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.
 
 
 

111199 lines
4.2 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.beta"
  8. // ...
  9. // computeService, err := compute.New(oauthHttpClient)
  10. package compute // import "google.golang.org/api/compute/v0.beta"
  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:beta"
  41. const apiName = "compute"
  42. const apiVersion = "beta"
  43. const basePath = "https://www.googleapis.com/compute/beta/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.HttpHealthChecks = NewHttpHealthChecksService(s)
  78. s.HttpsHealthChecks = NewHttpsHealthChecksService(s)
  79. s.Images = NewImagesService(s)
  80. s.InstanceGroupManagers = NewInstanceGroupManagersService(s)
  81. s.InstanceGroups = NewInstanceGroupsService(s)
  82. s.InstanceTemplates = NewInstanceTemplatesService(s)
  83. s.Instances = NewInstancesService(s)
  84. s.InterconnectAttachments = NewInterconnectAttachmentsService(s)
  85. s.InterconnectLocations = NewInterconnectLocationsService(s)
  86. s.Interconnects = NewInterconnectsService(s)
  87. s.LicenseCodes = NewLicenseCodesService(s)
  88. s.Licenses = NewLicensesService(s)
  89. s.MachineTypes = NewMachineTypesService(s)
  90. s.NetworkEndpointGroups = NewNetworkEndpointGroupsService(s)
  91. s.Networks = NewNetworksService(s)
  92. s.NodeGroups = NewNodeGroupsService(s)
  93. s.NodeTemplates = NewNodeTemplatesService(s)
  94. s.NodeTypes = NewNodeTypesService(s)
  95. s.Projects = NewProjectsService(s)
  96. s.RegionAutoscalers = NewRegionAutoscalersService(s)
  97. s.RegionBackendServices = NewRegionBackendServicesService(s)
  98. s.RegionCommitments = NewRegionCommitmentsService(s)
  99. s.RegionDiskTypes = NewRegionDiskTypesService(s)
  100. s.RegionDisks = NewRegionDisksService(s)
  101. s.RegionInstanceGroupManagers = NewRegionInstanceGroupManagersService(s)
  102. s.RegionInstanceGroups = NewRegionInstanceGroupsService(s)
  103. s.RegionOperations = NewRegionOperationsService(s)
  104. s.Regions = NewRegionsService(s)
  105. s.Routers = NewRoutersService(s)
  106. s.Routes = NewRoutesService(s)
  107. s.SecurityPolicies = NewSecurityPoliciesService(s)
  108. s.Snapshots = NewSnapshotsService(s)
  109. s.SslCertificates = NewSslCertificatesService(s)
  110. s.SslPolicies = NewSslPoliciesService(s)
  111. s.Subnetworks = NewSubnetworksService(s)
  112. s.TargetHttpProxies = NewTargetHttpProxiesService(s)
  113. s.TargetHttpsProxies = NewTargetHttpsProxiesService(s)
  114. s.TargetInstances = NewTargetInstancesService(s)
  115. s.TargetPools = NewTargetPoolsService(s)
  116. s.TargetSslProxies = NewTargetSslProxiesService(s)
  117. s.TargetTcpProxies = NewTargetTcpProxiesService(s)
  118. s.TargetVpnGateways = NewTargetVpnGatewaysService(s)
  119. s.UrlMaps = NewUrlMapsService(s)
  120. s.VpnTunnels = NewVpnTunnelsService(s)
  121. s.ZoneOperations = NewZoneOperationsService(s)
  122. s.Zones = NewZonesService(s)
  123. return s, nil
  124. }
  125. type Service struct {
  126. client *http.Client
  127. BasePath string // API endpoint base URL
  128. UserAgent string // optional additional User-Agent fragment
  129. AcceleratorTypes *AcceleratorTypesService
  130. Addresses *AddressesService
  131. Autoscalers *AutoscalersService
  132. BackendBuckets *BackendBucketsService
  133. BackendServices *BackendServicesService
  134. DiskTypes *DiskTypesService
  135. Disks *DisksService
  136. Firewalls *FirewallsService
  137. ForwardingRules *ForwardingRulesService
  138. GlobalAddresses *GlobalAddressesService
  139. GlobalForwardingRules *GlobalForwardingRulesService
  140. GlobalOperations *GlobalOperationsService
  141. HealthChecks *HealthChecksService
  142. HttpHealthChecks *HttpHealthChecksService
  143. HttpsHealthChecks *HttpsHealthChecksService
  144. Images *ImagesService
  145. InstanceGroupManagers *InstanceGroupManagersService
  146. InstanceGroups *InstanceGroupsService
  147. InstanceTemplates *InstanceTemplatesService
  148. Instances *InstancesService
  149. InterconnectAttachments *InterconnectAttachmentsService
  150. InterconnectLocations *InterconnectLocationsService
  151. Interconnects *InterconnectsService
  152. LicenseCodes *LicenseCodesService
  153. Licenses *LicensesService
  154. MachineTypes *MachineTypesService
  155. NetworkEndpointGroups *NetworkEndpointGroupsService
  156. Networks *NetworksService
  157. NodeGroups *NodeGroupsService
  158. NodeTemplates *NodeTemplatesService
  159. NodeTypes *NodeTypesService
  160. Projects *ProjectsService
  161. RegionAutoscalers *RegionAutoscalersService
  162. RegionBackendServices *RegionBackendServicesService
  163. RegionCommitments *RegionCommitmentsService
  164. RegionDiskTypes *RegionDiskTypesService
  165. RegionDisks *RegionDisksService
  166. RegionInstanceGroupManagers *RegionInstanceGroupManagersService
  167. RegionInstanceGroups *RegionInstanceGroupsService
  168. RegionOperations *RegionOperationsService
  169. Regions *RegionsService
  170. Routers *RoutersService
  171. Routes *RoutesService
  172. SecurityPolicies *SecurityPoliciesService
  173. Snapshots *SnapshotsService
  174. SslCertificates *SslCertificatesService
  175. SslPolicies *SslPoliciesService
  176. Subnetworks *SubnetworksService
  177. TargetHttpProxies *TargetHttpProxiesService
  178. TargetHttpsProxies *TargetHttpsProxiesService
  179. TargetInstances *TargetInstancesService
  180. TargetPools *TargetPoolsService
  181. TargetSslProxies *TargetSslProxiesService
  182. TargetTcpProxies *TargetTcpProxiesService
  183. TargetVpnGateways *TargetVpnGatewaysService
  184. UrlMaps *UrlMapsService
  185. VpnTunnels *VpnTunnelsService
  186. ZoneOperations *ZoneOperationsService
  187. Zones *ZonesService
  188. }
  189. func (s *Service) userAgent() string {
  190. if s.UserAgent == "" {
  191. return googleapi.UserAgent
  192. }
  193. return googleapi.UserAgent + " " + s.UserAgent
  194. }
  195. func NewAcceleratorTypesService(s *Service) *AcceleratorTypesService {
  196. rs := &AcceleratorTypesService{s: s}
  197. return rs
  198. }
  199. type AcceleratorTypesService struct {
  200. s *Service
  201. }
  202. func NewAddressesService(s *Service) *AddressesService {
  203. rs := &AddressesService{s: s}
  204. return rs
  205. }
  206. type AddressesService struct {
  207. s *Service
  208. }
  209. func NewAutoscalersService(s *Service) *AutoscalersService {
  210. rs := &AutoscalersService{s: s}
  211. return rs
  212. }
  213. type AutoscalersService struct {
  214. s *Service
  215. }
  216. func NewBackendBucketsService(s *Service) *BackendBucketsService {
  217. rs := &BackendBucketsService{s: s}
  218. return rs
  219. }
  220. type BackendBucketsService struct {
  221. s *Service
  222. }
  223. func NewBackendServicesService(s *Service) *BackendServicesService {
  224. rs := &BackendServicesService{s: s}
  225. return rs
  226. }
  227. type BackendServicesService struct {
  228. s *Service
  229. }
  230. func NewDiskTypesService(s *Service) *DiskTypesService {
  231. rs := &DiskTypesService{s: s}
  232. return rs
  233. }
  234. type DiskTypesService struct {
  235. s *Service
  236. }
  237. func NewDisksService(s *Service) *DisksService {
  238. rs := &DisksService{s: s}
  239. return rs
  240. }
  241. type DisksService struct {
  242. s *Service
  243. }
  244. func NewFirewallsService(s *Service) *FirewallsService {
  245. rs := &FirewallsService{s: s}
  246. return rs
  247. }
  248. type FirewallsService struct {
  249. s *Service
  250. }
  251. func NewForwardingRulesService(s *Service) *ForwardingRulesService {
  252. rs := &ForwardingRulesService{s: s}
  253. return rs
  254. }
  255. type ForwardingRulesService struct {
  256. s *Service
  257. }
  258. func NewGlobalAddressesService(s *Service) *GlobalAddressesService {
  259. rs := &GlobalAddressesService{s: s}
  260. return rs
  261. }
  262. type GlobalAddressesService struct {
  263. s *Service
  264. }
  265. func NewGlobalForwardingRulesService(s *Service) *GlobalForwardingRulesService {
  266. rs := &GlobalForwardingRulesService{s: s}
  267. return rs
  268. }
  269. type GlobalForwardingRulesService struct {
  270. s *Service
  271. }
  272. func NewGlobalOperationsService(s *Service) *GlobalOperationsService {
  273. rs := &GlobalOperationsService{s: s}
  274. return rs
  275. }
  276. type GlobalOperationsService struct {
  277. s *Service
  278. }
  279. func NewHealthChecksService(s *Service) *HealthChecksService {
  280. rs := &HealthChecksService{s: s}
  281. return rs
  282. }
  283. type HealthChecksService struct {
  284. s *Service
  285. }
  286. func NewHttpHealthChecksService(s *Service) *HttpHealthChecksService {
  287. rs := &HttpHealthChecksService{s: s}
  288. return rs
  289. }
  290. type HttpHealthChecksService struct {
  291. s *Service
  292. }
  293. func NewHttpsHealthChecksService(s *Service) *HttpsHealthChecksService {
  294. rs := &HttpsHealthChecksService{s: s}
  295. return rs
  296. }
  297. type HttpsHealthChecksService struct {
  298. s *Service
  299. }
  300. func NewImagesService(s *Service) *ImagesService {
  301. rs := &ImagesService{s: s}
  302. return rs
  303. }
  304. type ImagesService struct {
  305. s *Service
  306. }
  307. func NewInstanceGroupManagersService(s *Service) *InstanceGroupManagersService {
  308. rs := &InstanceGroupManagersService{s: s}
  309. return rs
  310. }
  311. type InstanceGroupManagersService struct {
  312. s *Service
  313. }
  314. func NewInstanceGroupsService(s *Service) *InstanceGroupsService {
  315. rs := &InstanceGroupsService{s: s}
  316. return rs
  317. }
  318. type InstanceGroupsService struct {
  319. s *Service
  320. }
  321. func NewInstanceTemplatesService(s *Service) *InstanceTemplatesService {
  322. rs := &InstanceTemplatesService{s: s}
  323. return rs
  324. }
  325. type InstanceTemplatesService struct {
  326. s *Service
  327. }
  328. func NewInstancesService(s *Service) *InstancesService {
  329. rs := &InstancesService{s: s}
  330. return rs
  331. }
  332. type InstancesService struct {
  333. s *Service
  334. }
  335. func NewInterconnectAttachmentsService(s *Service) *InterconnectAttachmentsService {
  336. rs := &InterconnectAttachmentsService{s: s}
  337. return rs
  338. }
  339. type InterconnectAttachmentsService struct {
  340. s *Service
  341. }
  342. func NewInterconnectLocationsService(s *Service) *InterconnectLocationsService {
  343. rs := &InterconnectLocationsService{s: s}
  344. return rs
  345. }
  346. type InterconnectLocationsService struct {
  347. s *Service
  348. }
  349. func NewInterconnectsService(s *Service) *InterconnectsService {
  350. rs := &InterconnectsService{s: s}
  351. return rs
  352. }
  353. type InterconnectsService struct {
  354. s *Service
  355. }
  356. func NewLicenseCodesService(s *Service) *LicenseCodesService {
  357. rs := &LicenseCodesService{s: s}
  358. return rs
  359. }
  360. type LicenseCodesService struct {
  361. s *Service
  362. }
  363. func NewLicensesService(s *Service) *LicensesService {
  364. rs := &LicensesService{s: s}
  365. return rs
  366. }
  367. type LicensesService struct {
  368. s *Service
  369. }
  370. func NewMachineTypesService(s *Service) *MachineTypesService {
  371. rs := &MachineTypesService{s: s}
  372. return rs
  373. }
  374. type MachineTypesService struct {
  375. s *Service
  376. }
  377. func NewNetworkEndpointGroupsService(s *Service) *NetworkEndpointGroupsService {
  378. rs := &NetworkEndpointGroupsService{s: s}
  379. return rs
  380. }
  381. type NetworkEndpointGroupsService struct {
  382. s *Service
  383. }
  384. func NewNetworksService(s *Service) *NetworksService {
  385. rs := &NetworksService{s: s}
  386. return rs
  387. }
  388. type NetworksService struct {
  389. s *Service
  390. }
  391. func NewNodeGroupsService(s *Service) *NodeGroupsService {
  392. rs := &NodeGroupsService{s: s}
  393. return rs
  394. }
  395. type NodeGroupsService struct {
  396. s *Service
  397. }
  398. func NewNodeTemplatesService(s *Service) *NodeTemplatesService {
  399. rs := &NodeTemplatesService{s: s}
  400. return rs
  401. }
  402. type NodeTemplatesService struct {
  403. s *Service
  404. }
  405. func NewNodeTypesService(s *Service) *NodeTypesService {
  406. rs := &NodeTypesService{s: s}
  407. return rs
  408. }
  409. type NodeTypesService struct {
  410. s *Service
  411. }
  412. func NewProjectsService(s *Service) *ProjectsService {
  413. rs := &ProjectsService{s: s}
  414. return rs
  415. }
  416. type ProjectsService struct {
  417. s *Service
  418. }
  419. func NewRegionAutoscalersService(s *Service) *RegionAutoscalersService {
  420. rs := &RegionAutoscalersService{s: s}
  421. return rs
  422. }
  423. type RegionAutoscalersService struct {
  424. s *Service
  425. }
  426. func NewRegionBackendServicesService(s *Service) *RegionBackendServicesService {
  427. rs := &RegionBackendServicesService{s: s}
  428. return rs
  429. }
  430. type RegionBackendServicesService struct {
  431. s *Service
  432. }
  433. func NewRegionCommitmentsService(s *Service) *RegionCommitmentsService {
  434. rs := &RegionCommitmentsService{s: s}
  435. return rs
  436. }
  437. type RegionCommitmentsService struct {
  438. s *Service
  439. }
  440. func NewRegionDiskTypesService(s *Service) *RegionDiskTypesService {
  441. rs := &RegionDiskTypesService{s: s}
  442. return rs
  443. }
  444. type RegionDiskTypesService struct {
  445. s *Service
  446. }
  447. func NewRegionDisksService(s *Service) *RegionDisksService {
  448. rs := &RegionDisksService{s: s}
  449. return rs
  450. }
  451. type RegionDisksService struct {
  452. s *Service
  453. }
  454. func NewRegionInstanceGroupManagersService(s *Service) *RegionInstanceGroupManagersService {
  455. rs := &RegionInstanceGroupManagersService{s: s}
  456. return rs
  457. }
  458. type RegionInstanceGroupManagersService struct {
  459. s *Service
  460. }
  461. func NewRegionInstanceGroupsService(s *Service) *RegionInstanceGroupsService {
  462. rs := &RegionInstanceGroupsService{s: s}
  463. return rs
  464. }
  465. type RegionInstanceGroupsService struct {
  466. s *Service
  467. }
  468. func NewRegionOperationsService(s *Service) *RegionOperationsService {
  469. rs := &RegionOperationsService{s: s}
  470. return rs
  471. }
  472. type RegionOperationsService struct {
  473. s *Service
  474. }
  475. func NewRegionsService(s *Service) *RegionsService {
  476. rs := &RegionsService{s: s}
  477. return rs
  478. }
  479. type RegionsService struct {
  480. s *Service
  481. }
  482. func NewRoutersService(s *Service) *RoutersService {
  483. rs := &RoutersService{s: s}
  484. return rs
  485. }
  486. type RoutersService struct {
  487. s *Service
  488. }
  489. func NewRoutesService(s *Service) *RoutesService {
  490. rs := &RoutesService{s: s}
  491. return rs
  492. }
  493. type RoutesService struct {
  494. s *Service
  495. }
  496. func NewSecurityPoliciesService(s *Service) *SecurityPoliciesService {
  497. rs := &SecurityPoliciesService{s: s}
  498. return rs
  499. }
  500. type SecurityPoliciesService struct {
  501. s *Service
  502. }
  503. func NewSnapshotsService(s *Service) *SnapshotsService {
  504. rs := &SnapshotsService{s: s}
  505. return rs
  506. }
  507. type SnapshotsService struct {
  508. s *Service
  509. }
  510. func NewSslCertificatesService(s *Service) *SslCertificatesService {
  511. rs := &SslCertificatesService{s: s}
  512. return rs
  513. }
  514. type SslCertificatesService struct {
  515. s *Service
  516. }
  517. func NewSslPoliciesService(s *Service) *SslPoliciesService {
  518. rs := &SslPoliciesService{s: s}
  519. return rs
  520. }
  521. type SslPoliciesService struct {
  522. s *Service
  523. }
  524. func NewSubnetworksService(s *Service) *SubnetworksService {
  525. rs := &SubnetworksService{s: s}
  526. return rs
  527. }
  528. type SubnetworksService struct {
  529. s *Service
  530. }
  531. func NewTargetHttpProxiesService(s *Service) *TargetHttpProxiesService {
  532. rs := &TargetHttpProxiesService{s: s}
  533. return rs
  534. }
  535. type TargetHttpProxiesService struct {
  536. s *Service
  537. }
  538. func NewTargetHttpsProxiesService(s *Service) *TargetHttpsProxiesService {
  539. rs := &TargetHttpsProxiesService{s: s}
  540. return rs
  541. }
  542. type TargetHttpsProxiesService struct {
  543. s *Service
  544. }
  545. func NewTargetInstancesService(s *Service) *TargetInstancesService {
  546. rs := &TargetInstancesService{s: s}
  547. return rs
  548. }
  549. type TargetInstancesService struct {
  550. s *Service
  551. }
  552. func NewTargetPoolsService(s *Service) *TargetPoolsService {
  553. rs := &TargetPoolsService{s: s}
  554. return rs
  555. }
  556. type TargetPoolsService struct {
  557. s *Service
  558. }
  559. func NewTargetSslProxiesService(s *Service) *TargetSslProxiesService {
  560. rs := &TargetSslProxiesService{s: s}
  561. return rs
  562. }
  563. type TargetSslProxiesService struct {
  564. s *Service
  565. }
  566. func NewTargetTcpProxiesService(s *Service) *TargetTcpProxiesService {
  567. rs := &TargetTcpProxiesService{s: s}
  568. return rs
  569. }
  570. type TargetTcpProxiesService struct {
  571. s *Service
  572. }
  573. func NewTargetVpnGatewaysService(s *Service) *TargetVpnGatewaysService {
  574. rs := &TargetVpnGatewaysService{s: s}
  575. return rs
  576. }
  577. type TargetVpnGatewaysService struct {
  578. s *Service
  579. }
  580. func NewUrlMapsService(s *Service) *UrlMapsService {
  581. rs := &UrlMapsService{s: s}
  582. return rs
  583. }
  584. type UrlMapsService struct {
  585. s *Service
  586. }
  587. func NewVpnTunnelsService(s *Service) *VpnTunnelsService {
  588. rs := &VpnTunnelsService{s: s}
  589. return rs
  590. }
  591. type VpnTunnelsService struct {
  592. s *Service
  593. }
  594. func NewZoneOperationsService(s *Service) *ZoneOperationsService {
  595. rs := &ZoneOperationsService{s: s}
  596. return rs
  597. }
  598. type ZoneOperationsService struct {
  599. s *Service
  600. }
  601. func NewZonesService(s *Service) *ZonesService {
  602. rs := &ZonesService{s: s}
  603. return rs
  604. }
  605. type ZonesService struct {
  606. s *Service
  607. }
  608. // AcceleratorConfig: A specification of the type and number of
  609. // accelerator cards attached to the instance.
  610. type AcceleratorConfig struct {
  611. // AcceleratorCount: The number of the guest accelerator cards exposed
  612. // to this instance.
  613. AcceleratorCount int64 `json:"acceleratorCount,omitempty"`
  614. // AcceleratorType: Full or partial URL of the accelerator type resource
  615. // to attach to this instance. If you are creating an instance template,
  616. // specify only the accelerator name.
  617. AcceleratorType string `json:"acceleratorType,omitempty"`
  618. // ForceSendFields is a list of field names (e.g. "AcceleratorCount") to
  619. // unconditionally include in API requests. By default, fields with
  620. // empty values are omitted from API requests. However, any non-pointer,
  621. // non-interface field appearing in ForceSendFields will be sent to the
  622. // server regardless of whether the field is empty or not. This may be
  623. // used to include empty fields in Patch requests.
  624. ForceSendFields []string `json:"-"`
  625. // NullFields is a list of field names (e.g. "AcceleratorCount") to
  626. // include in API requests with the JSON null value. By default, fields
  627. // with empty values are omitted from API requests. However, any field
  628. // with an empty value appearing in NullFields will be sent to the
  629. // server as null. It is an error if a field in this list has a
  630. // non-empty value. This may be used to include null fields in Patch
  631. // requests.
  632. NullFields []string `json:"-"`
  633. }
  634. func (s *AcceleratorConfig) MarshalJSON() ([]byte, error) {
  635. type NoMethod AcceleratorConfig
  636. raw := NoMethod(*s)
  637. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  638. }
  639. // AcceleratorType: An Accelerator Type resource. (== resource_for
  640. // beta.acceleratorTypes ==) (== resource_for v1.acceleratorTypes ==)
  641. type AcceleratorType struct {
  642. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  643. // format.
  644. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  645. // Deprecated: [Output Only] The deprecation status associated with this
  646. // accelerator type.
  647. Deprecated *DeprecationStatus `json:"deprecated,omitempty"`
  648. // Description: [Output Only] An optional textual description of the
  649. // resource.
  650. Description string `json:"description,omitempty"`
  651. // Id: [Output Only] The unique identifier for the resource. This
  652. // identifier is defined by the server.
  653. Id uint64 `json:"id,omitempty,string"`
  654. // Kind: [Output Only] The type of the resource. Always
  655. // compute#acceleratorType for accelerator types.
  656. Kind string `json:"kind,omitempty"`
  657. // MaximumCardsPerInstance: [Output Only] Maximum accelerator cards
  658. // allowed per instance.
  659. MaximumCardsPerInstance int64 `json:"maximumCardsPerInstance,omitempty"`
  660. // Name: [Output Only] Name of the resource.
  661. Name string `json:"name,omitempty"`
  662. // SelfLink: [Output Only] Server-defined fully-qualified URL for this
  663. // resource.
  664. SelfLink string `json:"selfLink,omitempty"`
  665. // Zone: [Output Only] The name of the zone where the accelerator type
  666. // resides, such as us-central1-a. You must specify this field as part
  667. // of the HTTP request URL. It is not settable as a field in the request
  668. // body.
  669. Zone string `json:"zone,omitempty"`
  670. // ServerResponse contains the HTTP response code and headers from the
  671. // server.
  672. googleapi.ServerResponse `json:"-"`
  673. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  674. // to unconditionally include in API requests. By default, fields with
  675. // empty values are omitted from API requests. However, any non-pointer,
  676. // non-interface field appearing in ForceSendFields will be sent to the
  677. // server regardless of whether the field is empty or not. This may be
  678. // used to include empty fields in Patch requests.
  679. ForceSendFields []string `json:"-"`
  680. // NullFields is a list of field names (e.g. "CreationTimestamp") to
  681. // include in API requests with the JSON null value. By default, fields
  682. // with empty values are omitted from API requests. However, any field
  683. // with an empty value appearing in NullFields will be sent to the
  684. // server as null. It is an error if a field in this list has a
  685. // non-empty value. This may be used to include null fields in Patch
  686. // requests.
  687. NullFields []string `json:"-"`
  688. }
  689. func (s *AcceleratorType) MarshalJSON() ([]byte, error) {
  690. type NoMethod AcceleratorType
  691. raw := NoMethod(*s)
  692. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  693. }
  694. type AcceleratorTypeAggregatedList struct {
  695. // Id: [Output Only] Unique identifier for the resource; defined by the
  696. // server.
  697. Id string `json:"id,omitempty"`
  698. // Items: A list of AcceleratorTypesScopedList resources.
  699. Items map[string]AcceleratorTypesScopedList `json:"items,omitempty"`
  700. // Kind: [Output Only] Type of resource. Always
  701. // compute#acceleratorTypeAggregatedList for aggregated lists of
  702. // accelerator types.
  703. Kind string `json:"kind,omitempty"`
  704. // NextPageToken: [Output Only] This token allows you to get the next
  705. // page of results for list requests. If the number of results is larger
  706. // than maxResults, use the nextPageToken as a value for the query
  707. // parameter pageToken in the next list request. Subsequent list
  708. // requests will have their own nextPageToken to continue paging through
  709. // the results.
  710. NextPageToken string `json:"nextPageToken,omitempty"`
  711. // SelfLink: [Output Only] Server-defined URL for this resource.
  712. SelfLink string `json:"selfLink,omitempty"`
  713. // Warning: [Output Only] Informational warning message.
  714. Warning *AcceleratorTypeAggregatedListWarning `json:"warning,omitempty"`
  715. // ServerResponse contains the HTTP response code and headers from the
  716. // server.
  717. googleapi.ServerResponse `json:"-"`
  718. // ForceSendFields is a list of field names (e.g. "Id") to
  719. // unconditionally include in API requests. By default, fields with
  720. // empty values are omitted from API requests. However, any non-pointer,
  721. // non-interface field appearing in ForceSendFields will be sent to the
  722. // server regardless of whether the field is empty or not. This may be
  723. // used to include empty fields in Patch requests.
  724. ForceSendFields []string `json:"-"`
  725. // NullFields is a list of field names (e.g. "Id") to include in API
  726. // requests with the JSON null value. By default, fields with empty
  727. // values are omitted from API requests. However, any field with an
  728. // empty value appearing in NullFields will be sent to the server as
  729. // null. It is an error if a field in this list has a non-empty value.
  730. // This may be used to include null fields in Patch requests.
  731. NullFields []string `json:"-"`
  732. }
  733. func (s *AcceleratorTypeAggregatedList) MarshalJSON() ([]byte, error) {
  734. type NoMethod AcceleratorTypeAggregatedList
  735. raw := NoMethod(*s)
  736. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  737. }
  738. // AcceleratorTypeAggregatedListWarning: [Output Only] Informational
  739. // warning message.
  740. type AcceleratorTypeAggregatedListWarning struct {
  741. // Code: [Output Only] A warning code, if applicable. For example,
  742. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  743. // the response.
  744. //
  745. // Possible values:
  746. // "CLEANUP_FAILED"
  747. // "DEPRECATED_RESOURCE_USED"
  748. // "DEPRECATED_TYPE_USED"
  749. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  750. // "EXPERIMENTAL_TYPE_USED"
  751. // "EXTERNAL_API_WARNING"
  752. // "FIELD_VALUE_OVERRIDEN"
  753. // "INJECTED_KERNELS_DEPRECATED"
  754. // "MISSING_TYPE_DEPENDENCY"
  755. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  756. // "NEXT_HOP_CANNOT_IP_FORWARD"
  757. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  758. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  759. // "NEXT_HOP_NOT_RUNNING"
  760. // "NOT_CRITICAL_ERROR"
  761. // "NO_RESULTS_ON_PAGE"
  762. // "REQUIRED_TOS_AGREEMENT"
  763. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  764. // "RESOURCE_NOT_DELETED"
  765. // "SCHEMA_VALIDATION_IGNORED"
  766. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  767. // "UNDECLARED_PROPERTIES"
  768. // "UNREACHABLE"
  769. Code string `json:"code,omitempty"`
  770. // Data: [Output Only] Metadata about this warning in key: value format.
  771. // For example:
  772. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  773. Data []*AcceleratorTypeAggregatedListWarningData `json:"data,omitempty"`
  774. // Message: [Output Only] A human-readable description of the warning
  775. // code.
  776. Message string `json:"message,omitempty"`
  777. // ForceSendFields is a list of field names (e.g. "Code") to
  778. // unconditionally include in API requests. By default, fields with
  779. // empty values are omitted from API requests. However, any non-pointer,
  780. // non-interface field appearing in ForceSendFields will be sent to the
  781. // server regardless of whether the field is empty or not. This may be
  782. // used to include empty fields in Patch requests.
  783. ForceSendFields []string `json:"-"`
  784. // NullFields is a list of field names (e.g. "Code") to include in API
  785. // requests with the JSON null value. By default, fields with empty
  786. // values are omitted from API requests. However, any field with an
  787. // empty value appearing in NullFields will be sent to the server as
  788. // null. It is an error if a field in this list has a non-empty value.
  789. // This may be used to include null fields in Patch requests.
  790. NullFields []string `json:"-"`
  791. }
  792. func (s *AcceleratorTypeAggregatedListWarning) MarshalJSON() ([]byte, error) {
  793. type NoMethod AcceleratorTypeAggregatedListWarning
  794. raw := NoMethod(*s)
  795. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  796. }
  797. type AcceleratorTypeAggregatedListWarningData struct {
  798. // Key: [Output Only] A key that provides more detail on the warning
  799. // being returned. For example, for warnings where there are no results
  800. // in a list request for a particular zone, this key might be scope and
  801. // the key value might be the zone name. Other examples might be a key
  802. // indicating a deprecated resource and a suggested replacement, or a
  803. // warning about invalid network settings (for example, if an instance
  804. // attempts to perform IP forwarding but is not enabled for IP
  805. // forwarding).
  806. Key string `json:"key,omitempty"`
  807. // Value: [Output Only] A warning data value corresponding to the key.
  808. Value string `json:"value,omitempty"`
  809. // ForceSendFields is a list of field names (e.g. "Key") to
  810. // unconditionally include in API requests. By default, fields with
  811. // empty values are omitted from API requests. However, any non-pointer,
  812. // non-interface field appearing in ForceSendFields will be sent to the
  813. // server regardless of whether the field is empty or not. This may be
  814. // used to include empty fields in Patch requests.
  815. ForceSendFields []string `json:"-"`
  816. // NullFields is a list of field names (e.g. "Key") to include in API
  817. // requests with the JSON null value. By default, fields with empty
  818. // values are omitted from API requests. However, any field with an
  819. // empty value appearing in NullFields will be sent to the server as
  820. // null. It is an error if a field in this list has a non-empty value.
  821. // This may be used to include null fields in Patch requests.
  822. NullFields []string `json:"-"`
  823. }
  824. func (s *AcceleratorTypeAggregatedListWarningData) MarshalJSON() ([]byte, error) {
  825. type NoMethod AcceleratorTypeAggregatedListWarningData
  826. raw := NoMethod(*s)
  827. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  828. }
  829. // AcceleratorTypeList: Contains a list of accelerator types.
  830. type AcceleratorTypeList struct {
  831. // Id: [Output Only] Unique identifier for the resource; defined by the
  832. // server.
  833. Id string `json:"id,omitempty"`
  834. // Items: A list of AcceleratorType resources.
  835. Items []*AcceleratorType `json:"items,omitempty"`
  836. // Kind: [Output Only] Type of resource. Always
  837. // compute#acceleratorTypeList for lists of accelerator types.
  838. Kind string `json:"kind,omitempty"`
  839. // NextPageToken: [Output Only] This token allows you to get the next
  840. // page of results for list requests. If the number of results is larger
  841. // than maxResults, use the nextPageToken as a value for the query
  842. // parameter pageToken in the next list request. Subsequent list
  843. // requests will have their own nextPageToken to continue paging through
  844. // the results.
  845. NextPageToken string `json:"nextPageToken,omitempty"`
  846. // SelfLink: [Output Only] Server-defined URL for this resource.
  847. SelfLink string `json:"selfLink,omitempty"`
  848. // Warning: [Output Only] Informational warning message.
  849. Warning *AcceleratorTypeListWarning `json:"warning,omitempty"`
  850. // ServerResponse contains the HTTP response code and headers from the
  851. // server.
  852. googleapi.ServerResponse `json:"-"`
  853. // ForceSendFields is a list of field names (e.g. "Id") to
  854. // unconditionally include in API requests. By default, fields with
  855. // empty values are omitted from API requests. However, any non-pointer,
  856. // non-interface field appearing in ForceSendFields will be sent to the
  857. // server regardless of whether the field is empty or not. This may be
  858. // used to include empty fields in Patch requests.
  859. ForceSendFields []string `json:"-"`
  860. // NullFields is a list of field names (e.g. "Id") to include in API
  861. // requests with the JSON null value. By default, fields with empty
  862. // values are omitted from API requests. However, any field with an
  863. // empty value appearing in NullFields will be sent to the server as
  864. // null. It is an error if a field in this list has a non-empty value.
  865. // This may be used to include null fields in Patch requests.
  866. NullFields []string `json:"-"`
  867. }
  868. func (s *AcceleratorTypeList) MarshalJSON() ([]byte, error) {
  869. type NoMethod AcceleratorTypeList
  870. raw := NoMethod(*s)
  871. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  872. }
  873. // AcceleratorTypeListWarning: [Output Only] Informational warning
  874. // message.
  875. type AcceleratorTypeListWarning struct {
  876. // Code: [Output Only] A warning code, if applicable. For example,
  877. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  878. // the response.
  879. //
  880. // Possible values:
  881. // "CLEANUP_FAILED"
  882. // "DEPRECATED_RESOURCE_USED"
  883. // "DEPRECATED_TYPE_USED"
  884. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  885. // "EXPERIMENTAL_TYPE_USED"
  886. // "EXTERNAL_API_WARNING"
  887. // "FIELD_VALUE_OVERRIDEN"
  888. // "INJECTED_KERNELS_DEPRECATED"
  889. // "MISSING_TYPE_DEPENDENCY"
  890. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  891. // "NEXT_HOP_CANNOT_IP_FORWARD"
  892. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  893. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  894. // "NEXT_HOP_NOT_RUNNING"
  895. // "NOT_CRITICAL_ERROR"
  896. // "NO_RESULTS_ON_PAGE"
  897. // "REQUIRED_TOS_AGREEMENT"
  898. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  899. // "RESOURCE_NOT_DELETED"
  900. // "SCHEMA_VALIDATION_IGNORED"
  901. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  902. // "UNDECLARED_PROPERTIES"
  903. // "UNREACHABLE"
  904. Code string `json:"code,omitempty"`
  905. // Data: [Output Only] Metadata about this warning in key: value format.
  906. // For example:
  907. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  908. Data []*AcceleratorTypeListWarningData `json:"data,omitempty"`
  909. // Message: [Output Only] A human-readable description of the warning
  910. // code.
  911. Message string `json:"message,omitempty"`
  912. // ForceSendFields is a list of field names (e.g. "Code") to
  913. // unconditionally include in API requests. By default, fields with
  914. // empty values are omitted from API requests. However, any non-pointer,
  915. // non-interface field appearing in ForceSendFields will be sent to the
  916. // server regardless of whether the field is empty or not. This may be
  917. // used to include empty fields in Patch requests.
  918. ForceSendFields []string `json:"-"`
  919. // NullFields is a list of field names (e.g. "Code") to include in API
  920. // requests with the JSON null value. By default, fields with empty
  921. // values are omitted from API requests. However, any field with an
  922. // empty value appearing in NullFields will be sent to the server as
  923. // null. It is an error if a field in this list has a non-empty value.
  924. // This may be used to include null fields in Patch requests.
  925. NullFields []string `json:"-"`
  926. }
  927. func (s *AcceleratorTypeListWarning) MarshalJSON() ([]byte, error) {
  928. type NoMethod AcceleratorTypeListWarning
  929. raw := NoMethod(*s)
  930. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  931. }
  932. type AcceleratorTypeListWarningData struct {
  933. // Key: [Output Only] A key that provides more detail on the warning
  934. // being returned. For example, for warnings where there are no results
  935. // in a list request for a particular zone, this key might be scope and
  936. // the key value might be the zone name. Other examples might be a key
  937. // indicating a deprecated resource and a suggested replacement, or a
  938. // warning about invalid network settings (for example, if an instance
  939. // attempts to perform IP forwarding but is not enabled for IP
  940. // forwarding).
  941. Key string `json:"key,omitempty"`
  942. // Value: [Output Only] A warning data value corresponding to the key.
  943. Value string `json:"value,omitempty"`
  944. // ForceSendFields is a list of field names (e.g. "Key") to
  945. // unconditionally include in API requests. By default, fields with
  946. // empty values are omitted from API requests. However, any non-pointer,
  947. // non-interface field appearing in ForceSendFields will be sent to the
  948. // server regardless of whether the field is empty or not. This may be
  949. // used to include empty fields in Patch requests.
  950. ForceSendFields []string `json:"-"`
  951. // NullFields is a list of field names (e.g. "Key") to include in API
  952. // requests with the JSON null value. By default, fields with empty
  953. // values are omitted from API requests. However, any field with an
  954. // empty value appearing in NullFields will be sent to the server as
  955. // null. It is an error if a field in this list has a non-empty value.
  956. // This may be used to include null fields in Patch requests.
  957. NullFields []string `json:"-"`
  958. }
  959. func (s *AcceleratorTypeListWarningData) MarshalJSON() ([]byte, error) {
  960. type NoMethod AcceleratorTypeListWarningData
  961. raw := NoMethod(*s)
  962. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  963. }
  964. type AcceleratorTypesScopedList struct {
  965. // AcceleratorTypes: [Output Only] A list of accelerator types contained
  966. // in this scope.
  967. AcceleratorTypes []*AcceleratorType `json:"acceleratorTypes,omitempty"`
  968. // Warning: [Output Only] An informational warning that appears when the
  969. // accelerator types list is empty.
  970. Warning *AcceleratorTypesScopedListWarning `json:"warning,omitempty"`
  971. // ForceSendFields is a list of field names (e.g. "AcceleratorTypes") to
  972. // unconditionally include in API requests. By default, fields with
  973. // empty values are omitted from API requests. However, any non-pointer,
  974. // non-interface field appearing in ForceSendFields will be sent to the
  975. // server regardless of whether the field is empty or not. This may be
  976. // used to include empty fields in Patch requests.
  977. ForceSendFields []string `json:"-"`
  978. // NullFields is a list of field names (e.g. "AcceleratorTypes") to
  979. // include in API requests with the JSON null value. By default, fields
  980. // with empty values are omitted from API requests. However, any field
  981. // with an empty value appearing in NullFields will be sent to the
  982. // server as null. It is an error if a field in this list has a
  983. // non-empty value. This may be used to include null fields in Patch
  984. // requests.
  985. NullFields []string `json:"-"`
  986. }
  987. func (s *AcceleratorTypesScopedList) MarshalJSON() ([]byte, error) {
  988. type NoMethod AcceleratorTypesScopedList
  989. raw := NoMethod(*s)
  990. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  991. }
  992. // AcceleratorTypesScopedListWarning: [Output Only] An informational
  993. // warning that appears when the accelerator types list is empty.
  994. type AcceleratorTypesScopedListWarning struct {
  995. // Code: [Output Only] A warning code, if applicable. For example,
  996. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  997. // the response.
  998. //
  999. // Possible values:
  1000. // "CLEANUP_FAILED"
  1001. // "DEPRECATED_RESOURCE_USED"
  1002. // "DEPRECATED_TYPE_USED"
  1003. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  1004. // "EXPERIMENTAL_TYPE_USED"
  1005. // "EXTERNAL_API_WARNING"
  1006. // "FIELD_VALUE_OVERRIDEN"
  1007. // "INJECTED_KERNELS_DEPRECATED"
  1008. // "MISSING_TYPE_DEPENDENCY"
  1009. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  1010. // "NEXT_HOP_CANNOT_IP_FORWARD"
  1011. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  1012. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  1013. // "NEXT_HOP_NOT_RUNNING"
  1014. // "NOT_CRITICAL_ERROR"
  1015. // "NO_RESULTS_ON_PAGE"
  1016. // "REQUIRED_TOS_AGREEMENT"
  1017. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  1018. // "RESOURCE_NOT_DELETED"
  1019. // "SCHEMA_VALIDATION_IGNORED"
  1020. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  1021. // "UNDECLARED_PROPERTIES"
  1022. // "UNREACHABLE"
  1023. Code string `json:"code,omitempty"`
  1024. // Data: [Output Only] Metadata about this warning in key: value format.
  1025. // For example:
  1026. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  1027. Data []*AcceleratorTypesScopedListWarningData `json:"data,omitempty"`
  1028. // Message: [Output Only] A human-readable description of the warning
  1029. // code.
  1030. Message string `json:"message,omitempty"`
  1031. // ForceSendFields is a list of field names (e.g. "Code") to
  1032. // unconditionally include in API requests. By default, fields with
  1033. // empty values are omitted from API requests. However, any non-pointer,
  1034. // non-interface field appearing in ForceSendFields will be sent to the
  1035. // server regardless of whether the field is empty or not. This may be
  1036. // used to include empty fields in Patch requests.
  1037. ForceSendFields []string `json:"-"`
  1038. // NullFields is a list of field names (e.g. "Code") to include in API
  1039. // requests with the JSON null value. By default, fields with empty
  1040. // values are omitted from API requests. However, any field with an
  1041. // empty value appearing in NullFields will be sent to the server as
  1042. // null. It is an error if a field in this list has a non-empty value.
  1043. // This may be used to include null fields in Patch requests.
  1044. NullFields []string `json:"-"`
  1045. }
  1046. func (s *AcceleratorTypesScopedListWarning) MarshalJSON() ([]byte, error) {
  1047. type NoMethod AcceleratorTypesScopedListWarning
  1048. raw := NoMethod(*s)
  1049. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1050. }
  1051. type AcceleratorTypesScopedListWarningData struct {
  1052. // Key: [Output Only] A key that provides more detail on the warning
  1053. // being returned. For example, for warnings where there are no results
  1054. // in a list request for a particular zone, this key might be scope and
  1055. // the key value might be the zone name. Other examples might be a key
  1056. // indicating a deprecated resource and a suggested replacement, or a
  1057. // warning about invalid network settings (for example, if an instance
  1058. // attempts to perform IP forwarding but is not enabled for IP
  1059. // forwarding).
  1060. Key string `json:"key,omitempty"`
  1061. // Value: [Output Only] A warning data value corresponding to the key.
  1062. Value string `json:"value,omitempty"`
  1063. // ForceSendFields is a list of field names (e.g. "Key") to
  1064. // unconditionally include in API requests. By default, fields with
  1065. // empty values are omitted from API requests. However, any non-pointer,
  1066. // non-interface field appearing in ForceSendFields will be sent to the
  1067. // server regardless of whether the field is empty or not. This may be
  1068. // used to include empty fields in Patch requests.
  1069. ForceSendFields []string `json:"-"`
  1070. // NullFields is a list of field names (e.g. "Key") to include in API
  1071. // requests with the JSON null value. By default, fields with empty
  1072. // values are omitted from API requests. However, any field with an
  1073. // empty value appearing in NullFields will be sent to the server as
  1074. // null. It is an error if a field in this list has a non-empty value.
  1075. // This may be used to include null fields in Patch requests.
  1076. NullFields []string `json:"-"`
  1077. }
  1078. func (s *AcceleratorTypesScopedListWarningData) MarshalJSON() ([]byte, error) {
  1079. type NoMethod AcceleratorTypesScopedListWarningData
  1080. raw := NoMethod(*s)
  1081. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1082. }
  1083. // AccessConfig: An access configuration attached to an instance's
  1084. // network interface. Only one access config per instance is supported.
  1085. type AccessConfig struct {
  1086. // Kind: [Output Only] Type of the resource. Always compute#accessConfig
  1087. // for access configs.
  1088. Kind string `json:"kind,omitempty"`
  1089. // Name: The name of this access configuration. The default and
  1090. // recommended name is External NAT but you can use any arbitrary string
  1091. // you would like. For example, My external IP or Network Access.
  1092. Name string `json:"name,omitempty"`
  1093. // NatIP: An external IP address associated with this instance. Specify
  1094. // an unused static external IP address available to the project or
  1095. // leave this field undefined to use an IP from a shared ephemeral IP
  1096. // address pool. If you specify a static external IP address, it must
  1097. // live in the same region as the zone of the instance.
  1098. NatIP string `json:"natIP,omitempty"`
  1099. // NetworkTier: This signifies the networking tier used for configuring
  1100. // this access configuration and can only take the following values:
  1101. // PREMIUM, STANDARD.
  1102. //
  1103. // If an AccessConfig is specified without a valid external IP address,
  1104. // an ephemeral IP will be created with this networkTier.
  1105. //
  1106. // If an AccessConfig with a valid external IP address is specified, it
  1107. // must match that of the networkTier associated with the Address
  1108. // resource owning that IP.
  1109. //
  1110. // Possible values:
  1111. // "PREMIUM"
  1112. // "STANDARD"
  1113. NetworkTier string `json:"networkTier,omitempty"`
  1114. // PublicPtrDomainName: The DNS domain name for the public PTR record.
  1115. // This field can only be set when the set_public_ptr field is enabled.
  1116. PublicPtrDomainName string `json:"publicPtrDomainName,omitempty"`
  1117. // SetPublicPtr: Specifies whether a public DNS ?PTR? record should be
  1118. // created to map the external IP address of the instance to a DNS
  1119. // domain name.
  1120. SetPublicPtr bool `json:"setPublicPtr,omitempty"`
  1121. // Type: The type of configuration. The default and only option is
  1122. // ONE_TO_ONE_NAT.
  1123. //
  1124. // Possible values:
  1125. // "ONE_TO_ONE_NAT" (default)
  1126. Type string `json:"type,omitempty"`
  1127. // ForceSendFields is a list of field names (e.g. "Kind") to
  1128. // unconditionally include in API requests. By default, fields with
  1129. // empty values are omitted from API requests. However, any non-pointer,
  1130. // non-interface field appearing in ForceSendFields will be sent to the
  1131. // server regardless of whether the field is empty or not. This may be
  1132. // used to include empty fields in Patch requests.
  1133. ForceSendFields []string `json:"-"`
  1134. // NullFields is a list of field names (e.g. "Kind") to include in API
  1135. // requests with the JSON null value. By default, fields with empty
  1136. // values are omitted from API requests. However, any field with an
  1137. // empty value appearing in NullFields will be sent to the server as
  1138. // null. It is an error if a field in this list has a non-empty value.
  1139. // This may be used to include null fields in Patch requests.
  1140. NullFields []string `json:"-"`
  1141. }
  1142. func (s *AccessConfig) MarshalJSON() ([]byte, error) {
  1143. type NoMethod AccessConfig
  1144. raw := NoMethod(*s)
  1145. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1146. }
  1147. // Address: A reserved address resource. (== resource_for beta.addresses
  1148. // ==) (== resource_for v1.addresses ==) (== resource_for
  1149. // beta.globalAddresses ==) (== resource_for v1.globalAddresses ==)
  1150. type Address struct {
  1151. // Address: The static IP address represented by this resource.
  1152. Address string `json:"address,omitempty"`
  1153. // AddressType: The type of address to reserve, either INTERNAL or
  1154. // EXTERNAL. If unspecified, defaults to EXTERNAL.
  1155. //
  1156. // Possible values:
  1157. // "EXTERNAL"
  1158. // "INTERNAL"
  1159. // "UNSPECIFIED_TYPE"
  1160. AddressType string `json:"addressType,omitempty"`
  1161. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  1162. // format.
  1163. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  1164. // Description: An optional description of this resource. Provide this
  1165. // property when you create the resource.
  1166. Description string `json:"description,omitempty"`
  1167. // Id: [Output Only] The unique identifier for the resource. This
  1168. // identifier is defined by the server.
  1169. Id uint64 `json:"id,omitempty,string"`
  1170. // IpVersion: The IP Version that will be used by this address. Valid
  1171. // options are IPV4 or IPV6. This can only be specified for a global
  1172. // address.
  1173. //
  1174. // Possible values:
  1175. // "IPV4"
  1176. // "IPV6"
  1177. // "UNSPECIFIED_VERSION"
  1178. IpVersion string `json:"ipVersion,omitempty"`
  1179. // Kind: [Output Only] Type of the resource. Always compute#address for
  1180. // addresses.
  1181. Kind string `json:"kind,omitempty"`
  1182. // LabelFingerprint: A fingerprint for the labels being applied to this
  1183. // Address, which is essentially a hash of the labels set used for
  1184. // optimistic locking. The fingerprint is initially generated by Compute
  1185. // Engine and changes after every request to modify or update labels.
  1186. // You must always provide an up-to-date fingerprint hash in order to
  1187. // update or change labels.
  1188. //
  1189. // To see the latest fingerprint, make a get() request to retrieve an
  1190. // Address.
  1191. LabelFingerprint string `json:"labelFingerprint,omitempty"`
  1192. // Labels: Labels to apply to this Address resource. These can be later
  1193. // modified by the setLabels method. Each label key/value must comply
  1194. // with RFC1035. Label values may be empty.
  1195. Labels map[string]string `json:"labels,omitempty"`
  1196. // Name: Name of the resource. Provided by the client when the resource
  1197. // is created. The name must be 1-63 characters long, and comply with
  1198. // RFC1035. Specifically, the name must be 1-63 characters long and
  1199. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  1200. // the first character must be a lowercase letter, and all following
  1201. // characters must be a dash, lowercase letter, or digit, except the
  1202. // last character, which cannot be a dash.
  1203. Name string `json:"name,omitempty"`
  1204. // Network: The URL of the network in which to reserve the address. This
  1205. // field can only be used with INTERNAL type with VPC_PEERING purpose.
  1206. Network string `json:"network,omitempty"`
  1207. // NetworkTier: This signifies the networking tier used for configuring
  1208. // this Address and can only take the following values: PREMIUM ,
  1209. // STANDARD.
  1210. //
  1211. // If this field is not specified, it is assumed to be PREMIUM.
  1212. //
  1213. // Possible values:
  1214. // "PREMIUM"
  1215. // "STANDARD"
  1216. NetworkTier string `json:"networkTier,omitempty"`
  1217. // PrefixLength: The prefix length if the resource reprensents an IP
  1218. // range.
  1219. PrefixLength int64 `json:"prefixLength,omitempty"`
  1220. // Purpose: The purpose of resource, only used with INTERNAL type.
  1221. //
  1222. // Possible values:
  1223. // "DNS_RESOLVER"
  1224. // "GCE_ENDPOINT"
  1225. // "UNSPECIFIED_PURPOSE"
  1226. // "VPC_PEERING"
  1227. Purpose string `json:"purpose,omitempty"`
  1228. // Region: [Output Only] URL of the region where the regional address
  1229. // resides. This field is not applicable to global addresses. You must
  1230. // specify this field as part of the HTTP request URL. You cannot set
  1231. // this field in the request body.
  1232. Region string `json:"region,omitempty"`
  1233. // SelfLink: [Output Only] Server-defined URL for the resource.
  1234. SelfLink string `json:"selfLink,omitempty"`
  1235. // Status: [Output Only] The status of the address, which can be one of
  1236. // RESERVING, RESERVED, or IN_USE. An address that is RESERVING is
  1237. // currently in the process of being reserved. A RESERVED address is
  1238. // currently reserved and available to use. An IN_USE address is
  1239. // currently being used by another resource and is not available.
  1240. //
  1241. // Possible values:
  1242. // "IN_USE"
  1243. // "RESERVED"
  1244. // "RESERVING"
  1245. Status string `json:"status,omitempty"`
  1246. // Subnetwork: The URL of the subnetwork in which to reserve the
  1247. // address. If an IP address is specified, it must be within the
  1248. // subnetwork's IP range. This field can only be used with INTERNAL type
  1249. // with GCE_ENDPOINT/DNS_RESOLVER purposes.
  1250. Subnetwork string `json:"subnetwork,omitempty"`
  1251. // Users: [Output Only] The URLs of the resources that are using this
  1252. // address.
  1253. Users []string `json:"users,omitempty"`
  1254. // ServerResponse contains the HTTP response code and headers from the
  1255. // server.
  1256. googleapi.ServerResponse `json:"-"`
  1257. // ForceSendFields is a list of field names (e.g. "Address") to
  1258. // unconditionally include in API requests. By default, fields with
  1259. // empty values are omitted from API requests. However, any non-pointer,
  1260. // non-interface field appearing in ForceSendFields will be sent to the
  1261. // server regardless of whether the field is empty or not. This may be
  1262. // used to include empty fields in Patch requests.
  1263. ForceSendFields []string `json:"-"`
  1264. // NullFields is a list of field names (e.g. "Address") to include in
  1265. // API requests with the JSON null value. By default, fields with empty
  1266. // values are omitted from API requests. However, any field with an
  1267. // empty value appearing in NullFields will be sent to the server as
  1268. // null. It is an error if a field in this list has a non-empty value.
  1269. // This may be used to include null fields in Patch requests.
  1270. NullFields []string `json:"-"`
  1271. }
  1272. func (s *Address) MarshalJSON() ([]byte, error) {
  1273. type NoMethod Address
  1274. raw := NoMethod(*s)
  1275. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1276. }
  1277. type AddressAggregatedList struct {
  1278. // Id: [Output Only] Unique identifier for the resource; defined by the
  1279. // server.
  1280. Id string `json:"id,omitempty"`
  1281. // Items: A list of AddressesScopedList resources.
  1282. Items map[string]AddressesScopedList `json:"items,omitempty"`
  1283. // Kind: [Output Only] Type of resource. Always
  1284. // compute#addressAggregatedList for aggregated lists of addresses.
  1285. Kind string `json:"kind,omitempty"`
  1286. // NextPageToken: [Output Only] This token allows you to get the next
  1287. // page of results for list requests. If the number of results is larger
  1288. // than maxResults, use the nextPageToken as a value for the query
  1289. // parameter pageToken in the next list request. Subsequent list
  1290. // requests will have their own nextPageToken to continue paging through
  1291. // the results.
  1292. NextPageToken string `json:"nextPageToken,omitempty"`
  1293. // SelfLink: [Output Only] Server-defined URL for this resource.
  1294. SelfLink string `json:"selfLink,omitempty"`
  1295. // Warning: [Output Only] Informational warning message.
  1296. Warning *AddressAggregatedListWarning `json:"warning,omitempty"`
  1297. // ServerResponse contains the HTTP response code and headers from the
  1298. // server.
  1299. googleapi.ServerResponse `json:"-"`
  1300. // ForceSendFields is a list of field names (e.g. "Id") to
  1301. // unconditionally include in API requests. By default, fields with
  1302. // empty values are omitted from API requests. However, any non-pointer,
  1303. // non-interface field appearing in ForceSendFields will be sent to the
  1304. // server regardless of whether the field is empty or not. This may be
  1305. // used to include empty fields in Patch requests.
  1306. ForceSendFields []string `json:"-"`
  1307. // NullFields is a list of field names (e.g. "Id") to include in API
  1308. // requests with the JSON null value. By default, fields with empty
  1309. // values are omitted from API requests. However, any field with an
  1310. // empty value appearing in NullFields will be sent to the server as
  1311. // null. It is an error if a field in this list has a non-empty value.
  1312. // This may be used to include null fields in Patch requests.
  1313. NullFields []string `json:"-"`
  1314. }
  1315. func (s *AddressAggregatedList) MarshalJSON() ([]byte, error) {
  1316. type NoMethod AddressAggregatedList
  1317. raw := NoMethod(*s)
  1318. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1319. }
  1320. // AddressAggregatedListWarning: [Output Only] Informational warning
  1321. // message.
  1322. type AddressAggregatedListWarning struct {
  1323. // Code: [Output Only] A warning code, if applicable. For example,
  1324. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  1325. // the response.
  1326. //
  1327. // Possible values:
  1328. // "CLEANUP_FAILED"
  1329. // "DEPRECATED_RESOURCE_USED"
  1330. // "DEPRECATED_TYPE_USED"
  1331. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  1332. // "EXPERIMENTAL_TYPE_USED"
  1333. // "EXTERNAL_API_WARNING"
  1334. // "FIELD_VALUE_OVERRIDEN"
  1335. // "INJECTED_KERNELS_DEPRECATED"
  1336. // "MISSING_TYPE_DEPENDENCY"
  1337. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  1338. // "NEXT_HOP_CANNOT_IP_FORWARD"
  1339. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  1340. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  1341. // "NEXT_HOP_NOT_RUNNING"
  1342. // "NOT_CRITICAL_ERROR"
  1343. // "NO_RESULTS_ON_PAGE"
  1344. // "REQUIRED_TOS_AGREEMENT"
  1345. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  1346. // "RESOURCE_NOT_DELETED"
  1347. // "SCHEMA_VALIDATION_IGNORED"
  1348. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  1349. // "UNDECLARED_PROPERTIES"
  1350. // "UNREACHABLE"
  1351. Code string `json:"code,omitempty"`
  1352. // Data: [Output Only] Metadata about this warning in key: value format.
  1353. // For example:
  1354. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  1355. Data []*AddressAggregatedListWarningData `json:"data,omitempty"`
  1356. // Message: [Output Only] A human-readable description of the warning
  1357. // code.
  1358. Message string `json:"message,omitempty"`
  1359. // ForceSendFields is a list of field names (e.g. "Code") to
  1360. // unconditionally include in API requests. By default, fields with
  1361. // empty values are omitted from API requests. However, any non-pointer,
  1362. // non-interface field appearing in ForceSendFields will be sent to the
  1363. // server regardless of whether the field is empty or not. This may be
  1364. // used to include empty fields in Patch requests.
  1365. ForceSendFields []string `json:"-"`
  1366. // NullFields is a list of field names (e.g. "Code") to include in API
  1367. // requests with the JSON null value. By default, fields with empty
  1368. // values are omitted from API requests. However, any field with an
  1369. // empty value appearing in NullFields will be sent to the server as
  1370. // null. It is an error if a field in this list has a non-empty value.
  1371. // This may be used to include null fields in Patch requests.
  1372. NullFields []string `json:"-"`
  1373. }
  1374. func (s *AddressAggregatedListWarning) MarshalJSON() ([]byte, error) {
  1375. type NoMethod AddressAggregatedListWarning
  1376. raw := NoMethod(*s)
  1377. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1378. }
  1379. type AddressAggregatedListWarningData struct {
  1380. // Key: [Output Only] A key that provides more detail on the warning
  1381. // being returned. For example, for warnings where there are no results
  1382. // in a list request for a particular zone, this key might be scope and
  1383. // the key value might be the zone name. Other examples might be a key
  1384. // indicating a deprecated resource and a suggested replacement, or a
  1385. // warning about invalid network settings (for example, if an instance
  1386. // attempts to perform IP forwarding but is not enabled for IP
  1387. // forwarding).
  1388. Key string `json:"key,omitempty"`
  1389. // Value: [Output Only] A warning data value corresponding to the key.
  1390. Value string `json:"value,omitempty"`
  1391. // ForceSendFields is a list of field names (e.g. "Key") to
  1392. // unconditionally include in API requests. By default, fields with
  1393. // empty values are omitted from API requests. However, any non-pointer,
  1394. // non-interface field appearing in ForceSendFields will be sent to the
  1395. // server regardless of whether the field is empty or not. This may be
  1396. // used to include empty fields in Patch requests.
  1397. ForceSendFields []string `json:"-"`
  1398. // NullFields is a list of field names (e.g. "Key") to include in API
  1399. // requests with the JSON null value. By default, fields with empty
  1400. // values are omitted from API requests. However, any field with an
  1401. // empty value appearing in NullFields will be sent to the server as
  1402. // null. It is an error if a field in this list has a non-empty value.
  1403. // This may be used to include null fields in Patch requests.
  1404. NullFields []string `json:"-"`
  1405. }
  1406. func (s *AddressAggregatedListWarningData) MarshalJSON() ([]byte, error) {
  1407. type NoMethod AddressAggregatedListWarningData
  1408. raw := NoMethod(*s)
  1409. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1410. }
  1411. // AddressList: Contains a list of addresses.
  1412. type AddressList struct {
  1413. // Id: [Output Only] Unique identifier for the resource; defined by the
  1414. // server.
  1415. Id string `json:"id,omitempty"`
  1416. // Items: A list of Address resources.
  1417. Items []*Address `json:"items,omitempty"`
  1418. // Kind: [Output Only] Type of resource. Always compute#addressList for
  1419. // lists of addresses.
  1420. Kind string `json:"kind,omitempty"`
  1421. // NextPageToken: [Output Only] This token allows you to get the next
  1422. // page of results for list requests. If the number of results is larger
  1423. // than maxResults, use the nextPageToken as a value for the query
  1424. // parameter pageToken in the next list request. Subsequent list
  1425. // requests will have their own nextPageToken to continue paging through
  1426. // the results.
  1427. NextPageToken string `json:"nextPageToken,omitempty"`
  1428. // SelfLink: [Output Only] Server-defined URL for this resource.
  1429. SelfLink string `json:"selfLink,omitempty"`
  1430. // Warning: [Output Only] Informational warning message.
  1431. Warning *AddressListWarning `json:"warning,omitempty"`
  1432. // ServerResponse contains the HTTP response code and headers from the
  1433. // server.
  1434. googleapi.ServerResponse `json:"-"`
  1435. // ForceSendFields is a list of field names (e.g. "Id") to
  1436. // unconditionally include in API requests. By default, fields with
  1437. // empty values are omitted from API requests. However, any non-pointer,
  1438. // non-interface field appearing in ForceSendFields will be sent to the
  1439. // server regardless of whether the field is empty or not. This may be
  1440. // used to include empty fields in Patch requests.
  1441. ForceSendFields []string `json:"-"`
  1442. // NullFields is a list of field names (e.g. "Id") to include in API
  1443. // requests with the JSON null value. By default, fields with empty
  1444. // values are omitted from API requests. However, any field with an
  1445. // empty value appearing in NullFields will be sent to the server as
  1446. // null. It is an error if a field in this list has a non-empty value.
  1447. // This may be used to include null fields in Patch requests.
  1448. NullFields []string `json:"-"`
  1449. }
  1450. func (s *AddressList) MarshalJSON() ([]byte, error) {
  1451. type NoMethod AddressList
  1452. raw := NoMethod(*s)
  1453. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1454. }
  1455. // AddressListWarning: [Output Only] Informational warning message.
  1456. type AddressListWarning struct {
  1457. // Code: [Output Only] A warning code, if applicable. For example,
  1458. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  1459. // the response.
  1460. //
  1461. // Possible values:
  1462. // "CLEANUP_FAILED"
  1463. // "DEPRECATED_RESOURCE_USED"
  1464. // "DEPRECATED_TYPE_USED"
  1465. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  1466. // "EXPERIMENTAL_TYPE_USED"
  1467. // "EXTERNAL_API_WARNING"
  1468. // "FIELD_VALUE_OVERRIDEN"
  1469. // "INJECTED_KERNELS_DEPRECATED"
  1470. // "MISSING_TYPE_DEPENDENCY"
  1471. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  1472. // "NEXT_HOP_CANNOT_IP_FORWARD"
  1473. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  1474. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  1475. // "NEXT_HOP_NOT_RUNNING"
  1476. // "NOT_CRITICAL_ERROR"
  1477. // "NO_RESULTS_ON_PAGE"
  1478. // "REQUIRED_TOS_AGREEMENT"
  1479. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  1480. // "RESOURCE_NOT_DELETED"
  1481. // "SCHEMA_VALIDATION_IGNORED"
  1482. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  1483. // "UNDECLARED_PROPERTIES"
  1484. // "UNREACHABLE"
  1485. Code string `json:"code,omitempty"`
  1486. // Data: [Output Only] Metadata about this warning in key: value format.
  1487. // For example:
  1488. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  1489. Data []*AddressListWarningData `json:"data,omitempty"`
  1490. // Message: [Output Only] A human-readable description of the warning
  1491. // code.
  1492. Message string `json:"message,omitempty"`
  1493. // ForceSendFields is a list of field names (e.g. "Code") to
  1494. // unconditionally include in API requests. By default, fields with
  1495. // empty values are omitted from API requests. However, any non-pointer,
  1496. // non-interface field appearing in ForceSendFields will be sent to the
  1497. // server regardless of whether the field is empty or not. This may be
  1498. // used to include empty fields in Patch requests.
  1499. ForceSendFields []string `json:"-"`
  1500. // NullFields is a list of field names (e.g. "Code") to include in API
  1501. // requests with the JSON null value. By default, fields with empty
  1502. // values are omitted from API requests. However, any field with an
  1503. // empty value appearing in NullFields will be sent to the server as
  1504. // null. It is an error if a field in this list has a non-empty value.
  1505. // This may be used to include null fields in Patch requests.
  1506. NullFields []string `json:"-"`
  1507. }
  1508. func (s *AddressListWarning) MarshalJSON() ([]byte, error) {
  1509. type NoMethod AddressListWarning
  1510. raw := NoMethod(*s)
  1511. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1512. }
  1513. type AddressListWarningData struct {
  1514. // Key: [Output Only] A key that provides more detail on the warning
  1515. // being returned. For example, for warnings where there are no results
  1516. // in a list request for a particular zone, this key might be scope and
  1517. // the key value might be the zone name. Other examples might be a key
  1518. // indicating a deprecated resource and a suggested replacement, or a
  1519. // warning about invalid network settings (for example, if an instance
  1520. // attempts to perform IP forwarding but is not enabled for IP
  1521. // forwarding).
  1522. Key string `json:"key,omitempty"`
  1523. // Value: [Output Only] A warning data value corresponding to the key.
  1524. Value string `json:"value,omitempty"`
  1525. // ForceSendFields is a list of field names (e.g. "Key") to
  1526. // unconditionally include in API requests. By default, fields with
  1527. // empty values are omitted from API requests. However, any non-pointer,
  1528. // non-interface field appearing in ForceSendFields will be sent to the
  1529. // server regardless of whether the field is empty or not. This may be
  1530. // used to include empty fields in Patch requests.
  1531. ForceSendFields []string `json:"-"`
  1532. // NullFields is a list of field names (e.g. "Key") to include in API
  1533. // requests with the JSON null value. By default, fields with empty
  1534. // values are omitted from API requests. However, any field with an
  1535. // empty value appearing in NullFields will be sent to the server as
  1536. // null. It is an error if a field in this list has a non-empty value.
  1537. // This may be used to include null fields in Patch requests.
  1538. NullFields []string `json:"-"`
  1539. }
  1540. func (s *AddressListWarningData) MarshalJSON() ([]byte, error) {
  1541. type NoMethod AddressListWarningData
  1542. raw := NoMethod(*s)
  1543. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1544. }
  1545. type AddressesScopedList struct {
  1546. // Addresses: [Output Only] A list of addresses contained in this scope.
  1547. Addresses []*Address `json:"addresses,omitempty"`
  1548. // Warning: [Output Only] Informational warning which replaces the list
  1549. // of addresses when the list is empty.
  1550. Warning *AddressesScopedListWarning `json:"warning,omitempty"`
  1551. // ForceSendFields is a list of field names (e.g. "Addresses") to
  1552. // unconditionally include in API requests. By default, fields with
  1553. // empty values are omitted from API requests. However, any non-pointer,
  1554. // non-interface field appearing in ForceSendFields will be sent to the
  1555. // server regardless of whether the field is empty or not. This may be
  1556. // used to include empty fields in Patch requests.
  1557. ForceSendFields []string `json:"-"`
  1558. // NullFields is a list of field names (e.g. "Addresses") to include in
  1559. // API requests with the JSON null value. By default, fields with empty
  1560. // values are omitted from API requests. However, any field with an
  1561. // empty value appearing in NullFields will be sent to the server as
  1562. // null. It is an error if a field in this list has a non-empty value.
  1563. // This may be used to include null fields in Patch requests.
  1564. NullFields []string `json:"-"`
  1565. }
  1566. func (s *AddressesScopedList) MarshalJSON() ([]byte, error) {
  1567. type NoMethod AddressesScopedList
  1568. raw := NoMethod(*s)
  1569. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1570. }
  1571. // AddressesScopedListWarning: [Output Only] Informational warning which
  1572. // replaces the list of addresses when the list is empty.
  1573. type AddressesScopedListWarning struct {
  1574. // Code: [Output Only] A warning code, if applicable. For example,
  1575. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  1576. // the response.
  1577. //
  1578. // Possible values:
  1579. // "CLEANUP_FAILED"
  1580. // "DEPRECATED_RESOURCE_USED"
  1581. // "DEPRECATED_TYPE_USED"
  1582. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  1583. // "EXPERIMENTAL_TYPE_USED"
  1584. // "EXTERNAL_API_WARNING"
  1585. // "FIELD_VALUE_OVERRIDEN"
  1586. // "INJECTED_KERNELS_DEPRECATED"
  1587. // "MISSING_TYPE_DEPENDENCY"
  1588. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  1589. // "NEXT_HOP_CANNOT_IP_FORWARD"
  1590. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  1591. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  1592. // "NEXT_HOP_NOT_RUNNING"
  1593. // "NOT_CRITICAL_ERROR"
  1594. // "NO_RESULTS_ON_PAGE"
  1595. // "REQUIRED_TOS_AGREEMENT"
  1596. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  1597. // "RESOURCE_NOT_DELETED"
  1598. // "SCHEMA_VALIDATION_IGNORED"
  1599. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  1600. // "UNDECLARED_PROPERTIES"
  1601. // "UNREACHABLE"
  1602. Code string `json:"code,omitempty"`
  1603. // Data: [Output Only] Metadata about this warning in key: value format.
  1604. // For example:
  1605. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  1606. Data []*AddressesScopedListWarningData `json:"data,omitempty"`
  1607. // Message: [Output Only] A human-readable description of the warning
  1608. // code.
  1609. Message string `json:"message,omitempty"`
  1610. // ForceSendFields is a list of field names (e.g. "Code") to
  1611. // unconditionally include in API requests. By default, fields with
  1612. // empty values are omitted from API requests. However, any non-pointer,
  1613. // non-interface field appearing in ForceSendFields will be sent to the
  1614. // server regardless of whether the field is empty or not. This may be
  1615. // used to include empty fields in Patch requests.
  1616. ForceSendFields []string `json:"-"`
  1617. // NullFields is a list of field names (e.g. "Code") to include in API
  1618. // requests with the JSON null value. By default, fields with empty
  1619. // values are omitted from API requests. However, any field with an
  1620. // empty value appearing in NullFields will be sent to the server as
  1621. // null. It is an error if a field in this list has a non-empty value.
  1622. // This may be used to include null fields in Patch requests.
  1623. NullFields []string `json:"-"`
  1624. }
  1625. func (s *AddressesScopedListWarning) MarshalJSON() ([]byte, error) {
  1626. type NoMethod AddressesScopedListWarning
  1627. raw := NoMethod(*s)
  1628. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1629. }
  1630. type AddressesScopedListWarningData struct {
  1631. // Key: [Output Only] A key that provides more detail on the warning
  1632. // being returned. For example, for warnings where there are no results
  1633. // in a list request for a particular zone, this key might be scope and
  1634. // the key value might be the zone name. Other examples might be a key
  1635. // indicating a deprecated resource and a suggested replacement, or a
  1636. // warning about invalid network settings (for example, if an instance
  1637. // attempts to perform IP forwarding but is not enabled for IP
  1638. // forwarding).
  1639. Key string `json:"key,omitempty"`
  1640. // Value: [Output Only] A warning data value corresponding to the key.
  1641. Value string `json:"value,omitempty"`
  1642. // ForceSendFields is a list of field names (e.g. "Key") to
  1643. // unconditionally include in API requests. By default, fields with
  1644. // empty values are omitted from API requests. However, any non-pointer,
  1645. // non-interface field appearing in ForceSendFields will be sent to the
  1646. // server regardless of whether the field is empty or not. This may be
  1647. // used to include empty fields in Patch requests.
  1648. ForceSendFields []string `json:"-"`
  1649. // NullFields is a list of field names (e.g. "Key") to include in API
  1650. // requests with the JSON null value. By default, fields with empty
  1651. // values are omitted from API requests. However, any field with an
  1652. // empty value appearing in NullFields will be sent to the server as
  1653. // null. It is an error if a field in this list has a non-empty value.
  1654. // This may be used to include null fields in Patch requests.
  1655. NullFields []string `json:"-"`
  1656. }
  1657. func (s *AddressesScopedListWarningData) MarshalJSON() ([]byte, error) {
  1658. type NoMethod AddressesScopedListWarningData
  1659. raw := NoMethod(*s)
  1660. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1661. }
  1662. // AliasIpRange: An alias IP range attached to an instance's network
  1663. // interface.
  1664. type AliasIpRange struct {
  1665. // IpCidrRange: The IP CIDR range represented by this alias IP range.
  1666. // This IP CIDR range must belong to the specified subnetwork and cannot
  1667. // contain IP addresses reserved by system or used by other network
  1668. // interfaces. This range may be a single IP address (e.g. 10.2.3.4), a
  1669. // netmask (e.g. /24) or a CIDR format string (e.g. 10.1.2.0/24).
  1670. IpCidrRange string `json:"ipCidrRange,omitempty"`
  1671. // SubnetworkRangeName: Optional subnetwork secondary range name
  1672. // specifying the secondary range from which to allocate the IP CIDR
  1673. // range for this alias IP range. If left unspecified, the primary range
  1674. // of the subnetwork will be used.
  1675. SubnetworkRangeName string `json:"subnetworkRangeName,omitempty"`
  1676. // ForceSendFields is a list of field names (e.g. "IpCidrRange") to
  1677. // unconditionally include in API requests. By default, fields with
  1678. // empty values are omitted from API requests. However, any non-pointer,
  1679. // non-interface field appearing in ForceSendFields will be sent to the
  1680. // server regardless of whether the field is empty or not. This may be
  1681. // used to include empty fields in Patch requests.
  1682. ForceSendFields []string `json:"-"`
  1683. // NullFields is a list of field names (e.g. "IpCidrRange") to include
  1684. // in API requests with the JSON null value. By default, fields with
  1685. // empty values are omitted from API requests. However, any field with
  1686. // an empty value appearing in NullFields will be sent to the server as
  1687. // null. It is an error if a field in this list has a non-empty value.
  1688. // This may be used to include null fields in Patch requests.
  1689. NullFields []string `json:"-"`
  1690. }
  1691. func (s *AliasIpRange) MarshalJSON() ([]byte, error) {
  1692. type NoMethod AliasIpRange
  1693. raw := NoMethod(*s)
  1694. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1695. }
  1696. // AttachedDisk: An instance-attached disk resource.
  1697. type AttachedDisk struct {
  1698. // AutoDelete: Specifies whether the disk will be auto-deleted when the
  1699. // instance is deleted (but not when the disk is detached from the
  1700. // instance).
  1701. AutoDelete bool `json:"autoDelete,omitempty"`
  1702. // Boot: Indicates that this is a boot disk. The virtual machine will
  1703. // use the first partition of the disk for its root filesystem.
  1704. Boot bool `json:"boot,omitempty"`
  1705. // DeviceName: Specifies a unique device name of your choice that is
  1706. // reflected into the /dev/disk/by-id/google-* tree of a Linux operating
  1707. // system running within the instance. This name can be used to
  1708. // reference the device for mounting, resizing, and so on, from within
  1709. // the instance.
  1710. //
  1711. // If not specified, the server chooses a default device name to apply
  1712. // to this disk, in the form persistent-disks-x, where x is a number
  1713. // assigned by Google Compute Engine. This field is only applicable for
  1714. // persistent disks.
  1715. DeviceName string `json:"deviceName,omitempty"`
  1716. // DiskEncryptionKey: Encrypts or decrypts a disk using a
  1717. // customer-supplied encryption key.
  1718. //
  1719. // If you are creating a new disk, this field encrypts the new disk
  1720. // using an encryption key that you provide. If you are attaching an
  1721. // existing disk that is already encrypted, this field decrypts the disk
  1722. // using the customer-supplied encryption key.
  1723. //
  1724. // If you encrypt a disk using a customer-supplied key, you must provide
  1725. // the same key again when you attempt to use this resource at a later
  1726. // time. For example, you must provide the key when you create a
  1727. // snapshot or an image from the disk or when you attach the disk to a
  1728. // virtual machine instance.
  1729. //
  1730. // If you do not provide an encryption key, then the disk will be
  1731. // encrypted using an automatically generated key and you do not need to
  1732. // provide a key to use the disk later.
  1733. //
  1734. // Instance templates do not store customer-supplied encryption keys, so
  1735. // you cannot use your own keys to encrypt disks in a managed instance
  1736. // group.
  1737. DiskEncryptionKey *CustomerEncryptionKey `json:"diskEncryptionKey,omitempty"`
  1738. // GuestOsFeatures: A list of features to enable on the guest operating
  1739. // system. Applicable only for bootable images. Read Enabling guest
  1740. // operating system features to see a list of available options.
  1741. GuestOsFeatures []*GuestOsFeature `json:"guestOsFeatures,omitempty"`
  1742. // Index: [Output Only] A zero-based index to this disk, where 0 is
  1743. // reserved for the boot disk. If you have many disks attached to an
  1744. // instance, each disk would have a unique index number.
  1745. Index int64 `json:"index,omitempty"`
  1746. // InitializeParams: [Input Only] Specifies the parameters for a new
  1747. // disk that will be created alongside the new instance. Use
  1748. // initialization parameters to create boot disks or local SSDs attached
  1749. // to the new instance.
  1750. //
  1751. // This property is mutually exclusive with the source property; you can
  1752. // only define one or the other, but not both.
  1753. InitializeParams *AttachedDiskInitializeParams `json:"initializeParams,omitempty"`
  1754. // Interface: Specifies the disk interface to use for attaching this
  1755. // disk, which is either SCSI or NVME. The default is SCSI. Persistent
  1756. // disks must always use SCSI and the request will fail if you attempt
  1757. // to attach a persistent disk in any other format than SCSI. Local SSDs
  1758. // can use either NVME or SCSI. For performance characteristics of SCSI
  1759. // over NVMe, see Local SSD performance.
  1760. //
  1761. // Possible values:
  1762. // "NVME"
  1763. // "SCSI"
  1764. Interface string `json:"interface,omitempty"`
  1765. // Kind: [Output Only] Type of the resource. Always compute#attachedDisk
  1766. // for attached disks.
  1767. Kind string `json:"kind,omitempty"`
  1768. // Licenses: [Output Only] Any valid publicly visible licenses.
  1769. Licenses []string `json:"licenses,omitempty"`
  1770. // Mode: The mode in which to attach this disk, either READ_WRITE or
  1771. // READ_ONLY. If not specified, the default is to attach the disk in
  1772. // READ_WRITE mode.
  1773. //
  1774. // Possible values:
  1775. // "READ_ONLY"
  1776. // "READ_WRITE"
  1777. Mode string `json:"mode,omitempty"`
  1778. // Source: Specifies a valid partial or full URL to an existing
  1779. // Persistent Disk resource. When creating a new instance, one of
  1780. // initializeParams.sourceImage or disks.source is required except for
  1781. // local SSD.
  1782. //
  1783. // If desired, you can also attach existing non-root persistent disks
  1784. // using this property. This field is only applicable for persistent
  1785. // disks.
  1786. //
  1787. // Note that for InstanceTemplate, specify the disk name, not the URL
  1788. // for the disk.
  1789. Source string `json:"source,omitempty"`
  1790. // Type: Specifies the type of the disk, either SCRATCH or PERSISTENT.
  1791. // If not specified, the default is PERSISTENT.
  1792. //
  1793. // Possible values:
  1794. // "PERSISTENT"
  1795. // "SCRATCH"
  1796. Type string `json:"type,omitempty"`
  1797. // ForceSendFields is a list of field names (e.g. "AutoDelete") to
  1798. // unconditionally include in API requests. By default, fields with
  1799. // empty values are omitted from API requests. However, any non-pointer,
  1800. // non-interface field appearing in ForceSendFields will be sent to the
  1801. // server regardless of whether the field is empty or not. This may be
  1802. // used to include empty fields in Patch requests.
  1803. ForceSendFields []string `json:"-"`
  1804. // NullFields is a list of field names (e.g. "AutoDelete") to include in
  1805. // API requests with the JSON null value. By default, fields with empty
  1806. // values are omitted from API requests. However, any field with an
  1807. // empty value appearing in NullFields will be sent to the server as
  1808. // null. It is an error if a field in this list has a non-empty value.
  1809. // This may be used to include null fields in Patch requests.
  1810. NullFields []string `json:"-"`
  1811. }
  1812. func (s *AttachedDisk) MarshalJSON() ([]byte, error) {
  1813. type NoMethod AttachedDisk
  1814. raw := NoMethod(*s)
  1815. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1816. }
  1817. // AttachedDiskInitializeParams: [Input Only] Specifies the parameters
  1818. // for a new disk that will be created alongside the new instance. Use
  1819. // initialization parameters to create boot disks or local SSDs attached
  1820. // to the new instance.
  1821. //
  1822. // This property is mutually exclusive with the source property; you can
  1823. // only define one or the other, but not both.
  1824. type AttachedDiskInitializeParams struct {
  1825. // DiskName: Specifies the disk name. If not specified, the default is
  1826. // to use the name of the instance.
  1827. DiskName string `json:"diskName,omitempty"`
  1828. // DiskSizeGb: Specifies the size of the disk in base-2 GB.
  1829. DiskSizeGb int64 `json:"diskSizeGb,omitempty,string"`
  1830. // DiskStorageType: [Deprecated] Storage type of the disk.
  1831. //
  1832. // Possible values:
  1833. // "HDD"
  1834. // "SSD"
  1835. DiskStorageType string `json:"diskStorageType,omitempty"`
  1836. // DiskType: Specifies the disk type to use to create the instance. If
  1837. // not specified, the default is pd-standard, specified using the full
  1838. // URL. For
  1839. // example:
  1840. // https://www.googleapis.com/compute/v1/projects/project/zones/
  1841. // zone/diskTypes/pd-standard
  1842. //
  1843. //
  1844. // Other values include pd-ssd and local-ssd. If you define this field,
  1845. // you can provide either the full or partial URL. For example, the
  1846. // following are valid values:
  1847. // -
  1848. // https://www.googleapis.com/compute/v1/projects/project/zones/zone/diskTypes/diskType
  1849. // - projects/project/zones/zone/diskTypes/diskType
  1850. // - zones/zone/diskTypes/diskType Note that for InstanceTemplate, this
  1851. // is the name of the disk type, not URL.
  1852. DiskType string `json:"diskType,omitempty"`
  1853. // Labels: Labels to apply to this disk. These can be later modified by
  1854. // the disks.setLabels method. This field is only applicable for
  1855. // persistent disks.
  1856. Labels map[string]string `json:"labels,omitempty"`
  1857. // SourceImage: The source image to create this disk. When creating a
  1858. // new instance, one of initializeParams.sourceImage or disks.source is
  1859. // required except for local SSD.
  1860. //
  1861. // To create a disk with one of the public operating system images,
  1862. // specify the image by its family name. For example, specify
  1863. // family/debian-8 to use the latest Debian 8
  1864. // image:
  1865. // projects/debian-cloud/global/images/family/debian-8
  1866. //
  1867. //
  1868. // Alternati
  1869. // vely, use a specific version of a public operating system
  1870. // image:
  1871. // projects/debian-cloud/global/images/debian-8-jessie-vYYYYMMDD
  1872. //
  1873. //
  1874. //
  1875. // To create a disk with a custom image that you created, specify the
  1876. // image name in the following
  1877. // format:
  1878. // global/images/my-custom-image
  1879. //
  1880. //
  1881. // You can also specify a custom image by its image family, which
  1882. // returns the latest version of the image in that family. Replace the
  1883. // image name with
  1884. // family/family-name:
  1885. // global/images/family/my-image-family
  1886. //
  1887. //
  1888. // If the source image is deleted later, this field will not be set.
  1889. SourceImage string `json:"sourceImage,omitempty"`
  1890. // SourceImageEncryptionKey: The customer-supplied encryption key of the
  1891. // source image. Required if the source image is protected by a
  1892. // customer-supplied encryption key.
  1893. //
  1894. // Instance templates do not store customer-supplied encryption keys, so
  1895. // you cannot create disks for instances in a managed instance group if
  1896. // the source images are encrypted with your own keys.
  1897. SourceImageEncryptionKey *CustomerEncryptionKey `json:"sourceImageEncryptionKey,omitempty"`
  1898. // ForceSendFields is a list of field names (e.g. "DiskName") to
  1899. // unconditionally include in API requests. By default, fields with
  1900. // empty values are omitted from API requests. However, any non-pointer,
  1901. // non-interface field appearing in ForceSendFields will be sent to the
  1902. // server regardless of whether the field is empty or not. This may be
  1903. // used to include empty fields in Patch requests.
  1904. ForceSendFields []string `json:"-"`
  1905. // NullFields is a list of field names (e.g. "DiskName") to include in
  1906. // API requests with the JSON null value. By default, fields with empty
  1907. // values are omitted from API requests. However, any field with an
  1908. // empty value appearing in NullFields will be sent to the server as
  1909. // null. It is an error if a field in this list has a non-empty value.
  1910. // This may be used to include null fields in Patch requests.
  1911. NullFields []string `json:"-"`
  1912. }
  1913. func (s *AttachedDiskInitializeParams) MarshalJSON() ([]byte, error) {
  1914. type NoMethod AttachedDiskInitializeParams
  1915. raw := NoMethod(*s)
  1916. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1917. }
  1918. // AuditConfig: Specifies the audit configuration for a service. The
  1919. // configuration determines which permission types are logged, and what
  1920. // identities, if any, are exempted from logging. An AuditConfig must
  1921. // have one or more AuditLogConfigs.
  1922. //
  1923. // If there are AuditConfigs for both `allServices` and a specific
  1924. // service, the union of the two AuditConfigs is used for that service:
  1925. // the log_types specified in each AuditConfig are enabled, and the
  1926. // exempted_members in each AuditLogConfig are exempted.
  1927. //
  1928. // Example Policy with multiple AuditConfigs:
  1929. //
  1930. // { "audit_configs": [ { "service": "allServices" "audit_log_configs":
  1931. // [ { "log_type": "DATA_READ", "exempted_members": [
  1932. // "user:foo@gmail.com" ] }, { "log_type": "DATA_WRITE", }, {
  1933. // "log_type": "ADMIN_READ", } ] }, { "service":
  1934. // "fooservice.googleapis.com" "audit_log_configs": [ { "log_type":
  1935. // "DATA_READ", }, { "log_type": "DATA_WRITE", "exempted_members": [
  1936. // "user:bar@gmail.com" ] } ] } ] }
  1937. //
  1938. // For fooservice, this policy enables DATA_READ, DATA_WRITE and
  1939. // ADMIN_READ logging. It also exempts foo@gmail.com from DATA_READ
  1940. // logging, and bar@gmail.com from DATA_WRITE logging.
  1941. type AuditConfig struct {
  1942. // AuditLogConfigs: The configuration for logging of each type of
  1943. // permission.
  1944. AuditLogConfigs []*AuditLogConfig `json:"auditLogConfigs,omitempty"`
  1945. ExemptedMembers []string `json:"exemptedMembers,omitempty"`
  1946. // Service: Specifies a service that will be enabled for audit logging.
  1947. // For example, `storage.googleapis.com`, `cloudsql.googleapis.com`.
  1948. // `allServices` is a special value that covers all services.
  1949. Service string `json:"service,omitempty"`
  1950. // ForceSendFields is a list of field names (e.g. "AuditLogConfigs") to
  1951. // unconditionally include in API requests. By default, fields with
  1952. // empty values are omitted from API requests. However, any non-pointer,
  1953. // non-interface field appearing in ForceSendFields will be sent to the
  1954. // server regardless of whether the field is empty or not. This may be
  1955. // used to include empty fields in Patch requests.
  1956. ForceSendFields []string `json:"-"`
  1957. // NullFields is a list of field names (e.g. "AuditLogConfigs") to
  1958. // include in API requests with the JSON null value. By default, fields
  1959. // with empty values are omitted from API requests. However, any field
  1960. // with an empty value appearing in NullFields will be sent to the
  1961. // server as null. It is an error if a field in this list has a
  1962. // non-empty value. This may be used to include null fields in Patch
  1963. // requests.
  1964. NullFields []string `json:"-"`
  1965. }
  1966. func (s *AuditConfig) MarshalJSON() ([]byte, error) {
  1967. type NoMethod AuditConfig
  1968. raw := NoMethod(*s)
  1969. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1970. }
  1971. // AuditLogConfig: Provides the configuration for logging a type of
  1972. // permissions. Example:
  1973. //
  1974. // { "audit_log_configs": [ { "log_type": "DATA_READ",
  1975. // "exempted_members": [ "user:foo@gmail.com" ] }, { "log_type":
  1976. // "DATA_WRITE", } ] }
  1977. //
  1978. // This enables 'DATA_READ' and 'DATA_WRITE' logging, while exempting
  1979. // foo@gmail.com from DATA_READ logging.
  1980. type AuditLogConfig struct {
  1981. // ExemptedMembers: Specifies the identities that do not cause logging
  1982. // for this type of permission. Follows the same format of
  1983. // [Binding.members][].
  1984. ExemptedMembers []string `json:"exemptedMembers,omitempty"`
  1985. // LogType: The log type that this config enables.
  1986. //
  1987. // Possible values:
  1988. // "ADMIN_READ"
  1989. // "DATA_READ"
  1990. // "DATA_WRITE"
  1991. // "LOG_TYPE_UNSPECIFIED"
  1992. LogType string `json:"logType,omitempty"`
  1993. // ForceSendFields is a list of field names (e.g. "ExemptedMembers") to
  1994. // unconditionally include in API requests. By default, fields with
  1995. // empty values are omitted from API requests. However, any non-pointer,
  1996. // non-interface field appearing in ForceSendFields will be sent to the
  1997. // server regardless of whether the field is empty or not. This may be
  1998. // used to include empty fields in Patch requests.
  1999. ForceSendFields []string `json:"-"`
  2000. // NullFields is a list of field names (e.g. "ExemptedMembers") to
  2001. // include in API requests with the JSON null value. By default, fields
  2002. // with empty values are omitted from API requests. However, any field
  2003. // with an empty value appearing in NullFields will be sent to the
  2004. // server as null. It is an error if a field in this list has a
  2005. // non-empty value. This may be used to include null fields in Patch
  2006. // requests.
  2007. NullFields []string `json:"-"`
  2008. }
  2009. func (s *AuditLogConfig) MarshalJSON() ([]byte, error) {
  2010. type NoMethod AuditLogConfig
  2011. raw := NoMethod(*s)
  2012. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2013. }
  2014. // AuthorizationLoggingOptions: Authorization-related information used
  2015. // by Cloud Audit Logging.
  2016. type AuthorizationLoggingOptions struct {
  2017. // PermissionType: The type of the permission that was checked.
  2018. //
  2019. // Possible values:
  2020. // "ADMIN_READ"
  2021. // "ADMIN_WRITE"
  2022. // "DATA_READ"
  2023. // "DATA_WRITE"
  2024. // "PERMISSION_TYPE_UNSPECIFIED"
  2025. PermissionType string `json:"permissionType,omitempty"`
  2026. // ForceSendFields is a list of field names (e.g. "PermissionType") to
  2027. // unconditionally include in API requests. By default, fields with
  2028. // empty values are omitted from API requests. However, any non-pointer,
  2029. // non-interface field appearing in ForceSendFields will be sent to the
  2030. // server regardless of whether the field is empty or not. This may be
  2031. // used to include empty fields in Patch requests.
  2032. ForceSendFields []string `json:"-"`
  2033. // NullFields is a list of field names (e.g. "PermissionType") to
  2034. // include in API requests with the JSON null value. By default, fields
  2035. // with empty values are omitted from API requests. However, any field
  2036. // with an empty value appearing in NullFields will be sent to the
  2037. // server as null. It is an error if a field in this list has a
  2038. // non-empty value. This may be used to include null fields in Patch
  2039. // requests.
  2040. NullFields []string `json:"-"`
  2041. }
  2042. func (s *AuthorizationLoggingOptions) MarshalJSON() ([]byte, error) {
  2043. type NoMethod AuthorizationLoggingOptions
  2044. raw := NoMethod(*s)
  2045. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2046. }
  2047. // Autoscaler: Represents an Autoscaler resource. Autoscalers allow you
  2048. // to automatically scale virtual machine instances in managed instance
  2049. // groups according to an autoscaling policy that you define. For more
  2050. // information, read Autoscaling Groups of Instances. (== resource_for
  2051. // beta.autoscalers ==) (== resource_for v1.autoscalers ==) (==
  2052. // resource_for beta.regionAutoscalers ==) (== resource_for
  2053. // v1.regionAutoscalers ==)
  2054. type Autoscaler struct {
  2055. // AutoscalingPolicy: The configuration parameters for the autoscaling
  2056. // algorithm. You can define one or more of the policies for an
  2057. // autoscaler: cpuUtilization, customMetricUtilizations, and
  2058. // loadBalancingUtilization.
  2059. //
  2060. // If none of these are specified, the default will be to autoscale
  2061. // based on cpuUtilization to 0.6 or 60%.
  2062. AutoscalingPolicy *AutoscalingPolicy `json:"autoscalingPolicy,omitempty"`
  2063. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  2064. // format.
  2065. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  2066. // Description: An optional description of this resource. Provide this
  2067. // property when you create the resource.
  2068. Description string `json:"description,omitempty"`
  2069. // Id: [Output Only] The unique identifier for the resource. This
  2070. // identifier is defined by the server.
  2071. Id uint64 `json:"id,omitempty,string"`
  2072. // Kind: [Output Only] Type of the resource. Always compute#autoscaler
  2073. // for autoscalers.
  2074. Kind string `json:"kind,omitempty"`
  2075. // Name: Name of the resource. Provided by the client when the resource
  2076. // is created. The name must be 1-63 characters long, and comply with
  2077. // RFC1035. Specifically, the name must be 1-63 characters long and
  2078. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  2079. // the first character must be a lowercase letter, and all following
  2080. // characters must be a dash, lowercase letter, or digit, except the
  2081. // last character, which cannot be a dash.
  2082. Name string `json:"name,omitempty"`
  2083. // Region: [Output Only] URL of the region where the instance group
  2084. // resides (for autoscalers living in regional scope).
  2085. Region string `json:"region,omitempty"`
  2086. // SelfLink: [Output Only] Server-defined URL for the resource.
  2087. SelfLink string `json:"selfLink,omitempty"`
  2088. // Status: [Output Only] The status of the autoscaler configuration.
  2089. //
  2090. // Possible values:
  2091. // "ACTIVE"
  2092. // "DELETING"
  2093. // "ERROR"
  2094. // "PENDING"
  2095. Status string `json:"status,omitempty"`
  2096. // StatusDetails: [Output Only] Human-readable details about the current
  2097. // state of the autoscaler. Read the documentation for Commonly returned
  2098. // status messages for examples of status messages you might encounter.
  2099. StatusDetails []*AutoscalerStatusDetails `json:"statusDetails,omitempty"`
  2100. // Target: URL of the managed instance group that this autoscaler will
  2101. // scale.
  2102. Target string `json:"target,omitempty"`
  2103. // Zone: [Output Only] URL of the zone where the instance group resides
  2104. // (for autoscalers living in zonal scope).
  2105. Zone string `json:"zone,omitempty"`
  2106. // ServerResponse contains the HTTP response code and headers from the
  2107. // server.
  2108. googleapi.ServerResponse `json:"-"`
  2109. // ForceSendFields is a list of field names (e.g. "AutoscalingPolicy")
  2110. // to unconditionally include in API requests. By default, fields with
  2111. // empty values are omitted from API requests. However, any non-pointer,
  2112. // non-interface field appearing in ForceSendFields will be sent to the
  2113. // server regardless of whether the field is empty or not. This may be
  2114. // used to include empty fields in Patch requests.
  2115. ForceSendFields []string `json:"-"`
  2116. // NullFields is a list of field names (e.g. "AutoscalingPolicy") to
  2117. // include in API requests with the JSON null value. By default, fields
  2118. // with empty values are omitted from API requests. However, any field
  2119. // with an empty value appearing in NullFields will be sent to the
  2120. // server as null. It is an error if a field in this list has a
  2121. // non-empty value. This may be used to include null fields in Patch
  2122. // requests.
  2123. NullFields []string `json:"-"`
  2124. }
  2125. func (s *Autoscaler) MarshalJSON() ([]byte, error) {
  2126. type NoMethod Autoscaler
  2127. raw := NoMethod(*s)
  2128. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2129. }
  2130. type AutoscalerAggregatedList struct {
  2131. // Id: [Output Only] Unique identifier for the resource; defined by the
  2132. // server.
  2133. Id string `json:"id,omitempty"`
  2134. // Items: A list of AutoscalersScopedList resources.
  2135. Items map[string]AutoscalersScopedList `json:"items,omitempty"`
  2136. // Kind: [Output Only] Type of resource. Always
  2137. // compute#autoscalerAggregatedList for aggregated lists of autoscalers.
  2138. Kind string `json:"kind,omitempty"`
  2139. // NextPageToken: [Output Only] This token allows you to get the next
  2140. // page of results for list requests. If the number of results is larger
  2141. // than maxResults, use the nextPageToken as a value for the query
  2142. // parameter pageToken in the next list request. Subsequent list
  2143. // requests will have their own nextPageToken to continue paging through
  2144. // the results.
  2145. NextPageToken string `json:"nextPageToken,omitempty"`
  2146. // SelfLink: [Output Only] Server-defined URL for this resource.
  2147. SelfLink string `json:"selfLink,omitempty"`
  2148. // Warning: [Output Only] Informational warning message.
  2149. Warning *AutoscalerAggregatedListWarning `json:"warning,omitempty"`
  2150. // ServerResponse contains the HTTP response code and headers from the
  2151. // server.
  2152. googleapi.ServerResponse `json:"-"`
  2153. // ForceSendFields is a list of field names (e.g. "Id") to
  2154. // unconditionally include in API requests. By default, fields with
  2155. // empty values are omitted from API requests. However, any non-pointer,
  2156. // non-interface field appearing in ForceSendFields will be sent to the
  2157. // server regardless of whether the field is empty or not. This may be
  2158. // used to include empty fields in Patch requests.
  2159. ForceSendFields []string `json:"-"`
  2160. // NullFields is a list of field names (e.g. "Id") to include in API
  2161. // requests with the JSON null value. By default, fields with empty
  2162. // values are omitted from API requests. However, any field with an
  2163. // empty value appearing in NullFields will be sent to the server as
  2164. // null. It is an error if a field in this list has a non-empty value.
  2165. // This may be used to include null fields in Patch requests.
  2166. NullFields []string `json:"-"`
  2167. }
  2168. func (s *AutoscalerAggregatedList) MarshalJSON() ([]byte, error) {
  2169. type NoMethod AutoscalerAggregatedList
  2170. raw := NoMethod(*s)
  2171. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2172. }
  2173. // AutoscalerAggregatedListWarning: [Output Only] Informational warning
  2174. // message.
  2175. type AutoscalerAggregatedListWarning struct {
  2176. // Code: [Output Only] A warning code, if applicable. For example,
  2177. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  2178. // the response.
  2179. //
  2180. // Possible values:
  2181. // "CLEANUP_FAILED"
  2182. // "DEPRECATED_RESOURCE_USED"
  2183. // "DEPRECATED_TYPE_USED"
  2184. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  2185. // "EXPERIMENTAL_TYPE_USED"
  2186. // "EXTERNAL_API_WARNING"
  2187. // "FIELD_VALUE_OVERRIDEN"
  2188. // "INJECTED_KERNELS_DEPRECATED"
  2189. // "MISSING_TYPE_DEPENDENCY"
  2190. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  2191. // "NEXT_HOP_CANNOT_IP_FORWARD"
  2192. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  2193. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  2194. // "NEXT_HOP_NOT_RUNNING"
  2195. // "NOT_CRITICAL_ERROR"
  2196. // "NO_RESULTS_ON_PAGE"
  2197. // "REQUIRED_TOS_AGREEMENT"
  2198. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  2199. // "RESOURCE_NOT_DELETED"
  2200. // "SCHEMA_VALIDATION_IGNORED"
  2201. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  2202. // "UNDECLARED_PROPERTIES"
  2203. // "UNREACHABLE"
  2204. Code string `json:"code,omitempty"`
  2205. // Data: [Output Only] Metadata about this warning in key: value format.
  2206. // For example:
  2207. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  2208. Data []*AutoscalerAggregatedListWarningData `json:"data,omitempty"`
  2209. // Message: [Output Only] A human-readable description of the warning
  2210. // code.
  2211. Message string `json:"message,omitempty"`
  2212. // ForceSendFields is a list of field names (e.g. "Code") to
  2213. // unconditionally include in API requests. By default, fields with
  2214. // empty values are omitted from API requests. However, any non-pointer,
  2215. // non-interface field appearing in ForceSendFields will be sent to the
  2216. // server regardless of whether the field is empty or not. This may be
  2217. // used to include empty fields in Patch requests.
  2218. ForceSendFields []string `json:"-"`
  2219. // NullFields is a list of field names (e.g. "Code") to include in API
  2220. // requests with the JSON null value. By default, fields with empty
  2221. // values are omitted from API requests. However, any field with an
  2222. // empty value appearing in NullFields will be sent to the server as
  2223. // null. It is an error if a field in this list has a non-empty value.
  2224. // This may be used to include null fields in Patch requests.
  2225. NullFields []string `json:"-"`
  2226. }
  2227. func (s *AutoscalerAggregatedListWarning) MarshalJSON() ([]byte, error) {
  2228. type NoMethod AutoscalerAggregatedListWarning
  2229. raw := NoMethod(*s)
  2230. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2231. }
  2232. type AutoscalerAggregatedListWarningData struct {
  2233. // Key: [Output Only] A key that provides more detail on the warning
  2234. // being returned. For example, for warnings where there are no results
  2235. // in a list request for a particular zone, this key might be scope and
  2236. // the key value might be the zone name. Other examples might be a key
  2237. // indicating a deprecated resource and a suggested replacement, or a
  2238. // warning about invalid network settings (for example, if an instance
  2239. // attempts to perform IP forwarding but is not enabled for IP
  2240. // forwarding).
  2241. Key string `json:"key,omitempty"`
  2242. // Value: [Output Only] A warning data value corresponding to the key.
  2243. Value string `json:"value,omitempty"`
  2244. // ForceSendFields is a list of field names (e.g. "Key") to
  2245. // unconditionally include in API requests. By default, fields with
  2246. // empty values are omitted from API requests. However, any non-pointer,
  2247. // non-interface field appearing in ForceSendFields will be sent to the
  2248. // server regardless of whether the field is empty or not. This may be
  2249. // used to include empty fields in Patch requests.
  2250. ForceSendFields []string `json:"-"`
  2251. // NullFields is a list of field names (e.g. "Key") to include in API
  2252. // requests with the JSON null value. By default, fields with empty
  2253. // values are omitted from API requests. However, any field with an
  2254. // empty value appearing in NullFields will be sent to the server as
  2255. // null. It is an error if a field in this list has a non-empty value.
  2256. // This may be used to include null fields in Patch requests.
  2257. NullFields []string `json:"-"`
  2258. }
  2259. func (s *AutoscalerAggregatedListWarningData) MarshalJSON() ([]byte, error) {
  2260. type NoMethod AutoscalerAggregatedListWarningData
  2261. raw := NoMethod(*s)
  2262. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2263. }
  2264. // AutoscalerList: Contains a list of Autoscaler resources.
  2265. type AutoscalerList struct {
  2266. // Id: [Output Only] Unique identifier for the resource; defined by the
  2267. // server.
  2268. Id string `json:"id,omitempty"`
  2269. // Items: A list of Autoscaler resources.
  2270. Items []*Autoscaler `json:"items,omitempty"`
  2271. // Kind: [Output Only] Type of resource. Always compute#autoscalerList
  2272. // for lists of autoscalers.
  2273. Kind string `json:"kind,omitempty"`
  2274. // NextPageToken: [Output Only] This token allows you to get the next
  2275. // page of results for list requests. If the number of results is larger
  2276. // than maxResults, use the nextPageToken as a value for the query
  2277. // parameter pageToken in the next list request. Subsequent list
  2278. // requests will have their own nextPageToken to continue paging through
  2279. // the results.
  2280. NextPageToken string `json:"nextPageToken,omitempty"`
  2281. // SelfLink: [Output Only] Server-defined URL for this resource.
  2282. SelfLink string `json:"selfLink,omitempty"`
  2283. // Warning: [Output Only] Informational warning message.
  2284. Warning *AutoscalerListWarning `json:"warning,omitempty"`
  2285. // ServerResponse contains the HTTP response code and headers from the
  2286. // server.
  2287. googleapi.ServerResponse `json:"-"`
  2288. // ForceSendFields is a list of field names (e.g. "Id") to
  2289. // unconditionally include in API requests. By default, fields with
  2290. // empty values are omitted from API requests. However, any non-pointer,
  2291. // non-interface field appearing in ForceSendFields will be sent to the
  2292. // server regardless of whether the field is empty or not. This may be
  2293. // used to include empty fields in Patch requests.
  2294. ForceSendFields []string `json:"-"`
  2295. // NullFields is a list of field names (e.g. "Id") to include in API
  2296. // requests with the JSON null value. By default, fields with empty
  2297. // values are omitted from API requests. However, any field with an
  2298. // empty value appearing in NullFields will be sent to the server as
  2299. // null. It is an error if a field in this list has a non-empty value.
  2300. // This may be used to include null fields in Patch requests.
  2301. NullFields []string `json:"-"`
  2302. }
  2303. func (s *AutoscalerList) MarshalJSON() ([]byte, error) {
  2304. type NoMethod AutoscalerList
  2305. raw := NoMethod(*s)
  2306. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2307. }
  2308. // AutoscalerListWarning: [Output Only] Informational warning message.
  2309. type AutoscalerListWarning struct {
  2310. // Code: [Output Only] A warning code, if applicable. For example,
  2311. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  2312. // the response.
  2313. //
  2314. // Possible values:
  2315. // "CLEANUP_FAILED"
  2316. // "DEPRECATED_RESOURCE_USED"
  2317. // "DEPRECATED_TYPE_USED"
  2318. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  2319. // "EXPERIMENTAL_TYPE_USED"
  2320. // "EXTERNAL_API_WARNING"
  2321. // "FIELD_VALUE_OVERRIDEN"
  2322. // "INJECTED_KERNELS_DEPRECATED"
  2323. // "MISSING_TYPE_DEPENDENCY"
  2324. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  2325. // "NEXT_HOP_CANNOT_IP_FORWARD"
  2326. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  2327. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  2328. // "NEXT_HOP_NOT_RUNNING"
  2329. // "NOT_CRITICAL_ERROR"
  2330. // "NO_RESULTS_ON_PAGE"
  2331. // "REQUIRED_TOS_AGREEMENT"
  2332. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  2333. // "RESOURCE_NOT_DELETED"
  2334. // "SCHEMA_VALIDATION_IGNORED"
  2335. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  2336. // "UNDECLARED_PROPERTIES"
  2337. // "UNREACHABLE"
  2338. Code string `json:"code,omitempty"`
  2339. // Data: [Output Only] Metadata about this warning in key: value format.
  2340. // For example:
  2341. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  2342. Data []*AutoscalerListWarningData `json:"data,omitempty"`
  2343. // Message: [Output Only] A human-readable description of the warning
  2344. // code.
  2345. Message string `json:"message,omitempty"`
  2346. // ForceSendFields is a list of field names (e.g. "Code") 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. "Code") 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 *AutoscalerListWarning) MarshalJSON() ([]byte, error) {
  2362. type NoMethod AutoscalerListWarning
  2363. raw := NoMethod(*s)
  2364. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2365. }
  2366. type AutoscalerListWarningData struct {
  2367. // Key: [Output Only] A key that provides more detail on the warning
  2368. // being returned. For example, for warnings where there are no results
  2369. // in a list request for a particular zone, this key might be scope and
  2370. // the key value might be the zone name. Other examples might be a key
  2371. // indicating a deprecated resource and a suggested replacement, or a
  2372. // warning about invalid network settings (for example, if an instance
  2373. // attempts to perform IP forwarding but is not enabled for IP
  2374. // forwarding).
  2375. Key string `json:"key,omitempty"`
  2376. // Value: [Output Only] A warning data value corresponding to the key.
  2377. Value string `json:"value,omitempty"`
  2378. // ForceSendFields is a list of field names (e.g. "Key") to
  2379. // unconditionally include in API requests. By default, fields with
  2380. // empty values are omitted from API requests. However, any non-pointer,
  2381. // non-interface field appearing in ForceSendFields will be sent to the
  2382. // server regardless of whether the field is empty or not. This may be
  2383. // used to include empty fields in Patch requests.
  2384. ForceSendFields []string `json:"-"`
  2385. // NullFields is a list of field names (e.g. "Key") to include in API
  2386. // requests with the JSON null value. By default, fields with empty
  2387. // values are omitted from API requests. However, any field with an
  2388. // empty value appearing in NullFields will be sent to the server as
  2389. // null. It is an error if a field in this list has a non-empty value.
  2390. // This may be used to include null fields in Patch requests.
  2391. NullFields []string `json:"-"`
  2392. }
  2393. func (s *AutoscalerListWarningData) MarshalJSON() ([]byte, error) {
  2394. type NoMethod AutoscalerListWarningData
  2395. raw := NoMethod(*s)
  2396. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2397. }
  2398. type AutoscalerStatusDetails struct {
  2399. // Message: The status message.
  2400. Message string `json:"message,omitempty"`
  2401. // Type: The type of error returned.
  2402. //
  2403. // Possible values:
  2404. // "ALL_INSTANCES_UNHEALTHY"
  2405. // "BACKEND_SERVICE_DOES_NOT_EXIST"
  2406. // "CAPPED_AT_MAX_NUM_REPLICAS"
  2407. // "CUSTOM_METRIC_DATA_POINTS_TOO_SPARSE"
  2408. // "CUSTOM_METRIC_INVALID"
  2409. // "MIN_EQUALS_MAX"
  2410. // "MISSING_CUSTOM_METRIC_DATA_POINTS"
  2411. // "MISSING_LOAD_BALANCING_DATA_POINTS"
  2412. // "MORE_THAN_ONE_BACKEND_SERVICE"
  2413. // "NOT_ENOUGH_QUOTA_AVAILABLE"
  2414. // "REGION_RESOURCE_STOCKOUT"
  2415. // "SCALING_TARGET_DOES_NOT_EXIST"
  2416. // "UNKNOWN"
  2417. // "UNSUPPORTED_MAX_RATE_LOAD_BALANCING_CONFIGURATION"
  2418. // "ZONE_RESOURCE_STOCKOUT"
  2419. Type string `json:"type,omitempty"`
  2420. // ForceSendFields is a list of field names (e.g. "Message") to
  2421. // unconditionally include in API requests. By default, fields with
  2422. // empty values are omitted from API requests. However, any non-pointer,
  2423. // non-interface field appearing in ForceSendFields will be sent to the
  2424. // server regardless of whether the field is empty or not. This may be
  2425. // used to include empty fields in Patch requests.
  2426. ForceSendFields []string `json:"-"`
  2427. // NullFields is a list of field names (e.g. "Message") to include in
  2428. // API requests with the JSON null value. By default, fields with empty
  2429. // values are omitted from API requests. However, any field with an
  2430. // empty value appearing in NullFields will be sent to the server as
  2431. // null. It is an error if a field in this list has a non-empty value.
  2432. // This may be used to include null fields in Patch requests.
  2433. NullFields []string `json:"-"`
  2434. }
  2435. func (s *AutoscalerStatusDetails) MarshalJSON() ([]byte, error) {
  2436. type NoMethod AutoscalerStatusDetails
  2437. raw := NoMethod(*s)
  2438. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2439. }
  2440. type AutoscalersScopedList struct {
  2441. // Autoscalers: [Output Only] A list of autoscalers contained in this
  2442. // scope.
  2443. Autoscalers []*Autoscaler `json:"autoscalers,omitempty"`
  2444. // Warning: [Output Only] Informational warning which replaces the list
  2445. // of autoscalers when the list is empty.
  2446. Warning *AutoscalersScopedListWarning `json:"warning,omitempty"`
  2447. // ForceSendFields is a list of field names (e.g. "Autoscalers") to
  2448. // unconditionally include in API requests. By default, fields with
  2449. // empty values are omitted from API requests. However, any non-pointer,
  2450. // non-interface field appearing in ForceSendFields will be sent to the
  2451. // server regardless of whether the field is empty or not. This may be
  2452. // used to include empty fields in Patch requests.
  2453. ForceSendFields []string `json:"-"`
  2454. // NullFields is a list of field names (e.g. "Autoscalers") to include
  2455. // in API requests with the JSON null value. By default, fields with
  2456. // empty values are omitted from API requests. However, any field with
  2457. // an empty value appearing in NullFields will be sent to the server as
  2458. // null. It is an error if a field in this list has a non-empty value.
  2459. // This may be used to include null fields in Patch requests.
  2460. NullFields []string `json:"-"`
  2461. }
  2462. func (s *AutoscalersScopedList) MarshalJSON() ([]byte, error) {
  2463. type NoMethod AutoscalersScopedList
  2464. raw := NoMethod(*s)
  2465. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2466. }
  2467. // AutoscalersScopedListWarning: [Output Only] Informational warning
  2468. // which replaces the list of autoscalers when the list is empty.
  2469. type AutoscalersScopedListWarning struct {
  2470. // Code: [Output Only] A warning code, if applicable. For example,
  2471. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  2472. // the response.
  2473. //
  2474. // Possible values:
  2475. // "CLEANUP_FAILED"
  2476. // "DEPRECATED_RESOURCE_USED"
  2477. // "DEPRECATED_TYPE_USED"
  2478. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  2479. // "EXPERIMENTAL_TYPE_USED"
  2480. // "EXTERNAL_API_WARNING"
  2481. // "FIELD_VALUE_OVERRIDEN"
  2482. // "INJECTED_KERNELS_DEPRECATED"
  2483. // "MISSING_TYPE_DEPENDENCY"
  2484. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  2485. // "NEXT_HOP_CANNOT_IP_FORWARD"
  2486. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  2487. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  2488. // "NEXT_HOP_NOT_RUNNING"
  2489. // "NOT_CRITICAL_ERROR"
  2490. // "NO_RESULTS_ON_PAGE"
  2491. // "REQUIRED_TOS_AGREEMENT"
  2492. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  2493. // "RESOURCE_NOT_DELETED"
  2494. // "SCHEMA_VALIDATION_IGNORED"
  2495. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  2496. // "UNDECLARED_PROPERTIES"
  2497. // "UNREACHABLE"
  2498. Code string `json:"code,omitempty"`
  2499. // Data: [Output Only] Metadata about this warning in key: value format.
  2500. // For example:
  2501. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  2502. Data []*AutoscalersScopedListWarningData `json:"data,omitempty"`
  2503. // Message: [Output Only] A human-readable description of the warning
  2504. // code.
  2505. Message string `json:"message,omitempty"`
  2506. // ForceSendFields is a list of field names (e.g. "Code") to
  2507. // unconditionally include in API requests. By default, fields with
  2508. // empty values are omitted from API requests. However, any non-pointer,
  2509. // non-interface field appearing in ForceSendFields will be sent to the
  2510. // server regardless of whether the field is empty or not. This may be
  2511. // used to include empty fields in Patch requests.
  2512. ForceSendFields []string `json:"-"`
  2513. // NullFields is a list of field names (e.g. "Code") to include in API
  2514. // requests with the JSON null value. By default, fields with empty
  2515. // values are omitted from API requests. However, any field with an
  2516. // empty value appearing in NullFields will be sent to the server as
  2517. // null. It is an error if a field in this list has a non-empty value.
  2518. // This may be used to include null fields in Patch requests.
  2519. NullFields []string `json:"-"`
  2520. }
  2521. func (s *AutoscalersScopedListWarning) MarshalJSON() ([]byte, error) {
  2522. type NoMethod AutoscalersScopedListWarning
  2523. raw := NoMethod(*s)
  2524. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2525. }
  2526. type AutoscalersScopedListWarningData struct {
  2527. // Key: [Output Only] A key that provides more detail on the warning
  2528. // being returned. For example, for warnings where there are no results
  2529. // in a list request for a particular zone, this key might be scope and
  2530. // the key value might be the zone name. Other examples might be a key
  2531. // indicating a deprecated resource and a suggested replacement, or a
  2532. // warning about invalid network settings (for example, if an instance
  2533. // attempts to perform IP forwarding but is not enabled for IP
  2534. // forwarding).
  2535. Key string `json:"key,omitempty"`
  2536. // Value: [Output Only] A warning data value corresponding to the key.
  2537. Value string `json:"value,omitempty"`
  2538. // ForceSendFields is a list of field names (e.g. "Key") to
  2539. // unconditionally include in API requests. By default, fields with
  2540. // empty values are omitted from API requests. However, any non-pointer,
  2541. // non-interface field appearing in ForceSendFields will be sent to the
  2542. // server regardless of whether the field is empty or not. This may be
  2543. // used to include empty fields in Patch requests.
  2544. ForceSendFields []string `json:"-"`
  2545. // NullFields is a list of field names (e.g. "Key") to include in API
  2546. // requests with the JSON null value. By default, fields with empty
  2547. // values are omitted from API requests. However, any field with an
  2548. // empty value appearing in NullFields will be sent to the server as
  2549. // null. It is an error if a field in this list has a non-empty value.
  2550. // This may be used to include null fields in Patch requests.
  2551. NullFields []string `json:"-"`
  2552. }
  2553. func (s *AutoscalersScopedListWarningData) MarshalJSON() ([]byte, error) {
  2554. type NoMethod AutoscalersScopedListWarningData
  2555. raw := NoMethod(*s)
  2556. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2557. }
  2558. // AutoscalingPolicy: Cloud Autoscaler policy.
  2559. type AutoscalingPolicy struct {
  2560. // CoolDownPeriodSec: The number of seconds that the autoscaler should
  2561. // wait before it starts collecting information from a new instance.
  2562. // This prevents the autoscaler from collecting information when the
  2563. // instance is initializing, during which the collected usage would not
  2564. // be reliable. The default time autoscaler waits is 60
  2565. // seconds.
  2566. //
  2567. // Virtual machine initialization times might vary because of numerous
  2568. // factors. We recommend that you test how long an instance may take to
  2569. // initialize. To do this, create an instance and time the startup
  2570. // process.
  2571. CoolDownPeriodSec int64 `json:"coolDownPeriodSec,omitempty"`
  2572. // CpuUtilization: Defines the CPU utilization policy that allows the
  2573. // autoscaler to scale based on the average CPU utilization of a managed
  2574. // instance group.
  2575. CpuUtilization *AutoscalingPolicyCpuUtilization `json:"cpuUtilization,omitempty"`
  2576. // CustomMetricUtilizations: Configuration parameters of autoscaling
  2577. // based on a custom metric.
  2578. CustomMetricUtilizations []*AutoscalingPolicyCustomMetricUtilization `json:"customMetricUtilizations,omitempty"`
  2579. // LoadBalancingUtilization: Configuration parameters of autoscaling
  2580. // based on load balancer.
  2581. LoadBalancingUtilization *AutoscalingPolicyLoadBalancingUtilization `json:"loadBalancingUtilization,omitempty"`
  2582. // MaxNumReplicas: The maximum number of instances that the autoscaler
  2583. // can scale up to. This is required when creating or updating an
  2584. // autoscaler. The maximum number of replicas should not be lower than
  2585. // minimal number of replicas.
  2586. MaxNumReplicas int64 `json:"maxNumReplicas,omitempty"`
  2587. // MinNumReplicas: The minimum number of replicas that the autoscaler
  2588. // can scale down to. This cannot be less than 0. If not provided,
  2589. // autoscaler will choose a default value depending on maximum number of
  2590. // instances allowed.
  2591. MinNumReplicas int64 `json:"minNumReplicas,omitempty"`
  2592. // ForceSendFields is a list of field names (e.g. "CoolDownPeriodSec")
  2593. // to unconditionally include in API requests. By default, fields with
  2594. // empty values are omitted from API requests. However, any non-pointer,
  2595. // non-interface field appearing in ForceSendFields will be sent to the
  2596. // server regardless of whether the field is empty or not. This may be
  2597. // used to include empty fields in Patch requests.
  2598. ForceSendFields []string `json:"-"`
  2599. // NullFields is a list of field names (e.g. "CoolDownPeriodSec") to
  2600. // include in API requests with the JSON null value. By default, fields
  2601. // with empty values are omitted from API requests. However, any field
  2602. // with an empty value appearing in NullFields will be sent to the
  2603. // server as null. It is an error if a field in this list has a
  2604. // non-empty value. This may be used to include null fields in Patch
  2605. // requests.
  2606. NullFields []string `json:"-"`
  2607. }
  2608. func (s *AutoscalingPolicy) MarshalJSON() ([]byte, error) {
  2609. type NoMethod AutoscalingPolicy
  2610. raw := NoMethod(*s)
  2611. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2612. }
  2613. // AutoscalingPolicyCpuUtilization: CPU utilization policy.
  2614. type AutoscalingPolicyCpuUtilization struct {
  2615. // UtilizationTarget: The target CPU utilization that the autoscaler
  2616. // should maintain. Must be a float value in the range (0, 1]. If not
  2617. // specified, the default is 0.6.
  2618. //
  2619. // If the CPU level is below the target utilization, the autoscaler
  2620. // scales down the number of instances until it reaches the minimum
  2621. // number of instances you specified or until the average CPU of your
  2622. // instances reaches the target utilization.
  2623. //
  2624. // If the average CPU is above the target utilization, the autoscaler
  2625. // scales up until it reaches the maximum number of instances you
  2626. // specified or until the average utilization reaches the target
  2627. // utilization.
  2628. UtilizationTarget float64 `json:"utilizationTarget,omitempty"`
  2629. // ForceSendFields is a list of field names (e.g. "UtilizationTarget")
  2630. // to unconditionally include in API requests. By default, fields with
  2631. // empty values are omitted from API requests. However, any non-pointer,
  2632. // non-interface field appearing in ForceSendFields will be sent to the
  2633. // server regardless of whether the field is empty or not. This may be
  2634. // used to include empty fields in Patch requests.
  2635. ForceSendFields []string `json:"-"`
  2636. // NullFields is a list of field names (e.g. "UtilizationTarget") to
  2637. // include in API requests with the JSON null value. By default, fields
  2638. // with empty values are omitted from API requests. However, any field
  2639. // with an empty value appearing in NullFields will be sent to the
  2640. // server as null. It is an error if a field in this list has a
  2641. // non-empty value. This may be used to include null fields in Patch
  2642. // requests.
  2643. NullFields []string `json:"-"`
  2644. }
  2645. func (s *AutoscalingPolicyCpuUtilization) MarshalJSON() ([]byte, error) {
  2646. type NoMethod AutoscalingPolicyCpuUtilization
  2647. raw := NoMethod(*s)
  2648. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2649. }
  2650. func (s *AutoscalingPolicyCpuUtilization) UnmarshalJSON(data []byte) error {
  2651. type NoMethod AutoscalingPolicyCpuUtilization
  2652. var s1 struct {
  2653. UtilizationTarget gensupport.JSONFloat64 `json:"utilizationTarget"`
  2654. *NoMethod
  2655. }
  2656. s1.NoMethod = (*NoMethod)(s)
  2657. if err := json.Unmarshal(data, &s1); err != nil {
  2658. return err
  2659. }
  2660. s.UtilizationTarget = float64(s1.UtilizationTarget)
  2661. return nil
  2662. }
  2663. // AutoscalingPolicyCustomMetricUtilization: Custom utilization metric
  2664. // policy.
  2665. type AutoscalingPolicyCustomMetricUtilization struct {
  2666. // Filter: A filter string, compatible with a Stackdriver Monitoring
  2667. // filter string for TimeSeries.list API call. This filter is used to
  2668. // select a specific TimeSeries for the purpose of autoscaling and to
  2669. // determine whether the metric is exporting per-instance or per-group
  2670. // data.
  2671. //
  2672. // For the filter to be valid for autoscaling purposes, the following
  2673. // rules apply:
  2674. // - You can only use the AND operator for joining selectors.
  2675. // - You can only use direct equality comparison operator (=) without
  2676. // any functions for each selector.
  2677. // - You can specify the metric in both the filter string and in the
  2678. // metric field. However, if specified in both places, the metric must
  2679. // be identical.
  2680. // - The monitored resource type determines what kind of values are
  2681. // expected for the metric. If it is a gce_instance, the autoscaler
  2682. // expects the metric to include a separate TimeSeries for each instance
  2683. // in a group. In such a case, you cannot filter on resource labels.
  2684. // If the resource type is any other value, the autoscaler expects this
  2685. // metric to contain values that apply to the entire autoscaled instance
  2686. // group and resource label filtering can be performed to point
  2687. // autoscaler at the correct TimeSeries to scale upon. This is called a
  2688. // per-group metric for the purpose of autoscaling.
  2689. //
  2690. // If not specified, the type defaults to gce_instance.
  2691. //
  2692. // You should provide a filter that is selective enough to pick just one
  2693. // TimeSeries for the autoscaled group or for each of the instances (if
  2694. // you are using gce_instance resource type). If multiple TimeSeries are
  2695. // returned upon the query execution, the autoscaler will sum their
  2696. // respective values to obtain its scaling value.
  2697. Filter string `json:"filter,omitempty"`
  2698. // Metric: The identifier (type) of the Stackdriver Monitoring metric.
  2699. // The metric cannot have negative values.
  2700. //
  2701. // The metric must have a value type of INT64 or DOUBLE.
  2702. Metric string `json:"metric,omitempty"`
  2703. // SingleInstanceAssignment: If scaling is based on a per-group metric
  2704. // value that represents the total amount of work to be done or resource
  2705. // usage, set this value to an amount assigned for a single instance of
  2706. // the scaled group. Autoscaler will keep the number of instances
  2707. // proportional to the value of this metric, the metric itself should
  2708. // not change value due to group resizing.
  2709. //
  2710. // A good metric to use with the target is for example
  2711. // pubsub.googleapis.com/subscription/num_undelivered_messages or a
  2712. // custom metric exporting the total number of requests coming to your
  2713. // instances.
  2714. //
  2715. // A bad example would be a metric exporting an average or median
  2716. // latency, since this value can't include a chunk assignable to a
  2717. // single instance, it could be better used with utilization_target
  2718. // instead.
  2719. SingleInstanceAssignment float64 `json:"singleInstanceAssignment,omitempty"`
  2720. // UtilizationTarget: The target value of the metric that autoscaler
  2721. // should maintain. This must be a positive value. A utilization metric
  2722. // scales number of virtual machines handling requests to increase or
  2723. // decrease proportionally to the metric.
  2724. //
  2725. // For example, a good metric to use as a utilization_target is
  2726. // compute.googleapis.com/instance/network/received_bytes_count. The
  2727. // autoscaler will work to keep this value constant for each of the
  2728. // instances.
  2729. UtilizationTarget float64 `json:"utilizationTarget,omitempty"`
  2730. // UtilizationTargetType: Defines how target utilization value is
  2731. // expressed for a Stackdriver Monitoring metric. Either GAUGE,
  2732. // DELTA_PER_SECOND, or DELTA_PER_MINUTE. If not specified, the default
  2733. // is GAUGE.
  2734. //
  2735. // Possible values:
  2736. // "DELTA_PER_MINUTE"
  2737. // "DELTA_PER_SECOND"
  2738. // "GAUGE"
  2739. UtilizationTargetType string `json:"utilizationTargetType,omitempty"`
  2740. // ForceSendFields is a list of field names (e.g. "Filter") to
  2741. // unconditionally include in API requests. By default, fields with
  2742. // empty values are omitted from API requests. However, any non-pointer,
  2743. // non-interface field appearing in ForceSendFields will be sent to the
  2744. // server regardless of whether the field is empty or not. This may be
  2745. // used to include empty fields in Patch requests.
  2746. ForceSendFields []string `json:"-"`
  2747. // NullFields is a list of field names (e.g. "Filter") to include in API
  2748. // requests with the JSON null value. By default, fields with empty
  2749. // values are omitted from API requests. However, any field with an
  2750. // empty value appearing in NullFields will be sent to the server as
  2751. // null. It is an error if a field in this list has a non-empty value.
  2752. // This may be used to include null fields in Patch requests.
  2753. NullFields []string `json:"-"`
  2754. }
  2755. func (s *AutoscalingPolicyCustomMetricUtilization) MarshalJSON() ([]byte, error) {
  2756. type NoMethod AutoscalingPolicyCustomMetricUtilization
  2757. raw := NoMethod(*s)
  2758. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2759. }
  2760. func (s *AutoscalingPolicyCustomMetricUtilization) UnmarshalJSON(data []byte) error {
  2761. type NoMethod AutoscalingPolicyCustomMetricUtilization
  2762. var s1 struct {
  2763. SingleInstanceAssignment gensupport.JSONFloat64 `json:"singleInstanceAssignment"`
  2764. UtilizationTarget gensupport.JSONFloat64 `json:"utilizationTarget"`
  2765. *NoMethod
  2766. }
  2767. s1.NoMethod = (*NoMethod)(s)
  2768. if err := json.Unmarshal(data, &s1); err != nil {
  2769. return err
  2770. }
  2771. s.SingleInstanceAssignment = float64(s1.SingleInstanceAssignment)
  2772. s.UtilizationTarget = float64(s1.UtilizationTarget)
  2773. return nil
  2774. }
  2775. // AutoscalingPolicyLoadBalancingUtilization: Configuration parameters
  2776. // of autoscaling based on load balancing.
  2777. type AutoscalingPolicyLoadBalancingUtilization struct {
  2778. // UtilizationTarget: Fraction of backend capacity utilization (set in
  2779. // HTTP(s) load balancing configuration) that autoscaler should
  2780. // maintain. Must be a positive float value. If not defined, the default
  2781. // is 0.8.
  2782. UtilizationTarget float64 `json:"utilizationTarget,omitempty"`
  2783. // ForceSendFields is a list of field names (e.g. "UtilizationTarget")
  2784. // to unconditionally include in API requests. By default, fields with
  2785. // empty values are omitted from API requests. However, any non-pointer,
  2786. // non-interface field appearing in ForceSendFields will be sent to the
  2787. // server regardless of whether the field is empty or not. This may be
  2788. // used to include empty fields in Patch requests.
  2789. ForceSendFields []string `json:"-"`
  2790. // NullFields is a list of field names (e.g. "UtilizationTarget") to
  2791. // include in API requests with the JSON null value. By default, fields
  2792. // with empty values are omitted from API requests. However, any field
  2793. // with an empty value appearing in NullFields will be sent to the
  2794. // server as null. It is an error if a field in this list has a
  2795. // non-empty value. This may be used to include null fields in Patch
  2796. // requests.
  2797. NullFields []string `json:"-"`
  2798. }
  2799. func (s *AutoscalingPolicyLoadBalancingUtilization) MarshalJSON() ([]byte, error) {
  2800. type NoMethod AutoscalingPolicyLoadBalancingUtilization
  2801. raw := NoMethod(*s)
  2802. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2803. }
  2804. func (s *AutoscalingPolicyLoadBalancingUtilization) UnmarshalJSON(data []byte) error {
  2805. type NoMethod AutoscalingPolicyLoadBalancingUtilization
  2806. var s1 struct {
  2807. UtilizationTarget gensupport.JSONFloat64 `json:"utilizationTarget"`
  2808. *NoMethod
  2809. }
  2810. s1.NoMethod = (*NoMethod)(s)
  2811. if err := json.Unmarshal(data, &s1); err != nil {
  2812. return err
  2813. }
  2814. s.UtilizationTarget = float64(s1.UtilizationTarget)
  2815. return nil
  2816. }
  2817. // Backend: Message containing information of one individual backend.
  2818. type Backend struct {
  2819. // BalancingMode: Specifies the balancing mode for this backend. For
  2820. // global HTTP(S) or TCP/SSL load balancing, the default is UTILIZATION.
  2821. // Valid values are UTILIZATION, RATE (for HTTP(S)) and CONNECTION (for
  2822. // TCP/SSL).
  2823. //
  2824. // For Internal Load Balancing, the default and only supported mode is
  2825. // CONNECTION.
  2826. //
  2827. // Possible values:
  2828. // "CONNECTION"
  2829. // "RATE"
  2830. // "UTILIZATION"
  2831. BalancingMode string `json:"balancingMode,omitempty"`
  2832. // CapacityScaler: A multiplier applied to the group's maximum servicing
  2833. // capacity (based on UTILIZATION, RATE or CONNECTION). Default value is
  2834. // 1, which means the group will serve up to 100% of its configured
  2835. // capacity (depending on balancingMode). A setting of 0 means the group
  2836. // is completely drained, offering 0% of its available Capacity. Valid
  2837. // range is [0.0,1.0].
  2838. //
  2839. // This cannot be used for internal load balancing.
  2840. CapacityScaler float64 `json:"capacityScaler,omitempty"`
  2841. // Description: An optional description of this resource. Provide this
  2842. // property when you create the resource.
  2843. Description string `json:"description,omitempty"`
  2844. // Group: The fully-qualified URL of a Instance Group resource. This
  2845. // instance group defines the list of instances that serve traffic.
  2846. // Member virtual machine instances from each instance group must live
  2847. // in the same zone as the instance group itself. No two backends in a
  2848. // backend service are allowed to use same Instance Group
  2849. // resource.
  2850. //
  2851. // Note that you must specify an Instance Group resource using the
  2852. // fully-qualified URL, rather than a partial URL.
  2853. //
  2854. // When the BackendService has load balancing scheme INTERNAL, the
  2855. // instance group must be within the same region as the BackendService.
  2856. Group string `json:"group,omitempty"`
  2857. // MaxConnections: The max number of simultaneous connections for the
  2858. // group. Can be used with either CONNECTION or UTILIZATION balancing
  2859. // modes. For CONNECTION mode, either maxConnections or
  2860. // maxConnectionsPerInstance must be set.
  2861. //
  2862. // This cannot be used for internal load balancing.
  2863. MaxConnections int64 `json:"maxConnections,omitempty"`
  2864. // MaxConnectionsPerEndpoint: The max number of simultaneous connections
  2865. // that a single backend network endpoint can handle. This is used to
  2866. // calculate the capacity of the group. Can be used in either CONNECTION
  2867. // or UTILIZATION balancing modes. For CONNECTION mode, either
  2868. // maxConnections or maxConnectionsPerEndpoint must be set.
  2869. //
  2870. // This cannot be used for internal load balancing.
  2871. MaxConnectionsPerEndpoint int64 `json:"maxConnectionsPerEndpoint,omitempty"`
  2872. // MaxConnectionsPerInstance: The max number of simultaneous connections
  2873. // that a single backend instance can handle. This is used to calculate
  2874. // the capacity of the group. Can be used in either CONNECTION or
  2875. // UTILIZATION balancing modes. For CONNECTION mode, either
  2876. // maxConnections or maxConnectionsPerInstance must be set.
  2877. //
  2878. // This cannot be used for internal load balancing.
  2879. MaxConnectionsPerInstance int64 `json:"maxConnectionsPerInstance,omitempty"`
  2880. // MaxRate: The max requests per second (RPS) of the group. Can be used
  2881. // with either RATE or UTILIZATION balancing modes, but required if RATE
  2882. // mode. For RATE mode, either maxRate or maxRatePerInstance must be
  2883. // set.
  2884. //
  2885. // This cannot be used for internal load balancing.
  2886. MaxRate int64 `json:"maxRate,omitempty"`
  2887. // MaxRatePerEndpoint: The max requests per second (RPS) that a single
  2888. // backend network endpoint can handle. This is used to calculate the
  2889. // capacity of the group. Can be used in either balancing mode. For RATE
  2890. // mode, either maxRate or maxRatePerEndpoint must be set.
  2891. //
  2892. // This cannot be used for internal load balancing.
  2893. MaxRatePerEndpoint float64 `json:"maxRatePerEndpoint,omitempty"`
  2894. // MaxRatePerInstance: The max requests per second (RPS) that a single
  2895. // backend instance can handle. This is used to calculate the capacity
  2896. // of the group. Can be used in either balancing mode. For RATE mode,
  2897. // either maxRate or maxRatePerInstance must be set.
  2898. //
  2899. // This cannot be used for internal load balancing.
  2900. MaxRatePerInstance float64 `json:"maxRatePerInstance,omitempty"`
  2901. // MaxUtilization: Used when balancingMode is UTILIZATION. This ratio
  2902. // defines the CPU utilization target for the group. The default is 0.8.
  2903. // Valid range is [0.0, 1.0].
  2904. //
  2905. // This cannot be used for internal load balancing.
  2906. MaxUtilization float64 `json:"maxUtilization,omitempty"`
  2907. // ForceSendFields is a list of field names (e.g. "BalancingMode") to
  2908. // unconditionally include in API requests. By default, fields with
  2909. // empty values are omitted from API requests. However, any non-pointer,
  2910. // non-interface field appearing in ForceSendFields will be sent to the
  2911. // server regardless of whether the field is empty or not. This may be
  2912. // used to include empty fields in Patch requests.
  2913. ForceSendFields []string `json:"-"`
  2914. // NullFields is a list of field names (e.g. "BalancingMode") to include
  2915. // in API requests with the JSON null value. By default, fields with
  2916. // empty values are omitted from API requests. However, any field with
  2917. // an empty value appearing in NullFields will be sent to the server as
  2918. // null. It is an error if a field in this list has a non-empty value.
  2919. // This may be used to include null fields in Patch requests.
  2920. NullFields []string `json:"-"`
  2921. }
  2922. func (s *Backend) MarshalJSON() ([]byte, error) {
  2923. type NoMethod Backend
  2924. raw := NoMethod(*s)
  2925. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2926. }
  2927. func (s *Backend) UnmarshalJSON(data []byte) error {
  2928. type NoMethod Backend
  2929. var s1 struct {
  2930. CapacityScaler gensupport.JSONFloat64 `json:"capacityScaler"`
  2931. MaxRatePerEndpoint gensupport.JSONFloat64 `json:"maxRatePerEndpoint"`
  2932. MaxRatePerInstance gensupport.JSONFloat64 `json:"maxRatePerInstance"`
  2933. MaxUtilization gensupport.JSONFloat64 `json:"maxUtilization"`
  2934. *NoMethod
  2935. }
  2936. s1.NoMethod = (*NoMethod)(s)
  2937. if err := json.Unmarshal(data, &s1); err != nil {
  2938. return err
  2939. }
  2940. s.CapacityScaler = float64(s1.CapacityScaler)
  2941. s.MaxRatePerEndpoint = float64(s1.MaxRatePerEndpoint)
  2942. s.MaxRatePerInstance = float64(s1.MaxRatePerInstance)
  2943. s.MaxUtilization = float64(s1.MaxUtilization)
  2944. return nil
  2945. }
  2946. // BackendBucket: A BackendBucket resource. This resource defines a
  2947. // Cloud Storage bucket.
  2948. type BackendBucket struct {
  2949. // BucketName: Cloud Storage bucket name.
  2950. BucketName string `json:"bucketName,omitempty"`
  2951. // CdnPolicy: Cloud CDN Coniguration for this BackendBucket.
  2952. CdnPolicy *BackendBucketCdnPolicy `json:"cdnPolicy,omitempty"`
  2953. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  2954. // format.
  2955. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  2956. // Description: An optional textual description of the resource;
  2957. // provided by the client when the resource is created.
  2958. Description string `json:"description,omitempty"`
  2959. // EnableCdn: If true, enable Cloud CDN for this BackendBucket.
  2960. EnableCdn bool `json:"enableCdn,omitempty"`
  2961. // Id: [Output Only] Unique identifier for the resource; defined by the
  2962. // server.
  2963. Id uint64 `json:"id,omitempty,string"`
  2964. // Kind: Type of the resource.
  2965. Kind string `json:"kind,omitempty"`
  2966. // Name: Name of the resource. Provided by the client when the resource
  2967. // is created. The name must be 1-63 characters long, and comply with
  2968. // RFC1035. Specifically, the name must be 1-63 characters long and
  2969. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  2970. // the first character must be a lowercase letter, and all following
  2971. // characters must be a dash, lowercase letter, or digit, except the
  2972. // last character, which cannot be a dash.
  2973. Name string `json:"name,omitempty"`
  2974. // SelfLink: [Output Only] Server-defined URL for the resource.
  2975. SelfLink string `json:"selfLink,omitempty"`
  2976. // ServerResponse contains the HTTP response code and headers from the
  2977. // server.
  2978. googleapi.ServerResponse `json:"-"`
  2979. // ForceSendFields is a list of field names (e.g. "BucketName") to
  2980. // unconditionally include in API requests. By default, fields with
  2981. // empty values are omitted from API requests. However, any non-pointer,
  2982. // non-interface field appearing in ForceSendFields will be sent to the
  2983. // server regardless of whether the field is empty or not. This may be
  2984. // used to include empty fields in Patch requests.
  2985. ForceSendFields []string `json:"-"`
  2986. // NullFields is a list of field names (e.g. "BucketName") to include in
  2987. // API requests with the JSON null value. By default, fields with empty
  2988. // values are omitted from API requests. However, any field with an
  2989. // empty value appearing in NullFields will be sent to the server as
  2990. // null. It is an error if a field in this list has a non-empty value.
  2991. // This may be used to include null fields in Patch requests.
  2992. NullFields []string `json:"-"`
  2993. }
  2994. func (s *BackendBucket) MarshalJSON() ([]byte, error) {
  2995. type NoMethod BackendBucket
  2996. raw := NoMethod(*s)
  2997. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2998. }
  2999. // BackendBucketCdnPolicy: Message containing Cloud CDN configuration
  3000. // for a backend bucket.
  3001. type BackendBucketCdnPolicy struct {
  3002. // SignedUrlCacheMaxAgeSec: Number of seconds up to which the response
  3003. // to a signed URL request will be cached in the CDN. After this time
  3004. // period, the Signed URL will be revalidated before being served.
  3005. // Defaults to 1hr (3600s). If this field is set, Cloud CDN will
  3006. // internally act as though all responses from this bucket had a
  3007. // ?Cache-Control: public, max-age=[TTL]? header, regardless of any
  3008. // existing Cache-Control header. The actual headers served in responses
  3009. // will not be altered.
  3010. SignedUrlCacheMaxAgeSec int64 `json:"signedUrlCacheMaxAgeSec,omitempty,string"`
  3011. // SignedUrlKeyNames: [Output Only] Names of the keys currently
  3012. // configured for Cloud CDN Signed URL on this backend bucket.
  3013. SignedUrlKeyNames []string `json:"signedUrlKeyNames,omitempty"`
  3014. // ForceSendFields is a list of field names (e.g.
  3015. // "SignedUrlCacheMaxAgeSec") to unconditionally include in API
  3016. // requests. By default, fields with empty values are omitted from API
  3017. // requests. However, any non-pointer, non-interface field appearing in
  3018. // ForceSendFields will be sent to the server regardless of whether the
  3019. // field is empty or not. This may be used to include empty fields in
  3020. // Patch requests.
  3021. ForceSendFields []string `json:"-"`
  3022. // NullFields is a list of field names (e.g. "SignedUrlCacheMaxAgeSec")
  3023. // to include in API requests with the JSON null value. By default,
  3024. // fields with empty values are omitted from API requests. However, any
  3025. // field with an empty value appearing in NullFields will be sent to the
  3026. // server as null. It is an error if a field in this list has a
  3027. // non-empty value. This may be used to include null fields in Patch
  3028. // requests.
  3029. NullFields []string `json:"-"`
  3030. }
  3031. func (s *BackendBucketCdnPolicy) MarshalJSON() ([]byte, error) {
  3032. type NoMethod BackendBucketCdnPolicy
  3033. raw := NoMethod(*s)
  3034. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3035. }
  3036. // BackendBucketList: Contains a list of BackendBucket resources.
  3037. type BackendBucketList struct {
  3038. // Id: [Output Only] Unique identifier for the resource; defined by the
  3039. // server.
  3040. Id string `json:"id,omitempty"`
  3041. // Items: A list of BackendBucket resources.
  3042. Items []*BackendBucket `json:"items,omitempty"`
  3043. // Kind: Type of resource.
  3044. Kind string `json:"kind,omitempty"`
  3045. // NextPageToken: [Output Only] This token allows you to get the next
  3046. // page of results for list requests. If the number of results is larger
  3047. // than maxResults, use the nextPageToken as a value for the query
  3048. // parameter pageToken in the next list request. Subsequent list
  3049. // requests will have their own nextPageToken to continue paging through
  3050. // the results.
  3051. NextPageToken string `json:"nextPageToken,omitempty"`
  3052. // SelfLink: [Output Only] Server-defined URL for this resource.
  3053. SelfLink string `json:"selfLink,omitempty"`
  3054. // Warning: [Output Only] Informational warning message.
  3055. Warning *BackendBucketListWarning `json:"warning,omitempty"`
  3056. // ServerResponse contains the HTTP response code and headers from the
  3057. // server.
  3058. googleapi.ServerResponse `json:"-"`
  3059. // ForceSendFields is a list of field names (e.g. "Id") to
  3060. // unconditionally include in API requests. By default, fields with
  3061. // empty values are omitted from API requests. However, any non-pointer,
  3062. // non-interface field appearing in ForceSendFields will be sent to the
  3063. // server regardless of whether the field is empty or not. This may be
  3064. // used to include empty fields in Patch requests.
  3065. ForceSendFields []string `json:"-"`
  3066. // NullFields is a list of field names (e.g. "Id") to include in API
  3067. // requests with the JSON null value. By default, fields with empty
  3068. // values are omitted from API requests. However, any field with an
  3069. // empty value appearing in NullFields will be sent to the server as
  3070. // null. It is an error if a field in this list has a non-empty value.
  3071. // This may be used to include null fields in Patch requests.
  3072. NullFields []string `json:"-"`
  3073. }
  3074. func (s *BackendBucketList) MarshalJSON() ([]byte, error) {
  3075. type NoMethod BackendBucketList
  3076. raw := NoMethod(*s)
  3077. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3078. }
  3079. // BackendBucketListWarning: [Output Only] Informational warning
  3080. // message.
  3081. type BackendBucketListWarning struct {
  3082. // Code: [Output Only] A warning code, if applicable. For example,
  3083. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  3084. // the response.
  3085. //
  3086. // Possible values:
  3087. // "CLEANUP_FAILED"
  3088. // "DEPRECATED_RESOURCE_USED"
  3089. // "DEPRECATED_TYPE_USED"
  3090. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  3091. // "EXPERIMENTAL_TYPE_USED"
  3092. // "EXTERNAL_API_WARNING"
  3093. // "FIELD_VALUE_OVERRIDEN"
  3094. // "INJECTED_KERNELS_DEPRECATED"
  3095. // "MISSING_TYPE_DEPENDENCY"
  3096. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  3097. // "NEXT_HOP_CANNOT_IP_FORWARD"
  3098. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  3099. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  3100. // "NEXT_HOP_NOT_RUNNING"
  3101. // "NOT_CRITICAL_ERROR"
  3102. // "NO_RESULTS_ON_PAGE"
  3103. // "REQUIRED_TOS_AGREEMENT"
  3104. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  3105. // "RESOURCE_NOT_DELETED"
  3106. // "SCHEMA_VALIDATION_IGNORED"
  3107. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  3108. // "UNDECLARED_PROPERTIES"
  3109. // "UNREACHABLE"
  3110. Code string `json:"code,omitempty"`
  3111. // Data: [Output Only] Metadata about this warning in key: value format.
  3112. // For example:
  3113. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  3114. Data []*BackendBucketListWarningData `json:"data,omitempty"`
  3115. // Message: [Output Only] A human-readable description of the warning
  3116. // code.
  3117. Message string `json:"message,omitempty"`
  3118. // ForceSendFields is a list of field names (e.g. "Code") to
  3119. // unconditionally include in API requests. By default, fields with
  3120. // empty values are omitted from API requests. However, any non-pointer,
  3121. // non-interface field appearing in ForceSendFields will be sent to the
  3122. // server regardless of whether the field is empty or not. This may be
  3123. // used to include empty fields in Patch requests.
  3124. ForceSendFields []string `json:"-"`
  3125. // NullFields is a list of field names (e.g. "Code") to include in API
  3126. // requests with the JSON null value. By default, fields with empty
  3127. // values are omitted from API requests. However, any field with an
  3128. // empty value appearing in NullFields will be sent to the server as
  3129. // null. It is an error if a field in this list has a non-empty value.
  3130. // This may be used to include null fields in Patch requests.
  3131. NullFields []string `json:"-"`
  3132. }
  3133. func (s *BackendBucketListWarning) MarshalJSON() ([]byte, error) {
  3134. type NoMethod BackendBucketListWarning
  3135. raw := NoMethod(*s)
  3136. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3137. }
  3138. type BackendBucketListWarningData struct {
  3139. // Key: [Output Only] A key that provides more detail on the warning
  3140. // being returned. For example, for warnings where there are no results
  3141. // in a list request for a particular zone, this key might be scope and
  3142. // the key value might be the zone name. Other examples might be a key
  3143. // indicating a deprecated resource and a suggested replacement, or a
  3144. // warning about invalid network settings (for example, if an instance
  3145. // attempts to perform IP forwarding but is not enabled for IP
  3146. // forwarding).
  3147. Key string `json:"key,omitempty"`
  3148. // Value: [Output Only] A warning data value corresponding to the key.
  3149. Value string `json:"value,omitempty"`
  3150. // ForceSendFields is a list of field names (e.g. "Key") to
  3151. // unconditionally include in API requests. By default, fields with
  3152. // empty values are omitted from API requests. However, any non-pointer,
  3153. // non-interface field appearing in ForceSendFields will be sent to the
  3154. // server regardless of whether the field is empty or not. This may be
  3155. // used to include empty fields in Patch requests.
  3156. ForceSendFields []string `json:"-"`
  3157. // NullFields is a list of field names (e.g. "Key") to include in API
  3158. // requests with the JSON null value. By default, fields with empty
  3159. // values are omitted from API requests. However, any field with an
  3160. // empty value appearing in NullFields will be sent to the server as
  3161. // null. It is an error if a field in this list has a non-empty value.
  3162. // This may be used to include null fields in Patch requests.
  3163. NullFields []string `json:"-"`
  3164. }
  3165. func (s *BackendBucketListWarningData) MarshalJSON() ([]byte, error) {
  3166. type NoMethod BackendBucketListWarningData
  3167. raw := NoMethod(*s)
  3168. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3169. }
  3170. // BackendService: A BackendService resource. This resource defines a
  3171. // group of backend virtual machines and their serving capacity. (==
  3172. // resource_for v1.backendService ==) (== resource_for
  3173. // beta.backendService ==)
  3174. type BackendService struct {
  3175. // AffinityCookieTtlSec: Lifetime of cookies in seconds if
  3176. // session_affinity is GENERATED_COOKIE. If set to 0, the cookie is
  3177. // non-persistent and lasts only until the end of the browser session
  3178. // (or equivalent). The maximum allowed value for TTL is one day.
  3179. //
  3180. // When the load balancing scheme is INTERNAL, this field is not used.
  3181. AffinityCookieTtlSec int64 `json:"affinityCookieTtlSec,omitempty"`
  3182. // Backends: The list of backends that serve this BackendService.
  3183. Backends []*Backend `json:"backends,omitempty"`
  3184. // CdnPolicy: Cloud CDN configuration for this BackendService.
  3185. CdnPolicy *BackendServiceCdnPolicy `json:"cdnPolicy,omitempty"`
  3186. ConnectionDraining *ConnectionDraining `json:"connectionDraining,omitempty"`
  3187. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  3188. // format.
  3189. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  3190. // CustomRequestHeaders: Headers that the HTTP/S load balancer should
  3191. // add to proxied requests.
  3192. CustomRequestHeaders []string `json:"customRequestHeaders,omitempty"`
  3193. // Description: An optional description of this resource. Provide this
  3194. // property when you create the resource.
  3195. Description string `json:"description,omitempty"`
  3196. // EnableCDN: If true, enable Cloud CDN for this BackendService.
  3197. //
  3198. // When the load balancing scheme is INTERNAL, this field is not used.
  3199. EnableCDN bool `json:"enableCDN,omitempty"`
  3200. // Fingerprint: Fingerprint of this resource. A hash of the contents
  3201. // stored in this object. This field is used in optimistic locking. This
  3202. // field will be ignored when inserting a BackendService. An up-to-date
  3203. // fingerprint must be provided in order to update the BackendService.
  3204. Fingerprint string `json:"fingerprint,omitempty"`
  3205. // HealthChecks: The list of URLs to the HttpHealthCheck or
  3206. // HttpsHealthCheck resource for health checking this BackendService.
  3207. // Currently at most one health check can be specified, and a health
  3208. // check is required for Compute Engine backend services. A health check
  3209. // must not be specified for App Engine backend and Cloud Function
  3210. // backend.
  3211. //
  3212. // For internal load balancing, a URL to a HealthCheck resource must be
  3213. // specified instead.
  3214. HealthChecks []string `json:"healthChecks,omitempty"`
  3215. Iap *BackendServiceIAP `json:"iap,omitempty"`
  3216. // Id: [Output Only] The unique identifier for the resource. This
  3217. // identifier is defined by the server.
  3218. Id uint64 `json:"id,omitempty,string"`
  3219. // Kind: [Output Only] Type of resource. Always compute#backendService
  3220. // for backend services.
  3221. Kind string `json:"kind,omitempty"`
  3222. // LoadBalancingScheme: Indicates whether the backend service will be
  3223. // used with internal or external load balancing. A backend service
  3224. // created for one type of load balancing cannot be used with the other.
  3225. // Possible values are INTERNAL and EXTERNAL.
  3226. //
  3227. // Possible values:
  3228. // "EXTERNAL"
  3229. // "INTERNAL"
  3230. // "INVALID_LOAD_BALANCING_SCHEME"
  3231. LoadBalancingScheme string `json:"loadBalancingScheme,omitempty"`
  3232. // Name: Name of the resource. Provided by the client when the resource
  3233. // is created. The name must be 1-63 characters long, and comply with
  3234. // RFC1035. Specifically, the name must be 1-63 characters long and
  3235. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  3236. // the first character must be a lowercase letter, and all following
  3237. // characters must be a dash, lowercase letter, or digit, except the
  3238. // last character, which cannot be a dash.
  3239. Name string `json:"name,omitempty"`
  3240. // Port: Deprecated in favor of portName. The TCP port to connect on the
  3241. // backend. The default value is 80.
  3242. //
  3243. // This cannot be used for internal load balancing.
  3244. Port int64 `json:"port,omitempty"`
  3245. // PortName: Name of backend port. The same name should appear in the
  3246. // instance groups referenced by this service. Required when the load
  3247. // balancing scheme is EXTERNAL.
  3248. //
  3249. // When the load balancing scheme is INTERNAL, this field is not used.
  3250. PortName string `json:"portName,omitempty"`
  3251. // Protocol: The protocol this BackendService uses to communicate with
  3252. // backends.
  3253. //
  3254. // Possible values are HTTP, HTTPS, TCP, and SSL. The default is
  3255. // HTTP.
  3256. //
  3257. // For internal load balancing, the possible values are TCP and UDP, and
  3258. // the default is TCP.
  3259. //
  3260. // Possible values:
  3261. // "HTTP"
  3262. // "HTTP2"
  3263. // "HTTPS"
  3264. // "SSL"
  3265. // "TCP"
  3266. // "UDP"
  3267. Protocol string `json:"protocol,omitempty"`
  3268. // Region: [Output Only] URL of the region where the regional backend
  3269. // service resides. This field is not applicable to global backend
  3270. // services. You must specify this field as part of the HTTP request
  3271. // URL. It is not settable as a field in the request body.
  3272. Region string `json:"region,omitempty"`
  3273. // SecurityPolicy: [Output Only] The resource URL for the security
  3274. // policy associated with this backend service.
  3275. SecurityPolicy string `json:"securityPolicy,omitempty"`
  3276. // SelfLink: [Output Only] Server-defined URL for the resource.
  3277. SelfLink string `json:"selfLink,omitempty"`
  3278. // SessionAffinity: Type of session affinity to use. The default is
  3279. // NONE.
  3280. //
  3281. // When the load balancing scheme is EXTERNAL, can be NONE, CLIENT_IP,
  3282. // or GENERATED_COOKIE.
  3283. //
  3284. // When the load balancing scheme is INTERNAL, can be NONE, CLIENT_IP,
  3285. // CLIENT_IP_PROTO, or CLIENT_IP_PORT_PROTO.
  3286. //
  3287. // When the protocol is UDP, this field is not used.
  3288. //
  3289. // Possible values:
  3290. // "CLIENT_IP"
  3291. // "CLIENT_IP_PORT_PROTO"
  3292. // "CLIENT_IP_PROTO"
  3293. // "GENERATED_COOKIE"
  3294. // "NONE"
  3295. SessionAffinity string `json:"sessionAffinity,omitempty"`
  3296. // TimeoutSec: How many seconds to wait for the backend before
  3297. // considering it a failed request. Default is 30 seconds.
  3298. TimeoutSec int64 `json:"timeoutSec,omitempty"`
  3299. // ServerResponse contains the HTTP response code and headers from the
  3300. // server.
  3301. googleapi.ServerResponse `json:"-"`
  3302. // ForceSendFields is a list of field names (e.g.
  3303. // "AffinityCookieTtlSec") to unconditionally include in API requests.
  3304. // By default, fields with empty values are omitted from API requests.
  3305. // However, any non-pointer, non-interface field appearing in
  3306. // ForceSendFields will be sent to the server regardless of whether the
  3307. // field is empty or not. This may be used to include empty fields in
  3308. // Patch requests.
  3309. ForceSendFields []string `json:"-"`
  3310. // NullFields is a list of field names (e.g. "AffinityCookieTtlSec") to
  3311. // include in API requests with the JSON null value. By default, fields
  3312. // with empty values are omitted from API requests. However, any field
  3313. // with an empty value appearing in NullFields will be sent to the
  3314. // server as null. It is an error if a field in this list has a
  3315. // non-empty value. This may be used to include null fields in Patch
  3316. // requests.
  3317. NullFields []string `json:"-"`
  3318. }
  3319. func (s *BackendService) MarshalJSON() ([]byte, error) {
  3320. type NoMethod BackendService
  3321. raw := NoMethod(*s)
  3322. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3323. }
  3324. // BackendServiceAggregatedList: Contains a list of
  3325. // BackendServicesScopedList.
  3326. type BackendServiceAggregatedList struct {
  3327. // Id: [Output Only] Unique identifier for the resource; defined by the
  3328. // server.
  3329. Id string `json:"id,omitempty"`
  3330. // Items: A list of BackendServicesScopedList resources.
  3331. Items map[string]BackendServicesScopedList `json:"items,omitempty"`
  3332. // Kind: Type of resource.
  3333. Kind string `json:"kind,omitempty"`
  3334. // NextPageToken: [Output Only] This token allows you to get the next
  3335. // page of results for list requests. If the number of results is larger
  3336. // than maxResults, use the nextPageToken as a value for the query
  3337. // parameter pageToken in the next list request. Subsequent list
  3338. // requests will have their own nextPageToken to continue paging through
  3339. // the results.
  3340. NextPageToken string `json:"nextPageToken,omitempty"`
  3341. // SelfLink: [Output Only] Server-defined URL for this resource.
  3342. SelfLink string `json:"selfLink,omitempty"`
  3343. // Warning: [Output Only] Informational warning message.
  3344. Warning *BackendServiceAggregatedListWarning `json:"warning,omitempty"`
  3345. // ServerResponse contains the HTTP response code and headers from the
  3346. // server.
  3347. googleapi.ServerResponse `json:"-"`
  3348. // ForceSendFields is a list of field names (e.g. "Id") to
  3349. // unconditionally include in API requests. By default, fields with
  3350. // empty values are omitted from API requests. However, any non-pointer,
  3351. // non-interface field appearing in ForceSendFields will be sent to the
  3352. // server regardless of whether the field is empty or not. This may be
  3353. // used to include empty fields in Patch requests.
  3354. ForceSendFields []string `json:"-"`
  3355. // NullFields is a list of field names (e.g. "Id") to include in API
  3356. // requests with the JSON null value. By default, fields with empty
  3357. // values are omitted from API requests. However, any field with an
  3358. // empty value appearing in NullFields will be sent to the server as
  3359. // null. It is an error if a field in this list has a non-empty value.
  3360. // This may be used to include null fields in Patch requests.
  3361. NullFields []string `json:"-"`
  3362. }
  3363. func (s *BackendServiceAggregatedList) MarshalJSON() ([]byte, error) {
  3364. type NoMethod BackendServiceAggregatedList
  3365. raw := NoMethod(*s)
  3366. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3367. }
  3368. // BackendServiceAggregatedListWarning: [Output Only] Informational
  3369. // warning message.
  3370. type BackendServiceAggregatedListWarning struct {
  3371. // Code: [Output Only] A warning code, if applicable. For example,
  3372. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  3373. // the response.
  3374. //
  3375. // Possible values:
  3376. // "CLEANUP_FAILED"
  3377. // "DEPRECATED_RESOURCE_USED"
  3378. // "DEPRECATED_TYPE_USED"
  3379. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  3380. // "EXPERIMENTAL_TYPE_USED"
  3381. // "EXTERNAL_API_WARNING"
  3382. // "FIELD_VALUE_OVERRIDEN"
  3383. // "INJECTED_KERNELS_DEPRECATED"
  3384. // "MISSING_TYPE_DEPENDENCY"
  3385. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  3386. // "NEXT_HOP_CANNOT_IP_FORWARD"
  3387. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  3388. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  3389. // "NEXT_HOP_NOT_RUNNING"
  3390. // "NOT_CRITICAL_ERROR"
  3391. // "NO_RESULTS_ON_PAGE"
  3392. // "REQUIRED_TOS_AGREEMENT"
  3393. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  3394. // "RESOURCE_NOT_DELETED"
  3395. // "SCHEMA_VALIDATION_IGNORED"
  3396. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  3397. // "UNDECLARED_PROPERTIES"
  3398. // "UNREACHABLE"
  3399. Code string `json:"code,omitempty"`
  3400. // Data: [Output Only] Metadata about this warning in key: value format.
  3401. // For example:
  3402. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  3403. Data []*BackendServiceAggregatedListWarningData `json:"data,omitempty"`
  3404. // Message: [Output Only] A human-readable description of the warning
  3405. // code.
  3406. Message string `json:"message,omitempty"`
  3407. // ForceSendFields is a list of field names (e.g. "Code") to
  3408. // unconditionally include in API requests. By default, fields with
  3409. // empty values are omitted from API requests. However, any non-pointer,
  3410. // non-interface field appearing in ForceSendFields will be sent to the
  3411. // server regardless of whether the field is empty or not. This may be
  3412. // used to include empty fields in Patch requests.
  3413. ForceSendFields []string `json:"-"`
  3414. // NullFields is a list of field names (e.g. "Code") to include in API
  3415. // requests with the JSON null value. By default, fields with empty
  3416. // values are omitted from API requests. However, any field with an
  3417. // empty value appearing in NullFields will be sent to the server as
  3418. // null. It is an error if a field in this list has a non-empty value.
  3419. // This may be used to include null fields in Patch requests.
  3420. NullFields []string `json:"-"`
  3421. }
  3422. func (s *BackendServiceAggregatedListWarning) MarshalJSON() ([]byte, error) {
  3423. type NoMethod BackendServiceAggregatedListWarning
  3424. raw := NoMethod(*s)
  3425. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3426. }
  3427. type BackendServiceAggregatedListWarningData struct {
  3428. // Key: [Output Only] A key that provides more detail on the warning
  3429. // being returned. For example, for warnings where there are no results
  3430. // in a list request for a particular zone, this key might be scope and
  3431. // the key value might be the zone name. Other examples might be a key
  3432. // indicating a deprecated resource and a suggested replacement, or a
  3433. // warning about invalid network settings (for example, if an instance
  3434. // attempts to perform IP forwarding but is not enabled for IP
  3435. // forwarding).
  3436. Key string `json:"key,omitempty"`
  3437. // Value: [Output Only] A warning data value corresponding to the key.
  3438. Value string `json:"value,omitempty"`
  3439. // ForceSendFields is a list of field names (e.g. "Key") to
  3440. // unconditionally include in API requests. By default, fields with
  3441. // empty values are omitted from API requests. However, any non-pointer,
  3442. // non-interface field appearing in ForceSendFields will be sent to the
  3443. // server regardless of whether the field is empty or not. This may be
  3444. // used to include empty fields in Patch requests.
  3445. ForceSendFields []string `json:"-"`
  3446. // NullFields is a list of field names (e.g. "Key") to include in API
  3447. // requests with the JSON null value. By default, fields with empty
  3448. // values are omitted from API requests. However, any field with an
  3449. // empty value appearing in NullFields will be sent to the server as
  3450. // null. It is an error if a field in this list has a non-empty value.
  3451. // This may be used to include null fields in Patch requests.
  3452. NullFields []string `json:"-"`
  3453. }
  3454. func (s *BackendServiceAggregatedListWarningData) MarshalJSON() ([]byte, error) {
  3455. type NoMethod BackendServiceAggregatedListWarningData
  3456. raw := NoMethod(*s)
  3457. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3458. }
  3459. // BackendServiceCdnPolicy: Message containing Cloud CDN configuration
  3460. // for a backend service.
  3461. type BackendServiceCdnPolicy struct {
  3462. // CacheKeyPolicy: The CacheKeyPolicy for this CdnPolicy.
  3463. CacheKeyPolicy *CacheKeyPolicy `json:"cacheKeyPolicy,omitempty"`
  3464. // SignedUrlCacheMaxAgeSec: Number of seconds up to which the response
  3465. // to a signed URL request will be cached in the CDN. After this time
  3466. // period, the Signed URL will be revalidated before being served.
  3467. // Defaults to 1hr (3600s). If this field is set, Cloud CDN will
  3468. // internally act as though all responses from this backend had a
  3469. // ?Cache-Control: public, max-age=[TTL]? header, regardless of any
  3470. // existing Cache-Control header. The actual headers served in responses
  3471. // will not be altered.
  3472. SignedUrlCacheMaxAgeSec int64 `json:"signedUrlCacheMaxAgeSec,omitempty,string"`
  3473. // SignedUrlKeyNames: [Output Only] Names of the keys currently
  3474. // configured for Cloud CDN Signed URL on this backend service.
  3475. SignedUrlKeyNames []string `json:"signedUrlKeyNames,omitempty"`
  3476. // ForceSendFields is a list of field names (e.g. "CacheKeyPolicy") to
  3477. // unconditionally include in API requests. By default, fields with
  3478. // empty values are omitted from API requests. However, any non-pointer,
  3479. // non-interface field appearing in ForceSendFields will be sent to the
  3480. // server regardless of whether the field is empty or not. This may be
  3481. // used to include empty fields in Patch requests.
  3482. ForceSendFields []string `json:"-"`
  3483. // NullFields is a list of field names (e.g. "CacheKeyPolicy") to
  3484. // include in API requests with the JSON null value. By default, fields
  3485. // with empty values are omitted from API requests. However, any field
  3486. // with an empty value appearing in NullFields will be sent to the
  3487. // server as null. It is an error if a field in this list has a
  3488. // non-empty value. This may be used to include null fields in Patch
  3489. // requests.
  3490. NullFields []string `json:"-"`
  3491. }
  3492. func (s *BackendServiceCdnPolicy) MarshalJSON() ([]byte, error) {
  3493. type NoMethod BackendServiceCdnPolicy
  3494. raw := NoMethod(*s)
  3495. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3496. }
  3497. type BackendServiceGroupHealth struct {
  3498. HealthStatus []*HealthStatus `json:"healthStatus,omitempty"`
  3499. // Kind: [Output Only] Type of resource. Always
  3500. // compute#backendServiceGroupHealth for the health of backend services.
  3501. Kind string `json:"kind,omitempty"`
  3502. // ServerResponse contains the HTTP response code and headers from the
  3503. // server.
  3504. googleapi.ServerResponse `json:"-"`
  3505. // ForceSendFields is a list of field names (e.g. "HealthStatus") to
  3506. // unconditionally include in API requests. By default, fields with
  3507. // empty values are omitted from API requests. However, any non-pointer,
  3508. // non-interface field appearing in ForceSendFields will be sent to the
  3509. // server regardless of whether the field is empty or not. This may be
  3510. // used to include empty fields in Patch requests.
  3511. ForceSendFields []string `json:"-"`
  3512. // NullFields is a list of field names (e.g. "HealthStatus") to include
  3513. // in API requests with the JSON null value. By default, fields with
  3514. // empty values are omitted from API requests. However, any field with
  3515. // an empty value appearing in NullFields will be sent to the server as
  3516. // null. It is an error if a field in this list has a non-empty value.
  3517. // This may be used to include null fields in Patch requests.
  3518. NullFields []string `json:"-"`
  3519. }
  3520. func (s *BackendServiceGroupHealth) MarshalJSON() ([]byte, error) {
  3521. type NoMethod BackendServiceGroupHealth
  3522. raw := NoMethod(*s)
  3523. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3524. }
  3525. // BackendServiceIAP: Identity-Aware Proxy
  3526. type BackendServiceIAP struct {
  3527. Enabled bool `json:"enabled,omitempty"`
  3528. Oauth2ClientId string `json:"oauth2ClientId,omitempty"`
  3529. Oauth2ClientSecret string `json:"oauth2ClientSecret,omitempty"`
  3530. // Oauth2ClientSecretSha256: [Output Only] SHA256 hash value for the
  3531. // field oauth2_client_secret above.
  3532. Oauth2ClientSecretSha256 string `json:"oauth2ClientSecretSha256,omitempty"`
  3533. // ForceSendFields is a list of field names (e.g. "Enabled") to
  3534. // unconditionally include in API requests. By default, fields with
  3535. // empty values are omitted from API requests. However, any non-pointer,
  3536. // non-interface field appearing in ForceSendFields will be sent to the
  3537. // server regardless of whether the field is empty or not. This may be
  3538. // used to include empty fields in Patch requests.
  3539. ForceSendFields []string `json:"-"`
  3540. // NullFields is a list of field names (e.g. "Enabled") to include in
  3541. // API requests with the JSON null value. By default, fields with empty
  3542. // values are omitted from API requests. However, any field with an
  3543. // empty value appearing in NullFields will be sent to the server as
  3544. // null. It is an error if a field in this list has a non-empty value.
  3545. // This may be used to include null fields in Patch requests.
  3546. NullFields []string `json:"-"`
  3547. }
  3548. func (s *BackendServiceIAP) MarshalJSON() ([]byte, error) {
  3549. type NoMethod BackendServiceIAP
  3550. raw := NoMethod(*s)
  3551. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3552. }
  3553. // BackendServiceList: Contains a list of BackendService resources.
  3554. type BackendServiceList struct {
  3555. // Id: [Output Only] Unique identifier for the resource; defined by the
  3556. // server.
  3557. Id string `json:"id,omitempty"`
  3558. // Items: A list of BackendService resources.
  3559. Items []*BackendService `json:"items,omitempty"`
  3560. // Kind: [Output Only] Type of resource. Always
  3561. // compute#backendServiceList for lists of backend services.
  3562. Kind string `json:"kind,omitempty"`
  3563. // NextPageToken: [Output Only] This token allows you to get the next
  3564. // page of results for list requests. If the number of results is larger
  3565. // than maxResults, use the nextPageToken as a value for the query
  3566. // parameter pageToken in the next list request. Subsequent list
  3567. // requests will have their own nextPageToken to continue paging through
  3568. // the results.
  3569. NextPageToken string `json:"nextPageToken,omitempty"`
  3570. // SelfLink: [Output Only] Server-defined URL for this resource.
  3571. SelfLink string `json:"selfLink,omitempty"`
  3572. // Warning: [Output Only] Informational warning message.
  3573. Warning *BackendServiceListWarning `json:"warning,omitempty"`
  3574. // ServerResponse contains the HTTP response code and headers from the
  3575. // server.
  3576. googleapi.ServerResponse `json:"-"`
  3577. // ForceSendFields is a list of field names (e.g. "Id") to
  3578. // unconditionally include in API requests. By default, fields with
  3579. // empty values are omitted from API requests. However, any non-pointer,
  3580. // non-interface field appearing in ForceSendFields will be sent to the
  3581. // server regardless of whether the field is empty or not. This may be
  3582. // used to include empty fields in Patch requests.
  3583. ForceSendFields []string `json:"-"`
  3584. // NullFields is a list of field names (e.g. "Id") to include in API
  3585. // requests with the JSON null value. By default, fields with empty
  3586. // values are omitted from API requests. However, any field with an
  3587. // empty value appearing in NullFields will be sent to the server as
  3588. // null. It is an error if a field in this list has a non-empty value.
  3589. // This may be used to include null fields in Patch requests.
  3590. NullFields []string `json:"-"`
  3591. }
  3592. func (s *BackendServiceList) MarshalJSON() ([]byte, error) {
  3593. type NoMethod BackendServiceList
  3594. raw := NoMethod(*s)
  3595. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3596. }
  3597. // BackendServiceListWarning: [Output Only] Informational warning
  3598. // message.
  3599. type BackendServiceListWarning struct {
  3600. // Code: [Output Only] A warning code, if applicable. For example,
  3601. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  3602. // the response.
  3603. //
  3604. // Possible values:
  3605. // "CLEANUP_FAILED"
  3606. // "DEPRECATED_RESOURCE_USED"
  3607. // "DEPRECATED_TYPE_USED"
  3608. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  3609. // "EXPERIMENTAL_TYPE_USED"
  3610. // "EXTERNAL_API_WARNING"
  3611. // "FIELD_VALUE_OVERRIDEN"
  3612. // "INJECTED_KERNELS_DEPRECATED"
  3613. // "MISSING_TYPE_DEPENDENCY"
  3614. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  3615. // "NEXT_HOP_CANNOT_IP_FORWARD"
  3616. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  3617. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  3618. // "NEXT_HOP_NOT_RUNNING"
  3619. // "NOT_CRITICAL_ERROR"
  3620. // "NO_RESULTS_ON_PAGE"
  3621. // "REQUIRED_TOS_AGREEMENT"
  3622. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  3623. // "RESOURCE_NOT_DELETED"
  3624. // "SCHEMA_VALIDATION_IGNORED"
  3625. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  3626. // "UNDECLARED_PROPERTIES"
  3627. // "UNREACHABLE"
  3628. Code string `json:"code,omitempty"`
  3629. // Data: [Output Only] Metadata about this warning in key: value format.
  3630. // For example:
  3631. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  3632. Data []*BackendServiceListWarningData `json:"data,omitempty"`
  3633. // Message: [Output Only] A human-readable description of the warning
  3634. // code.
  3635. Message string `json:"message,omitempty"`
  3636. // ForceSendFields is a list of field names (e.g. "Code") to
  3637. // unconditionally include in API requests. By default, fields with
  3638. // empty values are omitted from API requests. However, any non-pointer,
  3639. // non-interface field appearing in ForceSendFields will be sent to the
  3640. // server regardless of whether the field is empty or not. This may be
  3641. // used to include empty fields in Patch requests.
  3642. ForceSendFields []string `json:"-"`
  3643. // NullFields is a list of field names (e.g. "Code") to include in API
  3644. // requests with the JSON null value. By default, fields with empty
  3645. // values are omitted from API requests. However, any field with an
  3646. // empty value appearing in NullFields will be sent to the server as
  3647. // null. It is an error if a field in this list has a non-empty value.
  3648. // This may be used to include null fields in Patch requests.
  3649. NullFields []string `json:"-"`
  3650. }
  3651. func (s *BackendServiceListWarning) MarshalJSON() ([]byte, error) {
  3652. type NoMethod BackendServiceListWarning
  3653. raw := NoMethod(*s)
  3654. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3655. }
  3656. type BackendServiceListWarningData struct {
  3657. // Key: [Output Only] A key that provides more detail on the warning
  3658. // being returned. For example, for warnings where there are no results
  3659. // in a list request for a particular zone, this key might be scope and
  3660. // the key value might be the zone name. Other examples might be a key
  3661. // indicating a deprecated resource and a suggested replacement, or a
  3662. // warning about invalid network settings (for example, if an instance
  3663. // attempts to perform IP forwarding but is not enabled for IP
  3664. // forwarding).
  3665. Key string `json:"key,omitempty"`
  3666. // Value: [Output Only] A warning data value corresponding to the key.
  3667. Value string `json:"value,omitempty"`
  3668. // ForceSendFields is a list of field names (e.g. "Key") to
  3669. // unconditionally include in API requests. By default, fields with
  3670. // empty values are omitted from API requests. However, any non-pointer,
  3671. // non-interface field appearing in ForceSendFields will be sent to the
  3672. // server regardless of whether the field is empty or not. This may be
  3673. // used to include empty fields in Patch requests.
  3674. ForceSendFields []string `json:"-"`
  3675. // NullFields is a list of field names (e.g. "Key") to include in API
  3676. // requests with the JSON null value. By default, fields with empty
  3677. // values are omitted from API requests. However, any field with an
  3678. // empty value appearing in NullFields will be sent to the server as
  3679. // null. It is an error if a field in this list has a non-empty value.
  3680. // This may be used to include null fields in Patch requests.
  3681. NullFields []string `json:"-"`
  3682. }
  3683. func (s *BackendServiceListWarningData) MarshalJSON() ([]byte, error) {
  3684. type NoMethod BackendServiceListWarningData
  3685. raw := NoMethod(*s)
  3686. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3687. }
  3688. type BackendServiceReference struct {
  3689. BackendService string `json:"backendService,omitempty"`
  3690. // ForceSendFields is a list of field names (e.g. "BackendService") to
  3691. // unconditionally include in API requests. By default, fields with
  3692. // empty values are omitted from API requests. However, any non-pointer,
  3693. // non-interface field appearing in ForceSendFields will be sent to the
  3694. // server regardless of whether the field is empty or not. This may be
  3695. // used to include empty fields in Patch requests.
  3696. ForceSendFields []string `json:"-"`
  3697. // NullFields is a list of field names (e.g. "BackendService") to
  3698. // include in API requests with the JSON null value. By default, fields
  3699. // with empty values are omitted from API requests. However, any field
  3700. // with an empty value appearing in NullFields will be sent to the
  3701. // server as null. It is an error if a field in this list has a
  3702. // non-empty value. This may be used to include null fields in Patch
  3703. // requests.
  3704. NullFields []string `json:"-"`
  3705. }
  3706. func (s *BackendServiceReference) MarshalJSON() ([]byte, error) {
  3707. type NoMethod BackendServiceReference
  3708. raw := NoMethod(*s)
  3709. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3710. }
  3711. type BackendServicesScopedList struct {
  3712. // BackendServices: A list of BackendServices contained in this scope.
  3713. BackendServices []*BackendService `json:"backendServices,omitempty"`
  3714. // Warning: Informational warning which replaces the list of backend
  3715. // services when the list is empty.
  3716. Warning *BackendServicesScopedListWarning `json:"warning,omitempty"`
  3717. // ForceSendFields is a list of field names (e.g. "BackendServices") to
  3718. // unconditionally include in API requests. By default, fields with
  3719. // empty values are omitted from API requests. However, any non-pointer,
  3720. // non-interface field appearing in ForceSendFields will be sent to the
  3721. // server regardless of whether the field is empty or not. This may be
  3722. // used to include empty fields in Patch requests.
  3723. ForceSendFields []string `json:"-"`
  3724. // NullFields is a list of field names (e.g. "BackendServices") to
  3725. // include in API requests with the JSON null value. By default, fields
  3726. // with empty values are omitted from API requests. However, any field
  3727. // with an empty value appearing in NullFields will be sent to the
  3728. // server as null. It is an error if a field in this list has a
  3729. // non-empty value. This may be used to include null fields in Patch
  3730. // requests.
  3731. NullFields []string `json:"-"`
  3732. }
  3733. func (s *BackendServicesScopedList) MarshalJSON() ([]byte, error) {
  3734. type NoMethod BackendServicesScopedList
  3735. raw := NoMethod(*s)
  3736. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3737. }
  3738. // BackendServicesScopedListWarning: Informational warning which
  3739. // replaces the list of backend services when the list is empty.
  3740. type BackendServicesScopedListWarning struct {
  3741. // Code: [Output Only] A warning code, if applicable. For example,
  3742. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  3743. // the response.
  3744. //
  3745. // Possible values:
  3746. // "CLEANUP_FAILED"
  3747. // "DEPRECATED_RESOURCE_USED"
  3748. // "DEPRECATED_TYPE_USED"
  3749. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  3750. // "EXPERIMENTAL_TYPE_USED"
  3751. // "EXTERNAL_API_WARNING"
  3752. // "FIELD_VALUE_OVERRIDEN"
  3753. // "INJECTED_KERNELS_DEPRECATED"
  3754. // "MISSING_TYPE_DEPENDENCY"
  3755. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  3756. // "NEXT_HOP_CANNOT_IP_FORWARD"
  3757. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  3758. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  3759. // "NEXT_HOP_NOT_RUNNING"
  3760. // "NOT_CRITICAL_ERROR"
  3761. // "NO_RESULTS_ON_PAGE"
  3762. // "REQUIRED_TOS_AGREEMENT"
  3763. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  3764. // "RESOURCE_NOT_DELETED"
  3765. // "SCHEMA_VALIDATION_IGNORED"
  3766. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  3767. // "UNDECLARED_PROPERTIES"
  3768. // "UNREACHABLE"
  3769. Code string `json:"code,omitempty"`
  3770. // Data: [Output Only] Metadata about this warning in key: value format.
  3771. // For example:
  3772. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  3773. Data []*BackendServicesScopedListWarningData `json:"data,omitempty"`
  3774. // Message: [Output Only] A human-readable description of the warning
  3775. // code.
  3776. Message string `json:"message,omitempty"`
  3777. // ForceSendFields is a list of field names (e.g. "Code") to
  3778. // unconditionally include in API requests. By default, fields with
  3779. // empty values are omitted from API requests. However, any non-pointer,
  3780. // non-interface field appearing in ForceSendFields will be sent to the
  3781. // server regardless of whether the field is empty or not. This may be
  3782. // used to include empty fields in Patch requests.
  3783. ForceSendFields []string `json:"-"`
  3784. // NullFields is a list of field names (e.g. "Code") to include in API
  3785. // requests with the JSON null value. By default, fields with empty
  3786. // values are omitted from API requests. However, any field with an
  3787. // empty value appearing in NullFields will be sent to the server as
  3788. // null. It is an error if a field in this list has a non-empty value.
  3789. // This may be used to include null fields in Patch requests.
  3790. NullFields []string `json:"-"`
  3791. }
  3792. func (s *BackendServicesScopedListWarning) MarshalJSON() ([]byte, error) {
  3793. type NoMethod BackendServicesScopedListWarning
  3794. raw := NoMethod(*s)
  3795. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3796. }
  3797. type BackendServicesScopedListWarningData struct {
  3798. // Key: [Output Only] A key that provides more detail on the warning
  3799. // being returned. For example, for warnings where there are no results
  3800. // in a list request for a particular zone, this key might be scope and
  3801. // the key value might be the zone name. Other examples might be a key
  3802. // indicating a deprecated resource and a suggested replacement, or a
  3803. // warning about invalid network settings (for example, if an instance
  3804. // attempts to perform IP forwarding but is not enabled for IP
  3805. // forwarding).
  3806. Key string `json:"key,omitempty"`
  3807. // Value: [Output Only] A warning data value corresponding to the key.
  3808. Value string `json:"value,omitempty"`
  3809. // ForceSendFields is a list of field names (e.g. "Key") to
  3810. // unconditionally include in API requests. By default, fields with
  3811. // empty values are omitted from API requests. However, any non-pointer,
  3812. // non-interface field appearing in ForceSendFields will be sent to the
  3813. // server regardless of whether the field is empty or not. This may be
  3814. // used to include empty fields in Patch requests.
  3815. ForceSendFields []string `json:"-"`
  3816. // NullFields is a list of field names (e.g. "Key") to include in API
  3817. // requests with the JSON null value. By default, fields with empty
  3818. // values are omitted from API requests. However, any field with an
  3819. // empty value appearing in NullFields will be sent to the server as
  3820. // null. It is an error if a field in this list has a non-empty value.
  3821. // This may be used to include null fields in Patch requests.
  3822. NullFields []string `json:"-"`
  3823. }
  3824. func (s *BackendServicesScopedListWarningData) MarshalJSON() ([]byte, error) {
  3825. type NoMethod BackendServicesScopedListWarningData
  3826. raw := NoMethod(*s)
  3827. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3828. }
  3829. // Binding: Associates `members` with a `role`.
  3830. type Binding struct {
  3831. // Condition: The condition that is associated with this binding. NOTE:
  3832. // an unsatisfied condition will not allow user access via current
  3833. // binding. Different bindings, including their conditions, are examined
  3834. // independently. This field is only visible as GOOGLE_INTERNAL or
  3835. // CONDITION_TRUSTED_TESTER.
  3836. Condition *Expr `json:"condition,omitempty"`
  3837. // Members: Specifies the identities requesting access for a Cloud
  3838. // Platform resource. `members` can have the following values:
  3839. //
  3840. // * `allUsers`: A special identifier that represents anyone who is on
  3841. // the internet; with or without a Google account.
  3842. //
  3843. // * `allAuthenticatedUsers`: A special identifier that represents
  3844. // anyone who is authenticated with a Google account or a service
  3845. // account.
  3846. //
  3847. // * `user:{emailid}`: An email address that represents a specific
  3848. // Google account. For example, `alice@gmail.com` .
  3849. //
  3850. //
  3851. //
  3852. // * `serviceAccount:{emailid}`: An email address that represents a
  3853. // service account. For example,
  3854. // `my-other-app@appspot.gserviceaccount.com`.
  3855. //
  3856. // * `group:{emailid}`: An email address that represents a Google group.
  3857. // For example, `admins@example.com`.
  3858. //
  3859. //
  3860. //
  3861. // * `domain:{domain}`: A Google Apps domain name that represents all
  3862. // the users of that domain. For example, `google.com` or `example.com`.
  3863. Members []string `json:"members,omitempty"`
  3864. // Role: Role that is assigned to `members`. For example,
  3865. // `roles/viewer`, `roles/editor`, or `roles/owner`.
  3866. Role string `json:"role,omitempty"`
  3867. // ForceSendFields is a list of field names (e.g. "Condition") to
  3868. // unconditionally include in API requests. By default, fields with
  3869. // empty values are omitted from API requests. However, any non-pointer,
  3870. // non-interface field appearing in ForceSendFields will be sent to the
  3871. // server regardless of whether the field is empty or not. This may be
  3872. // used to include empty fields in Patch requests.
  3873. ForceSendFields []string `json:"-"`
  3874. // NullFields is a list of field names (e.g. "Condition") to include in
  3875. // API requests with the JSON null value. By default, fields with empty
  3876. // values are omitted from API requests. However, any field with an
  3877. // empty value appearing in NullFields will be sent to the server as
  3878. // null. It is an error if a field in this list has a non-empty value.
  3879. // This may be used to include null fields in Patch requests.
  3880. NullFields []string `json:"-"`
  3881. }
  3882. func (s *Binding) MarshalJSON() ([]byte, error) {
  3883. type NoMethod Binding
  3884. raw := NoMethod(*s)
  3885. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3886. }
  3887. type CacheInvalidationRule struct {
  3888. // Host: If set, this invalidation rule will only apply to requests with
  3889. // a Host header matching host.
  3890. Host string `json:"host,omitempty"`
  3891. Path string `json:"path,omitempty"`
  3892. // ForceSendFields is a list of field names (e.g. "Host") to
  3893. // unconditionally include in API requests. By default, fields with
  3894. // empty values are omitted from API requests. However, any non-pointer,
  3895. // non-interface field appearing in ForceSendFields will be sent to the
  3896. // server regardless of whether the field is empty or not. This may be
  3897. // used to include empty fields in Patch requests.
  3898. ForceSendFields []string `json:"-"`
  3899. // NullFields is a list of field names (e.g. "Host") to include in API
  3900. // requests with the JSON null value. By default, fields with empty
  3901. // values are omitted from API requests. However, any field with an
  3902. // empty value appearing in NullFields will be sent to the server as
  3903. // null. It is an error if a field in this list has a non-empty value.
  3904. // This may be used to include null fields in Patch requests.
  3905. NullFields []string `json:"-"`
  3906. }
  3907. func (s *CacheInvalidationRule) MarshalJSON() ([]byte, error) {
  3908. type NoMethod CacheInvalidationRule
  3909. raw := NoMethod(*s)
  3910. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3911. }
  3912. // CacheKeyPolicy: Message containing what to include in the cache key
  3913. // for a request for Cloud CDN.
  3914. type CacheKeyPolicy struct {
  3915. // IncludeHost: If true, requests to different hosts will be cached
  3916. // separately.
  3917. IncludeHost bool `json:"includeHost,omitempty"`
  3918. // IncludeProtocol: If true, http and https requests will be cached
  3919. // separately.
  3920. IncludeProtocol bool `json:"includeProtocol,omitempty"`
  3921. // IncludeQueryString: If true, include query string parameters in the
  3922. // cache key according to query_string_whitelist and
  3923. // query_string_blacklist. If neither is set, the entire query string
  3924. // will be included. If false, the query string will be excluded from
  3925. // the cache key entirely.
  3926. IncludeQueryString bool `json:"includeQueryString,omitempty"`
  3927. // QueryStringBlacklist: Names of query string parameters to exclude in
  3928. // cache keys. All other parameters will be included. Either specify
  3929. // query_string_whitelist or query_string_blacklist, not both. '&' and
  3930. // '=' will be percent encoded and not treated as delimiters.
  3931. QueryStringBlacklist []string `json:"queryStringBlacklist,omitempty"`
  3932. // QueryStringWhitelist: Names of query string parameters to include in
  3933. // cache keys. All other parameters will be excluded. Either specify
  3934. // query_string_whitelist or query_string_blacklist, not both. '&' and
  3935. // '=' will be percent encoded and not treated as delimiters.
  3936. QueryStringWhitelist []string `json:"queryStringWhitelist,omitempty"`
  3937. // ForceSendFields is a list of field names (e.g. "IncludeHost") to
  3938. // unconditionally include in API requests. By default, fields with
  3939. // empty values are omitted from API requests. However, any non-pointer,
  3940. // non-interface field appearing in ForceSendFields will be sent to the
  3941. // server regardless of whether the field is empty or not. This may be
  3942. // used to include empty fields in Patch requests.
  3943. ForceSendFields []string `json:"-"`
  3944. // NullFields is a list of field names (e.g. "IncludeHost") to include
  3945. // in API requests with the JSON null value. By default, fields with
  3946. // empty values are omitted from API requests. However, any field with
  3947. // an empty value appearing in NullFields will be sent to the server as
  3948. // null. It is an error if a field in this list has a non-empty value.
  3949. // This may be used to include null fields in Patch requests.
  3950. NullFields []string `json:"-"`
  3951. }
  3952. func (s *CacheKeyPolicy) MarshalJSON() ([]byte, error) {
  3953. type NoMethod CacheKeyPolicy
  3954. raw := NoMethod(*s)
  3955. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3956. }
  3957. // Commitment: Represents a Commitment resource. Creating a Commitment
  3958. // resource means that you are purchasing a committed use contract with
  3959. // an explicit start and end time. You can create commitments based on
  3960. // vCPUs and memory usage and receive discounted rates. For full
  3961. // details, read Signing Up for Committed Use Discounts.
  3962. //
  3963. // Committed use discounts are subject to Google Cloud Platform's
  3964. // Service Specific Terms. By purchasing a committed use discount, you
  3965. // agree to these terms. Committed use discounts will not renew, so you
  3966. // must purchase a new commitment to continue receiving discounts. (==
  3967. // resource_for beta.commitments ==) (== resource_for v1.commitments ==)
  3968. type Commitment struct {
  3969. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  3970. // format.
  3971. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  3972. // Description: An optional description of this resource. Provide this
  3973. // property when you create the resource.
  3974. Description string `json:"description,omitempty"`
  3975. // EndTimestamp: [Output Only] Commitment end time in RFC3339 text
  3976. // format.
  3977. EndTimestamp string `json:"endTimestamp,omitempty"`
  3978. // Id: [Output Only] The unique identifier for the resource. This
  3979. // identifier is defined by the server.
  3980. Id uint64 `json:"id,omitempty,string"`
  3981. // Kind: [Output Only] Type of the resource. Always compute#commitment
  3982. // for commitments.
  3983. Kind string `json:"kind,omitempty"`
  3984. // Name: Name of the resource. Provided by the client when the resource
  3985. // is created. The name must be 1-63 characters long, and comply with
  3986. // RFC1035. Specifically, the name must be 1-63 characters long and
  3987. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  3988. // the first character must be a lowercase letter, and all following
  3989. // characters must be a dash, lowercase letter, or digit, except the
  3990. // last character, which cannot be a dash.
  3991. Name string `json:"name,omitempty"`
  3992. // Plan: The plan for this commitment, which determines duration and
  3993. // discount rate. The currently supported plans are TWELVE_MONTH (1
  3994. // year), and THIRTY_SIX_MONTH (3 years).
  3995. //
  3996. // Possible values:
  3997. // "INVALID"
  3998. // "THIRTY_SIX_MONTH"
  3999. // "TWELVE_MONTH"
  4000. Plan string `json:"plan,omitempty"`
  4001. // Region: [Output Only] URL of the region where this commitment may be
  4002. // used.
  4003. Region string `json:"region,omitempty"`
  4004. // Resources: A list of commitment amounts for particular resources.
  4005. // Note that VCPU and MEMORY resource commitments must occur together.
  4006. Resources []*ResourceCommitment `json:"resources,omitempty"`
  4007. // SelfLink: [Output Only] Server-defined URL for the resource.
  4008. SelfLink string `json:"selfLink,omitempty"`
  4009. // StartTimestamp: [Output Only] Commitment start time in RFC3339 text
  4010. // format.
  4011. StartTimestamp string `json:"startTimestamp,omitempty"`
  4012. // Status: [Output Only] Status of the commitment with regards to
  4013. // eventual expiration (each commitment has an end date defined). One of
  4014. // the following values: NOT_YET_ACTIVE, ACTIVE, EXPIRED.
  4015. //
  4016. // Possible values:
  4017. // "ACTIVE"
  4018. // "CREATING"
  4019. // "EXPIRED"
  4020. // "NOT_YET_ACTIVE"
  4021. Status string `json:"status,omitempty"`
  4022. // StatusMessage: [Output Only] An optional, human-readable explanation
  4023. // of the status.
  4024. StatusMessage string `json:"statusMessage,omitempty"`
  4025. // ServerResponse contains the HTTP response code and headers from the
  4026. // server.
  4027. googleapi.ServerResponse `json:"-"`
  4028. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  4029. // to unconditionally include in API requests. By default, fields with
  4030. // empty values are omitted from API requests. However, any non-pointer,
  4031. // non-interface field appearing in ForceSendFields will be sent to the
  4032. // server regardless of whether the field is empty or not. This may be
  4033. // used to include empty fields in Patch requests.
  4034. ForceSendFields []string `json:"-"`
  4035. // NullFields is a list of field names (e.g. "CreationTimestamp") to
  4036. // include in API requests with the JSON null value. By default, fields
  4037. // with empty values are omitted from API requests. However, any field
  4038. // with an empty value appearing in NullFields will be sent to the
  4039. // server as null. It is an error if a field in this list has a
  4040. // non-empty value. This may be used to include null fields in Patch
  4041. // requests.
  4042. NullFields []string `json:"-"`
  4043. }
  4044. func (s *Commitment) MarshalJSON() ([]byte, error) {
  4045. type NoMethod Commitment
  4046. raw := NoMethod(*s)
  4047. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4048. }
  4049. type CommitmentAggregatedList struct {
  4050. // Id: [Output Only] Unique identifier for the resource; defined by the
  4051. // server.
  4052. Id string `json:"id,omitempty"`
  4053. // Items: A list of CommitmentsScopedList resources.
  4054. Items map[string]CommitmentsScopedList `json:"items,omitempty"`
  4055. // Kind: [Output Only] Type of resource. Always
  4056. // compute#commitmentAggregatedList for aggregated lists of commitments.
  4057. Kind string `json:"kind,omitempty"`
  4058. // NextPageToken: [Output Only] This token allows you to get the next
  4059. // page of results for list requests. If the number of results is larger
  4060. // than maxResults, use the nextPageToken as a value for the query
  4061. // parameter pageToken in the next list request. Subsequent list
  4062. // requests will have their own nextPageToken to continue paging through
  4063. // the results.
  4064. NextPageToken string `json:"nextPageToken,omitempty"`
  4065. // SelfLink: [Output Only] Server-defined URL for this resource.
  4066. SelfLink string `json:"selfLink,omitempty"`
  4067. // Warning: [Output Only] Informational warning message.
  4068. Warning *CommitmentAggregatedListWarning `json:"warning,omitempty"`
  4069. // ServerResponse contains the HTTP response code and headers from the
  4070. // server.
  4071. googleapi.ServerResponse `json:"-"`
  4072. // ForceSendFields is a list of field names (e.g. "Id") to
  4073. // unconditionally include in API requests. By default, fields with
  4074. // empty values are omitted from API requests. However, any non-pointer,
  4075. // non-interface field appearing in ForceSendFields will be sent to the
  4076. // server regardless of whether the field is empty or not. This may be
  4077. // used to include empty fields in Patch requests.
  4078. ForceSendFields []string `json:"-"`
  4079. // NullFields is a list of field names (e.g. "Id") to include in API
  4080. // requests with the JSON null value. By default, fields with empty
  4081. // values are omitted from API requests. However, any field with an
  4082. // empty value appearing in NullFields will be sent to the server as
  4083. // null. It is an error if a field in this list has a non-empty value.
  4084. // This may be used to include null fields in Patch requests.
  4085. NullFields []string `json:"-"`
  4086. }
  4087. func (s *CommitmentAggregatedList) MarshalJSON() ([]byte, error) {
  4088. type NoMethod CommitmentAggregatedList
  4089. raw := NoMethod(*s)
  4090. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4091. }
  4092. // CommitmentAggregatedListWarning: [Output Only] Informational warning
  4093. // message.
  4094. type CommitmentAggregatedListWarning struct {
  4095. // Code: [Output Only] A warning code, if applicable. For example,
  4096. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  4097. // the response.
  4098. //
  4099. // Possible values:
  4100. // "CLEANUP_FAILED"
  4101. // "DEPRECATED_RESOURCE_USED"
  4102. // "DEPRECATED_TYPE_USED"
  4103. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  4104. // "EXPERIMENTAL_TYPE_USED"
  4105. // "EXTERNAL_API_WARNING"
  4106. // "FIELD_VALUE_OVERRIDEN"
  4107. // "INJECTED_KERNELS_DEPRECATED"
  4108. // "MISSING_TYPE_DEPENDENCY"
  4109. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  4110. // "NEXT_HOP_CANNOT_IP_FORWARD"
  4111. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  4112. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  4113. // "NEXT_HOP_NOT_RUNNING"
  4114. // "NOT_CRITICAL_ERROR"
  4115. // "NO_RESULTS_ON_PAGE"
  4116. // "REQUIRED_TOS_AGREEMENT"
  4117. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  4118. // "RESOURCE_NOT_DELETED"
  4119. // "SCHEMA_VALIDATION_IGNORED"
  4120. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  4121. // "UNDECLARED_PROPERTIES"
  4122. // "UNREACHABLE"
  4123. Code string `json:"code,omitempty"`
  4124. // Data: [Output Only] Metadata about this warning in key: value format.
  4125. // For example:
  4126. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  4127. Data []*CommitmentAggregatedListWarningData `json:"data,omitempty"`
  4128. // Message: [Output Only] A human-readable description of the warning
  4129. // code.
  4130. Message string `json:"message,omitempty"`
  4131. // ForceSendFields is a list of field names (e.g. "Code") to
  4132. // unconditionally include in API requests. By default, fields with
  4133. // empty values are omitted from API requests. However, any non-pointer,
  4134. // non-interface field appearing in ForceSendFields will be sent to the
  4135. // server regardless of whether the field is empty or not. This may be
  4136. // used to include empty fields in Patch requests.
  4137. ForceSendFields []string `json:"-"`
  4138. // NullFields is a list of field names (e.g. "Code") to include in API
  4139. // requests with the JSON null value. By default, fields with empty
  4140. // values are omitted from API requests. However, any field with an
  4141. // empty value appearing in NullFields will be sent to the server as
  4142. // null. It is an error if a field in this list has a non-empty value.
  4143. // This may be used to include null fields in Patch requests.
  4144. NullFields []string `json:"-"`
  4145. }
  4146. func (s *CommitmentAggregatedListWarning) MarshalJSON() ([]byte, error) {
  4147. type NoMethod CommitmentAggregatedListWarning
  4148. raw := NoMethod(*s)
  4149. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4150. }
  4151. type CommitmentAggregatedListWarningData struct {
  4152. // Key: [Output Only] A key that provides more detail on the warning
  4153. // being returned. For example, for warnings where there are no results
  4154. // in a list request for a particular zone, this key might be scope and
  4155. // the key value might be the zone name. Other examples might be a key
  4156. // indicating a deprecated resource and a suggested replacement, or a
  4157. // warning about invalid network settings (for example, if an instance
  4158. // attempts to perform IP forwarding but is not enabled for IP
  4159. // forwarding).
  4160. Key string `json:"key,omitempty"`
  4161. // Value: [Output Only] A warning data value corresponding to the key.
  4162. Value string `json:"value,omitempty"`
  4163. // ForceSendFields is a list of field names (e.g. "Key") to
  4164. // unconditionally include in API requests. By default, fields with
  4165. // empty values are omitted from API requests. However, any non-pointer,
  4166. // non-interface field appearing in ForceSendFields will be sent to the
  4167. // server regardless of whether the field is empty or not. This may be
  4168. // used to include empty fields in Patch requests.
  4169. ForceSendFields []string `json:"-"`
  4170. // NullFields is a list of field names (e.g. "Key") to include in API
  4171. // requests with the JSON null value. By default, fields with empty
  4172. // values are omitted from API requests. However, any field with an
  4173. // empty value appearing in NullFields will be sent to the server as
  4174. // null. It is an error if a field in this list has a non-empty value.
  4175. // This may be used to include null fields in Patch requests.
  4176. NullFields []string `json:"-"`
  4177. }
  4178. func (s *CommitmentAggregatedListWarningData) MarshalJSON() ([]byte, error) {
  4179. type NoMethod CommitmentAggregatedListWarningData
  4180. raw := NoMethod(*s)
  4181. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4182. }
  4183. // CommitmentList: Contains a list of Commitment resources.
  4184. type CommitmentList struct {
  4185. // Id: [Output Only] Unique identifier for the resource; defined by the
  4186. // server.
  4187. Id string `json:"id,omitempty"`
  4188. // Items: A list of Commitment resources.
  4189. Items []*Commitment `json:"items,omitempty"`
  4190. // Kind: [Output Only] Type of resource. Always compute#commitmentList
  4191. // for lists of commitments.
  4192. Kind string `json:"kind,omitempty"`
  4193. // NextPageToken: [Output Only] This token allows you to get the next
  4194. // page of results for list requests. If the number of results is larger
  4195. // than maxResults, use the nextPageToken as a value for the query
  4196. // parameter pageToken in the next list request. Subsequent list
  4197. // requests will have their own nextPageToken to continue paging through
  4198. // the results.
  4199. NextPageToken string `json:"nextPageToken,omitempty"`
  4200. // SelfLink: [Output Only] Server-defined URL for this resource.
  4201. SelfLink string `json:"selfLink,omitempty"`
  4202. // Warning: [Output Only] Informational warning message.
  4203. Warning *CommitmentListWarning `json:"warning,omitempty"`
  4204. // ServerResponse contains the HTTP response code and headers from the
  4205. // server.
  4206. googleapi.ServerResponse `json:"-"`
  4207. // ForceSendFields is a list of field names (e.g. "Id") to
  4208. // unconditionally include in API requests. By default, fields with
  4209. // empty values are omitted from API requests. However, any non-pointer,
  4210. // non-interface field appearing in ForceSendFields will be sent to the
  4211. // server regardless of whether the field is empty or not. This may be
  4212. // used to include empty fields in Patch requests.
  4213. ForceSendFields []string `json:"-"`
  4214. // NullFields is a list of field names (e.g. "Id") to include in API
  4215. // requests with the JSON null value. By default, fields with empty
  4216. // values are omitted from API requests. However, any field with an
  4217. // empty value appearing in NullFields will be sent to the server as
  4218. // null. It is an error if a field in this list has a non-empty value.
  4219. // This may be used to include null fields in Patch requests.
  4220. NullFields []string `json:"-"`
  4221. }
  4222. func (s *CommitmentList) MarshalJSON() ([]byte, error) {
  4223. type NoMethod CommitmentList
  4224. raw := NoMethod(*s)
  4225. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4226. }
  4227. // CommitmentListWarning: [Output Only] Informational warning message.
  4228. type CommitmentListWarning struct {
  4229. // Code: [Output Only] A warning code, if applicable. For example,
  4230. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  4231. // the response.
  4232. //
  4233. // Possible values:
  4234. // "CLEANUP_FAILED"
  4235. // "DEPRECATED_RESOURCE_USED"
  4236. // "DEPRECATED_TYPE_USED"
  4237. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  4238. // "EXPERIMENTAL_TYPE_USED"
  4239. // "EXTERNAL_API_WARNING"
  4240. // "FIELD_VALUE_OVERRIDEN"
  4241. // "INJECTED_KERNELS_DEPRECATED"
  4242. // "MISSING_TYPE_DEPENDENCY"
  4243. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  4244. // "NEXT_HOP_CANNOT_IP_FORWARD"
  4245. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  4246. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  4247. // "NEXT_HOP_NOT_RUNNING"
  4248. // "NOT_CRITICAL_ERROR"
  4249. // "NO_RESULTS_ON_PAGE"
  4250. // "REQUIRED_TOS_AGREEMENT"
  4251. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  4252. // "RESOURCE_NOT_DELETED"
  4253. // "SCHEMA_VALIDATION_IGNORED"
  4254. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  4255. // "UNDECLARED_PROPERTIES"
  4256. // "UNREACHABLE"
  4257. Code string `json:"code,omitempty"`
  4258. // Data: [Output Only] Metadata about this warning in key: value format.
  4259. // For example:
  4260. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  4261. Data []*CommitmentListWarningData `json:"data,omitempty"`
  4262. // Message: [Output Only] A human-readable description of the warning
  4263. // code.
  4264. Message string `json:"message,omitempty"`
  4265. // ForceSendFields is a list of field names (e.g. "Code") to
  4266. // unconditionally include in API requests. By default, fields with
  4267. // empty values are omitted from API requests. However, any non-pointer,
  4268. // non-interface field appearing in ForceSendFields will be sent to the
  4269. // server regardless of whether the field is empty or not. This may be
  4270. // used to include empty fields in Patch requests.
  4271. ForceSendFields []string `json:"-"`
  4272. // NullFields is a list of field names (e.g. "Code") to include in API
  4273. // requests with the JSON null value. By default, fields with empty
  4274. // values are omitted from API requests. However, any field with an
  4275. // empty value appearing in NullFields will be sent to the server as
  4276. // null. It is an error if a field in this list has a non-empty value.
  4277. // This may be used to include null fields in Patch requests.
  4278. NullFields []string `json:"-"`
  4279. }
  4280. func (s *CommitmentListWarning) MarshalJSON() ([]byte, error) {
  4281. type NoMethod CommitmentListWarning
  4282. raw := NoMethod(*s)
  4283. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4284. }
  4285. type CommitmentListWarningData struct {
  4286. // Key: [Output Only] A key that provides more detail on the warning
  4287. // being returned. For example, for warnings where there are no results
  4288. // in a list request for a particular zone, this key might be scope and
  4289. // the key value might be the zone name. Other examples might be a key
  4290. // indicating a deprecated resource and a suggested replacement, or a
  4291. // warning about invalid network settings (for example, if an instance
  4292. // attempts to perform IP forwarding but is not enabled for IP
  4293. // forwarding).
  4294. Key string `json:"key,omitempty"`
  4295. // Value: [Output Only] A warning data value corresponding to the key.
  4296. Value string `json:"value,omitempty"`
  4297. // ForceSendFields is a list of field names (e.g. "Key") to
  4298. // unconditionally include in API requests. By default, fields with
  4299. // empty values are omitted from API requests. However, any non-pointer,
  4300. // non-interface field appearing in ForceSendFields will be sent to the
  4301. // server regardless of whether the field is empty or not. This may be
  4302. // used to include empty fields in Patch requests.
  4303. ForceSendFields []string `json:"-"`
  4304. // NullFields is a list of field names (e.g. "Key") to include in API
  4305. // requests with the JSON null value. By default, fields with empty
  4306. // values are omitted from API requests. However, any field with an
  4307. // empty value appearing in NullFields will be sent to the server as
  4308. // null. It is an error if a field in this list has a non-empty value.
  4309. // This may be used to include null fields in Patch requests.
  4310. NullFields []string `json:"-"`
  4311. }
  4312. func (s *CommitmentListWarningData) MarshalJSON() ([]byte, error) {
  4313. type NoMethod CommitmentListWarningData
  4314. raw := NoMethod(*s)
  4315. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4316. }
  4317. type CommitmentsScopedList struct {
  4318. // Commitments: [Output Only] A list of commitments contained in this
  4319. // scope.
  4320. Commitments []*Commitment `json:"commitments,omitempty"`
  4321. // Warning: [Output Only] Informational warning which replaces the list
  4322. // of commitments when the list is empty.
  4323. Warning *CommitmentsScopedListWarning `json:"warning,omitempty"`
  4324. // ForceSendFields is a list of field names (e.g. "Commitments") to
  4325. // unconditionally include in API requests. By default, fields with
  4326. // empty values are omitted from API requests. However, any non-pointer,
  4327. // non-interface field appearing in ForceSendFields will be sent to the
  4328. // server regardless of whether the field is empty or not. This may be
  4329. // used to include empty fields in Patch requests.
  4330. ForceSendFields []string `json:"-"`
  4331. // NullFields is a list of field names (e.g. "Commitments") to include
  4332. // in API requests with the JSON null value. By default, fields with
  4333. // empty values are omitted from API requests. However, any field with
  4334. // an empty value appearing in NullFields will be sent to the server as
  4335. // null. It is an error if a field in this list has a non-empty value.
  4336. // This may be used to include null fields in Patch requests.
  4337. NullFields []string `json:"-"`
  4338. }
  4339. func (s *CommitmentsScopedList) MarshalJSON() ([]byte, error) {
  4340. type NoMethod CommitmentsScopedList
  4341. raw := NoMethod(*s)
  4342. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4343. }
  4344. // CommitmentsScopedListWarning: [Output Only] Informational warning
  4345. // which replaces the list of commitments when the list is empty.
  4346. type CommitmentsScopedListWarning struct {
  4347. // Code: [Output Only] A warning code, if applicable. For example,
  4348. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  4349. // the response.
  4350. //
  4351. // Possible values:
  4352. // "CLEANUP_FAILED"
  4353. // "DEPRECATED_RESOURCE_USED"
  4354. // "DEPRECATED_TYPE_USED"
  4355. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  4356. // "EXPERIMENTAL_TYPE_USED"
  4357. // "EXTERNAL_API_WARNING"
  4358. // "FIELD_VALUE_OVERRIDEN"
  4359. // "INJECTED_KERNELS_DEPRECATED"
  4360. // "MISSING_TYPE_DEPENDENCY"
  4361. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  4362. // "NEXT_HOP_CANNOT_IP_FORWARD"
  4363. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  4364. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  4365. // "NEXT_HOP_NOT_RUNNING"
  4366. // "NOT_CRITICAL_ERROR"
  4367. // "NO_RESULTS_ON_PAGE"
  4368. // "REQUIRED_TOS_AGREEMENT"
  4369. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  4370. // "RESOURCE_NOT_DELETED"
  4371. // "SCHEMA_VALIDATION_IGNORED"
  4372. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  4373. // "UNDECLARED_PROPERTIES"
  4374. // "UNREACHABLE"
  4375. Code string `json:"code,omitempty"`
  4376. // Data: [Output Only] Metadata about this warning in key: value format.
  4377. // For example:
  4378. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  4379. Data []*CommitmentsScopedListWarningData `json:"data,omitempty"`
  4380. // Message: [Output Only] A human-readable description of the warning
  4381. // code.
  4382. Message string `json:"message,omitempty"`
  4383. // ForceSendFields is a list of field names (e.g. "Code") to
  4384. // unconditionally include in API requests. By default, fields with
  4385. // empty values are omitted from API requests. However, any non-pointer,
  4386. // non-interface field appearing in ForceSendFields will be sent to the
  4387. // server regardless of whether the field is empty or not. This may be
  4388. // used to include empty fields in Patch requests.
  4389. ForceSendFields []string `json:"-"`
  4390. // NullFields is a list of field names (e.g. "Code") to include in API
  4391. // requests with the JSON null value. By default, fields with empty
  4392. // values are omitted from API requests. However, any field with an
  4393. // empty value appearing in NullFields will be sent to the server as
  4394. // null. It is an error if a field in this list has a non-empty value.
  4395. // This may be used to include null fields in Patch requests.
  4396. NullFields []string `json:"-"`
  4397. }
  4398. func (s *CommitmentsScopedListWarning) MarshalJSON() ([]byte, error) {
  4399. type NoMethod CommitmentsScopedListWarning
  4400. raw := NoMethod(*s)
  4401. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4402. }
  4403. type CommitmentsScopedListWarningData struct {
  4404. // Key: [Output Only] A key that provides more detail on the warning
  4405. // being returned. For example, for warnings where there are no results
  4406. // in a list request for a particular zone, this key might be scope and
  4407. // the key value might be the zone name. Other examples might be a key
  4408. // indicating a deprecated resource and a suggested replacement, or a
  4409. // warning about invalid network settings (for example, if an instance
  4410. // attempts to perform IP forwarding but is not enabled for IP
  4411. // forwarding).
  4412. Key string `json:"key,omitempty"`
  4413. // Value: [Output Only] A warning data value corresponding to the key.
  4414. Value string `json:"value,omitempty"`
  4415. // ForceSendFields is a list of field names (e.g. "Key") to
  4416. // unconditionally include in API requests. By default, fields with
  4417. // empty values are omitted from API requests. However, any non-pointer,
  4418. // non-interface field appearing in ForceSendFields will be sent to the
  4419. // server regardless of whether the field is empty or not. This may be
  4420. // used to include empty fields in Patch requests.
  4421. ForceSendFields []string `json:"-"`
  4422. // NullFields is a list of field names (e.g. "Key") to include in API
  4423. // requests with the JSON null value. By default, fields with empty
  4424. // values are omitted from API requests. However, any field with an
  4425. // empty value appearing in NullFields will be sent to the server as
  4426. // null. It is an error if a field in this list has a non-empty value.
  4427. // This may be used to include null fields in Patch requests.
  4428. NullFields []string `json:"-"`
  4429. }
  4430. func (s *CommitmentsScopedListWarningData) MarshalJSON() ([]byte, error) {
  4431. type NoMethod CommitmentsScopedListWarningData
  4432. raw := NoMethod(*s)
  4433. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4434. }
  4435. // Condition: A condition to be met.
  4436. type Condition struct {
  4437. // Iam: Trusted attributes supplied by the IAM system.
  4438. //
  4439. // Possible values:
  4440. // "APPROVER"
  4441. // "ATTRIBUTION"
  4442. // "AUTHORITY"
  4443. // "CREDENTIALS_TYPE"
  4444. // "JUSTIFICATION_TYPE"
  4445. // "NO_ATTR"
  4446. // "SECURITY_REALM"
  4447. Iam string `json:"iam,omitempty"`
  4448. // Op: An operator to apply the subject with.
  4449. //
  4450. // Possible values:
  4451. // "DISCHARGED"
  4452. // "EQUALS"
  4453. // "IN"
  4454. // "NOT_EQUALS"
  4455. // "NOT_IN"
  4456. // "NO_OP"
  4457. Op string `json:"op,omitempty"`
  4458. // Svc: Trusted attributes discharged by the service.
  4459. Svc string `json:"svc,omitempty"`
  4460. // Sys: Trusted attributes supplied by any service that owns resources
  4461. // and uses the IAM system for access control.
  4462. //
  4463. // Possible values:
  4464. // "IP"
  4465. // "NAME"
  4466. // "NO_ATTR"
  4467. // "REGION"
  4468. // "SERVICE"
  4469. Sys string `json:"sys,omitempty"`
  4470. // Value: DEPRECATED. Use 'values' instead.
  4471. Value string `json:"value,omitempty"`
  4472. // Values: The objects of the condition. This is mutually exclusive with
  4473. // 'value'.
  4474. Values []string `json:"values,omitempty"`
  4475. // ForceSendFields is a list of field names (e.g. "Iam") to
  4476. // unconditionally include in API requests. By default, fields with
  4477. // empty values are omitted from API requests. However, any non-pointer,
  4478. // non-interface field appearing in ForceSendFields will be sent to the
  4479. // server regardless of whether the field is empty or not. This may be
  4480. // used to include empty fields in Patch requests.
  4481. ForceSendFields []string `json:"-"`
  4482. // NullFields is a list of field names (e.g. "Iam") to include in API
  4483. // requests with the JSON null value. By default, fields with empty
  4484. // values are omitted from API requests. However, any field with an
  4485. // empty value appearing in NullFields will be sent to the server as
  4486. // null. It is an error if a field in this list has a non-empty value.
  4487. // This may be used to include null fields in Patch requests.
  4488. NullFields []string `json:"-"`
  4489. }
  4490. func (s *Condition) MarshalJSON() ([]byte, error) {
  4491. type NoMethod Condition
  4492. raw := NoMethod(*s)
  4493. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4494. }
  4495. // ConnectionDraining: Message containing connection draining
  4496. // configuration.
  4497. type ConnectionDraining struct {
  4498. // DrainingTimeoutSec: Time for which instance will be drained (not
  4499. // accept new connections, but still work to finish started).
  4500. DrainingTimeoutSec int64 `json:"drainingTimeoutSec,omitempty"`
  4501. // ForceSendFields is a list of field names (e.g. "DrainingTimeoutSec")
  4502. // to unconditionally include in API requests. By default, fields with
  4503. // empty values are omitted from API requests. However, any non-pointer,
  4504. // non-interface field appearing in ForceSendFields will be sent to the
  4505. // server regardless of whether the field is empty or not. This may be
  4506. // used to include empty fields in Patch requests.
  4507. ForceSendFields []string `json:"-"`
  4508. // NullFields is a list of field names (e.g. "DrainingTimeoutSec") to
  4509. // include in API requests with the JSON null value. By default, fields
  4510. // with empty values are omitted from API requests. However, any field
  4511. // with an empty value appearing in NullFields will be sent to the
  4512. // server as null. It is an error if a field in this list has a
  4513. // non-empty value. This may be used to include null fields in Patch
  4514. // requests.
  4515. NullFields []string `json:"-"`
  4516. }
  4517. func (s *ConnectionDraining) MarshalJSON() ([]byte, error) {
  4518. type NoMethod ConnectionDraining
  4519. raw := NoMethod(*s)
  4520. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4521. }
  4522. // CustomerEncryptionKey: Represents a customer-supplied encryption key
  4523. type CustomerEncryptionKey struct {
  4524. // KmsKeyName: The name of the encryption key that is stored in Google
  4525. // Cloud KMS.
  4526. KmsKeyName string `json:"kmsKeyName,omitempty"`
  4527. // RawKey: Specifies a 256-bit customer-supplied encryption key, encoded
  4528. // in RFC 4648 base64 to either encrypt or decrypt this resource.
  4529. RawKey string `json:"rawKey,omitempty"`
  4530. // RsaEncryptedKey: Specifies an RFC 4648 base64 encoded, RSA-wrapped
  4531. // 2048-bit customer-supplied encryption key to either encrypt or
  4532. // decrypt this resource.
  4533. //
  4534. // The key must meet the following requirements before you can provide
  4535. // it to Compute Engine:
  4536. // - The key is wrapped using a RSA public key certificate provided by
  4537. // Google.
  4538. // - After being wrapped, the key must be encoded in RFC 4648 base64
  4539. // encoding. Gets the RSA public key certificate provided by Google
  4540. // at:
  4541. // https://cloud-certs.storage.googleapis.com/google-cloud-csek-ingre
  4542. // ss.pem
  4543. RsaEncryptedKey string `json:"rsaEncryptedKey,omitempty"`
  4544. // Sha256: [Output only] The RFC 4648 base64 encoded SHA-256 hash of the
  4545. // customer-supplied encryption key that protects this resource.
  4546. Sha256 string `json:"sha256,omitempty"`
  4547. // ForceSendFields is a list of field names (e.g. "KmsKeyName") to
  4548. // unconditionally include in API requests. By default, fields with
  4549. // empty values are omitted from API requests. However, any non-pointer,
  4550. // non-interface field appearing in ForceSendFields will be sent to the
  4551. // server regardless of whether the field is empty or not. This may be
  4552. // used to include empty fields in Patch requests.
  4553. ForceSendFields []string `json:"-"`
  4554. // NullFields is a list of field names (e.g. "KmsKeyName") to include in
  4555. // API requests with the JSON null value. By default, fields with empty
  4556. // values are omitted from API requests. However, any field with an
  4557. // empty value appearing in NullFields will be sent to the server as
  4558. // null. It is an error if a field in this list has a non-empty value.
  4559. // This may be used to include null fields in Patch requests.
  4560. NullFields []string `json:"-"`
  4561. }
  4562. func (s *CustomerEncryptionKey) MarshalJSON() ([]byte, error) {
  4563. type NoMethod CustomerEncryptionKey
  4564. raw := NoMethod(*s)
  4565. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4566. }
  4567. type CustomerEncryptionKeyProtectedDisk struct {
  4568. // DiskEncryptionKey: Decrypts data associated with the disk with a
  4569. // customer-supplied encryption key.
  4570. DiskEncryptionKey *CustomerEncryptionKey `json:"diskEncryptionKey,omitempty"`
  4571. // Source: Specifies a valid partial or full URL to an existing
  4572. // Persistent Disk resource. This field is only applicable for
  4573. // persistent disks.
  4574. Source string `json:"source,omitempty"`
  4575. // ForceSendFields is a list of field names (e.g. "DiskEncryptionKey")
  4576. // to unconditionally include in API requests. By default, fields with
  4577. // empty values are omitted from API requests. However, any non-pointer,
  4578. // non-interface field appearing in ForceSendFields will be sent to the
  4579. // server regardless of whether the field is empty or not. This may be
  4580. // used to include empty fields in Patch requests.
  4581. ForceSendFields []string `json:"-"`
  4582. // NullFields is a list of field names (e.g. "DiskEncryptionKey") to
  4583. // include in API requests with the JSON null value. By default, fields
  4584. // with empty values are omitted from API requests. However, any field
  4585. // with an empty value appearing in NullFields will be sent to the
  4586. // server as null. It is an error if a field in this list has a
  4587. // non-empty value. This may be used to include null fields in Patch
  4588. // requests.
  4589. NullFields []string `json:"-"`
  4590. }
  4591. func (s *CustomerEncryptionKeyProtectedDisk) MarshalJSON() ([]byte, error) {
  4592. type NoMethod CustomerEncryptionKeyProtectedDisk
  4593. raw := NoMethod(*s)
  4594. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4595. }
  4596. // DeprecationStatus: Deprecation status for a public resource.
  4597. type DeprecationStatus struct {
  4598. // Deleted: An optional RFC3339 timestamp on or after which the state of
  4599. // this resource is intended to change to DELETED. This is only
  4600. // informational and the status will not change unless the client
  4601. // explicitly changes it.
  4602. Deleted string `json:"deleted,omitempty"`
  4603. // Deprecated: An optional RFC3339 timestamp on or after which the state
  4604. // of this resource is intended to change to DEPRECATED. This is only
  4605. // informational and the status will not change unless the client
  4606. // explicitly changes it.
  4607. Deprecated string `json:"deprecated,omitempty"`
  4608. // Obsolete: An optional RFC3339 timestamp on or after which the state
  4609. // of this resource is intended to change to OBSOLETE. This is only
  4610. // informational and the status will not change unless the client
  4611. // explicitly changes it.
  4612. Obsolete string `json:"obsolete,omitempty"`
  4613. // Replacement: The URL of the suggested replacement for a deprecated
  4614. // resource. The suggested replacement resource must be the same kind of
  4615. // resource as the deprecated resource.
  4616. Replacement string `json:"replacement,omitempty"`
  4617. // State: The deprecation state of this resource. This can be
  4618. // DEPRECATED, OBSOLETE, or DELETED. Operations which create a new
  4619. // resource using a DEPRECATED resource will return successfully, but
  4620. // with a warning indicating the deprecated resource and recommending
  4621. // its replacement. Operations which use OBSOLETE or DELETED resources
  4622. // will be rejected and result in an error.
  4623. //
  4624. // Possible values:
  4625. // "DELETED"
  4626. // "DEPRECATED"
  4627. // "OBSOLETE"
  4628. State string `json:"state,omitempty"`
  4629. // ForceSendFields is a list of field names (e.g. "Deleted") to
  4630. // unconditionally include in API requests. By default, fields with
  4631. // empty values are omitted from API requests. However, any non-pointer,
  4632. // non-interface field appearing in ForceSendFields will be sent to the
  4633. // server regardless of whether the field is empty or not. This may be
  4634. // used to include empty fields in Patch requests.
  4635. ForceSendFields []string `json:"-"`
  4636. // NullFields is a list of field names (e.g. "Deleted") to include in
  4637. // API requests with the JSON null value. By default, fields with empty
  4638. // values are omitted from API requests. However, any field with an
  4639. // empty value appearing in NullFields will be sent to the server as
  4640. // null. It is an error if a field in this list has a non-empty value.
  4641. // This may be used to include null fields in Patch requests.
  4642. NullFields []string `json:"-"`
  4643. }
  4644. func (s *DeprecationStatus) MarshalJSON() ([]byte, error) {
  4645. type NoMethod DeprecationStatus
  4646. raw := NoMethod(*s)
  4647. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4648. }
  4649. // Disk: A Disk resource. (== resource_for beta.disks ==) (==
  4650. // resource_for v1.disks ==)
  4651. type Disk struct {
  4652. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  4653. // format.
  4654. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  4655. // Description: An optional description of this resource. Provide this
  4656. // property when you create the resource.
  4657. Description string `json:"description,omitempty"`
  4658. // DiskEncryptionKey: Encrypts the disk using a customer-supplied
  4659. // encryption key.
  4660. //
  4661. // After you encrypt a disk with a customer-supplied key, you must
  4662. // provide the same key if you use the disk later (e.g. to create a disk
  4663. // snapshot or an image, or to attach the disk to a virtual
  4664. // machine).
  4665. //
  4666. // Customer-supplied encryption keys do not protect access to metadata
  4667. // of the disk.
  4668. //
  4669. // If you do not provide an encryption key when creating the disk, then
  4670. // the disk will be encrypted using an automatically generated key and
  4671. // you do not need to provide a key to use the disk later.
  4672. DiskEncryptionKey *CustomerEncryptionKey `json:"diskEncryptionKey,omitempty"`
  4673. // GuestOsFeatures: A list of features to enable on the guest operating
  4674. // system. Applicable only for bootable images. Read Enabling guest
  4675. // operating system features to see a list of available options.
  4676. GuestOsFeatures []*GuestOsFeature `json:"guestOsFeatures,omitempty"`
  4677. // Id: [Output Only] The unique identifier for the resource. This
  4678. // identifier is defined by the server.
  4679. Id uint64 `json:"id,omitempty,string"`
  4680. // Kind: [Output Only] Type of the resource. Always compute#disk for
  4681. // disks.
  4682. Kind string `json:"kind,omitempty"`
  4683. // LabelFingerprint: A fingerprint for the labels being applied to this
  4684. // disk, which is essentially a hash of the labels set used for
  4685. // optimistic locking. The fingerprint is initially generated by Compute
  4686. // Engine and changes after every request to modify or update labels.
  4687. // You must always provide an up-to-date fingerprint hash in order to
  4688. // update or change labels.
  4689. //
  4690. // To see the latest fingerprint, make a get() request to retrieve a
  4691. // disk.
  4692. LabelFingerprint string `json:"labelFingerprint,omitempty"`
  4693. // Labels: Labels to apply to this disk. These can be later modified by
  4694. // the setLabels method.
  4695. Labels map[string]string `json:"labels,omitempty"`
  4696. // LastAttachTimestamp: [Output Only] Last attach timestamp in RFC3339
  4697. // text format.
  4698. LastAttachTimestamp string `json:"lastAttachTimestamp,omitempty"`
  4699. // LastDetachTimestamp: [Output Only] Last detach timestamp in RFC3339
  4700. // text format.
  4701. LastDetachTimestamp string `json:"lastDetachTimestamp,omitempty"`
  4702. // LicenseCodes: Integer license codes indicating which licenses are
  4703. // attached to this disk.
  4704. LicenseCodes googleapi.Int64s `json:"licenseCodes,omitempty"`
  4705. // Licenses: Any applicable publicly visible licenses.
  4706. Licenses []string `json:"licenses,omitempty"`
  4707. // Name: Name of the resource. Provided by the client when the resource
  4708. // is created. The name must be 1-63 characters long, and comply with
  4709. // RFC1035. Specifically, the name must be 1-63 characters long and
  4710. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  4711. // the first character must be a lowercase letter, and all following
  4712. // characters must be a dash, lowercase letter, or digit, except the
  4713. // last character, which cannot be a dash.
  4714. Name string `json:"name,omitempty"`
  4715. // Options: Internal use only.
  4716. Options string `json:"options,omitempty"`
  4717. // Region: [Output Only] URL of the region where the disk resides. Only
  4718. // applicable for regional resources. You must specify this field as
  4719. // part of the HTTP request URL. It is not settable as a field in the
  4720. // request body.
  4721. Region string `json:"region,omitempty"`
  4722. // ReplicaZones: URLs of the zones where the disk should be replicated
  4723. // to. Only applicable for regional resources.
  4724. ReplicaZones []string `json:"replicaZones,omitempty"`
  4725. // SelfLink: [Output Only] Server-defined fully-qualified URL for this
  4726. // resource.
  4727. SelfLink string `json:"selfLink,omitempty"`
  4728. // SizeGb: Size of the persistent disk, specified in GB. You can specify
  4729. // this field when creating a persistent disk using the sourceImage or
  4730. // sourceSnapshot parameter, or specify it alone to create an empty
  4731. // persistent disk.
  4732. //
  4733. // If you specify this field along with sourceImage or sourceSnapshot,
  4734. // the value of sizeGb must not be less than the size of the sourceImage
  4735. // or the size of the snapshot. Acceptable values are 1 to 65536,
  4736. // inclusive.
  4737. SizeGb int64 `json:"sizeGb,omitempty,string"`
  4738. // SourceImage: The source image used to create this disk. If the source
  4739. // image is deleted, this field will not be set.
  4740. //
  4741. // To create a disk with one of the public operating system images,
  4742. // specify the image by its family name. For example, specify
  4743. // family/debian-8 to use the latest Debian 8
  4744. // image:
  4745. // projects/debian-cloud/global/images/family/debian-8
  4746. //
  4747. //
  4748. // Alternati
  4749. // vely, use a specific version of a public operating system
  4750. // image:
  4751. // projects/debian-cloud/global/images/debian-8-jessie-vYYYYMMDD
  4752. //
  4753. //
  4754. //
  4755. // To create a disk with a custom image that you created, specify the
  4756. // image name in the following
  4757. // format:
  4758. // global/images/my-custom-image
  4759. //
  4760. //
  4761. // You can also specify a custom image by its image family, which
  4762. // returns the latest version of the image in that family. Replace the
  4763. // image name with
  4764. // family/family-name:
  4765. // global/images/family/my-image-family
  4766. SourceImage string `json:"sourceImage,omitempty"`
  4767. // SourceImageEncryptionKey: The customer-supplied encryption key of the
  4768. // source image. Required if the source image is protected by a
  4769. // customer-supplied encryption key.
  4770. SourceImageEncryptionKey *CustomerEncryptionKey `json:"sourceImageEncryptionKey,omitempty"`
  4771. // SourceImageId: [Output Only] The ID value of the image used to create
  4772. // this disk. This value identifies the exact image that was used to
  4773. // create this persistent disk. For example, if you created the
  4774. // persistent disk from an image that was later deleted and recreated
  4775. // under the same name, the source image ID would identify the exact
  4776. // version of the image that was used.
  4777. SourceImageId string `json:"sourceImageId,omitempty"`
  4778. // SourceSnapshot: The source snapshot used to create this disk. You can
  4779. // provide this as a partial or full URL to the resource. For example,
  4780. // the following are valid values:
  4781. // -
  4782. // https://www.googleapis.com/compute/v1/projects/project/global/snapshots/snapshot
  4783. // - projects/project/global/snapshots/snapshot
  4784. // - global/snapshots/snapshot
  4785. SourceSnapshot string `json:"sourceSnapshot,omitempty"`
  4786. // SourceSnapshotEncryptionKey: The customer-supplied encryption key of
  4787. // the source snapshot. Required if the source snapshot is protected by
  4788. // a customer-supplied encryption key.
  4789. SourceSnapshotEncryptionKey *CustomerEncryptionKey `json:"sourceSnapshotEncryptionKey,omitempty"`
  4790. // SourceSnapshotId: [Output Only] The unique ID of the snapshot used to
  4791. // create this disk. This value identifies the exact snapshot that was
  4792. // used to create this persistent disk. For example, if you created the
  4793. // persistent disk from a snapshot that was later deleted and recreated
  4794. // under the same name, the source snapshot ID would identify the exact
  4795. // version of the snapshot that was used.
  4796. SourceSnapshotId string `json:"sourceSnapshotId,omitempty"`
  4797. // Status: [Output Only] The status of disk creation.
  4798. //
  4799. // Possible values:
  4800. // "CREATING"
  4801. // "FAILED"
  4802. // "READY"
  4803. // "RESTORING"
  4804. Status string `json:"status,omitempty"`
  4805. // StorageType: [Deprecated] Storage type of the persistent disk.
  4806. //
  4807. // Possible values:
  4808. // "HDD"
  4809. // "SSD"
  4810. StorageType string `json:"storageType,omitempty"`
  4811. // Type: URL of the disk type resource describing which disk type to use
  4812. // to create the disk. Provide this when creating the disk. For example:
  4813. // project/zones/zone/diskTypes/pd-standard or pd-ssd
  4814. Type string `json:"type,omitempty"`
  4815. // Users: [Output Only] Links to the users of the disk (attached
  4816. // instances) in form: project/zones/zone/instances/instance
  4817. Users []string `json:"users,omitempty"`
  4818. // Zone: [Output Only] URL of the zone where the disk resides. You must
  4819. // specify this field as part of the HTTP request URL. It is not
  4820. // settable as a field in the request body.
  4821. Zone string `json:"zone,omitempty"`
  4822. // ServerResponse contains the HTTP response code and headers from the
  4823. // server.
  4824. googleapi.ServerResponse `json:"-"`
  4825. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  4826. // to unconditionally include in API requests. By default, fields with
  4827. // empty values are omitted from API requests. However, any non-pointer,
  4828. // non-interface field appearing in ForceSendFields will be sent to the
  4829. // server regardless of whether the field is empty or not. This may be
  4830. // used to include empty fields in Patch requests.
  4831. ForceSendFields []string `json:"-"`
  4832. // NullFields is a list of field names (e.g. "CreationTimestamp") to
  4833. // include in API requests with the JSON null value. By default, fields
  4834. // with empty values are omitted from API requests. However, any field
  4835. // with an empty value appearing in NullFields will be sent to the
  4836. // server as null. It is an error if a field in this list has a
  4837. // non-empty value. This may be used to include null fields in Patch
  4838. // requests.
  4839. NullFields []string `json:"-"`
  4840. }
  4841. func (s *Disk) MarshalJSON() ([]byte, error) {
  4842. type NoMethod Disk
  4843. raw := NoMethod(*s)
  4844. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4845. }
  4846. type DiskAggregatedList struct {
  4847. // Id: [Output Only] Unique identifier for the resource; defined by the
  4848. // server.
  4849. Id string `json:"id,omitempty"`
  4850. // Items: A list of DisksScopedList resources.
  4851. Items map[string]DisksScopedList `json:"items,omitempty"`
  4852. // Kind: [Output Only] Type of resource. Always
  4853. // compute#diskAggregatedList for aggregated lists of persistent disks.
  4854. Kind string `json:"kind,omitempty"`
  4855. // NextPageToken: [Output Only] This token allows you to get the next
  4856. // page of results for list requests. If the number of results is larger
  4857. // than maxResults, use the nextPageToken as a value for the query
  4858. // parameter pageToken in the next list request. Subsequent list
  4859. // requests will have their own nextPageToken to continue paging through
  4860. // the results.
  4861. NextPageToken string `json:"nextPageToken,omitempty"`
  4862. // SelfLink: [Output Only] Server-defined URL for this resource.
  4863. SelfLink string `json:"selfLink,omitempty"`
  4864. // Warning: [Output Only] Informational warning message.
  4865. Warning *DiskAggregatedListWarning `json:"warning,omitempty"`
  4866. // ServerResponse contains the HTTP response code and headers from the
  4867. // server.
  4868. googleapi.ServerResponse `json:"-"`
  4869. // ForceSendFields is a list of field names (e.g. "Id") to
  4870. // unconditionally include in API requests. By default, fields with
  4871. // empty values are omitted from API requests. However, any non-pointer,
  4872. // non-interface field appearing in ForceSendFields will be sent to the
  4873. // server regardless of whether the field is empty or not. This may be
  4874. // used to include empty fields in Patch requests.
  4875. ForceSendFields []string `json:"-"`
  4876. // NullFields is a list of field names (e.g. "Id") to include in API
  4877. // requests with the JSON null value. By default, fields with empty
  4878. // values are omitted from API requests. However, any field with an
  4879. // empty value appearing in NullFields will be sent to the server as
  4880. // null. It is an error if a field in this list has a non-empty value.
  4881. // This may be used to include null fields in Patch requests.
  4882. NullFields []string `json:"-"`
  4883. }
  4884. func (s *DiskAggregatedList) MarshalJSON() ([]byte, error) {
  4885. type NoMethod DiskAggregatedList
  4886. raw := NoMethod(*s)
  4887. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4888. }
  4889. // DiskAggregatedListWarning: [Output Only] Informational warning
  4890. // message.
  4891. type DiskAggregatedListWarning struct {
  4892. // Code: [Output Only] A warning code, if applicable. For example,
  4893. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  4894. // the response.
  4895. //
  4896. // Possible values:
  4897. // "CLEANUP_FAILED"
  4898. // "DEPRECATED_RESOURCE_USED"
  4899. // "DEPRECATED_TYPE_USED"
  4900. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  4901. // "EXPERIMENTAL_TYPE_USED"
  4902. // "EXTERNAL_API_WARNING"
  4903. // "FIELD_VALUE_OVERRIDEN"
  4904. // "INJECTED_KERNELS_DEPRECATED"
  4905. // "MISSING_TYPE_DEPENDENCY"
  4906. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  4907. // "NEXT_HOP_CANNOT_IP_FORWARD"
  4908. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  4909. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  4910. // "NEXT_HOP_NOT_RUNNING"
  4911. // "NOT_CRITICAL_ERROR"
  4912. // "NO_RESULTS_ON_PAGE"
  4913. // "REQUIRED_TOS_AGREEMENT"
  4914. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  4915. // "RESOURCE_NOT_DELETED"
  4916. // "SCHEMA_VALIDATION_IGNORED"
  4917. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  4918. // "UNDECLARED_PROPERTIES"
  4919. // "UNREACHABLE"
  4920. Code string `json:"code,omitempty"`
  4921. // Data: [Output Only] Metadata about this warning in key: value format.
  4922. // For example:
  4923. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  4924. Data []*DiskAggregatedListWarningData `json:"data,omitempty"`
  4925. // Message: [Output Only] A human-readable description of the warning
  4926. // code.
  4927. Message string `json:"message,omitempty"`
  4928. // ForceSendFields is a list of field names (e.g. "Code") to
  4929. // unconditionally include in API requests. By default, fields with
  4930. // empty values are omitted from API requests. However, any non-pointer,
  4931. // non-interface field appearing in ForceSendFields will be sent to the
  4932. // server regardless of whether the field is empty or not. This may be
  4933. // used to include empty fields in Patch requests.
  4934. ForceSendFields []string `json:"-"`
  4935. // NullFields is a list of field names (e.g. "Code") to include in API
  4936. // requests with the JSON null value. By default, fields with empty
  4937. // values are omitted from API requests. However, any field with an
  4938. // empty value appearing in NullFields will be sent to the server as
  4939. // null. It is an error if a field in this list has a non-empty value.
  4940. // This may be used to include null fields in Patch requests.
  4941. NullFields []string `json:"-"`
  4942. }
  4943. func (s *DiskAggregatedListWarning) MarshalJSON() ([]byte, error) {
  4944. type NoMethod DiskAggregatedListWarning
  4945. raw := NoMethod(*s)
  4946. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4947. }
  4948. type DiskAggregatedListWarningData struct {
  4949. // Key: [Output Only] A key that provides more detail on the warning
  4950. // being returned. For example, for warnings where there are no results
  4951. // in a list request for a particular zone, this key might be scope and
  4952. // the key value might be the zone name. Other examples might be a key
  4953. // indicating a deprecated resource and a suggested replacement, or a
  4954. // warning about invalid network settings (for example, if an instance
  4955. // attempts to perform IP forwarding but is not enabled for IP
  4956. // forwarding).
  4957. Key string `json:"key,omitempty"`
  4958. // Value: [Output Only] A warning data value corresponding to the key.
  4959. Value string `json:"value,omitempty"`
  4960. // ForceSendFields is a list of field names (e.g. "Key") to
  4961. // unconditionally include in API requests. By default, fields with
  4962. // empty values are omitted from API requests. However, any non-pointer,
  4963. // non-interface field appearing in ForceSendFields will be sent to the
  4964. // server regardless of whether the field is empty or not. This may be
  4965. // used to include empty fields in Patch requests.
  4966. ForceSendFields []string `json:"-"`
  4967. // NullFields is a list of field names (e.g. "Key") to include in API
  4968. // requests with the JSON null value. By default, fields with empty
  4969. // values are omitted from API requests. However, any field with an
  4970. // empty value appearing in NullFields will be sent to the server as
  4971. // null. It is an error if a field in this list has a non-empty value.
  4972. // This may be used to include null fields in Patch requests.
  4973. NullFields []string `json:"-"`
  4974. }
  4975. func (s *DiskAggregatedListWarningData) MarshalJSON() ([]byte, error) {
  4976. type NoMethod DiskAggregatedListWarningData
  4977. raw := NoMethod(*s)
  4978. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4979. }
  4980. // DiskInstantiationConfig: A specification of the desired way to
  4981. // instantiate a disk in the instance template when its created from a
  4982. // source instance.
  4983. type DiskInstantiationConfig struct {
  4984. // AutoDelete: Specifies whether the disk will be auto-deleted when the
  4985. // instance is deleted (but not when the disk is detached from the
  4986. // instance).
  4987. AutoDelete bool `json:"autoDelete,omitempty"`
  4988. // CustomImage: The custom source image to be used to restore this disk
  4989. // when instantiating this instance template.
  4990. CustomImage string `json:"customImage,omitempty"`
  4991. // DeviceName: Specifies the device name of the disk to which the
  4992. // configurations apply to.
  4993. DeviceName string `json:"deviceName,omitempty"`
  4994. // InstantiateFrom: Specifies whether to include the disk and what image
  4995. // to use. Possible values are:
  4996. // - source-image: to use the same image that was used to create the
  4997. // source instance's corresponding disk. Applicable to the boot disk and
  4998. // additional read-write disks.
  4999. // - source-image-family: to use the same image family that was used to
  5000. // create the source instance's corresponding disk. Applicable to the
  5001. // boot disk and additional read-write disks.
  5002. // - custom-image: to use a user-provided image url for disk creation.
  5003. // Applicable to the boot disk and additional read-write disks.
  5004. // - attach-read-only: to attach a read-only disk. Applicable to
  5005. // read-only disks.
  5006. // - do-not-include: to exclude a disk from the template. Applicable to
  5007. // additional read-write disks, local SSDs, and read-only disks.
  5008. //
  5009. // Possible values:
  5010. // "ATTACH_READ_ONLY"
  5011. // "BLANK"
  5012. // "CUSTOM_IMAGE"
  5013. // "DEFAULT"
  5014. // "DO_NOT_INCLUDE"
  5015. // "SOURCE_IMAGE"
  5016. // "SOURCE_IMAGE_FAMILY"
  5017. InstantiateFrom string `json:"instantiateFrom,omitempty"`
  5018. // ForceSendFields is a list of field names (e.g. "AutoDelete") to
  5019. // unconditionally include in API requests. By default, fields with
  5020. // empty values are omitted from API requests. However, any non-pointer,
  5021. // non-interface field appearing in ForceSendFields will be sent to the
  5022. // server regardless of whether the field is empty or not. This may be
  5023. // used to include empty fields in Patch requests.
  5024. ForceSendFields []string `json:"-"`
  5025. // NullFields is a list of field names (e.g. "AutoDelete") to include in
  5026. // API requests with the JSON null value. By default, fields with empty
  5027. // values are omitted from API requests. However, any field with an
  5028. // empty value appearing in NullFields will be sent to the server as
  5029. // null. It is an error if a field in this list has a non-empty value.
  5030. // This may be used to include null fields in Patch requests.
  5031. NullFields []string `json:"-"`
  5032. }
  5033. func (s *DiskInstantiationConfig) MarshalJSON() ([]byte, error) {
  5034. type NoMethod DiskInstantiationConfig
  5035. raw := NoMethod(*s)
  5036. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5037. }
  5038. // DiskList: A list of Disk resources.
  5039. type DiskList struct {
  5040. // Id: [Output Only] Unique identifier for the resource; defined by the
  5041. // server.
  5042. Id string `json:"id,omitempty"`
  5043. // Items: A list of Disk resources.
  5044. Items []*Disk `json:"items,omitempty"`
  5045. // Kind: [Output Only] Type of resource. Always compute#diskList for
  5046. // lists of disks.
  5047. Kind string `json:"kind,omitempty"`
  5048. // NextPageToken: [Output Only] This token allows you to get the next
  5049. // page of results for list requests. If the number of results is larger
  5050. // than maxResults, use the nextPageToken as a value for the query
  5051. // parameter pageToken in the next list request. Subsequent list
  5052. // requests will have their own nextPageToken to continue paging through
  5053. // the results.
  5054. NextPageToken string `json:"nextPageToken,omitempty"`
  5055. // SelfLink: [Output Only] Server-defined URL for this resource.
  5056. SelfLink string `json:"selfLink,omitempty"`
  5057. // Warning: [Output Only] Informational warning message.
  5058. Warning *DiskListWarning `json:"warning,omitempty"`
  5059. // ServerResponse contains the HTTP response code and headers from the
  5060. // server.
  5061. googleapi.ServerResponse `json:"-"`
  5062. // ForceSendFields is a list of field names (e.g. "Id") to
  5063. // unconditionally include in API requests. By default, fields with
  5064. // empty values are omitted from API requests. However, any non-pointer,
  5065. // non-interface field appearing in ForceSendFields will be sent to the
  5066. // server regardless of whether the field is empty or not. This may be
  5067. // used to include empty fields in Patch requests.
  5068. ForceSendFields []string `json:"-"`
  5069. // NullFields is a list of field names (e.g. "Id") to include in API
  5070. // requests with the JSON null value. By default, fields with empty
  5071. // values are omitted from API requests. However, any field with an
  5072. // empty value appearing in NullFields will be sent to the server as
  5073. // null. It is an error if a field in this list has a non-empty value.
  5074. // This may be used to include null fields in Patch requests.
  5075. NullFields []string `json:"-"`
  5076. }
  5077. func (s *DiskList) MarshalJSON() ([]byte, error) {
  5078. type NoMethod DiskList
  5079. raw := NoMethod(*s)
  5080. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5081. }
  5082. // DiskListWarning: [Output Only] Informational warning message.
  5083. type DiskListWarning struct {
  5084. // Code: [Output Only] A warning code, if applicable. For example,
  5085. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  5086. // the response.
  5087. //
  5088. // Possible values:
  5089. // "CLEANUP_FAILED"
  5090. // "DEPRECATED_RESOURCE_USED"
  5091. // "DEPRECATED_TYPE_USED"
  5092. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  5093. // "EXPERIMENTAL_TYPE_USED"
  5094. // "EXTERNAL_API_WARNING"
  5095. // "FIELD_VALUE_OVERRIDEN"
  5096. // "INJECTED_KERNELS_DEPRECATED"
  5097. // "MISSING_TYPE_DEPENDENCY"
  5098. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  5099. // "NEXT_HOP_CANNOT_IP_FORWARD"
  5100. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  5101. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  5102. // "NEXT_HOP_NOT_RUNNING"
  5103. // "NOT_CRITICAL_ERROR"
  5104. // "NO_RESULTS_ON_PAGE"
  5105. // "REQUIRED_TOS_AGREEMENT"
  5106. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  5107. // "RESOURCE_NOT_DELETED"
  5108. // "SCHEMA_VALIDATION_IGNORED"
  5109. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  5110. // "UNDECLARED_PROPERTIES"
  5111. // "UNREACHABLE"
  5112. Code string `json:"code,omitempty"`
  5113. // Data: [Output Only] Metadata about this warning in key: value format.
  5114. // For example:
  5115. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  5116. Data []*DiskListWarningData `json:"data,omitempty"`
  5117. // Message: [Output Only] A human-readable description of the warning
  5118. // code.
  5119. Message string `json:"message,omitempty"`
  5120. // ForceSendFields is a list of field names (e.g. "Code") to
  5121. // unconditionally include in API requests. By default, fields with
  5122. // empty values are omitted from API requests. However, any non-pointer,
  5123. // non-interface field appearing in ForceSendFields will be sent to the
  5124. // server regardless of whether the field is empty or not. This may be
  5125. // used to include empty fields in Patch requests.
  5126. ForceSendFields []string `json:"-"`
  5127. // NullFields is a list of field names (e.g. "Code") to include in API
  5128. // requests with the JSON null value. By default, fields with empty
  5129. // values are omitted from API requests. However, any field with an
  5130. // empty value appearing in NullFields will be sent to the server as
  5131. // null. It is an error if a field in this list has a non-empty value.
  5132. // This may be used to include null fields in Patch requests.
  5133. NullFields []string `json:"-"`
  5134. }
  5135. func (s *DiskListWarning) MarshalJSON() ([]byte, error) {
  5136. type NoMethod DiskListWarning
  5137. raw := NoMethod(*s)
  5138. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5139. }
  5140. type DiskListWarningData struct {
  5141. // Key: [Output Only] A key that provides more detail on the warning
  5142. // being returned. For example, for warnings where there are no results
  5143. // in a list request for a particular zone, this key might be scope and
  5144. // the key value might be the zone name. Other examples might be a key
  5145. // indicating a deprecated resource and a suggested replacement, or a
  5146. // warning about invalid network settings (for example, if an instance
  5147. // attempts to perform IP forwarding but is not enabled for IP
  5148. // forwarding).
  5149. Key string `json:"key,omitempty"`
  5150. // Value: [Output Only] A warning data value corresponding to the key.
  5151. Value string `json:"value,omitempty"`
  5152. // ForceSendFields is a list of field names (e.g. "Key") to
  5153. // unconditionally include in API requests. By default, fields with
  5154. // empty values are omitted from API requests. However, any non-pointer,
  5155. // non-interface field appearing in ForceSendFields will be sent to the
  5156. // server regardless of whether the field is empty or not. This may be
  5157. // used to include empty fields in Patch requests.
  5158. ForceSendFields []string `json:"-"`
  5159. // NullFields is a list of field names (e.g. "Key") to include in API
  5160. // requests with the JSON null value. By default, fields with empty
  5161. // values are omitted from API requests. However, any field with an
  5162. // empty value appearing in NullFields will be sent to the server as
  5163. // null. It is an error if a field in this list has a non-empty value.
  5164. // This may be used to include null fields in Patch requests.
  5165. NullFields []string `json:"-"`
  5166. }
  5167. func (s *DiskListWarningData) MarshalJSON() ([]byte, error) {
  5168. type NoMethod DiskListWarningData
  5169. raw := NoMethod(*s)
  5170. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5171. }
  5172. type DiskMoveRequest struct {
  5173. // DestinationZone: The URL of the destination zone to move the disk.
  5174. // This can be a full or partial URL. For example, the following are all
  5175. // valid URLs to a zone:
  5176. // - https://www.googleapis.com/compute/v1/projects/project/zones/zone
  5177. //
  5178. // - projects/project/zones/zone
  5179. // - zones/zone
  5180. DestinationZone string `json:"destinationZone,omitempty"`
  5181. // TargetDisk: The URL of the target disk to move. This can be a full or
  5182. // partial URL. For example, the following are all valid URLs to a disk:
  5183. //
  5184. // -
  5185. // https://www.googleapis.com/compute/v1/projects/project/zones/zone/disks/disk
  5186. // - projects/project/zones/zone/disks/disk
  5187. // - zones/zone/disks/disk
  5188. TargetDisk string `json:"targetDisk,omitempty"`
  5189. // ForceSendFields is a list of field names (e.g. "DestinationZone") to
  5190. // unconditionally include in API requests. By default, fields with
  5191. // empty values are omitted from API requests. However, any non-pointer,
  5192. // non-interface field appearing in ForceSendFields will be sent to the
  5193. // server regardless of whether the field is empty or not. This may be
  5194. // used to include empty fields in Patch requests.
  5195. ForceSendFields []string `json:"-"`
  5196. // NullFields is a list of field names (e.g. "DestinationZone") to
  5197. // include in API requests with the JSON null value. By default, fields
  5198. // with empty values are omitted from API requests. However, any field
  5199. // with an empty value appearing in NullFields will be sent to the
  5200. // server as null. It is an error if a field in this list has a
  5201. // non-empty value. This may be used to include null fields in Patch
  5202. // requests.
  5203. NullFields []string `json:"-"`
  5204. }
  5205. func (s *DiskMoveRequest) MarshalJSON() ([]byte, error) {
  5206. type NoMethod DiskMoveRequest
  5207. raw := NoMethod(*s)
  5208. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5209. }
  5210. // DiskType: A DiskType resource. (== resource_for beta.diskTypes ==)
  5211. // (== resource_for v1.diskTypes ==)
  5212. type DiskType struct {
  5213. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  5214. // format.
  5215. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  5216. // DefaultDiskSizeGb: [Output Only] Server-defined default disk size in
  5217. // GB.
  5218. DefaultDiskSizeGb int64 `json:"defaultDiskSizeGb,omitempty,string"`
  5219. // Deprecated: [Output Only] The deprecation status associated with this
  5220. // disk type.
  5221. Deprecated *DeprecationStatus `json:"deprecated,omitempty"`
  5222. // Description: [Output Only] An optional description of this resource.
  5223. Description string `json:"description,omitempty"`
  5224. // Id: [Output Only] The unique identifier for the resource. This
  5225. // identifier is defined by the server.
  5226. Id uint64 `json:"id,omitempty,string"`
  5227. // Kind: [Output Only] Type of the resource. Always compute#diskType for
  5228. // disk types.
  5229. Kind string `json:"kind,omitempty"`
  5230. // Name: [Output Only] Name of the resource.
  5231. Name string `json:"name,omitempty"`
  5232. // Region: [Output Only] URL of the region where the disk type resides.
  5233. // Only applicable for regional resources. You must specify this field
  5234. // as part of the HTTP request URL. It is not settable as a field in the
  5235. // request body.
  5236. Region string `json:"region,omitempty"`
  5237. // SelfLink: [Output Only] Server-defined URL for the resource.
  5238. SelfLink string `json:"selfLink,omitempty"`
  5239. // ValidDiskSize: [Output Only] An optional textual description of the
  5240. // valid disk size, such as "10GB-10TB".
  5241. ValidDiskSize string `json:"validDiskSize,omitempty"`
  5242. // Zone: [Output Only] URL of the zone where the disk type resides. You
  5243. // must specify this field as part of the HTTP request URL. It is not
  5244. // settable as a field in the request body.
  5245. Zone string `json:"zone,omitempty"`
  5246. // ServerResponse contains the HTTP response code and headers from the
  5247. // server.
  5248. googleapi.ServerResponse `json:"-"`
  5249. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  5250. // to unconditionally include in API requests. By default, fields with
  5251. // empty values are omitted from API requests. However, any non-pointer,
  5252. // non-interface field appearing in ForceSendFields will be sent to the
  5253. // server regardless of whether the field is empty or not. This may be
  5254. // used to include empty fields in Patch requests.
  5255. ForceSendFields []string `json:"-"`
  5256. // NullFields is a list of field names (e.g. "CreationTimestamp") to
  5257. // include in API requests with the JSON null value. By default, fields
  5258. // with empty values are omitted from API requests. However, any field
  5259. // with an empty value appearing in NullFields will be sent to the
  5260. // server as null. It is an error if a field in this list has a
  5261. // non-empty value. This may be used to include null fields in Patch
  5262. // requests.
  5263. NullFields []string `json:"-"`
  5264. }
  5265. func (s *DiskType) MarshalJSON() ([]byte, error) {
  5266. type NoMethod DiskType
  5267. raw := NoMethod(*s)
  5268. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5269. }
  5270. type DiskTypeAggregatedList struct {
  5271. // Id: [Output Only] Unique identifier for the resource; defined by the
  5272. // server.
  5273. Id string `json:"id,omitempty"`
  5274. // Items: A list of DiskTypesScopedList resources.
  5275. Items map[string]DiskTypesScopedList `json:"items,omitempty"`
  5276. // Kind: [Output Only] Type of resource. Always
  5277. // compute#diskTypeAggregatedList.
  5278. Kind string `json:"kind,omitempty"`
  5279. // NextPageToken: [Output Only] This token allows you to get the next
  5280. // page of results for list requests. If the number of results is larger
  5281. // than maxResults, use the nextPageToken as a value for the query
  5282. // parameter pageToken in the next list request. Subsequent list
  5283. // requests will have their own nextPageToken to continue paging through
  5284. // the results.
  5285. NextPageToken string `json:"nextPageToken,omitempty"`
  5286. // SelfLink: [Output Only] Server-defined URL for this resource.
  5287. SelfLink string `json:"selfLink,omitempty"`
  5288. // Warning: [Output Only] Informational warning message.
  5289. Warning *DiskTypeAggregatedListWarning `json:"warning,omitempty"`
  5290. // ServerResponse contains the HTTP response code and headers from the
  5291. // server.
  5292. googleapi.ServerResponse `json:"-"`
  5293. // ForceSendFields is a list of field names (e.g. "Id") to
  5294. // unconditionally include in API requests. By default, fields with
  5295. // empty values are omitted from API requests. However, any non-pointer,
  5296. // non-interface field appearing in ForceSendFields will be sent to the
  5297. // server regardless of whether the field is empty or not. This may be
  5298. // used to include empty fields in Patch requests.
  5299. ForceSendFields []string `json:"-"`
  5300. // NullFields is a list of field names (e.g. "Id") to include in API
  5301. // requests with the JSON null value. By default, fields with empty
  5302. // values are omitted from API requests. However, any field with an
  5303. // empty value appearing in NullFields will be sent to the server as
  5304. // null. It is an error if a field in this list has a non-empty value.
  5305. // This may be used to include null fields in Patch requests.
  5306. NullFields []string `json:"-"`
  5307. }
  5308. func (s *DiskTypeAggregatedList) MarshalJSON() ([]byte, error) {
  5309. type NoMethod DiskTypeAggregatedList
  5310. raw := NoMethod(*s)
  5311. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5312. }
  5313. // DiskTypeAggregatedListWarning: [Output Only] Informational warning
  5314. // message.
  5315. type DiskTypeAggregatedListWarning struct {
  5316. // Code: [Output Only] A warning code, if applicable. For example,
  5317. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  5318. // the response.
  5319. //
  5320. // Possible values:
  5321. // "CLEANUP_FAILED"
  5322. // "DEPRECATED_RESOURCE_USED"
  5323. // "DEPRECATED_TYPE_USED"
  5324. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  5325. // "EXPERIMENTAL_TYPE_USED"
  5326. // "EXTERNAL_API_WARNING"
  5327. // "FIELD_VALUE_OVERRIDEN"
  5328. // "INJECTED_KERNELS_DEPRECATED"
  5329. // "MISSING_TYPE_DEPENDENCY"
  5330. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  5331. // "NEXT_HOP_CANNOT_IP_FORWARD"
  5332. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  5333. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  5334. // "NEXT_HOP_NOT_RUNNING"
  5335. // "NOT_CRITICAL_ERROR"
  5336. // "NO_RESULTS_ON_PAGE"
  5337. // "REQUIRED_TOS_AGREEMENT"
  5338. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  5339. // "RESOURCE_NOT_DELETED"
  5340. // "SCHEMA_VALIDATION_IGNORED"
  5341. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  5342. // "UNDECLARED_PROPERTIES"
  5343. // "UNREACHABLE"
  5344. Code string `json:"code,omitempty"`
  5345. // Data: [Output Only] Metadata about this warning in key: value format.
  5346. // For example:
  5347. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  5348. Data []*DiskTypeAggregatedListWarningData `json:"data,omitempty"`
  5349. // Message: [Output Only] A human-readable description of the warning
  5350. // code.
  5351. Message string `json:"message,omitempty"`
  5352. // ForceSendFields is a list of field names (e.g. "Code") to
  5353. // unconditionally include in API requests. By default, fields with
  5354. // empty values are omitted from API requests. However, any non-pointer,
  5355. // non-interface field appearing in ForceSendFields will be sent to the
  5356. // server regardless of whether the field is empty or not. This may be
  5357. // used to include empty fields in Patch requests.
  5358. ForceSendFields []string `json:"-"`
  5359. // NullFields is a list of field names (e.g. "Code") to include in API
  5360. // requests with the JSON null value. By default, fields with empty
  5361. // values are omitted from API requests. However, any field with an
  5362. // empty value appearing in NullFields will be sent to the server as
  5363. // null. It is an error if a field in this list has a non-empty value.
  5364. // This may be used to include null fields in Patch requests.
  5365. NullFields []string `json:"-"`
  5366. }
  5367. func (s *DiskTypeAggregatedListWarning) MarshalJSON() ([]byte, error) {
  5368. type NoMethod DiskTypeAggregatedListWarning
  5369. raw := NoMethod(*s)
  5370. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5371. }
  5372. type DiskTypeAggregatedListWarningData struct {
  5373. // Key: [Output Only] A key that provides more detail on the warning
  5374. // being returned. For example, for warnings where there are no results
  5375. // in a list request for a particular zone, this key might be scope and
  5376. // the key value might be the zone name. Other examples might be a key
  5377. // indicating a deprecated resource and a suggested replacement, or a
  5378. // warning about invalid network settings (for example, if an instance
  5379. // attempts to perform IP forwarding but is not enabled for IP
  5380. // forwarding).
  5381. Key string `json:"key,omitempty"`
  5382. // Value: [Output Only] A warning data value corresponding to the key.
  5383. Value string `json:"value,omitempty"`
  5384. // ForceSendFields is a list of field names (e.g. "Key") to
  5385. // unconditionally include in API requests. By default, fields with
  5386. // empty values are omitted from API requests. However, any non-pointer,
  5387. // non-interface field appearing in ForceSendFields will be sent to the
  5388. // server regardless of whether the field is empty or not. This may be
  5389. // used to include empty fields in Patch requests.
  5390. ForceSendFields []string `json:"-"`
  5391. // NullFields is a list of field names (e.g. "Key") to include in API
  5392. // requests with the JSON null value. By default, fields with empty
  5393. // values are omitted from API requests. However, any field with an
  5394. // empty value appearing in NullFields will be sent to the server as
  5395. // null. It is an error if a field in this list has a non-empty value.
  5396. // This may be used to include null fields in Patch requests.
  5397. NullFields []string `json:"-"`
  5398. }
  5399. func (s *DiskTypeAggregatedListWarningData) MarshalJSON() ([]byte, error) {
  5400. type NoMethod DiskTypeAggregatedListWarningData
  5401. raw := NoMethod(*s)
  5402. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5403. }
  5404. // DiskTypeList: Contains a list of disk types.
  5405. type DiskTypeList struct {
  5406. // Id: [Output Only] Unique identifier for the resource; defined by the
  5407. // server.
  5408. Id string `json:"id,omitempty"`
  5409. // Items: A list of DiskType resources.
  5410. Items []*DiskType `json:"items,omitempty"`
  5411. // Kind: [Output Only] Type of resource. Always compute#diskTypeList for
  5412. // disk types.
  5413. Kind string `json:"kind,omitempty"`
  5414. // NextPageToken: [Output Only] This token allows you to get the next
  5415. // page of results for list requests. If the number of results is larger
  5416. // than maxResults, use the nextPageToken as a value for the query
  5417. // parameter pageToken in the next list request. Subsequent list
  5418. // requests will have their own nextPageToken to continue paging through
  5419. // the results.
  5420. NextPageToken string `json:"nextPageToken,omitempty"`
  5421. // SelfLink: [Output Only] Server-defined URL for this resource.
  5422. SelfLink string `json:"selfLink,omitempty"`
  5423. // Warning: [Output Only] Informational warning message.
  5424. Warning *DiskTypeListWarning `json:"warning,omitempty"`
  5425. // ServerResponse contains the HTTP response code and headers from the
  5426. // server.
  5427. googleapi.ServerResponse `json:"-"`
  5428. // ForceSendFields is a list of field names (e.g. "Id") to
  5429. // unconditionally include in API requests. By default, fields with
  5430. // empty values are omitted from API requests. However, any non-pointer,
  5431. // non-interface field appearing in ForceSendFields will be sent to the
  5432. // server regardless of whether the field is empty or not. This may be
  5433. // used to include empty fields in Patch requests.
  5434. ForceSendFields []string `json:"-"`
  5435. // NullFields is a list of field names (e.g. "Id") to include in API
  5436. // requests with the JSON null value. By default, fields with empty
  5437. // values are omitted from API requests. However, any field with an
  5438. // empty value appearing in NullFields will be sent to the server as
  5439. // null. It is an error if a field in this list has a non-empty value.
  5440. // This may be used to include null fields in Patch requests.
  5441. NullFields []string `json:"-"`
  5442. }
  5443. func (s *DiskTypeList) MarshalJSON() ([]byte, error) {
  5444. type NoMethod DiskTypeList
  5445. raw := NoMethod(*s)
  5446. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5447. }
  5448. // DiskTypeListWarning: [Output Only] Informational warning message.
  5449. type DiskTypeListWarning struct {
  5450. // Code: [Output Only] A warning code, if applicable. For example,
  5451. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  5452. // the response.
  5453. //
  5454. // Possible values:
  5455. // "CLEANUP_FAILED"
  5456. // "DEPRECATED_RESOURCE_USED"
  5457. // "DEPRECATED_TYPE_USED"
  5458. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  5459. // "EXPERIMENTAL_TYPE_USED"
  5460. // "EXTERNAL_API_WARNING"
  5461. // "FIELD_VALUE_OVERRIDEN"
  5462. // "INJECTED_KERNELS_DEPRECATED"
  5463. // "MISSING_TYPE_DEPENDENCY"
  5464. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  5465. // "NEXT_HOP_CANNOT_IP_FORWARD"
  5466. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  5467. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  5468. // "NEXT_HOP_NOT_RUNNING"
  5469. // "NOT_CRITICAL_ERROR"
  5470. // "NO_RESULTS_ON_PAGE"
  5471. // "REQUIRED_TOS_AGREEMENT"
  5472. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  5473. // "RESOURCE_NOT_DELETED"
  5474. // "SCHEMA_VALIDATION_IGNORED"
  5475. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  5476. // "UNDECLARED_PROPERTIES"
  5477. // "UNREACHABLE"
  5478. Code string `json:"code,omitempty"`
  5479. // Data: [Output Only] Metadata about this warning in key: value format.
  5480. // For example:
  5481. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  5482. Data []*DiskTypeListWarningData `json:"data,omitempty"`
  5483. // Message: [Output Only] A human-readable description of the warning
  5484. // code.
  5485. Message string `json:"message,omitempty"`
  5486. // ForceSendFields is a list of field names (e.g. "Code") to
  5487. // unconditionally include in API requests. By default, fields with
  5488. // empty values are omitted from API requests. However, any non-pointer,
  5489. // non-interface field appearing in ForceSendFields will be sent to the
  5490. // server regardless of whether the field is empty or not. This may be
  5491. // used to include empty fields in Patch requests.
  5492. ForceSendFields []string `json:"-"`
  5493. // NullFields is a list of field names (e.g. "Code") to include in API
  5494. // requests with the JSON null value. By default, fields with empty
  5495. // values are omitted from API requests. However, any field with an
  5496. // empty value appearing in NullFields will be sent to the server as
  5497. // null. It is an error if a field in this list has a non-empty value.
  5498. // This may be used to include null fields in Patch requests.
  5499. NullFields []string `json:"-"`
  5500. }
  5501. func (s *DiskTypeListWarning) MarshalJSON() ([]byte, error) {
  5502. type NoMethod DiskTypeListWarning
  5503. raw := NoMethod(*s)
  5504. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5505. }
  5506. type DiskTypeListWarningData struct {
  5507. // Key: [Output Only] A key that provides more detail on the warning
  5508. // being returned. For example, for warnings where there are no results
  5509. // in a list request for a particular zone, this key might be scope and
  5510. // the key value might be the zone name. Other examples might be a key
  5511. // indicating a deprecated resource and a suggested replacement, or a
  5512. // warning about invalid network settings (for example, if an instance
  5513. // attempts to perform IP forwarding but is not enabled for IP
  5514. // forwarding).
  5515. Key string `json:"key,omitempty"`
  5516. // Value: [Output Only] A warning data value corresponding to the key.
  5517. Value string `json:"value,omitempty"`
  5518. // ForceSendFields is a list of field names (e.g. "Key") to
  5519. // unconditionally include in API requests. By default, fields with
  5520. // empty values are omitted from API requests. However, any non-pointer,
  5521. // non-interface field appearing in ForceSendFields will be sent to the
  5522. // server regardless of whether the field is empty or not. This may be
  5523. // used to include empty fields in Patch requests.
  5524. ForceSendFields []string `json:"-"`
  5525. // NullFields is a list of field names (e.g. "Key") to include in API
  5526. // requests with the JSON null value. By default, fields with empty
  5527. // values are omitted from API requests. However, any field with an
  5528. // empty value appearing in NullFields will be sent to the server as
  5529. // null. It is an error if a field in this list has a non-empty value.
  5530. // This may be used to include null fields in Patch requests.
  5531. NullFields []string `json:"-"`
  5532. }
  5533. func (s *DiskTypeListWarningData) MarshalJSON() ([]byte, error) {
  5534. type NoMethod DiskTypeListWarningData
  5535. raw := NoMethod(*s)
  5536. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5537. }
  5538. type DiskTypesScopedList struct {
  5539. // DiskTypes: [Output Only] A list of disk types contained in this
  5540. // scope.
  5541. DiskTypes []*DiskType `json:"diskTypes,omitempty"`
  5542. // Warning: [Output Only] Informational warning which replaces the list
  5543. // of disk types when the list is empty.
  5544. Warning *DiskTypesScopedListWarning `json:"warning,omitempty"`
  5545. // ForceSendFields is a list of field names (e.g. "DiskTypes") 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. "DiskTypes") to include in
  5553. // API 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 *DiskTypesScopedList) MarshalJSON() ([]byte, error) {
  5561. type NoMethod DiskTypesScopedList
  5562. raw := NoMethod(*s)
  5563. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5564. }
  5565. // DiskTypesScopedListWarning: [Output Only] Informational warning which
  5566. // replaces the list of disk types when the list is empty.
  5567. type DiskTypesScopedListWarning struct {
  5568. // Code: [Output Only] A warning code, if applicable. For example,
  5569. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  5570. // the response.
  5571. //
  5572. // Possible values:
  5573. // "CLEANUP_FAILED"
  5574. // "DEPRECATED_RESOURCE_USED"
  5575. // "DEPRECATED_TYPE_USED"
  5576. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  5577. // "EXPERIMENTAL_TYPE_USED"
  5578. // "EXTERNAL_API_WARNING"
  5579. // "FIELD_VALUE_OVERRIDEN"
  5580. // "INJECTED_KERNELS_DEPRECATED"
  5581. // "MISSING_TYPE_DEPENDENCY"
  5582. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  5583. // "NEXT_HOP_CANNOT_IP_FORWARD"
  5584. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  5585. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  5586. // "NEXT_HOP_NOT_RUNNING"
  5587. // "NOT_CRITICAL_ERROR"
  5588. // "NO_RESULTS_ON_PAGE"
  5589. // "REQUIRED_TOS_AGREEMENT"
  5590. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  5591. // "RESOURCE_NOT_DELETED"
  5592. // "SCHEMA_VALIDATION_IGNORED"
  5593. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  5594. // "UNDECLARED_PROPERTIES"
  5595. // "UNREACHABLE"
  5596. Code string `json:"code,omitempty"`
  5597. // Data: [Output Only] Metadata about this warning in key: value format.
  5598. // For example:
  5599. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  5600. Data []*DiskTypesScopedListWarningData `json:"data,omitempty"`
  5601. // Message: [Output Only] A human-readable description of the warning
  5602. // code.
  5603. Message string `json:"message,omitempty"`
  5604. // ForceSendFields is a list of field names (e.g. "Code") to
  5605. // unconditionally include in API requests. By default, fields with
  5606. // empty values are omitted from API requests. However, any non-pointer,
  5607. // non-interface field appearing in ForceSendFields will be sent to the
  5608. // server regardless of whether the field is empty or not. This may be
  5609. // used to include empty fields in Patch requests.
  5610. ForceSendFields []string `json:"-"`
  5611. // NullFields is a list of field names (e.g. "Code") to include in API
  5612. // requests with the JSON null value. By default, fields with empty
  5613. // values are omitted from API requests. However, any field with an
  5614. // empty value appearing in NullFields will be sent to the server as
  5615. // null. It is an error if a field in this list has a non-empty value.
  5616. // This may be used to include null fields in Patch requests.
  5617. NullFields []string `json:"-"`
  5618. }
  5619. func (s *DiskTypesScopedListWarning) MarshalJSON() ([]byte, error) {
  5620. type NoMethod DiskTypesScopedListWarning
  5621. raw := NoMethod(*s)
  5622. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5623. }
  5624. type DiskTypesScopedListWarningData struct {
  5625. // Key: [Output Only] A key that provides more detail on the warning
  5626. // being returned. For example, for warnings where there are no results
  5627. // in a list request for a particular zone, this key might be scope and
  5628. // the key value might be the zone name. Other examples might be a key
  5629. // indicating a deprecated resource and a suggested replacement, or a
  5630. // warning about invalid network settings (for example, if an instance
  5631. // attempts to perform IP forwarding but is not enabled for IP
  5632. // forwarding).
  5633. Key string `json:"key,omitempty"`
  5634. // Value: [Output Only] A warning data value corresponding to the key.
  5635. Value string `json:"value,omitempty"`
  5636. // ForceSendFields is a list of field names (e.g. "Key") to
  5637. // unconditionally include in API requests. By default, fields with
  5638. // empty values are omitted from API requests. However, any non-pointer,
  5639. // non-interface field appearing in ForceSendFields will be sent to the
  5640. // server regardless of whether the field is empty or not. This may be
  5641. // used to include empty fields in Patch requests.
  5642. ForceSendFields []string `json:"-"`
  5643. // NullFields is a list of field names (e.g. "Key") to include in API
  5644. // requests with the JSON null value. By default, fields with empty
  5645. // values are omitted from API requests. However, any field with an
  5646. // empty value appearing in NullFields will be sent to the server as
  5647. // null. It is an error if a field in this list has a non-empty value.
  5648. // This may be used to include null fields in Patch requests.
  5649. NullFields []string `json:"-"`
  5650. }
  5651. func (s *DiskTypesScopedListWarningData) MarshalJSON() ([]byte, error) {
  5652. type NoMethod DiskTypesScopedListWarningData
  5653. raw := NoMethod(*s)
  5654. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5655. }
  5656. type DisksResizeRequest struct {
  5657. // SizeGb: The new size of the persistent disk, which is specified in
  5658. // GB.
  5659. SizeGb int64 `json:"sizeGb,omitempty,string"`
  5660. // ForceSendFields is a list of field names (e.g. "SizeGb") to
  5661. // unconditionally include in API requests. By default, fields with
  5662. // empty values are omitted from API requests. However, any non-pointer,
  5663. // non-interface field appearing in ForceSendFields will be sent to the
  5664. // server regardless of whether the field is empty or not. This may be
  5665. // used to include empty fields in Patch requests.
  5666. ForceSendFields []string `json:"-"`
  5667. // NullFields is a list of field names (e.g. "SizeGb") to include in API
  5668. // requests with the JSON null value. By default, fields with empty
  5669. // values are omitted from API requests. However, any field with an
  5670. // empty value appearing in NullFields will be sent to the server as
  5671. // null. It is an error if a field in this list has a non-empty value.
  5672. // This may be used to include null fields in Patch requests.
  5673. NullFields []string `json:"-"`
  5674. }
  5675. func (s *DisksResizeRequest) MarshalJSON() ([]byte, error) {
  5676. type NoMethod DisksResizeRequest
  5677. raw := NoMethod(*s)
  5678. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5679. }
  5680. type DisksScopedList struct {
  5681. // Disks: [Output Only] A list of disks contained in this scope.
  5682. Disks []*Disk `json:"disks,omitempty"`
  5683. // Warning: [Output Only] Informational warning which replaces the list
  5684. // of disks when the list is empty.
  5685. Warning *DisksScopedListWarning `json:"warning,omitempty"`
  5686. // ForceSendFields is a list of field names (e.g. "Disks") 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. "Disks") 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 *DisksScopedList) MarshalJSON() ([]byte, error) {
  5702. type NoMethod DisksScopedList
  5703. raw := NoMethod(*s)
  5704. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5705. }
  5706. // DisksScopedListWarning: [Output Only] Informational warning which
  5707. // replaces the list of disks when the list is empty.
  5708. type DisksScopedListWarning 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 []*DisksScopedListWarningData `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 *DisksScopedListWarning) MarshalJSON() ([]byte, error) {
  5761. type NoMethod DisksScopedListWarning
  5762. raw := NoMethod(*s)
  5763. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5764. }
  5765. type DisksScopedListWarningData 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 *DisksScopedListWarningData) MarshalJSON() ([]byte, error) {
  5793. type NoMethod DisksScopedListWarningData
  5794. raw := NoMethod(*s)
  5795. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5796. }
  5797. type DistributionPolicy struct {
  5798. Zones []*DistributionPolicyZoneConfiguration `json:"zones,omitempty"`
  5799. // ForceSendFields is a list of field names (e.g. "Zones") to
  5800. // unconditionally include in API requests. By default, fields with
  5801. // empty values are omitted from API requests. However, any non-pointer,
  5802. // non-interface field appearing in ForceSendFields will be sent to the
  5803. // server regardless of whether the field is empty or not. This may be
  5804. // used to include empty fields in Patch requests.
  5805. ForceSendFields []string `json:"-"`
  5806. // NullFields is a list of field names (e.g. "Zones") to include in API
  5807. // requests with the JSON null value. By default, fields with empty
  5808. // values are omitted from API requests. However, any field with an
  5809. // empty value appearing in NullFields will be sent to the server as
  5810. // null. It is an error if a field in this list has a non-empty value.
  5811. // This may be used to include null fields in Patch requests.
  5812. NullFields []string `json:"-"`
  5813. }
  5814. func (s *DistributionPolicy) MarshalJSON() ([]byte, error) {
  5815. type NoMethod DistributionPolicy
  5816. raw := NoMethod(*s)
  5817. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5818. }
  5819. type DistributionPolicyZoneConfiguration struct {
  5820. // Zone: URL of the zone where managed instance group is spawning
  5821. // instances (for regional resources). Zone has to belong to the region
  5822. // where managed instance group is located.
  5823. Zone string `json:"zone,omitempty"`
  5824. // ForceSendFields is a list of field names (e.g. "Zone") to
  5825. // unconditionally include in API requests. By default, fields with
  5826. // empty values are omitted from API requests. However, any non-pointer,
  5827. // non-interface field appearing in ForceSendFields will be sent to the
  5828. // server regardless of whether the field is empty or not. This may be
  5829. // used to include empty fields in Patch requests.
  5830. ForceSendFields []string `json:"-"`
  5831. // NullFields is a list of field names (e.g. "Zone") to include in API
  5832. // requests with the JSON null value. By default, fields with empty
  5833. // values are omitted from API requests. However, any field with an
  5834. // empty value appearing in NullFields will be sent to the server as
  5835. // null. It is an error if a field in this list has a non-empty value.
  5836. // This may be used to include null fields in Patch requests.
  5837. NullFields []string `json:"-"`
  5838. }
  5839. func (s *DistributionPolicyZoneConfiguration) MarshalJSON() ([]byte, error) {
  5840. type NoMethod DistributionPolicyZoneConfiguration
  5841. raw := NoMethod(*s)
  5842. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5843. }
  5844. // Expr: Represents an expression text. Example:
  5845. //
  5846. // title: "User account presence" description: "Determines whether the
  5847. // request has a user account" expression: "size(request.user) > 0"
  5848. type Expr struct {
  5849. // Description: An optional description of the expression. This is a
  5850. // longer text which describes the expression, e.g. when hovered over it
  5851. // in a UI.
  5852. Description string `json:"description,omitempty"`
  5853. // Expression: Textual representation of an expression in Common
  5854. // Expression Language syntax.
  5855. //
  5856. // The application context of the containing message determines which
  5857. // well-known feature set of CEL is supported.
  5858. Expression string `json:"expression,omitempty"`
  5859. // Location: An optional string indicating the location of the
  5860. // expression for error reporting, e.g. a file name and a position in
  5861. // the file.
  5862. Location string `json:"location,omitempty"`
  5863. // Title: An optional title for the expression, i.e. a short string
  5864. // describing its purpose. This can be used e.g. in UIs which allow to
  5865. // enter the expression.
  5866. Title string `json:"title,omitempty"`
  5867. // ForceSendFields is a list of field names (e.g. "Description") to
  5868. // unconditionally include in API requests. By default, fields with
  5869. // empty values are omitted from API requests. However, any non-pointer,
  5870. // non-interface field appearing in ForceSendFields will be sent to the
  5871. // server regardless of whether the field is empty or not. This may be
  5872. // used to include empty fields in Patch requests.
  5873. ForceSendFields []string `json:"-"`
  5874. // NullFields is a list of field names (e.g. "Description") to include
  5875. // in API requests with the JSON null value. By default, fields with
  5876. // empty values are omitted from API requests. However, any field with
  5877. // an empty value appearing in NullFields will be sent to the server as
  5878. // null. It is an error if a field in this list has a non-empty value.
  5879. // This may be used to include null fields in Patch requests.
  5880. NullFields []string `json:"-"`
  5881. }
  5882. func (s *Expr) MarshalJSON() ([]byte, error) {
  5883. type NoMethod Expr
  5884. raw := NoMethod(*s)
  5885. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5886. }
  5887. // Firewall: Represents a Firewall resource.
  5888. type Firewall struct {
  5889. // Allowed: The list of ALLOW rules specified by this firewall. Each
  5890. // rule specifies a protocol and port-range tuple that describes a
  5891. // permitted connection.
  5892. Allowed []*FirewallAllowed `json:"allowed,omitempty"`
  5893. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  5894. // format.
  5895. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  5896. // Denied: The list of DENY rules specified by this firewall. Each rule
  5897. // specifies a protocol and port-range tuple that describes a denied
  5898. // connection.
  5899. Denied []*FirewallDenied `json:"denied,omitempty"`
  5900. // Description: An optional description of this resource. Provide this
  5901. // property when you create the resource.
  5902. Description string `json:"description,omitempty"`
  5903. // DestinationRanges: If destination ranges are specified, the firewall
  5904. // will apply only to traffic that has destination IP address in these
  5905. // ranges. These ranges must be expressed in CIDR format. Only IPv4 is
  5906. // supported.
  5907. DestinationRanges []string `json:"destinationRanges,omitempty"`
  5908. // Direction: Direction of traffic to which this firewall applies;
  5909. // default is INGRESS. Note: For INGRESS traffic, it is NOT supported to
  5910. // specify destinationRanges; For EGRESS traffic, it is NOT supported to
  5911. // specify sourceRanges OR sourceTags.
  5912. //
  5913. // Possible values:
  5914. // "EGRESS"
  5915. // "INGRESS"
  5916. Direction string `json:"direction,omitempty"`
  5917. // Disabled: Denotes whether the firewall rule is disabled, i.e not
  5918. // applied to the network it is associated with. When set to true, the
  5919. // firewall rule is not enforced and the network behaves as if it did
  5920. // not exist. If this is unspecified, the firewall rule will be enabled.
  5921. Disabled bool `json:"disabled,omitempty"`
  5922. // EnableLogging: This field denotes whether to enable logging for a
  5923. // particular firewall rule. If logging is enabled, logs will be
  5924. // exported to Stackdriver.
  5925. EnableLogging bool `json:"enableLogging,omitempty"`
  5926. // Id: [Output Only] The unique identifier for the resource. This
  5927. // identifier is defined by the server.
  5928. Id uint64 `json:"id,omitempty,string"`
  5929. // Kind: [Output Only] Type of the resource. Always compute#firewall for
  5930. // firewall rules.
  5931. Kind string `json:"kind,omitempty"`
  5932. // Name: Name of the resource; provided by the client when the resource
  5933. // is created. The name must be 1-63 characters long, and comply with
  5934. // RFC1035. Specifically, the name must be 1-63 characters long and
  5935. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  5936. // the first character must be a lowercase letter, and all following
  5937. // characters must be a dash, lowercase letter, or digit, except the
  5938. // last character, which cannot be a dash.
  5939. Name string `json:"name,omitempty"`
  5940. // Network: URL of the network resource for this firewall rule. If not
  5941. // specified when creating a firewall rule, the default network is
  5942. // used:
  5943. // global/networks/default
  5944. // If you choose to specify this property, you can specify the network
  5945. // as a full or partial URL. For example, the following are all valid
  5946. // URLs:
  5947. // -
  5948. // https://www.googleapis.com/compute/v1/projects/myproject/global/networks/my-network
  5949. // - projects/myproject/global/networks/my-network
  5950. // - global/networks/default
  5951. Network string `json:"network,omitempty"`
  5952. // Priority: Priority for this rule. This is an integer between 0 and
  5953. // 65535, both inclusive. When not specified, the value assumed is 1000.
  5954. // Relative priorities determine precedence of conflicting rules. Lower
  5955. // value of priority implies higher precedence (eg, a rule with priority
  5956. // 0 has higher precedence than a rule with priority 1). DENY rules take
  5957. // precedence over ALLOW rules having equal priority.
  5958. Priority int64 `json:"priority,omitempty"`
  5959. // SelfLink: [Output Only] Server-defined URL for the resource.
  5960. SelfLink string `json:"selfLink,omitempty"`
  5961. // SourceRanges: If source ranges are specified, the firewall will apply
  5962. // only to traffic that has source IP address in these ranges. These
  5963. // ranges must be expressed in CIDR format. One or both of sourceRanges
  5964. // and sourceTags may be set. If both properties are set, the firewall
  5965. // will apply to traffic that has source IP address within sourceRanges
  5966. // OR the source IP that belongs to a tag listed in the sourceTags
  5967. // property. The connection does not need to match both properties for
  5968. // the firewall to apply. Only IPv4 is supported.
  5969. SourceRanges []string `json:"sourceRanges,omitempty"`
  5970. // SourceServiceAccounts: If source service accounts are specified, the
  5971. // firewall will apply only to traffic originating from an instance with
  5972. // a service account in this list. Source service accounts cannot be
  5973. // used to control traffic to an instance's external IP address because
  5974. // service accounts are associated with an instance, not an IP address.
  5975. // sourceRanges can be set at the same time as sourceServiceAccounts. If
  5976. // both are set, the firewall will apply to traffic that has source IP
  5977. // address within sourceRanges OR the source IP belongs to an instance
  5978. // with service account listed in sourceServiceAccount. The connection
  5979. // does not need to match both properties for the firewall to apply.
  5980. // sourceServiceAccounts cannot be used at the same time as sourceTags
  5981. // or targetTags.
  5982. SourceServiceAccounts []string `json:"sourceServiceAccounts,omitempty"`
  5983. // SourceTags: If source tags are specified, the firewall rule applies
  5984. // only to traffic with source IPs that match the primary network
  5985. // interfaces of VM instances that have the tag and are in the same VPC
  5986. // network. Source tags cannot be used to control traffic to an
  5987. // instance's external IP address, it only applies to traffic between
  5988. // instances in the same virtual network. Because tags are associated
  5989. // with instances, not IP addresses. One or both of sourceRanges and
  5990. // sourceTags may be set. If both properties are set, the firewall will
  5991. // apply to traffic that has source IP address within sourceRanges OR
  5992. // the source IP that belongs to a tag listed in the sourceTags
  5993. // property. The connection does not need to match both properties for
  5994. // the firewall to apply.
  5995. SourceTags []string `json:"sourceTags,omitempty"`
  5996. // TargetServiceAccounts: A list of service accounts indicating sets of
  5997. // instances located in the network that may make network connections as
  5998. // specified in allowed[]. targetServiceAccounts cannot be used at the
  5999. // same time as targetTags or sourceTags. If neither
  6000. // targetServiceAccounts nor targetTags are specified, the firewall rule
  6001. // applies to all instances on the specified network.
  6002. TargetServiceAccounts []string `json:"targetServiceAccounts,omitempty"`
  6003. // TargetTags: A list of tags that controls which instances the firewall
  6004. // rule applies to. If targetTags are specified, then the firewall rule
  6005. // applies only to instances in the VPC network that have one of those
  6006. // tags. If no targetTags are specified, the firewall rule applies to
  6007. // all instances on the specified network.
  6008. TargetTags []string `json:"targetTags,omitempty"`
  6009. // ServerResponse contains the HTTP response code and headers from the
  6010. // server.
  6011. googleapi.ServerResponse `json:"-"`
  6012. // ForceSendFields is a list of field names (e.g. "Allowed") to
  6013. // unconditionally include in API requests. By default, fields with
  6014. // empty values are omitted from API requests. However, any non-pointer,
  6015. // non-interface field appearing in ForceSendFields will be sent to the
  6016. // server regardless of whether the field is empty or not. This may be
  6017. // used to include empty fields in Patch requests.
  6018. ForceSendFields []string `json:"-"`
  6019. // NullFields is a list of field names (e.g. "Allowed") to include in
  6020. // API requests with the JSON null value. By default, fields with empty
  6021. // values are omitted from API requests. However, any field with an
  6022. // empty value appearing in NullFields will be sent to the server as
  6023. // null. It is an error if a field in this list has a non-empty value.
  6024. // This may be used to include null fields in Patch requests.
  6025. NullFields []string `json:"-"`
  6026. }
  6027. func (s *Firewall) MarshalJSON() ([]byte, error) {
  6028. type NoMethod Firewall
  6029. raw := NoMethod(*s)
  6030. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6031. }
  6032. type FirewallAllowed struct {
  6033. // IPProtocol: The IP protocol to which this rule applies. The protocol
  6034. // type is required when creating a firewall rule. This value can either
  6035. // be one of the following well known protocol strings (tcp, udp, icmp,
  6036. // esp, ah, ipip, sctp), or the IP protocol number.
  6037. IPProtocol string `json:"IPProtocol,omitempty"`
  6038. // Ports: An optional list of ports to which this rule applies. This
  6039. // field is only applicable for UDP or TCP protocol. Each entry must be
  6040. // either an integer or a range. If not specified, this rule applies to
  6041. // connections through any port.
  6042. //
  6043. // Example inputs include: ["22"], ["80","443"], and ["12345-12349"].
  6044. Ports []string `json:"ports,omitempty"`
  6045. // ForceSendFields is a list of field names (e.g. "IPProtocol") to
  6046. // unconditionally include in API requests. By default, fields with
  6047. // empty values are omitted from API requests. However, any non-pointer,
  6048. // non-interface field appearing in ForceSendFields will be sent to the
  6049. // server regardless of whether the field is empty or not. This may be
  6050. // used to include empty fields in Patch requests.
  6051. ForceSendFields []string `json:"-"`
  6052. // NullFields is a list of field names (e.g. "IPProtocol") to include in
  6053. // API requests with the JSON null value. By default, fields with empty
  6054. // values are omitted from API requests. However, any field with an
  6055. // empty value appearing in NullFields will be sent to the server as
  6056. // null. It is an error if a field in this list has a non-empty value.
  6057. // This may be used to include null fields in Patch requests.
  6058. NullFields []string `json:"-"`
  6059. }
  6060. func (s *FirewallAllowed) MarshalJSON() ([]byte, error) {
  6061. type NoMethod FirewallAllowed
  6062. raw := NoMethod(*s)
  6063. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6064. }
  6065. type FirewallDenied struct {
  6066. // IPProtocol: The IP protocol to which this rule applies. The protocol
  6067. // type is required when creating a firewall rule. This value can either
  6068. // be one of the following well known protocol strings (tcp, udp, icmp,
  6069. // esp, ah, ipip, sctp), or the IP protocol number.
  6070. IPProtocol string `json:"IPProtocol,omitempty"`
  6071. // Ports: An optional list of ports to which this rule applies. This
  6072. // field is only applicable for UDP or TCP protocol. Each entry must be
  6073. // either an integer or a range. If not specified, this rule applies to
  6074. // connections through any port.
  6075. //
  6076. // Example inputs include: ["22"], ["80","443"], and ["12345-12349"].
  6077. Ports []string `json:"ports,omitempty"`
  6078. // ForceSendFields is a list of field names (e.g. "IPProtocol") to
  6079. // unconditionally include in API requests. By default, fields with
  6080. // empty values are omitted from API requests. However, any non-pointer,
  6081. // non-interface field appearing in ForceSendFields will be sent to the
  6082. // server regardless of whether the field is empty or not. This may be
  6083. // used to include empty fields in Patch requests.
  6084. ForceSendFields []string `json:"-"`
  6085. // NullFields is a list of field names (e.g. "IPProtocol") to include in
  6086. // API requests with the JSON null value. By default, fields with empty
  6087. // values are omitted from API requests. However, any field with an
  6088. // empty value appearing in NullFields will be sent to the server as
  6089. // null. It is an error if a field in this list has a non-empty value.
  6090. // This may be used to include null fields in Patch requests.
  6091. NullFields []string `json:"-"`
  6092. }
  6093. func (s *FirewallDenied) MarshalJSON() ([]byte, error) {
  6094. type NoMethod FirewallDenied
  6095. raw := NoMethod(*s)
  6096. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6097. }
  6098. // FirewallList: Contains a list of firewalls.
  6099. type FirewallList struct {
  6100. // Id: [Output Only] Unique identifier for the resource; defined by the
  6101. // server.
  6102. Id string `json:"id,omitempty"`
  6103. // Items: A list of Firewall resources.
  6104. Items []*Firewall `json:"items,omitempty"`
  6105. // Kind: [Output Only] Type of resource. Always compute#firewallList for
  6106. // lists of firewalls.
  6107. Kind string `json:"kind,omitempty"`
  6108. // NextPageToken: [Output Only] This token allows you to get the next
  6109. // page of results for list requests. If the number of results is larger
  6110. // than maxResults, use the nextPageToken as a value for the query
  6111. // parameter pageToken in the next list request. Subsequent list
  6112. // requests will have their own nextPageToken to continue paging through
  6113. // the results.
  6114. NextPageToken string `json:"nextPageToken,omitempty"`
  6115. // SelfLink: [Output Only] Server-defined URL for this resource.
  6116. SelfLink string `json:"selfLink,omitempty"`
  6117. // Warning: [Output Only] Informational warning message.
  6118. Warning *FirewallListWarning `json:"warning,omitempty"`
  6119. // ServerResponse contains the HTTP response code and headers from the
  6120. // server.
  6121. googleapi.ServerResponse `json:"-"`
  6122. // ForceSendFields is a list of field names (e.g. "Id") to
  6123. // unconditionally include in API requests. By default, fields with
  6124. // empty values are omitted from API requests. However, any non-pointer,
  6125. // non-interface field appearing in ForceSendFields will be sent to the
  6126. // server regardless of whether the field is empty or not. This may be
  6127. // used to include empty fields in Patch requests.
  6128. ForceSendFields []string `json:"-"`
  6129. // NullFields is a list of field names (e.g. "Id") to include in API
  6130. // requests with the JSON null value. By default, fields with empty
  6131. // values are omitted from API requests. However, any field with an
  6132. // empty value appearing in NullFields will be sent to the server as
  6133. // null. It is an error if a field in this list has a non-empty value.
  6134. // This may be used to include null fields in Patch requests.
  6135. NullFields []string `json:"-"`
  6136. }
  6137. func (s *FirewallList) MarshalJSON() ([]byte, error) {
  6138. type NoMethod FirewallList
  6139. raw := NoMethod(*s)
  6140. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6141. }
  6142. // FirewallListWarning: [Output Only] Informational warning message.
  6143. type FirewallListWarning struct {
  6144. // Code: [Output Only] A warning code, if applicable. For example,
  6145. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  6146. // the response.
  6147. //
  6148. // Possible values:
  6149. // "CLEANUP_FAILED"
  6150. // "DEPRECATED_RESOURCE_USED"
  6151. // "DEPRECATED_TYPE_USED"
  6152. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  6153. // "EXPERIMENTAL_TYPE_USED"
  6154. // "EXTERNAL_API_WARNING"
  6155. // "FIELD_VALUE_OVERRIDEN"
  6156. // "INJECTED_KERNELS_DEPRECATED"
  6157. // "MISSING_TYPE_DEPENDENCY"
  6158. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  6159. // "NEXT_HOP_CANNOT_IP_FORWARD"
  6160. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  6161. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  6162. // "NEXT_HOP_NOT_RUNNING"
  6163. // "NOT_CRITICAL_ERROR"
  6164. // "NO_RESULTS_ON_PAGE"
  6165. // "REQUIRED_TOS_AGREEMENT"
  6166. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  6167. // "RESOURCE_NOT_DELETED"
  6168. // "SCHEMA_VALIDATION_IGNORED"
  6169. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  6170. // "UNDECLARED_PROPERTIES"
  6171. // "UNREACHABLE"
  6172. Code string `json:"code,omitempty"`
  6173. // Data: [Output Only] Metadata about this warning in key: value format.
  6174. // For example:
  6175. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  6176. Data []*FirewallListWarningData `json:"data,omitempty"`
  6177. // Message: [Output Only] A human-readable description of the warning
  6178. // code.
  6179. Message string `json:"message,omitempty"`
  6180. // ForceSendFields is a list of field names (e.g. "Code") to
  6181. // unconditionally include in API requests. By default, fields with
  6182. // empty values are omitted from API requests. However, any non-pointer,
  6183. // non-interface field appearing in ForceSendFields will be sent to the
  6184. // server regardless of whether the field is empty or not. This may be
  6185. // used to include empty fields in Patch requests.
  6186. ForceSendFields []string `json:"-"`
  6187. // NullFields is a list of field names (e.g. "Code") to include in API
  6188. // requests with the JSON null value. By default, fields with empty
  6189. // values are omitted from API requests. However, any field with an
  6190. // empty value appearing in NullFields will be sent to the server as
  6191. // null. It is an error if a field in this list has a non-empty value.
  6192. // This may be used to include null fields in Patch requests.
  6193. NullFields []string `json:"-"`
  6194. }
  6195. func (s *FirewallListWarning) MarshalJSON() ([]byte, error) {
  6196. type NoMethod FirewallListWarning
  6197. raw := NoMethod(*s)
  6198. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6199. }
  6200. type FirewallListWarningData struct {
  6201. // Key: [Output Only] A key that provides more detail on the warning
  6202. // being returned. For example, for warnings where there are no results
  6203. // in a list request for a particular zone, this key might be scope and
  6204. // the key value might be the zone name. Other examples might be a key
  6205. // indicating a deprecated resource and a suggested replacement, or a
  6206. // warning about invalid network settings (for example, if an instance
  6207. // attempts to perform IP forwarding but is not enabled for IP
  6208. // forwarding).
  6209. Key string `json:"key,omitempty"`
  6210. // Value: [Output Only] A warning data value corresponding to the key.
  6211. Value string `json:"value,omitempty"`
  6212. // ForceSendFields is a list of field names (e.g. "Key") to
  6213. // unconditionally include in API requests. By default, fields with
  6214. // empty values are omitted from API requests. However, any non-pointer,
  6215. // non-interface field appearing in ForceSendFields will be sent to the
  6216. // server regardless of whether the field is empty or not. This may be
  6217. // used to include empty fields in Patch requests.
  6218. ForceSendFields []string `json:"-"`
  6219. // NullFields is a list of field names (e.g. "Key") to include in API
  6220. // requests with the JSON null value. By default, fields with empty
  6221. // values are omitted from API requests. However, any field with an
  6222. // empty value appearing in NullFields will be sent to the server as
  6223. // null. It is an error if a field in this list has a non-empty value.
  6224. // This may be used to include null fields in Patch requests.
  6225. NullFields []string `json:"-"`
  6226. }
  6227. func (s *FirewallListWarningData) MarshalJSON() ([]byte, error) {
  6228. type NoMethod FirewallListWarningData
  6229. raw := NoMethod(*s)
  6230. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6231. }
  6232. // FixedOrPercent: Encapsulates numeric value that can be either
  6233. // absolute or relative.
  6234. type FixedOrPercent struct {
  6235. // Calculated: [Output Only] Absolute value of VM instances calculated
  6236. // based on the specific mode.
  6237. //
  6238. //
  6239. // - If the value is fixed, then the caculated value is equal to the
  6240. // fixed value.
  6241. // - If the value is a percent, then the calculated value is percent/100
  6242. // * targetSize. For example, the calculated value of a 80% of a managed
  6243. // instance group with 150 instances would be (80/100 * 150) = 120 VM
  6244. // instances. If there is a remainder, the number is rounded up.
  6245. Calculated int64 `json:"calculated,omitempty"`
  6246. // Fixed: Specifies a fixed number of VM instances. This must be a
  6247. // positive integer.
  6248. Fixed int64 `json:"fixed,omitempty"`
  6249. // Percent: Specifies a percentage of instances between 0 to 100%,
  6250. // inclusive. For example, specify 80 for 80%.
  6251. Percent int64 `json:"percent,omitempty"`
  6252. // ForceSendFields is a list of field names (e.g. "Calculated") to
  6253. // unconditionally include in API requests. By default, fields with
  6254. // empty values are omitted from API requests. However, any non-pointer,
  6255. // non-interface field appearing in ForceSendFields will be sent to the
  6256. // server regardless of whether the field is empty or not. This may be
  6257. // used to include empty fields in Patch requests.
  6258. ForceSendFields []string `json:"-"`
  6259. // NullFields is a list of field names (e.g. "Calculated") to include in
  6260. // API requests with the JSON null value. By default, fields with empty
  6261. // values are omitted from API requests. However, any field with an
  6262. // empty value appearing in NullFields will be sent to the server as
  6263. // null. It is an error if a field in this list has a non-empty value.
  6264. // This may be used to include null fields in Patch requests.
  6265. NullFields []string `json:"-"`
  6266. }
  6267. func (s *FixedOrPercent) MarshalJSON() ([]byte, error) {
  6268. type NoMethod FixedOrPercent
  6269. raw := NoMethod(*s)
  6270. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6271. }
  6272. // ForwardingRule: A ForwardingRule resource. A ForwardingRule resource
  6273. // specifies which pool of target virtual machines to forward a packet
  6274. // to if it matches the given [IPAddress, IPProtocol, ports] tuple. (==
  6275. // resource_for beta.forwardingRules ==) (== resource_for
  6276. // v1.forwardingRules ==) (== resource_for beta.globalForwardingRules
  6277. // ==) (== resource_for v1.globalForwardingRules ==) (== resource_for
  6278. // beta.regionForwardingRules ==) (== resource_for
  6279. // v1.regionForwardingRules ==)
  6280. type ForwardingRule struct {
  6281. // IPAddress: The IP address that this forwarding rule is serving on
  6282. // behalf of.
  6283. //
  6284. // Addresses are restricted based on the forwarding rule's load
  6285. // balancing scheme (EXTERNAL or INTERNAL) and scope (global or
  6286. // regional).
  6287. //
  6288. // When the load balancing scheme is EXTERNAL, for global forwarding
  6289. // rules, the address must be a global IP, and for regional forwarding
  6290. // rules, the address must live in the same region as the forwarding
  6291. // rule. If this field is empty, an ephemeral IPv4 address from the same
  6292. // scope (global or regional) will be assigned. A regional forwarding
  6293. // rule supports IPv4 only. A global forwarding rule supports either
  6294. // IPv4 or IPv6.
  6295. //
  6296. // When the load balancing scheme is INTERNAL, this can only be an RFC
  6297. // 1918 IP address belonging to the network/subnet configured for the
  6298. // forwarding rule. By default, if this field is empty, an ephemeral
  6299. // internal IP address will be automatically allocated from the IP range
  6300. // of the subnet or network configured for this forwarding rule.
  6301. //
  6302. // An address can be specified either by a literal IP address or a URL
  6303. // reference to an existing Address resource. The following examples are
  6304. // all valid:
  6305. // - 100.1.2.3
  6306. // -
  6307. // https://www.googleapis.com/compute/v1/projects/project/regions/region/addresses/address
  6308. // - projects/project/regions/region/addresses/address
  6309. // - regions/region/addresses/address
  6310. // - global/addresses/address
  6311. // - address
  6312. IPAddress string `json:"IPAddress,omitempty"`
  6313. // IPProtocol: The IP protocol to which this rule applies. Valid options
  6314. // are TCP, UDP, ESP, AH, SCTP or ICMP.
  6315. //
  6316. // When the load balancing scheme is INTERNAL, only TCP and UDP are
  6317. // valid.
  6318. //
  6319. // Possible values:
  6320. // "AH"
  6321. // "ESP"
  6322. // "ICMP"
  6323. // "SCTP"
  6324. // "TCP"
  6325. // "UDP"
  6326. IPProtocol string `json:"IPProtocol,omitempty"`
  6327. // BackendService: This field is not used for external load
  6328. // balancing.
  6329. //
  6330. // For internal load balancing, this field identifies the BackendService
  6331. // resource to receive the matched traffic.
  6332. BackendService string `json:"backendService,omitempty"`
  6333. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  6334. // format.
  6335. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  6336. // Description: An optional description of this resource. Provide this
  6337. // property when you create the resource.
  6338. Description string `json:"description,omitempty"`
  6339. // Id: [Output Only] The unique identifier for the resource. This
  6340. // identifier is defined by the server.
  6341. Id uint64 `json:"id,omitempty,string"`
  6342. // IpVersion: The IP Version that will be used by this forwarding rule.
  6343. // Valid options are IPV4 or IPV6. This can only be specified for a
  6344. // global forwarding rule.
  6345. //
  6346. // Possible values:
  6347. // "IPV4"
  6348. // "IPV6"
  6349. // "UNSPECIFIED_VERSION"
  6350. IpVersion string `json:"ipVersion,omitempty"`
  6351. // Kind: [Output Only] Type of the resource. Always
  6352. // compute#forwardingRule for Forwarding Rule resources.
  6353. Kind string `json:"kind,omitempty"`
  6354. // LabelFingerprint: A fingerprint for the labels being applied to this
  6355. // resource, which is essentially a hash of the labels set used for
  6356. // optimistic locking. The fingerprint is initially generated by Compute
  6357. // Engine and changes after every request to modify or update labels.
  6358. // You must always provide an up-to-date fingerprint hash in order to
  6359. // update or change labels.
  6360. //
  6361. // To see the latest fingerprint, make a get() request to retrieve a
  6362. // ForwardingRule.
  6363. LabelFingerprint string `json:"labelFingerprint,omitempty"`
  6364. // Labels: Labels to apply to this resource. These can be later modified
  6365. // by the setLabels method. Each label key/value pair must comply with
  6366. // RFC1035. Label values may be empty.
  6367. Labels map[string]string `json:"labels,omitempty"`
  6368. // LoadBalancingScheme: This signifies what the ForwardingRule will be
  6369. // used for and can only take the following values: INTERNAL, EXTERNAL
  6370. // The value of INTERNAL means that this will be used for Internal
  6371. // Network Load Balancing (TCP, UDP). The value of EXTERNAL means that
  6372. // this will be used for External Load Balancing (HTTP(S) LB, External
  6373. // TCP/UDP LB, SSL Proxy)
  6374. //
  6375. // Possible values:
  6376. // "EXTERNAL"
  6377. // "INTERNAL"
  6378. // "INVALID"
  6379. LoadBalancingScheme string `json:"loadBalancingScheme,omitempty"`
  6380. // Name: Name of the resource; provided by the client when the resource
  6381. // is created. The name must be 1-63 characters long, and comply with
  6382. // RFC1035. Specifically, the name must be 1-63 characters long and
  6383. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  6384. // the first character must be a lowercase letter, and all following
  6385. // characters must be a dash, lowercase letter, or digit, except the
  6386. // last character, which cannot be a dash.
  6387. Name string `json:"name,omitempty"`
  6388. // Network: This field is not used for external load balancing.
  6389. //
  6390. // For internal load balancing, this field identifies the network that
  6391. // the load balanced IP should belong to for this Forwarding Rule. If
  6392. // this field is not specified, the default network will be used.
  6393. Network string `json:"network,omitempty"`
  6394. // NetworkTier: This signifies the networking tier used for configuring
  6395. // this load balancer and can only take the following values: PREMIUM ,
  6396. // STANDARD.
  6397. //
  6398. // For regional ForwardingRule, the valid values are PREMIUM and
  6399. // STANDARD. For GlobalForwardingRule, the valid value is PREMIUM.
  6400. //
  6401. // If this field is not specified, it is assumed to be PREMIUM. If
  6402. // IPAddress is specified, this value must be equal to the networkTier
  6403. // of the Address.
  6404. //
  6405. // Possible values:
  6406. // "PREMIUM"
  6407. // "STANDARD"
  6408. NetworkTier string `json:"networkTier,omitempty"`
  6409. // PortRange: This field is used along with the target field for
  6410. // TargetHttpProxy, TargetHttpsProxy, TargetSslProxy, TargetTcpProxy,
  6411. // TargetVpnGateway, TargetPool, TargetInstance.
  6412. //
  6413. // Applicable only when IPProtocol is TCP, UDP, or SCTP, only packets
  6414. // addressed to ports in the specified range will be forwarded to
  6415. // target. Forwarding rules with the same [IPAddress, IPProtocol] pair
  6416. // must have disjoint port ranges.
  6417. //
  6418. // Some types of forwarding target have constraints on the acceptable
  6419. // ports:
  6420. // - TargetHttpProxy: 80, 8080
  6421. // - TargetHttpsProxy: 443
  6422. // - TargetTcpProxy: 25, 43, 110, 143, 195, 443, 465, 587, 700, 993,
  6423. // 995, 1688, 1883, 5222
  6424. // - TargetSslProxy: 25, 43, 110, 143, 195, 443, 465, 587, 700, 993,
  6425. // 995, 1688, 1883, 5222
  6426. // - TargetVpnGateway: 500, 4500
  6427. PortRange string `json:"portRange,omitempty"`
  6428. // Ports: This field is used along with the backend_service field for
  6429. // internal load balancing.
  6430. //
  6431. // When the load balancing scheme is INTERNAL, a single port or a comma
  6432. // separated list of ports can be configured. Only packets addressed to
  6433. // these ports will be forwarded to the backends configured with this
  6434. // forwarding rule.
  6435. //
  6436. // You may specify a maximum of up to 5 ports.
  6437. Ports []string `json:"ports,omitempty"`
  6438. // Region: [Output Only] URL of the region where the regional forwarding
  6439. // rule resides. This field is not applicable to global forwarding
  6440. // rules. You must specify this field as part of the HTTP request URL.
  6441. // It is not settable as a field in the request body.
  6442. Region string `json:"region,omitempty"`
  6443. // SelfLink: [Output Only] Server-defined URL for the resource.
  6444. SelfLink string `json:"selfLink,omitempty"`
  6445. // ServiceLabel: An optional prefix to the service name for this
  6446. // Forwarding Rule. If specified, will be the first label of the fully
  6447. // qualified service name.
  6448. //
  6449. // The label must be 1-63 characters long, and comply with RFC1035.
  6450. // Specifically, the label must be 1-63 characters long and match the
  6451. // regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first
  6452. // character must be a lowercase letter, and all following characters
  6453. // must be a dash, lowercase letter, or digit, except the last
  6454. // character, which cannot be a dash.
  6455. //
  6456. // This field is only used for internal load balancing.
  6457. ServiceLabel string `json:"serviceLabel,omitempty"`
  6458. // ServiceName: [Output Only] The internal fully qualified service name
  6459. // for this Forwarding Rule.
  6460. //
  6461. // This field is only used for internal load balancing.
  6462. ServiceName string `json:"serviceName,omitempty"`
  6463. // Subnetwork: This field is not used for external load balancing.
  6464. //
  6465. // For internal load balancing, this field identifies the subnetwork
  6466. // that the load balanced IP should belong to for this Forwarding
  6467. // Rule.
  6468. //
  6469. // If the network specified is in auto subnet mode, this field is
  6470. // optional. However, if the network is in custom subnet mode, a
  6471. // subnetwork must be specified.
  6472. Subnetwork string `json:"subnetwork,omitempty"`
  6473. // Target: The URL of the target resource to receive the matched
  6474. // traffic. For regional forwarding rules, this target must live in the
  6475. // same region as the forwarding rule. For global forwarding rules, this
  6476. // target must be a global load balancing resource. The forwarded
  6477. // traffic must be of a type appropriate to the target object.
  6478. Target string `json:"target,omitempty"`
  6479. // ServerResponse contains the HTTP response code and headers from the
  6480. // server.
  6481. googleapi.ServerResponse `json:"-"`
  6482. // ForceSendFields is a list of field names (e.g. "IPAddress") to
  6483. // unconditionally include in API requests. By default, fields with
  6484. // empty values are omitted from API requests. However, any non-pointer,
  6485. // non-interface field appearing in ForceSendFields will be sent to the
  6486. // server regardless of whether the field is empty or not. This may be
  6487. // used to include empty fields in Patch requests.
  6488. ForceSendFields []string `json:"-"`
  6489. // NullFields is a list of field names (e.g. "IPAddress") to include in
  6490. // API requests with the JSON null value. By default, fields with empty
  6491. // values are omitted from API requests. However, any field with an
  6492. // empty value appearing in NullFields will be sent to the server as
  6493. // null. It is an error if a field in this list has a non-empty value.
  6494. // This may be used to include null fields in Patch requests.
  6495. NullFields []string `json:"-"`
  6496. }
  6497. func (s *ForwardingRule) MarshalJSON() ([]byte, error) {
  6498. type NoMethod ForwardingRule
  6499. raw := NoMethod(*s)
  6500. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6501. }
  6502. type ForwardingRuleAggregatedList struct {
  6503. // Id: [Output Only] Unique identifier for the resource; defined by the
  6504. // server.
  6505. Id string `json:"id,omitempty"`
  6506. // Items: A list of ForwardingRulesScopedList resources.
  6507. Items map[string]ForwardingRulesScopedList `json:"items,omitempty"`
  6508. // Kind: [Output Only] Type of resource. Always
  6509. // compute#forwardingRuleAggregatedList for lists of forwarding rules.
  6510. Kind string `json:"kind,omitempty"`
  6511. // NextPageToken: [Output Only] This token allows you to get the next
  6512. // page of results for list requests. If the number of results is larger
  6513. // than maxResults, use the nextPageToken as a value for the query
  6514. // parameter pageToken in the next list request. Subsequent list
  6515. // requests will have their own nextPageToken to continue paging through
  6516. // the results.
  6517. NextPageToken string `json:"nextPageToken,omitempty"`
  6518. // SelfLink: [Output Only] Server-defined URL for this resource.
  6519. SelfLink string `json:"selfLink,omitempty"`
  6520. // Warning: [Output Only] Informational warning message.
  6521. Warning *ForwardingRuleAggregatedListWarning `json:"warning,omitempty"`
  6522. // ServerResponse contains the HTTP response code and headers from the
  6523. // server.
  6524. googleapi.ServerResponse `json:"-"`
  6525. // ForceSendFields is a list of field names (e.g. "Id") to
  6526. // unconditionally include in API requests. By default, fields with
  6527. // empty values are omitted from API requests. However, any non-pointer,
  6528. // non-interface field appearing in ForceSendFields will be sent to the
  6529. // server regardless of whether the field is empty or not. This may be
  6530. // used to include empty fields in Patch requests.
  6531. ForceSendFields []string `json:"-"`
  6532. // NullFields is a list of field names (e.g. "Id") to include in API
  6533. // requests with the JSON null value. By default, fields with empty
  6534. // values are omitted from API requests. However, any field with an
  6535. // empty value appearing in NullFields will be sent to the server as
  6536. // null. It is an error if a field in this list has a non-empty value.
  6537. // This may be used to include null fields in Patch requests.
  6538. NullFields []string `json:"-"`
  6539. }
  6540. func (s *ForwardingRuleAggregatedList) MarshalJSON() ([]byte, error) {
  6541. type NoMethod ForwardingRuleAggregatedList
  6542. raw := NoMethod(*s)
  6543. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6544. }
  6545. // ForwardingRuleAggregatedListWarning: [Output Only] Informational
  6546. // warning message.
  6547. type ForwardingRuleAggregatedListWarning struct {
  6548. // Code: [Output Only] A warning code, if applicable. For example,
  6549. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  6550. // the response.
  6551. //
  6552. // Possible values:
  6553. // "CLEANUP_FAILED"
  6554. // "DEPRECATED_RESOURCE_USED"
  6555. // "DEPRECATED_TYPE_USED"
  6556. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  6557. // "EXPERIMENTAL_TYPE_USED"
  6558. // "EXTERNAL_API_WARNING"
  6559. // "FIELD_VALUE_OVERRIDEN"
  6560. // "INJECTED_KERNELS_DEPRECATED"
  6561. // "MISSING_TYPE_DEPENDENCY"
  6562. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  6563. // "NEXT_HOP_CANNOT_IP_FORWARD"
  6564. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  6565. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  6566. // "NEXT_HOP_NOT_RUNNING"
  6567. // "NOT_CRITICAL_ERROR"
  6568. // "NO_RESULTS_ON_PAGE"
  6569. // "REQUIRED_TOS_AGREEMENT"
  6570. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  6571. // "RESOURCE_NOT_DELETED"
  6572. // "SCHEMA_VALIDATION_IGNORED"
  6573. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  6574. // "UNDECLARED_PROPERTIES"
  6575. // "UNREACHABLE"
  6576. Code string `json:"code,omitempty"`
  6577. // Data: [Output Only] Metadata about this warning in key: value format.
  6578. // For example:
  6579. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  6580. Data []*ForwardingRuleAggregatedListWarningData `json:"data,omitempty"`
  6581. // Message: [Output Only] A human-readable description of the warning
  6582. // code.
  6583. Message string `json:"message,omitempty"`
  6584. // ForceSendFields is a list of field names (e.g. "Code") to
  6585. // unconditionally include in API requests. By default, fields with
  6586. // empty values are omitted from API requests. However, any non-pointer,
  6587. // non-interface field appearing in ForceSendFields will be sent to the
  6588. // server regardless of whether the field is empty or not. This may be
  6589. // used to include empty fields in Patch requests.
  6590. ForceSendFields []string `json:"-"`
  6591. // NullFields is a list of field names (e.g. "Code") to include in API
  6592. // requests with the JSON null value. By default, fields with empty
  6593. // values are omitted from API requests. However, any field with an
  6594. // empty value appearing in NullFields will be sent to the server as
  6595. // null. It is an error if a field in this list has a non-empty value.
  6596. // This may be used to include null fields in Patch requests.
  6597. NullFields []string `json:"-"`
  6598. }
  6599. func (s *ForwardingRuleAggregatedListWarning) MarshalJSON() ([]byte, error) {
  6600. type NoMethod ForwardingRuleAggregatedListWarning
  6601. raw := NoMethod(*s)
  6602. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6603. }
  6604. type ForwardingRuleAggregatedListWarningData struct {
  6605. // Key: [Output Only] A key that provides more detail on the warning
  6606. // being returned. For example, for warnings where there are no results
  6607. // in a list request for a particular zone, this key might be scope and
  6608. // the key value might be the zone name. Other examples might be a key
  6609. // indicating a deprecated resource and a suggested replacement, or a
  6610. // warning about invalid network settings (for example, if an instance
  6611. // attempts to perform IP forwarding but is not enabled for IP
  6612. // forwarding).
  6613. Key string `json:"key,omitempty"`
  6614. // Value: [Output Only] A warning data value corresponding to the key.
  6615. Value string `json:"value,omitempty"`
  6616. // ForceSendFields is a list of field names (e.g. "Key") to
  6617. // unconditionally include in API requests. By default, fields with
  6618. // empty values are omitted from API requests. However, any non-pointer,
  6619. // non-interface field appearing in ForceSendFields will be sent to the
  6620. // server regardless of whether the field is empty or not. This may be
  6621. // used to include empty fields in Patch requests.
  6622. ForceSendFields []string `json:"-"`
  6623. // NullFields is a list of field names (e.g. "Key") to include in API
  6624. // requests with the JSON null value. By default, fields with empty
  6625. // values are omitted from API requests. However, any field with an
  6626. // empty value appearing in NullFields will be sent to the server as
  6627. // null. It is an error if a field in this list has a non-empty value.
  6628. // This may be used to include null fields in Patch requests.
  6629. NullFields []string `json:"-"`
  6630. }
  6631. func (s *ForwardingRuleAggregatedListWarningData) MarshalJSON() ([]byte, error) {
  6632. type NoMethod ForwardingRuleAggregatedListWarningData
  6633. raw := NoMethod(*s)
  6634. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6635. }
  6636. // ForwardingRuleList: Contains a list of ForwardingRule resources.
  6637. type ForwardingRuleList struct {
  6638. // Id: [Output Only] Unique identifier for the resource; defined by the
  6639. // server.
  6640. Id string `json:"id,omitempty"`
  6641. // Items: A list of ForwardingRule resources.
  6642. Items []*ForwardingRule `json:"items,omitempty"`
  6643. // Kind: Type of resource.
  6644. Kind string `json:"kind,omitempty"`
  6645. // NextPageToken: [Output Only] This token allows you to get the next
  6646. // page of results for list requests. If the number of results is larger
  6647. // than maxResults, use the nextPageToken as a value for the query
  6648. // parameter pageToken in the next list request. Subsequent list
  6649. // requests will have their own nextPageToken to continue paging through
  6650. // the results.
  6651. NextPageToken string `json:"nextPageToken,omitempty"`
  6652. // SelfLink: [Output Only] Server-defined URL for this resource.
  6653. SelfLink string `json:"selfLink,omitempty"`
  6654. // Warning: [Output Only] Informational warning message.
  6655. Warning *ForwardingRuleListWarning `json:"warning,omitempty"`
  6656. // ServerResponse contains the HTTP response code and headers from the
  6657. // server.
  6658. googleapi.ServerResponse `json:"-"`
  6659. // ForceSendFields is a list of field names (e.g. "Id") to
  6660. // unconditionally include in API requests. By default, fields with
  6661. // empty values are omitted from API requests. However, any non-pointer,
  6662. // non-interface field appearing in ForceSendFields will be sent to the
  6663. // server regardless of whether the field is empty or not. This may be
  6664. // used to include empty fields in Patch requests.
  6665. ForceSendFields []string `json:"-"`
  6666. // NullFields is a list of field names (e.g. "Id") to include in API
  6667. // requests with the JSON null value. By default, fields with empty
  6668. // values are omitted from API requests. However, any field with an
  6669. // empty value appearing in NullFields will be sent to the server as
  6670. // null. It is an error if a field in this list has a non-empty value.
  6671. // This may be used to include null fields in Patch requests.
  6672. NullFields []string `json:"-"`
  6673. }
  6674. func (s *ForwardingRuleList) MarshalJSON() ([]byte, error) {
  6675. type NoMethod ForwardingRuleList
  6676. raw := NoMethod(*s)
  6677. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6678. }
  6679. // ForwardingRuleListWarning: [Output Only] Informational warning
  6680. // message.
  6681. type ForwardingRuleListWarning struct {
  6682. // Code: [Output Only] A warning code, if applicable. For example,
  6683. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  6684. // the response.
  6685. //
  6686. // Possible values:
  6687. // "CLEANUP_FAILED"
  6688. // "DEPRECATED_RESOURCE_USED"
  6689. // "DEPRECATED_TYPE_USED"
  6690. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  6691. // "EXPERIMENTAL_TYPE_USED"
  6692. // "EXTERNAL_API_WARNING"
  6693. // "FIELD_VALUE_OVERRIDEN"
  6694. // "INJECTED_KERNELS_DEPRECATED"
  6695. // "MISSING_TYPE_DEPENDENCY"
  6696. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  6697. // "NEXT_HOP_CANNOT_IP_FORWARD"
  6698. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  6699. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  6700. // "NEXT_HOP_NOT_RUNNING"
  6701. // "NOT_CRITICAL_ERROR"
  6702. // "NO_RESULTS_ON_PAGE"
  6703. // "REQUIRED_TOS_AGREEMENT"
  6704. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  6705. // "RESOURCE_NOT_DELETED"
  6706. // "SCHEMA_VALIDATION_IGNORED"
  6707. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  6708. // "UNDECLARED_PROPERTIES"
  6709. // "UNREACHABLE"
  6710. Code string `json:"code,omitempty"`
  6711. // Data: [Output Only] Metadata about this warning in key: value format.
  6712. // For example:
  6713. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  6714. Data []*ForwardingRuleListWarningData `json:"data,omitempty"`
  6715. // Message: [Output Only] A human-readable description of the warning
  6716. // code.
  6717. Message string `json:"message,omitempty"`
  6718. // ForceSendFields is a list of field names (e.g. "Code") to
  6719. // unconditionally include in API requests. By default, fields with
  6720. // empty values are omitted from API requests. However, any non-pointer,
  6721. // non-interface field appearing in ForceSendFields will be sent to the
  6722. // server regardless of whether the field is empty or not. This may be
  6723. // used to include empty fields in Patch requests.
  6724. ForceSendFields []string `json:"-"`
  6725. // NullFields is a list of field names (e.g. "Code") to include in API
  6726. // requests with the JSON null value. By default, fields with empty
  6727. // values are omitted from API requests. However, any field with an
  6728. // empty value appearing in NullFields will be sent to the server as
  6729. // null. It is an error if a field in this list has a non-empty value.
  6730. // This may be used to include null fields in Patch requests.
  6731. NullFields []string `json:"-"`
  6732. }
  6733. func (s *ForwardingRuleListWarning) MarshalJSON() ([]byte, error) {
  6734. type NoMethod ForwardingRuleListWarning
  6735. raw := NoMethod(*s)
  6736. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6737. }
  6738. type ForwardingRuleListWarningData struct {
  6739. // Key: [Output Only] A key that provides more detail on the warning
  6740. // being returned. For example, for warnings where there are no results
  6741. // in a list request for a particular zone, this key might be scope and
  6742. // the key value might be the zone name. Other examples might be a key
  6743. // indicating a deprecated resource and a suggested replacement, or a
  6744. // warning about invalid network settings (for example, if an instance
  6745. // attempts to perform IP forwarding but is not enabled for IP
  6746. // forwarding).
  6747. Key string `json:"key,omitempty"`
  6748. // Value: [Output Only] A warning data value corresponding to the key.
  6749. Value string `json:"value,omitempty"`
  6750. // ForceSendFields is a list of field names (e.g. "Key") to
  6751. // unconditionally include in API requests. By default, fields with
  6752. // empty values are omitted from API requests. However, any non-pointer,
  6753. // non-interface field appearing in ForceSendFields will be sent to the
  6754. // server regardless of whether the field is empty or not. This may be
  6755. // used to include empty fields in Patch requests.
  6756. ForceSendFields []string `json:"-"`
  6757. // NullFields is a list of field names (e.g. "Key") to include in API
  6758. // requests with the JSON null value. By default, fields with empty
  6759. // values are omitted from API requests. However, any field with an
  6760. // empty value appearing in NullFields will be sent to the server as
  6761. // null. It is an error if a field in this list has a non-empty value.
  6762. // This may be used to include null fields in Patch requests.
  6763. NullFields []string `json:"-"`
  6764. }
  6765. func (s *ForwardingRuleListWarningData) MarshalJSON() ([]byte, error) {
  6766. type NoMethod ForwardingRuleListWarningData
  6767. raw := NoMethod(*s)
  6768. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6769. }
  6770. type ForwardingRuleReference struct {
  6771. ForwardingRule string `json:"forwardingRule,omitempty"`
  6772. // ForceSendFields is a list of field names (e.g. "ForwardingRule") to
  6773. // unconditionally include in API requests. By default, fields with
  6774. // empty values are omitted from API requests. However, any non-pointer,
  6775. // non-interface field appearing in ForceSendFields will be sent to the
  6776. // server regardless of whether the field is empty or not. This may be
  6777. // used to include empty fields in Patch requests.
  6778. ForceSendFields []string `json:"-"`
  6779. // NullFields is a list of field names (e.g. "ForwardingRule") to
  6780. // include in API requests with the JSON null value. By default, fields
  6781. // with empty values are omitted from API requests. However, any field
  6782. // with an empty value appearing in NullFields will be sent to the
  6783. // server as null. It is an error if a field in this list has a
  6784. // non-empty value. This may be used to include null fields in Patch
  6785. // requests.
  6786. NullFields []string `json:"-"`
  6787. }
  6788. func (s *ForwardingRuleReference) MarshalJSON() ([]byte, error) {
  6789. type NoMethod ForwardingRuleReference
  6790. raw := NoMethod(*s)
  6791. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6792. }
  6793. type ForwardingRulesScopedList struct {
  6794. // ForwardingRules: A list of forwarding rules contained in this scope.
  6795. ForwardingRules []*ForwardingRule `json:"forwardingRules,omitempty"`
  6796. // Warning: Informational warning which replaces the list of forwarding
  6797. // rules when the list is empty.
  6798. Warning *ForwardingRulesScopedListWarning `json:"warning,omitempty"`
  6799. // ForceSendFields is a list of field names (e.g. "ForwardingRules") to
  6800. // unconditionally include in API requests. By default, fields with
  6801. // empty values are omitted from API requests. However, any non-pointer,
  6802. // non-interface field appearing in ForceSendFields will be sent to the
  6803. // server regardless of whether the field is empty or not. This may be
  6804. // used to include empty fields in Patch requests.
  6805. ForceSendFields []string `json:"-"`
  6806. // NullFields is a list of field names (e.g. "ForwardingRules") to
  6807. // include in API requests with the JSON null value. By default, fields
  6808. // with empty values are omitted from API requests. However, any field
  6809. // with an empty value appearing in NullFields will be sent to the
  6810. // server as null. It is an error if a field in this list has a
  6811. // non-empty value. This may be used to include null fields in Patch
  6812. // requests.
  6813. NullFields []string `json:"-"`
  6814. }
  6815. func (s *ForwardingRulesScopedList) MarshalJSON() ([]byte, error) {
  6816. type NoMethod ForwardingRulesScopedList
  6817. raw := NoMethod(*s)
  6818. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6819. }
  6820. // ForwardingRulesScopedListWarning: Informational warning which
  6821. // replaces the list of forwarding rules when the list is empty.
  6822. type ForwardingRulesScopedListWarning struct {
  6823. // Code: [Output Only] A warning code, if applicable. For example,
  6824. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  6825. // the response.
  6826. //
  6827. // Possible values:
  6828. // "CLEANUP_FAILED"
  6829. // "DEPRECATED_RESOURCE_USED"
  6830. // "DEPRECATED_TYPE_USED"
  6831. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  6832. // "EXPERIMENTAL_TYPE_USED"
  6833. // "EXTERNAL_API_WARNING"
  6834. // "FIELD_VALUE_OVERRIDEN"
  6835. // "INJECTED_KERNELS_DEPRECATED"
  6836. // "MISSING_TYPE_DEPENDENCY"
  6837. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  6838. // "NEXT_HOP_CANNOT_IP_FORWARD"
  6839. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  6840. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  6841. // "NEXT_HOP_NOT_RUNNING"
  6842. // "NOT_CRITICAL_ERROR"
  6843. // "NO_RESULTS_ON_PAGE"
  6844. // "REQUIRED_TOS_AGREEMENT"
  6845. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  6846. // "RESOURCE_NOT_DELETED"
  6847. // "SCHEMA_VALIDATION_IGNORED"
  6848. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  6849. // "UNDECLARED_PROPERTIES"
  6850. // "UNREACHABLE"
  6851. Code string `json:"code,omitempty"`
  6852. // Data: [Output Only] Metadata about this warning in key: value format.
  6853. // For example:
  6854. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  6855. Data []*ForwardingRulesScopedListWarningData `json:"data,omitempty"`
  6856. // Message: [Output Only] A human-readable description of the warning
  6857. // code.
  6858. Message string `json:"message,omitempty"`
  6859. // ForceSendFields is a list of field names (e.g. "Code") to
  6860. // unconditionally include in API requests. By default, fields with
  6861. // empty values are omitted from API requests. However, any non-pointer,
  6862. // non-interface field appearing in ForceSendFields will be sent to the
  6863. // server regardless of whether the field is empty or not. This may be
  6864. // used to include empty fields in Patch requests.
  6865. ForceSendFields []string `json:"-"`
  6866. // NullFields is a list of field names (e.g. "Code") to include in API
  6867. // requests with the JSON null value. By default, fields with empty
  6868. // values are omitted from API requests. However, any field with an
  6869. // empty value appearing in NullFields will be sent to the server as
  6870. // null. It is an error if a field in this list has a non-empty value.
  6871. // This may be used to include null fields in Patch requests.
  6872. NullFields []string `json:"-"`
  6873. }
  6874. func (s *ForwardingRulesScopedListWarning) MarshalJSON() ([]byte, error) {
  6875. type NoMethod ForwardingRulesScopedListWarning
  6876. raw := NoMethod(*s)
  6877. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6878. }
  6879. type ForwardingRulesScopedListWarningData struct {
  6880. // Key: [Output Only] A key that provides more detail on the warning
  6881. // being returned. For example, for warnings where there are no results
  6882. // in a list request for a particular zone, this key might be scope and
  6883. // the key value might be the zone name. Other examples might be a key
  6884. // indicating a deprecated resource and a suggested replacement, or a
  6885. // warning about invalid network settings (for example, if an instance
  6886. // attempts to perform IP forwarding but is not enabled for IP
  6887. // forwarding).
  6888. Key string `json:"key,omitempty"`
  6889. // Value: [Output Only] A warning data value corresponding to the key.
  6890. Value string `json:"value,omitempty"`
  6891. // ForceSendFields is a list of field names (e.g. "Key") to
  6892. // unconditionally include in API requests. By default, fields with
  6893. // empty values are omitted from API requests. However, any non-pointer,
  6894. // non-interface field appearing in ForceSendFields will be sent to the
  6895. // server regardless of whether the field is empty or not. This may be
  6896. // used to include empty fields in Patch requests.
  6897. ForceSendFields []string `json:"-"`
  6898. // NullFields is a list of field names (e.g. "Key") to include in API
  6899. // requests with the JSON null value. By default, fields with empty
  6900. // values are omitted from API requests. However, any field with an
  6901. // empty value appearing in NullFields will be sent to the server as
  6902. // null. It is an error if a field in this list has a non-empty value.
  6903. // This may be used to include null fields in Patch requests.
  6904. NullFields []string `json:"-"`
  6905. }
  6906. func (s *ForwardingRulesScopedListWarningData) MarshalJSON() ([]byte, error) {
  6907. type NoMethod ForwardingRulesScopedListWarningData
  6908. raw := NoMethod(*s)
  6909. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6910. }
  6911. type GlobalSetLabelsRequest struct {
  6912. // LabelFingerprint: The fingerprint of the previous set of labels for
  6913. // this resource, used to detect conflicts. The fingerprint is initially
  6914. // generated by Compute Engine and changes after every request to modify
  6915. // or update labels. You must always provide an up-to-date fingerprint
  6916. // hash when updating or changing labels. Make a get() request to the
  6917. // resource to get the latest fingerprint.
  6918. LabelFingerprint string `json:"labelFingerprint,omitempty"`
  6919. // Labels: A list of labels to apply for this resource. Each label key &
  6920. // value must comply with RFC1035. Specifically, the name must be 1-63
  6921. // characters long and match the regular expression
  6922. // `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be
  6923. // a lowercase letter, and all following characters must be a dash,
  6924. // lowercase letter, or digit, except the last character, which cannot
  6925. // be a dash. For example, "webserver-frontend": "images". A label value
  6926. // can also be empty (e.g. "my-label": "").
  6927. Labels map[string]string `json:"labels,omitempty"`
  6928. // ForceSendFields is a list of field names (e.g. "LabelFingerprint") to
  6929. // unconditionally include in API requests. By default, fields with
  6930. // empty values are omitted from API requests. However, any non-pointer,
  6931. // non-interface field appearing in ForceSendFields will be sent to the
  6932. // server regardless of whether the field is empty or not. This may be
  6933. // used to include empty fields in Patch requests.
  6934. ForceSendFields []string `json:"-"`
  6935. // NullFields is a list of field names (e.g. "LabelFingerprint") to
  6936. // include in API requests with the JSON null value. By default, fields
  6937. // with empty values are omitted from API requests. However, any field
  6938. // with an empty value appearing in NullFields will be sent to the
  6939. // server as null. It is an error if a field in this list has a
  6940. // non-empty value. This may be used to include null fields in Patch
  6941. // requests.
  6942. NullFields []string `json:"-"`
  6943. }
  6944. func (s *GlobalSetLabelsRequest) MarshalJSON() ([]byte, error) {
  6945. type NoMethod GlobalSetLabelsRequest
  6946. raw := NoMethod(*s)
  6947. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6948. }
  6949. // GuestOsFeature: Guest OS features.
  6950. type GuestOsFeature struct {
  6951. // Type: The ID of a supported feature. Read Enabling guest operating
  6952. // system features to see a list of available options.
  6953. //
  6954. // Possible values:
  6955. // "FEATURE_TYPE_UNSPECIFIED"
  6956. // "MULTI_IP_SUBNET"
  6957. // "SECURE_BOOT"
  6958. // "UEFI_COMPATIBLE"
  6959. // "VIRTIO_SCSI_MULTIQUEUE"
  6960. // "WINDOWS"
  6961. Type string `json:"type,omitempty"`
  6962. // ForceSendFields is a list of field names (e.g. "Type") to
  6963. // unconditionally include in API requests. By default, fields with
  6964. // empty values are omitted from API requests. However, any non-pointer,
  6965. // non-interface field appearing in ForceSendFields will be sent to the
  6966. // server regardless of whether the field is empty or not. This may be
  6967. // used to include empty fields in Patch requests.
  6968. ForceSendFields []string `json:"-"`
  6969. // NullFields is a list of field names (e.g. "Type") to include in API
  6970. // requests with the JSON null value. By default, fields with empty
  6971. // values are omitted from API requests. However, any field with an
  6972. // empty value appearing in NullFields will be sent to the server as
  6973. // null. It is an error if a field in this list has a non-empty value.
  6974. // This may be used to include null fields in Patch requests.
  6975. NullFields []string `json:"-"`
  6976. }
  6977. func (s *GuestOsFeature) MarshalJSON() ([]byte, error) {
  6978. type NoMethod GuestOsFeature
  6979. raw := NoMethod(*s)
  6980. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6981. }
  6982. type HTTP2HealthCheck struct {
  6983. // Host: The value of the host header in the HTTP/2 health check
  6984. // request. If left empty (default value), the IP on behalf of which
  6985. // this health check is performed will be used.
  6986. Host string `json:"host,omitempty"`
  6987. // Port: The TCP port number for the health check request. The default
  6988. // value is 443. Valid values are 1 through 65535.
  6989. Port int64 `json:"port,omitempty"`
  6990. // PortName: Port name as defined in InstanceGroup#NamedPort#name. If
  6991. // both port and port_name are defined, port takes precedence.
  6992. PortName string `json:"portName,omitempty"`
  6993. // PortSpecification: Specifies how port is selected for health
  6994. // checking, can be one of following values:
  6995. // USE_FIXED_PORT: The port number in
  6996. // port
  6997. // is used for health checking.
  6998. // USE_NAMED_PORT: The
  6999. // portName
  7000. // is used for health checking.
  7001. // USE_SERVING_PORT: For NetworkEndpointGroup, the port specified for
  7002. // each network endpoint is used for health checking. For other
  7003. // backends, the port or named port specified in the Backend Service is
  7004. // used for health checking.
  7005. //
  7006. //
  7007. // If not specified, HTTP2 health check follows behavior specified
  7008. // in
  7009. // port
  7010. // and
  7011. // portName
  7012. // fields.
  7013. //
  7014. // Possible values:
  7015. // "USE_FIXED_PORT"
  7016. // "USE_NAMED_PORT"
  7017. // "USE_SERVING_PORT"
  7018. PortSpecification string `json:"portSpecification,omitempty"`
  7019. // ProxyHeader: Specifies the type of proxy header to append before
  7020. // sending data to the backend, either NONE or PROXY_V1. The default is
  7021. // NONE.
  7022. //
  7023. // Possible values:
  7024. // "NONE"
  7025. // "PROXY_V1"
  7026. ProxyHeader string `json:"proxyHeader,omitempty"`
  7027. // RequestPath: The request path of the HTTP/2 health check request. The
  7028. // default value is /.
  7029. RequestPath string `json:"requestPath,omitempty"`
  7030. // Response: The string to match anywhere in the first 1024 bytes of the
  7031. // response body. If left empty (the default value), the status code
  7032. // determines health. The response data can only be ASCII.
  7033. Response string `json:"response,omitempty"`
  7034. // ForceSendFields is a list of field names (e.g. "Host") to
  7035. // unconditionally include in API requests. By default, fields with
  7036. // empty values are omitted from API requests. However, any non-pointer,
  7037. // non-interface field appearing in ForceSendFields will be sent to the
  7038. // server regardless of whether the field is empty or not. This may be
  7039. // used to include empty fields in Patch requests.
  7040. ForceSendFields []string `json:"-"`
  7041. // NullFields is a list of field names (e.g. "Host") to include in API
  7042. // requests with the JSON null value. By default, fields with empty
  7043. // values are omitted from API requests. However, any field with an
  7044. // empty value appearing in NullFields will be sent to the server as
  7045. // null. It is an error if a field in this list has a non-empty value.
  7046. // This may be used to include null fields in Patch requests.
  7047. NullFields []string `json:"-"`
  7048. }
  7049. func (s *HTTP2HealthCheck) MarshalJSON() ([]byte, error) {
  7050. type NoMethod HTTP2HealthCheck
  7051. raw := NoMethod(*s)
  7052. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7053. }
  7054. type HTTPHealthCheck struct {
  7055. // Host: The value of the host header in the HTTP health check request.
  7056. // If left empty (default value), the IP on behalf of which this health
  7057. // check is performed will be used.
  7058. Host string `json:"host,omitempty"`
  7059. // Port: The TCP port number for the health check request. The default
  7060. // value is 80. Valid values are 1 through 65535.
  7061. Port int64 `json:"port,omitempty"`
  7062. // PortName: Port name as defined in InstanceGroup#NamedPort#name. If
  7063. // both port and port_name are defined, port takes precedence.
  7064. PortName string `json:"portName,omitempty"`
  7065. // PortSpecification: Specifies how port is selected for health
  7066. // checking, can be one of following values:
  7067. // USE_FIXED_PORT: The port number in
  7068. // port
  7069. // is used for health checking.
  7070. // USE_NAMED_PORT: The
  7071. // portName
  7072. // is used for health checking.
  7073. // USE_SERVING_PORT: For NetworkEndpointGroup, the port specified for
  7074. // each network endpoint is used for health checking. For other
  7075. // backends, the port or named port specified in the Backend Service is
  7076. // used for health checking.
  7077. //
  7078. //
  7079. // If not specified, HTTP health check follows behavior specified
  7080. // in
  7081. // port
  7082. // and
  7083. // portName
  7084. // fields.
  7085. //
  7086. // Possible values:
  7087. // "USE_FIXED_PORT"
  7088. // "USE_NAMED_PORT"
  7089. // "USE_SERVING_PORT"
  7090. PortSpecification string `json:"portSpecification,omitempty"`
  7091. // ProxyHeader: Specifies the type of proxy header to append before
  7092. // sending data to the backend, either NONE or PROXY_V1. The default is
  7093. // NONE.
  7094. //
  7095. // Possible values:
  7096. // "NONE"
  7097. // "PROXY_V1"
  7098. ProxyHeader string `json:"proxyHeader,omitempty"`
  7099. // RequestPath: The request path of the HTTP health check request. The
  7100. // default value is /.
  7101. RequestPath string `json:"requestPath,omitempty"`
  7102. // Response: The string to match anywhere in the first 1024 bytes of the
  7103. // response body. If left empty (the default value), the status code
  7104. // determines health. The response data can only be ASCII.
  7105. Response string `json:"response,omitempty"`
  7106. // ForceSendFields is a list of field names (e.g. "Host") to
  7107. // unconditionally include in API requests. By default, fields with
  7108. // empty values are omitted from API requests. However, any non-pointer,
  7109. // non-interface field appearing in ForceSendFields will be sent to the
  7110. // server regardless of whether the field is empty or not. This may be
  7111. // used to include empty fields in Patch requests.
  7112. ForceSendFields []string `json:"-"`
  7113. // NullFields is a list of field names (e.g. "Host") to include in API
  7114. // requests with the JSON null value. By default, fields with empty
  7115. // values are omitted from API requests. However, any field with an
  7116. // empty value appearing in NullFields will be sent to the server as
  7117. // null. It is an error if a field in this list has a non-empty value.
  7118. // This may be used to include null fields in Patch requests.
  7119. NullFields []string `json:"-"`
  7120. }
  7121. func (s *HTTPHealthCheck) MarshalJSON() ([]byte, error) {
  7122. type NoMethod HTTPHealthCheck
  7123. raw := NoMethod(*s)
  7124. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7125. }
  7126. type HTTPSHealthCheck struct {
  7127. // Host: The value of the host header in the HTTPS health check request.
  7128. // If left empty (default value), the IP on behalf of which this health
  7129. // check is performed will be used.
  7130. Host string `json:"host,omitempty"`
  7131. // Port: The TCP port number for the health check request. The default
  7132. // value is 443. Valid values are 1 through 65535.
  7133. Port int64 `json:"port,omitempty"`
  7134. // PortName: Port name as defined in InstanceGroup#NamedPort#name. If
  7135. // both port and port_name are defined, port takes precedence.
  7136. PortName string `json:"portName,omitempty"`
  7137. // PortSpecification: Specifies how port is selected for health
  7138. // checking, can be one of following values:
  7139. // USE_FIXED_PORT: The port number in
  7140. // port
  7141. // is used for health checking.
  7142. // USE_NAMED_PORT: The
  7143. // portName
  7144. // is used for health checking.
  7145. // USE_SERVING_PORT: For NetworkEndpointGroup, the port specified for
  7146. // each network endpoint is used for health checking. For other
  7147. // backends, the port or named port specified in the Backend Service is
  7148. // used for health checking.
  7149. //
  7150. //
  7151. // If not specified, HTTPS health check follows behavior specified
  7152. // in
  7153. // port
  7154. // and
  7155. // portName
  7156. // fields.
  7157. //
  7158. // Possible values:
  7159. // "USE_FIXED_PORT"
  7160. // "USE_NAMED_PORT"
  7161. // "USE_SERVING_PORT"
  7162. PortSpecification string `json:"portSpecification,omitempty"`
  7163. // ProxyHeader: Specifies the type of proxy header to append before
  7164. // sending data to the backend, either NONE or PROXY_V1. The default is
  7165. // NONE.
  7166. //
  7167. // Possible values:
  7168. // "NONE"
  7169. // "PROXY_V1"
  7170. ProxyHeader string `json:"proxyHeader,omitempty"`
  7171. // RequestPath: The request path of the HTTPS health check request. The
  7172. // default value is /.
  7173. RequestPath string `json:"requestPath,omitempty"`
  7174. // Response: The string to match anywhere in the first 1024 bytes of the
  7175. // response body. If left empty (the default value), the status code
  7176. // determines health. The response data can only be ASCII.
  7177. Response string `json:"response,omitempty"`
  7178. // ForceSendFields is a list of field names (e.g. "Host") to
  7179. // unconditionally include in API requests. By default, fields with
  7180. // empty values are omitted from API requests. However, any non-pointer,
  7181. // non-interface field appearing in ForceSendFields will be sent to the
  7182. // server regardless of whether the field is empty or not. This may be
  7183. // used to include empty fields in Patch requests.
  7184. ForceSendFields []string `json:"-"`
  7185. // NullFields is a list of field names (e.g. "Host") to include in API
  7186. // requests with the JSON null value. By default, fields with empty
  7187. // values are omitted from API requests. However, any field with an
  7188. // empty value appearing in NullFields will be sent to the server as
  7189. // null. It is an error if a field in this list has a non-empty value.
  7190. // This may be used to include null fields in Patch requests.
  7191. NullFields []string `json:"-"`
  7192. }
  7193. func (s *HTTPSHealthCheck) MarshalJSON() ([]byte, error) {
  7194. type NoMethod HTTPSHealthCheck
  7195. raw := NoMethod(*s)
  7196. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7197. }
  7198. // HealthCheck: An HealthCheck resource. This resource defines a
  7199. // template for how individual virtual machines should be checked for
  7200. // health, via one of the supported protocols.
  7201. type HealthCheck struct {
  7202. // CheckIntervalSec: How often (in seconds) to send a health check. The
  7203. // default value is 5 seconds.
  7204. CheckIntervalSec int64 `json:"checkIntervalSec,omitempty"`
  7205. // CreationTimestamp: [Output Only] Creation timestamp in 3339 text
  7206. // format.
  7207. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  7208. // Description: An optional description of this resource. Provide this
  7209. // property when you create the resource.
  7210. Description string `json:"description,omitempty"`
  7211. // HealthyThreshold: A so-far unhealthy instance will be marked healthy
  7212. // after this many consecutive successes. The default value is 2.
  7213. HealthyThreshold int64 `json:"healthyThreshold,omitempty"`
  7214. Http2HealthCheck *HTTP2HealthCheck `json:"http2HealthCheck,omitempty"`
  7215. HttpHealthCheck *HTTPHealthCheck `json:"httpHealthCheck,omitempty"`
  7216. HttpsHealthCheck *HTTPSHealthCheck `json:"httpsHealthCheck,omitempty"`
  7217. // Id: [Output Only] The unique identifier for the resource. This
  7218. // identifier is defined by the server.
  7219. Id uint64 `json:"id,omitempty,string"`
  7220. // Kind: Type of the resource.
  7221. Kind string `json:"kind,omitempty"`
  7222. // Name: Name of the resource. Provided by the client when the resource
  7223. // is created. The name must be 1-63 characters long, and comply with
  7224. // RFC1035. Specifically, the name must be 1-63 characters long and
  7225. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  7226. // the first character must be a lowercase letter, and all following
  7227. // characters must be a dash, lowercase letter, or digit, except the
  7228. // last character, which cannot be a dash.
  7229. Name string `json:"name,omitempty"`
  7230. // SelfLink: [Output Only] Server-defined URL for the resource.
  7231. SelfLink string `json:"selfLink,omitempty"`
  7232. SslHealthCheck *SSLHealthCheck `json:"sslHealthCheck,omitempty"`
  7233. TcpHealthCheck *TCPHealthCheck `json:"tcpHealthCheck,omitempty"`
  7234. // TimeoutSec: How long (in seconds) to wait before claiming failure.
  7235. // The default value is 5 seconds. It is invalid for timeoutSec to have
  7236. // greater value than checkIntervalSec.
  7237. TimeoutSec int64 `json:"timeoutSec,omitempty"`
  7238. // Type: Specifies the type of the healthCheck, either TCP, SSL, HTTP or
  7239. // HTTPS. If not specified, the default is TCP. Exactly one of the
  7240. // protocol-specific health check field must be specified, which must
  7241. // match type field.
  7242. //
  7243. // Possible values:
  7244. // "HTTP"
  7245. // "HTTP2"
  7246. // "HTTPS"
  7247. // "INVALID"
  7248. // "SSL"
  7249. // "TCP"
  7250. // "UDP"
  7251. Type string `json:"type,omitempty"`
  7252. UdpHealthCheck *UDPHealthCheck `json:"udpHealthCheck,omitempty"`
  7253. // UnhealthyThreshold: A so-far healthy instance will be marked
  7254. // unhealthy after this many consecutive failures. The default value is
  7255. // 2.
  7256. UnhealthyThreshold int64 `json:"unhealthyThreshold,omitempty"`
  7257. // ServerResponse contains the HTTP response code and headers from the
  7258. // server.
  7259. googleapi.ServerResponse `json:"-"`
  7260. // ForceSendFields is a list of field names (e.g. "CheckIntervalSec") 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. "CheckIntervalSec") 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 *HealthCheck) MarshalJSON() ([]byte, error) {
  7277. type NoMethod HealthCheck
  7278. raw := NoMethod(*s)
  7279. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7280. }
  7281. // HealthCheckList: Contains a list of HealthCheck resources.
  7282. type HealthCheckList struct {
  7283. // Id: [Output Only] Unique identifier for the resource; defined by the
  7284. // server.
  7285. Id string `json:"id,omitempty"`
  7286. // Items: A list of HealthCheck resources.
  7287. Items []*HealthCheck `json:"items,omitempty"`
  7288. // Kind: Type of resource.
  7289. Kind string `json:"kind,omitempty"`
  7290. // NextPageToken: [Output Only] This token allows you to get the next
  7291. // page of results for list requests. If the number of results is larger
  7292. // than maxResults, use the nextPageToken as a value for the query
  7293. // parameter pageToken in the next list request. Subsequent list
  7294. // requests will have their own nextPageToken to continue paging through
  7295. // the results.
  7296. NextPageToken string `json:"nextPageToken,omitempty"`
  7297. // SelfLink: [Output Only] Server-defined URL for this resource.
  7298. SelfLink string `json:"selfLink,omitempty"`
  7299. // Warning: [Output Only] Informational warning message.
  7300. Warning *HealthCheckListWarning `json:"warning,omitempty"`
  7301. // ServerResponse contains the HTTP response code and headers from the
  7302. // server.
  7303. googleapi.ServerResponse `json:"-"`
  7304. // ForceSendFields is a list of field names (e.g. "Id") to
  7305. // unconditionally include in API requests. By default, fields with
  7306. // empty values are omitted from API requests. However, any non-pointer,
  7307. // non-interface field appearing in ForceSendFields will be sent to the
  7308. // server regardless of whether the field is empty or not. This may be
  7309. // used to include empty fields in Patch requests.
  7310. ForceSendFields []string `json:"-"`
  7311. // NullFields is a list of field names (e.g. "Id") to include in API
  7312. // requests with the JSON null value. By default, fields with empty
  7313. // values are omitted from API requests. However, any field with an
  7314. // empty value appearing in NullFields will be sent to the server as
  7315. // null. It is an error if a field in this list has a non-empty value.
  7316. // This may be used to include null fields in Patch requests.
  7317. NullFields []string `json:"-"`
  7318. }
  7319. func (s *HealthCheckList) MarshalJSON() ([]byte, error) {
  7320. type NoMethod HealthCheckList
  7321. raw := NoMethod(*s)
  7322. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7323. }
  7324. // HealthCheckListWarning: [Output Only] Informational warning message.
  7325. type HealthCheckListWarning struct {
  7326. // Code: [Output Only] A warning code, if applicable. For example,
  7327. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  7328. // the response.
  7329. //
  7330. // Possible values:
  7331. // "CLEANUP_FAILED"
  7332. // "DEPRECATED_RESOURCE_USED"
  7333. // "DEPRECATED_TYPE_USED"
  7334. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  7335. // "EXPERIMENTAL_TYPE_USED"
  7336. // "EXTERNAL_API_WARNING"
  7337. // "FIELD_VALUE_OVERRIDEN"
  7338. // "INJECTED_KERNELS_DEPRECATED"
  7339. // "MISSING_TYPE_DEPENDENCY"
  7340. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  7341. // "NEXT_HOP_CANNOT_IP_FORWARD"
  7342. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  7343. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  7344. // "NEXT_HOP_NOT_RUNNING"
  7345. // "NOT_CRITICAL_ERROR"
  7346. // "NO_RESULTS_ON_PAGE"
  7347. // "REQUIRED_TOS_AGREEMENT"
  7348. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  7349. // "RESOURCE_NOT_DELETED"
  7350. // "SCHEMA_VALIDATION_IGNORED"
  7351. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  7352. // "UNDECLARED_PROPERTIES"
  7353. // "UNREACHABLE"
  7354. Code string `json:"code,omitempty"`
  7355. // Data: [Output Only] Metadata about this warning in key: value format.
  7356. // For example:
  7357. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  7358. Data []*HealthCheckListWarningData `json:"data,omitempty"`
  7359. // Message: [Output Only] A human-readable description of the warning
  7360. // code.
  7361. Message string `json:"message,omitempty"`
  7362. // ForceSendFields is a list of field names (e.g. "Code") to
  7363. // unconditionally include in API requests. By default, fields with
  7364. // empty values are omitted from API requests. However, any non-pointer,
  7365. // non-interface field appearing in ForceSendFields will be sent to the
  7366. // server regardless of whether the field is empty or not. This may be
  7367. // used to include empty fields in Patch requests.
  7368. ForceSendFields []string `json:"-"`
  7369. // NullFields is a list of field names (e.g. "Code") to include in API
  7370. // requests with the JSON null value. By default, fields with empty
  7371. // values are omitted from API requests. However, any field with an
  7372. // empty value appearing in NullFields will be sent to the server as
  7373. // null. It is an error if a field in this list has a non-empty value.
  7374. // This may be used to include null fields in Patch requests.
  7375. NullFields []string `json:"-"`
  7376. }
  7377. func (s *HealthCheckListWarning) MarshalJSON() ([]byte, error) {
  7378. type NoMethod HealthCheckListWarning
  7379. raw := NoMethod(*s)
  7380. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7381. }
  7382. type HealthCheckListWarningData struct {
  7383. // Key: [Output Only] A key that provides more detail on the warning
  7384. // being returned. For example, for warnings where there are no results
  7385. // in a list request for a particular zone, this key might be scope and
  7386. // the key value might be the zone name. Other examples might be a key
  7387. // indicating a deprecated resource and a suggested replacement, or a
  7388. // warning about invalid network settings (for example, if an instance
  7389. // attempts to perform IP forwarding but is not enabled for IP
  7390. // forwarding).
  7391. Key string `json:"key,omitempty"`
  7392. // Value: [Output Only] A warning data value corresponding to the key.
  7393. Value string `json:"value,omitempty"`
  7394. // ForceSendFields is a list of field names (e.g. "Key") to
  7395. // unconditionally include in API requests. By default, fields with
  7396. // empty values are omitted from API requests. However, any non-pointer,
  7397. // non-interface field appearing in ForceSendFields will be sent to the
  7398. // server regardless of whether the field is empty or not. This may be
  7399. // used to include empty fields in Patch requests.
  7400. ForceSendFields []string `json:"-"`
  7401. // NullFields is a list of field names (e.g. "Key") to include in API
  7402. // requests with the JSON null value. By default, fields with empty
  7403. // values are omitted from API requests. However, any field with an
  7404. // empty value appearing in NullFields will be sent to the server as
  7405. // null. It is an error if a field in this list has a non-empty value.
  7406. // This may be used to include null fields in Patch requests.
  7407. NullFields []string `json:"-"`
  7408. }
  7409. func (s *HealthCheckListWarningData) MarshalJSON() ([]byte, error) {
  7410. type NoMethod HealthCheckListWarningData
  7411. raw := NoMethod(*s)
  7412. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7413. }
  7414. // HealthCheckReference: A full or valid partial URL to a health check.
  7415. // For example, the following are valid URLs:
  7416. // -
  7417. // https://www.googleapis.com/compute/beta/projects/project-id/global/httpHealthChecks/health-check
  7418. // - projects/project-id/global/httpHealthChecks/health-check
  7419. // - global/httpHealthChecks/health-check
  7420. type HealthCheckReference struct {
  7421. HealthCheck string `json:"healthCheck,omitempty"`
  7422. // ForceSendFields is a list of field names (e.g. "HealthCheck") 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. "HealthCheck") to include
  7430. // in API requests with the JSON null value. By default, fields with
  7431. // empty values are omitted from API requests. However, any field with
  7432. // an 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 *HealthCheckReference) MarshalJSON() ([]byte, error) {
  7438. type NoMethod HealthCheckReference
  7439. raw := NoMethod(*s)
  7440. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7441. }
  7442. type HealthStatus struct {
  7443. // HealthState: Health state of the instance.
  7444. //
  7445. // Possible values:
  7446. // "HEALTHY"
  7447. // "UNHEALTHY"
  7448. HealthState string `json:"healthState,omitempty"`
  7449. // Instance: URL of the instance resource.
  7450. Instance string `json:"instance,omitempty"`
  7451. // IpAddress: The IP address represented by this resource.
  7452. IpAddress string `json:"ipAddress,omitempty"`
  7453. // Port: The port on the instance.
  7454. Port int64 `json:"port,omitempty"`
  7455. // ForceSendFields is a list of field names (e.g. "HealthState") to
  7456. // unconditionally include in API requests. By default, fields with
  7457. // empty values are omitted from API requests. However, any non-pointer,
  7458. // non-interface field appearing in ForceSendFields will be sent to the
  7459. // server regardless of whether the field is empty or not. This may be
  7460. // used to include empty fields in Patch requests.
  7461. ForceSendFields []string `json:"-"`
  7462. // NullFields is a list of field names (e.g. "HealthState") to include
  7463. // in API requests with the JSON null value. By default, fields with
  7464. // empty values are omitted from API requests. However, any field with
  7465. // an empty value appearing in NullFields will be sent to the server as
  7466. // null. It is an error if a field in this list has a non-empty value.
  7467. // This may be used to include null fields in Patch requests.
  7468. NullFields []string `json:"-"`
  7469. }
  7470. func (s *HealthStatus) MarshalJSON() ([]byte, error) {
  7471. type NoMethod HealthStatus
  7472. raw := NoMethod(*s)
  7473. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7474. }
  7475. type HealthStatusForNetworkEndpoint struct {
  7476. // BackendService: URL of the backend service associated with the health
  7477. // state of the network endpoint.
  7478. BackendService *BackendServiceReference `json:"backendService,omitempty"`
  7479. // ForwardingRule: URL of the forwarding rule associated with the health
  7480. // state of the network endpoint.
  7481. ForwardingRule *ForwardingRuleReference `json:"forwardingRule,omitempty"`
  7482. // HealthCheck: URL of the health check associated with the health state
  7483. // of the network endpoint.
  7484. HealthCheck *HealthCheckReference `json:"healthCheck,omitempty"`
  7485. // HealthState: Health state of the network endpoint determined based on
  7486. // the health checks configured.
  7487. //
  7488. // Possible values:
  7489. // "DRAINING"
  7490. // "HEALTHY"
  7491. // "UNHEALTHY"
  7492. // "UNKNOWN"
  7493. HealthState string `json:"healthState,omitempty"`
  7494. // ForceSendFields is a list of field names (e.g. "BackendService") to
  7495. // unconditionally include in API requests. By default, fields with
  7496. // empty values are omitted from API requests. However, any non-pointer,
  7497. // non-interface field appearing in ForceSendFields will be sent to the
  7498. // server regardless of whether the field is empty or not. This may be
  7499. // used to include empty fields in Patch requests.
  7500. ForceSendFields []string `json:"-"`
  7501. // NullFields is a list of field names (e.g. "BackendService") to
  7502. // include in API requests with the JSON null value. By default, fields
  7503. // with empty values are omitted from API requests. However, any field
  7504. // with an empty value appearing in NullFields will be sent to the
  7505. // server as null. It is an error if a field in this list has a
  7506. // non-empty value. This may be used to include null fields in Patch
  7507. // requests.
  7508. NullFields []string `json:"-"`
  7509. }
  7510. func (s *HealthStatusForNetworkEndpoint) MarshalJSON() ([]byte, error) {
  7511. type NoMethod HealthStatusForNetworkEndpoint
  7512. raw := NoMethod(*s)
  7513. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7514. }
  7515. // HostRule: UrlMaps A host-matching rule for a URL. If matched, will
  7516. // use the named PathMatcher to select the BackendService.
  7517. type HostRule struct {
  7518. // Description: An optional description of this resource. Provide this
  7519. // property when you create the resource.
  7520. Description string `json:"description,omitempty"`
  7521. // Hosts: The list of host patterns to match. They must be valid
  7522. // hostnames, except * will match any string of ([a-z0-9-.]*). In that
  7523. // case, * must be the first character and must be followed in the
  7524. // pattern by either - or ..
  7525. Hosts []string `json:"hosts,omitempty"`
  7526. // PathMatcher: The name of the PathMatcher to use to match the path
  7527. // portion of the URL if the hostRule matches the URL's host portion.
  7528. PathMatcher string `json:"pathMatcher,omitempty"`
  7529. // ForceSendFields is a list of field names (e.g. "Description") to
  7530. // unconditionally include in API requests. By default, fields with
  7531. // empty values are omitted from API requests. However, any non-pointer,
  7532. // non-interface field appearing in ForceSendFields will be sent to the
  7533. // server regardless of whether the field is empty or not. This may be
  7534. // used to include empty fields in Patch requests.
  7535. ForceSendFields []string `json:"-"`
  7536. // NullFields is a list of field names (e.g. "Description") to include
  7537. // in API requests with the JSON null value. By default, fields with
  7538. // empty values are omitted from API requests. However, any field with
  7539. // an empty value appearing in NullFields will be sent to the server as
  7540. // null. It is an error if a field in this list has a non-empty value.
  7541. // This may be used to include null fields in Patch requests.
  7542. NullFields []string `json:"-"`
  7543. }
  7544. func (s *HostRule) MarshalJSON() ([]byte, error) {
  7545. type NoMethod HostRule
  7546. raw := NoMethod(*s)
  7547. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7548. }
  7549. // HttpHealthCheck: An HttpHealthCheck resource. This resource defines a
  7550. // template for how individual instances should be checked for health,
  7551. // via HTTP.
  7552. type HttpHealthCheck struct {
  7553. // CheckIntervalSec: How often (in seconds) to send a health check. The
  7554. // default value is 5 seconds.
  7555. CheckIntervalSec int64 `json:"checkIntervalSec,omitempty"`
  7556. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  7557. // format.
  7558. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  7559. // Description: An optional description of this resource. Provide this
  7560. // property when you create the resource.
  7561. Description string `json:"description,omitempty"`
  7562. // HealthyThreshold: A so-far unhealthy instance will be marked healthy
  7563. // after this many consecutive successes. The default value is 2.
  7564. HealthyThreshold int64 `json:"healthyThreshold,omitempty"`
  7565. // Host: The value of the host header in the HTTP health check request.
  7566. // If left empty (default value), the public IP on behalf of which this
  7567. // health check is performed will be used.
  7568. Host string `json:"host,omitempty"`
  7569. // Id: [Output Only] The unique identifier for the resource. This
  7570. // identifier is defined by the server.
  7571. Id uint64 `json:"id,omitempty,string"`
  7572. // Kind: [Output Only] Type of the resource. Always
  7573. // compute#httpHealthCheck for HTTP health checks.
  7574. Kind string `json:"kind,omitempty"`
  7575. // Name: Name of the resource. Provided by the client when the resource
  7576. // is created. The name must be 1-63 characters long, and comply with
  7577. // RFC1035. Specifically, the name must be 1-63 characters long and
  7578. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  7579. // the first character must be a lowercase letter, and all following
  7580. // characters must be a dash, lowercase letter, or digit, except the
  7581. // last character, which cannot be a dash.
  7582. Name string `json:"name,omitempty"`
  7583. // Port: The TCP port number for the HTTP health check request. The
  7584. // default value is 80.
  7585. Port int64 `json:"port,omitempty"`
  7586. // RequestPath: The request path of the HTTP health check request. The
  7587. // default value is /.
  7588. RequestPath string `json:"requestPath,omitempty"`
  7589. // SelfLink: [Output Only] Server-defined URL for the resource.
  7590. SelfLink string `json:"selfLink,omitempty"`
  7591. // TimeoutSec: How long (in seconds) to wait before claiming failure.
  7592. // The default value is 5 seconds. It is invalid for timeoutSec to have
  7593. // greater value than checkIntervalSec.
  7594. TimeoutSec int64 `json:"timeoutSec,omitempty"`
  7595. // UnhealthyThreshold: A so-far healthy instance will be marked
  7596. // unhealthy after this many consecutive failures. The default value is
  7597. // 2.
  7598. UnhealthyThreshold int64 `json:"unhealthyThreshold,omitempty"`
  7599. // ServerResponse contains the HTTP response code and headers from the
  7600. // server.
  7601. googleapi.ServerResponse `json:"-"`
  7602. // ForceSendFields is a list of field names (e.g. "CheckIntervalSec") to
  7603. // unconditionally include in API requests. By default, fields with
  7604. // empty values are omitted from API requests. However, any non-pointer,
  7605. // non-interface field appearing in ForceSendFields will be sent to the
  7606. // server regardless of whether the field is empty or not. This may be
  7607. // used to include empty fields in Patch requests.
  7608. ForceSendFields []string `json:"-"`
  7609. // NullFields is a list of field names (e.g. "CheckIntervalSec") to
  7610. // include in API requests with the JSON null value. By default, fields
  7611. // with empty values are omitted from API requests. However, any field
  7612. // with an empty value appearing in NullFields will be sent to the
  7613. // server as null. It is an error if a field in this list has a
  7614. // non-empty value. This may be used to include null fields in Patch
  7615. // requests.
  7616. NullFields []string `json:"-"`
  7617. }
  7618. func (s *HttpHealthCheck) MarshalJSON() ([]byte, error) {
  7619. type NoMethod HttpHealthCheck
  7620. raw := NoMethod(*s)
  7621. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7622. }
  7623. // HttpHealthCheckList: Contains a list of HttpHealthCheck resources.
  7624. type HttpHealthCheckList struct {
  7625. // Id: [Output Only] Unique identifier for the resource; defined by the
  7626. // server.
  7627. Id string `json:"id,omitempty"`
  7628. // Items: A list of HttpHealthCheck resources.
  7629. Items []*HttpHealthCheck `json:"items,omitempty"`
  7630. // Kind: Type of resource.
  7631. Kind string `json:"kind,omitempty"`
  7632. // NextPageToken: [Output Only] This token allows you to get the next
  7633. // page of results for list requests. If the number of results is larger
  7634. // than maxResults, use the nextPageToken as a value for the query
  7635. // parameter pageToken in the next list request. Subsequent list
  7636. // requests will have their own nextPageToken to continue paging through
  7637. // the results.
  7638. NextPageToken string `json:"nextPageToken,omitempty"`
  7639. // SelfLink: [Output Only] Server-defined URL for this resource.
  7640. SelfLink string `json:"selfLink,omitempty"`
  7641. // Warning: [Output Only] Informational warning message.
  7642. Warning *HttpHealthCheckListWarning `json:"warning,omitempty"`
  7643. // ServerResponse contains the HTTP response code and headers from the
  7644. // server.
  7645. googleapi.ServerResponse `json:"-"`
  7646. // ForceSendFields is a list of field names (e.g. "Id") to
  7647. // unconditionally include in API requests. By default, fields with
  7648. // empty values are omitted from API requests. However, any non-pointer,
  7649. // non-interface field appearing in ForceSendFields will be sent to the
  7650. // server regardless of whether the field is empty or not. This may be
  7651. // used to include empty fields in Patch requests.
  7652. ForceSendFields []string `json:"-"`
  7653. // NullFields is a list of field names (e.g. "Id") to include in API
  7654. // requests with the JSON null value. By default, fields with empty
  7655. // values are omitted from API requests. However, any field with an
  7656. // empty value appearing in NullFields will be sent to the server as
  7657. // null. It is an error if a field in this list has a non-empty value.
  7658. // This may be used to include null fields in Patch requests.
  7659. NullFields []string `json:"-"`
  7660. }
  7661. func (s *HttpHealthCheckList) MarshalJSON() ([]byte, error) {
  7662. type NoMethod HttpHealthCheckList
  7663. raw := NoMethod(*s)
  7664. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7665. }
  7666. // HttpHealthCheckListWarning: [Output Only] Informational warning
  7667. // message.
  7668. type HttpHealthCheckListWarning struct {
  7669. // Code: [Output Only] A warning code, if applicable. For example,
  7670. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  7671. // the response.
  7672. //
  7673. // Possible values:
  7674. // "CLEANUP_FAILED"
  7675. // "DEPRECATED_RESOURCE_USED"
  7676. // "DEPRECATED_TYPE_USED"
  7677. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  7678. // "EXPERIMENTAL_TYPE_USED"
  7679. // "EXTERNAL_API_WARNING"
  7680. // "FIELD_VALUE_OVERRIDEN"
  7681. // "INJECTED_KERNELS_DEPRECATED"
  7682. // "MISSING_TYPE_DEPENDENCY"
  7683. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  7684. // "NEXT_HOP_CANNOT_IP_FORWARD"
  7685. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  7686. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  7687. // "NEXT_HOP_NOT_RUNNING"
  7688. // "NOT_CRITICAL_ERROR"
  7689. // "NO_RESULTS_ON_PAGE"
  7690. // "REQUIRED_TOS_AGREEMENT"
  7691. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  7692. // "RESOURCE_NOT_DELETED"
  7693. // "SCHEMA_VALIDATION_IGNORED"
  7694. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  7695. // "UNDECLARED_PROPERTIES"
  7696. // "UNREACHABLE"
  7697. Code string `json:"code,omitempty"`
  7698. // Data: [Output Only] Metadata about this warning in key: value format.
  7699. // For example:
  7700. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  7701. Data []*HttpHealthCheckListWarningData `json:"data,omitempty"`
  7702. // Message: [Output Only] A human-readable description of the warning
  7703. // code.
  7704. Message string `json:"message,omitempty"`
  7705. // ForceSendFields is a list of field names (e.g. "Code") 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. "Code") 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 *HttpHealthCheckListWarning) MarshalJSON() ([]byte, error) {
  7721. type NoMethod HttpHealthCheckListWarning
  7722. raw := NoMethod(*s)
  7723. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7724. }
  7725. type HttpHealthCheckListWarningData struct {
  7726. // Key: [Output Only] A key that provides more detail on the warning
  7727. // being returned. For example, for warnings where there are no results
  7728. // in a list request for a particular zone, this key might be scope and
  7729. // the key value might be the zone name. Other examples might be a key
  7730. // indicating a deprecated resource and a suggested replacement, or a
  7731. // warning about invalid network settings (for example, if an instance
  7732. // attempts to perform IP forwarding but is not enabled for IP
  7733. // forwarding).
  7734. Key string `json:"key,omitempty"`
  7735. // Value: [Output Only] A warning data value corresponding to the key.
  7736. Value string `json:"value,omitempty"`
  7737. // ForceSendFields is a list of field names (e.g. "Key") to
  7738. // unconditionally include in API requests. By default, fields with
  7739. // empty values are omitted from API requests. However, any non-pointer,
  7740. // non-interface field appearing in ForceSendFields will be sent to the
  7741. // server regardless of whether the field is empty or not. This may be
  7742. // used to include empty fields in Patch requests.
  7743. ForceSendFields []string `json:"-"`
  7744. // NullFields is a list of field names (e.g. "Key") to include in API
  7745. // requests with the JSON null value. By default, fields with empty
  7746. // values are omitted from API requests. However, any field with an
  7747. // empty value appearing in NullFields will be sent to the server as
  7748. // null. It is an error if a field in this list has a non-empty value.
  7749. // This may be used to include null fields in Patch requests.
  7750. NullFields []string `json:"-"`
  7751. }
  7752. func (s *HttpHealthCheckListWarningData) MarshalJSON() ([]byte, error) {
  7753. type NoMethod HttpHealthCheckListWarningData
  7754. raw := NoMethod(*s)
  7755. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7756. }
  7757. // HttpsHealthCheck: An HttpsHealthCheck resource. This resource defines
  7758. // a template for how individual instances should be checked for health,
  7759. // via HTTPS.
  7760. type HttpsHealthCheck struct {
  7761. // CheckIntervalSec: How often (in seconds) to send a health check. The
  7762. // default value is 5 seconds.
  7763. CheckIntervalSec int64 `json:"checkIntervalSec,omitempty"`
  7764. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  7765. // format.
  7766. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  7767. // Description: An optional description of this resource. Provide this
  7768. // property when you create the resource.
  7769. Description string `json:"description,omitempty"`
  7770. // HealthyThreshold: A so-far unhealthy instance will be marked healthy
  7771. // after this many consecutive successes. The default value is 2.
  7772. HealthyThreshold int64 `json:"healthyThreshold,omitempty"`
  7773. // Host: The value of the host header in the HTTPS health check request.
  7774. // If left empty (default value), the public IP on behalf of which this
  7775. // health check is performed will be used.
  7776. Host string `json:"host,omitempty"`
  7777. // Id: [Output Only] The unique identifier for the resource. This
  7778. // identifier is defined by the server.
  7779. Id uint64 `json:"id,omitempty,string"`
  7780. // Kind: Type of the resource.
  7781. Kind string `json:"kind,omitempty"`
  7782. // Name: Name of the resource. Provided by the client when the resource
  7783. // is created. The name must be 1-63 characters long, and comply with
  7784. // RFC1035. Specifically, the name must be 1-63 characters long and
  7785. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  7786. // the first character must be a lowercase letter, and all following
  7787. // characters must be a dash, lowercase letter, or digit, except the
  7788. // last character, which cannot be a dash.
  7789. Name string `json:"name,omitempty"`
  7790. // Port: The TCP port number for the HTTPS health check request. The
  7791. // default value is 443.
  7792. Port int64 `json:"port,omitempty"`
  7793. // RequestPath: The request path of the HTTPS health check request. The
  7794. // default value is "/".
  7795. RequestPath string `json:"requestPath,omitempty"`
  7796. // SelfLink: [Output Only] Server-defined URL for the resource.
  7797. SelfLink string `json:"selfLink,omitempty"`
  7798. // TimeoutSec: How long (in seconds) to wait before claiming failure.
  7799. // The default value is 5 seconds. It is invalid for timeoutSec to have
  7800. // a greater value than checkIntervalSec.
  7801. TimeoutSec int64 `json:"timeoutSec,omitempty"`
  7802. // UnhealthyThreshold: A so-far healthy instance will be marked
  7803. // unhealthy after this many consecutive failures. The default value is
  7804. // 2.
  7805. UnhealthyThreshold int64 `json:"unhealthyThreshold,omitempty"`
  7806. // ServerResponse contains the HTTP response code and headers from the
  7807. // server.
  7808. googleapi.ServerResponse `json:"-"`
  7809. // ForceSendFields is a list of field names (e.g. "CheckIntervalSec") to
  7810. // unconditionally include in API requests. By default, fields with
  7811. // empty values are omitted from API requests. However, any non-pointer,
  7812. // non-interface field appearing in ForceSendFields will be sent to the
  7813. // server regardless of whether the field is empty or not. This may be
  7814. // used to include empty fields in Patch requests.
  7815. ForceSendFields []string `json:"-"`
  7816. // NullFields is a list of field names (e.g. "CheckIntervalSec") to
  7817. // include in API requests with the JSON null value. By default, fields
  7818. // with empty values are omitted from API requests. However, any field
  7819. // with an empty value appearing in NullFields will be sent to the
  7820. // server as null. It is an error if a field in this list has a
  7821. // non-empty value. This may be used to include null fields in Patch
  7822. // requests.
  7823. NullFields []string `json:"-"`
  7824. }
  7825. func (s *HttpsHealthCheck) MarshalJSON() ([]byte, error) {
  7826. type NoMethod HttpsHealthCheck
  7827. raw := NoMethod(*s)
  7828. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7829. }
  7830. // HttpsHealthCheckList: Contains a list of HttpsHealthCheck resources.
  7831. type HttpsHealthCheckList struct {
  7832. // Id: [Output Only] Unique identifier for the resource; defined by the
  7833. // server.
  7834. Id string `json:"id,omitempty"`
  7835. // Items: A list of HttpsHealthCheck resources.
  7836. Items []*HttpsHealthCheck `json:"items,omitempty"`
  7837. // Kind: Type of resource.
  7838. Kind string `json:"kind,omitempty"`
  7839. // NextPageToken: [Output Only] This token allows you to get the next
  7840. // page of results for list requests. If the number of results is larger
  7841. // than maxResults, use the nextPageToken as a value for the query
  7842. // parameter pageToken in the next list request. Subsequent list
  7843. // requests will have their own nextPageToken to continue paging through
  7844. // the results.
  7845. NextPageToken string `json:"nextPageToken,omitempty"`
  7846. // SelfLink: [Output Only] Server-defined URL for this resource.
  7847. SelfLink string `json:"selfLink,omitempty"`
  7848. // Warning: [Output Only] Informational warning message.
  7849. Warning *HttpsHealthCheckListWarning `json:"warning,omitempty"`
  7850. // ServerResponse contains the HTTP response code and headers from the
  7851. // server.
  7852. googleapi.ServerResponse `json:"-"`
  7853. // ForceSendFields is a list of field names (e.g. "Id") to
  7854. // unconditionally include in API requests. By default, fields with
  7855. // empty values are omitted from API requests. However, any non-pointer,
  7856. // non-interface field appearing in ForceSendFields will be sent to the
  7857. // server regardless of whether the field is empty or not. This may be
  7858. // used to include empty fields in Patch requests.
  7859. ForceSendFields []string `json:"-"`
  7860. // NullFields is a list of field names (e.g. "Id") to include in API
  7861. // requests with the JSON null value. By default, fields with empty
  7862. // values are omitted from API requests. However, any field with an
  7863. // empty value appearing in NullFields will be sent to the server as
  7864. // null. It is an error if a field in this list has a non-empty value.
  7865. // This may be used to include null fields in Patch requests.
  7866. NullFields []string `json:"-"`
  7867. }
  7868. func (s *HttpsHealthCheckList) MarshalJSON() ([]byte, error) {
  7869. type NoMethod HttpsHealthCheckList
  7870. raw := NoMethod(*s)
  7871. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7872. }
  7873. // HttpsHealthCheckListWarning: [Output Only] Informational warning
  7874. // message.
  7875. type HttpsHealthCheckListWarning struct {
  7876. // Code: [Output Only] A warning code, if applicable. For example,
  7877. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  7878. // the response.
  7879. //
  7880. // Possible values:
  7881. // "CLEANUP_FAILED"
  7882. // "DEPRECATED_RESOURCE_USED"
  7883. // "DEPRECATED_TYPE_USED"
  7884. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  7885. // "EXPERIMENTAL_TYPE_USED"
  7886. // "EXTERNAL_API_WARNING"
  7887. // "FIELD_VALUE_OVERRIDEN"
  7888. // "INJECTED_KERNELS_DEPRECATED"
  7889. // "MISSING_TYPE_DEPENDENCY"
  7890. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  7891. // "NEXT_HOP_CANNOT_IP_FORWARD"
  7892. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  7893. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  7894. // "NEXT_HOP_NOT_RUNNING"
  7895. // "NOT_CRITICAL_ERROR"
  7896. // "NO_RESULTS_ON_PAGE"
  7897. // "REQUIRED_TOS_AGREEMENT"
  7898. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  7899. // "RESOURCE_NOT_DELETED"
  7900. // "SCHEMA_VALIDATION_IGNORED"
  7901. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  7902. // "UNDECLARED_PROPERTIES"
  7903. // "UNREACHABLE"
  7904. Code string `json:"code,omitempty"`
  7905. // Data: [Output Only] Metadata about this warning in key: value format.
  7906. // For example:
  7907. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  7908. Data []*HttpsHealthCheckListWarningData `json:"data,omitempty"`
  7909. // Message: [Output Only] A human-readable description of the warning
  7910. // code.
  7911. Message string `json:"message,omitempty"`
  7912. // ForceSendFields is a list of field names (e.g. "Code") to
  7913. // unconditionally include in API requests. By default, fields with
  7914. // empty values are omitted from API requests. However, any non-pointer,
  7915. // non-interface field appearing in ForceSendFields will be sent to the
  7916. // server regardless of whether the field is empty or not. This may be
  7917. // used to include empty fields in Patch requests.
  7918. ForceSendFields []string `json:"-"`
  7919. // NullFields is a list of field names (e.g. "Code") to include in API
  7920. // requests with the JSON null value. By default, fields with empty
  7921. // values are omitted from API requests. However, any field with an
  7922. // empty value appearing in NullFields will be sent to the server as
  7923. // null. It is an error if a field in this list has a non-empty value.
  7924. // This may be used to include null fields in Patch requests.
  7925. NullFields []string `json:"-"`
  7926. }
  7927. func (s *HttpsHealthCheckListWarning) MarshalJSON() ([]byte, error) {
  7928. type NoMethod HttpsHealthCheckListWarning
  7929. raw := NoMethod(*s)
  7930. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7931. }
  7932. type HttpsHealthCheckListWarningData struct {
  7933. // Key: [Output Only] A key that provides more detail on the warning
  7934. // being returned. For example, for warnings where there are no results
  7935. // in a list request for a particular zone, this key might be scope and
  7936. // the key value might be the zone name. Other examples might be a key
  7937. // indicating a deprecated resource and a suggested replacement, or a
  7938. // warning about invalid network settings (for example, if an instance
  7939. // attempts to perform IP forwarding but is not enabled for IP
  7940. // forwarding).
  7941. Key string `json:"key,omitempty"`
  7942. // Value: [Output Only] A warning data value corresponding to the key.
  7943. Value string `json:"value,omitempty"`
  7944. // ForceSendFields is a list of field names (e.g. "Key") to
  7945. // unconditionally include in API requests. By default, fields with
  7946. // empty values are omitted from API requests. However, any non-pointer,
  7947. // non-interface field appearing in ForceSendFields will be sent to the
  7948. // server regardless of whether the field is empty or not. This may be
  7949. // used to include empty fields in Patch requests.
  7950. ForceSendFields []string `json:"-"`
  7951. // NullFields is a list of field names (e.g. "Key") to include in API
  7952. // requests with the JSON null value. By default, fields with empty
  7953. // values are omitted from API requests. However, any field with an
  7954. // empty value appearing in NullFields will be sent to the server as
  7955. // null. It is an error if a field in this list has a non-empty value.
  7956. // This may be used to include null fields in Patch requests.
  7957. NullFields []string `json:"-"`
  7958. }
  7959. func (s *HttpsHealthCheckListWarningData) MarshalJSON() ([]byte, error) {
  7960. type NoMethod HttpsHealthCheckListWarningData
  7961. raw := NoMethod(*s)
  7962. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7963. }
  7964. // Image: An Image resource. (== resource_for beta.images ==) (==
  7965. // resource_for v1.images ==)
  7966. type Image struct {
  7967. // ArchiveSizeBytes: Size of the image tar.gz archive stored in Google
  7968. // Cloud Storage (in bytes).
  7969. ArchiveSizeBytes int64 `json:"archiveSizeBytes,omitempty,string"`
  7970. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  7971. // format.
  7972. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  7973. // Deprecated: The deprecation status associated with this image.
  7974. Deprecated *DeprecationStatus `json:"deprecated,omitempty"`
  7975. // Description: An optional description of this resource. Provide this
  7976. // property when you create the resource.
  7977. Description string `json:"description,omitempty"`
  7978. // DiskSizeGb: Size of the image when restored onto a persistent disk
  7979. // (in GB).
  7980. DiskSizeGb int64 `json:"diskSizeGb,omitempty,string"`
  7981. // Family: The name of the image family to which this image belongs. You
  7982. // can create disks by specifying an image family instead of a specific
  7983. // image name. The image family always returns its latest image that is
  7984. // not deprecated. The name of the image family must comply with
  7985. // RFC1035.
  7986. Family string `json:"family,omitempty"`
  7987. // GuestOsFeatures: A list of features to enable on the guest operating
  7988. // system. Applicable only for bootable images. Read Enabling guest
  7989. // operating system features to see a list of available options.
  7990. GuestOsFeatures []*GuestOsFeature `json:"guestOsFeatures,omitempty"`
  7991. // Id: [Output Only] The unique identifier for the resource. This
  7992. // identifier is defined by the server.
  7993. Id uint64 `json:"id,omitempty,string"`
  7994. // ImageEncryptionKey: Encrypts the image using a customer-supplied
  7995. // encryption key.
  7996. //
  7997. // After you encrypt an image with a customer-supplied key, you must
  7998. // provide the same key if you use the image later (e.g. to create a
  7999. // disk from the image).
  8000. //
  8001. // Customer-supplied encryption keys do not protect access to metadata
  8002. // of the disk.
  8003. //
  8004. // If you do not provide an encryption key when creating the image, then
  8005. // the disk will be encrypted using an automatically generated key and
  8006. // you do not need to provide a key to use the image later.
  8007. ImageEncryptionKey *CustomerEncryptionKey `json:"imageEncryptionKey,omitempty"`
  8008. // Kind: [Output Only] Type of the resource. Always compute#image for
  8009. // images.
  8010. Kind string `json:"kind,omitempty"`
  8011. // LabelFingerprint: A fingerprint for the labels being applied to this
  8012. // image, which is essentially a hash of the labels used for optimistic
  8013. // locking. The fingerprint is initially generated by Compute Engine and
  8014. // changes after every request to modify or update labels. You must
  8015. // always provide an up-to-date fingerprint hash in order to update or
  8016. // change labels.
  8017. //
  8018. // To see the latest fingerprint, make a get() request to retrieve an
  8019. // image.
  8020. LabelFingerprint string `json:"labelFingerprint,omitempty"`
  8021. // Labels: Labels to apply to this image. These can be later modified by
  8022. // the setLabels method.
  8023. Labels map[string]string `json:"labels,omitempty"`
  8024. // LicenseCodes: Integer license codes indicating which licenses are
  8025. // attached to this image.
  8026. LicenseCodes googleapi.Int64s `json:"licenseCodes,omitempty"`
  8027. // Licenses: Any applicable license URI.
  8028. Licenses []string `json:"licenses,omitempty"`
  8029. // Name: Name of the resource; provided by the client when the resource
  8030. // is created. The name must be 1-63 characters long, and comply with
  8031. // RFC1035. Specifically, the name must be 1-63 characters long and
  8032. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  8033. // the first character must be a lowercase letter, and all following
  8034. // characters must be a dash, lowercase letter, or digit, except the
  8035. // last character, which cannot be a dash.
  8036. Name string `json:"name,omitempty"`
  8037. // RawDisk: The parameters of the raw disk image.
  8038. RawDisk *ImageRawDisk `json:"rawDisk,omitempty"`
  8039. // SelfLink: [Output Only] Server-defined URL for the resource.
  8040. SelfLink string `json:"selfLink,omitempty"`
  8041. // SourceDisk: URL of the source disk used to create this image. This
  8042. // can be a full or valid partial URL. You must provide either this
  8043. // property or the rawDisk.source property but not both to create an
  8044. // image. For example, the following are valid values:
  8045. // -
  8046. // https://www.googleapis.com/compute/v1/projects/project/zones/zone/disks/disk
  8047. // - projects/project/zones/zone/disks/disk
  8048. // - zones/zone/disks/disk
  8049. SourceDisk string `json:"sourceDisk,omitempty"`
  8050. // SourceDiskEncryptionKey: The customer-supplied encryption key of the
  8051. // source disk. Required if the source disk is protected by a
  8052. // customer-supplied encryption key.
  8053. SourceDiskEncryptionKey *CustomerEncryptionKey `json:"sourceDiskEncryptionKey,omitempty"`
  8054. // SourceDiskId: The ID value of the disk used to create this image.
  8055. // This value may be used to determine whether the image was taken from
  8056. // the current or a previous instance of a given disk name.
  8057. SourceDiskId string `json:"sourceDiskId,omitempty"`
  8058. // SourceImage: URL of the source image used to create this image. This
  8059. // can be a full or valid partial URL. You must provide exactly one of:
  8060. //
  8061. // - this property, or
  8062. // - the rawDisk.source property, or
  8063. // - the sourceDisk property in order to create an image.
  8064. SourceImage string `json:"sourceImage,omitempty"`
  8065. // SourceImageEncryptionKey: The customer-supplied encryption key of the
  8066. // source image. Required if the source image is protected by a
  8067. // customer-supplied encryption key.
  8068. SourceImageEncryptionKey *CustomerEncryptionKey `json:"sourceImageEncryptionKey,omitempty"`
  8069. // SourceImageId: [Output Only] The ID value of the image used to create
  8070. // this image. This value may be used to determine whether the image was
  8071. // taken from the current or a previous instance of a given image name.
  8072. SourceImageId string `json:"sourceImageId,omitempty"`
  8073. // SourceSnapshot: URL of the source snapshot used to create this image.
  8074. // This can be a full or valid partial URL. You must provide exactly one
  8075. // of:
  8076. // - this property, or
  8077. // - the sourceImage property, or
  8078. // - the rawDisk.source property, or
  8079. // - the sourceDisk property in order to create an image.
  8080. SourceSnapshot string `json:"sourceSnapshot,omitempty"`
  8081. // SourceSnapshotEncryptionKey: The customer-supplied encryption key of
  8082. // the source snapshot. Required if the source snapshot is protected by
  8083. // a customer-supplied encryption key.
  8084. SourceSnapshotEncryptionKey *CustomerEncryptionKey `json:"sourceSnapshotEncryptionKey,omitempty"`
  8085. // SourceSnapshotId: [Output Only] The ID value of the snapshot used to
  8086. // create this image. This value may be used to determine whether the
  8087. // snapshot was taken from the current or a previous instance of a given
  8088. // snapshot name.
  8089. SourceSnapshotId string `json:"sourceSnapshotId,omitempty"`
  8090. // SourceType: The type of the image used to create this disk. The
  8091. // default and only value is RAW
  8092. //
  8093. // Possible values:
  8094. // "RAW" (default)
  8095. SourceType string `json:"sourceType,omitempty"`
  8096. // Status: [Output Only] The status of the image. An image can be used
  8097. // to create other resources, such as instances, only after the image
  8098. // has been successfully created and the status is set to READY.
  8099. // Possible values are FAILED, PENDING, or READY.
  8100. //
  8101. // Possible values:
  8102. // "FAILED"
  8103. // "PENDING"
  8104. // "READY"
  8105. Status string `json:"status,omitempty"`
  8106. // ServerResponse contains the HTTP response code and headers from the
  8107. // server.
  8108. googleapi.ServerResponse `json:"-"`
  8109. // ForceSendFields is a list of field names (e.g. "ArchiveSizeBytes") to
  8110. // unconditionally include in API requests. By default, fields with
  8111. // empty values are omitted from API requests. However, any non-pointer,
  8112. // non-interface field appearing in ForceSendFields will be sent to the
  8113. // server regardless of whether the field is empty or not. This may be
  8114. // used to include empty fields in Patch requests.
  8115. ForceSendFields []string `json:"-"`
  8116. // NullFields is a list of field names (e.g. "ArchiveSizeBytes") to
  8117. // include in API requests with the JSON null value. By default, fields
  8118. // with empty values are omitted from API requests. However, any field
  8119. // with an empty value appearing in NullFields will be sent to the
  8120. // server as null. It is an error if a field in this list has a
  8121. // non-empty value. This may be used to include null fields in Patch
  8122. // requests.
  8123. NullFields []string `json:"-"`
  8124. }
  8125. func (s *Image) MarshalJSON() ([]byte, error) {
  8126. type NoMethod Image
  8127. raw := NoMethod(*s)
  8128. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8129. }
  8130. // ImageRawDisk: The parameters of the raw disk image.
  8131. type ImageRawDisk struct {
  8132. // ContainerType: The format used to encode and transmit the block
  8133. // device, which should be TAR. This is just a container and
  8134. // transmission format and not a runtime format. Provided by the client
  8135. // when the disk image is created.
  8136. //
  8137. // Possible values:
  8138. // "TAR"
  8139. ContainerType string `json:"containerType,omitempty"`
  8140. // Sha1Checksum: An optional SHA1 checksum of the disk image before
  8141. // unpackaging; provided by the client when the disk image is created.
  8142. Sha1Checksum string `json:"sha1Checksum,omitempty"`
  8143. // Source: The full Google Cloud Storage URL where the disk image is
  8144. // stored. You must provide either this property or the sourceDisk
  8145. // property but not both.
  8146. Source string `json:"source,omitempty"`
  8147. // ForceSendFields is a list of field names (e.g. "ContainerType") to
  8148. // unconditionally include in API requests. By default, fields with
  8149. // empty values are omitted from API requests. However, any non-pointer,
  8150. // non-interface field appearing in ForceSendFields will be sent to the
  8151. // server regardless of whether the field is empty or not. This may be
  8152. // used to include empty fields in Patch requests.
  8153. ForceSendFields []string `json:"-"`
  8154. // NullFields is a list of field names (e.g. "ContainerType") to include
  8155. // in API requests with the JSON null value. By default, fields with
  8156. // empty values are omitted from API requests. However, any field with
  8157. // an empty value appearing in NullFields will be sent to the server as
  8158. // null. It is an error if a field in this list has a non-empty value.
  8159. // This may be used to include null fields in Patch requests.
  8160. NullFields []string `json:"-"`
  8161. }
  8162. func (s *ImageRawDisk) MarshalJSON() ([]byte, error) {
  8163. type NoMethod ImageRawDisk
  8164. raw := NoMethod(*s)
  8165. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8166. }
  8167. // ImageList: Contains a list of images.
  8168. type ImageList struct {
  8169. // Id: [Output Only] Unique identifier for the resource; defined by the
  8170. // server.
  8171. Id string `json:"id,omitempty"`
  8172. // Items: A list of Image resources.
  8173. Items []*Image `json:"items,omitempty"`
  8174. // Kind: Type of resource.
  8175. Kind string `json:"kind,omitempty"`
  8176. // NextPageToken: [Output Only] This token allows you to get the next
  8177. // page of results for list requests. If the number of results is larger
  8178. // than maxResults, use the nextPageToken as a value for the query
  8179. // parameter pageToken in the next list request. Subsequent list
  8180. // requests will have their own nextPageToken to continue paging through
  8181. // the results.
  8182. NextPageToken string `json:"nextPageToken,omitempty"`
  8183. // SelfLink: [Output Only] Server-defined URL for this resource.
  8184. SelfLink string `json:"selfLink,omitempty"`
  8185. // Warning: [Output Only] Informational warning message.
  8186. Warning *ImageListWarning `json:"warning,omitempty"`
  8187. // ServerResponse contains the HTTP response code and headers from the
  8188. // server.
  8189. googleapi.ServerResponse `json:"-"`
  8190. // ForceSendFields is a list of field names (e.g. "Id") to
  8191. // unconditionally include in API requests. By default, fields with
  8192. // empty values are omitted from API requests. However, any non-pointer,
  8193. // non-interface field appearing in ForceSendFields will be sent to the
  8194. // server regardless of whether the field is empty or not. This may be
  8195. // used to include empty fields in Patch requests.
  8196. ForceSendFields []string `json:"-"`
  8197. // NullFields is a list of field names (e.g. "Id") to include in API
  8198. // requests with the JSON null value. By default, fields with empty
  8199. // values are omitted from API requests. However, any field with an
  8200. // empty value appearing in NullFields will be sent to the server as
  8201. // null. It is an error if a field in this list has a non-empty value.
  8202. // This may be used to include null fields in Patch requests.
  8203. NullFields []string `json:"-"`
  8204. }
  8205. func (s *ImageList) MarshalJSON() ([]byte, error) {
  8206. type NoMethod ImageList
  8207. raw := NoMethod(*s)
  8208. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8209. }
  8210. // ImageListWarning: [Output Only] Informational warning message.
  8211. type ImageListWarning struct {
  8212. // Code: [Output Only] A warning code, if applicable. For example,
  8213. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  8214. // the response.
  8215. //
  8216. // Possible values:
  8217. // "CLEANUP_FAILED"
  8218. // "DEPRECATED_RESOURCE_USED"
  8219. // "DEPRECATED_TYPE_USED"
  8220. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  8221. // "EXPERIMENTAL_TYPE_USED"
  8222. // "EXTERNAL_API_WARNING"
  8223. // "FIELD_VALUE_OVERRIDEN"
  8224. // "INJECTED_KERNELS_DEPRECATED"
  8225. // "MISSING_TYPE_DEPENDENCY"
  8226. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  8227. // "NEXT_HOP_CANNOT_IP_FORWARD"
  8228. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  8229. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  8230. // "NEXT_HOP_NOT_RUNNING"
  8231. // "NOT_CRITICAL_ERROR"
  8232. // "NO_RESULTS_ON_PAGE"
  8233. // "REQUIRED_TOS_AGREEMENT"
  8234. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  8235. // "RESOURCE_NOT_DELETED"
  8236. // "SCHEMA_VALIDATION_IGNORED"
  8237. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  8238. // "UNDECLARED_PROPERTIES"
  8239. // "UNREACHABLE"
  8240. Code string `json:"code,omitempty"`
  8241. // Data: [Output Only] Metadata about this warning in key: value format.
  8242. // For example:
  8243. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  8244. Data []*ImageListWarningData `json:"data,omitempty"`
  8245. // Message: [Output Only] A human-readable description of the warning
  8246. // code.
  8247. Message string `json:"message,omitempty"`
  8248. // ForceSendFields is a list of field names (e.g. "Code") to
  8249. // unconditionally include in API requests. By default, fields with
  8250. // empty values are omitted from API requests. However, any non-pointer,
  8251. // non-interface field appearing in ForceSendFields will be sent to the
  8252. // server regardless of whether the field is empty or not. This may be
  8253. // used to include empty fields in Patch requests.
  8254. ForceSendFields []string `json:"-"`
  8255. // NullFields is a list of field names (e.g. "Code") to include in API
  8256. // requests with the JSON null value. By default, fields with empty
  8257. // values are omitted from API requests. However, any field with an
  8258. // empty value appearing in NullFields will be sent to the server as
  8259. // null. It is an error if a field in this list has a non-empty value.
  8260. // This may be used to include null fields in Patch requests.
  8261. NullFields []string `json:"-"`
  8262. }
  8263. func (s *ImageListWarning) MarshalJSON() ([]byte, error) {
  8264. type NoMethod ImageListWarning
  8265. raw := NoMethod(*s)
  8266. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8267. }
  8268. type ImageListWarningData struct {
  8269. // Key: [Output Only] A key that provides more detail on the warning
  8270. // being returned. For example, for warnings where there are no results
  8271. // in a list request for a particular zone, this key might be scope and
  8272. // the key value might be the zone name. Other examples might be a key
  8273. // indicating a deprecated resource and a suggested replacement, or a
  8274. // warning about invalid network settings (for example, if an instance
  8275. // attempts to perform IP forwarding but is not enabled for IP
  8276. // forwarding).
  8277. Key string `json:"key,omitempty"`
  8278. // Value: [Output Only] A warning data value corresponding to the key.
  8279. Value string `json:"value,omitempty"`
  8280. // ForceSendFields is a list of field names (e.g. "Key") to
  8281. // unconditionally include in API requests. By default, fields with
  8282. // empty values are omitted from API requests. However, any non-pointer,
  8283. // non-interface field appearing in ForceSendFields will be sent to the
  8284. // server regardless of whether the field is empty or not. This may be
  8285. // used to include empty fields in Patch requests.
  8286. ForceSendFields []string `json:"-"`
  8287. // NullFields is a list of field names (e.g. "Key") to include in API
  8288. // requests with the JSON null value. By default, fields with empty
  8289. // values are omitted from API requests. However, any field with an
  8290. // empty value appearing in NullFields will be sent to the server as
  8291. // null. It is an error if a field in this list has a non-empty value.
  8292. // This may be used to include null fields in Patch requests.
  8293. NullFields []string `json:"-"`
  8294. }
  8295. func (s *ImageListWarningData) MarshalJSON() ([]byte, error) {
  8296. type NoMethod ImageListWarningData
  8297. raw := NoMethod(*s)
  8298. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8299. }
  8300. // Instance: An Instance resource. (== resource_for beta.instances ==)
  8301. // (== resource_for v1.instances ==)
  8302. type Instance struct {
  8303. // CanIpForward: Allows this instance to send and receive packets with
  8304. // non-matching destination or source IPs. This is required if you plan
  8305. // to use this instance to forward routes. For more information, see
  8306. // Enabling IP Forwarding.
  8307. CanIpForward bool `json:"canIpForward,omitempty"`
  8308. // CpuPlatform: [Output Only] The CPU platform used by this instance.
  8309. CpuPlatform string `json:"cpuPlatform,omitempty"`
  8310. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  8311. // format.
  8312. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  8313. // DeletionProtection: Whether the resource should be protected against
  8314. // deletion.
  8315. DeletionProtection bool `json:"deletionProtection,omitempty"`
  8316. // Description: An optional description of this resource. Provide this
  8317. // property when you create the resource.
  8318. Description string `json:"description,omitempty"`
  8319. // Disks: Array of disks associated with this instance. Persistent disks
  8320. // must be created before you can assign them.
  8321. Disks []*AttachedDisk `json:"disks,omitempty"`
  8322. // GuestAccelerators: A list of the type and count of accelerator cards
  8323. // attached to the instance.
  8324. GuestAccelerators []*AcceleratorConfig `json:"guestAccelerators,omitempty"`
  8325. // Id: [Output Only] The unique identifier for the resource. This
  8326. // identifier is defined by the server.
  8327. Id uint64 `json:"id,omitempty,string"`
  8328. // Kind: [Output Only] Type of the resource. Always compute#instance for
  8329. // instances.
  8330. Kind string `json:"kind,omitempty"`
  8331. // LabelFingerprint: A fingerprint for this request, which is
  8332. // essentially a hash of the label's contents and used for optimistic
  8333. // locking. The fingerprint is initially generated by Compute Engine and
  8334. // changes after every request to modify or update labels. You must
  8335. // always provide an up-to-date fingerprint hash in order to update or
  8336. // change labels.
  8337. //
  8338. // To see the latest fingerprint, make get() request to the instance.
  8339. LabelFingerprint string `json:"labelFingerprint,omitempty"`
  8340. // Labels: Labels to apply to this instance. These can be later modified
  8341. // by the setLabels method.
  8342. Labels map[string]string `json:"labels,omitempty"`
  8343. // MachineType: Full or partial URL of the machine type resource to use
  8344. // for this instance, in the format:
  8345. // zones/zone/machineTypes/machine-type. This is provided by the client
  8346. // when the instance is created. For example, the following is a valid
  8347. // partial url to a predefined machine
  8348. // type:
  8349. // zones/us-central1-f/machineTypes/n1-standard-1
  8350. //
  8351. //
  8352. // To create a custom machine type, provide a URL to a machine type in
  8353. // the following format, where CPUS is 1 or an even number up to 32 (2,
  8354. // 4, 6, ... 24, etc), and MEMORY is the total memory for this instance.
  8355. // Memory must be a multiple of 256 MB and must be supplied in MB (e.g.
  8356. // 5 GB of memory is 5120
  8357. // MB):
  8358. // zones/zone/machineTypes/custom-CPUS-MEMORY
  8359. //
  8360. //
  8361. // For example: zones/us-central1-f/machineTypes/custom-4-5120
  8362. //
  8363. // For a full list of restrictions, read the Specifications for custom
  8364. // machine types.
  8365. MachineType string `json:"machineType,omitempty"`
  8366. // Metadata: The metadata key/value pairs assigned to this instance.
  8367. // This includes custom metadata and predefined keys.
  8368. Metadata *Metadata `json:"metadata,omitempty"`
  8369. // MinCpuPlatform: Specifies a minimum CPU platform for the VM instance.
  8370. // Applicable values are the friendly names of CPU platforms, such as
  8371. // minCpuPlatform: "Intel Haswell" or minCpuPlatform: "Intel Sandy
  8372. // Bridge".
  8373. MinCpuPlatform string `json:"minCpuPlatform,omitempty"`
  8374. // Name: The name of the resource, provided by the client when initially
  8375. // creating the resource. The resource name must be 1-63 characters
  8376. // long, and comply with RFC1035. Specifically, the name must be 1-63
  8377. // characters long and match the regular expression
  8378. // `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be
  8379. // a lowercase letter, and all following characters must be a dash,
  8380. // lowercase letter, or digit, except the last character, which cannot
  8381. // be a dash.
  8382. Name string `json:"name,omitempty"`
  8383. // NetworkInterfaces: An array of network configurations for this
  8384. // instance. These specify how interfaces are configured to interact
  8385. // with other network services, such as connecting to the internet.
  8386. // Multiple interfaces are supported per instance.
  8387. NetworkInterfaces []*NetworkInterface `json:"networkInterfaces,omitempty"`
  8388. // Scheduling: Sets the scheduling options for this instance.
  8389. Scheduling *Scheduling `json:"scheduling,omitempty"`
  8390. // SelfLink: [Output Only] Server-defined URL for this resource.
  8391. SelfLink string `json:"selfLink,omitempty"`
  8392. // ServiceAccounts: A list of service accounts, with their specified
  8393. // scopes, authorized for this instance. Only one service account per VM
  8394. // instance is supported.
  8395. //
  8396. // Service accounts generate access tokens that can be accessed through
  8397. // the metadata server and used to authenticate applications on the
  8398. // instance. See Service Accounts for more information.
  8399. ServiceAccounts []*ServiceAccount `json:"serviceAccounts,omitempty"`
  8400. ShieldedVmConfig *ShieldedVmConfig `json:"shieldedVmConfig,omitempty"`
  8401. ShieldedVmIntegrityPolicy *ShieldedVmIntegrityPolicy `json:"shieldedVmIntegrityPolicy,omitempty"`
  8402. // StartRestricted: [Output Only] Whether a VM has been restricted for
  8403. // start because Compute Engine has detected suspicious activity.
  8404. StartRestricted bool `json:"startRestricted,omitempty"`
  8405. // Status: [Output Only] The status of the instance. One of the
  8406. // following values: PROVISIONING, STAGING, RUNNING, STOPPING, STOPPED,
  8407. // SUSPENDING, SUSPENDED, and TERMINATED.
  8408. //
  8409. // Possible values:
  8410. // "PROVISIONING"
  8411. // "RUNNING"
  8412. // "STAGING"
  8413. // "STOPPED"
  8414. // "STOPPING"
  8415. // "SUSPENDED"
  8416. // "SUSPENDING"
  8417. // "TERMINATED"
  8418. Status string `json:"status,omitempty"`
  8419. // StatusMessage: [Output Only] An optional, human-readable explanation
  8420. // of the status.
  8421. StatusMessage string `json:"statusMessage,omitempty"`
  8422. // Tags: A list of tags to apply to this instance. Tags are used to
  8423. // identify valid sources or targets for network firewalls and are
  8424. // specified by the client during instance creation. The tags can be
  8425. // later modified by the setTags method. Each tag within the list must
  8426. // comply with RFC1035.
  8427. Tags *Tags `json:"tags,omitempty"`
  8428. // Zone: [Output Only] URL of the zone where the instance resides. You
  8429. // must specify this field as part of the HTTP request URL. It is not
  8430. // settable as a field in the request body.
  8431. Zone string `json:"zone,omitempty"`
  8432. // ServerResponse contains the HTTP response code and headers from the
  8433. // server.
  8434. googleapi.ServerResponse `json:"-"`
  8435. // ForceSendFields is a list of field names (e.g. "CanIpForward") to
  8436. // unconditionally include in API requests. By default, fields with
  8437. // empty values are omitted from API requests. However, any non-pointer,
  8438. // non-interface field appearing in ForceSendFields will be sent to the
  8439. // server regardless of whether the field is empty or not. This may be
  8440. // used to include empty fields in Patch requests.
  8441. ForceSendFields []string `json:"-"`
  8442. // NullFields is a list of field names (e.g. "CanIpForward") to include
  8443. // in API requests with the JSON null value. By default, fields with
  8444. // empty values are omitted from API requests. However, any field with
  8445. // an empty value appearing in NullFields will be sent to the server as
  8446. // null. It is an error if a field in this list has a non-empty value.
  8447. // This may be used to include null fields in Patch requests.
  8448. NullFields []string `json:"-"`
  8449. }
  8450. func (s *Instance) MarshalJSON() ([]byte, error) {
  8451. type NoMethod Instance
  8452. raw := NoMethod(*s)
  8453. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8454. }
  8455. type InstanceAggregatedList struct {
  8456. // Id: [Output Only] Unique identifier for the resource; defined by the
  8457. // server.
  8458. Id string `json:"id,omitempty"`
  8459. // Items: A list of InstancesScopedList resources.
  8460. Items map[string]InstancesScopedList `json:"items,omitempty"`
  8461. // Kind: [Output Only] Type of resource. Always
  8462. // compute#instanceAggregatedList for aggregated lists of Instance
  8463. // resources.
  8464. Kind string `json:"kind,omitempty"`
  8465. // NextPageToken: [Output Only] This token allows you to get the next
  8466. // page of results for list requests. If the number of results is larger
  8467. // than maxResults, use the nextPageToken as a value for the query
  8468. // parameter pageToken in the next list request. Subsequent list
  8469. // requests will have their own nextPageToken to continue paging through
  8470. // the results.
  8471. NextPageToken string `json:"nextPageToken,omitempty"`
  8472. // SelfLink: [Output Only] Server-defined URL for this resource.
  8473. SelfLink string `json:"selfLink,omitempty"`
  8474. // Warning: [Output Only] Informational warning message.
  8475. Warning *InstanceAggregatedListWarning `json:"warning,omitempty"`
  8476. // ServerResponse contains the HTTP response code and headers from the
  8477. // server.
  8478. googleapi.ServerResponse `json:"-"`
  8479. // ForceSendFields is a list of field names (e.g. "Id") to
  8480. // unconditionally include in API requests. By default, fields with
  8481. // empty values are omitted from API requests. However, any non-pointer,
  8482. // non-interface field appearing in ForceSendFields will be sent to the
  8483. // server regardless of whether the field is empty or not. This may be
  8484. // used to include empty fields in Patch requests.
  8485. ForceSendFields []string `json:"-"`
  8486. // NullFields is a list of field names (e.g. "Id") to include in API
  8487. // requests with the JSON null value. By default, fields with empty
  8488. // values are omitted from API requests. However, any field with an
  8489. // empty value appearing in NullFields will be sent to the server as
  8490. // null. It is an error if a field in this list has a non-empty value.
  8491. // This may be used to include null fields in Patch requests.
  8492. NullFields []string `json:"-"`
  8493. }
  8494. func (s *InstanceAggregatedList) MarshalJSON() ([]byte, error) {
  8495. type NoMethod InstanceAggregatedList
  8496. raw := NoMethod(*s)
  8497. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8498. }
  8499. // InstanceAggregatedListWarning: [Output Only] Informational warning
  8500. // message.
  8501. type InstanceAggregatedListWarning struct {
  8502. // Code: [Output Only] A warning code, if applicable. For example,
  8503. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  8504. // the response.
  8505. //
  8506. // Possible values:
  8507. // "CLEANUP_FAILED"
  8508. // "DEPRECATED_RESOURCE_USED"
  8509. // "DEPRECATED_TYPE_USED"
  8510. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  8511. // "EXPERIMENTAL_TYPE_USED"
  8512. // "EXTERNAL_API_WARNING"
  8513. // "FIELD_VALUE_OVERRIDEN"
  8514. // "INJECTED_KERNELS_DEPRECATED"
  8515. // "MISSING_TYPE_DEPENDENCY"
  8516. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  8517. // "NEXT_HOP_CANNOT_IP_FORWARD"
  8518. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  8519. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  8520. // "NEXT_HOP_NOT_RUNNING"
  8521. // "NOT_CRITICAL_ERROR"
  8522. // "NO_RESULTS_ON_PAGE"
  8523. // "REQUIRED_TOS_AGREEMENT"
  8524. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  8525. // "RESOURCE_NOT_DELETED"
  8526. // "SCHEMA_VALIDATION_IGNORED"
  8527. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  8528. // "UNDECLARED_PROPERTIES"
  8529. // "UNREACHABLE"
  8530. Code string `json:"code,omitempty"`
  8531. // Data: [Output Only] Metadata about this warning in key: value format.
  8532. // For example:
  8533. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  8534. Data []*InstanceAggregatedListWarningData `json:"data,omitempty"`
  8535. // Message: [Output Only] A human-readable description of the warning
  8536. // code.
  8537. Message string `json:"message,omitempty"`
  8538. // ForceSendFields is a list of field names (e.g. "Code") to
  8539. // unconditionally include in API requests. By default, fields with
  8540. // empty values are omitted from API requests. However, any non-pointer,
  8541. // non-interface field appearing in ForceSendFields will be sent to the
  8542. // server regardless of whether the field is empty or not. This may be
  8543. // used to include empty fields in Patch requests.
  8544. ForceSendFields []string `json:"-"`
  8545. // NullFields is a list of field names (e.g. "Code") to include in API
  8546. // requests with the JSON null value. By default, fields with empty
  8547. // values are omitted from API requests. However, any field with an
  8548. // empty value appearing in NullFields will be sent to the server as
  8549. // null. It is an error if a field in this list has a non-empty value.
  8550. // This may be used to include null fields in Patch requests.
  8551. NullFields []string `json:"-"`
  8552. }
  8553. func (s *InstanceAggregatedListWarning) MarshalJSON() ([]byte, error) {
  8554. type NoMethod InstanceAggregatedListWarning
  8555. raw := NoMethod(*s)
  8556. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8557. }
  8558. type InstanceAggregatedListWarningData struct {
  8559. // Key: [Output Only] A key that provides more detail on the warning
  8560. // being returned. For example, for warnings where there are no results
  8561. // in a list request for a particular zone, this key might be scope and
  8562. // the key value might be the zone name. Other examples might be a key
  8563. // indicating a deprecated resource and a suggested replacement, or a
  8564. // warning about invalid network settings (for example, if an instance
  8565. // attempts to perform IP forwarding but is not enabled for IP
  8566. // forwarding).
  8567. Key string `json:"key,omitempty"`
  8568. // Value: [Output Only] A warning data value corresponding to the key.
  8569. Value string `json:"value,omitempty"`
  8570. // ForceSendFields is a list of field names (e.g. "Key") to
  8571. // unconditionally include in API requests. By default, fields with
  8572. // empty values are omitted from API requests. However, any non-pointer,
  8573. // non-interface field appearing in ForceSendFields will be sent to the
  8574. // server regardless of whether the field is empty or not. This may be
  8575. // used to include empty fields in Patch requests.
  8576. ForceSendFields []string `json:"-"`
  8577. // NullFields is a list of field names (e.g. "Key") to include in API
  8578. // requests with the JSON null value. By default, fields with empty
  8579. // values are omitted from API requests. However, any field with an
  8580. // empty value appearing in NullFields will be sent to the server as
  8581. // null. It is an error if a field in this list has a non-empty value.
  8582. // This may be used to include null fields in Patch requests.
  8583. NullFields []string `json:"-"`
  8584. }
  8585. func (s *InstanceAggregatedListWarningData) MarshalJSON() ([]byte, error) {
  8586. type NoMethod InstanceAggregatedListWarningData
  8587. raw := NoMethod(*s)
  8588. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8589. }
  8590. // InstanceGroup: InstanceGroups (== resource_for beta.instanceGroups
  8591. // ==) (== resource_for v1.instanceGroups ==) (== resource_for
  8592. // beta.regionInstanceGroups ==) (== resource_for
  8593. // v1.regionInstanceGroups ==)
  8594. type InstanceGroup struct {
  8595. // CreationTimestamp: [Output Only] The creation timestamp for this
  8596. // instance group in RFC3339 text format.
  8597. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  8598. // Description: An optional description of this resource. Provide this
  8599. // property when you create the resource.
  8600. Description string `json:"description,omitempty"`
  8601. // Fingerprint: [Output Only] The fingerprint of the named ports. The
  8602. // system uses this fingerprint to detect conflicts when multiple users
  8603. // change the named ports concurrently.
  8604. Fingerprint string `json:"fingerprint,omitempty"`
  8605. // Id: [Output Only] A unique identifier for this instance group,
  8606. // generated by the server.
  8607. Id uint64 `json:"id,omitempty,string"`
  8608. // Kind: [Output Only] The resource type, which is always
  8609. // compute#instanceGroup for instance groups.
  8610. Kind string `json:"kind,omitempty"`
  8611. // Name: The name of the instance group. The name must be 1-63
  8612. // characters long, and comply with RFC1035.
  8613. Name string `json:"name,omitempty"`
  8614. // NamedPorts: Assigns a name to a port number. For example: {name:
  8615. // "http", port: 80}
  8616. //
  8617. // This allows the system to reference ports by the assigned name
  8618. // instead of a port number. Named ports can also contain multiple
  8619. // ports. For example: [{name: "http", port: 80},{name: "http", port:
  8620. // 8080}]
  8621. //
  8622. // Named ports apply to all instances in this instance group.
  8623. NamedPorts []*NamedPort `json:"namedPorts,omitempty"`
  8624. // Network: The URL of the network to which all instances in the
  8625. // instance group belong.
  8626. Network string `json:"network,omitempty"`
  8627. // Region: [Output Only] The URL of the region where the instance group
  8628. // is located (for regional resources).
  8629. Region string `json:"region,omitempty"`
  8630. // SelfLink: [Output Only] The URL for this instance group. The server
  8631. // generates this URL.
  8632. SelfLink string `json:"selfLink,omitempty"`
  8633. // Size: [Output Only] The total number of instances in the instance
  8634. // group.
  8635. Size int64 `json:"size,omitempty"`
  8636. // Subnetwork: [Output Only] The URL of the subnetwork to which all
  8637. // instances in the instance group belong.
  8638. Subnetwork string `json:"subnetwork,omitempty"`
  8639. // Zone: [Output Only] The URL of the zone where the instance group is
  8640. // located (for zonal resources).
  8641. Zone string `json:"zone,omitempty"`
  8642. // ServerResponse contains the HTTP response code and headers from the
  8643. // server.
  8644. googleapi.ServerResponse `json:"-"`
  8645. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  8646. // to unconditionally include in API requests. By default, fields with
  8647. // empty values are omitted from API requests. However, any non-pointer,
  8648. // non-interface field appearing in ForceSendFields will be sent to the
  8649. // server regardless of whether the field is empty or not. This may be
  8650. // used to include empty fields in Patch requests.
  8651. ForceSendFields []string `json:"-"`
  8652. // NullFields is a list of field names (e.g. "CreationTimestamp") to
  8653. // include in API requests with the JSON null value. By default, fields
  8654. // with empty values are omitted from API requests. However, any field
  8655. // with an empty value appearing in NullFields will be sent to the
  8656. // server as null. It is an error if a field in this list has a
  8657. // non-empty value. This may be used to include null fields in Patch
  8658. // requests.
  8659. NullFields []string `json:"-"`
  8660. }
  8661. func (s *InstanceGroup) MarshalJSON() ([]byte, error) {
  8662. type NoMethod InstanceGroup
  8663. raw := NoMethod(*s)
  8664. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8665. }
  8666. type InstanceGroupAggregatedList struct {
  8667. // Id: [Output Only] Unique identifier for the resource; defined by the
  8668. // server.
  8669. Id string `json:"id,omitempty"`
  8670. // Items: A list of InstanceGroupsScopedList resources.
  8671. Items map[string]InstanceGroupsScopedList `json:"items,omitempty"`
  8672. // Kind: [Output Only] The resource type, which is always
  8673. // compute#instanceGroupAggregatedList for aggregated lists of instance
  8674. // groups.
  8675. Kind string `json:"kind,omitempty"`
  8676. // NextPageToken: [Output Only] This token allows you to get the next
  8677. // page of results for list requests. If the number of results is larger
  8678. // than maxResults, use the nextPageToken as a value for the query
  8679. // parameter pageToken in the next list request. Subsequent list
  8680. // requests will have their own nextPageToken to continue paging through
  8681. // the results.
  8682. NextPageToken string `json:"nextPageToken,omitempty"`
  8683. // SelfLink: [Output Only] Server-defined URL for this resource.
  8684. SelfLink string `json:"selfLink,omitempty"`
  8685. // Warning: [Output Only] Informational warning message.
  8686. Warning *InstanceGroupAggregatedListWarning `json:"warning,omitempty"`
  8687. // ServerResponse contains the HTTP response code and headers from the
  8688. // server.
  8689. googleapi.ServerResponse `json:"-"`
  8690. // ForceSendFields is a list of field names (e.g. "Id") to
  8691. // unconditionally include in API requests. By default, fields with
  8692. // empty values are omitted from API requests. However, any non-pointer,
  8693. // non-interface field appearing in ForceSendFields will be sent to the
  8694. // server regardless of whether the field is empty or not. This may be
  8695. // used to include empty fields in Patch requests.
  8696. ForceSendFields []string `json:"-"`
  8697. // NullFields is a list of field names (e.g. "Id") to include in API
  8698. // requests with the JSON null value. By default, fields with empty
  8699. // values are omitted from API requests. However, any field with an
  8700. // empty value appearing in NullFields will be sent to the server as
  8701. // null. It is an error if a field in this list has a non-empty value.
  8702. // This may be used to include null fields in Patch requests.
  8703. NullFields []string `json:"-"`
  8704. }
  8705. func (s *InstanceGroupAggregatedList) MarshalJSON() ([]byte, error) {
  8706. type NoMethod InstanceGroupAggregatedList
  8707. raw := NoMethod(*s)
  8708. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8709. }
  8710. // InstanceGroupAggregatedListWarning: [Output Only] Informational
  8711. // warning message.
  8712. type InstanceGroupAggregatedListWarning struct {
  8713. // Code: [Output Only] A warning code, if applicable. For example,
  8714. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  8715. // the response.
  8716. //
  8717. // Possible values:
  8718. // "CLEANUP_FAILED"
  8719. // "DEPRECATED_RESOURCE_USED"
  8720. // "DEPRECATED_TYPE_USED"
  8721. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  8722. // "EXPERIMENTAL_TYPE_USED"
  8723. // "EXTERNAL_API_WARNING"
  8724. // "FIELD_VALUE_OVERRIDEN"
  8725. // "INJECTED_KERNELS_DEPRECATED"
  8726. // "MISSING_TYPE_DEPENDENCY"
  8727. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  8728. // "NEXT_HOP_CANNOT_IP_FORWARD"
  8729. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  8730. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  8731. // "NEXT_HOP_NOT_RUNNING"
  8732. // "NOT_CRITICAL_ERROR"
  8733. // "NO_RESULTS_ON_PAGE"
  8734. // "REQUIRED_TOS_AGREEMENT"
  8735. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  8736. // "RESOURCE_NOT_DELETED"
  8737. // "SCHEMA_VALIDATION_IGNORED"
  8738. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  8739. // "UNDECLARED_PROPERTIES"
  8740. // "UNREACHABLE"
  8741. Code string `json:"code,omitempty"`
  8742. // Data: [Output Only] Metadata about this warning in key: value format.
  8743. // For example:
  8744. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  8745. Data []*InstanceGroupAggregatedListWarningData `json:"data,omitempty"`
  8746. // Message: [Output Only] A human-readable description of the warning
  8747. // code.
  8748. Message string `json:"message,omitempty"`
  8749. // ForceSendFields is a list of field names (e.g. "Code") to
  8750. // unconditionally include in API requests. By default, fields with
  8751. // empty values are omitted from API requests. However, any non-pointer,
  8752. // non-interface field appearing in ForceSendFields will be sent to the
  8753. // server regardless of whether the field is empty or not. This may be
  8754. // used to include empty fields in Patch requests.
  8755. ForceSendFields []string `json:"-"`
  8756. // NullFields is a list of field names (e.g. "Code") to include in API
  8757. // requests with the JSON null value. By default, fields with empty
  8758. // values are omitted from API requests. However, any field with an
  8759. // empty value appearing in NullFields will be sent to the server as
  8760. // null. It is an error if a field in this list has a non-empty value.
  8761. // This may be used to include null fields in Patch requests.
  8762. NullFields []string `json:"-"`
  8763. }
  8764. func (s *InstanceGroupAggregatedListWarning) MarshalJSON() ([]byte, error) {
  8765. type NoMethod InstanceGroupAggregatedListWarning
  8766. raw := NoMethod(*s)
  8767. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8768. }
  8769. type InstanceGroupAggregatedListWarningData struct {
  8770. // Key: [Output Only] A key that provides more detail on the warning
  8771. // being returned. For example, for warnings where there are no results
  8772. // in a list request for a particular zone, this key might be scope and
  8773. // the key value might be the zone name. Other examples might be a key
  8774. // indicating a deprecated resource and a suggested replacement, or a
  8775. // warning about invalid network settings (for example, if an instance
  8776. // attempts to perform IP forwarding but is not enabled for IP
  8777. // forwarding).
  8778. Key string `json:"key,omitempty"`
  8779. // Value: [Output Only] A warning data value corresponding to the key.
  8780. Value string `json:"value,omitempty"`
  8781. // ForceSendFields is a list of field names (e.g. "Key") to
  8782. // unconditionally include in API requests. By default, fields with
  8783. // empty values are omitted from API requests. However, any non-pointer,
  8784. // non-interface field appearing in ForceSendFields will be sent to the
  8785. // server regardless of whether the field is empty or not. This may be
  8786. // used to include empty fields in Patch requests.
  8787. ForceSendFields []string `json:"-"`
  8788. // NullFields is a list of field names (e.g. "Key") to include in API
  8789. // requests with the JSON null value. By default, fields with empty
  8790. // values are omitted from API requests. However, any field with an
  8791. // empty value appearing in NullFields will be sent to the server as
  8792. // null. It is an error if a field in this list has a non-empty value.
  8793. // This may be used to include null fields in Patch requests.
  8794. NullFields []string `json:"-"`
  8795. }
  8796. func (s *InstanceGroupAggregatedListWarningData) MarshalJSON() ([]byte, error) {
  8797. type NoMethod InstanceGroupAggregatedListWarningData
  8798. raw := NoMethod(*s)
  8799. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8800. }
  8801. // InstanceGroupList: A list of InstanceGroup resources.
  8802. type InstanceGroupList struct {
  8803. // Id: [Output Only] Unique identifier for the resource; defined by the
  8804. // server.
  8805. Id string `json:"id,omitempty"`
  8806. // Items: A list of InstanceGroup resources.
  8807. Items []*InstanceGroup `json:"items,omitempty"`
  8808. // Kind: [Output Only] The resource type, which is always
  8809. // compute#instanceGroupList for instance group lists.
  8810. Kind string `json:"kind,omitempty"`
  8811. // NextPageToken: [Output Only] This token allows you to get the next
  8812. // page of results for list requests. If the number of results is larger
  8813. // than maxResults, use the nextPageToken as a value for the query
  8814. // parameter pageToken in the next list request. Subsequent list
  8815. // requests will have their own nextPageToken to continue paging through
  8816. // the results.
  8817. NextPageToken string `json:"nextPageToken,omitempty"`
  8818. // SelfLink: [Output Only] Server-defined URL for this resource.
  8819. SelfLink string `json:"selfLink,omitempty"`
  8820. // Warning: [Output Only] Informational warning message.
  8821. Warning *InstanceGroupListWarning `json:"warning,omitempty"`
  8822. // ServerResponse contains the HTTP response code and headers from the
  8823. // server.
  8824. googleapi.ServerResponse `json:"-"`
  8825. // ForceSendFields is a list of field names (e.g. "Id") to
  8826. // unconditionally include in API requests. By default, fields with
  8827. // empty values are omitted from API requests. However, any non-pointer,
  8828. // non-interface field appearing in ForceSendFields will be sent to the
  8829. // server regardless of whether the field is empty or not. This may be
  8830. // used to include empty fields in Patch requests.
  8831. ForceSendFields []string `json:"-"`
  8832. // NullFields is a list of field names (e.g. "Id") to include in API
  8833. // requests with the JSON null value. By default, fields with empty
  8834. // values are omitted from API requests. However, any field with an
  8835. // empty value appearing in NullFields will be sent to the server as
  8836. // null. It is an error if a field in this list has a non-empty value.
  8837. // This may be used to include null fields in Patch requests.
  8838. NullFields []string `json:"-"`
  8839. }
  8840. func (s *InstanceGroupList) MarshalJSON() ([]byte, error) {
  8841. type NoMethod InstanceGroupList
  8842. raw := NoMethod(*s)
  8843. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8844. }
  8845. // InstanceGroupListWarning: [Output Only] Informational warning
  8846. // message.
  8847. type InstanceGroupListWarning struct {
  8848. // Code: [Output Only] A warning code, if applicable. For example,
  8849. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  8850. // the response.
  8851. //
  8852. // Possible values:
  8853. // "CLEANUP_FAILED"
  8854. // "DEPRECATED_RESOURCE_USED"
  8855. // "DEPRECATED_TYPE_USED"
  8856. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  8857. // "EXPERIMENTAL_TYPE_USED"
  8858. // "EXTERNAL_API_WARNING"
  8859. // "FIELD_VALUE_OVERRIDEN"
  8860. // "INJECTED_KERNELS_DEPRECATED"
  8861. // "MISSING_TYPE_DEPENDENCY"
  8862. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  8863. // "NEXT_HOP_CANNOT_IP_FORWARD"
  8864. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  8865. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  8866. // "NEXT_HOP_NOT_RUNNING"
  8867. // "NOT_CRITICAL_ERROR"
  8868. // "NO_RESULTS_ON_PAGE"
  8869. // "REQUIRED_TOS_AGREEMENT"
  8870. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  8871. // "RESOURCE_NOT_DELETED"
  8872. // "SCHEMA_VALIDATION_IGNORED"
  8873. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  8874. // "UNDECLARED_PROPERTIES"
  8875. // "UNREACHABLE"
  8876. Code string `json:"code,omitempty"`
  8877. // Data: [Output Only] Metadata about this warning in key: value format.
  8878. // For example:
  8879. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  8880. Data []*InstanceGroupListWarningData `json:"data,omitempty"`
  8881. // Message: [Output Only] A human-readable description of the warning
  8882. // code.
  8883. Message string `json:"message,omitempty"`
  8884. // ForceSendFields is a list of field names (e.g. "Code") to
  8885. // unconditionally include in API requests. By default, fields with
  8886. // empty values are omitted from API requests. However, any non-pointer,
  8887. // non-interface field appearing in ForceSendFields will be sent to the
  8888. // server regardless of whether the field is empty or not. This may be
  8889. // used to include empty fields in Patch requests.
  8890. ForceSendFields []string `json:"-"`
  8891. // NullFields is a list of field names (e.g. "Code") to include in API
  8892. // requests with the JSON null value. By default, fields with empty
  8893. // values are omitted from API requests. However, any field with an
  8894. // empty value appearing in NullFields will be sent to the server as
  8895. // null. It is an error if a field in this list has a non-empty value.
  8896. // This may be used to include null fields in Patch requests.
  8897. NullFields []string `json:"-"`
  8898. }
  8899. func (s *InstanceGroupListWarning) MarshalJSON() ([]byte, error) {
  8900. type NoMethod InstanceGroupListWarning
  8901. raw := NoMethod(*s)
  8902. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8903. }
  8904. type InstanceGroupListWarningData struct {
  8905. // Key: [Output Only] A key that provides more detail on the warning
  8906. // being returned. For example, for warnings where there are no results
  8907. // in a list request for a particular zone, this key might be scope and
  8908. // the key value might be the zone name. Other examples might be a key
  8909. // indicating a deprecated resource and a suggested replacement, or a
  8910. // warning about invalid network settings (for example, if an instance
  8911. // attempts to perform IP forwarding but is not enabled for IP
  8912. // forwarding).
  8913. Key string `json:"key,omitempty"`
  8914. // Value: [Output Only] A warning data value corresponding to the key.
  8915. Value string `json:"value,omitempty"`
  8916. // ForceSendFields is a list of field names (e.g. "Key") to
  8917. // unconditionally include in API requests. By default, fields with
  8918. // empty values are omitted from API requests. However, any non-pointer,
  8919. // non-interface field appearing in ForceSendFields will be sent to the
  8920. // server regardless of whether the field is empty or not. This may be
  8921. // used to include empty fields in Patch requests.
  8922. ForceSendFields []string `json:"-"`
  8923. // NullFields is a list of field names (e.g. "Key") to include in API
  8924. // requests with the JSON null value. By default, fields with empty
  8925. // values are omitted from API requests. However, any field with an
  8926. // empty value appearing in NullFields will be sent to the server as
  8927. // null. It is an error if a field in this list has a non-empty value.
  8928. // This may be used to include null fields in Patch requests.
  8929. NullFields []string `json:"-"`
  8930. }
  8931. func (s *InstanceGroupListWarningData) MarshalJSON() ([]byte, error) {
  8932. type NoMethod InstanceGroupListWarningData
  8933. raw := NoMethod(*s)
  8934. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8935. }
  8936. // InstanceGroupManager: An Instance Group Manager resource. (==
  8937. // resource_for beta.instanceGroupManagers ==) (== resource_for
  8938. // v1.instanceGroupManagers ==) (== resource_for
  8939. // beta.regionInstanceGroupManagers ==) (== resource_for
  8940. // v1.regionInstanceGroupManagers ==)
  8941. type InstanceGroupManager struct {
  8942. // AutoHealingPolicies: The autohealing policy for this managed instance
  8943. // group. You can specify only one value.
  8944. AutoHealingPolicies []*InstanceGroupManagerAutoHealingPolicy `json:"autoHealingPolicies,omitempty"`
  8945. // BaseInstanceName: The base instance name to use for instances in this
  8946. // group. The value must be 1-58 characters long. Instances are named by
  8947. // appending a hyphen and a random four-character string to the base
  8948. // instance name. The base instance name must comply with RFC1035.
  8949. BaseInstanceName string `json:"baseInstanceName,omitempty"`
  8950. // CreationTimestamp: [Output Only] The creation timestamp for this
  8951. // managed instance group in RFC3339 text format.
  8952. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  8953. // CurrentActions: [Output Only] The list of instance actions and the
  8954. // number of instances in this managed instance group that are scheduled
  8955. // for each of those actions.
  8956. CurrentActions *InstanceGroupManagerActionsSummary `json:"currentActions,omitempty"`
  8957. // Description: An optional description of this resource. Provide this
  8958. // property when you create the resource.
  8959. Description string `json:"description,omitempty"`
  8960. // DistributionPolicy: Policy valid only for regional managed instance
  8961. // groups.
  8962. DistributionPolicy *DistributionPolicy `json:"distributionPolicy,omitempty"`
  8963. // FailoverAction: The action to perform in case of zone failure. Only
  8964. // one value is supported, NO_FAILOVER. The default is NO_FAILOVER.
  8965. //
  8966. // Possible values:
  8967. // "NO_FAILOVER"
  8968. // "UNKNOWN"
  8969. FailoverAction string `json:"failoverAction,omitempty"`
  8970. // Fingerprint: Fingerprint of this resource. This field may be used in
  8971. // optimistic locking. It will be ignored when inserting an
  8972. // InstanceGroupManager. An up-to-date fingerprint must be provided in
  8973. // order to update the InstanceGroupManager.
  8974. Fingerprint string `json:"fingerprint,omitempty"`
  8975. // Id: [Output Only] A unique identifier for this resource type. The
  8976. // server generates this identifier.
  8977. Id uint64 `json:"id,omitempty,string"`
  8978. // InstanceGroup: [Output Only] The URL of the Instance Group resource.
  8979. InstanceGroup string `json:"instanceGroup,omitempty"`
  8980. // InstanceTemplate: The URL of the instance template that is specified
  8981. // for this managed instance group. The group uses this template to
  8982. // create all new instances in the managed instance group.
  8983. InstanceTemplate string `json:"instanceTemplate,omitempty"`
  8984. // Kind: [Output Only] The resource type, which is always
  8985. // compute#instanceGroupManager for managed instance groups.
  8986. Kind string `json:"kind,omitempty"`
  8987. // Name: The name of the managed instance group. The name must be 1-63
  8988. // characters long, and comply with RFC1035.
  8989. Name string `json:"name,omitempty"`
  8990. // NamedPorts: Named ports configured for the Instance Groups
  8991. // complementary to this Instance Group Manager.
  8992. NamedPorts []*NamedPort `json:"namedPorts,omitempty"`
  8993. // PendingActions: [Output Only] The list of instance actions and the
  8994. // number of instances in this managed instance group that are pending
  8995. // for each of those actions.
  8996. PendingActions *InstanceGroupManagerPendingActionsSummary `json:"pendingActions,omitempty"`
  8997. // Region: [Output Only] The URL of the region where the managed
  8998. // instance group resides (for regional resources).
  8999. Region string `json:"region,omitempty"`
  9000. // SelfLink: [Output Only] The URL for this managed instance group. The
  9001. // server defines this URL.
  9002. SelfLink string `json:"selfLink,omitempty"`
  9003. // ServiceAccount: The service account to be used as credentials for all
  9004. // operations performed by the managed instance group on instances. The
  9005. // service accounts needs all permissions required to create and delete
  9006. // instances. By default, the service account
  9007. // {projectNumber}@cloudservices.gserviceaccount.com is used.
  9008. ServiceAccount string `json:"serviceAccount,omitempty"`
  9009. // TargetPools: The URLs for all TargetPool resources to which instances
  9010. // in the instanceGroup field are added. The target pools automatically
  9011. // apply to all of the instances in the managed instance group.
  9012. TargetPools []string `json:"targetPools,omitempty"`
  9013. // TargetSize: The target number of running instances for this managed
  9014. // instance group. Deleting or abandoning instances reduces this number.
  9015. // Resizing the group changes this number.
  9016. TargetSize int64 `json:"targetSize,omitempty"`
  9017. // UpdatePolicy: The update policy for this managed instance group.
  9018. UpdatePolicy *InstanceGroupManagerUpdatePolicy `json:"updatePolicy,omitempty"`
  9019. // Versions: Specifies the instance templates used by this managed
  9020. // instance group to create instances.
  9021. //
  9022. // Each version is defined by an instanceTemplate. Every template can
  9023. // appear at most once per instance group. This field overrides the
  9024. // top-level instanceTemplate field. Read more about the relationships
  9025. // between these fields. Exactly one version must leave the targetSize
  9026. // field unset. That version will be applied to all remaining instances.
  9027. // For more information, read about canary updates.
  9028. Versions []*InstanceGroupManagerVersion `json:"versions,omitempty"`
  9029. // Zone: [Output Only] The URL of the zone where the managed instance
  9030. // group is located (for zonal resources).
  9031. Zone string `json:"zone,omitempty"`
  9032. // ServerResponse contains the HTTP response code and headers from the
  9033. // server.
  9034. googleapi.ServerResponse `json:"-"`
  9035. // ForceSendFields is a list of field names (e.g. "AutoHealingPolicies")
  9036. // to unconditionally include in API requests. By default, fields with
  9037. // empty values are omitted from API requests. However, any non-pointer,
  9038. // non-interface field appearing in ForceSendFields will be sent to the
  9039. // server regardless of whether the field is empty or not. This may be
  9040. // used to include empty fields in Patch requests.
  9041. ForceSendFields []string `json:"-"`
  9042. // NullFields is a list of field names (e.g. "AutoHealingPolicies") to
  9043. // include in API requests with the JSON null value. By default, fields
  9044. // with empty values are omitted from API requests. However, any field
  9045. // with an empty value appearing in NullFields will be sent to the
  9046. // server as null. It is an error if a field in this list has a
  9047. // non-empty value. This may be used to include null fields in Patch
  9048. // requests.
  9049. NullFields []string `json:"-"`
  9050. }
  9051. func (s *InstanceGroupManager) MarshalJSON() ([]byte, error) {
  9052. type NoMethod InstanceGroupManager
  9053. raw := NoMethod(*s)
  9054. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9055. }
  9056. type InstanceGroupManagerActionsSummary struct {
  9057. // Abandoning: [Output Only] The total number of instances in the
  9058. // managed instance group that are scheduled to be abandoned. Abandoning
  9059. // an instance removes it from the managed instance group without
  9060. // deleting it.
  9061. Abandoning int64 `json:"abandoning,omitempty"`
  9062. // Creating: [Output Only] The number of instances in the managed
  9063. // instance group that are scheduled to be created or are currently
  9064. // being created. If the group fails to create any of these instances,
  9065. // it tries again until it creates the instance successfully.
  9066. //
  9067. // If you have disabled creation retries, this field will not be
  9068. // populated; instead, the creatingWithoutRetries field will be
  9069. // populated.
  9070. Creating int64 `json:"creating,omitempty"`
  9071. // CreatingWithoutRetries: [Output Only] The number of instances that
  9072. // the managed instance group will attempt to create. The group attempts
  9073. // to create each instance only once. If the group fails to create any
  9074. // of these instances, it decreases the group's targetSize value
  9075. // accordingly.
  9076. CreatingWithoutRetries int64 `json:"creatingWithoutRetries,omitempty"`
  9077. // Deleting: [Output Only] The number of instances in the managed
  9078. // instance group that are scheduled to be deleted or are currently
  9079. // being deleted.
  9080. Deleting int64 `json:"deleting,omitempty"`
  9081. // None: [Output Only] The number of instances in the managed instance
  9082. // group that are running and have no scheduled actions.
  9083. None int64 `json:"none,omitempty"`
  9084. // Recreating: [Output Only] The number of instances in the managed
  9085. // instance group that are scheduled to be recreated or are currently
  9086. // being being recreated. Recreating an instance deletes the existing
  9087. // root persistent disk and creates a new disk from the image that is
  9088. // defined in the instance template.
  9089. Recreating int64 `json:"recreating,omitempty"`
  9090. // Refreshing: [Output Only] The number of instances in the managed
  9091. // instance group that are being reconfigured with properties that do
  9092. // not require a restart or a recreate action. For example, setting or
  9093. // removing target pools for the instance.
  9094. Refreshing int64 `json:"refreshing,omitempty"`
  9095. // Restarting: [Output Only] The number of instances in the managed
  9096. // instance group that are scheduled to be restarted or are currently
  9097. // being restarted.
  9098. Restarting int64 `json:"restarting,omitempty"`
  9099. // Verifying: [Output Only] The number of instances in the managed
  9100. // instance group that are being verified. See the
  9101. // managedInstances[].currentAction property in the listManagedInstances
  9102. // method documentation.
  9103. Verifying int64 `json:"verifying,omitempty"`
  9104. // ForceSendFields is a list of field names (e.g. "Abandoning") to
  9105. // unconditionally include in API requests. By default, fields with
  9106. // empty values are omitted from API requests. However, any non-pointer,
  9107. // non-interface field appearing in ForceSendFields will be sent to the
  9108. // server regardless of whether the field is empty or not. This may be
  9109. // used to include empty fields in Patch requests.
  9110. ForceSendFields []string `json:"-"`
  9111. // NullFields is a list of field names (e.g. "Abandoning") to include in
  9112. // API requests with the JSON null value. By default, fields with empty
  9113. // values are omitted from API requests. However, any field with an
  9114. // empty value appearing in NullFields will be sent to the server as
  9115. // null. It is an error if a field in this list has a non-empty value.
  9116. // This may be used to include null fields in Patch requests.
  9117. NullFields []string `json:"-"`
  9118. }
  9119. func (s *InstanceGroupManagerActionsSummary) MarshalJSON() ([]byte, error) {
  9120. type NoMethod InstanceGroupManagerActionsSummary
  9121. raw := NoMethod(*s)
  9122. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9123. }
  9124. type InstanceGroupManagerAggregatedList struct {
  9125. // Id: [Output Only] Unique identifier for the resource; defined by the
  9126. // server.
  9127. Id string `json:"id,omitempty"`
  9128. // Items: A list of InstanceGroupManagersScopedList resources.
  9129. Items map[string]InstanceGroupManagersScopedList `json:"items,omitempty"`
  9130. // Kind: [Output Only] The resource type, which is always
  9131. // compute#instanceGroupManagerAggregatedList for an aggregated list of
  9132. // managed instance groups.
  9133. Kind string `json:"kind,omitempty"`
  9134. // NextPageToken: [Output Only] This token allows you to get the next
  9135. // page of results for list requests. If the number of results is larger
  9136. // than maxResults, use the nextPageToken as a value for the query
  9137. // parameter pageToken in the next list request. Subsequent list
  9138. // requests will have their own nextPageToken to continue paging through
  9139. // the results.
  9140. NextPageToken string `json:"nextPageToken,omitempty"`
  9141. // SelfLink: [Output Only] Server-defined URL for this resource.
  9142. SelfLink string `json:"selfLink,omitempty"`
  9143. // Warning: [Output Only] Informational warning message.
  9144. Warning *InstanceGroupManagerAggregatedListWarning `json:"warning,omitempty"`
  9145. // ServerResponse contains the HTTP response code and headers from the
  9146. // server.
  9147. googleapi.ServerResponse `json:"-"`
  9148. // ForceSendFields is a list of field names (e.g. "Id") to
  9149. // unconditionally include in API requests. By default, fields with
  9150. // empty values are omitted from API requests. However, any non-pointer,
  9151. // non-interface field appearing in ForceSendFields will be sent to the
  9152. // server regardless of whether the field is empty or not. This may be
  9153. // used to include empty fields in Patch requests.
  9154. ForceSendFields []string `json:"-"`
  9155. // NullFields is a list of field names (e.g. "Id") to include in API
  9156. // requests with the JSON null value. By default, fields with empty
  9157. // values are omitted from API requests. However, any field with an
  9158. // empty value appearing in NullFields will be sent to the server as
  9159. // null. It is an error if a field in this list has a non-empty value.
  9160. // This may be used to include null fields in Patch requests.
  9161. NullFields []string `json:"-"`
  9162. }
  9163. func (s *InstanceGroupManagerAggregatedList) MarshalJSON() ([]byte, error) {
  9164. type NoMethod InstanceGroupManagerAggregatedList
  9165. raw := NoMethod(*s)
  9166. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9167. }
  9168. // InstanceGroupManagerAggregatedListWarning: [Output Only]
  9169. // Informational warning message.
  9170. type InstanceGroupManagerAggregatedListWarning struct {
  9171. // Code: [Output Only] A warning code, if applicable. For example,
  9172. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  9173. // the response.
  9174. //
  9175. // Possible values:
  9176. // "CLEANUP_FAILED"
  9177. // "DEPRECATED_RESOURCE_USED"
  9178. // "DEPRECATED_TYPE_USED"
  9179. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  9180. // "EXPERIMENTAL_TYPE_USED"
  9181. // "EXTERNAL_API_WARNING"
  9182. // "FIELD_VALUE_OVERRIDEN"
  9183. // "INJECTED_KERNELS_DEPRECATED"
  9184. // "MISSING_TYPE_DEPENDENCY"
  9185. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  9186. // "NEXT_HOP_CANNOT_IP_FORWARD"
  9187. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  9188. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  9189. // "NEXT_HOP_NOT_RUNNING"
  9190. // "NOT_CRITICAL_ERROR"
  9191. // "NO_RESULTS_ON_PAGE"
  9192. // "REQUIRED_TOS_AGREEMENT"
  9193. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  9194. // "RESOURCE_NOT_DELETED"
  9195. // "SCHEMA_VALIDATION_IGNORED"
  9196. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  9197. // "UNDECLARED_PROPERTIES"
  9198. // "UNREACHABLE"
  9199. Code string `json:"code,omitempty"`
  9200. // Data: [Output Only] Metadata about this warning in key: value format.
  9201. // For example:
  9202. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  9203. Data []*InstanceGroupManagerAggregatedListWarningData `json:"data,omitempty"`
  9204. // Message: [Output Only] A human-readable description of the warning
  9205. // code.
  9206. Message string `json:"message,omitempty"`
  9207. // ForceSendFields is a list of field names (e.g. "Code") to
  9208. // unconditionally include in API requests. By default, fields with
  9209. // empty values are omitted from API requests. However, any non-pointer,
  9210. // non-interface field appearing in ForceSendFields will be sent to the
  9211. // server regardless of whether the field is empty or not. This may be
  9212. // used to include empty fields in Patch requests.
  9213. ForceSendFields []string `json:"-"`
  9214. // NullFields is a list of field names (e.g. "Code") to include in API
  9215. // requests with the JSON null value. By default, fields with empty
  9216. // values are omitted from API requests. However, any field with an
  9217. // empty value appearing in NullFields will be sent to the server as
  9218. // null. It is an error if a field in this list has a non-empty value.
  9219. // This may be used to include null fields in Patch requests.
  9220. NullFields []string `json:"-"`
  9221. }
  9222. func (s *InstanceGroupManagerAggregatedListWarning) MarshalJSON() ([]byte, error) {
  9223. type NoMethod InstanceGroupManagerAggregatedListWarning
  9224. raw := NoMethod(*s)
  9225. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9226. }
  9227. type InstanceGroupManagerAggregatedListWarningData struct {
  9228. // Key: [Output Only] A key that provides more detail on the warning
  9229. // being returned. For example, for warnings where there are no results
  9230. // in a list request for a particular zone, this key might be scope and
  9231. // the key value might be the zone name. Other examples might be a key
  9232. // indicating a deprecated resource and a suggested replacement, or a
  9233. // warning about invalid network settings (for example, if an instance
  9234. // attempts to perform IP forwarding but is not enabled for IP
  9235. // forwarding).
  9236. Key string `json:"key,omitempty"`
  9237. // Value: [Output Only] A warning data value corresponding to the key.
  9238. Value string `json:"value,omitempty"`
  9239. // ForceSendFields is a list of field names (e.g. "Key") to
  9240. // unconditionally include in API requests. By default, fields with
  9241. // empty values are omitted from API requests. However, any non-pointer,
  9242. // non-interface field appearing in ForceSendFields will be sent to the
  9243. // server regardless of whether the field is empty or not. This may be
  9244. // used to include empty fields in Patch requests.
  9245. ForceSendFields []string `json:"-"`
  9246. // NullFields is a list of field names (e.g. "Key") to include in API
  9247. // requests with the JSON null value. By default, fields with empty
  9248. // values are omitted from API requests. However, any field with an
  9249. // empty value appearing in NullFields will be sent to the server as
  9250. // null. It is an error if a field in this list has a non-empty value.
  9251. // This may be used to include null fields in Patch requests.
  9252. NullFields []string `json:"-"`
  9253. }
  9254. func (s *InstanceGroupManagerAggregatedListWarningData) MarshalJSON() ([]byte, error) {
  9255. type NoMethod InstanceGroupManagerAggregatedListWarningData
  9256. raw := NoMethod(*s)
  9257. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9258. }
  9259. type InstanceGroupManagerAutoHealingPolicy struct {
  9260. // HealthCheck: The URL for the health check that signals autohealing.
  9261. HealthCheck string `json:"healthCheck,omitempty"`
  9262. // InitialDelaySec: The number of seconds that the managed instance
  9263. // group waits before it applies autohealing policies to new instances
  9264. // or recently recreated instances. This initial delay allows instances
  9265. // to initialize and run their startup scripts before the instance group
  9266. // determines that they are UNHEALTHY. This prevents the managed
  9267. // instance group from recreating its instances prematurely. This value
  9268. // must be from range [0, 3600].
  9269. InitialDelaySec int64 `json:"initialDelaySec,omitempty"`
  9270. // ForceSendFields is a list of field names (e.g. "HealthCheck") to
  9271. // unconditionally include in API requests. By default, fields with
  9272. // empty values are omitted from API requests. However, any non-pointer,
  9273. // non-interface field appearing in ForceSendFields will be sent to the
  9274. // server regardless of whether the field is empty or not. This may be
  9275. // used to include empty fields in Patch requests.
  9276. ForceSendFields []string `json:"-"`
  9277. // NullFields is a list of field names (e.g. "HealthCheck") to include
  9278. // in API requests with the JSON null value. By default, fields with
  9279. // empty values are omitted from API requests. However, any field with
  9280. // an empty value appearing in NullFields will be sent to the server as
  9281. // null. It is an error if a field in this list has a non-empty value.
  9282. // This may be used to include null fields in Patch requests.
  9283. NullFields []string `json:"-"`
  9284. }
  9285. func (s *InstanceGroupManagerAutoHealingPolicy) MarshalJSON() ([]byte, error) {
  9286. type NoMethod InstanceGroupManagerAutoHealingPolicy
  9287. raw := NoMethod(*s)
  9288. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9289. }
  9290. // InstanceGroupManagerList: [Output Only] A list of managed instance
  9291. // groups.
  9292. type InstanceGroupManagerList struct {
  9293. // Id: [Output Only] Unique identifier for the resource; defined by the
  9294. // server.
  9295. Id string `json:"id,omitempty"`
  9296. // Items: A list of InstanceGroupManager resources.
  9297. Items []*InstanceGroupManager `json:"items,omitempty"`
  9298. // Kind: [Output Only] The resource type, which is always
  9299. // compute#instanceGroupManagerList for a list of managed instance
  9300. // groups.
  9301. Kind string `json:"kind,omitempty"`
  9302. // NextPageToken: [Output Only] This token allows you to get the next
  9303. // page of results for list requests. If the number of results is larger
  9304. // than maxResults, use the nextPageToken as a value for the query
  9305. // parameter pageToken in the next list request. Subsequent list
  9306. // requests will have their own nextPageToken to continue paging through
  9307. // the results.
  9308. NextPageToken string `json:"nextPageToken,omitempty"`
  9309. // SelfLink: [Output Only] Server-defined URL for this resource.
  9310. SelfLink string `json:"selfLink,omitempty"`
  9311. // Warning: [Output Only] Informational warning message.
  9312. Warning *InstanceGroupManagerListWarning `json:"warning,omitempty"`
  9313. // ServerResponse contains the HTTP response code and headers from the
  9314. // server.
  9315. googleapi.ServerResponse `json:"-"`
  9316. // ForceSendFields is a list of field names (e.g. "Id") to
  9317. // unconditionally include in API requests. By default, fields with
  9318. // empty values are omitted from API requests. However, any non-pointer,
  9319. // non-interface field appearing in ForceSendFields will be sent to the
  9320. // server regardless of whether the field is empty or not. This may be
  9321. // used to include empty fields in Patch requests.
  9322. ForceSendFields []string `json:"-"`
  9323. // NullFields is a list of field names (e.g. "Id") to include in API
  9324. // requests with the JSON null value. By default, fields with empty
  9325. // values are omitted from API requests. However, any field with an
  9326. // empty value appearing in NullFields will be sent to the server as
  9327. // null. It is an error if a field in this list has a non-empty value.
  9328. // This may be used to include null fields in Patch requests.
  9329. NullFields []string `json:"-"`
  9330. }
  9331. func (s *InstanceGroupManagerList) MarshalJSON() ([]byte, error) {
  9332. type NoMethod InstanceGroupManagerList
  9333. raw := NoMethod(*s)
  9334. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9335. }
  9336. // InstanceGroupManagerListWarning: [Output Only] Informational warning
  9337. // message.
  9338. type InstanceGroupManagerListWarning struct {
  9339. // Code: [Output Only] A warning code, if applicable. For example,
  9340. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  9341. // the response.
  9342. //
  9343. // Possible values:
  9344. // "CLEANUP_FAILED"
  9345. // "DEPRECATED_RESOURCE_USED"
  9346. // "DEPRECATED_TYPE_USED"
  9347. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  9348. // "EXPERIMENTAL_TYPE_USED"
  9349. // "EXTERNAL_API_WARNING"
  9350. // "FIELD_VALUE_OVERRIDEN"
  9351. // "INJECTED_KERNELS_DEPRECATED"
  9352. // "MISSING_TYPE_DEPENDENCY"
  9353. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  9354. // "NEXT_HOP_CANNOT_IP_FORWARD"
  9355. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  9356. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  9357. // "NEXT_HOP_NOT_RUNNING"
  9358. // "NOT_CRITICAL_ERROR"
  9359. // "NO_RESULTS_ON_PAGE"
  9360. // "REQUIRED_TOS_AGREEMENT"
  9361. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  9362. // "RESOURCE_NOT_DELETED"
  9363. // "SCHEMA_VALIDATION_IGNORED"
  9364. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  9365. // "UNDECLARED_PROPERTIES"
  9366. // "UNREACHABLE"
  9367. Code string `json:"code,omitempty"`
  9368. // Data: [Output Only] Metadata about this warning in key: value format.
  9369. // For example:
  9370. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  9371. Data []*InstanceGroupManagerListWarningData `json:"data,omitempty"`
  9372. // Message: [Output Only] A human-readable description of the warning
  9373. // code.
  9374. Message string `json:"message,omitempty"`
  9375. // ForceSendFields is a list of field names (e.g. "Code") to
  9376. // unconditionally include in API requests. By default, fields with
  9377. // empty values are omitted from API requests. However, any non-pointer,
  9378. // non-interface field appearing in ForceSendFields will be sent to the
  9379. // server regardless of whether the field is empty or not. This may be
  9380. // used to include empty fields in Patch requests.
  9381. ForceSendFields []string `json:"-"`
  9382. // NullFields is a list of field names (e.g. "Code") to include in API
  9383. // requests with the JSON null value. By default, fields with empty
  9384. // values are omitted from API requests. However, any field with an
  9385. // empty value appearing in NullFields will be sent to the server as
  9386. // null. It is an error if a field in this list has a non-empty value.
  9387. // This may be used to include null fields in Patch requests.
  9388. NullFields []string `json:"-"`
  9389. }
  9390. func (s *InstanceGroupManagerListWarning) MarshalJSON() ([]byte, error) {
  9391. type NoMethod InstanceGroupManagerListWarning
  9392. raw := NoMethod(*s)
  9393. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9394. }
  9395. type InstanceGroupManagerListWarningData struct {
  9396. // Key: [Output Only] A key that provides more detail on the warning
  9397. // being returned. For example, for warnings where there are no results
  9398. // in a list request for a particular zone, this key might be scope and
  9399. // the key value might be the zone name. Other examples might be a key
  9400. // indicating a deprecated resource and a suggested replacement, or a
  9401. // warning about invalid network settings (for example, if an instance
  9402. // attempts to perform IP forwarding but is not enabled for IP
  9403. // forwarding).
  9404. Key string `json:"key,omitempty"`
  9405. // Value: [Output Only] A warning data value corresponding to the key.
  9406. Value string `json:"value,omitempty"`
  9407. // ForceSendFields is a list of field names (e.g. "Key") to
  9408. // unconditionally include in API requests. By default, fields with
  9409. // empty values are omitted from API requests. However, any non-pointer,
  9410. // non-interface field appearing in ForceSendFields will be sent to the
  9411. // server regardless of whether the field is empty or not. This may be
  9412. // used to include empty fields in Patch requests.
  9413. ForceSendFields []string `json:"-"`
  9414. // NullFields is a list of field names (e.g. "Key") to include in API
  9415. // requests with the JSON null value. By default, fields with empty
  9416. // values are omitted from API requests. However, any field with an
  9417. // empty value appearing in NullFields will be sent to the server as
  9418. // null. It is an error if a field in this list has a non-empty value.
  9419. // This may be used to include null fields in Patch requests.
  9420. NullFields []string `json:"-"`
  9421. }
  9422. func (s *InstanceGroupManagerListWarningData) MarshalJSON() ([]byte, error) {
  9423. type NoMethod InstanceGroupManagerListWarningData
  9424. raw := NoMethod(*s)
  9425. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9426. }
  9427. type InstanceGroupManagerPendingActionsSummary struct {
  9428. // Creating: [Output Only] The number of instances in the managed
  9429. // instance group that are pending to be created.
  9430. Creating int64 `json:"creating,omitempty"`
  9431. // Deleting: [Output Only] The number of instances in the managed
  9432. // instance group that are pending to be deleted.
  9433. Deleting int64 `json:"deleting,omitempty"`
  9434. // Recreating: [Output Only] The number of instances in the managed
  9435. // instance group that are pending to be recreated.
  9436. Recreating int64 `json:"recreating,omitempty"`
  9437. // Restarting: [Output Only] The number of instances in the managed
  9438. // instance group that are pending to be restarted.
  9439. Restarting int64 `json:"restarting,omitempty"`
  9440. // ForceSendFields is a list of field names (e.g. "Creating") to
  9441. // unconditionally include in API requests. By default, fields with
  9442. // empty values are omitted from API requests. However, any non-pointer,
  9443. // non-interface field appearing in ForceSendFields will be sent to the
  9444. // server regardless of whether the field is empty or not. This may be
  9445. // used to include empty fields in Patch requests.
  9446. ForceSendFields []string `json:"-"`
  9447. // NullFields is a list of field names (e.g. "Creating") to include in
  9448. // API requests with the JSON null value. By default, fields with empty
  9449. // values are omitted from API requests. However, any field with an
  9450. // empty value appearing in NullFields will be sent to the server as
  9451. // null. It is an error if a field in this list has a non-empty value.
  9452. // This may be used to include null fields in Patch requests.
  9453. NullFields []string `json:"-"`
  9454. }
  9455. func (s *InstanceGroupManagerPendingActionsSummary) MarshalJSON() ([]byte, error) {
  9456. type NoMethod InstanceGroupManagerPendingActionsSummary
  9457. raw := NoMethod(*s)
  9458. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9459. }
  9460. type InstanceGroupManagerUpdatePolicy struct {
  9461. // MaxSurge: The maximum number of instances that can be created above
  9462. // the specified targetSize during the update process. By default, a
  9463. // fixed value of 1 is used. This value can be either a fixed number or
  9464. // a percentage if the instance group has 10 or more instances. If you
  9465. // set a percentage, the number of instances will be rounded up if
  9466. // necessary.
  9467. //
  9468. // At least one of either maxSurge or maxUnavailable must be greater
  9469. // than 0. Learn more about maxSurge.
  9470. MaxSurge *FixedOrPercent `json:"maxSurge,omitempty"`
  9471. // MaxUnavailable: The maximum number of instances that can be
  9472. // unavailable during the update process. An instance is considered
  9473. // available if all of the following conditions are satisfied:
  9474. //
  9475. //
  9476. // - The instance's status is RUNNING.
  9477. // - If there is a health check on the instance group, the instance's
  9478. // liveness health check result must be HEALTHY at least once. If there
  9479. // is no health check on the group, then the instance only needs to have
  9480. // a status of RUNNING to be considered available. By default, a fixed
  9481. // value of 1 is used. This value can be either a fixed number or a
  9482. // percentage if the instance group has 10 or more instances. If you set
  9483. // a percentage, the number of instances will be rounded up if
  9484. // necessary.
  9485. //
  9486. // At least one of either maxSurge or maxUnavailable must be greater
  9487. // than 0. Learn more about maxUnavailable.
  9488. MaxUnavailable *FixedOrPercent `json:"maxUnavailable,omitempty"`
  9489. // MinReadySec: Minimum number of seconds to wait for after a newly
  9490. // created instance becomes available. This value must be from range [0,
  9491. // 3600].
  9492. MinReadySec int64 `json:"minReadySec,omitempty"`
  9493. // MinimalAction: Minimal action to be taken on an instance. You can
  9494. // specify either RESTART to restart existing instances or REPLACE to
  9495. // delete and create new instances from the target template. If you
  9496. // specify a code>RESTART, the Updater will attempt to perform that
  9497. // action only. However, if the Updater determines that the minimal
  9498. // action you specify is not enough to perform the update, it might
  9499. // perform a more disruptive action.
  9500. //
  9501. // Possible values:
  9502. // "REPLACE"
  9503. // "RESTART"
  9504. MinimalAction string `json:"minimalAction,omitempty"`
  9505. // Possible values:
  9506. // "OPPORTUNISTIC"
  9507. // "PROACTIVE"
  9508. Type string `json:"type,omitempty"`
  9509. // ForceSendFields is a list of field names (e.g. "MaxSurge") to
  9510. // unconditionally include in API requests. By default, fields with
  9511. // empty values are omitted from API requests. However, any non-pointer,
  9512. // non-interface field appearing in ForceSendFields will be sent to the
  9513. // server regardless of whether the field is empty or not. This may be
  9514. // used to include empty fields in Patch requests.
  9515. ForceSendFields []string `json:"-"`
  9516. // NullFields is a list of field names (e.g. "MaxSurge") to include in
  9517. // API requests with the JSON null value. By default, fields with empty
  9518. // values are omitted from API requests. However, any field with an
  9519. // empty value appearing in NullFields will be sent to the server as
  9520. // null. It is an error if a field in this list has a non-empty value.
  9521. // This may be used to include null fields in Patch requests.
  9522. NullFields []string `json:"-"`
  9523. }
  9524. func (s *InstanceGroupManagerUpdatePolicy) MarshalJSON() ([]byte, error) {
  9525. type NoMethod InstanceGroupManagerUpdatePolicy
  9526. raw := NoMethod(*s)
  9527. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9528. }
  9529. type InstanceGroupManagerVersion struct {
  9530. InstanceTemplate string `json:"instanceTemplate,omitempty"`
  9531. // Name: Name of the version. Unique among all versions in the scope of
  9532. // this managed instance group.
  9533. Name string `json:"name,omitempty"`
  9534. // TargetSize: Specifies the intended number of instances to be created
  9535. // from the instanceTemplate. The final number of instances created from
  9536. // the template will be equal to:
  9537. // - If expressed as a fixed number, the minimum of either
  9538. // targetSize.fixed or instanceGroupManager.targetSize is used.
  9539. // - if expressed as a percent, the targetSize would be
  9540. // (targetSize.percent/100 * InstanceGroupManager.targetSize) If there
  9541. // is a remainder, the number is rounded up. If unset, this version
  9542. // will update any remaining instances not updated by another version.
  9543. // Read Starting a canary update for more information.
  9544. TargetSize *FixedOrPercent `json:"targetSize,omitempty"`
  9545. // ForceSendFields is a list of field names (e.g. "InstanceTemplate") to
  9546. // unconditionally include in API requests. By default, fields with
  9547. // empty values are omitted from API requests. However, any non-pointer,
  9548. // non-interface field appearing in ForceSendFields will be sent to the
  9549. // server regardless of whether the field is empty or not. This may be
  9550. // used to include empty fields in Patch requests.
  9551. ForceSendFields []string `json:"-"`
  9552. // NullFields is a list of field names (e.g. "InstanceTemplate") to
  9553. // include in API requests with the JSON null value. By default, fields
  9554. // with empty values are omitted from API requests. However, any field
  9555. // with an empty value appearing in NullFields will be sent to the
  9556. // server as null. It is an error if a field in this list has a
  9557. // non-empty value. This may be used to include null fields in Patch
  9558. // requests.
  9559. NullFields []string `json:"-"`
  9560. }
  9561. func (s *InstanceGroupManagerVersion) MarshalJSON() ([]byte, error) {
  9562. type NoMethod InstanceGroupManagerVersion
  9563. raw := NoMethod(*s)
  9564. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9565. }
  9566. type InstanceGroupManagersAbandonInstancesRequest struct {
  9567. // Instances: The URLs of one or more instances to abandon. This can be
  9568. // a full URL or a partial URL, such as
  9569. // zones/[ZONE]/instances/[INSTANCE_NAME].
  9570. Instances []string `json:"instances,omitempty"`
  9571. // ForceSendFields is a list of field names (e.g. "Instances") to
  9572. // unconditionally include in API requests. By default, fields with
  9573. // empty values are omitted from API requests. However, any non-pointer,
  9574. // non-interface field appearing in ForceSendFields will be sent to the
  9575. // server regardless of whether the field is empty or not. This may be
  9576. // used to include empty fields in Patch requests.
  9577. ForceSendFields []string `json:"-"`
  9578. // NullFields is a list of field names (e.g. "Instances") to include in
  9579. // API requests with the JSON null value. By default, fields with empty
  9580. // values are omitted from API requests. However, any field with an
  9581. // empty value appearing in NullFields will be sent to the server as
  9582. // null. It is an error if a field in this list has a non-empty value.
  9583. // This may be used to include null fields in Patch requests.
  9584. NullFields []string `json:"-"`
  9585. }
  9586. func (s *InstanceGroupManagersAbandonInstancesRequest) MarshalJSON() ([]byte, error) {
  9587. type NoMethod InstanceGroupManagersAbandonInstancesRequest
  9588. raw := NoMethod(*s)
  9589. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9590. }
  9591. type InstanceGroupManagersDeleteInstancesRequest struct {
  9592. // Instances: The URLs of one or more instances to delete. This can be a
  9593. // full URL or a partial URL, such as
  9594. // zones/[ZONE]/instances/[INSTANCE_NAME].
  9595. Instances []string `json:"instances,omitempty"`
  9596. // ForceSendFields is a list of field names (e.g. "Instances") to
  9597. // unconditionally include in API requests. By default, fields with
  9598. // empty values are omitted from API requests. However, any non-pointer,
  9599. // non-interface field appearing in ForceSendFields will be sent to the
  9600. // server regardless of whether the field is empty or not. This may be
  9601. // used to include empty fields in Patch requests.
  9602. ForceSendFields []string `json:"-"`
  9603. // NullFields is a list of field names (e.g. "Instances") to include in
  9604. // API requests with the JSON null value. By default, fields with empty
  9605. // values are omitted from API requests. However, any field with an
  9606. // empty value appearing in NullFields will be sent to the server as
  9607. // null. It is an error if a field in this list has a non-empty value.
  9608. // This may be used to include null fields in Patch requests.
  9609. NullFields []string `json:"-"`
  9610. }
  9611. func (s *InstanceGroupManagersDeleteInstancesRequest) MarshalJSON() ([]byte, error) {
  9612. type NoMethod InstanceGroupManagersDeleteInstancesRequest
  9613. raw := NoMethod(*s)
  9614. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9615. }
  9616. type InstanceGroupManagersListManagedInstancesResponse struct {
  9617. // ManagedInstances: [Output Only] The list of instances in the managed
  9618. // instance group.
  9619. ManagedInstances []*ManagedInstance `json:"managedInstances,omitempty"`
  9620. // NextPageToken: [Output Only] This token allows you to get the next
  9621. // page of results for list requests. If the number of results is larger
  9622. // than maxResults, use the nextPageToken as a value for the query
  9623. // parameter pageToken in the next list request. Subsequent list
  9624. // requests will have their own nextPageToken to continue paging through
  9625. // the results.
  9626. NextPageToken string `json:"nextPageToken,omitempty"`
  9627. // ServerResponse contains the HTTP response code and headers from the
  9628. // server.
  9629. googleapi.ServerResponse `json:"-"`
  9630. // ForceSendFields is a list of field names (e.g. "ManagedInstances") to
  9631. // unconditionally include in API requests. By default, fields with
  9632. // empty values are omitted from API requests. However, any non-pointer,
  9633. // non-interface field appearing in ForceSendFields will be sent to the
  9634. // server regardless of whether the field is empty or not. This may be
  9635. // used to include empty fields in Patch requests.
  9636. ForceSendFields []string `json:"-"`
  9637. // NullFields is a list of field names (e.g. "ManagedInstances") to
  9638. // include in API requests with the JSON null value. By default, fields
  9639. // with empty values are omitted from API requests. However, any field
  9640. // with an empty value appearing in NullFields will be sent to the
  9641. // server as null. It is an error if a field in this list has a
  9642. // non-empty value. This may be used to include null fields in Patch
  9643. // requests.
  9644. NullFields []string `json:"-"`
  9645. }
  9646. func (s *InstanceGroupManagersListManagedInstancesResponse) MarshalJSON() ([]byte, error) {
  9647. type NoMethod InstanceGroupManagersListManagedInstancesResponse
  9648. raw := NoMethod(*s)
  9649. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9650. }
  9651. type InstanceGroupManagersRecreateInstancesRequest struct {
  9652. // Instances: The URLs of one or more instances to recreate. This can be
  9653. // a full URL or a partial URL, such as
  9654. // zones/[ZONE]/instances/[INSTANCE_NAME].
  9655. Instances []string `json:"instances,omitempty"`
  9656. // ForceSendFields is a list of field names (e.g. "Instances") to
  9657. // unconditionally include in API requests. By default, fields with
  9658. // empty values are omitted from API requests. However, any non-pointer,
  9659. // non-interface field appearing in ForceSendFields will be sent to the
  9660. // server regardless of whether the field is empty or not. This may be
  9661. // used to include empty fields in Patch requests.
  9662. ForceSendFields []string `json:"-"`
  9663. // NullFields is a list of field names (e.g. "Instances") to include in
  9664. // API requests with the JSON null value. By default, fields with empty
  9665. // values are omitted from API requests. However, any field with an
  9666. // empty value appearing in NullFields will be sent to the server as
  9667. // null. It is an error if a field in this list has a non-empty value.
  9668. // This may be used to include null fields in Patch requests.
  9669. NullFields []string `json:"-"`
  9670. }
  9671. func (s *InstanceGroupManagersRecreateInstancesRequest) MarshalJSON() ([]byte, error) {
  9672. type NoMethod InstanceGroupManagersRecreateInstancesRequest
  9673. raw := NoMethod(*s)
  9674. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9675. }
  9676. type InstanceGroupManagersResizeAdvancedRequest struct {
  9677. // NoCreationRetries: If this flag is true, the managed instance group
  9678. // attempts to create all instances initiated by this resize request
  9679. // only once. If there is an error during creation, the managed instance
  9680. // group does not retry create this instance, and we will decrease the
  9681. // targetSize of the request instead. If the flag is false, the group
  9682. // attemps to recreate each instance continuously until it
  9683. // succeeds.
  9684. //
  9685. // This flag matters only in the first attempt of creation of an
  9686. // instance. After an instance is successfully created while this flag
  9687. // is enabled, the instance behaves the same way as all the other
  9688. // instances created with a regular resize request. In particular, if a
  9689. // running instance dies unexpectedly at a later time and needs to be
  9690. // recreated, this mode does not affect the recreation behavior in that
  9691. // scenario.
  9692. //
  9693. // This flag is applicable only to the current resize request. It does
  9694. // not influence other resize requests in any way.
  9695. //
  9696. // You can see which instances is being creating in which mode by
  9697. // calling the get or listManagedInstances API.
  9698. NoCreationRetries bool `json:"noCreationRetries,omitempty"`
  9699. // TargetSize: The number of running instances that the managed instance
  9700. // group should maintain at any given time. The group automatically adds
  9701. // or removes instances to maintain the number of instances specified by
  9702. // this parameter.
  9703. TargetSize int64 `json:"targetSize,omitempty"`
  9704. // ForceSendFields is a list of field names (e.g. "NoCreationRetries")
  9705. // to unconditionally include in API requests. By default, fields with
  9706. // empty values are omitted from API requests. However, any non-pointer,
  9707. // non-interface field appearing in ForceSendFields will be sent to the
  9708. // server regardless of whether the field is empty or not. This may be
  9709. // used to include empty fields in Patch requests.
  9710. ForceSendFields []string `json:"-"`
  9711. // NullFields is a list of field names (e.g. "NoCreationRetries") to
  9712. // include in API requests with the JSON null value. By default, fields
  9713. // with empty values are omitted from API requests. However, any field
  9714. // with an empty value appearing in NullFields will be sent to the
  9715. // server as null. It is an error if a field in this list has a
  9716. // non-empty value. This may be used to include null fields in Patch
  9717. // requests.
  9718. NullFields []string `json:"-"`
  9719. }
  9720. func (s *InstanceGroupManagersResizeAdvancedRequest) MarshalJSON() ([]byte, error) {
  9721. type NoMethod InstanceGroupManagersResizeAdvancedRequest
  9722. raw := NoMethod(*s)
  9723. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9724. }
  9725. type InstanceGroupManagersScopedList struct {
  9726. // InstanceGroupManagers: [Output Only] The list of managed instance
  9727. // groups that are contained in the specified project and zone.
  9728. InstanceGroupManagers []*InstanceGroupManager `json:"instanceGroupManagers,omitempty"`
  9729. // Warning: [Output Only] The warning that replaces the list of managed
  9730. // instance groups when the list is empty.
  9731. Warning *InstanceGroupManagersScopedListWarning `json:"warning,omitempty"`
  9732. // ForceSendFields is a list of field names (e.g.
  9733. // "InstanceGroupManagers") to unconditionally include in API requests.
  9734. // By default, fields with empty values are omitted from API requests.
  9735. // However, any non-pointer, non-interface field appearing in
  9736. // ForceSendFields will be sent to the server regardless of whether the
  9737. // field is empty or not. This may be used to include empty fields in
  9738. // Patch requests.
  9739. ForceSendFields []string `json:"-"`
  9740. // NullFields is a list of field names (e.g. "InstanceGroupManagers") to
  9741. // include in API requests with the JSON null value. By default, fields
  9742. // with empty values are omitted from API requests. However, any field
  9743. // with an empty value appearing in NullFields will be sent to the
  9744. // server as null. It is an error if a field in this list has a
  9745. // non-empty value. This may be used to include null fields in Patch
  9746. // requests.
  9747. NullFields []string `json:"-"`
  9748. }
  9749. func (s *InstanceGroupManagersScopedList) MarshalJSON() ([]byte, error) {
  9750. type NoMethod InstanceGroupManagersScopedList
  9751. raw := NoMethod(*s)
  9752. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9753. }
  9754. // InstanceGroupManagersScopedListWarning: [Output Only] The warning
  9755. // that replaces the list of managed instance groups when the list is
  9756. // empty.
  9757. type InstanceGroupManagersScopedListWarning struct {
  9758. // Code: [Output Only] A warning code, if applicable. For example,
  9759. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  9760. // the response.
  9761. //
  9762. // Possible values:
  9763. // "CLEANUP_FAILED"
  9764. // "DEPRECATED_RESOURCE_USED"
  9765. // "DEPRECATED_TYPE_USED"
  9766. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  9767. // "EXPERIMENTAL_TYPE_USED"
  9768. // "EXTERNAL_API_WARNING"
  9769. // "FIELD_VALUE_OVERRIDEN"
  9770. // "INJECTED_KERNELS_DEPRECATED"
  9771. // "MISSING_TYPE_DEPENDENCY"
  9772. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  9773. // "NEXT_HOP_CANNOT_IP_FORWARD"
  9774. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  9775. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  9776. // "NEXT_HOP_NOT_RUNNING"
  9777. // "NOT_CRITICAL_ERROR"
  9778. // "NO_RESULTS_ON_PAGE"
  9779. // "REQUIRED_TOS_AGREEMENT"
  9780. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  9781. // "RESOURCE_NOT_DELETED"
  9782. // "SCHEMA_VALIDATION_IGNORED"
  9783. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  9784. // "UNDECLARED_PROPERTIES"
  9785. // "UNREACHABLE"
  9786. Code string `json:"code,omitempty"`
  9787. // Data: [Output Only] Metadata about this warning in key: value format.
  9788. // For example:
  9789. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  9790. Data []*InstanceGroupManagersScopedListWarningData `json:"data,omitempty"`
  9791. // Message: [Output Only] A human-readable description of the warning
  9792. // code.
  9793. Message string `json:"message,omitempty"`
  9794. // ForceSendFields is a list of field names (e.g. "Code") to
  9795. // unconditionally include in API requests. By default, fields with
  9796. // empty values are omitted from API requests. However, any non-pointer,
  9797. // non-interface field appearing in ForceSendFields will be sent to the
  9798. // server regardless of whether the field is empty or not. This may be
  9799. // used to include empty fields in Patch requests.
  9800. ForceSendFields []string `json:"-"`
  9801. // NullFields is a list of field names (e.g. "Code") to include in API
  9802. // requests with the JSON null value. By default, fields with empty
  9803. // values are omitted from API requests. However, any field with an
  9804. // empty value appearing in NullFields will be sent to the server as
  9805. // null. It is an error if a field in this list has a non-empty value.
  9806. // This may be used to include null fields in Patch requests.
  9807. NullFields []string `json:"-"`
  9808. }
  9809. func (s *InstanceGroupManagersScopedListWarning) MarshalJSON() ([]byte, error) {
  9810. type NoMethod InstanceGroupManagersScopedListWarning
  9811. raw := NoMethod(*s)
  9812. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9813. }
  9814. type InstanceGroupManagersScopedListWarningData struct {
  9815. // Key: [Output Only] A key that provides more detail on the warning
  9816. // being returned. For example, for warnings where there are no results
  9817. // in a list request for a particular zone, this key might be scope and
  9818. // the key value might be the zone name. Other examples might be a key
  9819. // indicating a deprecated resource and a suggested replacement, or a
  9820. // warning about invalid network settings (for example, if an instance
  9821. // attempts to perform IP forwarding but is not enabled for IP
  9822. // forwarding).
  9823. Key string `json:"key,omitempty"`
  9824. // Value: [Output Only] A warning data value corresponding to the key.
  9825. Value string `json:"value,omitempty"`
  9826. // ForceSendFields is a list of field names (e.g. "Key") to
  9827. // unconditionally include in API requests. By default, fields with
  9828. // empty values are omitted from API requests. However, any non-pointer,
  9829. // non-interface field appearing in ForceSendFields will be sent to the
  9830. // server regardless of whether the field is empty or not. This may be
  9831. // used to include empty fields in Patch requests.
  9832. ForceSendFields []string `json:"-"`
  9833. // NullFields is a list of field names (e.g. "Key") to include in API
  9834. // requests with the JSON null value. By default, fields with empty
  9835. // values are omitted from API requests. However, any field with an
  9836. // empty value appearing in NullFields will be sent to the server as
  9837. // null. It is an error if a field in this list has a non-empty value.
  9838. // This may be used to include null fields in Patch requests.
  9839. NullFields []string `json:"-"`
  9840. }
  9841. func (s *InstanceGroupManagersScopedListWarningData) MarshalJSON() ([]byte, error) {
  9842. type NoMethod InstanceGroupManagersScopedListWarningData
  9843. raw := NoMethod(*s)
  9844. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9845. }
  9846. type InstanceGroupManagersSetAutoHealingRequest struct {
  9847. AutoHealingPolicies []*InstanceGroupManagerAutoHealingPolicy `json:"autoHealingPolicies,omitempty"`
  9848. // ForceSendFields is a list of field names (e.g. "AutoHealingPolicies")
  9849. // to unconditionally include in API requests. By default, fields with
  9850. // empty values are omitted from API requests. However, any non-pointer,
  9851. // non-interface field appearing in ForceSendFields will be sent to the
  9852. // server regardless of whether the field is empty or not. This may be
  9853. // used to include empty fields in Patch requests.
  9854. ForceSendFields []string `json:"-"`
  9855. // NullFields is a list of field names (e.g. "AutoHealingPolicies") to
  9856. // include in API requests with the JSON null value. By default, fields
  9857. // with empty values are omitted from API requests. However, any field
  9858. // with an empty value appearing in NullFields will be sent to the
  9859. // server as null. It is an error if a field in this list has a
  9860. // non-empty value. This may be used to include null fields in Patch
  9861. // requests.
  9862. NullFields []string `json:"-"`
  9863. }
  9864. func (s *InstanceGroupManagersSetAutoHealingRequest) MarshalJSON() ([]byte, error) {
  9865. type NoMethod InstanceGroupManagersSetAutoHealingRequest
  9866. raw := NoMethod(*s)
  9867. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9868. }
  9869. type InstanceGroupManagersSetInstanceTemplateRequest struct {
  9870. // InstanceTemplate: The URL of the instance template that is specified
  9871. // for this managed instance group. The group uses this template to
  9872. // create all new instances in the managed instance group.
  9873. InstanceTemplate string `json:"instanceTemplate,omitempty"`
  9874. // ForceSendFields is a list of field names (e.g. "InstanceTemplate") to
  9875. // unconditionally include in API requests. By default, fields with
  9876. // empty values are omitted from API requests. However, any non-pointer,
  9877. // non-interface field appearing in ForceSendFields will be sent to the
  9878. // server regardless of whether the field is empty or not. This may be
  9879. // used to include empty fields in Patch requests.
  9880. ForceSendFields []string `json:"-"`
  9881. // NullFields is a list of field names (e.g. "InstanceTemplate") to
  9882. // include in API requests with the JSON null value. By default, fields
  9883. // with empty values are omitted from API requests. However, any field
  9884. // with an empty value appearing in NullFields will be sent to the
  9885. // server as null. It is an error if a field in this list has a
  9886. // non-empty value. This may be used to include null fields in Patch
  9887. // requests.
  9888. NullFields []string `json:"-"`
  9889. }
  9890. func (s *InstanceGroupManagersSetInstanceTemplateRequest) MarshalJSON() ([]byte, error) {
  9891. type NoMethod InstanceGroupManagersSetInstanceTemplateRequest
  9892. raw := NoMethod(*s)
  9893. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9894. }
  9895. type InstanceGroupManagersSetTargetPoolsRequest struct {
  9896. // Fingerprint: The fingerprint of the target pools information. Use
  9897. // this optional property to prevent conflicts when multiple users
  9898. // change the target pools settings concurrently. Obtain the fingerprint
  9899. // with the instanceGroupManagers.get method. Then, include the
  9900. // fingerprint in your request to ensure that you do not overwrite
  9901. // changes that were applied from another concurrent request.
  9902. Fingerprint string `json:"fingerprint,omitempty"`
  9903. // TargetPools: The list of target pool URLs that instances in this
  9904. // managed instance group belong to. The managed instance group applies
  9905. // these target pools to all of the instances in the group. Existing
  9906. // instances and new instances in the group all receive these target
  9907. // pool settings.
  9908. TargetPools []string `json:"targetPools,omitempty"`
  9909. // ForceSendFields is a list of field names (e.g. "Fingerprint") to
  9910. // unconditionally include in API requests. By default, fields with
  9911. // empty values are omitted from API requests. However, any non-pointer,
  9912. // non-interface field appearing in ForceSendFields will be sent to the
  9913. // server regardless of whether the field is empty or not. This may be
  9914. // used to include empty fields in Patch requests.
  9915. ForceSendFields []string `json:"-"`
  9916. // NullFields is a list of field names (e.g. "Fingerprint") to include
  9917. // in API requests with the JSON null value. By default, fields with
  9918. // empty values are omitted from API requests. However, any field with
  9919. // an empty value appearing in NullFields will be sent to the server as
  9920. // null. It is an error if a field in this list has a non-empty value.
  9921. // This may be used to include null fields in Patch requests.
  9922. NullFields []string `json:"-"`
  9923. }
  9924. func (s *InstanceGroupManagersSetTargetPoolsRequest) MarshalJSON() ([]byte, error) {
  9925. type NoMethod InstanceGroupManagersSetTargetPoolsRequest
  9926. raw := NoMethod(*s)
  9927. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9928. }
  9929. type InstanceGroupsAddInstancesRequest struct {
  9930. // Instances: The list of instances to add to the instance group.
  9931. Instances []*InstanceReference `json:"instances,omitempty"`
  9932. // ForceSendFields is a list of field names (e.g. "Instances") to
  9933. // unconditionally include in API requests. By default, fields with
  9934. // empty values are omitted from API requests. However, any non-pointer,
  9935. // non-interface field appearing in ForceSendFields will be sent to the
  9936. // server regardless of whether the field is empty or not. This may be
  9937. // used to include empty fields in Patch requests.
  9938. ForceSendFields []string `json:"-"`
  9939. // NullFields is a list of field names (e.g. "Instances") to include in
  9940. // API requests with the JSON null value. By default, fields with empty
  9941. // values are omitted from API requests. However, any field with an
  9942. // empty value appearing in NullFields will be sent to the server as
  9943. // null. It is an error if a field in this list has a non-empty value.
  9944. // This may be used to include null fields in Patch requests.
  9945. NullFields []string `json:"-"`
  9946. }
  9947. func (s *InstanceGroupsAddInstancesRequest) MarshalJSON() ([]byte, error) {
  9948. type NoMethod InstanceGroupsAddInstancesRequest
  9949. raw := NoMethod(*s)
  9950. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9951. }
  9952. type InstanceGroupsListInstances struct {
  9953. // Id: [Output Only] Unique identifier for the resource; defined by the
  9954. // server.
  9955. Id string `json:"id,omitempty"`
  9956. // Items: A list of InstanceWithNamedPorts resources.
  9957. Items []*InstanceWithNamedPorts `json:"items,omitempty"`
  9958. // Kind: [Output Only] The resource type, which is always
  9959. // compute#instanceGroupsListInstances for the list of instances in the
  9960. // specified instance group.
  9961. Kind string `json:"kind,omitempty"`
  9962. // NextPageToken: [Output Only] This token allows you to get the next
  9963. // page of results for list requests. If the number of results is larger
  9964. // than maxResults, use the nextPageToken as a value for the query
  9965. // parameter pageToken in the next list request. Subsequent list
  9966. // requests will have their own nextPageToken to continue paging through
  9967. // the results.
  9968. NextPageToken string `json:"nextPageToken,omitempty"`
  9969. // SelfLink: [Output Only] Server-defined URL for this resource.
  9970. SelfLink string `json:"selfLink,omitempty"`
  9971. // Warning: [Output Only] Informational warning message.
  9972. Warning *InstanceGroupsListInstancesWarning `json:"warning,omitempty"`
  9973. // ServerResponse contains the HTTP response code and headers from the
  9974. // server.
  9975. googleapi.ServerResponse `json:"-"`
  9976. // ForceSendFields is a list of field names (e.g. "Id") to
  9977. // unconditionally include in API requests. By default, fields with
  9978. // empty values are omitted from API requests. However, any non-pointer,
  9979. // non-interface field appearing in ForceSendFields will be sent to the
  9980. // server regardless of whether the field is empty or not. This may be
  9981. // used to include empty fields in Patch requests.
  9982. ForceSendFields []string `json:"-"`
  9983. // NullFields is a list of field names (e.g. "Id") to include in API
  9984. // requests with the JSON null value. By default, fields with empty
  9985. // values are omitted from API requests. However, any field with an
  9986. // empty value appearing in NullFields will be sent to the server as
  9987. // null. It is an error if a field in this list has a non-empty value.
  9988. // This may be used to include null fields in Patch requests.
  9989. NullFields []string `json:"-"`
  9990. }
  9991. func (s *InstanceGroupsListInstances) MarshalJSON() ([]byte, error) {
  9992. type NoMethod InstanceGroupsListInstances
  9993. raw := NoMethod(*s)
  9994. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9995. }
  9996. // InstanceGroupsListInstancesWarning: [Output Only] Informational
  9997. // warning message.
  9998. type InstanceGroupsListInstancesWarning struct {
  9999. // Code: [Output Only] A warning code, if applicable. For example,
  10000. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  10001. // the response.
  10002. //
  10003. // Possible values:
  10004. // "CLEANUP_FAILED"
  10005. // "DEPRECATED_RESOURCE_USED"
  10006. // "DEPRECATED_TYPE_USED"
  10007. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  10008. // "EXPERIMENTAL_TYPE_USED"
  10009. // "EXTERNAL_API_WARNING"
  10010. // "FIELD_VALUE_OVERRIDEN"
  10011. // "INJECTED_KERNELS_DEPRECATED"
  10012. // "MISSING_TYPE_DEPENDENCY"
  10013. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  10014. // "NEXT_HOP_CANNOT_IP_FORWARD"
  10015. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  10016. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  10017. // "NEXT_HOP_NOT_RUNNING"
  10018. // "NOT_CRITICAL_ERROR"
  10019. // "NO_RESULTS_ON_PAGE"
  10020. // "REQUIRED_TOS_AGREEMENT"
  10021. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  10022. // "RESOURCE_NOT_DELETED"
  10023. // "SCHEMA_VALIDATION_IGNORED"
  10024. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  10025. // "UNDECLARED_PROPERTIES"
  10026. // "UNREACHABLE"
  10027. Code string `json:"code,omitempty"`
  10028. // Data: [Output Only] Metadata about this warning in key: value format.
  10029. // For example:
  10030. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  10031. Data []*InstanceGroupsListInstancesWarningData `json:"data,omitempty"`
  10032. // Message: [Output Only] A human-readable description of the warning
  10033. // code.
  10034. Message string `json:"message,omitempty"`
  10035. // ForceSendFields is a list of field names (e.g. "Code") to
  10036. // unconditionally include in API requests. By default, fields with
  10037. // empty values are omitted from API requests. However, any non-pointer,
  10038. // non-interface field appearing in ForceSendFields will be sent to the
  10039. // server regardless of whether the field is empty or not. This may be
  10040. // used to include empty fields in Patch requests.
  10041. ForceSendFields []string `json:"-"`
  10042. // NullFields is a list of field names (e.g. "Code") to include in API
  10043. // requests with the JSON null value. By default, fields with empty
  10044. // values are omitted from API requests. However, any field with an
  10045. // empty value appearing in NullFields will be sent to the server as
  10046. // null. It is an error if a field in this list has a non-empty value.
  10047. // This may be used to include null fields in Patch requests.
  10048. NullFields []string `json:"-"`
  10049. }
  10050. func (s *InstanceGroupsListInstancesWarning) MarshalJSON() ([]byte, error) {
  10051. type NoMethod InstanceGroupsListInstancesWarning
  10052. raw := NoMethod(*s)
  10053. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10054. }
  10055. type InstanceGroupsListInstancesWarningData struct {
  10056. // Key: [Output Only] A key that provides more detail on the warning
  10057. // being returned. For example, for warnings where there are no results
  10058. // in a list request for a particular zone, this key might be scope and
  10059. // the key value might be the zone name. Other examples might be a key
  10060. // indicating a deprecated resource and a suggested replacement, or a
  10061. // warning about invalid network settings (for example, if an instance
  10062. // attempts to perform IP forwarding but is not enabled for IP
  10063. // forwarding).
  10064. Key string `json:"key,omitempty"`
  10065. // Value: [Output Only] A warning data value corresponding to the key.
  10066. Value string `json:"value,omitempty"`
  10067. // ForceSendFields is a list of field names (e.g. "Key") to
  10068. // unconditionally include in API requests. By default, fields with
  10069. // empty values are omitted from API requests. However, any non-pointer,
  10070. // non-interface field appearing in ForceSendFields will be sent to the
  10071. // server regardless of whether the field is empty or not. This may be
  10072. // used to include empty fields in Patch requests.
  10073. ForceSendFields []string `json:"-"`
  10074. // NullFields is a list of field names (e.g. "Key") to include in API
  10075. // requests with the JSON null value. By default, fields with empty
  10076. // values are omitted from API requests. However, any field with an
  10077. // empty value appearing in NullFields will be sent to the server as
  10078. // null. It is an error if a field in this list has a non-empty value.
  10079. // This may be used to include null fields in Patch requests.
  10080. NullFields []string `json:"-"`
  10081. }
  10082. func (s *InstanceGroupsListInstancesWarningData) MarshalJSON() ([]byte, error) {
  10083. type NoMethod InstanceGroupsListInstancesWarningData
  10084. raw := NoMethod(*s)
  10085. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10086. }
  10087. type InstanceGroupsListInstancesRequest struct {
  10088. // InstanceState: A filter for the state of the instances in the
  10089. // instance group. Valid options are ALL or RUNNING. If you do not
  10090. // specify this parameter the list includes all instances regardless of
  10091. // their state.
  10092. //
  10093. // Possible values:
  10094. // "ALL"
  10095. // "RUNNING"
  10096. InstanceState string `json:"instanceState,omitempty"`
  10097. // ForceSendFields is a list of field names (e.g. "InstanceState") to
  10098. // unconditionally include in API requests. By default, fields with
  10099. // empty values are omitted from API requests. However, any non-pointer,
  10100. // non-interface field appearing in ForceSendFields will be sent to the
  10101. // server regardless of whether the field is empty or not. This may be
  10102. // used to include empty fields in Patch requests.
  10103. ForceSendFields []string `json:"-"`
  10104. // NullFields is a list of field names (e.g. "InstanceState") to include
  10105. // in API requests with the JSON null value. By default, fields with
  10106. // empty values are omitted from API requests. However, any field with
  10107. // an empty value appearing in NullFields will be sent to the server as
  10108. // null. It is an error if a field in this list has a non-empty value.
  10109. // This may be used to include null fields in Patch requests.
  10110. NullFields []string `json:"-"`
  10111. }
  10112. func (s *InstanceGroupsListInstancesRequest) MarshalJSON() ([]byte, error) {
  10113. type NoMethod InstanceGroupsListInstancesRequest
  10114. raw := NoMethod(*s)
  10115. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10116. }
  10117. type InstanceGroupsRemoveInstancesRequest struct {
  10118. // Instances: The list of instances to remove from the instance group.
  10119. Instances []*InstanceReference `json:"instances,omitempty"`
  10120. // ForceSendFields is a list of field names (e.g. "Instances") to
  10121. // unconditionally include in API requests. By default, fields with
  10122. // empty values are omitted from API requests. However, any non-pointer,
  10123. // non-interface field appearing in ForceSendFields will be sent to the
  10124. // server regardless of whether the field is empty or not. This may be
  10125. // used to include empty fields in Patch requests.
  10126. ForceSendFields []string `json:"-"`
  10127. // NullFields is a list of field names (e.g. "Instances") to include in
  10128. // API requests with the JSON null value. By default, fields with empty
  10129. // values are omitted from API requests. However, any field with an
  10130. // empty value appearing in NullFields will be sent to the server as
  10131. // null. It is an error if a field in this list has a non-empty value.
  10132. // This may be used to include null fields in Patch requests.
  10133. NullFields []string `json:"-"`
  10134. }
  10135. func (s *InstanceGroupsRemoveInstancesRequest) MarshalJSON() ([]byte, error) {
  10136. type NoMethod InstanceGroupsRemoveInstancesRequest
  10137. raw := NoMethod(*s)
  10138. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10139. }
  10140. type InstanceGroupsScopedList struct {
  10141. // InstanceGroups: [Output Only] The list of instance groups that are
  10142. // contained in this scope.
  10143. InstanceGroups []*InstanceGroup `json:"instanceGroups,omitempty"`
  10144. // Warning: [Output Only] An informational warning that replaces the
  10145. // list of instance groups when the list is empty.
  10146. Warning *InstanceGroupsScopedListWarning `json:"warning,omitempty"`
  10147. // ForceSendFields is a list of field names (e.g. "InstanceGroups") to
  10148. // unconditionally include in API requests. By default, fields with
  10149. // empty values are omitted from API requests. However, any non-pointer,
  10150. // non-interface field appearing in ForceSendFields will be sent to the
  10151. // server regardless of whether the field is empty or not. This may be
  10152. // used to include empty fields in Patch requests.
  10153. ForceSendFields []string `json:"-"`
  10154. // NullFields is a list of field names (e.g. "InstanceGroups") to
  10155. // include in API requests with the JSON null value. By default, fields
  10156. // with empty values are omitted from API requests. However, any field
  10157. // with an empty value appearing in NullFields will be sent to the
  10158. // server as null. It is an error if a field in this list has a
  10159. // non-empty value. This may be used to include null fields in Patch
  10160. // requests.
  10161. NullFields []string `json:"-"`
  10162. }
  10163. func (s *InstanceGroupsScopedList) MarshalJSON() ([]byte, error) {
  10164. type NoMethod InstanceGroupsScopedList
  10165. raw := NoMethod(*s)
  10166. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10167. }
  10168. // InstanceGroupsScopedListWarning: [Output Only] An informational
  10169. // warning that replaces the list of instance groups when the list is
  10170. // empty.
  10171. type InstanceGroupsScopedListWarning struct {
  10172. // Code: [Output Only] A warning code, if applicable. For example,
  10173. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  10174. // the response.
  10175. //
  10176. // Possible values:
  10177. // "CLEANUP_FAILED"
  10178. // "DEPRECATED_RESOURCE_USED"
  10179. // "DEPRECATED_TYPE_USED"
  10180. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  10181. // "EXPERIMENTAL_TYPE_USED"
  10182. // "EXTERNAL_API_WARNING"
  10183. // "FIELD_VALUE_OVERRIDEN"
  10184. // "INJECTED_KERNELS_DEPRECATED"
  10185. // "MISSING_TYPE_DEPENDENCY"
  10186. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  10187. // "NEXT_HOP_CANNOT_IP_FORWARD"
  10188. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  10189. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  10190. // "NEXT_HOP_NOT_RUNNING"
  10191. // "NOT_CRITICAL_ERROR"
  10192. // "NO_RESULTS_ON_PAGE"
  10193. // "REQUIRED_TOS_AGREEMENT"
  10194. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  10195. // "RESOURCE_NOT_DELETED"
  10196. // "SCHEMA_VALIDATION_IGNORED"
  10197. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  10198. // "UNDECLARED_PROPERTIES"
  10199. // "UNREACHABLE"
  10200. Code string `json:"code,omitempty"`
  10201. // Data: [Output Only] Metadata about this warning in key: value format.
  10202. // For example:
  10203. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  10204. Data []*InstanceGroupsScopedListWarningData `json:"data,omitempty"`
  10205. // Message: [Output Only] A human-readable description of the warning
  10206. // code.
  10207. Message string `json:"message,omitempty"`
  10208. // ForceSendFields is a list of field names (e.g. "Code") to
  10209. // unconditionally include in API requests. By default, fields with
  10210. // empty values are omitted from API requests. However, any non-pointer,
  10211. // non-interface field appearing in ForceSendFields will be sent to the
  10212. // server regardless of whether the field is empty or not. This may be
  10213. // used to include empty fields in Patch requests.
  10214. ForceSendFields []string `json:"-"`
  10215. // NullFields is a list of field names (e.g. "Code") to include in API
  10216. // requests with the JSON null value. By default, fields with empty
  10217. // values are omitted from API requests. However, any field with an
  10218. // empty value appearing in NullFields will be sent to the server as
  10219. // null. It is an error if a field in this list has a non-empty value.
  10220. // This may be used to include null fields in Patch requests.
  10221. NullFields []string `json:"-"`
  10222. }
  10223. func (s *InstanceGroupsScopedListWarning) MarshalJSON() ([]byte, error) {
  10224. type NoMethod InstanceGroupsScopedListWarning
  10225. raw := NoMethod(*s)
  10226. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10227. }
  10228. type InstanceGroupsScopedListWarningData struct {
  10229. // Key: [Output Only] A key that provides more detail on the warning
  10230. // being returned. For example, for warnings where there are no results
  10231. // in a list request for a particular zone, this key might be scope and
  10232. // the key value might be the zone name. Other examples might be a key
  10233. // indicating a deprecated resource and a suggested replacement, or a
  10234. // warning about invalid network settings (for example, if an instance
  10235. // attempts to perform IP forwarding but is not enabled for IP
  10236. // forwarding).
  10237. Key string `json:"key,omitempty"`
  10238. // Value: [Output Only] A warning data value corresponding to the key.
  10239. Value string `json:"value,omitempty"`
  10240. // ForceSendFields is a list of field names (e.g. "Key") to
  10241. // unconditionally include in API requests. By default, fields with
  10242. // empty values are omitted from API requests. However, any non-pointer,
  10243. // non-interface field appearing in ForceSendFields will be sent to the
  10244. // server regardless of whether the field is empty or not. This may be
  10245. // used to include empty fields in Patch requests.
  10246. ForceSendFields []string `json:"-"`
  10247. // NullFields is a list of field names (e.g. "Key") to include in API
  10248. // requests with the JSON null value. By default, fields with empty
  10249. // values are omitted from API requests. However, any field with an
  10250. // empty value appearing in NullFields will be sent to the server as
  10251. // null. It is an error if a field in this list has a non-empty value.
  10252. // This may be used to include null fields in Patch requests.
  10253. NullFields []string `json:"-"`
  10254. }
  10255. func (s *InstanceGroupsScopedListWarningData) MarshalJSON() ([]byte, error) {
  10256. type NoMethod InstanceGroupsScopedListWarningData
  10257. raw := NoMethod(*s)
  10258. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10259. }
  10260. type InstanceGroupsSetNamedPortsRequest struct {
  10261. // Fingerprint: The fingerprint of the named ports information for this
  10262. // instance group. Use this optional property to prevent conflicts when
  10263. // multiple users change the named ports settings concurrently. Obtain
  10264. // the fingerprint with the instanceGroups.get method. Then, include the
  10265. // fingerprint in your request to ensure that you do not overwrite
  10266. // changes that were applied from another concurrent request.
  10267. Fingerprint string `json:"fingerprint,omitempty"`
  10268. // NamedPorts: The list of named ports to set for this instance group.
  10269. NamedPorts []*NamedPort `json:"namedPorts,omitempty"`
  10270. // ForceSendFields is a list of field names (e.g. "Fingerprint") to
  10271. // unconditionally include in API requests. By default, fields with
  10272. // empty values are omitted from API requests. However, any non-pointer,
  10273. // non-interface field appearing in ForceSendFields will be sent to the
  10274. // server regardless of whether the field is empty or not. This may be
  10275. // used to include empty fields in Patch requests.
  10276. ForceSendFields []string `json:"-"`
  10277. // NullFields is a list of field names (e.g. "Fingerprint") to include
  10278. // in API requests with the JSON null value. By default, fields with
  10279. // empty values are omitted from API requests. However, any field with
  10280. // an empty value appearing in NullFields will be sent to the server as
  10281. // null. It is an error if a field in this list has a non-empty value.
  10282. // This may be used to include null fields in Patch requests.
  10283. NullFields []string `json:"-"`
  10284. }
  10285. func (s *InstanceGroupsSetNamedPortsRequest) MarshalJSON() ([]byte, error) {
  10286. type NoMethod InstanceGroupsSetNamedPortsRequest
  10287. raw := NoMethod(*s)
  10288. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10289. }
  10290. // InstanceList: Contains a list of instances.
  10291. type InstanceList struct {
  10292. // Id: [Output Only] Unique identifier for the resource; defined by the
  10293. // server.
  10294. Id string `json:"id,omitempty"`
  10295. // Items: A list of Instance resources.
  10296. Items []*Instance `json:"items,omitempty"`
  10297. // Kind: [Output Only] Type of resource. Always compute#instanceList for
  10298. // lists of Instance resources.
  10299. Kind string `json:"kind,omitempty"`
  10300. // NextPageToken: [Output Only] This token allows you to get the next
  10301. // page of results for list requests. If the number of results is larger
  10302. // than maxResults, use the nextPageToken as a value for the query
  10303. // parameter pageToken in the next list request. Subsequent list
  10304. // requests will have their own nextPageToken to continue paging through
  10305. // the results.
  10306. NextPageToken string `json:"nextPageToken,omitempty"`
  10307. // SelfLink: [Output Only] Server-defined URL for this resource.
  10308. SelfLink string `json:"selfLink,omitempty"`
  10309. // Warning: [Output Only] Informational warning message.
  10310. Warning *InstanceListWarning `json:"warning,omitempty"`
  10311. // ServerResponse contains the HTTP response code and headers from the
  10312. // server.
  10313. googleapi.ServerResponse `json:"-"`
  10314. // ForceSendFields is a list of field names (e.g. "Id") to
  10315. // unconditionally include in API requests. By default, fields with
  10316. // empty values are omitted from API requests. However, any non-pointer,
  10317. // non-interface field appearing in ForceSendFields will be sent to the
  10318. // server regardless of whether the field is empty or not. This may be
  10319. // used to include empty fields in Patch requests.
  10320. ForceSendFields []string `json:"-"`
  10321. // NullFields is a list of field names (e.g. "Id") to include in API
  10322. // requests with the JSON null value. By default, fields with empty
  10323. // values are omitted from API requests. However, any field with an
  10324. // empty value appearing in NullFields will be sent to the server as
  10325. // null. It is an error if a field in this list has a non-empty value.
  10326. // This may be used to include null fields in Patch requests.
  10327. NullFields []string `json:"-"`
  10328. }
  10329. func (s *InstanceList) MarshalJSON() ([]byte, error) {
  10330. type NoMethod InstanceList
  10331. raw := NoMethod(*s)
  10332. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10333. }
  10334. // InstanceListWarning: [Output Only] Informational warning message.
  10335. type InstanceListWarning struct {
  10336. // Code: [Output Only] A warning code, if applicable. For example,
  10337. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  10338. // the response.
  10339. //
  10340. // Possible values:
  10341. // "CLEANUP_FAILED"
  10342. // "DEPRECATED_RESOURCE_USED"
  10343. // "DEPRECATED_TYPE_USED"
  10344. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  10345. // "EXPERIMENTAL_TYPE_USED"
  10346. // "EXTERNAL_API_WARNING"
  10347. // "FIELD_VALUE_OVERRIDEN"
  10348. // "INJECTED_KERNELS_DEPRECATED"
  10349. // "MISSING_TYPE_DEPENDENCY"
  10350. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  10351. // "NEXT_HOP_CANNOT_IP_FORWARD"
  10352. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  10353. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  10354. // "NEXT_HOP_NOT_RUNNING"
  10355. // "NOT_CRITICAL_ERROR"
  10356. // "NO_RESULTS_ON_PAGE"
  10357. // "REQUIRED_TOS_AGREEMENT"
  10358. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  10359. // "RESOURCE_NOT_DELETED"
  10360. // "SCHEMA_VALIDATION_IGNORED"
  10361. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  10362. // "UNDECLARED_PROPERTIES"
  10363. // "UNREACHABLE"
  10364. Code string `json:"code,omitempty"`
  10365. // Data: [Output Only] Metadata about this warning in key: value format.
  10366. // For example:
  10367. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  10368. Data []*InstanceListWarningData `json:"data,omitempty"`
  10369. // Message: [Output Only] A human-readable description of the warning
  10370. // code.
  10371. Message string `json:"message,omitempty"`
  10372. // ForceSendFields is a list of field names (e.g. "Code") to
  10373. // unconditionally include in API requests. By default, fields with
  10374. // empty values are omitted from API requests. However, any non-pointer,
  10375. // non-interface field appearing in ForceSendFields will be sent to the
  10376. // server regardless of whether the field is empty or not. This may be
  10377. // used to include empty fields in Patch requests.
  10378. ForceSendFields []string `json:"-"`
  10379. // NullFields is a list of field names (e.g. "Code") to include in API
  10380. // requests with the JSON null value. By default, fields with empty
  10381. // values are omitted from API requests. However, any field with an
  10382. // empty value appearing in NullFields will be sent to the server as
  10383. // null. It is an error if a field in this list has a non-empty value.
  10384. // This may be used to include null fields in Patch requests.
  10385. NullFields []string `json:"-"`
  10386. }
  10387. func (s *InstanceListWarning) MarshalJSON() ([]byte, error) {
  10388. type NoMethod InstanceListWarning
  10389. raw := NoMethod(*s)
  10390. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10391. }
  10392. type InstanceListWarningData struct {
  10393. // Key: [Output Only] A key that provides more detail on the warning
  10394. // being returned. For example, for warnings where there are no results
  10395. // in a list request for a particular zone, this key might be scope and
  10396. // the key value might be the zone name. Other examples might be a key
  10397. // indicating a deprecated resource and a suggested replacement, or a
  10398. // warning about invalid network settings (for example, if an instance
  10399. // attempts to perform IP forwarding but is not enabled for IP
  10400. // forwarding).
  10401. Key string `json:"key,omitempty"`
  10402. // Value: [Output Only] A warning data value corresponding to the key.
  10403. Value string `json:"value,omitempty"`
  10404. // ForceSendFields is a list of field names (e.g. "Key") to
  10405. // unconditionally include in API requests. By default, fields with
  10406. // empty values are omitted from API requests. However, any non-pointer,
  10407. // non-interface field appearing in ForceSendFields will be sent to the
  10408. // server regardless of whether the field is empty or not. This may be
  10409. // used to include empty fields in Patch requests.
  10410. ForceSendFields []string `json:"-"`
  10411. // NullFields is a list of field names (e.g. "Key") to include in API
  10412. // requests with the JSON null value. By default, fields with empty
  10413. // values are omitted from API requests. However, any field with an
  10414. // empty value appearing in NullFields will be sent to the server as
  10415. // null. It is an error if a field in this list has a non-empty value.
  10416. // This may be used to include null fields in Patch requests.
  10417. NullFields []string `json:"-"`
  10418. }
  10419. func (s *InstanceListWarningData) MarshalJSON() ([]byte, error) {
  10420. type NoMethod InstanceListWarningData
  10421. raw := NoMethod(*s)
  10422. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10423. }
  10424. // InstanceListReferrers: Contains a list of instance referrers.
  10425. type InstanceListReferrers struct {
  10426. // Id: [Output Only] Unique identifier for the resource; defined by the
  10427. // server.
  10428. Id string `json:"id,omitempty"`
  10429. // Items: A list of Reference resources.
  10430. Items []*Reference `json:"items,omitempty"`
  10431. // Kind: [Output Only] Type of resource. Always
  10432. // compute#instanceListReferrers for lists of Instance referrers.
  10433. Kind string `json:"kind,omitempty"`
  10434. // NextPageToken: [Output Only] This token allows you to get the next
  10435. // page of results for list requests. If the number of results is larger
  10436. // than maxResults, use the nextPageToken as a value for the query
  10437. // parameter pageToken in the next list request. Subsequent list
  10438. // requests will have their own nextPageToken to continue paging through
  10439. // the results.
  10440. NextPageToken string `json:"nextPageToken,omitempty"`
  10441. // SelfLink: [Output Only] Server-defined URL for this resource.
  10442. SelfLink string `json:"selfLink,omitempty"`
  10443. // Warning: [Output Only] Informational warning message.
  10444. Warning *InstanceListReferrersWarning `json:"warning,omitempty"`
  10445. // ServerResponse contains the HTTP response code and headers from the
  10446. // server.
  10447. googleapi.ServerResponse `json:"-"`
  10448. // ForceSendFields is a list of field names (e.g. "Id") to
  10449. // unconditionally include in API requests. By default, fields with
  10450. // empty values are omitted from API requests. However, any non-pointer,
  10451. // non-interface field appearing in ForceSendFields will be sent to the
  10452. // server regardless of whether the field is empty or not. This may be
  10453. // used to include empty fields in Patch requests.
  10454. ForceSendFields []string `json:"-"`
  10455. // NullFields is a list of field names (e.g. "Id") to include in API
  10456. // requests with the JSON null value. By default, fields with empty
  10457. // values are omitted from API requests. However, any field with an
  10458. // empty value appearing in NullFields will be sent to the server as
  10459. // null. It is an error if a field in this list has a non-empty value.
  10460. // This may be used to include null fields in Patch requests.
  10461. NullFields []string `json:"-"`
  10462. }
  10463. func (s *InstanceListReferrers) MarshalJSON() ([]byte, error) {
  10464. type NoMethod InstanceListReferrers
  10465. raw := NoMethod(*s)
  10466. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10467. }
  10468. // InstanceListReferrersWarning: [Output Only] Informational warning
  10469. // message.
  10470. type InstanceListReferrersWarning struct {
  10471. // Code: [Output Only] A warning code, if applicable. For example,
  10472. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  10473. // the response.
  10474. //
  10475. // Possible values:
  10476. // "CLEANUP_FAILED"
  10477. // "DEPRECATED_RESOURCE_USED"
  10478. // "DEPRECATED_TYPE_USED"
  10479. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  10480. // "EXPERIMENTAL_TYPE_USED"
  10481. // "EXTERNAL_API_WARNING"
  10482. // "FIELD_VALUE_OVERRIDEN"
  10483. // "INJECTED_KERNELS_DEPRECATED"
  10484. // "MISSING_TYPE_DEPENDENCY"
  10485. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  10486. // "NEXT_HOP_CANNOT_IP_FORWARD"
  10487. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  10488. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  10489. // "NEXT_HOP_NOT_RUNNING"
  10490. // "NOT_CRITICAL_ERROR"
  10491. // "NO_RESULTS_ON_PAGE"
  10492. // "REQUIRED_TOS_AGREEMENT"
  10493. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  10494. // "RESOURCE_NOT_DELETED"
  10495. // "SCHEMA_VALIDATION_IGNORED"
  10496. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  10497. // "UNDECLARED_PROPERTIES"
  10498. // "UNREACHABLE"
  10499. Code string `json:"code,omitempty"`
  10500. // Data: [Output Only] Metadata about this warning in key: value format.
  10501. // For example:
  10502. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  10503. Data []*InstanceListReferrersWarningData `json:"data,omitempty"`
  10504. // Message: [Output Only] A human-readable description of the warning
  10505. // code.
  10506. Message string `json:"message,omitempty"`
  10507. // ForceSendFields is a list of field names (e.g. "Code") to
  10508. // unconditionally include in API requests. By default, fields with
  10509. // empty values are omitted from API requests. However, any non-pointer,
  10510. // non-interface field appearing in ForceSendFields will be sent to the
  10511. // server regardless of whether the field is empty or not. This may be
  10512. // used to include empty fields in Patch requests.
  10513. ForceSendFields []string `json:"-"`
  10514. // NullFields is a list of field names (e.g. "Code") to include in API
  10515. // requests with the JSON null value. By default, fields with empty
  10516. // values are omitted from API requests. However, any field with an
  10517. // empty value appearing in NullFields will be sent to the server as
  10518. // null. It is an error if a field in this list has a non-empty value.
  10519. // This may be used to include null fields in Patch requests.
  10520. NullFields []string `json:"-"`
  10521. }
  10522. func (s *InstanceListReferrersWarning) MarshalJSON() ([]byte, error) {
  10523. type NoMethod InstanceListReferrersWarning
  10524. raw := NoMethod(*s)
  10525. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10526. }
  10527. type InstanceListReferrersWarningData struct {
  10528. // Key: [Output Only] A key that provides more detail on the warning
  10529. // being returned. For example, for warnings where there are no results
  10530. // in a list request for a particular zone, this key might be scope and
  10531. // the key value might be the zone name. Other examples might be a key
  10532. // indicating a deprecated resource and a suggested replacement, or a
  10533. // warning about invalid network settings (for example, if an instance
  10534. // attempts to perform IP forwarding but is not enabled for IP
  10535. // forwarding).
  10536. Key string `json:"key,omitempty"`
  10537. // Value: [Output Only] A warning data value corresponding to the key.
  10538. Value string `json:"value,omitempty"`
  10539. // ForceSendFields is a list of field names (e.g. "Key") to
  10540. // unconditionally include in API requests. By default, fields with
  10541. // empty values are omitted from API requests. However, any non-pointer,
  10542. // non-interface field appearing in ForceSendFields will be sent to the
  10543. // server regardless of whether the field is empty or not. This may be
  10544. // used to include empty fields in Patch requests.
  10545. ForceSendFields []string `json:"-"`
  10546. // NullFields is a list of field names (e.g. "Key") to include in API
  10547. // requests with the JSON null value. By default, fields with empty
  10548. // values are omitted from API requests. However, any field with an
  10549. // empty value appearing in NullFields will be sent to the server as
  10550. // null. It is an error if a field in this list has a non-empty value.
  10551. // This may be used to include null fields in Patch requests.
  10552. NullFields []string `json:"-"`
  10553. }
  10554. func (s *InstanceListReferrersWarningData) MarshalJSON() ([]byte, error) {
  10555. type NoMethod InstanceListReferrersWarningData
  10556. raw := NoMethod(*s)
  10557. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10558. }
  10559. type InstanceMoveRequest struct {
  10560. // DestinationZone: The URL of the destination zone to move the
  10561. // instance. This can be a full or partial URL. For example, the
  10562. // following are all valid URLs to a zone:
  10563. // - https://www.googleapis.com/compute/v1/projects/project/zones/zone
  10564. //
  10565. // - projects/project/zones/zone
  10566. // - zones/zone
  10567. DestinationZone string `json:"destinationZone,omitempty"`
  10568. // TargetInstance: The URL of the target instance to move. This can be a
  10569. // full or partial URL. For example, the following are all valid URLs to
  10570. // an instance:
  10571. // -
  10572. // https://www.googleapis.com/compute/v1/projects/project/zones/zone/instances/instance
  10573. // - projects/project/zones/zone/instances/instance
  10574. // - zones/zone/instances/instance
  10575. TargetInstance string `json:"targetInstance,omitempty"`
  10576. // ForceSendFields is a list of field names (e.g. "DestinationZone") to
  10577. // unconditionally include in API requests. By default, fields with
  10578. // empty values are omitted from API requests. However, any non-pointer,
  10579. // non-interface field appearing in ForceSendFields will be sent to the
  10580. // server regardless of whether the field is empty or not. This may be
  10581. // used to include empty fields in Patch requests.
  10582. ForceSendFields []string `json:"-"`
  10583. // NullFields is a list of field names (e.g. "DestinationZone") to
  10584. // include in API requests with the JSON null value. By default, fields
  10585. // with empty values are omitted from API requests. However, any field
  10586. // with an empty value appearing in NullFields will be sent to the
  10587. // server as null. It is an error if a field in this list has a
  10588. // non-empty value. This may be used to include null fields in Patch
  10589. // requests.
  10590. NullFields []string `json:"-"`
  10591. }
  10592. func (s *InstanceMoveRequest) MarshalJSON() ([]byte, error) {
  10593. type NoMethod InstanceMoveRequest
  10594. raw := NoMethod(*s)
  10595. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10596. }
  10597. type InstanceProperties struct {
  10598. // CanIpForward: Enables instances created based on this template to
  10599. // send packets with source IP addresses other than their own and
  10600. // receive packets with destination IP addresses other than their own.
  10601. // If these instances will be used as an IP gateway or it will be set as
  10602. // the next-hop in a Route resource, specify true. If unsure, leave this
  10603. // set to false. See the Enable IP forwarding documentation for more
  10604. // information.
  10605. CanIpForward bool `json:"canIpForward,omitempty"`
  10606. // Description: An optional text description for the instances that are
  10607. // created from this instance template.
  10608. Description string `json:"description,omitempty"`
  10609. // Disks: An array of disks that are associated with the instances that
  10610. // are created from this template.
  10611. Disks []*AttachedDisk `json:"disks,omitempty"`
  10612. // GuestAccelerators: A list of guest accelerator cards' type and count
  10613. // to use for instances created from the instance template.
  10614. GuestAccelerators []*AcceleratorConfig `json:"guestAccelerators,omitempty"`
  10615. // Labels: Labels to apply to instances that are created from this
  10616. // template.
  10617. Labels map[string]string `json:"labels,omitempty"`
  10618. // MachineType: The machine type to use for instances that are created
  10619. // from this template.
  10620. MachineType string `json:"machineType,omitempty"`
  10621. // Metadata: The metadata key/value pairs to assign to instances that
  10622. // are created from this template. These pairs can consist of custom
  10623. // metadata or predefined keys. See Project and instance metadata for
  10624. // more information.
  10625. Metadata *Metadata `json:"metadata,omitempty"`
  10626. // MinCpuPlatform: Minimum cpu/platform to be used by this instance. The
  10627. // instance may be scheduled on the specified or newer cpu/platform.
  10628. // Applicable values are the friendly names of CPU platforms, such as
  10629. // minCpuPlatform: "Intel Haswell" or minCpuPlatform: "Intel Sandy
  10630. // Bridge". For more information, read Specifying a Minimum CPU
  10631. // Platform.
  10632. MinCpuPlatform string `json:"minCpuPlatform,omitempty"`
  10633. // NetworkInterfaces: An array of network access configurations for this
  10634. // interface.
  10635. NetworkInterfaces []*NetworkInterface `json:"networkInterfaces,omitempty"`
  10636. // Scheduling: Specifies the scheduling options for the instances that
  10637. // are created from this template.
  10638. Scheduling *Scheduling `json:"scheduling,omitempty"`
  10639. // ServiceAccounts: A list of service accounts with specified scopes.
  10640. // Access tokens for these service accounts are available to the
  10641. // instances that are created from this template. Use metadata queries
  10642. // to obtain the access tokens for these instances.
  10643. ServiceAccounts []*ServiceAccount `json:"serviceAccounts,omitempty"`
  10644. // ShieldedVmConfig: Specifies the Shielded VM options for the instances
  10645. // that are created from this template.
  10646. ShieldedVmConfig *ShieldedVmConfig `json:"shieldedVmConfig,omitempty"`
  10647. // Tags: A list of tags to apply to the instances that are created from
  10648. // this template. The tags identify valid sources or targets for network
  10649. // firewalls. The setTags method can modify this list of tags. Each tag
  10650. // within the list must comply with RFC1035.
  10651. Tags *Tags `json:"tags,omitempty"`
  10652. // ForceSendFields is a list of field names (e.g. "CanIpForward") to
  10653. // unconditionally include in API requests. By default, fields with
  10654. // empty values are omitted from API requests. However, any non-pointer,
  10655. // non-interface field appearing in ForceSendFields will be sent to the
  10656. // server regardless of whether the field is empty or not. This may be
  10657. // used to include empty fields in Patch requests.
  10658. ForceSendFields []string `json:"-"`
  10659. // NullFields is a list of field names (e.g. "CanIpForward") to include
  10660. // in API requests with the JSON null value. By default, fields with
  10661. // empty values are omitted from API requests. However, any field with
  10662. // an empty value appearing in NullFields will be sent to the server as
  10663. // null. It is an error if a field in this list has a non-empty value.
  10664. // This may be used to include null fields in Patch requests.
  10665. NullFields []string `json:"-"`
  10666. }
  10667. func (s *InstanceProperties) MarshalJSON() ([]byte, error) {
  10668. type NoMethod InstanceProperties
  10669. raw := NoMethod(*s)
  10670. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10671. }
  10672. type InstanceReference struct {
  10673. // Instance: The URL for a specific instance.
  10674. Instance string `json:"instance,omitempty"`
  10675. // ForceSendFields is a list of field names (e.g. "Instance") to
  10676. // unconditionally include in API requests. By default, fields with
  10677. // empty values are omitted from API requests. However, any non-pointer,
  10678. // non-interface field appearing in ForceSendFields will be sent to the
  10679. // server regardless of whether the field is empty or not. This may be
  10680. // used to include empty fields in Patch requests.
  10681. ForceSendFields []string `json:"-"`
  10682. // NullFields is a list of field names (e.g. "Instance") to include in
  10683. // API requests with the JSON null value. By default, fields with empty
  10684. // values are omitted from API requests. However, any field with an
  10685. // empty value appearing in NullFields will be sent to the server as
  10686. // null. It is an error if a field in this list has a non-empty value.
  10687. // This may be used to include null fields in Patch requests.
  10688. NullFields []string `json:"-"`
  10689. }
  10690. func (s *InstanceReference) MarshalJSON() ([]byte, error) {
  10691. type NoMethod InstanceReference
  10692. raw := NoMethod(*s)
  10693. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10694. }
  10695. // InstanceTemplate: An Instance Template resource. (== resource_for
  10696. // beta.instanceTemplates ==) (== resource_for v1.instanceTemplates ==)
  10697. type InstanceTemplate struct {
  10698. // CreationTimestamp: [Output Only] The creation timestamp for this
  10699. // instance template in RFC3339 text format.
  10700. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  10701. // Description: An optional description of this resource. Provide this
  10702. // property when you create the resource.
  10703. Description string `json:"description,omitempty"`
  10704. // Id: [Output Only] A unique identifier for this instance template. The
  10705. // server defines this identifier.
  10706. Id uint64 `json:"id,omitempty,string"`
  10707. // Kind: [Output Only] The resource type, which is always
  10708. // compute#instanceTemplate for instance templates.
  10709. Kind string `json:"kind,omitempty"`
  10710. // Name: Name of the resource; provided by the client when the resource
  10711. // is created. The name must be 1-63 characters long, and comply with
  10712. // RFC1035. Specifically, the name must be 1-63 characters long and
  10713. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  10714. // the first character must be a lowercase letter, and all following
  10715. // characters must be a dash, lowercase letter, or digit, except the
  10716. // last character, which cannot be a dash.
  10717. Name string `json:"name,omitempty"`
  10718. // Properties: The instance properties for this instance template.
  10719. Properties *InstanceProperties `json:"properties,omitempty"`
  10720. // SelfLink: [Output Only] The URL for this instance template. The
  10721. // server defines this URL.
  10722. SelfLink string `json:"selfLink,omitempty"`
  10723. // SourceInstance: The source instance used to create the template. You
  10724. // can provide this as a partial or full URL to the resource. For
  10725. // example, the following are valid values:
  10726. // -
  10727. // https://www.googleapis.com/compute/v1/projects/project/zones/zone/instances/instance
  10728. // - projects/project/zones/zone/instances/instance
  10729. SourceInstance string `json:"sourceInstance,omitempty"`
  10730. // SourceInstanceParams: The source instance params to use to create
  10731. // this instance template.
  10732. SourceInstanceParams *SourceInstanceParams `json:"sourceInstanceParams,omitempty"`
  10733. // ServerResponse contains the HTTP response code and headers from the
  10734. // server.
  10735. googleapi.ServerResponse `json:"-"`
  10736. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  10737. // to unconditionally include in API requests. By default, fields with
  10738. // empty values are omitted from API requests. However, any non-pointer,
  10739. // non-interface field appearing in ForceSendFields will be sent to the
  10740. // server regardless of whether the field is empty or not. This may be
  10741. // used to include empty fields in Patch requests.
  10742. ForceSendFields []string `json:"-"`
  10743. // NullFields is a list of field names (e.g. "CreationTimestamp") to
  10744. // include in API requests with the JSON null value. By default, fields
  10745. // with empty values are omitted from API requests. However, any field
  10746. // with an empty value appearing in NullFields will be sent to the
  10747. // server as null. It is an error if a field in this list has a
  10748. // non-empty value. This may be used to include null fields in Patch
  10749. // requests.
  10750. NullFields []string `json:"-"`
  10751. }
  10752. func (s *InstanceTemplate) MarshalJSON() ([]byte, error) {
  10753. type NoMethod InstanceTemplate
  10754. raw := NoMethod(*s)
  10755. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10756. }
  10757. // InstanceTemplateList: A list of instance templates.
  10758. type InstanceTemplateList struct {
  10759. // Id: [Output Only] Unique identifier for the resource; defined by the
  10760. // server.
  10761. Id string `json:"id,omitempty"`
  10762. // Items: A list of InstanceTemplate resources.
  10763. Items []*InstanceTemplate `json:"items,omitempty"`
  10764. // Kind: [Output Only] The resource type, which is always
  10765. // compute#instanceTemplatesListResponse for instance template lists.
  10766. Kind string `json:"kind,omitempty"`
  10767. // NextPageToken: [Output Only] This token allows you to get the next
  10768. // page of results for list requests. If the number of results is larger
  10769. // than maxResults, use the nextPageToken as a value for the query
  10770. // parameter pageToken in the next list request. Subsequent list
  10771. // requests will have their own nextPageToken to continue paging through
  10772. // the results.
  10773. NextPageToken string `json:"nextPageToken,omitempty"`
  10774. // SelfLink: [Output Only] Server-defined URL for this resource.
  10775. SelfLink string `json:"selfLink,omitempty"`
  10776. // Warning: [Output Only] Informational warning message.
  10777. Warning *InstanceTemplateListWarning `json:"warning,omitempty"`
  10778. // ServerResponse contains the HTTP response code and headers from the
  10779. // server.
  10780. googleapi.ServerResponse `json:"-"`
  10781. // ForceSendFields is a list of field names (e.g. "Id") to
  10782. // unconditionally include in API requests. By default, fields with
  10783. // empty values are omitted from API requests. However, any non-pointer,
  10784. // non-interface field appearing in ForceSendFields will be sent to the
  10785. // server regardless of whether the field is empty or not. This may be
  10786. // used to include empty fields in Patch requests.
  10787. ForceSendFields []string `json:"-"`
  10788. // NullFields is a list of field names (e.g. "Id") to include in API
  10789. // requests with the JSON null value. By default, fields with empty
  10790. // values are omitted from API requests. However, any field with an
  10791. // empty value appearing in NullFields will be sent to the server as
  10792. // null. It is an error if a field in this list has a non-empty value.
  10793. // This may be used to include null fields in Patch requests.
  10794. NullFields []string `json:"-"`
  10795. }
  10796. func (s *InstanceTemplateList) MarshalJSON() ([]byte, error) {
  10797. type NoMethod InstanceTemplateList
  10798. raw := NoMethod(*s)
  10799. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10800. }
  10801. // InstanceTemplateListWarning: [Output Only] Informational warning
  10802. // message.
  10803. type InstanceTemplateListWarning struct {
  10804. // Code: [Output Only] A warning code, if applicable. For example,
  10805. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  10806. // the response.
  10807. //
  10808. // Possible values:
  10809. // "CLEANUP_FAILED"
  10810. // "DEPRECATED_RESOURCE_USED"
  10811. // "DEPRECATED_TYPE_USED"
  10812. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  10813. // "EXPERIMENTAL_TYPE_USED"
  10814. // "EXTERNAL_API_WARNING"
  10815. // "FIELD_VALUE_OVERRIDEN"
  10816. // "INJECTED_KERNELS_DEPRECATED"
  10817. // "MISSING_TYPE_DEPENDENCY"
  10818. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  10819. // "NEXT_HOP_CANNOT_IP_FORWARD"
  10820. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  10821. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  10822. // "NEXT_HOP_NOT_RUNNING"
  10823. // "NOT_CRITICAL_ERROR"
  10824. // "NO_RESULTS_ON_PAGE"
  10825. // "REQUIRED_TOS_AGREEMENT"
  10826. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  10827. // "RESOURCE_NOT_DELETED"
  10828. // "SCHEMA_VALIDATION_IGNORED"
  10829. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  10830. // "UNDECLARED_PROPERTIES"
  10831. // "UNREACHABLE"
  10832. Code string `json:"code,omitempty"`
  10833. // Data: [Output Only] Metadata about this warning in key: value format.
  10834. // For example:
  10835. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  10836. Data []*InstanceTemplateListWarningData `json:"data,omitempty"`
  10837. // Message: [Output Only] A human-readable description of the warning
  10838. // code.
  10839. Message string `json:"message,omitempty"`
  10840. // ForceSendFields is a list of field names (e.g. "Code") 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. "Code") to include in API
  10848. // 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 *InstanceTemplateListWarning) MarshalJSON() ([]byte, error) {
  10856. type NoMethod InstanceTemplateListWarning
  10857. raw := NoMethod(*s)
  10858. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10859. }
  10860. type InstanceTemplateListWarningData struct {
  10861. // Key: [Output Only] A key that provides more detail on the warning
  10862. // being returned. For example, for warnings where there are no results
  10863. // in a list request for a particular zone, this key might be scope and
  10864. // the key value might be the zone name. Other examples might be a key
  10865. // indicating a deprecated resource and a suggested replacement, or a
  10866. // warning about invalid network settings (for example, if an instance
  10867. // attempts to perform IP forwarding but is not enabled for IP
  10868. // forwarding).
  10869. Key string `json:"key,omitempty"`
  10870. // Value: [Output Only] A warning data value corresponding to the key.
  10871. Value string `json:"value,omitempty"`
  10872. // ForceSendFields is a list of field names (e.g. "Key") to
  10873. // unconditionally include in API requests. By default, fields with
  10874. // empty values are omitted from API requests. However, any non-pointer,
  10875. // non-interface field appearing in ForceSendFields will be sent to the
  10876. // server regardless of whether the field is empty or not. This may be
  10877. // used to include empty fields in Patch requests.
  10878. ForceSendFields []string `json:"-"`
  10879. // NullFields is a list of field names (e.g. "Key") to include in API
  10880. // requests with the JSON null value. By default, fields with empty
  10881. // values are omitted from API requests. However, any field with an
  10882. // empty value appearing in NullFields will be sent to the server as
  10883. // null. It is an error if a field in this list has a non-empty value.
  10884. // This may be used to include null fields in Patch requests.
  10885. NullFields []string `json:"-"`
  10886. }
  10887. func (s *InstanceTemplateListWarningData) MarshalJSON() ([]byte, error) {
  10888. type NoMethod InstanceTemplateListWarningData
  10889. raw := NoMethod(*s)
  10890. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10891. }
  10892. type InstanceWithNamedPorts struct {
  10893. // Instance: [Output Only] The URL of the instance.
  10894. Instance string `json:"instance,omitempty"`
  10895. // NamedPorts: [Output Only] The named ports that belong to this
  10896. // instance group.
  10897. NamedPorts []*NamedPort `json:"namedPorts,omitempty"`
  10898. // Status: [Output Only] The status of the instance.
  10899. //
  10900. // Possible values:
  10901. // "PROVISIONING"
  10902. // "RUNNING"
  10903. // "STAGING"
  10904. // "STOPPED"
  10905. // "STOPPING"
  10906. // "SUSPENDED"
  10907. // "SUSPENDING"
  10908. // "TERMINATED"
  10909. Status string `json:"status,omitempty"`
  10910. // ForceSendFields is a list of field names (e.g. "Instance") to
  10911. // unconditionally include in API requests. By default, fields with
  10912. // empty values are omitted from API requests. However, any non-pointer,
  10913. // non-interface field appearing in ForceSendFields will be sent to the
  10914. // server regardless of whether the field is empty or not. This may be
  10915. // used to include empty fields in Patch requests.
  10916. ForceSendFields []string `json:"-"`
  10917. // NullFields is a list of field names (e.g. "Instance") to include in
  10918. // API requests with the JSON null value. By default, fields with empty
  10919. // values are omitted from API requests. However, any field with an
  10920. // empty value appearing in NullFields will be sent to the server as
  10921. // null. It is an error if a field in this list has a non-empty value.
  10922. // This may be used to include null fields in Patch requests.
  10923. NullFields []string `json:"-"`
  10924. }
  10925. func (s *InstanceWithNamedPorts) MarshalJSON() ([]byte, error) {
  10926. type NoMethod InstanceWithNamedPorts
  10927. raw := NoMethod(*s)
  10928. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10929. }
  10930. type InstancesScopedList struct {
  10931. // Instances: [Output Only] A list of instances contained in this scope.
  10932. Instances []*Instance `json:"instances,omitempty"`
  10933. // Warning: [Output Only] Informational warning which replaces the list
  10934. // of instances when the list is empty.
  10935. Warning *InstancesScopedListWarning `json:"warning,omitempty"`
  10936. // ForceSendFields is a list of field names (e.g. "Instances") to
  10937. // unconditionally include in API requests. By default, fields with
  10938. // empty values are omitted from API requests. However, any non-pointer,
  10939. // non-interface field appearing in ForceSendFields will be sent to the
  10940. // server regardless of whether the field is empty or not. This may be
  10941. // used to include empty fields in Patch requests.
  10942. ForceSendFields []string `json:"-"`
  10943. // NullFields is a list of field names (e.g. "Instances") to include in
  10944. // API requests with the JSON null value. By default, fields with empty
  10945. // values are omitted from API requests. However, any field with an
  10946. // empty value appearing in NullFields will be sent to the server as
  10947. // null. It is an error if a field in this list has a non-empty value.
  10948. // This may be used to include null fields in Patch requests.
  10949. NullFields []string `json:"-"`
  10950. }
  10951. func (s *InstancesScopedList) MarshalJSON() ([]byte, error) {
  10952. type NoMethod InstancesScopedList
  10953. raw := NoMethod(*s)
  10954. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10955. }
  10956. // InstancesScopedListWarning: [Output Only] Informational warning which
  10957. // replaces the list of instances when the list is empty.
  10958. type InstancesScopedListWarning struct {
  10959. // Code: [Output Only] A warning code, if applicable. For example,
  10960. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  10961. // the response.
  10962. //
  10963. // Possible values:
  10964. // "CLEANUP_FAILED"
  10965. // "DEPRECATED_RESOURCE_USED"
  10966. // "DEPRECATED_TYPE_USED"
  10967. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  10968. // "EXPERIMENTAL_TYPE_USED"
  10969. // "EXTERNAL_API_WARNING"
  10970. // "FIELD_VALUE_OVERRIDEN"
  10971. // "INJECTED_KERNELS_DEPRECATED"
  10972. // "MISSING_TYPE_DEPENDENCY"
  10973. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  10974. // "NEXT_HOP_CANNOT_IP_FORWARD"
  10975. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  10976. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  10977. // "NEXT_HOP_NOT_RUNNING"
  10978. // "NOT_CRITICAL_ERROR"
  10979. // "NO_RESULTS_ON_PAGE"
  10980. // "REQUIRED_TOS_AGREEMENT"
  10981. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  10982. // "RESOURCE_NOT_DELETED"
  10983. // "SCHEMA_VALIDATION_IGNORED"
  10984. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  10985. // "UNDECLARED_PROPERTIES"
  10986. // "UNREACHABLE"
  10987. Code string `json:"code,omitempty"`
  10988. // Data: [Output Only] Metadata about this warning in key: value format.
  10989. // For example:
  10990. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  10991. Data []*InstancesScopedListWarningData `json:"data,omitempty"`
  10992. // Message: [Output Only] A human-readable description of the warning
  10993. // code.
  10994. Message string `json:"message,omitempty"`
  10995. // ForceSendFields is a list of field names (e.g. "Code") to
  10996. // unconditionally include in API requests. By default, fields with
  10997. // empty values are omitted from API requests. However, any non-pointer,
  10998. // non-interface field appearing in ForceSendFields will be sent to the
  10999. // server regardless of whether the field is empty or not. This may be
  11000. // used to include empty fields in Patch requests.
  11001. ForceSendFields []string `json:"-"`
  11002. // NullFields is a list of field names (e.g. "Code") to include in API
  11003. // requests with the JSON null value. By default, fields with empty
  11004. // values are omitted from API requests. However, any field with an
  11005. // empty value appearing in NullFields will be sent to the server as
  11006. // null. It is an error if a field in this list has a non-empty value.
  11007. // This may be used to include null fields in Patch requests.
  11008. NullFields []string `json:"-"`
  11009. }
  11010. func (s *InstancesScopedListWarning) MarshalJSON() ([]byte, error) {
  11011. type NoMethod InstancesScopedListWarning
  11012. raw := NoMethod(*s)
  11013. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11014. }
  11015. type InstancesScopedListWarningData struct {
  11016. // Key: [Output Only] A key that provides more detail on the warning
  11017. // being returned. For example, for warnings where there are no results
  11018. // in a list request for a particular zone, this key might be scope and
  11019. // the key value might be the zone name. Other examples might be a key
  11020. // indicating a deprecated resource and a suggested replacement, or a
  11021. // warning about invalid network settings (for example, if an instance
  11022. // attempts to perform IP forwarding but is not enabled for IP
  11023. // forwarding).
  11024. Key string `json:"key,omitempty"`
  11025. // Value: [Output Only] A warning data value corresponding to the key.
  11026. Value string `json:"value,omitempty"`
  11027. // ForceSendFields is a list of field names (e.g. "Key") to
  11028. // unconditionally include in API requests. By default, fields with
  11029. // empty values are omitted from API requests. However, any non-pointer,
  11030. // non-interface field appearing in ForceSendFields will be sent to the
  11031. // server regardless of whether the field is empty or not. This may be
  11032. // used to include empty fields in Patch requests.
  11033. ForceSendFields []string `json:"-"`
  11034. // NullFields is a list of field names (e.g. "Key") to include in API
  11035. // requests with the JSON null value. By default, fields with empty
  11036. // values are omitted from API requests. However, any field with an
  11037. // empty value appearing in NullFields will be sent to the server as
  11038. // null. It is an error if a field in this list has a non-empty value.
  11039. // This may be used to include null fields in Patch requests.
  11040. NullFields []string `json:"-"`
  11041. }
  11042. func (s *InstancesScopedListWarningData) MarshalJSON() ([]byte, error) {
  11043. type NoMethod InstancesScopedListWarningData
  11044. raw := NoMethod(*s)
  11045. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11046. }
  11047. type InstancesSetLabelsRequest struct {
  11048. // LabelFingerprint: Fingerprint of the previous set of labels for this
  11049. // resource, used to prevent conflicts. Provide the latest fingerprint
  11050. // value when making a request to add or change labels.
  11051. LabelFingerprint string `json:"labelFingerprint,omitempty"`
  11052. Labels map[string]string `json:"labels,omitempty"`
  11053. // ForceSendFields is a list of field names (e.g. "LabelFingerprint") to
  11054. // unconditionally include in API requests. By default, fields with
  11055. // empty values are omitted from API requests. However, any non-pointer,
  11056. // non-interface field appearing in ForceSendFields will be sent to the
  11057. // server regardless of whether the field is empty or not. This may be
  11058. // used to include empty fields in Patch requests.
  11059. ForceSendFields []string `json:"-"`
  11060. // NullFields is a list of field names (e.g. "LabelFingerprint") to
  11061. // include in API requests with the JSON null value. By default, fields
  11062. // with empty values are omitted from API requests. However, any field
  11063. // with an empty value appearing in NullFields will be sent to the
  11064. // server as null. It is an error if a field in this list has a
  11065. // non-empty value. This may be used to include null fields in Patch
  11066. // requests.
  11067. NullFields []string `json:"-"`
  11068. }
  11069. func (s *InstancesSetLabelsRequest) MarshalJSON() ([]byte, error) {
  11070. type NoMethod InstancesSetLabelsRequest
  11071. raw := NoMethod(*s)
  11072. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11073. }
  11074. type InstancesSetMachineResourcesRequest struct {
  11075. // GuestAccelerators: A list of the type and count of accelerator cards
  11076. // attached to the instance.
  11077. GuestAccelerators []*AcceleratorConfig `json:"guestAccelerators,omitempty"`
  11078. // ForceSendFields is a list of field names (e.g. "GuestAccelerators")
  11079. // to unconditionally include in API requests. By default, fields with
  11080. // empty values are omitted from API requests. However, any non-pointer,
  11081. // non-interface field appearing in ForceSendFields will be sent to the
  11082. // server regardless of whether the field is empty or not. This may be
  11083. // used to include empty fields in Patch requests.
  11084. ForceSendFields []string `json:"-"`
  11085. // NullFields is a list of field names (e.g. "GuestAccelerators") to
  11086. // include in API requests with the JSON null value. By default, fields
  11087. // with empty values are omitted from API requests. However, any field
  11088. // with an empty value appearing in NullFields will be sent to the
  11089. // server as null. It is an error if a field in this list has a
  11090. // non-empty value. This may be used to include null fields in Patch
  11091. // requests.
  11092. NullFields []string `json:"-"`
  11093. }
  11094. func (s *InstancesSetMachineResourcesRequest) MarshalJSON() ([]byte, error) {
  11095. type NoMethod InstancesSetMachineResourcesRequest
  11096. raw := NoMethod(*s)
  11097. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11098. }
  11099. type InstancesSetMachineTypeRequest struct {
  11100. // MachineType: Full or partial URL of the machine type resource. See
  11101. // Machine Types for a full list of machine types. For example:
  11102. // zones/us-central1-f/machineTypes/n1-standard-1
  11103. MachineType string `json:"machineType,omitempty"`
  11104. // ForceSendFields is a list of field names (e.g. "MachineType") to
  11105. // unconditionally include in API requests. By default, fields with
  11106. // empty values are omitted from API requests. However, any non-pointer,
  11107. // non-interface field appearing in ForceSendFields will be sent to the
  11108. // server regardless of whether the field is empty or not. This may be
  11109. // used to include empty fields in Patch requests.
  11110. ForceSendFields []string `json:"-"`
  11111. // NullFields is a list of field names (e.g. "MachineType") to include
  11112. // in API requests with the JSON null value. By default, fields with
  11113. // empty values are omitted from API requests. However, any field with
  11114. // an empty value appearing in NullFields will be sent to the server as
  11115. // null. It is an error if a field in this list has a non-empty value.
  11116. // This may be used to include null fields in Patch requests.
  11117. NullFields []string `json:"-"`
  11118. }
  11119. func (s *InstancesSetMachineTypeRequest) MarshalJSON() ([]byte, error) {
  11120. type NoMethod InstancesSetMachineTypeRequest
  11121. raw := NoMethod(*s)
  11122. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11123. }
  11124. type InstancesSetMinCpuPlatformRequest struct {
  11125. // MinCpuPlatform: Minimum cpu/platform this instance should be started
  11126. // at.
  11127. MinCpuPlatform string `json:"minCpuPlatform,omitempty"`
  11128. // ForceSendFields is a list of field names (e.g. "MinCpuPlatform") to
  11129. // unconditionally include in API requests. By default, fields with
  11130. // empty values are omitted from API requests. However, any non-pointer,
  11131. // non-interface field appearing in ForceSendFields will be sent to the
  11132. // server regardless of whether the field is empty or not. This may be
  11133. // used to include empty fields in Patch requests.
  11134. ForceSendFields []string `json:"-"`
  11135. // NullFields is a list of field names (e.g. "MinCpuPlatform") to
  11136. // include in API requests with the JSON null value. By default, fields
  11137. // with empty values are omitted from API requests. However, any field
  11138. // with an empty value appearing in NullFields will be sent to the
  11139. // server as null. It is an error if a field in this list has a
  11140. // non-empty value. This may be used to include null fields in Patch
  11141. // requests.
  11142. NullFields []string `json:"-"`
  11143. }
  11144. func (s *InstancesSetMinCpuPlatformRequest) MarshalJSON() ([]byte, error) {
  11145. type NoMethod InstancesSetMinCpuPlatformRequest
  11146. raw := NoMethod(*s)
  11147. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11148. }
  11149. type InstancesSetServiceAccountRequest struct {
  11150. // Email: Email address of the service account.
  11151. Email string `json:"email,omitempty"`
  11152. // Scopes: The list of scopes to be made available for this service
  11153. // account.
  11154. Scopes []string `json:"scopes,omitempty"`
  11155. // ForceSendFields is a list of field names (e.g. "Email") to
  11156. // unconditionally include in API requests. By default, fields with
  11157. // empty values are omitted from API requests. However, any non-pointer,
  11158. // non-interface field appearing in ForceSendFields will be sent to the
  11159. // server regardless of whether the field is empty or not. This may be
  11160. // used to include empty fields in Patch requests.
  11161. ForceSendFields []string `json:"-"`
  11162. // NullFields is a list of field names (e.g. "Email") to include in API
  11163. // requests with the JSON null value. By default, fields with empty
  11164. // values are omitted from API requests. However, any field with an
  11165. // empty value appearing in NullFields will be sent to the server as
  11166. // null. It is an error if a field in this list has a non-empty value.
  11167. // This may be used to include null fields in Patch requests.
  11168. NullFields []string `json:"-"`
  11169. }
  11170. func (s *InstancesSetServiceAccountRequest) MarshalJSON() ([]byte, error) {
  11171. type NoMethod InstancesSetServiceAccountRequest
  11172. raw := NoMethod(*s)
  11173. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11174. }
  11175. type InstancesStartWithEncryptionKeyRequest struct {
  11176. // Disks: Array of disks associated with this instance that are
  11177. // protected with a customer-supplied encryption key.
  11178. //
  11179. // In order to start the instance, the disk url and its corresponding
  11180. // key must be provided.
  11181. //
  11182. // If the disk is not protected with a customer-supplied encryption key
  11183. // it should not be specified.
  11184. Disks []*CustomerEncryptionKeyProtectedDisk `json:"disks,omitempty"`
  11185. // ForceSendFields is a list of field names (e.g. "Disks") to
  11186. // unconditionally include in API requests. By default, fields with
  11187. // empty values are omitted from API requests. However, any non-pointer,
  11188. // non-interface field appearing in ForceSendFields will be sent to the
  11189. // server regardless of whether the field is empty or not. This may be
  11190. // used to include empty fields in Patch requests.
  11191. ForceSendFields []string `json:"-"`
  11192. // NullFields is a list of field names (e.g. "Disks") to include in API
  11193. // requests with the JSON null value. By default, fields with empty
  11194. // values are omitted from API requests. However, any field with an
  11195. // empty value appearing in NullFields will be sent to the server as
  11196. // null. It is an error if a field in this list has a non-empty value.
  11197. // This may be used to include null fields in Patch requests.
  11198. NullFields []string `json:"-"`
  11199. }
  11200. func (s *InstancesStartWithEncryptionKeyRequest) MarshalJSON() ([]byte, error) {
  11201. type NoMethod InstancesStartWithEncryptionKeyRequest
  11202. raw := NoMethod(*s)
  11203. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11204. }
  11205. // Interconnect: Represents an Interconnects resource. The Interconnects
  11206. // resource is a dedicated connection between Google's network and your
  11207. // on-premises network. For more information, see the Dedicated
  11208. // overview page. (== resource_for v1.interconnects ==) (== resource_for
  11209. // beta.interconnects ==)
  11210. type Interconnect struct {
  11211. // AdminEnabled: Administrative status of the interconnect. When this is
  11212. // set to true, the Interconnect is functional and can carry traffic.
  11213. // When set to false, no packets can be carried over the interconnect
  11214. // and no BGP routes are exchanged over it. By default, the status is
  11215. // set to true.
  11216. AdminEnabled bool `json:"adminEnabled,omitempty"`
  11217. // CircuitInfos: [Output Only] A list of CircuitInfo objects, that
  11218. // describe the individual circuits in this LAG.
  11219. CircuitInfos []*InterconnectCircuitInfo `json:"circuitInfos,omitempty"`
  11220. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  11221. // format.
  11222. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  11223. // CustomerName: Customer name, to put in the Letter of Authorization as
  11224. // the party authorized to request a crossconnect.
  11225. CustomerName string `json:"customerName,omitempty"`
  11226. // Description: An optional description of this resource. Provide this
  11227. // property when you create the resource.
  11228. Description string `json:"description,omitempty"`
  11229. // ExpectedOutages: [Output Only] A list of outages expected for this
  11230. // Interconnect.
  11231. ExpectedOutages []*InterconnectOutageNotification `json:"expectedOutages,omitempty"`
  11232. // GoogleIpAddress: [Output Only] IP address configured on the Google
  11233. // side of the Interconnect link. This can be used only for ping tests.
  11234. GoogleIpAddress string `json:"googleIpAddress,omitempty"`
  11235. // GoogleReferenceId: [Output Only] Google reference ID; to be used when
  11236. // raising support tickets with Google or otherwise to debug backend
  11237. // connectivity issues.
  11238. GoogleReferenceId string `json:"googleReferenceId,omitempty"`
  11239. // Id: [Output Only] The unique identifier for the resource. This
  11240. // identifier is defined by the server.
  11241. Id uint64 `json:"id,omitempty,string"`
  11242. // InterconnectAttachments: [Output Only] A list of the URLs of all
  11243. // InterconnectAttachments configured to use this Interconnect.
  11244. InterconnectAttachments []string `json:"interconnectAttachments,omitempty"`
  11245. // InterconnectType: Type of interconnect. Note that "IT_PRIVATE" has
  11246. // been deprecated in favor of "DEDICATED"
  11247. //
  11248. // Possible values:
  11249. // "DEDICATED"
  11250. // "IT_PRIVATE"
  11251. // "PARTNER"
  11252. InterconnectType string `json:"interconnectType,omitempty"`
  11253. // Kind: [Output Only] Type of the resource. Always compute#interconnect
  11254. // for interconnects.
  11255. Kind string `json:"kind,omitempty"`
  11256. // LabelFingerprint: A fingerprint for the labels being applied to this
  11257. // Interconnect, which is essentially a hash of the labels set used for
  11258. // optimistic locking. The fingerprint is initially generated by Compute
  11259. // Engine and changes after every request to modify or update labels.
  11260. // You must always provide an up-to-date fingerprint hash in order to
  11261. // update or change labels.
  11262. //
  11263. // To see the latest fingerprint, make a get() request to retrieve an
  11264. // Interconnect.
  11265. LabelFingerprint string `json:"labelFingerprint,omitempty"`
  11266. // Labels: Labels to apply to this Interconnect resource. These can be
  11267. // later modified by the setLabels method. Each label key/value must
  11268. // comply with RFC1035. Label values may be empty.
  11269. Labels map[string]string `json:"labels,omitempty"`
  11270. // LinkType: Type of link requested. This field indicates speed of each
  11271. // of the links in the bundle, not the entire bundle. Only 10G per link
  11272. // is allowed for a dedicated interconnect. Options: Ethernet_10G_LR
  11273. //
  11274. // Possible values:
  11275. // "LINK_TYPE_ETHERNET_10G_LR"
  11276. LinkType string `json:"linkType,omitempty"`
  11277. // Location: URL of the InterconnectLocation object that represents
  11278. // where this connection is to be provisioned.
  11279. Location string `json:"location,omitempty"`
  11280. // Name: Name of the resource. Provided by the client when the resource
  11281. // is created. The name must be 1-63 characters long, and comply with
  11282. // RFC1035. Specifically, the name must be 1-63 characters long and
  11283. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  11284. // the first character must be a lowercase letter, and all following
  11285. // characters must be a dash, lowercase letter, or digit, except the
  11286. // last character, which cannot be a dash.
  11287. Name string `json:"name,omitempty"`
  11288. // NocContactEmail: Email address to contact the customer NOC for
  11289. // operations and maintenance notifications regarding this Interconnect.
  11290. // If specified, this will be used for notifications in addition to all
  11291. // other forms described, such as Stackdriver logs alerting and Cloud
  11292. // Notifications.
  11293. NocContactEmail string `json:"nocContactEmail,omitempty"`
  11294. // OperationalStatus: [Output Only] The current status of whether or not
  11295. // this Interconnect is functional.
  11296. //
  11297. // Possible values:
  11298. // "OS_ACTIVE"
  11299. // "OS_UNPROVISIONED"
  11300. OperationalStatus string `json:"operationalStatus,omitempty"`
  11301. // PeerIpAddress: [Output Only] IP address configured on the customer
  11302. // side of the Interconnect link. The customer should configure this IP
  11303. // address during turnup when prompted by Google NOC. This can be used
  11304. // only for ping tests.
  11305. PeerIpAddress string `json:"peerIpAddress,omitempty"`
  11306. // ProvisionedLinkCount: [Output Only] Number of links actually
  11307. // provisioned in this interconnect.
  11308. ProvisionedLinkCount int64 `json:"provisionedLinkCount,omitempty"`
  11309. // RequestedLinkCount: Target number of physical links in the link
  11310. // bundle, as requested by the customer.
  11311. RequestedLinkCount int64 `json:"requestedLinkCount,omitempty"`
  11312. // SelfLink: [Output Only] Server-defined URL for the resource.
  11313. SelfLink string `json:"selfLink,omitempty"`
  11314. // State: [Output Only] The current state of whether or not this
  11315. // Interconnect is functional.
  11316. //
  11317. // Possible values:
  11318. // "ACTIVE"
  11319. // "UNPROVISIONED"
  11320. State string `json:"state,omitempty"`
  11321. // ServerResponse contains the HTTP response code and headers from the
  11322. // server.
  11323. googleapi.ServerResponse `json:"-"`
  11324. // ForceSendFields is a list of field names (e.g. "AdminEnabled") to
  11325. // unconditionally include in API requests. By default, fields with
  11326. // empty values are omitted from API requests. However, any non-pointer,
  11327. // non-interface field appearing in ForceSendFields will be sent to the
  11328. // server regardless of whether the field is empty or not. This may be
  11329. // used to include empty fields in Patch requests.
  11330. ForceSendFields []string `json:"-"`
  11331. // NullFields is a list of field names (e.g. "AdminEnabled") to include
  11332. // in API requests with the JSON null value. By default, fields with
  11333. // empty values are omitted from API requests. However, any field with
  11334. // an empty value appearing in NullFields will be sent to the server as
  11335. // null. It is an error if a field in this list has a non-empty value.
  11336. // This may be used to include null fields in Patch requests.
  11337. NullFields []string `json:"-"`
  11338. }
  11339. func (s *Interconnect) MarshalJSON() ([]byte, error) {
  11340. type NoMethod Interconnect
  11341. raw := NoMethod(*s)
  11342. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11343. }
  11344. // InterconnectAttachment: Represents an InterconnectAttachment (VLAN
  11345. // attachment) resource. For more information, see Creating VLAN
  11346. // Attachments. (== resource_for beta.interconnectAttachments ==) (==
  11347. // resource_for v1.interconnectAttachments ==)
  11348. type InterconnectAttachment struct {
  11349. // AdminEnabled: Determines whether this Attachment will carry packets.
  11350. // Not present for PARTNER_PROVIDER.
  11351. AdminEnabled bool `json:"adminEnabled,omitempty"`
  11352. // Bandwidth: Provisioned bandwidth capacity for the
  11353. // interconnectAttachment. Can be set by the partner to update the
  11354. // customer's provisioned bandwidth. Output only for for PARTNER type,
  11355. // mutable for PARTNER_PROVIDER, not available for DEDICATED.
  11356. //
  11357. // Possible values:
  11358. // "BPS_100M"
  11359. // "BPS_10G"
  11360. // "BPS_1G"
  11361. // "BPS_200M"
  11362. // "BPS_2G"
  11363. // "BPS_300M"
  11364. // "BPS_400M"
  11365. // "BPS_500M"
  11366. // "BPS_50M"
  11367. // "BPS_5G"
  11368. Bandwidth string `json:"bandwidth,omitempty"`
  11369. // CandidateSubnets: Up to 16 candidate prefixes that can be used to
  11370. // restrict the allocation of cloudRouterIpAddress and
  11371. // customerRouterIpAddress for this attachment. All prefixes must be
  11372. // within link-local address space (169.254.0.0/16) and must be /29 or
  11373. // shorter (/28, /27, etc). Google will attempt to select an unused /29
  11374. // from the supplied candidate prefix(es). The request will fail if all
  11375. // possible /29s are in use on Google?s edge. If not supplied, Google
  11376. // will randomly select an unused /29 from all of link-local space.
  11377. CandidateSubnets []string `json:"candidateSubnets,omitempty"`
  11378. // CloudRouterIpAddress: [Output Only] IPv4 address + prefix length to
  11379. // be configured on Cloud Router Interface for this interconnect
  11380. // attachment.
  11381. CloudRouterIpAddress string `json:"cloudRouterIpAddress,omitempty"`
  11382. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  11383. // format.
  11384. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  11385. // CustomerRouterIpAddress: [Output Only] IPv4 address + prefix length
  11386. // to be configured on the customer router subinterface for this
  11387. // interconnect attachment.
  11388. CustomerRouterIpAddress string `json:"customerRouterIpAddress,omitempty"`
  11389. // Description: An optional description of this resource.
  11390. Description string `json:"description,omitempty"`
  11391. // EdgeAvailabilityDomain: Desired availability domain for the
  11392. // attachment. Only available for type PARTNER, at creation time. For
  11393. // improved reliability, customers should configure a pair of
  11394. // attachments with one per availability domain. The selected
  11395. // availability domain will be provided to the Partner via the pairing
  11396. // key so that the provisioned circuit will lie in the specified domain.
  11397. // If not specified, the value will default to AVAILABILITY_DOMAIN_ANY.
  11398. //
  11399. // Possible values:
  11400. // "AVAILABILITY_DOMAIN_1"
  11401. // "AVAILABILITY_DOMAIN_2"
  11402. // "AVAILABILITY_DOMAIN_ANY"
  11403. EdgeAvailabilityDomain string `json:"edgeAvailabilityDomain,omitempty"`
  11404. // GoogleReferenceId: [Output Only] Google reference ID, to be used when
  11405. // raising support tickets with Google or otherwise to debug backend
  11406. // connectivity issues.
  11407. GoogleReferenceId string `json:"googleReferenceId,omitempty"`
  11408. // Id: [Output Only] The unique identifier for the resource. This
  11409. // identifier is defined by the server.
  11410. Id uint64 `json:"id,omitempty,string"`
  11411. // Interconnect: URL of the underlying Interconnect object that this
  11412. // attachment's traffic will traverse through.
  11413. Interconnect string `json:"interconnect,omitempty"`
  11414. // Kind: [Output Only] Type of the resource. Always
  11415. // compute#interconnectAttachment for interconnect attachments.
  11416. Kind string `json:"kind,omitempty"`
  11417. // LabelFingerprint: A fingerprint for the labels being applied to this
  11418. // InterconnectAttachment, which is essentially a hash of the labels set
  11419. // used for optimistic locking. The fingerprint is initially generated
  11420. // by Compute Engine and changes after every request to modify or update
  11421. // labels. You must always provide an up-to-date fingerprint hash in
  11422. // order to update or change labels.
  11423. //
  11424. // To see the latest fingerprint, make a get() request to retrieve an
  11425. // InterconnectAttachment.
  11426. LabelFingerprint string `json:"labelFingerprint,omitempty"`
  11427. // Labels: Labels to apply to this InterconnectAttachment resource.
  11428. // These can be later modified by the setLabels method. Each label
  11429. // key/value must comply with RFC1035. Label values may be empty.
  11430. Labels map[string]string `json:"labels,omitempty"`
  11431. // Name: Name of the resource. Provided by the client when the resource
  11432. // is created. The name must be 1-63 characters long, and comply with
  11433. // RFC1035. Specifically, the name must be 1-63 characters long and
  11434. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  11435. // the first character must be a lowercase letter, and all following
  11436. // characters must be a dash, lowercase letter, or digit, except the
  11437. // last character, which cannot be a dash.
  11438. Name string `json:"name,omitempty"`
  11439. // OperationalStatus: [Output Only] The current status of whether or not
  11440. // this interconnect attachment is functional.
  11441. //
  11442. // Possible values:
  11443. // "OS_ACTIVE"
  11444. // "OS_UNPROVISIONED"
  11445. OperationalStatus string `json:"operationalStatus,omitempty"`
  11446. // PairingKey: [Output only for type PARTNER. Input only for
  11447. // PARTNER_PROVIDER. Not present for DEDICATED]. The opaque identifier
  11448. // of an PARTNER attachment used to initiate provisioning with a
  11449. // selected partner. Of the form "XXXXX/region/domain"
  11450. PairingKey string `json:"pairingKey,omitempty"`
  11451. // PartnerAsn: Optional BGP ASN for the router that should be supplied
  11452. // by a layer 3 Partner if they configured BGP on behalf of the
  11453. // customer. Output only for PARTNER type, input only for
  11454. // PARTNER_PROVIDER, not available for DEDICATED.
  11455. PartnerAsn int64 `json:"partnerAsn,omitempty,string"`
  11456. // PartnerMetadata: Informational metadata about Partner attachments
  11457. // from Partners to display to customers. Output only for for PARTNER
  11458. // type, mutable for PARTNER_PROVIDER, not available for DEDICATED.
  11459. PartnerMetadata *InterconnectAttachmentPartnerMetadata `json:"partnerMetadata,omitempty"`
  11460. // PrivateInterconnectInfo: [Output Only] Information specific to an
  11461. // InterconnectAttachment. This property is populated if the
  11462. // interconnect that this is attached to is of type DEDICATED.
  11463. PrivateInterconnectInfo *InterconnectAttachmentPrivateInfo `json:"privateInterconnectInfo,omitempty"`
  11464. // Region: [Output Only] URL of the region where the regional
  11465. // interconnect attachment resides. You must specify this field as part
  11466. // of the HTTP request URL. It is not settable as a field in the request
  11467. // body.
  11468. Region string `json:"region,omitempty"`
  11469. // Router: URL of the cloud router to be used for dynamic routing. This
  11470. // router must be in the same region as this InterconnectAttachment. The
  11471. // InterconnectAttachment will automatically connect the Interconnect to
  11472. // the network & region within which the Cloud Router is configured.
  11473. Router string `json:"router,omitempty"`
  11474. // SelfLink: [Output Only] Server-defined URL for the resource.
  11475. SelfLink string `json:"selfLink,omitempty"`
  11476. // State: [Output Only] The current state of this attachment's
  11477. // functionality.
  11478. //
  11479. // Possible values:
  11480. // "ACTIVE"
  11481. // "DEFUNCT"
  11482. // "PARTNER_REQUEST_RECEIVED"
  11483. // "PENDING_CUSTOMER"
  11484. // "PENDING_PARTNER"
  11485. // "STATE_UNSPECIFIED"
  11486. // "UNPROVISIONED"
  11487. State string `json:"state,omitempty"`
  11488. // Possible values:
  11489. // "DEDICATED"
  11490. // "PARTNER"
  11491. // "PARTNER_PROVIDER"
  11492. Type string `json:"type,omitempty"`
  11493. // VlanTag8021q: Available only for DEDICATED and PARTNER_PROVIDER.
  11494. // Desired VLAN tag for this attachment, in the range 2-4094. This field
  11495. // refers to 802.1q VLAN tag, also known as IEEE 802.1Q Only specified
  11496. // at creation time.
  11497. VlanTag8021q int64 `json:"vlanTag8021q,omitempty"`
  11498. // ServerResponse contains the HTTP response code and headers from the
  11499. // server.
  11500. googleapi.ServerResponse `json:"-"`
  11501. // ForceSendFields is a list of field names (e.g. "AdminEnabled") to
  11502. // unconditionally include in API requests. By default, fields with
  11503. // empty values are omitted from API requests. However, any non-pointer,
  11504. // non-interface field appearing in ForceSendFields will be sent to the
  11505. // server regardless of whether the field is empty or not. This may be
  11506. // used to include empty fields in Patch requests.
  11507. ForceSendFields []string `json:"-"`
  11508. // NullFields is a list of field names (e.g. "AdminEnabled") to include
  11509. // in API requests with the JSON null value. By default, fields with
  11510. // empty values are omitted from API requests. However, any field with
  11511. // an empty value appearing in NullFields will be sent to the server as
  11512. // null. It is an error if a field in this list has a non-empty value.
  11513. // This may be used to include null fields in Patch requests.
  11514. NullFields []string `json:"-"`
  11515. }
  11516. func (s *InterconnectAttachment) MarshalJSON() ([]byte, error) {
  11517. type NoMethod InterconnectAttachment
  11518. raw := NoMethod(*s)
  11519. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11520. }
  11521. type InterconnectAttachmentAggregatedList struct {
  11522. // Id: [Output Only] Unique identifier for the resource; defined by the
  11523. // server.
  11524. Id string `json:"id,omitempty"`
  11525. // Items: A list of InterconnectAttachmentsScopedList resources.
  11526. Items map[string]InterconnectAttachmentsScopedList `json:"items,omitempty"`
  11527. // Kind: [Output Only] Type of resource. Always
  11528. // compute#interconnectAttachmentAggregatedList for aggregated lists of
  11529. // interconnect attachments.
  11530. Kind string `json:"kind,omitempty"`
  11531. // NextPageToken: [Output Only] This token allows you to get the next
  11532. // page of results for list requests. If the number of results is larger
  11533. // than maxResults, use the nextPageToken as a value for the query
  11534. // parameter pageToken in the next list request. Subsequent list
  11535. // requests will have their own nextPageToken to continue paging through
  11536. // the results.
  11537. NextPageToken string `json:"nextPageToken,omitempty"`
  11538. // SelfLink: [Output Only] Server-defined URL for this resource.
  11539. SelfLink string `json:"selfLink,omitempty"`
  11540. // Warning: [Output Only] Informational warning message.
  11541. Warning *InterconnectAttachmentAggregatedListWarning `json:"warning,omitempty"`
  11542. // ServerResponse contains the HTTP response code and headers from the
  11543. // server.
  11544. googleapi.ServerResponse `json:"-"`
  11545. // ForceSendFields is a list of field names (e.g. "Id") to
  11546. // unconditionally include in API requests. By default, fields with
  11547. // empty values are omitted from API requests. However, any non-pointer,
  11548. // non-interface field appearing in ForceSendFields will be sent to the
  11549. // server regardless of whether the field is empty or not. This may be
  11550. // used to include empty fields in Patch requests.
  11551. ForceSendFields []string `json:"-"`
  11552. // NullFields is a list of field names (e.g. "Id") to include in API
  11553. // requests with the JSON null value. By default, fields with empty
  11554. // values are omitted from API requests. However, any field with an
  11555. // empty value appearing in NullFields will be sent to the server as
  11556. // null. It is an error if a field in this list has a non-empty value.
  11557. // This may be used to include null fields in Patch requests.
  11558. NullFields []string `json:"-"`
  11559. }
  11560. func (s *InterconnectAttachmentAggregatedList) MarshalJSON() ([]byte, error) {
  11561. type NoMethod InterconnectAttachmentAggregatedList
  11562. raw := NoMethod(*s)
  11563. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11564. }
  11565. // InterconnectAttachmentAggregatedListWarning: [Output Only]
  11566. // Informational warning message.
  11567. type InterconnectAttachmentAggregatedListWarning struct {
  11568. // Code: [Output Only] A warning code, if applicable. For example,
  11569. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  11570. // the response.
  11571. //
  11572. // Possible values:
  11573. // "CLEANUP_FAILED"
  11574. // "DEPRECATED_RESOURCE_USED"
  11575. // "DEPRECATED_TYPE_USED"
  11576. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  11577. // "EXPERIMENTAL_TYPE_USED"
  11578. // "EXTERNAL_API_WARNING"
  11579. // "FIELD_VALUE_OVERRIDEN"
  11580. // "INJECTED_KERNELS_DEPRECATED"
  11581. // "MISSING_TYPE_DEPENDENCY"
  11582. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  11583. // "NEXT_HOP_CANNOT_IP_FORWARD"
  11584. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  11585. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  11586. // "NEXT_HOP_NOT_RUNNING"
  11587. // "NOT_CRITICAL_ERROR"
  11588. // "NO_RESULTS_ON_PAGE"
  11589. // "REQUIRED_TOS_AGREEMENT"
  11590. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  11591. // "RESOURCE_NOT_DELETED"
  11592. // "SCHEMA_VALIDATION_IGNORED"
  11593. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  11594. // "UNDECLARED_PROPERTIES"
  11595. // "UNREACHABLE"
  11596. Code string `json:"code,omitempty"`
  11597. // Data: [Output Only] Metadata about this warning in key: value format.
  11598. // For example:
  11599. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  11600. Data []*InterconnectAttachmentAggregatedListWarningData `json:"data,omitempty"`
  11601. // Message: [Output Only] A human-readable description of the warning
  11602. // code.
  11603. Message string `json:"message,omitempty"`
  11604. // ForceSendFields is a list of field names (e.g. "Code") to
  11605. // unconditionally include in API requests. By default, fields with
  11606. // empty values are omitted from API requests. However, any non-pointer,
  11607. // non-interface field appearing in ForceSendFields will be sent to the
  11608. // server regardless of whether the field is empty or not. This may be
  11609. // used to include empty fields in Patch requests.
  11610. ForceSendFields []string `json:"-"`
  11611. // NullFields is a list of field names (e.g. "Code") to include in API
  11612. // requests with the JSON null value. By default, fields with empty
  11613. // values are omitted from API requests. However, any field with an
  11614. // empty value appearing in NullFields will be sent to the server as
  11615. // null. It is an error if a field in this list has a non-empty value.
  11616. // This may be used to include null fields in Patch requests.
  11617. NullFields []string `json:"-"`
  11618. }
  11619. func (s *InterconnectAttachmentAggregatedListWarning) MarshalJSON() ([]byte, error) {
  11620. type NoMethod InterconnectAttachmentAggregatedListWarning
  11621. raw := NoMethod(*s)
  11622. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11623. }
  11624. type InterconnectAttachmentAggregatedListWarningData struct {
  11625. // Key: [Output Only] A key that provides more detail on the warning
  11626. // being returned. For example, for warnings where there are no results
  11627. // in a list request for a particular zone, this key might be scope and
  11628. // the key value might be the zone name. Other examples might be a key
  11629. // indicating a deprecated resource and a suggested replacement, or a
  11630. // warning about invalid network settings (for example, if an instance
  11631. // attempts to perform IP forwarding but is not enabled for IP
  11632. // forwarding).
  11633. Key string `json:"key,omitempty"`
  11634. // Value: [Output Only] A warning data value corresponding to the key.
  11635. Value string `json:"value,omitempty"`
  11636. // ForceSendFields is a list of field names (e.g. "Key") to
  11637. // unconditionally include in API requests. By default, fields with
  11638. // empty values are omitted from API requests. However, any non-pointer,
  11639. // non-interface field appearing in ForceSendFields will be sent to the
  11640. // server regardless of whether the field is empty or not. This may be
  11641. // used to include empty fields in Patch requests.
  11642. ForceSendFields []string `json:"-"`
  11643. // NullFields is a list of field names (e.g. "Key") to include in API
  11644. // requests with the JSON null value. By default, fields with empty
  11645. // values are omitted from API requests. However, any field with an
  11646. // empty value appearing in NullFields will be sent to the server as
  11647. // null. It is an error if a field in this list has a non-empty value.
  11648. // This may be used to include null fields in Patch requests.
  11649. NullFields []string `json:"-"`
  11650. }
  11651. func (s *InterconnectAttachmentAggregatedListWarningData) MarshalJSON() ([]byte, error) {
  11652. type NoMethod InterconnectAttachmentAggregatedListWarningData
  11653. raw := NoMethod(*s)
  11654. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11655. }
  11656. // InterconnectAttachmentList: Response to the list request, and
  11657. // contains a list of interconnect attachments.
  11658. type InterconnectAttachmentList struct {
  11659. // Id: [Output Only] Unique identifier for the resource; defined by the
  11660. // server.
  11661. Id string `json:"id,omitempty"`
  11662. // Items: A list of InterconnectAttachment resources.
  11663. Items []*InterconnectAttachment `json:"items,omitempty"`
  11664. // Kind: [Output Only] Type of resource. Always
  11665. // compute#interconnectAttachmentList for lists of interconnect
  11666. // attachments.
  11667. Kind string `json:"kind,omitempty"`
  11668. // NextPageToken: [Output Only] This token allows you to get the next
  11669. // page of results for list requests. If the number of results is larger
  11670. // than maxResults, use the nextPageToken as a value for the query
  11671. // parameter pageToken in the next list request. Subsequent list
  11672. // requests will have their own nextPageToken to continue paging through
  11673. // the results.
  11674. NextPageToken string `json:"nextPageToken,omitempty"`
  11675. // SelfLink: [Output Only] Server-defined URL for this resource.
  11676. SelfLink string `json:"selfLink,omitempty"`
  11677. // Warning: [Output Only] Informational warning message.
  11678. Warning *InterconnectAttachmentListWarning `json:"warning,omitempty"`
  11679. // ServerResponse contains the HTTP response code and headers from the
  11680. // server.
  11681. googleapi.ServerResponse `json:"-"`
  11682. // ForceSendFields is a list of field names (e.g. "Id") to
  11683. // unconditionally include in API requests. By default, fields with
  11684. // empty values are omitted from API requests. However, any non-pointer,
  11685. // non-interface field appearing in ForceSendFields will be sent to the
  11686. // server regardless of whether the field is empty or not. This may be
  11687. // used to include empty fields in Patch requests.
  11688. ForceSendFields []string `json:"-"`
  11689. // NullFields is a list of field names (e.g. "Id") to include in API
  11690. // requests with the JSON null value. By default, fields with empty
  11691. // values are omitted from API requests. However, any field with an
  11692. // empty value appearing in NullFields will be sent to the server as
  11693. // null. It is an error if a field in this list has a non-empty value.
  11694. // This may be used to include null fields in Patch requests.
  11695. NullFields []string `json:"-"`
  11696. }
  11697. func (s *InterconnectAttachmentList) MarshalJSON() ([]byte, error) {
  11698. type NoMethod InterconnectAttachmentList
  11699. raw := NoMethod(*s)
  11700. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11701. }
  11702. // InterconnectAttachmentListWarning: [Output Only] Informational
  11703. // warning message.
  11704. type InterconnectAttachmentListWarning struct {
  11705. // Code: [Output Only] A warning code, if applicable. For example,
  11706. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  11707. // the response.
  11708. //
  11709. // Possible values:
  11710. // "CLEANUP_FAILED"
  11711. // "DEPRECATED_RESOURCE_USED"
  11712. // "DEPRECATED_TYPE_USED"
  11713. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  11714. // "EXPERIMENTAL_TYPE_USED"
  11715. // "EXTERNAL_API_WARNING"
  11716. // "FIELD_VALUE_OVERRIDEN"
  11717. // "INJECTED_KERNELS_DEPRECATED"
  11718. // "MISSING_TYPE_DEPENDENCY"
  11719. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  11720. // "NEXT_HOP_CANNOT_IP_FORWARD"
  11721. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  11722. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  11723. // "NEXT_HOP_NOT_RUNNING"
  11724. // "NOT_CRITICAL_ERROR"
  11725. // "NO_RESULTS_ON_PAGE"
  11726. // "REQUIRED_TOS_AGREEMENT"
  11727. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  11728. // "RESOURCE_NOT_DELETED"
  11729. // "SCHEMA_VALIDATION_IGNORED"
  11730. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  11731. // "UNDECLARED_PROPERTIES"
  11732. // "UNREACHABLE"
  11733. Code string `json:"code,omitempty"`
  11734. // Data: [Output Only] Metadata about this warning in key: value format.
  11735. // For example:
  11736. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  11737. Data []*InterconnectAttachmentListWarningData `json:"data,omitempty"`
  11738. // Message: [Output Only] A human-readable description of the warning
  11739. // code.
  11740. Message string `json:"message,omitempty"`
  11741. // ForceSendFields is a list of field names (e.g. "Code") to
  11742. // unconditionally include in API requests. By default, fields with
  11743. // empty values are omitted from API requests. However, any non-pointer,
  11744. // non-interface field appearing in ForceSendFields will be sent to the
  11745. // server regardless of whether the field is empty or not. This may be
  11746. // used to include empty fields in Patch requests.
  11747. ForceSendFields []string `json:"-"`
  11748. // NullFields is a list of field names (e.g. "Code") to include in API
  11749. // requests with the JSON null value. By default, fields with empty
  11750. // values are omitted from API requests. However, any field with an
  11751. // empty value appearing in NullFields will be sent to the server as
  11752. // null. It is an error if a field in this list has a non-empty value.
  11753. // This may be used to include null fields in Patch requests.
  11754. NullFields []string `json:"-"`
  11755. }
  11756. func (s *InterconnectAttachmentListWarning) MarshalJSON() ([]byte, error) {
  11757. type NoMethod InterconnectAttachmentListWarning
  11758. raw := NoMethod(*s)
  11759. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11760. }
  11761. type InterconnectAttachmentListWarningData struct {
  11762. // Key: [Output Only] A key that provides more detail on the warning
  11763. // being returned. For example, for warnings where there are no results
  11764. // in a list request for a particular zone, this key might be scope and
  11765. // the key value might be the zone name. Other examples might be a key
  11766. // indicating a deprecated resource and a suggested replacement, or a
  11767. // warning about invalid network settings (for example, if an instance
  11768. // attempts to perform IP forwarding but is not enabled for IP
  11769. // forwarding).
  11770. Key string `json:"key,omitempty"`
  11771. // Value: [Output Only] A warning data value corresponding to the key.
  11772. Value string `json:"value,omitempty"`
  11773. // ForceSendFields is a list of field names (e.g. "Key") to
  11774. // unconditionally include in API requests. By default, fields with
  11775. // empty values are omitted from API requests. However, any non-pointer,
  11776. // non-interface field appearing in ForceSendFields will be sent to the
  11777. // server regardless of whether the field is empty or not. This may be
  11778. // used to include empty fields in Patch requests.
  11779. ForceSendFields []string `json:"-"`
  11780. // NullFields is a list of field names (e.g. "Key") to include in API
  11781. // requests with the JSON null value. By default, fields with empty
  11782. // values are omitted from API requests. However, any field with an
  11783. // empty value appearing in NullFields will be sent to the server as
  11784. // null. It is an error if a field in this list has a non-empty value.
  11785. // This may be used to include null fields in Patch requests.
  11786. NullFields []string `json:"-"`
  11787. }
  11788. func (s *InterconnectAttachmentListWarningData) MarshalJSON() ([]byte, error) {
  11789. type NoMethod InterconnectAttachmentListWarningData
  11790. raw := NoMethod(*s)
  11791. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11792. }
  11793. // InterconnectAttachmentPartnerMetadata: Informational metadata about
  11794. // Partner attachments from Partners to display to customers. These
  11795. // fields are propagated from PARTNER_PROVIDER attachments to their
  11796. // corresponding PARTNER attachments.
  11797. type InterconnectAttachmentPartnerMetadata struct {
  11798. // InterconnectName: Plain text name of the Interconnect this attachment
  11799. // is connected to, as displayed in the Partner?s portal. For instance
  11800. // ?Chicago 1?. This value may be validated to match approved Partner
  11801. // values.
  11802. InterconnectName string `json:"interconnectName,omitempty"`
  11803. // PartnerName: Plain text name of the Partner providing this
  11804. // attachment. This value may be validated to match approved Partner
  11805. // values.
  11806. PartnerName string `json:"partnerName,omitempty"`
  11807. // PortalUrl: URL of the Partner?s portal for this Attachment. Partners
  11808. // may customise this to be a deep-link to the specific resource on the
  11809. // Partner portal. This value may be validated to match approved Partner
  11810. // values.
  11811. PortalUrl string `json:"portalUrl,omitempty"`
  11812. // ForceSendFields is a list of field names (e.g. "InterconnectName") to
  11813. // unconditionally include in API requests. By default, fields with
  11814. // empty values are omitted from API requests. However, any non-pointer,
  11815. // non-interface field appearing in ForceSendFields will be sent to the
  11816. // server regardless of whether the field is empty or not. This may be
  11817. // used to include empty fields in Patch requests.
  11818. ForceSendFields []string `json:"-"`
  11819. // NullFields is a list of field names (e.g. "InterconnectName") to
  11820. // include in API requests with the JSON null value. By default, fields
  11821. // with empty values are omitted from API requests. However, any field
  11822. // with an empty value appearing in NullFields will be sent to the
  11823. // server as null. It is an error if a field in this list has a
  11824. // non-empty value. This may be used to include null fields in Patch
  11825. // requests.
  11826. NullFields []string `json:"-"`
  11827. }
  11828. func (s *InterconnectAttachmentPartnerMetadata) MarshalJSON() ([]byte, error) {
  11829. type NoMethod InterconnectAttachmentPartnerMetadata
  11830. raw := NoMethod(*s)
  11831. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11832. }
  11833. // InterconnectAttachmentPrivateInfo: Information for an interconnect
  11834. // attachment when this belongs to an interconnect of type DEDICATED.
  11835. type InterconnectAttachmentPrivateInfo struct {
  11836. // Tag8021q: [Output Only] 802.1q encapsulation tag to be used for
  11837. // traffic between Google and the customer, going to and from this
  11838. // network and region.
  11839. Tag8021q int64 `json:"tag8021q,omitempty"`
  11840. // ForceSendFields is a list of field names (e.g. "Tag8021q") to
  11841. // unconditionally include in API requests. By default, fields with
  11842. // empty values are omitted from API requests. However, any non-pointer,
  11843. // non-interface field appearing in ForceSendFields will be sent to the
  11844. // server regardless of whether the field is empty or not. This may be
  11845. // used to include empty fields in Patch requests.
  11846. ForceSendFields []string `json:"-"`
  11847. // NullFields is a list of field names (e.g. "Tag8021q") to include in
  11848. // API requests with the JSON null value. By default, fields with empty
  11849. // values are omitted from API requests. However, any field with an
  11850. // empty value appearing in NullFields will be sent to the server as
  11851. // null. It is an error if a field in this list has a non-empty value.
  11852. // This may be used to include null fields in Patch requests.
  11853. NullFields []string `json:"-"`
  11854. }
  11855. func (s *InterconnectAttachmentPrivateInfo) MarshalJSON() ([]byte, error) {
  11856. type NoMethod InterconnectAttachmentPrivateInfo
  11857. raw := NoMethod(*s)
  11858. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11859. }
  11860. type InterconnectAttachmentsScopedList struct {
  11861. // InterconnectAttachments: A list of interconnect attachments contained
  11862. // in this scope.
  11863. InterconnectAttachments []*InterconnectAttachment `json:"interconnectAttachments,omitempty"`
  11864. // Warning: Informational warning which replaces the list of addresses
  11865. // when the list is empty.
  11866. Warning *InterconnectAttachmentsScopedListWarning `json:"warning,omitempty"`
  11867. // ForceSendFields is a list of field names (e.g.
  11868. // "InterconnectAttachments") to unconditionally include in API
  11869. // requests. By default, fields with empty values are omitted from API
  11870. // requests. However, any non-pointer, non-interface field appearing in
  11871. // ForceSendFields will be sent to the server regardless of whether the
  11872. // field is empty or not. This may be used to include empty fields in
  11873. // Patch requests.
  11874. ForceSendFields []string `json:"-"`
  11875. // NullFields is a list of field names (e.g. "InterconnectAttachments")
  11876. // to include in API requests with the JSON null value. By default,
  11877. // fields with empty values are omitted from API requests. However, any
  11878. // field with an empty value appearing in NullFields will be sent to the
  11879. // server as null. It is an error if a field in this list has a
  11880. // non-empty value. This may be used to include null fields in Patch
  11881. // requests.
  11882. NullFields []string `json:"-"`
  11883. }
  11884. func (s *InterconnectAttachmentsScopedList) MarshalJSON() ([]byte, error) {
  11885. type NoMethod InterconnectAttachmentsScopedList
  11886. raw := NoMethod(*s)
  11887. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11888. }
  11889. // InterconnectAttachmentsScopedListWarning: Informational warning which
  11890. // replaces the list of addresses when the list is empty.
  11891. type InterconnectAttachmentsScopedListWarning struct {
  11892. // Code: [Output Only] A warning code, if applicable. For example,
  11893. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  11894. // the response.
  11895. //
  11896. // Possible values:
  11897. // "CLEANUP_FAILED"
  11898. // "DEPRECATED_RESOURCE_USED"
  11899. // "DEPRECATED_TYPE_USED"
  11900. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  11901. // "EXPERIMENTAL_TYPE_USED"
  11902. // "EXTERNAL_API_WARNING"
  11903. // "FIELD_VALUE_OVERRIDEN"
  11904. // "INJECTED_KERNELS_DEPRECATED"
  11905. // "MISSING_TYPE_DEPENDENCY"
  11906. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  11907. // "NEXT_HOP_CANNOT_IP_FORWARD"
  11908. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  11909. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  11910. // "NEXT_HOP_NOT_RUNNING"
  11911. // "NOT_CRITICAL_ERROR"
  11912. // "NO_RESULTS_ON_PAGE"
  11913. // "REQUIRED_TOS_AGREEMENT"
  11914. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  11915. // "RESOURCE_NOT_DELETED"
  11916. // "SCHEMA_VALIDATION_IGNORED"
  11917. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  11918. // "UNDECLARED_PROPERTIES"
  11919. // "UNREACHABLE"
  11920. Code string `json:"code,omitempty"`
  11921. // Data: [Output Only] Metadata about this warning in key: value format.
  11922. // For example:
  11923. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  11924. Data []*InterconnectAttachmentsScopedListWarningData `json:"data,omitempty"`
  11925. // Message: [Output Only] A human-readable description of the warning
  11926. // code.
  11927. Message string `json:"message,omitempty"`
  11928. // ForceSendFields is a list of field names (e.g. "Code") to
  11929. // unconditionally include in API requests. By default, fields with
  11930. // empty values are omitted from API requests. However, any non-pointer,
  11931. // non-interface field appearing in ForceSendFields will be sent to the
  11932. // server regardless of whether the field is empty or not. This may be
  11933. // used to include empty fields in Patch requests.
  11934. ForceSendFields []string `json:"-"`
  11935. // NullFields is a list of field names (e.g. "Code") to include in API
  11936. // requests with the JSON null value. By default, fields with empty
  11937. // values are omitted from API requests. However, any field with an
  11938. // empty value appearing in NullFields will be sent to the server as
  11939. // null. It is an error if a field in this list has a non-empty value.
  11940. // This may be used to include null fields in Patch requests.
  11941. NullFields []string `json:"-"`
  11942. }
  11943. func (s *InterconnectAttachmentsScopedListWarning) MarshalJSON() ([]byte, error) {
  11944. type NoMethod InterconnectAttachmentsScopedListWarning
  11945. raw := NoMethod(*s)
  11946. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11947. }
  11948. type InterconnectAttachmentsScopedListWarningData struct {
  11949. // Key: [Output Only] A key that provides more detail on the warning
  11950. // being returned. For example, for warnings where there are no results
  11951. // in a list request for a particular zone, this key might be scope and
  11952. // the key value might be the zone name. Other examples might be a key
  11953. // indicating a deprecated resource and a suggested replacement, or a
  11954. // warning about invalid network settings (for example, if an instance
  11955. // attempts to perform IP forwarding but is not enabled for IP
  11956. // forwarding).
  11957. Key string `json:"key,omitempty"`
  11958. // Value: [Output Only] A warning data value corresponding to the key.
  11959. Value string `json:"value,omitempty"`
  11960. // ForceSendFields is a list of field names (e.g. "Key") to
  11961. // unconditionally include in API requests. By default, fields with
  11962. // empty values are omitted from API requests. However, any non-pointer,
  11963. // non-interface field appearing in ForceSendFields will be sent to the
  11964. // server regardless of whether the field is empty or not. This may be
  11965. // used to include empty fields in Patch requests.
  11966. ForceSendFields []string `json:"-"`
  11967. // NullFields is a list of field names (e.g. "Key") to include in API
  11968. // requests with the JSON null value. By default, fields with empty
  11969. // values are omitted from API requests. However, any field with an
  11970. // empty value appearing in NullFields will be sent to the server as
  11971. // null. It is an error if a field in this list has a non-empty value.
  11972. // This may be used to include null fields in Patch requests.
  11973. NullFields []string `json:"-"`
  11974. }
  11975. func (s *InterconnectAttachmentsScopedListWarningData) MarshalJSON() ([]byte, error) {
  11976. type NoMethod InterconnectAttachmentsScopedListWarningData
  11977. raw := NoMethod(*s)
  11978. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11979. }
  11980. // InterconnectCircuitInfo: Describes a single physical circuit between
  11981. // the Customer and Google. CircuitInfo objects are created by Google,
  11982. // so all fields are output only. Next id: 4
  11983. type InterconnectCircuitInfo struct {
  11984. // CustomerDemarcId: Customer-side demarc ID for this circuit.
  11985. CustomerDemarcId string `json:"customerDemarcId,omitempty"`
  11986. // GoogleCircuitId: Google-assigned unique ID for this circuit. Assigned
  11987. // at circuit turn-up.
  11988. GoogleCircuitId string `json:"googleCircuitId,omitempty"`
  11989. // GoogleDemarcId: Google-side demarc ID for this circuit. Assigned at
  11990. // circuit turn-up and provided by Google to the customer in the LOA.
  11991. GoogleDemarcId string `json:"googleDemarcId,omitempty"`
  11992. // ForceSendFields is a list of field names (e.g. "CustomerDemarcId") to
  11993. // unconditionally include in API requests. By default, fields with
  11994. // empty values are omitted from API requests. However, any non-pointer,
  11995. // non-interface field appearing in ForceSendFields will be sent to the
  11996. // server regardless of whether the field is empty or not. This may be
  11997. // used to include empty fields in Patch requests.
  11998. ForceSendFields []string `json:"-"`
  11999. // NullFields is a list of field names (e.g. "CustomerDemarcId") to
  12000. // include in API requests with the JSON null value. By default, fields
  12001. // with empty values are omitted from API requests. However, any field
  12002. // with an empty value appearing in NullFields will be sent to the
  12003. // server as null. It is an error if a field in this list has a
  12004. // non-empty value. This may be used to include null fields in Patch
  12005. // requests.
  12006. NullFields []string `json:"-"`
  12007. }
  12008. func (s *InterconnectCircuitInfo) MarshalJSON() ([]byte, error) {
  12009. type NoMethod InterconnectCircuitInfo
  12010. raw := NoMethod(*s)
  12011. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  12012. }
  12013. // InterconnectList: Response to the list request, and contains a list
  12014. // of interconnects.
  12015. type InterconnectList struct {
  12016. // Id: [Output Only] Unique identifier for the resource; defined by the
  12017. // server.
  12018. Id string `json:"id,omitempty"`
  12019. // Items: A list of Interconnect resources.
  12020. Items []*Interconnect `json:"items,omitempty"`
  12021. // Kind: [Output Only] Type of resource. Always compute#interconnectList
  12022. // for lists of interconnects.
  12023. Kind string `json:"kind,omitempty"`
  12024. // NextPageToken: [Output Only] This token allows you to get the next
  12025. // page of results for list requests. If the number of results is larger
  12026. // than maxResults, use the nextPageToken as a value for the query
  12027. // parameter pageToken in the next list request. Subsequent list
  12028. // requests will have their own nextPageToken to continue paging through
  12029. // the results.
  12030. NextPageToken string `json:"nextPageToken,omitempty"`
  12031. // SelfLink: [Output Only] Server-defined URL for this resource.
  12032. SelfLink string `json:"selfLink,omitempty"`
  12033. // Warning: [Output Only] Informational warning message.
  12034. Warning *InterconnectListWarning `json:"warning,omitempty"`
  12035. // ServerResponse contains the HTTP response code and headers from the
  12036. // server.
  12037. googleapi.ServerResponse `json:"-"`
  12038. // ForceSendFields is a list of field names (e.g. "Id") to
  12039. // unconditionally include in API requests. By default, fields with
  12040. // empty values are omitted from API requests. However, any non-pointer,
  12041. // non-interface field appearing in ForceSendFields will be sent to the
  12042. // server regardless of whether the field is empty or not. This may be
  12043. // used to include empty fields in Patch requests.
  12044. ForceSendFields []string `json:"-"`
  12045. // NullFields is a list of field names (e.g. "Id") to include in API
  12046. // requests with the JSON null value. By default, fields with empty
  12047. // values are omitted from API requests. However, any field with an
  12048. // empty value appearing in NullFields will be sent to the server as
  12049. // null. It is an error if a field in this list has a non-empty value.
  12050. // This may be used to include null fields in Patch requests.
  12051. NullFields []string `json:"-"`
  12052. }
  12053. func (s *InterconnectList) MarshalJSON() ([]byte, error) {
  12054. type NoMethod InterconnectList
  12055. raw := NoMethod(*s)
  12056. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  12057. }
  12058. // InterconnectListWarning: [Output Only] Informational warning message.
  12059. type InterconnectListWarning struct {
  12060. // Code: [Output Only] A warning code, if applicable. For example,
  12061. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  12062. // the response.
  12063. //
  12064. // Possible values:
  12065. // "CLEANUP_FAILED"
  12066. // "DEPRECATED_RESOURCE_USED"
  12067. // "DEPRECATED_TYPE_USED"
  12068. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  12069. // "EXPERIMENTAL_TYPE_USED"
  12070. // "EXTERNAL_API_WARNING"
  12071. // "FIELD_VALUE_OVERRIDEN"
  12072. // "INJECTED_KERNELS_DEPRECATED"
  12073. // "MISSING_TYPE_DEPENDENCY"
  12074. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  12075. // "NEXT_HOP_CANNOT_IP_FORWARD"
  12076. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  12077. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  12078. // "NEXT_HOP_NOT_RUNNING"
  12079. // "NOT_CRITICAL_ERROR"
  12080. // "NO_RESULTS_ON_PAGE"
  12081. // "REQUIRED_TOS_AGREEMENT"
  12082. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  12083. // "RESOURCE_NOT_DELETED"
  12084. // "SCHEMA_VALIDATION_IGNORED"
  12085. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  12086. // "UNDECLARED_PROPERTIES"
  12087. // "UNREACHABLE"
  12088. Code string `json:"code,omitempty"`
  12089. // Data: [Output Only] Metadata about this warning in key: value format.
  12090. // For example:
  12091. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  12092. Data []*InterconnectListWarningData `json:"data,omitempty"`
  12093. // Message: [Output Only] A human-readable description of the warning
  12094. // code.
  12095. Message string `json:"message,omitempty"`
  12096. // ForceSendFields is a list of field names (e.g. "Code") to
  12097. // unconditionally include in API requests. By default, fields with
  12098. // empty values are omitted from API requests. However, any non-pointer,
  12099. // non-interface field appearing in ForceSendFields will be sent to the
  12100. // server regardless of whether the field is empty or not. This may be
  12101. // used to include empty fields in Patch requests.
  12102. ForceSendFields []string `json:"-"`
  12103. // NullFields is a list of field names (e.g. "Code") to include in API
  12104. // requests with the JSON null value. By default, fields with empty
  12105. // values are omitted from API requests. However, any field with an
  12106. // empty value appearing in NullFields will be sent to the server as
  12107. // null. It is an error if a field in this list has a non-empty value.
  12108. // This may be used to include null fields in Patch requests.
  12109. NullFields []string `json:"-"`
  12110. }
  12111. func (s *InterconnectListWarning) MarshalJSON() ([]byte, error) {
  12112. type NoMethod InterconnectListWarning
  12113. raw := NoMethod(*s)
  12114. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  12115. }
  12116. type InterconnectListWarningData struct {
  12117. // Key: [Output Only] A key that provides more detail on the warning
  12118. // being returned. For example, for warnings where there are no results
  12119. // in a list request for a particular zone, this key might be scope and
  12120. // the key value might be the zone name. Other examples might be a key
  12121. // indicating a deprecated resource and a suggested replacement, or a
  12122. // warning about invalid network settings (for example, if an instance
  12123. // attempts to perform IP forwarding but is not enabled for IP
  12124. // forwarding).
  12125. Key string `json:"key,omitempty"`
  12126. // Value: [Output Only] A warning data value corresponding to the key.
  12127. Value string `json:"value,omitempty"`
  12128. // ForceSendFields is a list of field names (e.g. "Key") to
  12129. // unconditionally include in API requests. By default, fields with
  12130. // empty values are omitted from API requests. However, any non-pointer,
  12131. // non-interface field appearing in ForceSendFields will be sent to the
  12132. // server regardless of whether the field is empty or not. This may be
  12133. // used to include empty fields in Patch requests.
  12134. ForceSendFields []string `json:"-"`
  12135. // NullFields is a list of field names (e.g. "Key") to include in API
  12136. // requests with the JSON null value. By default, fields with empty
  12137. // values are omitted from API requests. However, any field with an
  12138. // empty value appearing in NullFields will be sent to the server as
  12139. // null. It is an error if a field in this list has a non-empty value.
  12140. // This may be used to include null fields in Patch requests.
  12141. NullFields []string `json:"-"`
  12142. }
  12143. func (s *InterconnectListWarningData) MarshalJSON() ([]byte, error) {
  12144. type NoMethod InterconnectListWarningData
  12145. raw := NoMethod(*s)
  12146. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  12147. }
  12148. // InterconnectLocation: Represents an InterconnectLocations resource.
  12149. // The InterconnectLocations resource describes the locations where you
  12150. // can connect to Google's networks. For more information, see
  12151. // Colocation Facilities.
  12152. type InterconnectLocation struct {
  12153. // Address: [Output Only] The postal address of the Point of Presence,
  12154. // each line in the address is separated by a newline character.
  12155. Address string `json:"address,omitempty"`
  12156. // AvailabilityZone: [Output Only] Availability zone for this location.
  12157. // Within a metropolitan area (metro), maintenance will not be
  12158. // simultaneously scheduled in more than one availability zone. Example:
  12159. // "zone1" or "zone2".
  12160. AvailabilityZone string `json:"availabilityZone,omitempty"`
  12161. // City: [Output Only] Metropolitan area designator that indicates which
  12162. // city an interconnect is located. For example: "Chicago, IL",
  12163. // "Amsterdam, Netherlands".
  12164. City string `json:"city,omitempty"`
  12165. // Continent: [Output Only] Continent for this location.
  12166. //
  12167. // Possible values:
  12168. // "AFRICA"
  12169. // "ASIA_PAC"
  12170. // "C_AFRICA"
  12171. // "C_ASIA_PAC"
  12172. // "C_EUROPE"
  12173. // "C_NORTH_AMERICA"
  12174. // "C_SOUTH_AMERICA"
  12175. // "EUROPE"
  12176. // "NORTH_AMERICA"
  12177. // "SOUTH_AMERICA"
  12178. Continent string `json:"continent,omitempty"`
  12179. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  12180. // format.
  12181. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  12182. // Description: [Output Only] An optional description of the resource.
  12183. Description string `json:"description,omitempty"`
  12184. // FacilityProvider: [Output Only] The name of the provider for this
  12185. // facility (e.g., EQUINIX).
  12186. FacilityProvider string `json:"facilityProvider,omitempty"`
  12187. // FacilityProviderFacilityId: [Output Only] A provider-assigned
  12188. // Identifier for this facility (e.g., Ashburn-DC1).
  12189. FacilityProviderFacilityId string `json:"facilityProviderFacilityId,omitempty"`
  12190. // Id: [Output Only] The unique identifier for the resource. This
  12191. // identifier is defined by the server.
  12192. Id uint64 `json:"id,omitempty,string"`
  12193. // Kind: [Output Only] Type of the resource. Always
  12194. // compute#interconnectLocation for interconnect locations.
  12195. Kind string `json:"kind,omitempty"`
  12196. // Name: [Output Only] Name of the resource.
  12197. Name string `json:"name,omitempty"`
  12198. // PeeringdbFacilityId: [Output Only] The peeringdb identifier for this
  12199. // facility (corresponding with a netfac type in peeringdb).
  12200. PeeringdbFacilityId string `json:"peeringdbFacilityId,omitempty"`
  12201. // RegionInfos: [Output Only] A list of InterconnectLocation.RegionInfo
  12202. // objects, that describe parameters pertaining to the relation between
  12203. // this InterconnectLocation and various Google Cloud regions.
  12204. RegionInfos []*InterconnectLocationRegionInfo `json:"regionInfos,omitempty"`
  12205. // SelfLink: [Output Only] Server-defined URL for the resource.
  12206. SelfLink string `json:"selfLink,omitempty"`
  12207. // ServerResponse contains the HTTP response code and headers from the
  12208. // server.
  12209. googleapi.ServerResponse `json:"-"`
  12210. // ForceSendFields is a list of field names (e.g. "Address") to
  12211. // unconditionally include in API requests. By default, fields with
  12212. // empty values are omitted from API requests. However, any non-pointer,
  12213. // non-interface field appearing in ForceSendFields will be sent to the
  12214. // server regardless of whether the field is empty or not. This may be
  12215. // used to include empty fields in Patch requests.
  12216. ForceSendFields []string `json:"-"`
  12217. // NullFields is a list of field names (e.g. "Address") to include in
  12218. // API requests with the JSON null value. By default, fields with empty
  12219. // values are omitted from API requests. However, any field with an
  12220. // empty value appearing in NullFields will be sent to the server as
  12221. // null. It is an error if a field in this list has a non-empty value.
  12222. // This may be used to include null fields in Patch requests.
  12223. NullFields []string `json:"-"`
  12224. }
  12225. func (s *InterconnectLocation) MarshalJSON() ([]byte, error) {
  12226. type NoMethod InterconnectLocation
  12227. raw := NoMethod(*s)
  12228. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  12229. }
  12230. // InterconnectLocationList: Response to the list request, and contains
  12231. // a list of interconnect locations.
  12232. type InterconnectLocationList struct {
  12233. // Id: [Output Only] Unique identifier for the resource; defined by the
  12234. // server.
  12235. Id string `json:"id,omitempty"`
  12236. // Items: A list of InterconnectLocation resources.
  12237. Items []*InterconnectLocation `json:"items,omitempty"`
  12238. // Kind: [Output Only] Type of resource. Always
  12239. // compute#interconnectLocationList for lists of interconnect locations.
  12240. Kind string `json:"kind,omitempty"`
  12241. // NextPageToken: [Output Only] This token allows you to get the next
  12242. // page of results for list requests. If the number of results is larger
  12243. // than maxResults, use the nextPageToken as a value for the query
  12244. // parameter pageToken in the next list request. Subsequent list
  12245. // requests will have their own nextPageToken to continue paging through
  12246. // the results.
  12247. NextPageToken string `json:"nextPageToken,omitempty"`
  12248. // SelfLink: [Output Only] Server-defined URL for this resource.
  12249. SelfLink string `json:"selfLink,omitempty"`
  12250. // Warning: [Output Only] Informational warning message.
  12251. Warning *InterconnectLocationListWarning `json:"warning,omitempty"`
  12252. // ServerResponse contains the HTTP response code and headers from the
  12253. // server.
  12254. googleapi.ServerResponse `json:"-"`
  12255. // ForceSendFields is a list of field names (e.g. "Id") to
  12256. // unconditionally include in API requests. By default, fields with
  12257. // empty values are omitted from API requests. However, any non-pointer,
  12258. // non-interface field appearing in ForceSendFields will be sent to the
  12259. // server regardless of whether the field is empty or not. This may be
  12260. // used to include empty fields in Patch requests.
  12261. ForceSendFields []string `json:"-"`
  12262. // NullFields is a list of field names (e.g. "Id") to include in API
  12263. // requests with the JSON null value. By default, fields with empty
  12264. // values are omitted from API requests. However, any field with an
  12265. // empty value appearing in NullFields will be sent to the server as
  12266. // null. It is an error if a field in this list has a non-empty value.
  12267. // This may be used to include null fields in Patch requests.
  12268. NullFields []string `json:"-"`
  12269. }
  12270. func (s *InterconnectLocationList) MarshalJSON() ([]byte, error) {
  12271. type NoMethod InterconnectLocationList
  12272. raw := NoMethod(*s)
  12273. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  12274. }
  12275. // InterconnectLocationListWarning: [Output Only] Informational warning
  12276. // message.
  12277. type InterconnectLocationListWarning struct {
  12278. // Code: [Output Only] A warning code, if applicable. For example,
  12279. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  12280. // the response.
  12281. //
  12282. // Possible values:
  12283. // "CLEANUP_FAILED"
  12284. // "DEPRECATED_RESOURCE_USED"
  12285. // "DEPRECATED_TYPE_USED"
  12286. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  12287. // "EXPERIMENTAL_TYPE_USED"
  12288. // "EXTERNAL_API_WARNING"
  12289. // "FIELD_VALUE_OVERRIDEN"
  12290. // "INJECTED_KERNELS_DEPRECATED"
  12291. // "MISSING_TYPE_DEPENDENCY"
  12292. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  12293. // "NEXT_HOP_CANNOT_IP_FORWARD"
  12294. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  12295. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  12296. // "NEXT_HOP_NOT_RUNNING"
  12297. // "NOT_CRITICAL_ERROR"
  12298. // "NO_RESULTS_ON_PAGE"
  12299. // "REQUIRED_TOS_AGREEMENT"
  12300. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  12301. // "RESOURCE_NOT_DELETED"
  12302. // "SCHEMA_VALIDATION_IGNORED"
  12303. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  12304. // "UNDECLARED_PROPERTIES"
  12305. // "UNREACHABLE"
  12306. Code string `json:"code,omitempty"`
  12307. // Data: [Output Only] Metadata about this warning in key: value format.
  12308. // For example:
  12309. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  12310. Data []*InterconnectLocationListWarningData `json:"data,omitempty"`
  12311. // Message: [Output Only] A human-readable description of the warning
  12312. // code.
  12313. Message string `json:"message,omitempty"`
  12314. // ForceSendFields is a list of field names (e.g. "Code") to
  12315. // unconditionally include in API requests. By default, fields with
  12316. // empty values are omitted from API requests. However, any non-pointer,
  12317. // non-interface field appearing in ForceSendFields will be sent to the
  12318. // server regardless of whether the field is empty or not. This may be
  12319. // used to include empty fields in Patch requests.
  12320. ForceSendFields []string `json:"-"`
  12321. // NullFields is a list of field names (e.g. "Code") to include in API
  12322. // requests with the JSON null value. By default, fields with empty
  12323. // values are omitted from API requests. However, any field with an
  12324. // empty value appearing in NullFields will be sent to the server as
  12325. // null. It is an error if a field in this list has a non-empty value.
  12326. // This may be used to include null fields in Patch requests.
  12327. NullFields []string `json:"-"`
  12328. }
  12329. func (s *InterconnectLocationListWarning) MarshalJSON() ([]byte, error) {
  12330. type NoMethod InterconnectLocationListWarning
  12331. raw := NoMethod(*s)
  12332. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  12333. }
  12334. type InterconnectLocationListWarningData struct {
  12335. // Key: [Output Only] A key that provides more detail on the warning
  12336. // being returned. For example, for warnings where there are no results
  12337. // in a list request for a particular zone, this key might be scope and
  12338. // the key value might be the zone name. Other examples might be a key
  12339. // indicating a deprecated resource and a suggested replacement, or a
  12340. // warning about invalid network settings (for example, if an instance
  12341. // attempts to perform IP forwarding but is not enabled for IP
  12342. // forwarding).
  12343. Key string `json:"key,omitempty"`
  12344. // Value: [Output Only] A warning data value corresponding to the key.
  12345. Value string `json:"value,omitempty"`
  12346. // ForceSendFields is a list of field names (e.g. "Key") to
  12347. // unconditionally include in API requests. By default, fields with
  12348. // empty values are omitted from API requests. However, any non-pointer,
  12349. // non-interface field appearing in ForceSendFields will be sent to the
  12350. // server regardless of whether the field is empty or not. This may be
  12351. // used to include empty fields in Patch requests.
  12352. ForceSendFields []string `json:"-"`
  12353. // NullFields is a list of field names (e.g. "Key") to include in API
  12354. // requests with the JSON null value. By default, fields with empty
  12355. // values are omitted from API requests. However, any field with an
  12356. // empty value appearing in NullFields will be sent to the server as
  12357. // null. It is an error if a field in this list has a non-empty value.
  12358. // This may be used to include null fields in Patch requests.
  12359. NullFields []string `json:"-"`
  12360. }
  12361. func (s *InterconnectLocationListWarningData) MarshalJSON() ([]byte, error) {
  12362. type NoMethod InterconnectLocationListWarningData
  12363. raw := NoMethod(*s)
  12364. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  12365. }
  12366. // InterconnectLocationRegionInfo: Information about any potential
  12367. // InterconnectAttachments between an Interconnect at a specific
  12368. // InterconnectLocation, and a specific Cloud Region.
  12369. type InterconnectLocationRegionInfo struct {
  12370. // ExpectedRttMs: Expected round-trip time in milliseconds, from this
  12371. // InterconnectLocation to a VM in this region.
  12372. ExpectedRttMs int64 `json:"expectedRttMs,omitempty,string"`
  12373. // LocationPresence: Identifies the network presence of this location.
  12374. //
  12375. // Possible values:
  12376. // "GLOBAL"
  12377. // "LOCAL_REGION"
  12378. // "LP_GLOBAL"
  12379. // "LP_LOCAL_REGION"
  12380. LocationPresence string `json:"locationPresence,omitempty"`
  12381. // Region: URL for the region of this location.
  12382. Region string `json:"region,omitempty"`
  12383. // ForceSendFields is a list of field names (e.g. "ExpectedRttMs") to
  12384. // unconditionally include in API requests. By default, fields with
  12385. // empty values are omitted from API requests. However, any non-pointer,
  12386. // non-interface field appearing in ForceSendFields will be sent to the
  12387. // server regardless of whether the field is empty or not. This may be
  12388. // used to include empty fields in Patch requests.
  12389. ForceSendFields []string `json:"-"`
  12390. // NullFields is a list of field names (e.g. "ExpectedRttMs") to include
  12391. // in API requests with the JSON null value. By default, fields with
  12392. // empty values are omitted from API requests. However, any field with
  12393. // an empty value appearing in NullFields will be sent to the server as
  12394. // null. It is an error if a field in this list has a non-empty value.
  12395. // This may be used to include null fields in Patch requests.
  12396. NullFields []string `json:"-"`
  12397. }
  12398. func (s *InterconnectLocationRegionInfo) MarshalJSON() ([]byte, error) {
  12399. type NoMethod InterconnectLocationRegionInfo
  12400. raw := NoMethod(*s)
  12401. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  12402. }
  12403. // InterconnectOutageNotification: Description of a planned outage on
  12404. // this Interconnect. Next id: 9
  12405. type InterconnectOutageNotification struct {
  12406. // AffectedCircuits: If issue_type is IT_PARTIAL_OUTAGE, a list of the
  12407. // Google-side circuit IDs that will be affected.
  12408. AffectedCircuits []string `json:"affectedCircuits,omitempty"`
  12409. // Description: A description about the purpose of the outage.
  12410. Description string `json:"description,omitempty"`
  12411. // EndTime: Scheduled end time for the outage (milliseconds since Unix
  12412. // epoch).
  12413. EndTime int64 `json:"endTime,omitempty,string"`
  12414. // IssueType: Form this outage is expected to take. Note that the "IT_"
  12415. // versions of this enum have been deprecated in favor of the unprefixed
  12416. // values.
  12417. //
  12418. // Possible values:
  12419. // "IT_OUTAGE"
  12420. // "IT_PARTIAL_OUTAGE"
  12421. // "OUTAGE"
  12422. // "PARTIAL_OUTAGE"
  12423. IssueType string `json:"issueType,omitempty"`
  12424. // Name: Unique identifier for this outage notification.
  12425. Name string `json:"name,omitempty"`
  12426. // Source: The party that generated this notification. Note that
  12427. // "NSRC_GOOGLE" has been deprecated in favor of "GOOGLE"
  12428. //
  12429. // Possible values:
  12430. // "GOOGLE"
  12431. // "NSRC_GOOGLE"
  12432. Source string `json:"source,omitempty"`
  12433. // StartTime: Scheduled start time for the outage (milliseconds since
  12434. // Unix epoch).
  12435. StartTime int64 `json:"startTime,omitempty,string"`
  12436. // State: State of this notification. Note that the "NS_" versions of
  12437. // this enum have been deprecated in favor of the unprefixed values.
  12438. //
  12439. // Possible values:
  12440. // "ACTIVE"
  12441. // "CANCELLED"
  12442. // "NS_ACTIVE"
  12443. // "NS_CANCELED"
  12444. State string `json:"state,omitempty"`
  12445. // ForceSendFields is a list of field names (e.g. "AffectedCircuits") to
  12446. // unconditionally include in API requests. By default, fields with
  12447. // empty values are omitted from API requests. However, any non-pointer,
  12448. // non-interface field appearing in ForceSendFields will be sent to the
  12449. // server regardless of whether the field is empty or not. This may be
  12450. // used to include empty fields in Patch requests.
  12451. ForceSendFields []string `json:"-"`
  12452. // NullFields is a list of field names (e.g. "AffectedCircuits") to
  12453. // include in API requests with the JSON null value. By default, fields
  12454. // with empty values are omitted from API requests. However, any field
  12455. // with an empty value appearing in NullFields will be sent to the
  12456. // server as null. It is an error if a field in this list has a
  12457. // non-empty value. This may be used to include null fields in Patch
  12458. // requests.
  12459. NullFields []string `json:"-"`
  12460. }
  12461. func (s *InterconnectOutageNotification) MarshalJSON() ([]byte, error) {
  12462. type NoMethod InterconnectOutageNotification
  12463. raw := NoMethod(*s)
  12464. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  12465. }
  12466. // License: A license resource.
  12467. type License struct {
  12468. // ChargesUseFee: [Output Only] Deprecated. This field no longer
  12469. // reflects whether a license charges a usage fee.
  12470. ChargesUseFee bool `json:"chargesUseFee,omitempty"`
  12471. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  12472. // format.
  12473. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  12474. // Description: An optional textual description of the resource;
  12475. // provided by the client when the resource is created.
  12476. Description string `json:"description,omitempty"`
  12477. // Id: [Output Only] The unique identifier for the resource. This
  12478. // identifier is defined by the server.
  12479. Id uint64 `json:"id,omitempty,string"`
  12480. // Kind: [Output Only] Type of resource. Always compute#license for
  12481. // licenses.
  12482. Kind string `json:"kind,omitempty"`
  12483. // LicenseCode: [Output Only] The unique code used to attach this
  12484. // license to images, snapshots, and disks.
  12485. LicenseCode uint64 `json:"licenseCode,omitempty,string"`
  12486. // Name: [Output Only] Name of the resource. The name is 1-63 characters
  12487. // long and complies with RFC1035.
  12488. Name string `json:"name,omitempty"`
  12489. ResourceRequirements *LicenseResourceRequirements `json:"resourceRequirements,omitempty"`
  12490. // SelfLink: [Output Only] Server-defined URL for the resource.
  12491. SelfLink string `json:"selfLink,omitempty"`
  12492. // Transferable: If false, licenses will not be copied from the source
  12493. // resource when creating an image from a disk, disk from snapshot, or
  12494. // snapshot from disk.
  12495. Transferable bool `json:"transferable,omitempty"`
  12496. // ServerResponse contains the HTTP response code and headers from the
  12497. // server.
  12498. googleapi.ServerResponse `json:"-"`
  12499. // ForceSendFields is a list of field names (e.g. "ChargesUseFee") to
  12500. // unconditionally include in API requests. By default, fields with
  12501. // empty values are omitted from API requests. However, any non-pointer,
  12502. // non-interface field appearing in ForceSendFields will be sent to the
  12503. // server regardless of whether the field is empty or not. This may be
  12504. // used to include empty fields in Patch requests.
  12505. ForceSendFields []string `json:"-"`
  12506. // NullFields is a list of field names (e.g. "ChargesUseFee") to include
  12507. // in API requests with the JSON null value. By default, fields with
  12508. // empty values are omitted from API requests. However, any field with
  12509. // an empty value appearing in NullFields will be sent to the server as
  12510. // null. It is an error if a field in this list has a non-empty value.
  12511. // This may be used to include null fields in Patch requests.
  12512. NullFields []string `json:"-"`
  12513. }
  12514. func (s *License) MarshalJSON() ([]byte, error) {
  12515. type NoMethod License
  12516. raw := NoMethod(*s)
  12517. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  12518. }
  12519. type LicenseCode struct {
  12520. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  12521. // format.
  12522. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  12523. // Description: [Output Only] Description of this License Code.
  12524. Description string `json:"description,omitempty"`
  12525. // Id: [Output Only] The unique identifier for the resource. This
  12526. // identifier is defined by the server.
  12527. Id uint64 `json:"id,omitempty,string"`
  12528. // Kind: [Output Only] Type of resource. Always compute#licenseCode for
  12529. // licenses.
  12530. Kind string `json:"kind,omitempty"`
  12531. // LicenseAlias: [Output Only] URL and description aliases of Licenses
  12532. // with the same License Code.
  12533. LicenseAlias []*LicenseCodeLicenseAlias `json:"licenseAlias,omitempty"`
  12534. // Name: [Output Only] Name of the resource. The name is 1-20 characters
  12535. // long and must be a valid 64 bit integer.
  12536. Name string `json:"name,omitempty"`
  12537. // SelfLink: [Output Only] Server-defined URL for the resource.
  12538. SelfLink string `json:"selfLink,omitempty"`
  12539. // State: [Output Only] Current state of this License Code.
  12540. //
  12541. // Possible values:
  12542. // "DISABLED"
  12543. // "ENABLED"
  12544. // "RESTRICTED"
  12545. // "STATE_UNSPECIFIED"
  12546. // "TERMINATED"
  12547. State string `json:"state,omitempty"`
  12548. // Transferable: [Output Only] If true, the license will remain attached
  12549. // when creating images or snapshots from disks. Otherwise, the license
  12550. // is not transferred.
  12551. Transferable bool `json:"transferable,omitempty"`
  12552. // ServerResponse contains the HTTP response code and headers from the
  12553. // server.
  12554. googleapi.ServerResponse `json:"-"`
  12555. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  12556. // to unconditionally include in API requests. By default, fields with
  12557. // empty values are omitted from API requests. However, any non-pointer,
  12558. // non-interface field appearing in ForceSendFields will be sent to the
  12559. // server regardless of whether the field is empty or not. This may be
  12560. // used to include empty fields in Patch requests.
  12561. ForceSendFields []string `json:"-"`
  12562. // NullFields is a list of field names (e.g. "CreationTimestamp") to
  12563. // include in API requests with the JSON null value. By default, fields
  12564. // with empty values are omitted from API requests. However, any field
  12565. // with an empty value appearing in NullFields will be sent to the
  12566. // server as null. It is an error if a field in this list has a
  12567. // non-empty value. This may be used to include null fields in Patch
  12568. // requests.
  12569. NullFields []string `json:"-"`
  12570. }
  12571. func (s *LicenseCode) MarshalJSON() ([]byte, error) {
  12572. type NoMethod LicenseCode
  12573. raw := NoMethod(*s)
  12574. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  12575. }
  12576. type LicenseCodeLicenseAlias struct {
  12577. // Description: [Output Only] Description of this License Code.
  12578. Description string `json:"description,omitempty"`
  12579. // SelfLink: [Output Only] URL of license corresponding to this License
  12580. // Code.
  12581. SelfLink string `json:"selfLink,omitempty"`
  12582. // ForceSendFields is a list of field names (e.g. "Description") to
  12583. // unconditionally include in API requests. By default, fields with
  12584. // empty values are omitted from API requests. However, any non-pointer,
  12585. // non-interface field appearing in ForceSendFields will be sent to the
  12586. // server regardless of whether the field is empty or not. This may be
  12587. // used to include empty fields in Patch requests.
  12588. ForceSendFields []string `json:"-"`
  12589. // NullFields is a list of field names (e.g. "Description") to include
  12590. // in API requests with the JSON null value. By default, fields with
  12591. // empty values are omitted from API requests. However, any field with
  12592. // an empty value appearing in NullFields will be sent to the server as
  12593. // null. It is an error if a field in this list has a non-empty value.
  12594. // This may be used to include null fields in Patch requests.
  12595. NullFields []string `json:"-"`
  12596. }
  12597. func (s *LicenseCodeLicenseAlias) MarshalJSON() ([]byte, error) {
  12598. type NoMethod LicenseCodeLicenseAlias
  12599. raw := NoMethod(*s)
  12600. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  12601. }
  12602. type LicenseResourceRequirements struct {
  12603. // MinGuestCpuCount: Minimum number of guest cpus required to use the
  12604. // Instance. Enforced at Instance creation and Instance start.
  12605. MinGuestCpuCount int64 `json:"minGuestCpuCount,omitempty"`
  12606. // MinMemoryMb: Minimum memory required to use the Instance. Enforced at
  12607. // Instance creation and Instance start.
  12608. MinMemoryMb int64 `json:"minMemoryMb,omitempty"`
  12609. // ForceSendFields is a list of field names (e.g. "MinGuestCpuCount") to
  12610. // unconditionally include in API requests. By default, fields with
  12611. // empty values are omitted from API requests. However, any non-pointer,
  12612. // non-interface field appearing in ForceSendFields will be sent to the
  12613. // server regardless of whether the field is empty or not. This may be
  12614. // used to include empty fields in Patch requests.
  12615. ForceSendFields []string `json:"-"`
  12616. // NullFields is a list of field names (e.g. "MinGuestCpuCount") to
  12617. // include in API requests with the JSON null value. By default, fields
  12618. // with empty values are omitted from API requests. However, any field
  12619. // with an empty value appearing in NullFields will be sent to the
  12620. // server as null. It is an error if a field in this list has a
  12621. // non-empty value. This may be used to include null fields in Patch
  12622. // requests.
  12623. NullFields []string `json:"-"`
  12624. }
  12625. func (s *LicenseResourceRequirements) MarshalJSON() ([]byte, error) {
  12626. type NoMethod LicenseResourceRequirements
  12627. raw := NoMethod(*s)
  12628. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  12629. }
  12630. type LicensesListResponse struct {
  12631. // Id: [Output Only] Unique identifier for the resource; defined by the
  12632. // server.
  12633. Id string `json:"id,omitempty"`
  12634. // Items: A list of License resources.
  12635. Items []*License `json:"items,omitempty"`
  12636. // NextPageToken: [Output Only] This token allows you to get the next
  12637. // page of results for list requests. If the number of results is larger
  12638. // than maxResults, use the nextPageToken as a value for the query
  12639. // parameter pageToken in the next list request. Subsequent list
  12640. // requests will have their own nextPageToken to continue paging through
  12641. // the results.
  12642. NextPageToken string `json:"nextPageToken,omitempty"`
  12643. // SelfLink: [Output Only] Server-defined URL for this resource.
  12644. SelfLink string `json:"selfLink,omitempty"`
  12645. // Warning: [Output Only] Informational warning message.
  12646. Warning *LicensesListResponseWarning `json:"warning,omitempty"`
  12647. // ServerResponse contains the HTTP response code and headers from the
  12648. // server.
  12649. googleapi.ServerResponse `json:"-"`
  12650. // ForceSendFields is a list of field names (e.g. "Id") to
  12651. // unconditionally include in API requests. By default, fields with
  12652. // empty values are omitted from API requests. However, any non-pointer,
  12653. // non-interface field appearing in ForceSendFields will be sent to the
  12654. // server regardless of whether the field is empty or not. This may be
  12655. // used to include empty fields in Patch requests.
  12656. ForceSendFields []string `json:"-"`
  12657. // NullFields is a list of field names (e.g. "Id") to include in API
  12658. // requests with the JSON null value. By default, fields with empty
  12659. // values are omitted from API requests. However, any field with an
  12660. // empty value appearing in NullFields will be sent to the server as
  12661. // null. It is an error if a field in this list has a non-empty value.
  12662. // This may be used to include null fields in Patch requests.
  12663. NullFields []string `json:"-"`
  12664. }
  12665. func (s *LicensesListResponse) MarshalJSON() ([]byte, error) {
  12666. type NoMethod LicensesListResponse
  12667. raw := NoMethod(*s)
  12668. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  12669. }
  12670. // LicensesListResponseWarning: [Output Only] Informational warning
  12671. // message.
  12672. type LicensesListResponseWarning struct {
  12673. // Code: [Output Only] A warning code, if applicable. For example,
  12674. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  12675. // the response.
  12676. //
  12677. // Possible values:
  12678. // "CLEANUP_FAILED"
  12679. // "DEPRECATED_RESOURCE_USED"
  12680. // "DEPRECATED_TYPE_USED"
  12681. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  12682. // "EXPERIMENTAL_TYPE_USED"
  12683. // "EXTERNAL_API_WARNING"
  12684. // "FIELD_VALUE_OVERRIDEN"
  12685. // "INJECTED_KERNELS_DEPRECATED"
  12686. // "MISSING_TYPE_DEPENDENCY"
  12687. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  12688. // "NEXT_HOP_CANNOT_IP_FORWARD"
  12689. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  12690. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  12691. // "NEXT_HOP_NOT_RUNNING"
  12692. // "NOT_CRITICAL_ERROR"
  12693. // "NO_RESULTS_ON_PAGE"
  12694. // "REQUIRED_TOS_AGREEMENT"
  12695. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  12696. // "RESOURCE_NOT_DELETED"
  12697. // "SCHEMA_VALIDATION_IGNORED"
  12698. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  12699. // "UNDECLARED_PROPERTIES"
  12700. // "UNREACHABLE"
  12701. Code string `json:"code,omitempty"`
  12702. // Data: [Output Only] Metadata about this warning in key: value format.
  12703. // For example:
  12704. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  12705. Data []*LicensesListResponseWarningData `json:"data,omitempty"`
  12706. // Message: [Output Only] A human-readable description of the warning
  12707. // code.
  12708. Message string `json:"message,omitempty"`
  12709. // ForceSendFields is a list of field names (e.g. "Code") to
  12710. // unconditionally include in API requests. By default, fields with
  12711. // empty values are omitted from API requests. However, any non-pointer,
  12712. // non-interface field appearing in ForceSendFields will be sent to the
  12713. // server regardless of whether the field is empty or not. This may be
  12714. // used to include empty fields in Patch requests.
  12715. ForceSendFields []string `json:"-"`
  12716. // NullFields is a list of field names (e.g. "Code") to include in API
  12717. // requests with the JSON null value. By default, fields with empty
  12718. // values are omitted from API requests. However, any field with an
  12719. // empty value appearing in NullFields will be sent to the server as
  12720. // null. It is an error if a field in this list has a non-empty value.
  12721. // This may be used to include null fields in Patch requests.
  12722. NullFields []string `json:"-"`
  12723. }
  12724. func (s *LicensesListResponseWarning) MarshalJSON() ([]byte, error) {
  12725. type NoMethod LicensesListResponseWarning
  12726. raw := NoMethod(*s)
  12727. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  12728. }
  12729. type LicensesListResponseWarningData struct {
  12730. // Key: [Output Only] A key that provides more detail on the warning
  12731. // being returned. For example, for warnings where there are no results
  12732. // in a list request for a particular zone, this key might be scope and
  12733. // the key value might be the zone name. Other examples might be a key
  12734. // indicating a deprecated resource and a suggested replacement, or a
  12735. // warning about invalid network settings (for example, if an instance
  12736. // attempts to perform IP forwarding but is not enabled for IP
  12737. // forwarding).
  12738. Key string `json:"key,omitempty"`
  12739. // Value: [Output Only] A warning data value corresponding to the key.
  12740. Value string `json:"value,omitempty"`
  12741. // ForceSendFields is a list of field names (e.g. "Key") to
  12742. // unconditionally include in API requests. By default, fields with
  12743. // empty values are omitted from API requests. However, any non-pointer,
  12744. // non-interface field appearing in ForceSendFields will be sent to the
  12745. // server regardless of whether the field is empty or not. This may be
  12746. // used to include empty fields in Patch requests.
  12747. ForceSendFields []string `json:"-"`
  12748. // NullFields is a list of field names (e.g. "Key") to include in API
  12749. // requests with the JSON null value. By default, fields with empty
  12750. // values are omitted from API requests. However, any field with an
  12751. // empty value appearing in NullFields will be sent to the server as
  12752. // null. It is an error if a field in this list has a non-empty value.
  12753. // This may be used to include null fields in Patch requests.
  12754. NullFields []string `json:"-"`
  12755. }
  12756. func (s *LicensesListResponseWarningData) MarshalJSON() ([]byte, error) {
  12757. type NoMethod LicensesListResponseWarningData
  12758. raw := NoMethod(*s)
  12759. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  12760. }
  12761. // LogConfig: Specifies what kind of log the caller must write
  12762. type LogConfig struct {
  12763. // CloudAudit: Cloud audit options.
  12764. CloudAudit *LogConfigCloudAuditOptions `json:"cloudAudit,omitempty"`
  12765. // Counter: Counter options.
  12766. Counter *LogConfigCounterOptions `json:"counter,omitempty"`
  12767. // DataAccess: Data access options.
  12768. DataAccess *LogConfigDataAccessOptions `json:"dataAccess,omitempty"`
  12769. // ForceSendFields is a list of field names (e.g. "CloudAudit") to
  12770. // unconditionally include in API requests. By default, fields with
  12771. // empty values are omitted from API requests. However, any non-pointer,
  12772. // non-interface field appearing in ForceSendFields will be sent to the
  12773. // server regardless of whether the field is empty or not. This may be
  12774. // used to include empty fields in Patch requests.
  12775. ForceSendFields []string `json:"-"`
  12776. // NullFields is a list of field names (e.g. "CloudAudit") to include in
  12777. // API requests with the JSON null value. By default, fields with empty
  12778. // values are omitted from API requests. However, any field with an
  12779. // empty value appearing in NullFields will be sent to the server as
  12780. // null. It is an error if a field in this list has a non-empty value.
  12781. // This may be used to include null fields in Patch requests.
  12782. NullFields []string `json:"-"`
  12783. }
  12784. func (s *LogConfig) MarshalJSON() ([]byte, error) {
  12785. type NoMethod LogConfig
  12786. raw := NoMethod(*s)
  12787. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  12788. }
  12789. // LogConfigCloudAuditOptions: Write a Cloud Audit log
  12790. type LogConfigCloudAuditOptions struct {
  12791. // AuthorizationLoggingOptions: Information used by the Cloud Audit
  12792. // Logging pipeline.
  12793. AuthorizationLoggingOptions *AuthorizationLoggingOptions `json:"authorizationLoggingOptions,omitempty"`
  12794. // LogName: The log_name to populate in the Cloud Audit Record.
  12795. //
  12796. // Possible values:
  12797. // "ADMIN_ACTIVITY"
  12798. // "DATA_ACCESS"
  12799. // "UNSPECIFIED_LOG_NAME"
  12800. LogName string `json:"logName,omitempty"`
  12801. // ForceSendFields is a list of field names (e.g.
  12802. // "AuthorizationLoggingOptions") to unconditionally include in API
  12803. // requests. By default, fields with empty values are omitted from API
  12804. // requests. However, any non-pointer, non-interface field appearing in
  12805. // ForceSendFields will be sent to the server regardless of whether the
  12806. // field is empty or not. This may be used to include empty fields in
  12807. // Patch requests.
  12808. ForceSendFields []string `json:"-"`
  12809. // NullFields is a list of field names (e.g.
  12810. // "AuthorizationLoggingOptions") to include in API requests with the
  12811. // JSON null value. By default, fields with empty values are omitted
  12812. // from API requests. However, any field with an empty value appearing
  12813. // in NullFields will be sent to the server as null. It is an error if a
  12814. // field in this list has a non-empty value. This may be used to include
  12815. // null fields in Patch requests.
  12816. NullFields []string `json:"-"`
  12817. }
  12818. func (s *LogConfigCloudAuditOptions) MarshalJSON() ([]byte, error) {
  12819. type NoMethod LogConfigCloudAuditOptions
  12820. raw := NoMethod(*s)
  12821. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  12822. }
  12823. // LogConfigCounterOptions: Increment a streamz counter with the
  12824. // specified metric and field names.
  12825. //
  12826. // Metric names should start with a '/', generally be lowercase-only,
  12827. // and end in "_count". Field names should not contain an initial slash.
  12828. // The actual exported metric names will have "/iam/policy"
  12829. // prepended.
  12830. //
  12831. // Field names correspond to IAM request parameters and field values are
  12832. // their respective values.
  12833. //
  12834. // At present the only supported field names are - "iam_principal",
  12835. // corresponding to IAMContext.principal; - "" (empty string), resulting
  12836. // in one aggretated counter with no field.
  12837. //
  12838. // Examples: counter { metric: "/debug_access_count" field:
  12839. // "iam_principal" } ==> increment counter
  12840. // /iam/policy/backend_debug_access_count {iam_principal=[value of
  12841. // IAMContext.principal]}
  12842. //
  12843. // At this time we do not support: * multiple field names (though this
  12844. // may be supported in the future) * decrementing the counter *
  12845. // incrementing it by anything other than 1
  12846. type LogConfigCounterOptions struct {
  12847. // Field: The field value to attribute.
  12848. Field string `json:"field,omitempty"`
  12849. // Metric: The metric to update.
  12850. Metric string `json:"metric,omitempty"`
  12851. // ForceSendFields is a list of field names (e.g. "Field") to
  12852. // unconditionally include in API requests. By default, fields with
  12853. // empty values are omitted from API requests. However, any non-pointer,
  12854. // non-interface field appearing in ForceSendFields will be sent to the
  12855. // server regardless of whether the field is empty or not. This may be
  12856. // used to include empty fields in Patch requests.
  12857. ForceSendFields []string `json:"-"`
  12858. // NullFields is a list of field names (e.g. "Field") to include in API
  12859. // requests with the JSON null value. By default, fields with empty
  12860. // values are omitted from API requests. However, any field with an
  12861. // empty value appearing in NullFields will be sent to the server as
  12862. // null. It is an error if a field in this list has a non-empty value.
  12863. // This may be used to include null fields in Patch requests.
  12864. NullFields []string `json:"-"`
  12865. }
  12866. func (s *LogConfigCounterOptions) MarshalJSON() ([]byte, error) {
  12867. type NoMethod LogConfigCounterOptions
  12868. raw := NoMethod(*s)
  12869. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  12870. }
  12871. // LogConfigDataAccessOptions: Write a Data Access (Gin) log
  12872. type LogConfigDataAccessOptions struct {
  12873. // LogMode: Whether Gin logging should happen in a fail-closed manner at
  12874. // the caller. This is relevant only in the LocalIAM implementation, for
  12875. // now.
  12876. //
  12877. // Possible values:
  12878. // "LOG_FAIL_CLOSED"
  12879. // "LOG_MODE_UNSPECIFIED"
  12880. LogMode string `json:"logMode,omitempty"`
  12881. // ForceSendFields is a list of field names (e.g. "LogMode") to
  12882. // unconditionally include in API requests. By default, fields with
  12883. // empty values are omitted from API requests. However, any non-pointer,
  12884. // non-interface field appearing in ForceSendFields will be sent to the
  12885. // server regardless of whether the field is empty or not. This may be
  12886. // used to include empty fields in Patch requests.
  12887. ForceSendFields []string `json:"-"`
  12888. // NullFields is a list of field names (e.g. "LogMode") to include in
  12889. // API requests with the JSON null value. By default, fields with empty
  12890. // values are omitted from API requests. However, any field with an
  12891. // empty value appearing in NullFields will be sent to the server as
  12892. // null. It is an error if a field in this list has a non-empty value.
  12893. // This may be used to include null fields in Patch requests.
  12894. NullFields []string `json:"-"`
  12895. }
  12896. func (s *LogConfigDataAccessOptions) MarshalJSON() ([]byte, error) {
  12897. type NoMethod LogConfigDataAccessOptions
  12898. raw := NoMethod(*s)
  12899. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  12900. }
  12901. // MachineType: A Machine Type resource. (== resource_for
  12902. // v1.machineTypes ==) (== resource_for beta.machineTypes ==)
  12903. type MachineType struct {
  12904. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  12905. // format.
  12906. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  12907. // Deprecated: [Output Only] The deprecation status associated with this
  12908. // machine type.
  12909. Deprecated *DeprecationStatus `json:"deprecated,omitempty"`
  12910. // Description: [Output Only] An optional textual description of the
  12911. // resource.
  12912. Description string `json:"description,omitempty"`
  12913. // GuestCpus: [Output Only] The number of virtual CPUs that are
  12914. // available to the instance.
  12915. GuestCpus int64 `json:"guestCpus,omitempty"`
  12916. // Id: [Output Only] The unique identifier for the resource. This
  12917. // identifier is defined by the server.
  12918. Id uint64 `json:"id,omitempty,string"`
  12919. // IsSharedCpu: [Output Only] Whether this machine type has a shared
  12920. // CPU. See Shared-core machine types for more information.
  12921. IsSharedCpu bool `json:"isSharedCpu,omitempty"`
  12922. // Kind: [Output Only] The type of the resource. Always
  12923. // compute#machineType for machine types.
  12924. Kind string `json:"kind,omitempty"`
  12925. // MaximumPersistentDisks: [Output Only] Maximum persistent disks
  12926. // allowed.
  12927. MaximumPersistentDisks int64 `json:"maximumPersistentDisks,omitempty"`
  12928. // MaximumPersistentDisksSizeGb: [Output Only] Maximum total persistent
  12929. // disks size (GB) allowed.
  12930. MaximumPersistentDisksSizeGb int64 `json:"maximumPersistentDisksSizeGb,omitempty,string"`
  12931. // MemoryMb: [Output Only] The amount of physical memory available to
  12932. // the instance, defined in MB.
  12933. MemoryMb int64 `json:"memoryMb,omitempty"`
  12934. // Name: [Output Only] Name of the resource.
  12935. Name string `json:"name,omitempty"`
  12936. // SelfLink: [Output Only] Server-defined URL for the resource.
  12937. SelfLink string `json:"selfLink,omitempty"`
  12938. // Zone: [Output Only] The name of the zone where the machine type
  12939. // resides, such as us-central1-a.
  12940. Zone string `json:"zone,omitempty"`
  12941. // ServerResponse contains the HTTP response code and headers from the
  12942. // server.
  12943. googleapi.ServerResponse `json:"-"`
  12944. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  12945. // to unconditionally include in API requests. By default, fields with
  12946. // empty values are omitted from API requests. However, any non-pointer,
  12947. // non-interface field appearing in ForceSendFields will be sent to the
  12948. // server regardless of whether the field is empty or not. This may be
  12949. // used to include empty fields in Patch requests.
  12950. ForceSendFields []string `json:"-"`
  12951. // NullFields is a list of field names (e.g. "CreationTimestamp") to
  12952. // include in API requests with the JSON null value. By default, fields
  12953. // with empty values are omitted from API requests. However, any field
  12954. // with an empty value appearing in NullFields will be sent to the
  12955. // server as null. It is an error if a field in this list has a
  12956. // non-empty value. This may be used to include null fields in Patch
  12957. // requests.
  12958. NullFields []string `json:"-"`
  12959. }
  12960. func (s *MachineType) MarshalJSON() ([]byte, error) {
  12961. type NoMethod MachineType
  12962. raw := NoMethod(*s)
  12963. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  12964. }
  12965. type MachineTypeAggregatedList struct {
  12966. // Id: [Output Only] Unique identifier for the resource; defined by the
  12967. // server.
  12968. Id string `json:"id,omitempty"`
  12969. // Items: A list of MachineTypesScopedList resources.
  12970. Items map[string]MachineTypesScopedList `json:"items,omitempty"`
  12971. // Kind: [Output Only] Type of resource. Always
  12972. // compute#machineTypeAggregatedList for aggregated lists of machine
  12973. // types.
  12974. Kind string `json:"kind,omitempty"`
  12975. // NextPageToken: [Output Only] This token allows you to get the next
  12976. // page of results for list requests. If the number of results is larger
  12977. // than maxResults, use the nextPageToken as a value for the query
  12978. // parameter pageToken in the next list request. Subsequent list
  12979. // requests will have their own nextPageToken to continue paging through
  12980. // the results.
  12981. NextPageToken string `json:"nextPageToken,omitempty"`
  12982. // SelfLink: [Output Only] Server-defined URL for this resource.
  12983. SelfLink string `json:"selfLink,omitempty"`
  12984. // Warning: [Output Only] Informational warning message.
  12985. Warning *MachineTypeAggregatedListWarning `json:"warning,omitempty"`
  12986. // ServerResponse contains the HTTP response code and headers from the
  12987. // server.
  12988. googleapi.ServerResponse `json:"-"`
  12989. // ForceSendFields is a list of field names (e.g. "Id") to
  12990. // unconditionally include in API requests. By default, fields with
  12991. // empty values are omitted from API requests. However, any non-pointer,
  12992. // non-interface field appearing in ForceSendFields will be sent to the
  12993. // server regardless of whether the field is empty or not. This may be
  12994. // used to include empty fields in Patch requests.
  12995. ForceSendFields []string `json:"-"`
  12996. // NullFields is a list of field names (e.g. "Id") to include in API
  12997. // requests with the JSON null value. By default, fields with empty
  12998. // values are omitted from API requests. However, any field with an
  12999. // empty value appearing in NullFields will be sent to the server as
  13000. // null. It is an error if a field in this list has a non-empty value.
  13001. // This may be used to include null fields in Patch requests.
  13002. NullFields []string `json:"-"`
  13003. }
  13004. func (s *MachineTypeAggregatedList) MarshalJSON() ([]byte, error) {
  13005. type NoMethod MachineTypeAggregatedList
  13006. raw := NoMethod(*s)
  13007. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  13008. }
  13009. // MachineTypeAggregatedListWarning: [Output Only] Informational warning
  13010. // message.
  13011. type MachineTypeAggregatedListWarning struct {
  13012. // Code: [Output Only] A warning code, if applicable. For example,
  13013. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  13014. // the response.
  13015. //
  13016. // Possible values:
  13017. // "CLEANUP_FAILED"
  13018. // "DEPRECATED_RESOURCE_USED"
  13019. // "DEPRECATED_TYPE_USED"
  13020. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  13021. // "EXPERIMENTAL_TYPE_USED"
  13022. // "EXTERNAL_API_WARNING"
  13023. // "FIELD_VALUE_OVERRIDEN"
  13024. // "INJECTED_KERNELS_DEPRECATED"
  13025. // "MISSING_TYPE_DEPENDENCY"
  13026. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  13027. // "NEXT_HOP_CANNOT_IP_FORWARD"
  13028. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  13029. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  13030. // "NEXT_HOP_NOT_RUNNING"
  13031. // "NOT_CRITICAL_ERROR"
  13032. // "NO_RESULTS_ON_PAGE"
  13033. // "REQUIRED_TOS_AGREEMENT"
  13034. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  13035. // "RESOURCE_NOT_DELETED"
  13036. // "SCHEMA_VALIDATION_IGNORED"
  13037. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  13038. // "UNDECLARED_PROPERTIES"
  13039. // "UNREACHABLE"
  13040. Code string `json:"code,omitempty"`
  13041. // Data: [Output Only] Metadata about this warning in key: value format.
  13042. // For example:
  13043. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  13044. Data []*MachineTypeAggregatedListWarningData `json:"data,omitempty"`
  13045. // Message: [Output Only] A human-readable description of the warning
  13046. // code.
  13047. Message string `json:"message,omitempty"`
  13048. // ForceSendFields is a list of field names (e.g. "Code") to
  13049. // unconditionally include in API requests. By default, fields with
  13050. // empty values are omitted from API requests. However, any non-pointer,
  13051. // non-interface field appearing in ForceSendFields will be sent to the
  13052. // server regardless of whether the field is empty or not. This may be
  13053. // used to include empty fields in Patch requests.
  13054. ForceSendFields []string `json:"-"`
  13055. // NullFields is a list of field names (e.g. "Code") to include in API
  13056. // requests with the JSON null value. By default, fields with empty
  13057. // values are omitted from API requests. However, any field with an
  13058. // empty value appearing in NullFields will be sent to the server as
  13059. // null. It is an error if a field in this list has a non-empty value.
  13060. // This may be used to include null fields in Patch requests.
  13061. NullFields []string `json:"-"`
  13062. }
  13063. func (s *MachineTypeAggregatedListWarning) MarshalJSON() ([]byte, error) {
  13064. type NoMethod MachineTypeAggregatedListWarning
  13065. raw := NoMethod(*s)
  13066. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  13067. }
  13068. type MachineTypeAggregatedListWarningData struct {
  13069. // Key: [Output Only] A key that provides more detail on the warning
  13070. // being returned. For example, for warnings where there are no results
  13071. // in a list request for a particular zone, this key might be scope and
  13072. // the key value might be the zone name. Other examples might be a key
  13073. // indicating a deprecated resource and a suggested replacement, or a
  13074. // warning about invalid network settings (for example, if an instance
  13075. // attempts to perform IP forwarding but is not enabled for IP
  13076. // forwarding).
  13077. Key string `json:"key,omitempty"`
  13078. // Value: [Output Only] A warning data value corresponding to the key.
  13079. Value string `json:"value,omitempty"`
  13080. // ForceSendFields is a list of field names (e.g. "Key") to
  13081. // unconditionally include in API requests. By default, fields with
  13082. // empty values are omitted from API requests. However, any non-pointer,
  13083. // non-interface field appearing in ForceSendFields will be sent to the
  13084. // server regardless of whether the field is empty or not. This may be
  13085. // used to include empty fields in Patch requests.
  13086. ForceSendFields []string `json:"-"`
  13087. // NullFields is a list of field names (e.g. "Key") to include in API
  13088. // requests with the JSON null value. By default, fields with empty
  13089. // values are omitted from API requests. However, any field with an
  13090. // empty value appearing in NullFields will be sent to the server as
  13091. // null. It is an error if a field in this list has a non-empty value.
  13092. // This may be used to include null fields in Patch requests.
  13093. NullFields []string `json:"-"`
  13094. }
  13095. func (s *MachineTypeAggregatedListWarningData) MarshalJSON() ([]byte, error) {
  13096. type NoMethod MachineTypeAggregatedListWarningData
  13097. raw := NoMethod(*s)
  13098. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  13099. }
  13100. // MachineTypeList: Contains a list of machine types.
  13101. type MachineTypeList struct {
  13102. // Id: [Output Only] Unique identifier for the resource; defined by the
  13103. // server.
  13104. Id string `json:"id,omitempty"`
  13105. // Items: A list of MachineType resources.
  13106. Items []*MachineType `json:"items,omitempty"`
  13107. // Kind: [Output Only] Type of resource. Always compute#machineTypeList
  13108. // for lists of machine types.
  13109. Kind string `json:"kind,omitempty"`
  13110. // NextPageToken: [Output Only] This token allows you to get the next
  13111. // page of results for list requests. If the number of results is larger
  13112. // than maxResults, use the nextPageToken as a value for the query
  13113. // parameter pageToken in the next list request. Subsequent list
  13114. // requests will have their own nextPageToken to continue paging through
  13115. // the results.
  13116. NextPageToken string `json:"nextPageToken,omitempty"`
  13117. // SelfLink: [Output Only] Server-defined URL for this resource.
  13118. SelfLink string `json:"selfLink,omitempty"`
  13119. // Warning: [Output Only] Informational warning message.
  13120. Warning *MachineTypeListWarning `json:"warning,omitempty"`
  13121. // ServerResponse contains the HTTP response code and headers from the
  13122. // server.
  13123. googleapi.ServerResponse `json:"-"`
  13124. // ForceSendFields is a list of field names (e.g. "Id") to
  13125. // unconditionally include in API requests. By default, fields with
  13126. // empty values are omitted from API requests. However, any non-pointer,
  13127. // non-interface field appearing in ForceSendFields will be sent to the
  13128. // server regardless of whether the field is empty or not. This may be
  13129. // used to include empty fields in Patch requests.
  13130. ForceSendFields []string `json:"-"`
  13131. // NullFields is a list of field names (e.g. "Id") to include in API
  13132. // requests with the JSON null value. By default, fields with empty
  13133. // values are omitted from API requests. However, any field with an
  13134. // empty value appearing in NullFields will be sent to the server as
  13135. // null. It is an error if a field in this list has a non-empty value.
  13136. // This may be used to include null fields in Patch requests.
  13137. NullFields []string `json:"-"`
  13138. }
  13139. func (s *MachineTypeList) MarshalJSON() ([]byte, error) {
  13140. type NoMethod MachineTypeList
  13141. raw := NoMethod(*s)
  13142. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  13143. }
  13144. // MachineTypeListWarning: [Output Only] Informational warning message.
  13145. type MachineTypeListWarning struct {
  13146. // Code: [Output Only] A warning code, if applicable. For example,
  13147. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  13148. // the response.
  13149. //
  13150. // Possible values:
  13151. // "CLEANUP_FAILED"
  13152. // "DEPRECATED_RESOURCE_USED"
  13153. // "DEPRECATED_TYPE_USED"
  13154. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  13155. // "EXPERIMENTAL_TYPE_USED"
  13156. // "EXTERNAL_API_WARNING"
  13157. // "FIELD_VALUE_OVERRIDEN"
  13158. // "INJECTED_KERNELS_DEPRECATED"
  13159. // "MISSING_TYPE_DEPENDENCY"
  13160. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  13161. // "NEXT_HOP_CANNOT_IP_FORWARD"
  13162. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  13163. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  13164. // "NEXT_HOP_NOT_RUNNING"
  13165. // "NOT_CRITICAL_ERROR"
  13166. // "NO_RESULTS_ON_PAGE"
  13167. // "REQUIRED_TOS_AGREEMENT"
  13168. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  13169. // "RESOURCE_NOT_DELETED"
  13170. // "SCHEMA_VALIDATION_IGNORED"
  13171. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  13172. // "UNDECLARED_PROPERTIES"
  13173. // "UNREACHABLE"
  13174. Code string `json:"code,omitempty"`
  13175. // Data: [Output Only] Metadata about this warning in key: value format.
  13176. // For example:
  13177. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  13178. Data []*MachineTypeListWarningData `json:"data,omitempty"`
  13179. // Message: [Output Only] A human-readable description of the warning
  13180. // code.
  13181. Message string `json:"message,omitempty"`
  13182. // ForceSendFields is a list of field names (e.g. "Code") to
  13183. // unconditionally include in API requests. By default, fields with
  13184. // empty values are omitted from API requests. However, any non-pointer,
  13185. // non-interface field appearing in ForceSendFields will be sent to the
  13186. // server regardless of whether the field is empty or not. This may be
  13187. // used to include empty fields in Patch requests.
  13188. ForceSendFields []string `json:"-"`
  13189. // NullFields is a list of field names (e.g. "Code") to include in API
  13190. // requests with the JSON null value. By default, fields with empty
  13191. // values are omitted from API requests. However, any field with an
  13192. // empty value appearing in NullFields will be sent to the server as
  13193. // null. It is an error if a field in this list has a non-empty value.
  13194. // This may be used to include null fields in Patch requests.
  13195. NullFields []string `json:"-"`
  13196. }
  13197. func (s *MachineTypeListWarning) MarshalJSON() ([]byte, error) {
  13198. type NoMethod MachineTypeListWarning
  13199. raw := NoMethod(*s)
  13200. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  13201. }
  13202. type MachineTypeListWarningData struct {
  13203. // Key: [Output Only] A key that provides more detail on the warning
  13204. // being returned. For example, for warnings where there are no results
  13205. // in a list request for a particular zone, this key might be scope and
  13206. // the key value might be the zone name. Other examples might be a key
  13207. // indicating a deprecated resource and a suggested replacement, or a
  13208. // warning about invalid network settings (for example, if an instance
  13209. // attempts to perform IP forwarding but is not enabled for IP
  13210. // forwarding).
  13211. Key string `json:"key,omitempty"`
  13212. // Value: [Output Only] A warning data value corresponding to the key.
  13213. Value string `json:"value,omitempty"`
  13214. // ForceSendFields is a list of field names (e.g. "Key") to
  13215. // unconditionally include in API requests. By default, fields with
  13216. // empty values are omitted from API requests. However, any non-pointer,
  13217. // non-interface field appearing in ForceSendFields will be sent to the
  13218. // server regardless of whether the field is empty or not. This may be
  13219. // used to include empty fields in Patch requests.
  13220. ForceSendFields []string `json:"-"`
  13221. // NullFields is a list of field names (e.g. "Key") to include in API
  13222. // requests with the JSON null value. By default, fields with empty
  13223. // values are omitted from API requests. However, any field with an
  13224. // empty value appearing in NullFields will be sent to the server as
  13225. // null. It is an error if a field in this list has a non-empty value.
  13226. // This may be used to include null fields in Patch requests.
  13227. NullFields []string `json:"-"`
  13228. }
  13229. func (s *MachineTypeListWarningData) MarshalJSON() ([]byte, error) {
  13230. type NoMethod MachineTypeListWarningData
  13231. raw := NoMethod(*s)
  13232. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  13233. }
  13234. type MachineTypesScopedList struct {
  13235. // MachineTypes: [Output Only] A list of machine types contained in this
  13236. // scope.
  13237. MachineTypes []*MachineType `json:"machineTypes,omitempty"`
  13238. // Warning: [Output Only] An informational warning that appears when the
  13239. // machine types list is empty.
  13240. Warning *MachineTypesScopedListWarning `json:"warning,omitempty"`
  13241. // ForceSendFields is a list of field names (e.g. "MachineTypes") to
  13242. // unconditionally include in API requests. By default, fields with
  13243. // empty values are omitted from API requests. However, any non-pointer,
  13244. // non-interface field appearing in ForceSendFields will be sent to the
  13245. // server regardless of whether the field is empty or not. This may be
  13246. // used to include empty fields in Patch requests.
  13247. ForceSendFields []string `json:"-"`
  13248. // NullFields is a list of field names (e.g. "MachineTypes") to include
  13249. // in API requests with the JSON null value. By default, fields with
  13250. // empty values are omitted from API requests. However, any field with
  13251. // an empty value appearing in NullFields will be sent to the server as
  13252. // null. It is an error if a field in this list has a non-empty value.
  13253. // This may be used to include null fields in Patch requests.
  13254. NullFields []string `json:"-"`
  13255. }
  13256. func (s *MachineTypesScopedList) MarshalJSON() ([]byte, error) {
  13257. type NoMethod MachineTypesScopedList
  13258. raw := NoMethod(*s)
  13259. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  13260. }
  13261. // MachineTypesScopedListWarning: [Output Only] An informational warning
  13262. // that appears when the machine types list is empty.
  13263. type MachineTypesScopedListWarning struct {
  13264. // Code: [Output Only] A warning code, if applicable. For example,
  13265. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  13266. // the response.
  13267. //
  13268. // Possible values:
  13269. // "CLEANUP_FAILED"
  13270. // "DEPRECATED_RESOURCE_USED"
  13271. // "DEPRECATED_TYPE_USED"
  13272. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  13273. // "EXPERIMENTAL_TYPE_USED"
  13274. // "EXTERNAL_API_WARNING"
  13275. // "FIELD_VALUE_OVERRIDEN"
  13276. // "INJECTED_KERNELS_DEPRECATED"
  13277. // "MISSING_TYPE_DEPENDENCY"
  13278. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  13279. // "NEXT_HOP_CANNOT_IP_FORWARD"
  13280. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  13281. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  13282. // "NEXT_HOP_NOT_RUNNING"
  13283. // "NOT_CRITICAL_ERROR"
  13284. // "NO_RESULTS_ON_PAGE"
  13285. // "REQUIRED_TOS_AGREEMENT"
  13286. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  13287. // "RESOURCE_NOT_DELETED"
  13288. // "SCHEMA_VALIDATION_IGNORED"
  13289. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  13290. // "UNDECLARED_PROPERTIES"
  13291. // "UNREACHABLE"
  13292. Code string `json:"code,omitempty"`
  13293. // Data: [Output Only] Metadata about this warning in key: value format.
  13294. // For example:
  13295. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  13296. Data []*MachineTypesScopedListWarningData `json:"data,omitempty"`
  13297. // Message: [Output Only] A human-readable description of the warning
  13298. // code.
  13299. Message string `json:"message,omitempty"`
  13300. // ForceSendFields is a list of field names (e.g. "Code") to
  13301. // unconditionally include in API requests. By default, fields with
  13302. // empty values are omitted from API requests. However, any non-pointer,
  13303. // non-interface field appearing in ForceSendFields will be sent to the
  13304. // server regardless of whether the field is empty or not. This may be
  13305. // used to include empty fields in Patch requests.
  13306. ForceSendFields []string `json:"-"`
  13307. // NullFields is a list of field names (e.g. "Code") to include in API
  13308. // requests with the JSON null value. By default, fields with empty
  13309. // values are omitted from API requests. However, any field with an
  13310. // empty value appearing in NullFields will be sent to the server as
  13311. // null. It is an error if a field in this list has a non-empty value.
  13312. // This may be used to include null fields in Patch requests.
  13313. NullFields []string `json:"-"`
  13314. }
  13315. func (s *MachineTypesScopedListWarning) MarshalJSON() ([]byte, error) {
  13316. type NoMethod MachineTypesScopedListWarning
  13317. raw := NoMethod(*s)
  13318. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  13319. }
  13320. type MachineTypesScopedListWarningData struct {
  13321. // Key: [Output Only] A key that provides more detail on the warning
  13322. // being returned. For example, for warnings where there are no results
  13323. // in a list request for a particular zone, this key might be scope and
  13324. // the key value might be the zone name. Other examples might be a key
  13325. // indicating a deprecated resource and a suggested replacement, or a
  13326. // warning about invalid network settings (for example, if an instance
  13327. // attempts to perform IP forwarding but is not enabled for IP
  13328. // forwarding).
  13329. Key string `json:"key,omitempty"`
  13330. // Value: [Output Only] A warning data value corresponding to the key.
  13331. Value string `json:"value,omitempty"`
  13332. // ForceSendFields is a list of field names (e.g. "Key") to
  13333. // unconditionally include in API requests. By default, fields with
  13334. // empty values are omitted from API requests. However, any non-pointer,
  13335. // non-interface field appearing in ForceSendFields will be sent to the
  13336. // server regardless of whether the field is empty or not. This may be
  13337. // used to include empty fields in Patch requests.
  13338. ForceSendFields []string `json:"-"`
  13339. // NullFields is a list of field names (e.g. "Key") to include in API
  13340. // requests with the JSON null value. By default, fields with empty
  13341. // values are omitted from API requests. However, any field with an
  13342. // empty value appearing in NullFields will be sent to the server as
  13343. // null. It is an error if a field in this list has a non-empty value.
  13344. // This may be used to include null fields in Patch requests.
  13345. NullFields []string `json:"-"`
  13346. }
  13347. func (s *MachineTypesScopedListWarningData) MarshalJSON() ([]byte, error) {
  13348. type NoMethod MachineTypesScopedListWarningData
  13349. raw := NoMethod(*s)
  13350. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  13351. }
  13352. // ManagedInstance: A Managed Instance resource.
  13353. type ManagedInstance struct {
  13354. // CurrentAction: [Output Only] The current action that the managed
  13355. // instance group has scheduled for the instance. Possible values:
  13356. // - NONE The instance is running, and the managed instance group does
  13357. // not have any scheduled actions for this instance.
  13358. // - CREATING The managed instance group is creating this instance. If
  13359. // the group fails to create this instance, it will try again until it
  13360. // is successful.
  13361. // - CREATING_WITHOUT_RETRIES The managed instance group is attempting
  13362. // to create this instance only once. If the group fails to create this
  13363. // instance, it does not try again and the group's targetSize value is
  13364. // decreased instead.
  13365. // - RECREATING The managed instance group is recreating this instance.
  13366. //
  13367. // - DELETING The managed instance group is permanently deleting this
  13368. // instance.
  13369. // - ABANDONING The managed instance group is abandoning this instance.
  13370. // The instance will be removed from the instance group and from any
  13371. // target pools that are associated with this group.
  13372. // - RESTARTING The managed instance group is restarting the instance.
  13373. //
  13374. // - REFRESHING The managed instance group is applying configuration
  13375. // changes to the instance without stopping it. For example, the group
  13376. // can update the target pool list for an instance without stopping that
  13377. // instance.
  13378. // - VERIFYING The managed instance group has created the instance and
  13379. // it is in the process of being verified.
  13380. //
  13381. // Possible values:
  13382. // "ABANDONING"
  13383. // "CREATING"
  13384. // "CREATING_WITHOUT_RETRIES"
  13385. // "DELETING"
  13386. // "NONE"
  13387. // "RECREATING"
  13388. // "REFRESHING"
  13389. // "RESTARTING"
  13390. // "VERIFYING"
  13391. CurrentAction string `json:"currentAction,omitempty"`
  13392. // Id: [Output only] The unique identifier for this resource. This field
  13393. // is empty when instance does not exist.
  13394. Id uint64 `json:"id,omitempty,string"`
  13395. // Instance: [Output Only] The URL of the instance. The URL can exist
  13396. // even if the instance has not yet been created.
  13397. Instance string `json:"instance,omitempty"`
  13398. // InstanceStatus: [Output Only] The status of the instance. This field
  13399. // is empty when the instance does not exist.
  13400. //
  13401. // Possible values:
  13402. // "PROVISIONING"
  13403. // "RUNNING"
  13404. // "STAGING"
  13405. // "STOPPED"
  13406. // "STOPPING"
  13407. // "SUSPENDED"
  13408. // "SUSPENDING"
  13409. // "TERMINATED"
  13410. InstanceStatus string `json:"instanceStatus,omitempty"`
  13411. // LastAttempt: [Output Only] Information about the last attempt to
  13412. // create or delete the instance.
  13413. LastAttempt *ManagedInstanceLastAttempt `json:"lastAttempt,omitempty"`
  13414. // Version: [Output Only] Intended version of this instance.
  13415. Version *ManagedInstanceVersion `json:"version,omitempty"`
  13416. // ForceSendFields is a list of field names (e.g. "CurrentAction") to
  13417. // unconditionally include in API requests. By default, fields with
  13418. // empty values are omitted from API requests. However, any non-pointer,
  13419. // non-interface field appearing in ForceSendFields will be sent to the
  13420. // server regardless of whether the field is empty or not. This may be
  13421. // used to include empty fields in Patch requests.
  13422. ForceSendFields []string `json:"-"`
  13423. // NullFields is a list of field names (e.g. "CurrentAction") to include
  13424. // in API requests with the JSON null value. By default, fields with
  13425. // empty values are omitted from API requests. However, any field with
  13426. // an empty value appearing in NullFields will be sent to the server as
  13427. // null. It is an error if a field in this list has a non-empty value.
  13428. // This may be used to include null fields in Patch requests.
  13429. NullFields []string `json:"-"`
  13430. }
  13431. func (s *ManagedInstance) MarshalJSON() ([]byte, error) {
  13432. type NoMethod ManagedInstance
  13433. raw := NoMethod(*s)
  13434. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  13435. }
  13436. type ManagedInstanceLastAttempt struct {
  13437. // Errors: [Output Only] Encountered errors during the last attempt to
  13438. // create or delete the instance.
  13439. Errors *ManagedInstanceLastAttemptErrors `json:"errors,omitempty"`
  13440. // ForceSendFields is a list of field names (e.g. "Errors") to
  13441. // unconditionally include in API requests. By default, fields with
  13442. // empty values are omitted from API requests. However, any non-pointer,
  13443. // non-interface field appearing in ForceSendFields will be sent to the
  13444. // server regardless of whether the field is empty or not. This may be
  13445. // used to include empty fields in Patch requests.
  13446. ForceSendFields []string `json:"-"`
  13447. // NullFields is a list of field names (e.g. "Errors") to include in API
  13448. // requests with the JSON null value. By default, fields with empty
  13449. // values are omitted from API requests. However, any field with an
  13450. // empty value appearing in NullFields will be sent to the server as
  13451. // null. It is an error if a field in this list has a non-empty value.
  13452. // This may be used to include null fields in Patch requests.
  13453. NullFields []string `json:"-"`
  13454. }
  13455. func (s *ManagedInstanceLastAttempt) MarshalJSON() ([]byte, error) {
  13456. type NoMethod ManagedInstanceLastAttempt
  13457. raw := NoMethod(*s)
  13458. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  13459. }
  13460. // ManagedInstanceLastAttemptErrors: [Output Only] Encountered errors
  13461. // during the last attempt to create or delete the instance.
  13462. type ManagedInstanceLastAttemptErrors struct {
  13463. // Errors: [Output Only] The array of errors encountered while
  13464. // processing this operation.
  13465. Errors []*ManagedInstanceLastAttemptErrorsErrors `json:"errors,omitempty"`
  13466. // ForceSendFields is a list of field names (e.g. "Errors") to
  13467. // unconditionally include in API requests. By default, fields with
  13468. // empty values are omitted from API requests. However, any non-pointer,
  13469. // non-interface field appearing in ForceSendFields will be sent to the
  13470. // server regardless of whether the field is empty or not. This may be
  13471. // used to include empty fields in Patch requests.
  13472. ForceSendFields []string `json:"-"`
  13473. // NullFields is a list of field names (e.g. "Errors") to include in API
  13474. // requests with the JSON null value. By default, fields with empty
  13475. // values are omitted from API requests. However, any field with an
  13476. // empty value appearing in NullFields will be sent to the server as
  13477. // null. It is an error if a field in this list has a non-empty value.
  13478. // This may be used to include null fields in Patch requests.
  13479. NullFields []string `json:"-"`
  13480. }
  13481. func (s *ManagedInstanceLastAttemptErrors) MarshalJSON() ([]byte, error) {
  13482. type NoMethod ManagedInstanceLastAttemptErrors
  13483. raw := NoMethod(*s)
  13484. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  13485. }
  13486. type ManagedInstanceLastAttemptErrorsErrors struct {
  13487. // Code: [Output Only] The error type identifier for this error.
  13488. Code string `json:"code,omitempty"`
  13489. // Location: [Output Only] Indicates the field in the request that
  13490. // caused the error. This property is optional.
  13491. Location string `json:"location,omitempty"`
  13492. // Message: [Output Only] An optional, human-readable error message.
  13493. Message string `json:"message,omitempty"`
  13494. // ForceSendFields is a list of field names (e.g. "Code") to
  13495. // unconditionally include in API requests. By default, fields with
  13496. // empty values are omitted from API requests. However, any non-pointer,
  13497. // non-interface field appearing in ForceSendFields will be sent to the
  13498. // server regardless of whether the field is empty or not. This may be
  13499. // used to include empty fields in Patch requests.
  13500. ForceSendFields []string `json:"-"`
  13501. // NullFields is a list of field names (e.g. "Code") to include in API
  13502. // requests with the JSON null value. By default, fields with empty
  13503. // values are omitted from API requests. However, any field with an
  13504. // empty value appearing in NullFields will be sent to the server as
  13505. // null. It is an error if a field in this list has a non-empty value.
  13506. // This may be used to include null fields in Patch requests.
  13507. NullFields []string `json:"-"`
  13508. }
  13509. func (s *ManagedInstanceLastAttemptErrorsErrors) MarshalJSON() ([]byte, error) {
  13510. type NoMethod ManagedInstanceLastAttemptErrorsErrors
  13511. raw := NoMethod(*s)
  13512. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  13513. }
  13514. type ManagedInstanceVersion struct {
  13515. // InstanceTemplate: [Output Only] The intended template of the
  13516. // instance. This field is empty when current_action is one of {
  13517. // DELETING, ABANDONING }.
  13518. InstanceTemplate string `json:"instanceTemplate,omitempty"`
  13519. // Name: [Output Only] Name of the version.
  13520. Name string `json:"name,omitempty"`
  13521. // ForceSendFields is a list of field names (e.g. "InstanceTemplate") to
  13522. // unconditionally include in API requests. By default, fields with
  13523. // empty values are omitted from API requests. However, any non-pointer,
  13524. // non-interface field appearing in ForceSendFields will be sent to the
  13525. // server regardless of whether the field is empty or not. This may be
  13526. // used to include empty fields in Patch requests.
  13527. ForceSendFields []string `json:"-"`
  13528. // NullFields is a list of field names (e.g. "InstanceTemplate") to
  13529. // include in API requests with the JSON null value. By default, fields
  13530. // with empty values are omitted from API requests. However, any field
  13531. // with an empty value appearing in NullFields will be sent to the
  13532. // server as null. It is an error if a field in this list has a
  13533. // non-empty value. This may be used to include null fields in Patch
  13534. // requests.
  13535. NullFields []string `json:"-"`
  13536. }
  13537. func (s *ManagedInstanceVersion) MarshalJSON() ([]byte, error) {
  13538. type NoMethod ManagedInstanceVersion
  13539. raw := NoMethod(*s)
  13540. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  13541. }
  13542. // Metadata: A metadata key/value entry.
  13543. type Metadata struct {
  13544. // Fingerprint: Specifies a fingerprint for this request, which is
  13545. // essentially a hash of the metadata's contents and used for optimistic
  13546. // locking. The fingerprint is initially generated by Compute Engine and
  13547. // changes after every request to modify or update metadata. You must
  13548. // always provide an up-to-date fingerprint hash in order to update or
  13549. // change metadata.
  13550. Fingerprint string `json:"fingerprint,omitempty"`
  13551. // Items: Array of key/value pairs. The total size of all keys and
  13552. // values must be less than 512 KB.
  13553. Items []*MetadataItems `json:"items,omitempty"`
  13554. // Kind: [Output Only] Type of the resource. Always compute#metadata for
  13555. // metadata.
  13556. Kind string `json:"kind,omitempty"`
  13557. // ForceSendFields is a list of field names (e.g. "Fingerprint") to
  13558. // unconditionally include in API requests. By default, fields with
  13559. // empty values are omitted from API requests. However, any non-pointer,
  13560. // non-interface field appearing in ForceSendFields will be sent to the
  13561. // server regardless of whether the field is empty or not. This may be
  13562. // used to include empty fields in Patch requests.
  13563. ForceSendFields []string `json:"-"`
  13564. // NullFields is a list of field names (e.g. "Fingerprint") to include
  13565. // in API requests with the JSON null value. By default, fields with
  13566. // empty values are omitted from API requests. However, any field with
  13567. // an empty value appearing in NullFields will be sent to the server as
  13568. // null. It is an error if a field in this list has a non-empty value.
  13569. // This may be used to include null fields in Patch requests.
  13570. NullFields []string `json:"-"`
  13571. }
  13572. func (s *Metadata) MarshalJSON() ([]byte, error) {
  13573. type NoMethod Metadata
  13574. raw := NoMethod(*s)
  13575. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  13576. }
  13577. type MetadataItems struct {
  13578. // Key: Key for the metadata entry. Keys must conform to the following
  13579. // regexp: [a-zA-Z0-9-_]+, and be less than 128 bytes in length. This is
  13580. // reflected as part of a URL in the metadata server. Additionally, to
  13581. // avoid ambiguity, keys must not conflict with any other metadata keys
  13582. // for the project.
  13583. Key string `json:"key,omitempty"`
  13584. // Value: Value for the metadata entry. These are free-form strings, and
  13585. // only have meaning as interpreted by the image running in the
  13586. // instance. The only restriction placed on values is that their size
  13587. // must be less than or equal to 262144 bytes (256 KiB).
  13588. Value *string `json:"value,omitempty"`
  13589. // ForceSendFields is a list of field names (e.g. "Key") to
  13590. // unconditionally include in API requests. By default, fields with
  13591. // empty values are omitted from API requests. However, any non-pointer,
  13592. // non-interface field appearing in ForceSendFields will be sent to the
  13593. // server regardless of whether the field is empty or not. This may be
  13594. // used to include empty fields in Patch requests.
  13595. ForceSendFields []string `json:"-"`
  13596. // NullFields is a list of field names (e.g. "Key") to include in API
  13597. // requests with the JSON null value. By default, fields with empty
  13598. // values are omitted from API requests. However, any field with an
  13599. // empty value appearing in NullFields will be sent to the server as
  13600. // null. It is an error if a field in this list has a non-empty value.
  13601. // This may be used to include null fields in Patch requests.
  13602. NullFields []string `json:"-"`
  13603. }
  13604. func (s *MetadataItems) MarshalJSON() ([]byte, error) {
  13605. type NoMethod MetadataItems
  13606. raw := NoMethod(*s)
  13607. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  13608. }
  13609. // NamedPort: The named port. For example: .
  13610. type NamedPort struct {
  13611. // Name: The name for this named port. The name must be 1-63 characters
  13612. // long, and comply with RFC1035.
  13613. Name string `json:"name,omitempty"`
  13614. // Port: The port number, which can be a value between 1 and 65535.
  13615. Port int64 `json:"port,omitempty"`
  13616. // ForceSendFields is a list of field names (e.g. "Name") to
  13617. // unconditionally include in API requests. By default, fields with
  13618. // empty values are omitted from API requests. However, any non-pointer,
  13619. // non-interface field appearing in ForceSendFields will be sent to the
  13620. // server regardless of whether the field is empty or not. This may be
  13621. // used to include empty fields in Patch requests.
  13622. ForceSendFields []string `json:"-"`
  13623. // NullFields is a list of field names (e.g. "Name") to include in API
  13624. // requests with the JSON null value. By default, fields with empty
  13625. // values are omitted from API requests. However, any field with an
  13626. // empty value appearing in NullFields will be sent to the server as
  13627. // null. It is an error if a field in this list has a non-empty value.
  13628. // This may be used to include null fields in Patch requests.
  13629. NullFields []string `json:"-"`
  13630. }
  13631. func (s *NamedPort) MarshalJSON() ([]byte, error) {
  13632. type NoMethod NamedPort
  13633. raw := NoMethod(*s)
  13634. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  13635. }
  13636. // Network: Represents a Network resource. Read Networks and Firewalls
  13637. // for more information. (== resource_for v1.networks ==) (==
  13638. // resource_for beta.networks ==)
  13639. type Network struct {
  13640. // IPv4Range: The range of internal addresses that are legal on this
  13641. // network. This range is a CIDR specification, for example:
  13642. // 192.168.0.0/16. Provided by the client when the network is created.
  13643. IPv4Range string `json:"IPv4Range,omitempty"`
  13644. // AutoCreateSubnetworks: When set to true, the network is created in
  13645. // "auto subnet mode". When set to false, the network is in "custom
  13646. // subnet mode".
  13647. //
  13648. // In "auto subnet mode", a newly created network is assigned the
  13649. // default CIDR of 10.128.0.0/9 and it automatically creates one
  13650. // subnetwork per region.
  13651. AutoCreateSubnetworks bool `json:"autoCreateSubnetworks,omitempty"`
  13652. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  13653. // format.
  13654. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  13655. // Description: An optional description of this resource. Provide this
  13656. // property when you create the resource.
  13657. Description string `json:"description,omitempty"`
  13658. // GatewayIPv4: A gateway address for default routing to other networks.
  13659. // This value is read only and is selected by the Google Compute Engine,
  13660. // typically as the first usable address in the IPv4Range.
  13661. GatewayIPv4 string `json:"gatewayIPv4,omitempty"`
  13662. // Id: [Output Only] The unique identifier for the resource. This
  13663. // identifier is defined by the server.
  13664. Id uint64 `json:"id,omitempty,string"`
  13665. // Kind: [Output Only] Type of the resource. Always compute#network for
  13666. // networks.
  13667. Kind string `json:"kind,omitempty"`
  13668. // Name: Name of the resource. Provided by the client when the resource
  13669. // is created. The name must be 1-63 characters long, and comply with
  13670. // RFC1035. Specifically, the name must be 1-63 characters long and
  13671. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  13672. // the first character must be a lowercase letter, and all following
  13673. // characters must be a dash, lowercase letter, or digit, except the
  13674. // last character, which cannot be a dash.
  13675. Name string `json:"name,omitempty"`
  13676. // Peerings: [Output Only] A list of network peerings for the resource.
  13677. Peerings []*NetworkPeering `json:"peerings,omitempty"`
  13678. // RoutingConfig: The network-level routing configuration for this
  13679. // network. Used by Cloud Router to determine what type of network-wide
  13680. // routing behavior to enforce.
  13681. RoutingConfig *NetworkRoutingConfig `json:"routingConfig,omitempty"`
  13682. // SelfLink: [Output Only] Server-defined URL for the resource.
  13683. SelfLink string `json:"selfLink,omitempty"`
  13684. // Subnetworks: [Output Only] Server-defined fully-qualified URLs for
  13685. // all subnetworks in this network.
  13686. Subnetworks []string `json:"subnetworks,omitempty"`
  13687. // ServerResponse contains the HTTP response code and headers from the
  13688. // server.
  13689. googleapi.ServerResponse `json:"-"`
  13690. // ForceSendFields is a list of field names (e.g. "IPv4Range") to
  13691. // unconditionally include in API requests. By default, fields with
  13692. // empty values are omitted from API requests. However, any non-pointer,
  13693. // non-interface field appearing in ForceSendFields will be sent to the
  13694. // server regardless of whether the field is empty or not. This may be
  13695. // used to include empty fields in Patch requests.
  13696. ForceSendFields []string `json:"-"`
  13697. // NullFields is a list of field names (e.g. "IPv4Range") to include in
  13698. // API requests with the JSON null value. By default, fields with empty
  13699. // values are omitted from API requests. However, any field with an
  13700. // empty value appearing in NullFields will be sent to the server as
  13701. // null. It is an error if a field in this list has a non-empty value.
  13702. // This may be used to include null fields in Patch requests.
  13703. NullFields []string `json:"-"`
  13704. }
  13705. func (s *Network) MarshalJSON() ([]byte, error) {
  13706. type NoMethod Network
  13707. raw := NoMethod(*s)
  13708. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  13709. }
  13710. // NetworkEndpoint: The network endpoint.
  13711. type NetworkEndpoint struct {
  13712. // Instance: The name for a specific VM instance that the IP address
  13713. // belongs to. This is required for network endpoints of type GCE_VM_IP
  13714. // and GCE_VM_IP_PORT. The instance must be in the same zone of network
  13715. // endpoint group.
  13716. //
  13717. // The name must be 1-63 characters long, and comply with RFC1035.
  13718. Instance string `json:"instance,omitempty"`
  13719. // IpAddress: Optional IPv4 address of network endpoint. The IP address
  13720. // must belong to a VM in GCE (either the primary IP or as part of an
  13721. // aliased IP range). If the IP address is not specified, then the
  13722. // primary IP address for the VM instance in the network that the
  13723. // network endpoint group belongs to will be used.
  13724. IpAddress string `json:"ipAddress,omitempty"`
  13725. // Port: Optional port number of network endpoint. If not specified and
  13726. // the NetworkEndpointGroup.network_endpoint_type is GCE_IP_PORT, the
  13727. // defaultPort for the network endpoint group will be used.
  13728. Port int64 `json:"port,omitempty"`
  13729. // ForceSendFields is a list of field names (e.g. "Instance") to
  13730. // unconditionally include in API requests. By default, fields with
  13731. // empty values are omitted from API requests. However, any non-pointer,
  13732. // non-interface field appearing in ForceSendFields will be sent to the
  13733. // server regardless of whether the field is empty or not. This may be
  13734. // used to include empty fields in Patch requests.
  13735. ForceSendFields []string `json:"-"`
  13736. // NullFields is a list of field names (e.g. "Instance") to include in
  13737. // API requests with the JSON null value. By default, fields with empty
  13738. // values are omitted from API requests. However, any field with an
  13739. // empty value appearing in NullFields will be sent to the server as
  13740. // null. It is an error if a field in this list has a non-empty value.
  13741. // This may be used to include null fields in Patch requests.
  13742. NullFields []string `json:"-"`
  13743. }
  13744. func (s *NetworkEndpoint) MarshalJSON() ([]byte, error) {
  13745. type NoMethod NetworkEndpoint
  13746. raw := NoMethod(*s)
  13747. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  13748. }
  13749. // NetworkEndpointGroup: Represents a collection of network endpoints.
  13750. type NetworkEndpointGroup struct {
  13751. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  13752. // format.
  13753. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  13754. // Description: An optional description of this resource. Provide this
  13755. // property when you create the resource.
  13756. Description string `json:"description,omitempty"`
  13757. // Id: [Output Only] The unique identifier for the resource. This
  13758. // identifier is defined by the server.
  13759. Id uint64 `json:"id,omitempty,string"`
  13760. // Kind: [Output Only] Type of the resource. Always
  13761. // compute#networkEndpointGroup for network endpoint group.
  13762. Kind string `json:"kind,omitempty"`
  13763. // LoadBalancer: This field is only valid when the network endpoint
  13764. // group type is LOAD_BALANCING.
  13765. LoadBalancer *NetworkEndpointGroupLbNetworkEndpointGroup `json:"loadBalancer,omitempty"`
  13766. // Name: Name of the resource; provided by the client when the resource
  13767. // is created. The name must be 1-63 characters long, and comply with
  13768. // RFC1035. Specifically, the name must be 1-63 characters long and
  13769. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  13770. // the first character must be a lowercase letter, and all following
  13771. // characters must be a dash, lowercase letter, or digit, except the
  13772. // last character, which cannot be a dash.
  13773. Name string `json:"name,omitempty"`
  13774. // NetworkEndpointType: Type of network endpoints in this network
  13775. // endpoint group. Only supported values for LOAD_BALANCING are
  13776. // GCE_VM_IP or GCE_VM_IP_PORT.
  13777. //
  13778. // Possible values:
  13779. // "GCE_VM_IP_PORT"
  13780. NetworkEndpointType string `json:"networkEndpointType,omitempty"`
  13781. // SelfLink: [Output Only] Server-defined URL for the resource.
  13782. SelfLink string `json:"selfLink,omitempty"`
  13783. // Size: [Output only] Number of network endpoints in the network
  13784. // endpoint group.
  13785. Size int64 `json:"size,omitempty"`
  13786. // Type: Specify the type of this network endpoint group. Only
  13787. // LOAD_BALANCING is valid for now.
  13788. //
  13789. // Possible values:
  13790. // "LOAD_BALANCING"
  13791. Type string `json:"type,omitempty"`
  13792. // ServerResponse contains the HTTP response code and headers from the
  13793. // server.
  13794. googleapi.ServerResponse `json:"-"`
  13795. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  13796. // to unconditionally include in API requests. By default, fields with
  13797. // empty values are omitted from API requests. However, any non-pointer,
  13798. // non-interface field appearing in ForceSendFields will be sent to the
  13799. // server regardless of whether the field is empty or not. This may be
  13800. // used to include empty fields in Patch requests.
  13801. ForceSendFields []string `json:"-"`
  13802. // NullFields is a list of field names (e.g. "CreationTimestamp") to
  13803. // include in API requests with the JSON null value. By default, fields
  13804. // with empty values are omitted from API requests. However, any field
  13805. // with an empty value appearing in NullFields will be sent to the
  13806. // server as null. It is an error if a field in this list has a
  13807. // non-empty value. This may be used to include null fields in Patch
  13808. // requests.
  13809. NullFields []string `json:"-"`
  13810. }
  13811. func (s *NetworkEndpointGroup) MarshalJSON() ([]byte, error) {
  13812. type NoMethod NetworkEndpointGroup
  13813. raw := NoMethod(*s)
  13814. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  13815. }
  13816. type NetworkEndpointGroupAggregatedList struct {
  13817. // Id: [Output Only] Unique identifier for the resource; defined by the
  13818. // server.
  13819. Id string `json:"id,omitempty"`
  13820. // Items: A list of NetworkEndpointGroupsScopedList resources.
  13821. Items map[string]NetworkEndpointGroupsScopedList `json:"items,omitempty"`
  13822. // Kind: [Output Only] The resource type, which is always
  13823. // compute#networkEndpointGroupAggregatedList for aggregated lists of
  13824. // network endpoint groups.
  13825. Kind string `json:"kind,omitempty"`
  13826. // NextPageToken: [Output Only] This token allows you to get the next
  13827. // page of results for list requests. If the number of results is larger
  13828. // than maxResults, use the nextPageToken as a value for the query
  13829. // parameter pageToken in the next list request. Subsequent list
  13830. // requests will have their own nextPageToken to continue paging through
  13831. // the results.
  13832. NextPageToken string `json:"nextPageToken,omitempty"`
  13833. // SelfLink: [Output Only] Server-defined URL for this resource.
  13834. SelfLink string `json:"selfLink,omitempty"`
  13835. // Warning: [Output Only] Informational warning message.
  13836. Warning *NetworkEndpointGroupAggregatedListWarning `json:"warning,omitempty"`
  13837. // ServerResponse contains the HTTP response code and headers from the
  13838. // server.
  13839. googleapi.ServerResponse `json:"-"`
  13840. // ForceSendFields is a list of field names (e.g. "Id") to
  13841. // unconditionally include in API requests. By default, fields with
  13842. // empty values are omitted from API requests. However, any non-pointer,
  13843. // non-interface field appearing in ForceSendFields will be sent to the
  13844. // server regardless of whether the field is empty or not. This may be
  13845. // used to include empty fields in Patch requests.
  13846. ForceSendFields []string `json:"-"`
  13847. // NullFields is a list of field names (e.g. "Id") to include in API
  13848. // requests with the JSON null value. By default, fields with empty
  13849. // values are omitted from API requests. However, any field with an
  13850. // empty value appearing in NullFields will be sent to the server as
  13851. // null. It is an error if a field in this list has a non-empty value.
  13852. // This may be used to include null fields in Patch requests.
  13853. NullFields []string `json:"-"`
  13854. }
  13855. func (s *NetworkEndpointGroupAggregatedList) MarshalJSON() ([]byte, error) {
  13856. type NoMethod NetworkEndpointGroupAggregatedList
  13857. raw := NoMethod(*s)
  13858. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  13859. }
  13860. // NetworkEndpointGroupAggregatedListWarning: [Output Only]
  13861. // Informational warning message.
  13862. type NetworkEndpointGroupAggregatedListWarning struct {
  13863. // Code: [Output Only] A warning code, if applicable. For example,
  13864. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  13865. // the response.
  13866. //
  13867. // Possible values:
  13868. // "CLEANUP_FAILED"
  13869. // "DEPRECATED_RESOURCE_USED"
  13870. // "DEPRECATED_TYPE_USED"
  13871. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  13872. // "EXPERIMENTAL_TYPE_USED"
  13873. // "EXTERNAL_API_WARNING"
  13874. // "FIELD_VALUE_OVERRIDEN"
  13875. // "INJECTED_KERNELS_DEPRECATED"
  13876. // "MISSING_TYPE_DEPENDENCY"
  13877. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  13878. // "NEXT_HOP_CANNOT_IP_FORWARD"
  13879. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  13880. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  13881. // "NEXT_HOP_NOT_RUNNING"
  13882. // "NOT_CRITICAL_ERROR"
  13883. // "NO_RESULTS_ON_PAGE"
  13884. // "REQUIRED_TOS_AGREEMENT"
  13885. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  13886. // "RESOURCE_NOT_DELETED"
  13887. // "SCHEMA_VALIDATION_IGNORED"
  13888. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  13889. // "UNDECLARED_PROPERTIES"
  13890. // "UNREACHABLE"
  13891. Code string `json:"code,omitempty"`
  13892. // Data: [Output Only] Metadata about this warning in key: value format.
  13893. // For example:
  13894. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  13895. Data []*NetworkEndpointGroupAggregatedListWarningData `json:"data,omitempty"`
  13896. // Message: [Output Only] A human-readable description of the warning
  13897. // code.
  13898. Message string `json:"message,omitempty"`
  13899. // ForceSendFields is a list of field names (e.g. "Code") to
  13900. // unconditionally include in API requests. By default, fields with
  13901. // empty values are omitted from API requests. However, any non-pointer,
  13902. // non-interface field appearing in ForceSendFields will be sent to the
  13903. // server regardless of whether the field is empty or not. This may be
  13904. // used to include empty fields in Patch requests.
  13905. ForceSendFields []string `json:"-"`
  13906. // NullFields is a list of field names (e.g. "Code") to include in API
  13907. // requests with the JSON null value. By default, fields with empty
  13908. // values are omitted from API requests. However, any field with an
  13909. // empty value appearing in NullFields will be sent to the server as
  13910. // null. It is an error if a field in this list has a non-empty value.
  13911. // This may be used to include null fields in Patch requests.
  13912. NullFields []string `json:"-"`
  13913. }
  13914. func (s *NetworkEndpointGroupAggregatedListWarning) MarshalJSON() ([]byte, error) {
  13915. type NoMethod NetworkEndpointGroupAggregatedListWarning
  13916. raw := NoMethod(*s)
  13917. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  13918. }
  13919. type NetworkEndpointGroupAggregatedListWarningData struct {
  13920. // Key: [Output Only] A key that provides more detail on the warning
  13921. // being returned. For example, for warnings where there are no results
  13922. // in a list request for a particular zone, this key might be scope and
  13923. // the key value might be the zone name. Other examples might be a key
  13924. // indicating a deprecated resource and a suggested replacement, or a
  13925. // warning about invalid network settings (for example, if an instance
  13926. // attempts to perform IP forwarding but is not enabled for IP
  13927. // forwarding).
  13928. Key string `json:"key,omitempty"`
  13929. // Value: [Output Only] A warning data value corresponding to the key.
  13930. Value string `json:"value,omitempty"`
  13931. // ForceSendFields is a list of field names (e.g. "Key") to
  13932. // unconditionally include in API requests. By default, fields with
  13933. // empty values are omitted from API requests. However, any non-pointer,
  13934. // non-interface field appearing in ForceSendFields will be sent to the
  13935. // server regardless of whether the field is empty or not. This may be
  13936. // used to include empty fields in Patch requests.
  13937. ForceSendFields []string `json:"-"`
  13938. // NullFields is a list of field names (e.g. "Key") to include in API
  13939. // requests with the JSON null value. By default, fields with empty
  13940. // values are omitted from API requests. However, any field with an
  13941. // empty value appearing in NullFields will be sent to the server as
  13942. // null. It is an error if a field in this list has a non-empty value.
  13943. // This may be used to include null fields in Patch requests.
  13944. NullFields []string `json:"-"`
  13945. }
  13946. func (s *NetworkEndpointGroupAggregatedListWarningData) MarshalJSON() ([]byte, error) {
  13947. type NoMethod NetworkEndpointGroupAggregatedListWarningData
  13948. raw := NoMethod(*s)
  13949. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  13950. }
  13951. // NetworkEndpointGroupLbNetworkEndpointGroup: Load balancing specific
  13952. // fields for network endpoint group of type LOAD_BALANCING.
  13953. type NetworkEndpointGroupLbNetworkEndpointGroup struct {
  13954. // DefaultPort: The default port used if the port number is not
  13955. // specified in the network endpoint. If the network endpoint type is
  13956. // GCE_VM_IP, this field must not be specified.
  13957. DefaultPort int64 `json:"defaultPort,omitempty"`
  13958. // Network: The URL of the network to which all network endpoints in the
  13959. // NEG belong. Uses "default" project network if unspecified.
  13960. Network string `json:"network,omitempty"`
  13961. // Subnetwork: Optional URL of the subnetwork to which all network
  13962. // endpoints in the NEG belong.
  13963. Subnetwork string `json:"subnetwork,omitempty"`
  13964. // Zone: [Output Only] The URL of the zone where the network endpoint
  13965. // group is located.
  13966. Zone string `json:"zone,omitempty"`
  13967. // ForceSendFields is a list of field names (e.g. "DefaultPort") to
  13968. // unconditionally include in API requests. By default, fields with
  13969. // empty values are omitted from API requests. However, any non-pointer,
  13970. // non-interface field appearing in ForceSendFields will be sent to the
  13971. // server regardless of whether the field is empty or not. This may be
  13972. // used to include empty fields in Patch requests.
  13973. ForceSendFields []string `json:"-"`
  13974. // NullFields is a list of field names (e.g. "DefaultPort") to include
  13975. // in API requests with the JSON null value. By default, fields with
  13976. // empty values are omitted from API requests. However, any field with
  13977. // an empty value appearing in NullFields will be sent to the server as
  13978. // null. It is an error if a field in this list has a non-empty value.
  13979. // This may be used to include null fields in Patch requests.
  13980. NullFields []string `json:"-"`
  13981. }
  13982. func (s *NetworkEndpointGroupLbNetworkEndpointGroup) MarshalJSON() ([]byte, error) {
  13983. type NoMethod NetworkEndpointGroupLbNetworkEndpointGroup
  13984. raw := NoMethod(*s)
  13985. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  13986. }
  13987. type NetworkEndpointGroupList struct {
  13988. // Id: [Output Only] Unique identifier for the resource; defined by the
  13989. // server.
  13990. Id string `json:"id,omitempty"`
  13991. // Items: A list of NetworkEndpointGroup resources.
  13992. Items []*NetworkEndpointGroup `json:"items,omitempty"`
  13993. // Kind: [Output Only] The resource type, which is always
  13994. // compute#networkEndpointGroupList for network endpoint group lists.
  13995. Kind string `json:"kind,omitempty"`
  13996. // NextPageToken: [Output Only] This token allows you to get the next
  13997. // page of results for list requests. If the number of results is larger
  13998. // than maxResults, use the nextPageToken as a value for the query
  13999. // parameter pageToken in the next list request. Subsequent list
  14000. // requests will have their own nextPageToken to continue paging through
  14001. // the results.
  14002. NextPageToken string `json:"nextPageToken,omitempty"`
  14003. // SelfLink: [Output Only] Server-defined URL for this resource.
  14004. SelfLink string `json:"selfLink,omitempty"`
  14005. // Warning: [Output Only] Informational warning message.
  14006. Warning *NetworkEndpointGroupListWarning `json:"warning,omitempty"`
  14007. // ServerResponse contains the HTTP response code and headers from the
  14008. // server.
  14009. googleapi.ServerResponse `json:"-"`
  14010. // ForceSendFields is a list of field names (e.g. "Id") to
  14011. // unconditionally include in API requests. By default, fields with
  14012. // empty values are omitted from API requests. However, any non-pointer,
  14013. // non-interface field appearing in ForceSendFields will be sent to the
  14014. // server regardless of whether the field is empty or not. This may be
  14015. // used to include empty fields in Patch requests.
  14016. ForceSendFields []string `json:"-"`
  14017. // NullFields is a list of field names (e.g. "Id") to include in API
  14018. // requests with the JSON null value. By default, fields with empty
  14019. // values are omitted from API requests. However, any field with an
  14020. // empty value appearing in NullFields will be sent to the server as
  14021. // null. It is an error if a field in this list has a non-empty value.
  14022. // This may be used to include null fields in Patch requests.
  14023. NullFields []string `json:"-"`
  14024. }
  14025. func (s *NetworkEndpointGroupList) MarshalJSON() ([]byte, error) {
  14026. type NoMethod NetworkEndpointGroupList
  14027. raw := NoMethod(*s)
  14028. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  14029. }
  14030. // NetworkEndpointGroupListWarning: [Output Only] Informational warning
  14031. // message.
  14032. type NetworkEndpointGroupListWarning struct {
  14033. // Code: [Output Only] A warning code, if applicable. For example,
  14034. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  14035. // the response.
  14036. //
  14037. // Possible values:
  14038. // "CLEANUP_FAILED"
  14039. // "DEPRECATED_RESOURCE_USED"
  14040. // "DEPRECATED_TYPE_USED"
  14041. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  14042. // "EXPERIMENTAL_TYPE_USED"
  14043. // "EXTERNAL_API_WARNING"
  14044. // "FIELD_VALUE_OVERRIDEN"
  14045. // "INJECTED_KERNELS_DEPRECATED"
  14046. // "MISSING_TYPE_DEPENDENCY"
  14047. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  14048. // "NEXT_HOP_CANNOT_IP_FORWARD"
  14049. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  14050. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  14051. // "NEXT_HOP_NOT_RUNNING"
  14052. // "NOT_CRITICAL_ERROR"
  14053. // "NO_RESULTS_ON_PAGE"
  14054. // "REQUIRED_TOS_AGREEMENT"
  14055. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  14056. // "RESOURCE_NOT_DELETED"
  14057. // "SCHEMA_VALIDATION_IGNORED"
  14058. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  14059. // "UNDECLARED_PROPERTIES"
  14060. // "UNREACHABLE"
  14061. Code string `json:"code,omitempty"`
  14062. // Data: [Output Only] Metadata about this warning in key: value format.
  14063. // For example:
  14064. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  14065. Data []*NetworkEndpointGroupListWarningData `json:"data,omitempty"`
  14066. // Message: [Output Only] A human-readable description of the warning
  14067. // code.
  14068. Message string `json:"message,omitempty"`
  14069. // ForceSendFields is a list of field names (e.g. "Code") to
  14070. // unconditionally include in API requests. By default, fields with
  14071. // empty values are omitted from API requests. However, any non-pointer,
  14072. // non-interface field appearing in ForceSendFields will be sent to the
  14073. // server regardless of whether the field is empty or not. This may be
  14074. // used to include empty fields in Patch requests.
  14075. ForceSendFields []string `json:"-"`
  14076. // NullFields is a list of field names (e.g. "Code") to include in API
  14077. // requests with the JSON null value. By default, fields with empty
  14078. // values are omitted from API requests. However, any field with an
  14079. // empty value appearing in NullFields will be sent to the server as
  14080. // null. It is an error if a field in this list has a non-empty value.
  14081. // This may be used to include null fields in Patch requests.
  14082. NullFields []string `json:"-"`
  14083. }
  14084. func (s *NetworkEndpointGroupListWarning) MarshalJSON() ([]byte, error) {
  14085. type NoMethod NetworkEndpointGroupListWarning
  14086. raw := NoMethod(*s)
  14087. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  14088. }
  14089. type NetworkEndpointGroupListWarningData struct {
  14090. // Key: [Output Only] A key that provides more detail on the warning
  14091. // being returned. For example, for warnings where there are no results
  14092. // in a list request for a particular zone, this key might be scope and
  14093. // the key value might be the zone name. Other examples might be a key
  14094. // indicating a deprecated resource and a suggested replacement, or a
  14095. // warning about invalid network settings (for example, if an instance
  14096. // attempts to perform IP forwarding but is not enabled for IP
  14097. // forwarding).
  14098. Key string `json:"key,omitempty"`
  14099. // Value: [Output Only] A warning data value corresponding to the key.
  14100. Value string `json:"value,omitempty"`
  14101. // ForceSendFields is a list of field names (e.g. "Key") to
  14102. // unconditionally include in API requests. By default, fields with
  14103. // empty values are omitted from API requests. However, any non-pointer,
  14104. // non-interface field appearing in ForceSendFields will be sent to the
  14105. // server regardless of whether the field is empty or not. This may be
  14106. // used to include empty fields in Patch requests.
  14107. ForceSendFields []string `json:"-"`
  14108. // NullFields is a list of field names (e.g. "Key") to include in API
  14109. // requests with the JSON null value. By default, fields with empty
  14110. // values are omitted from API requests. However, any field with an
  14111. // empty value appearing in NullFields will be sent to the server as
  14112. // null. It is an error if a field in this list has a non-empty value.
  14113. // This may be used to include null fields in Patch requests.
  14114. NullFields []string `json:"-"`
  14115. }
  14116. func (s *NetworkEndpointGroupListWarningData) MarshalJSON() ([]byte, error) {
  14117. type NoMethod NetworkEndpointGroupListWarningData
  14118. raw := NoMethod(*s)
  14119. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  14120. }
  14121. type NetworkEndpointGroupsAttachEndpointsRequest struct {
  14122. // NetworkEndpoints: The list of network endpoints to be attached.
  14123. NetworkEndpoints []*NetworkEndpoint `json:"networkEndpoints,omitempty"`
  14124. // ForceSendFields is a list of field names (e.g. "NetworkEndpoints") to
  14125. // unconditionally include in API requests. By default, fields with
  14126. // empty values are omitted from API requests. However, any non-pointer,
  14127. // non-interface field appearing in ForceSendFields will be sent to the
  14128. // server regardless of whether the field is empty or not. This may be
  14129. // used to include empty fields in Patch requests.
  14130. ForceSendFields []string `json:"-"`
  14131. // NullFields is a list of field names (e.g. "NetworkEndpoints") to
  14132. // include in API requests with the JSON null value. By default, fields
  14133. // with empty values are omitted from API requests. However, any field
  14134. // with an empty value appearing in NullFields will be sent to the
  14135. // server as null. It is an error if a field in this list has a
  14136. // non-empty value. This may be used to include null fields in Patch
  14137. // requests.
  14138. NullFields []string `json:"-"`
  14139. }
  14140. func (s *NetworkEndpointGroupsAttachEndpointsRequest) MarshalJSON() ([]byte, error) {
  14141. type NoMethod NetworkEndpointGroupsAttachEndpointsRequest
  14142. raw := NoMethod(*s)
  14143. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  14144. }
  14145. type NetworkEndpointGroupsDetachEndpointsRequest struct {
  14146. // NetworkEndpoints: The list of network endpoints to be detached.
  14147. NetworkEndpoints []*NetworkEndpoint `json:"networkEndpoints,omitempty"`
  14148. // ForceSendFields is a list of field names (e.g. "NetworkEndpoints") to
  14149. // unconditionally include in API requests. By default, fields with
  14150. // empty values are omitted from API requests. However, any non-pointer,
  14151. // non-interface field appearing in ForceSendFields will be sent to the
  14152. // server regardless of whether the field is empty or not. This may be
  14153. // used to include empty fields in Patch requests.
  14154. ForceSendFields []string `json:"-"`
  14155. // NullFields is a list of field names (e.g. "NetworkEndpoints") to
  14156. // include in API requests with the JSON null value. By default, fields
  14157. // with empty values are omitted from API requests. However, any field
  14158. // with an empty value appearing in NullFields will be sent to the
  14159. // server as null. It is an error if a field in this list has a
  14160. // non-empty value. This may be used to include null fields in Patch
  14161. // requests.
  14162. NullFields []string `json:"-"`
  14163. }
  14164. func (s *NetworkEndpointGroupsDetachEndpointsRequest) MarshalJSON() ([]byte, error) {
  14165. type NoMethod NetworkEndpointGroupsDetachEndpointsRequest
  14166. raw := NoMethod(*s)
  14167. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  14168. }
  14169. type NetworkEndpointGroupsListEndpointsRequest struct {
  14170. // HealthStatus: Optional query parameter for showing the health status
  14171. // of each network endpoint. Valid options are SKIP or SHOW. If you
  14172. // don't specifiy this parameter, the health status of network endpoints
  14173. // will not be provided.
  14174. //
  14175. // Possible values:
  14176. // "SHOW"
  14177. // "SKIP"
  14178. HealthStatus string `json:"healthStatus,omitempty"`
  14179. // ForceSendFields is a list of field names (e.g. "HealthStatus") to
  14180. // unconditionally include in API requests. By default, fields with
  14181. // empty values are omitted from API requests. However, any non-pointer,
  14182. // non-interface field appearing in ForceSendFields will be sent to the
  14183. // server regardless of whether the field is empty or not. This may be
  14184. // used to include empty fields in Patch requests.
  14185. ForceSendFields []string `json:"-"`
  14186. // NullFields is a list of field names (e.g. "HealthStatus") to include
  14187. // in API requests with the JSON null value. By default, fields with
  14188. // empty values are omitted from API requests. However, any field with
  14189. // an empty value appearing in NullFields will be sent to the server as
  14190. // null. It is an error if a field in this list has a non-empty value.
  14191. // This may be used to include null fields in Patch requests.
  14192. NullFields []string `json:"-"`
  14193. }
  14194. func (s *NetworkEndpointGroupsListEndpointsRequest) MarshalJSON() ([]byte, error) {
  14195. type NoMethod NetworkEndpointGroupsListEndpointsRequest
  14196. raw := NoMethod(*s)
  14197. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  14198. }
  14199. type NetworkEndpointGroupsListNetworkEndpoints struct {
  14200. // Id: [Output Only] Unique identifier for the resource; defined by the
  14201. // server.
  14202. Id string `json:"id,omitempty"`
  14203. // Items: A list of NetworkEndpointWithHealthStatus resources.
  14204. Items []*NetworkEndpointWithHealthStatus `json:"items,omitempty"`
  14205. // Kind: [Output Only] The resource type, which is always
  14206. // compute#networkEndpointGroupsListNetworkEndpoints for the list of
  14207. // network endpoints in the specified network endpoint group.
  14208. Kind string `json:"kind,omitempty"`
  14209. // NextPageToken: [Output Only] This token allows you to get the next
  14210. // page of results for list requests. If the number of results is larger
  14211. // than maxResults, use the nextPageToken as a value for the query
  14212. // parameter pageToken in the next list request. Subsequent list
  14213. // requests will have their own nextPageToken to continue paging through
  14214. // the results.
  14215. NextPageToken string `json:"nextPageToken,omitempty"`
  14216. // Warning: [Output Only] Informational warning message.
  14217. Warning *NetworkEndpointGroupsListNetworkEndpointsWarning `json:"warning,omitempty"`
  14218. // ServerResponse contains the HTTP response code and headers from the
  14219. // server.
  14220. googleapi.ServerResponse `json:"-"`
  14221. // ForceSendFields is a list of field names (e.g. "Id") to
  14222. // unconditionally include in API requests. By default, fields with
  14223. // empty values are omitted from API requests. However, any non-pointer,
  14224. // non-interface field appearing in ForceSendFields will be sent to the
  14225. // server regardless of whether the field is empty or not. This may be
  14226. // used to include empty fields in Patch requests.
  14227. ForceSendFields []string `json:"-"`
  14228. // NullFields is a list of field names (e.g. "Id") to include in API
  14229. // requests with the JSON null value. By default, fields with empty
  14230. // values are omitted from API requests. However, any field with an
  14231. // empty value appearing in NullFields will be sent to the server as
  14232. // null. It is an error if a field in this list has a non-empty value.
  14233. // This may be used to include null fields in Patch requests.
  14234. NullFields []string `json:"-"`
  14235. }
  14236. func (s *NetworkEndpointGroupsListNetworkEndpoints) MarshalJSON() ([]byte, error) {
  14237. type NoMethod NetworkEndpointGroupsListNetworkEndpoints
  14238. raw := NoMethod(*s)
  14239. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  14240. }
  14241. // NetworkEndpointGroupsListNetworkEndpointsWarning: [Output Only]
  14242. // Informational warning message.
  14243. type NetworkEndpointGroupsListNetworkEndpointsWarning struct {
  14244. // Code: [Output Only] A warning code, if applicable. For example,
  14245. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  14246. // the response.
  14247. //
  14248. // Possible values:
  14249. // "CLEANUP_FAILED"
  14250. // "DEPRECATED_RESOURCE_USED"
  14251. // "DEPRECATED_TYPE_USED"
  14252. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  14253. // "EXPERIMENTAL_TYPE_USED"
  14254. // "EXTERNAL_API_WARNING"
  14255. // "FIELD_VALUE_OVERRIDEN"
  14256. // "INJECTED_KERNELS_DEPRECATED"
  14257. // "MISSING_TYPE_DEPENDENCY"
  14258. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  14259. // "NEXT_HOP_CANNOT_IP_FORWARD"
  14260. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  14261. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  14262. // "NEXT_HOP_NOT_RUNNING"
  14263. // "NOT_CRITICAL_ERROR"
  14264. // "NO_RESULTS_ON_PAGE"
  14265. // "REQUIRED_TOS_AGREEMENT"
  14266. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  14267. // "RESOURCE_NOT_DELETED"
  14268. // "SCHEMA_VALIDATION_IGNORED"
  14269. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  14270. // "UNDECLARED_PROPERTIES"
  14271. // "UNREACHABLE"
  14272. Code string `json:"code,omitempty"`
  14273. // Data: [Output Only] Metadata about this warning in key: value format.
  14274. // For example:
  14275. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  14276. Data []*NetworkEndpointGroupsListNetworkEndpointsWarningData `json:"data,omitempty"`
  14277. // Message: [Output Only] A human-readable description of the warning
  14278. // code.
  14279. Message string `json:"message,omitempty"`
  14280. // ForceSendFields is a list of field names (e.g. "Code") to
  14281. // unconditionally include in API requests. By default, fields with
  14282. // empty values are omitted from API requests. However, any non-pointer,
  14283. // non-interface field appearing in ForceSendFields will be sent to the
  14284. // server regardless of whether the field is empty or not. This may be
  14285. // used to include empty fields in Patch requests.
  14286. ForceSendFields []string `json:"-"`
  14287. // NullFields is a list of field names (e.g. "Code") to include in API
  14288. // requests with the JSON null value. By default, fields with empty
  14289. // values are omitted from API requests. However, any field with an
  14290. // empty value appearing in NullFields will be sent to the server as
  14291. // null. It is an error if a field in this list has a non-empty value.
  14292. // This may be used to include null fields in Patch requests.
  14293. NullFields []string `json:"-"`
  14294. }
  14295. func (s *NetworkEndpointGroupsListNetworkEndpointsWarning) MarshalJSON() ([]byte, error) {
  14296. type NoMethod NetworkEndpointGroupsListNetworkEndpointsWarning
  14297. raw := NoMethod(*s)
  14298. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  14299. }
  14300. type NetworkEndpointGroupsListNetworkEndpointsWarningData struct {
  14301. // Key: [Output Only] A key that provides more detail on the warning
  14302. // being returned. For example, for warnings where there are no results
  14303. // in a list request for a particular zone, this key might be scope and
  14304. // the key value might be the zone name. Other examples might be a key
  14305. // indicating a deprecated resource and a suggested replacement, or a
  14306. // warning about invalid network settings (for example, if an instance
  14307. // attempts to perform IP forwarding but is not enabled for IP
  14308. // forwarding).
  14309. Key string `json:"key,omitempty"`
  14310. // Value: [Output Only] A warning data value corresponding to the key.
  14311. Value string `json:"value,omitempty"`
  14312. // ForceSendFields is a list of field names (e.g. "Key") to
  14313. // unconditionally include in API requests. By default, fields with
  14314. // empty values are omitted from API requests. However, any non-pointer,
  14315. // non-interface field appearing in ForceSendFields will be sent to the
  14316. // server regardless of whether the field is empty or not. This may be
  14317. // used to include empty fields in Patch requests.
  14318. ForceSendFields []string `json:"-"`
  14319. // NullFields is a list of field names (e.g. "Key") to include in API
  14320. // requests with the JSON null value. By default, fields with empty
  14321. // values are omitted from API requests. However, any field with an
  14322. // empty value appearing in NullFields will be sent to the server as
  14323. // null. It is an error if a field in this list has a non-empty value.
  14324. // This may be used to include null fields in Patch requests.
  14325. NullFields []string `json:"-"`
  14326. }
  14327. func (s *NetworkEndpointGroupsListNetworkEndpointsWarningData) MarshalJSON() ([]byte, error) {
  14328. type NoMethod NetworkEndpointGroupsListNetworkEndpointsWarningData
  14329. raw := NoMethod(*s)
  14330. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  14331. }
  14332. type NetworkEndpointGroupsScopedList struct {
  14333. // NetworkEndpointGroups: [Output Only] The list of network endpoint
  14334. // groups that are contained in this scope.
  14335. NetworkEndpointGroups []*NetworkEndpointGroup `json:"networkEndpointGroups,omitempty"`
  14336. // Warning: [Output Only] An informational warning that replaces the
  14337. // list of network endpoint groups when the list is empty.
  14338. Warning *NetworkEndpointGroupsScopedListWarning `json:"warning,omitempty"`
  14339. // ForceSendFields is a list of field names (e.g.
  14340. // "NetworkEndpointGroups") to unconditionally include in API requests.
  14341. // By default, fields with empty values are omitted from API requests.
  14342. // However, any non-pointer, non-interface field appearing in
  14343. // ForceSendFields will be sent to the server regardless of whether the
  14344. // field is empty or not. This may be used to include empty fields in
  14345. // Patch requests.
  14346. ForceSendFields []string `json:"-"`
  14347. // NullFields is a list of field names (e.g. "NetworkEndpointGroups") to
  14348. // include in API requests with the JSON null value. By default, fields
  14349. // with empty values are omitted from API requests. However, any field
  14350. // with an empty value appearing in NullFields will be sent to the
  14351. // server as null. It is an error if a field in this list has a
  14352. // non-empty value. This may be used to include null fields in Patch
  14353. // requests.
  14354. NullFields []string `json:"-"`
  14355. }
  14356. func (s *NetworkEndpointGroupsScopedList) MarshalJSON() ([]byte, error) {
  14357. type NoMethod NetworkEndpointGroupsScopedList
  14358. raw := NoMethod(*s)
  14359. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  14360. }
  14361. // NetworkEndpointGroupsScopedListWarning: [Output Only] An
  14362. // informational warning that replaces the list of network endpoint
  14363. // groups when the list is empty.
  14364. type NetworkEndpointGroupsScopedListWarning struct {
  14365. // Code: [Output Only] A warning code, if applicable. For example,
  14366. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  14367. // the response.
  14368. //
  14369. // Possible values:
  14370. // "CLEANUP_FAILED"
  14371. // "DEPRECATED_RESOURCE_USED"
  14372. // "DEPRECATED_TYPE_USED"
  14373. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  14374. // "EXPERIMENTAL_TYPE_USED"
  14375. // "EXTERNAL_API_WARNING"
  14376. // "FIELD_VALUE_OVERRIDEN"
  14377. // "INJECTED_KERNELS_DEPRECATED"
  14378. // "MISSING_TYPE_DEPENDENCY"
  14379. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  14380. // "NEXT_HOP_CANNOT_IP_FORWARD"
  14381. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  14382. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  14383. // "NEXT_HOP_NOT_RUNNING"
  14384. // "NOT_CRITICAL_ERROR"
  14385. // "NO_RESULTS_ON_PAGE"
  14386. // "REQUIRED_TOS_AGREEMENT"
  14387. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  14388. // "RESOURCE_NOT_DELETED"
  14389. // "SCHEMA_VALIDATION_IGNORED"
  14390. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  14391. // "UNDECLARED_PROPERTIES"
  14392. // "UNREACHABLE"
  14393. Code string `json:"code,omitempty"`
  14394. // Data: [Output Only] Metadata about this warning in key: value format.
  14395. // For example:
  14396. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  14397. Data []*NetworkEndpointGroupsScopedListWarningData `json:"data,omitempty"`
  14398. // Message: [Output Only] A human-readable description of the warning
  14399. // code.
  14400. Message string `json:"message,omitempty"`
  14401. // ForceSendFields is a list of field names (e.g. "Code") to
  14402. // unconditionally include in API requests. By default, fields with
  14403. // empty values are omitted from API requests. However, any non-pointer,
  14404. // non-interface field appearing in ForceSendFields will be sent to the
  14405. // server regardless of whether the field is empty or not. This may be
  14406. // used to include empty fields in Patch requests.
  14407. ForceSendFields []string `json:"-"`
  14408. // NullFields is a list of field names (e.g. "Code") to include in API
  14409. // requests with the JSON null value. By default, fields with empty
  14410. // values are omitted from API requests. However, any field with an
  14411. // empty value appearing in NullFields will be sent to the server as
  14412. // null. It is an error if a field in this list has a non-empty value.
  14413. // This may be used to include null fields in Patch requests.
  14414. NullFields []string `json:"-"`
  14415. }
  14416. func (s *NetworkEndpointGroupsScopedListWarning) MarshalJSON() ([]byte, error) {
  14417. type NoMethod NetworkEndpointGroupsScopedListWarning
  14418. raw := NoMethod(*s)
  14419. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  14420. }
  14421. type NetworkEndpointGroupsScopedListWarningData struct {
  14422. // Key: [Output Only] A key that provides more detail on the warning
  14423. // being returned. For example, for warnings where there are no results
  14424. // in a list request for a particular zone, this key might be scope and
  14425. // the key value might be the zone name. Other examples might be a key
  14426. // indicating a deprecated resource and a suggested replacement, or a
  14427. // warning about invalid network settings (for example, if an instance
  14428. // attempts to perform IP forwarding but is not enabled for IP
  14429. // forwarding).
  14430. Key string `json:"key,omitempty"`
  14431. // Value: [Output Only] A warning data value corresponding to the key.
  14432. Value string `json:"value,omitempty"`
  14433. // ForceSendFields is a list of field names (e.g. "Key") to
  14434. // unconditionally include in API requests. By default, fields with
  14435. // empty values are omitted from API requests. However, any non-pointer,
  14436. // non-interface field appearing in ForceSendFields will be sent to the
  14437. // server regardless of whether the field is empty or not. This may be
  14438. // used to include empty fields in Patch requests.
  14439. ForceSendFields []string `json:"-"`
  14440. // NullFields is a list of field names (e.g. "Key") to include in API
  14441. // requests with the JSON null value. By default, fields with empty
  14442. // values are omitted from API requests. However, any field with an
  14443. // empty value appearing in NullFields will be sent to the server as
  14444. // null. It is an error if a field in this list has a non-empty value.
  14445. // This may be used to include null fields in Patch requests.
  14446. NullFields []string `json:"-"`
  14447. }
  14448. func (s *NetworkEndpointGroupsScopedListWarningData) MarshalJSON() ([]byte, error) {
  14449. type NoMethod NetworkEndpointGroupsScopedListWarningData
  14450. raw := NoMethod(*s)
  14451. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  14452. }
  14453. type NetworkEndpointWithHealthStatus struct {
  14454. // Healths: [Output only] The health status of network endpoint;
  14455. Healths []*HealthStatusForNetworkEndpoint `json:"healths,omitempty"`
  14456. // NetworkEndpoint: [Output only] The network endpoint;
  14457. NetworkEndpoint *NetworkEndpoint `json:"networkEndpoint,omitempty"`
  14458. // ForceSendFields is a list of field names (e.g. "Healths") to
  14459. // unconditionally include in API requests. By default, fields with
  14460. // empty values are omitted from API requests. However, any non-pointer,
  14461. // non-interface field appearing in ForceSendFields will be sent to the
  14462. // server regardless of whether the field is empty or not. This may be
  14463. // used to include empty fields in Patch requests.
  14464. ForceSendFields []string `json:"-"`
  14465. // NullFields is a list of field names (e.g. "Healths") to include in
  14466. // API requests with the JSON null value. By default, fields with empty
  14467. // values are omitted from API requests. However, any field with an
  14468. // empty value appearing in NullFields will be sent to the server as
  14469. // null. It is an error if a field in this list has a non-empty value.
  14470. // This may be used to include null fields in Patch requests.
  14471. NullFields []string `json:"-"`
  14472. }
  14473. func (s *NetworkEndpointWithHealthStatus) MarshalJSON() ([]byte, error) {
  14474. type NoMethod NetworkEndpointWithHealthStatus
  14475. raw := NoMethod(*s)
  14476. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  14477. }
  14478. // NetworkInterface: A network interface resource attached to an
  14479. // instance.
  14480. type NetworkInterface struct {
  14481. // AccessConfigs: An array of configurations for this interface.
  14482. // Currently, only one access config, ONE_TO_ONE_NAT, is supported. If
  14483. // there are no accessConfigs specified, then this instance will have no
  14484. // external internet access.
  14485. AccessConfigs []*AccessConfig `json:"accessConfigs,omitempty"`
  14486. // AliasIpRanges: An array of alias IP ranges for this network
  14487. // interface. Can only be specified for network interfaces on
  14488. // subnet-mode networks.
  14489. AliasIpRanges []*AliasIpRange `json:"aliasIpRanges,omitempty"`
  14490. // Fingerprint: Fingerprint hash of contents stored in this network
  14491. // interface. This field will be ignored when inserting an Instance or
  14492. // adding a NetworkInterface. An up-to-date fingerprint must be provided
  14493. // in order to update the NetworkInterface.
  14494. Fingerprint string `json:"fingerprint,omitempty"`
  14495. // Kind: [Output Only] Type of the resource. Always
  14496. // compute#networkInterface for network interfaces.
  14497. Kind string `json:"kind,omitempty"`
  14498. // Name: [Output Only] The name of the network interface, generated by
  14499. // the server. For network devices, these are eth0, eth1, etc.
  14500. Name string `json:"name,omitempty"`
  14501. // Network: URL of the network resource for this instance. When creating
  14502. // an instance, if neither the network nor the subnetwork is specified,
  14503. // the default network global/networks/default is used; if the network
  14504. // is not specified but the subnetwork is specified, the network is
  14505. // inferred.
  14506. //
  14507. // This field is optional when creating a firewall rule. If not
  14508. // specified when creating a firewall rule, the default network
  14509. // global/networks/default is used.
  14510. //
  14511. // If you specify this property, you can specify the network as a full
  14512. // or partial URL. For example, the following are all valid URLs:
  14513. // -
  14514. // https://www.googleapis.com/compute/v1/projects/project/global/networks/network
  14515. // - projects/project/global/networks/network
  14516. // - global/networks/default
  14517. Network string `json:"network,omitempty"`
  14518. // NetworkIP: An IPv4 internal network address to assign to the instance
  14519. // for this network interface. If not specified by the user, an unused
  14520. // internal IP is assigned by the system.
  14521. NetworkIP string `json:"networkIP,omitempty"`
  14522. // Subnetwork: The URL of the Subnetwork resource for this instance. If
  14523. // the network resource is in legacy mode, do not provide this property.
  14524. // If the network is in auto subnet mode, providing the subnetwork is
  14525. // optional. If the network is in custom subnet mode, then this field
  14526. // should be specified. If you specify this property, you can specify
  14527. // the subnetwork as a full or partial URL. For example, the following
  14528. // are all valid URLs:
  14529. // -
  14530. // https://www.googleapis.com/compute/v1/projects/project/regions/region/subnetworks/subnetwork
  14531. // - regions/region/subnetworks/subnetwork
  14532. Subnetwork string `json:"subnetwork,omitempty"`
  14533. // ForceSendFields is a list of field names (e.g. "AccessConfigs") to
  14534. // unconditionally include in API requests. By default, fields with
  14535. // empty values are omitted from API requests. However, any non-pointer,
  14536. // non-interface field appearing in ForceSendFields will be sent to the
  14537. // server regardless of whether the field is empty or not. This may be
  14538. // used to include empty fields in Patch requests.
  14539. ForceSendFields []string `json:"-"`
  14540. // NullFields is a list of field names (e.g. "AccessConfigs") to include
  14541. // in API requests with the JSON null value. By default, fields with
  14542. // empty values are omitted from API requests. However, any field with
  14543. // an empty value appearing in NullFields will be sent to the server as
  14544. // null. It is an error if a field in this list has a non-empty value.
  14545. // This may be used to include null fields in Patch requests.
  14546. NullFields []string `json:"-"`
  14547. }
  14548. func (s *NetworkInterface) MarshalJSON() ([]byte, error) {
  14549. type NoMethod NetworkInterface
  14550. raw := NoMethod(*s)
  14551. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  14552. }
  14553. // NetworkList: Contains a list of networks.
  14554. type NetworkList struct {
  14555. // Id: [Output Only] Unique identifier for the resource; defined by the
  14556. // server.
  14557. Id string `json:"id,omitempty"`
  14558. // Items: A list of Network resources.
  14559. Items []*Network `json:"items,omitempty"`
  14560. // Kind: [Output Only] Type of resource. Always compute#networkList for
  14561. // lists of networks.
  14562. Kind string `json:"kind,omitempty"`
  14563. // NextPageToken: [Output Only] This token allows you to get the next
  14564. // page of results for list requests. If the number of results is larger
  14565. // than maxResults, use the nextPageToken as a value for the query
  14566. // parameter pageToken in the next list request. Subsequent list
  14567. // requests will have their own nextPageToken to continue paging through
  14568. // the results.
  14569. NextPageToken string `json:"nextPageToken,omitempty"`
  14570. // SelfLink: [Output Only] Server-defined URL for this resource.
  14571. SelfLink string `json:"selfLink,omitempty"`
  14572. // Warning: [Output Only] Informational warning message.
  14573. Warning *NetworkListWarning `json:"warning,omitempty"`
  14574. // ServerResponse contains the HTTP response code and headers from the
  14575. // server.
  14576. googleapi.ServerResponse `json:"-"`
  14577. // ForceSendFields is a list of field names (e.g. "Id") to
  14578. // unconditionally include in API requests. By default, fields with
  14579. // empty values are omitted from API requests. However, any non-pointer,
  14580. // non-interface field appearing in ForceSendFields will be sent to the
  14581. // server regardless of whether the field is empty or not. This may be
  14582. // used to include empty fields in Patch requests.
  14583. ForceSendFields []string `json:"-"`
  14584. // NullFields is a list of field names (e.g. "Id") to include in API
  14585. // requests with the JSON null value. By default, fields with empty
  14586. // values are omitted from API requests. However, any field with an
  14587. // empty value appearing in NullFields will be sent to the server as
  14588. // null. It is an error if a field in this list has a non-empty value.
  14589. // This may be used to include null fields in Patch requests.
  14590. NullFields []string `json:"-"`
  14591. }
  14592. func (s *NetworkList) MarshalJSON() ([]byte, error) {
  14593. type NoMethod NetworkList
  14594. raw := NoMethod(*s)
  14595. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  14596. }
  14597. // NetworkListWarning: [Output Only] Informational warning message.
  14598. type NetworkListWarning struct {
  14599. // Code: [Output Only] A warning code, if applicable. For example,
  14600. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  14601. // the response.
  14602. //
  14603. // Possible values:
  14604. // "CLEANUP_FAILED"
  14605. // "DEPRECATED_RESOURCE_USED"
  14606. // "DEPRECATED_TYPE_USED"
  14607. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  14608. // "EXPERIMENTAL_TYPE_USED"
  14609. // "EXTERNAL_API_WARNING"
  14610. // "FIELD_VALUE_OVERRIDEN"
  14611. // "INJECTED_KERNELS_DEPRECATED"
  14612. // "MISSING_TYPE_DEPENDENCY"
  14613. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  14614. // "NEXT_HOP_CANNOT_IP_FORWARD"
  14615. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  14616. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  14617. // "NEXT_HOP_NOT_RUNNING"
  14618. // "NOT_CRITICAL_ERROR"
  14619. // "NO_RESULTS_ON_PAGE"
  14620. // "REQUIRED_TOS_AGREEMENT"
  14621. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  14622. // "RESOURCE_NOT_DELETED"
  14623. // "SCHEMA_VALIDATION_IGNORED"
  14624. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  14625. // "UNDECLARED_PROPERTIES"
  14626. // "UNREACHABLE"
  14627. Code string `json:"code,omitempty"`
  14628. // Data: [Output Only] Metadata about this warning in key: value format.
  14629. // For example:
  14630. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  14631. Data []*NetworkListWarningData `json:"data,omitempty"`
  14632. // Message: [Output Only] A human-readable description of the warning
  14633. // code.
  14634. Message string `json:"message,omitempty"`
  14635. // ForceSendFields is a list of field names (e.g. "Code") to
  14636. // unconditionally include in API requests. By default, fields with
  14637. // empty values are omitted from API requests. However, any non-pointer,
  14638. // non-interface field appearing in ForceSendFields will be sent to the
  14639. // server regardless of whether the field is empty or not. This may be
  14640. // used to include empty fields in Patch requests.
  14641. ForceSendFields []string `json:"-"`
  14642. // NullFields is a list of field names (e.g. "Code") to include in API
  14643. // requests with the JSON null value. By default, fields with empty
  14644. // values are omitted from API requests. However, any field with an
  14645. // empty value appearing in NullFields will be sent to the server as
  14646. // null. It is an error if a field in this list has a non-empty value.
  14647. // This may be used to include null fields in Patch requests.
  14648. NullFields []string `json:"-"`
  14649. }
  14650. func (s *NetworkListWarning) MarshalJSON() ([]byte, error) {
  14651. type NoMethod NetworkListWarning
  14652. raw := NoMethod(*s)
  14653. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  14654. }
  14655. type NetworkListWarningData struct {
  14656. // Key: [Output Only] A key that provides more detail on the warning
  14657. // being returned. For example, for warnings where there are no results
  14658. // in a list request for a particular zone, this key might be scope and
  14659. // the key value might be the zone name. Other examples might be a key
  14660. // indicating a deprecated resource and a suggested replacement, or a
  14661. // warning about invalid network settings (for example, if an instance
  14662. // attempts to perform IP forwarding but is not enabled for IP
  14663. // forwarding).
  14664. Key string `json:"key,omitempty"`
  14665. // Value: [Output Only] A warning data value corresponding to the key.
  14666. Value string `json:"value,omitempty"`
  14667. // ForceSendFields is a list of field names (e.g. "Key") to
  14668. // unconditionally include in API requests. By default, fields with
  14669. // empty values are omitted from API requests. However, any non-pointer,
  14670. // non-interface field appearing in ForceSendFields will be sent to the
  14671. // server regardless of whether the field is empty or not. This may be
  14672. // used to include empty fields in Patch requests.
  14673. ForceSendFields []string `json:"-"`
  14674. // NullFields is a list of field names (e.g. "Key") to include in API
  14675. // requests with the JSON null value. By default, fields with empty
  14676. // values are omitted from API requests. However, any field with an
  14677. // empty value appearing in NullFields will be sent to the server as
  14678. // null. It is an error if a field in this list has a non-empty value.
  14679. // This may be used to include null fields in Patch requests.
  14680. NullFields []string `json:"-"`
  14681. }
  14682. func (s *NetworkListWarningData) MarshalJSON() ([]byte, error) {
  14683. type NoMethod NetworkListWarningData
  14684. raw := NoMethod(*s)
  14685. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  14686. }
  14687. // NetworkPeering: A network peering attached to a network resource. The
  14688. // message includes the peering name, peer network, peering state, and a
  14689. // flag indicating whether Google Compute Engine should automatically
  14690. // create routes for the peering.
  14691. type NetworkPeering struct {
  14692. // AutoCreateRoutes: Whether full mesh connectivity is created and
  14693. // managed automatically. When it is set to true, Google Compute Engine
  14694. // will automatically create and manage the routes between two networks
  14695. // when the state is ACTIVE. Otherwise, user needs to create routes
  14696. // manually to route packets to peer network.
  14697. AutoCreateRoutes bool `json:"autoCreateRoutes,omitempty"`
  14698. // Name: Name of this peering. Provided by the client when the peering
  14699. // is created. The name must comply with RFC1035. Specifically, the name
  14700. // must be 1-63 characters long and match regular expression
  14701. // `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be
  14702. // a lowercase letter, and all the following characters must be a dash,
  14703. // lowercase letter, or digit, except the last character, which cannot
  14704. // be a dash.
  14705. Name string `json:"name,omitempty"`
  14706. // Network: The URL of the peer network. It can be either full URL or
  14707. // partial URL. The peer network may belong to a different project. If
  14708. // the partial URL does not contain project, it is assumed that the peer
  14709. // network is in the same project as the current network.
  14710. Network string `json:"network,omitempty"`
  14711. // State: [Output Only] State for the peering.
  14712. //
  14713. // Possible values:
  14714. // "ACTIVE"
  14715. // "INACTIVE"
  14716. State string `json:"state,omitempty"`
  14717. // StateDetails: [Output Only] Details about the current state of the
  14718. // peering.
  14719. StateDetails string `json:"stateDetails,omitempty"`
  14720. // ForceSendFields is a list of field names (e.g. "AutoCreateRoutes") to
  14721. // unconditionally include in API requests. By default, fields with
  14722. // empty values are omitted from API requests. However, any non-pointer,
  14723. // non-interface field appearing in ForceSendFields will be sent to the
  14724. // server regardless of whether the field is empty or not. This may be
  14725. // used to include empty fields in Patch requests.
  14726. ForceSendFields []string `json:"-"`
  14727. // NullFields is a list of field names (e.g. "AutoCreateRoutes") to
  14728. // include in API requests with the JSON null value. By default, fields
  14729. // with empty values are omitted from API requests. However, any field
  14730. // with an empty value appearing in NullFields will be sent to the
  14731. // server as null. It is an error if a field in this list has a
  14732. // non-empty value. This may be used to include null fields in Patch
  14733. // requests.
  14734. NullFields []string `json:"-"`
  14735. }
  14736. func (s *NetworkPeering) MarshalJSON() ([]byte, error) {
  14737. type NoMethod NetworkPeering
  14738. raw := NoMethod(*s)
  14739. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  14740. }
  14741. // NetworkRoutingConfig: A routing configuration attached to a network
  14742. // resource. The message includes the list of routers associated with
  14743. // the network, and a flag indicating the type of routing behavior to
  14744. // enforce network-wide.
  14745. type NetworkRoutingConfig struct {
  14746. // RoutingMode: The network-wide routing mode to use. If set to
  14747. // REGIONAL, this network's cloud routers will only advertise routes
  14748. // with subnetworks of this network in the same region as the router. If
  14749. // set to GLOBAL, this network's cloud routers will advertise routes
  14750. // with all subnetworks of this network, across regions.
  14751. //
  14752. // Possible values:
  14753. // "GLOBAL"
  14754. // "REGIONAL"
  14755. RoutingMode string `json:"routingMode,omitempty"`
  14756. // ForceSendFields is a list of field names (e.g. "RoutingMode") to
  14757. // unconditionally include in API requests. By default, fields with
  14758. // empty values are omitted from API requests. However, any non-pointer,
  14759. // non-interface field appearing in ForceSendFields will be sent to the
  14760. // server regardless of whether the field is empty or not. This may be
  14761. // used to include empty fields in Patch requests.
  14762. ForceSendFields []string `json:"-"`
  14763. // NullFields is a list of field names (e.g. "RoutingMode") to include
  14764. // in API requests with the JSON null value. By default, fields with
  14765. // empty values are omitted from API requests. However, any field with
  14766. // an empty value appearing in NullFields will be sent to the server as
  14767. // null. It is an error if a field in this list has a non-empty value.
  14768. // This may be used to include null fields in Patch requests.
  14769. NullFields []string `json:"-"`
  14770. }
  14771. func (s *NetworkRoutingConfig) MarshalJSON() ([]byte, error) {
  14772. type NoMethod NetworkRoutingConfig
  14773. raw := NoMethod(*s)
  14774. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  14775. }
  14776. type NetworksAddPeeringRequest struct {
  14777. // AutoCreateRoutes: Whether Google Compute Engine manages the routes
  14778. // automatically.
  14779. AutoCreateRoutes bool `json:"autoCreateRoutes,omitempty"`
  14780. // Name: Name of the peering, which should conform to RFC1035.
  14781. Name string `json:"name,omitempty"`
  14782. // PeerNetwork: URL of the peer network. It can be either full URL or
  14783. // partial URL. The peer network may belong to a different project. If
  14784. // the partial URL does not contain project, it is assumed that the peer
  14785. // network is in the same project as the current network.
  14786. PeerNetwork string `json:"peerNetwork,omitempty"`
  14787. // ForceSendFields is a list of field names (e.g. "AutoCreateRoutes") to
  14788. // unconditionally include in API requests. By default, fields with
  14789. // empty values are omitted from API requests. However, any non-pointer,
  14790. // non-interface field appearing in ForceSendFields will be sent to the
  14791. // server regardless of whether the field is empty or not. This may be
  14792. // used to include empty fields in Patch requests.
  14793. ForceSendFields []string `json:"-"`
  14794. // NullFields is a list of field names (e.g. "AutoCreateRoutes") to
  14795. // include in API requests with the JSON null value. By default, fields
  14796. // with empty values are omitted from API requests. However, any field
  14797. // with an empty value appearing in NullFields will be sent to the
  14798. // server as null. It is an error if a field in this list has a
  14799. // non-empty value. This may be used to include null fields in Patch
  14800. // requests.
  14801. NullFields []string `json:"-"`
  14802. }
  14803. func (s *NetworksAddPeeringRequest) MarshalJSON() ([]byte, error) {
  14804. type NoMethod NetworksAddPeeringRequest
  14805. raw := NoMethod(*s)
  14806. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  14807. }
  14808. type NetworksRemovePeeringRequest struct {
  14809. // Name: Name of the peering, which should conform to RFC1035.
  14810. Name string `json:"name,omitempty"`
  14811. // ForceSendFields is a list of field names (e.g. "Name") to
  14812. // unconditionally include in API requests. By default, fields with
  14813. // empty values are omitted from API requests. However, any non-pointer,
  14814. // non-interface field appearing in ForceSendFields will be sent to the
  14815. // server regardless of whether the field is empty or not. This may be
  14816. // used to include empty fields in Patch requests.
  14817. ForceSendFields []string `json:"-"`
  14818. // NullFields is a list of field names (e.g. "Name") to include in API
  14819. // requests with the JSON null value. By default, fields with empty
  14820. // values are omitted from API requests. However, any field with an
  14821. // empty value appearing in NullFields will be sent to the server as
  14822. // null. It is an error if a field in this list has a non-empty value.
  14823. // This may be used to include null fields in Patch requests.
  14824. NullFields []string `json:"-"`
  14825. }
  14826. func (s *NetworksRemovePeeringRequest) MarshalJSON() ([]byte, error) {
  14827. type NoMethod NetworksRemovePeeringRequest
  14828. raw := NoMethod(*s)
  14829. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  14830. }
  14831. // NodeGroup: A NodeGroup resource.
  14832. type NodeGroup struct {
  14833. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  14834. // format.
  14835. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  14836. // Description: An optional description of this resource. Provide this
  14837. // property when you create the resource.
  14838. Description string `json:"description,omitempty"`
  14839. // Id: [Output Only] The unique identifier for the resource. This
  14840. // identifier is defined by the server.
  14841. Id uint64 `json:"id,omitempty,string"`
  14842. // Kind: [Output Only] The type of the resource. Always
  14843. // compute#nodeGroup for node group.
  14844. Kind string `json:"kind,omitempty"`
  14845. // Name: The name of the resource, provided by the client when initially
  14846. // creating the resource. The resource name must be 1-63 characters
  14847. // long, and comply with RFC1035. Specifically, the name must be 1-63
  14848. // characters long and match the regular expression
  14849. // `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be
  14850. // a lowercase letter, and all following characters must be a dash,
  14851. // lowercase letter, or digit, except the last character, which cannot
  14852. // be a dash.
  14853. Name string `json:"name,omitempty"`
  14854. // NodeTemplate: The URL of the node template to which this node group
  14855. // belongs.
  14856. NodeTemplate string `json:"nodeTemplate,omitempty"`
  14857. // Nodes: [Output Only] A list of nodes in this node group.
  14858. Nodes []*NodeGroupNode `json:"nodes,omitempty"`
  14859. // SelfLink: [Output Only] Server-defined URL for the resource.
  14860. SelfLink string `json:"selfLink,omitempty"`
  14861. // Possible values:
  14862. // "CREATING"
  14863. // "DELETING"
  14864. // "INVALID"
  14865. // "READY"
  14866. Status string `json:"status,omitempty"`
  14867. // Zone: [Output Only] The name of the zone where the node group
  14868. // resides, such as us-central1-a.
  14869. Zone string `json:"zone,omitempty"`
  14870. // ServerResponse contains the HTTP response code and headers from the
  14871. // server.
  14872. googleapi.ServerResponse `json:"-"`
  14873. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  14874. // to unconditionally include in API requests. By default, fields with
  14875. // empty values are omitted from API requests. However, any non-pointer,
  14876. // non-interface field appearing in ForceSendFields will be sent to the
  14877. // server regardless of whether the field is empty or not. This may be
  14878. // used to include empty fields in Patch requests.
  14879. ForceSendFields []string `json:"-"`
  14880. // NullFields is a list of field names (e.g. "CreationTimestamp") to
  14881. // include in API requests with the JSON null value. By default, fields
  14882. // with empty values are omitted from API requests. However, any field
  14883. // with an empty value appearing in NullFields will be sent to the
  14884. // server as null. It is an error if a field in this list has a
  14885. // non-empty value. This may be used to include null fields in Patch
  14886. // requests.
  14887. NullFields []string `json:"-"`
  14888. }
  14889. func (s *NodeGroup) MarshalJSON() ([]byte, error) {
  14890. type NoMethod NodeGroup
  14891. raw := NoMethod(*s)
  14892. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  14893. }
  14894. type NodeGroupAggregatedList struct {
  14895. // Id: [Output Only] Unique identifier for the resource; defined by the
  14896. // server.
  14897. Id string `json:"id,omitempty"`
  14898. // Items: A list of NodeGroupsScopedList resources.
  14899. Items map[string]NodeGroupsScopedList `json:"items,omitempty"`
  14900. // Kind: [Output Only] Type of resource.Always
  14901. // compute#nodeGroupAggregatedList for aggregated lists of node groups.
  14902. Kind string `json:"kind,omitempty"`
  14903. // NextPageToken: [Output Only] This token allows you to get the next
  14904. // page of results for list requests. If the number of results is larger
  14905. // than maxResults, use the nextPageToken as a value for the query
  14906. // parameter pageToken in the next list request. Subsequent list
  14907. // requests will have their own nextPageToken to continue paging through
  14908. // the results.
  14909. NextPageToken string `json:"nextPageToken,omitempty"`
  14910. // SelfLink: [Output Only] Server-defined URL for this resource.
  14911. SelfLink string `json:"selfLink,omitempty"`
  14912. // Warning: [Output Only] Informational warning message.
  14913. Warning *NodeGroupAggregatedListWarning `json:"warning,omitempty"`
  14914. // ServerResponse contains the HTTP response code and headers from the
  14915. // server.
  14916. googleapi.ServerResponse `json:"-"`
  14917. // ForceSendFields is a list of field names (e.g. "Id") to
  14918. // unconditionally include in API requests. By default, fields with
  14919. // empty values are omitted from API requests. However, any non-pointer,
  14920. // non-interface field appearing in ForceSendFields will be sent to the
  14921. // server regardless of whether the field is empty or not. This may be
  14922. // used to include empty fields in Patch requests.
  14923. ForceSendFields []string `json:"-"`
  14924. // NullFields is a list of field names (e.g. "Id") to include in API
  14925. // requests with the JSON null value. By default, fields with empty
  14926. // values are omitted from API requests. However, any field with an
  14927. // empty value appearing in NullFields will be sent to the server as
  14928. // null. It is an error if a field in this list has a non-empty value.
  14929. // This may be used to include null fields in Patch requests.
  14930. NullFields []string `json:"-"`
  14931. }
  14932. func (s *NodeGroupAggregatedList) MarshalJSON() ([]byte, error) {
  14933. type NoMethod NodeGroupAggregatedList
  14934. raw := NoMethod(*s)
  14935. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  14936. }
  14937. // NodeGroupAggregatedListWarning: [Output Only] Informational warning
  14938. // message.
  14939. type NodeGroupAggregatedListWarning struct {
  14940. // Code: [Output Only] A warning code, if applicable. For example,
  14941. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  14942. // the response.
  14943. //
  14944. // Possible values:
  14945. // "CLEANUP_FAILED"
  14946. // "DEPRECATED_RESOURCE_USED"
  14947. // "DEPRECATED_TYPE_USED"
  14948. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  14949. // "EXPERIMENTAL_TYPE_USED"
  14950. // "EXTERNAL_API_WARNING"
  14951. // "FIELD_VALUE_OVERRIDEN"
  14952. // "INJECTED_KERNELS_DEPRECATED"
  14953. // "MISSING_TYPE_DEPENDENCY"
  14954. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  14955. // "NEXT_HOP_CANNOT_IP_FORWARD"
  14956. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  14957. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  14958. // "NEXT_HOP_NOT_RUNNING"
  14959. // "NOT_CRITICAL_ERROR"
  14960. // "NO_RESULTS_ON_PAGE"
  14961. // "REQUIRED_TOS_AGREEMENT"
  14962. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  14963. // "RESOURCE_NOT_DELETED"
  14964. // "SCHEMA_VALIDATION_IGNORED"
  14965. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  14966. // "UNDECLARED_PROPERTIES"
  14967. // "UNREACHABLE"
  14968. Code string `json:"code,omitempty"`
  14969. // Data: [Output Only] Metadata about this warning in key: value format.
  14970. // For example:
  14971. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  14972. Data []*NodeGroupAggregatedListWarningData `json:"data,omitempty"`
  14973. // Message: [Output Only] A human-readable description of the warning
  14974. // code.
  14975. Message string `json:"message,omitempty"`
  14976. // ForceSendFields is a list of field names (e.g. "Code") to
  14977. // unconditionally include in API requests. By default, fields with
  14978. // empty values are omitted from API requests. However, any non-pointer,
  14979. // non-interface field appearing in ForceSendFields will be sent to the
  14980. // server regardless of whether the field is empty or not. This may be
  14981. // used to include empty fields in Patch requests.
  14982. ForceSendFields []string `json:"-"`
  14983. // NullFields is a list of field names (e.g. "Code") to include in API
  14984. // requests with the JSON null value. By default, fields with empty
  14985. // values are omitted from API requests. However, any field with an
  14986. // empty value appearing in NullFields will be sent to the server as
  14987. // null. It is an error if a field in this list has a non-empty value.
  14988. // This may be used to include null fields in Patch requests.
  14989. NullFields []string `json:"-"`
  14990. }
  14991. func (s *NodeGroupAggregatedListWarning) MarshalJSON() ([]byte, error) {
  14992. type NoMethod NodeGroupAggregatedListWarning
  14993. raw := NoMethod(*s)
  14994. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  14995. }
  14996. type NodeGroupAggregatedListWarningData struct {
  14997. // Key: [Output Only] A key that provides more detail on the warning
  14998. // being returned. For example, for warnings where there are no results
  14999. // in a list request for a particular zone, this key might be scope and
  15000. // the key value might be the zone name. Other examples might be a key
  15001. // indicating a deprecated resource and a suggested replacement, or a
  15002. // warning about invalid network settings (for example, if an instance
  15003. // attempts to perform IP forwarding but is not enabled for IP
  15004. // forwarding).
  15005. Key string `json:"key,omitempty"`
  15006. // Value: [Output Only] A warning data value corresponding to the key.
  15007. Value string `json:"value,omitempty"`
  15008. // ForceSendFields is a list of field names (e.g. "Key") to
  15009. // unconditionally include in API requests. By default, fields with
  15010. // empty values are omitted from API requests. However, any non-pointer,
  15011. // non-interface field appearing in ForceSendFields will be sent to the
  15012. // server regardless of whether the field is empty or not. This may be
  15013. // used to include empty fields in Patch requests.
  15014. ForceSendFields []string `json:"-"`
  15015. // NullFields is a list of field names (e.g. "Key") to include in API
  15016. // requests with the JSON null value. By default, fields with empty
  15017. // values are omitted from API requests. However, any field with an
  15018. // empty value appearing in NullFields will be sent to the server as
  15019. // null. It is an error if a field in this list has a non-empty value.
  15020. // This may be used to include null fields in Patch requests.
  15021. NullFields []string `json:"-"`
  15022. }
  15023. func (s *NodeGroupAggregatedListWarningData) MarshalJSON() ([]byte, error) {
  15024. type NoMethod NodeGroupAggregatedListWarningData
  15025. raw := NoMethod(*s)
  15026. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  15027. }
  15028. // NodeGroupList: Contains a list of nodeGroups.
  15029. type NodeGroupList struct {
  15030. // Id: [Output Only] Unique identifier for the resource; defined by the
  15031. // server.
  15032. Id string `json:"id,omitempty"`
  15033. // Items: A list of NodeGroup resources.
  15034. Items []*NodeGroup `json:"items,omitempty"`
  15035. // Kind: [Output Only] Type of resource.Always compute#nodeGroupList for
  15036. // lists of node groups.
  15037. Kind string `json:"kind,omitempty"`
  15038. // NextPageToken: [Output Only] This token allows you to get the next
  15039. // page of results for list requests. If the number of results is larger
  15040. // than maxResults, use the nextPageToken as a value for the query
  15041. // parameter pageToken in the next list request. Subsequent list
  15042. // requests will have their own nextPageToken to continue paging through
  15043. // the results.
  15044. NextPageToken string `json:"nextPageToken,omitempty"`
  15045. // SelfLink: [Output Only] Server-defined URL for this resource.
  15046. SelfLink string `json:"selfLink,omitempty"`
  15047. // Warning: [Output Only] Informational warning message.
  15048. Warning *NodeGroupListWarning `json:"warning,omitempty"`
  15049. // ServerResponse contains the HTTP response code and headers from the
  15050. // server.
  15051. googleapi.ServerResponse `json:"-"`
  15052. // ForceSendFields is a list of field names (e.g. "Id") to
  15053. // unconditionally include in API requests. By default, fields with
  15054. // empty values are omitted from API requests. However, any non-pointer,
  15055. // non-interface field appearing in ForceSendFields will be sent to the
  15056. // server regardless of whether the field is empty or not. This may be
  15057. // used to include empty fields in Patch requests.
  15058. ForceSendFields []string `json:"-"`
  15059. // NullFields is a list of field names (e.g. "Id") to include in API
  15060. // requests with the JSON null value. By default, fields with empty
  15061. // values are omitted from API requests. However, any field with an
  15062. // empty value appearing in NullFields will be sent to the server as
  15063. // null. It is an error if a field in this list has a non-empty value.
  15064. // This may be used to include null fields in Patch requests.
  15065. NullFields []string `json:"-"`
  15066. }
  15067. func (s *NodeGroupList) MarshalJSON() ([]byte, error) {
  15068. type NoMethod NodeGroupList
  15069. raw := NoMethod(*s)
  15070. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  15071. }
  15072. // NodeGroupListWarning: [Output Only] Informational warning message.
  15073. type NodeGroupListWarning struct {
  15074. // Code: [Output Only] A warning code, if applicable. For example,
  15075. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  15076. // the response.
  15077. //
  15078. // Possible values:
  15079. // "CLEANUP_FAILED"
  15080. // "DEPRECATED_RESOURCE_USED"
  15081. // "DEPRECATED_TYPE_USED"
  15082. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  15083. // "EXPERIMENTAL_TYPE_USED"
  15084. // "EXTERNAL_API_WARNING"
  15085. // "FIELD_VALUE_OVERRIDEN"
  15086. // "INJECTED_KERNELS_DEPRECATED"
  15087. // "MISSING_TYPE_DEPENDENCY"
  15088. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  15089. // "NEXT_HOP_CANNOT_IP_FORWARD"
  15090. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  15091. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  15092. // "NEXT_HOP_NOT_RUNNING"
  15093. // "NOT_CRITICAL_ERROR"
  15094. // "NO_RESULTS_ON_PAGE"
  15095. // "REQUIRED_TOS_AGREEMENT"
  15096. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  15097. // "RESOURCE_NOT_DELETED"
  15098. // "SCHEMA_VALIDATION_IGNORED"
  15099. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  15100. // "UNDECLARED_PROPERTIES"
  15101. // "UNREACHABLE"
  15102. Code string `json:"code,omitempty"`
  15103. // Data: [Output Only] Metadata about this warning in key: value format.
  15104. // For example:
  15105. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  15106. Data []*NodeGroupListWarningData `json:"data,omitempty"`
  15107. // Message: [Output Only] A human-readable description of the warning
  15108. // code.
  15109. Message string `json:"message,omitempty"`
  15110. // ForceSendFields is a list of field names (e.g. "Code") to
  15111. // unconditionally include in API requests. By default, fields with
  15112. // empty values are omitted from API requests. However, any non-pointer,
  15113. // non-interface field appearing in ForceSendFields will be sent to the
  15114. // server regardless of whether the field is empty or not. This may be
  15115. // used to include empty fields in Patch requests.
  15116. ForceSendFields []string `json:"-"`
  15117. // NullFields is a list of field names (e.g. "Code") to include in API
  15118. // requests with the JSON null value. By default, fields with empty
  15119. // values are omitted from API requests. However, any field with an
  15120. // empty value appearing in NullFields will be sent to the server as
  15121. // null. It is an error if a field in this list has a non-empty value.
  15122. // This may be used to include null fields in Patch requests.
  15123. NullFields []string `json:"-"`
  15124. }
  15125. func (s *NodeGroupListWarning) MarshalJSON() ([]byte, error) {
  15126. type NoMethod NodeGroupListWarning
  15127. raw := NoMethod(*s)
  15128. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  15129. }
  15130. type NodeGroupListWarningData struct {
  15131. // Key: [Output Only] A key that provides more detail on the warning
  15132. // being returned. For example, for warnings where there are no results
  15133. // in a list request for a particular zone, this key might be scope and
  15134. // the key value might be the zone name. Other examples might be a key
  15135. // indicating a deprecated resource and a suggested replacement, or a
  15136. // warning about invalid network settings (for example, if an instance
  15137. // attempts to perform IP forwarding but is not enabled for IP
  15138. // forwarding).
  15139. Key string `json:"key,omitempty"`
  15140. // Value: [Output Only] A warning data value corresponding to the key.
  15141. Value string `json:"value,omitempty"`
  15142. // ForceSendFields is a list of field names (e.g. "Key") to
  15143. // unconditionally include in API requests. By default, fields with
  15144. // empty values are omitted from API requests. However, any non-pointer,
  15145. // non-interface field appearing in ForceSendFields will be sent to the
  15146. // server regardless of whether the field is empty or not. This may be
  15147. // used to include empty fields in Patch requests.
  15148. ForceSendFields []string `json:"-"`
  15149. // NullFields is a list of field names (e.g. "Key") to include in API
  15150. // requests with the JSON null value. By default, fields with empty
  15151. // values are omitted from API requests. However, any field with an
  15152. // empty value appearing in NullFields will be sent to the server as
  15153. // null. It is an error if a field in this list has a non-empty value.
  15154. // This may be used to include null fields in Patch requests.
  15155. NullFields []string `json:"-"`
  15156. }
  15157. func (s *NodeGroupListWarningData) MarshalJSON() ([]byte, error) {
  15158. type NoMethod NodeGroupListWarningData
  15159. raw := NoMethod(*s)
  15160. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  15161. }
  15162. type NodeGroupNode struct {
  15163. // Instances: Instances scheduled on this node.
  15164. Instances []string `json:"instances,omitempty"`
  15165. // Name: The name of the node.
  15166. Name string `json:"name,omitempty"`
  15167. // NodeType: The type of this node.
  15168. NodeType string `json:"nodeType,omitempty"`
  15169. // ForceSendFields is a list of field names (e.g. "Instances") to
  15170. // unconditionally include in API requests. By default, fields with
  15171. // empty values are omitted from API requests. However, any non-pointer,
  15172. // non-interface field appearing in ForceSendFields will be sent to the
  15173. // server regardless of whether the field is empty or not. This may be
  15174. // used to include empty fields in Patch requests.
  15175. ForceSendFields []string `json:"-"`
  15176. // NullFields is a list of field names (e.g. "Instances") to include in
  15177. // API requests with the JSON null value. By default, fields with empty
  15178. // values are omitted from API requests. However, any field with an
  15179. // empty value appearing in NullFields will be sent to the server as
  15180. // null. It is an error if a field in this list has a non-empty value.
  15181. // This may be used to include null fields in Patch requests.
  15182. NullFields []string `json:"-"`
  15183. }
  15184. func (s *NodeGroupNode) MarshalJSON() ([]byte, error) {
  15185. type NoMethod NodeGroupNode
  15186. raw := NoMethod(*s)
  15187. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  15188. }
  15189. type NodeGroupsAddNodesRequest struct {
  15190. // AdditionalNodeCount: Count of additional nodes to be added to the
  15191. // node group.
  15192. AdditionalNodeCount int64 `json:"additionalNodeCount,omitempty"`
  15193. // ForceSendFields is a list of field names (e.g. "AdditionalNodeCount")
  15194. // to unconditionally include in API requests. By default, fields with
  15195. // empty values are omitted from API requests. However, any non-pointer,
  15196. // non-interface field appearing in ForceSendFields will be sent to the
  15197. // server regardless of whether the field is empty or not. This may be
  15198. // used to include empty fields in Patch requests.
  15199. ForceSendFields []string `json:"-"`
  15200. // NullFields is a list of field names (e.g. "AdditionalNodeCount") to
  15201. // include in API requests with the JSON null value. By default, fields
  15202. // with empty values are omitted from API requests. However, any field
  15203. // with an empty value appearing in NullFields will be sent to the
  15204. // server as null. It is an error if a field in this list has a
  15205. // non-empty value. This may be used to include null fields in Patch
  15206. // requests.
  15207. NullFields []string `json:"-"`
  15208. }
  15209. func (s *NodeGroupsAddNodesRequest) MarshalJSON() ([]byte, error) {
  15210. type NoMethod NodeGroupsAddNodesRequest
  15211. raw := NoMethod(*s)
  15212. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  15213. }
  15214. type NodeGroupsDeleteNodesRequest struct {
  15215. Nodes []string `json:"nodes,omitempty"`
  15216. // ForceSendFields is a list of field names (e.g. "Nodes") to
  15217. // unconditionally include in API requests. By default, fields with
  15218. // empty values are omitted from API requests. However, any non-pointer,
  15219. // non-interface field appearing in ForceSendFields will be sent to the
  15220. // server regardless of whether the field is empty or not. This may be
  15221. // used to include empty fields in Patch requests.
  15222. ForceSendFields []string `json:"-"`
  15223. // NullFields is a list of field names (e.g. "Nodes") to include in API
  15224. // requests with the JSON null value. By default, fields with empty
  15225. // values are omitted from API requests. However, any field with an
  15226. // empty value appearing in NullFields will be sent to the server as
  15227. // null. It is an error if a field in this list has a non-empty value.
  15228. // This may be used to include null fields in Patch requests.
  15229. NullFields []string `json:"-"`
  15230. }
  15231. func (s *NodeGroupsDeleteNodesRequest) MarshalJSON() ([]byte, error) {
  15232. type NoMethod NodeGroupsDeleteNodesRequest
  15233. raw := NoMethod(*s)
  15234. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  15235. }
  15236. type NodeGroupsScopedList struct {
  15237. // NodeGroups: [Output Only] A list of node groups contained in this
  15238. // scope.
  15239. NodeGroups []*NodeGroup `json:"nodeGroups,omitempty"`
  15240. // Warning: [Output Only] An informational warning that appears when the
  15241. // nodeGroup list is empty.
  15242. Warning *NodeGroupsScopedListWarning `json:"warning,omitempty"`
  15243. // ForceSendFields is a list of field names (e.g. "NodeGroups") to
  15244. // unconditionally include in API requests. By default, fields with
  15245. // empty values are omitted from API requests. However, any non-pointer,
  15246. // non-interface field appearing in ForceSendFields will be sent to the
  15247. // server regardless of whether the field is empty or not. This may be
  15248. // used to include empty fields in Patch requests.
  15249. ForceSendFields []string `json:"-"`
  15250. // NullFields is a list of field names (e.g. "NodeGroups") to include in
  15251. // API requests with the JSON null value. By default, fields with empty
  15252. // values are omitted from API requests. However, any field with an
  15253. // empty value appearing in NullFields will be sent to the server as
  15254. // null. It is an error if a field in this list has a non-empty value.
  15255. // This may be used to include null fields in Patch requests.
  15256. NullFields []string `json:"-"`
  15257. }
  15258. func (s *NodeGroupsScopedList) MarshalJSON() ([]byte, error) {
  15259. type NoMethod NodeGroupsScopedList
  15260. raw := NoMethod(*s)
  15261. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  15262. }
  15263. // NodeGroupsScopedListWarning: [Output Only] An informational warning
  15264. // that appears when the nodeGroup list is empty.
  15265. type NodeGroupsScopedListWarning struct {
  15266. // Code: [Output Only] A warning code, if applicable. For example,
  15267. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  15268. // the response.
  15269. //
  15270. // Possible values:
  15271. // "CLEANUP_FAILED"
  15272. // "DEPRECATED_RESOURCE_USED"
  15273. // "DEPRECATED_TYPE_USED"
  15274. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  15275. // "EXPERIMENTAL_TYPE_USED"
  15276. // "EXTERNAL_API_WARNING"
  15277. // "FIELD_VALUE_OVERRIDEN"
  15278. // "INJECTED_KERNELS_DEPRECATED"
  15279. // "MISSING_TYPE_DEPENDENCY"
  15280. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  15281. // "NEXT_HOP_CANNOT_IP_FORWARD"
  15282. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  15283. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  15284. // "NEXT_HOP_NOT_RUNNING"
  15285. // "NOT_CRITICAL_ERROR"
  15286. // "NO_RESULTS_ON_PAGE"
  15287. // "REQUIRED_TOS_AGREEMENT"
  15288. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  15289. // "RESOURCE_NOT_DELETED"
  15290. // "SCHEMA_VALIDATION_IGNORED"
  15291. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  15292. // "UNDECLARED_PROPERTIES"
  15293. // "UNREACHABLE"
  15294. Code string `json:"code,omitempty"`
  15295. // Data: [Output Only] Metadata about this warning in key: value format.
  15296. // For example:
  15297. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  15298. Data []*NodeGroupsScopedListWarningData `json:"data,omitempty"`
  15299. // Message: [Output Only] A human-readable description of the warning
  15300. // code.
  15301. Message string `json:"message,omitempty"`
  15302. // ForceSendFields is a list of field names (e.g. "Code") to
  15303. // unconditionally include in API requests. By default, fields with
  15304. // empty values are omitted from API requests. However, any non-pointer,
  15305. // non-interface field appearing in ForceSendFields will be sent to the
  15306. // server regardless of whether the field is empty or not. This may be
  15307. // used to include empty fields in Patch requests.
  15308. ForceSendFields []string `json:"-"`
  15309. // NullFields is a list of field names (e.g. "Code") to include in API
  15310. // requests with the JSON null value. By default, fields with empty
  15311. // values are omitted from API requests. However, any field with an
  15312. // empty value appearing in NullFields will be sent to the server as
  15313. // null. It is an error if a field in this list has a non-empty value.
  15314. // This may be used to include null fields in Patch requests.
  15315. NullFields []string `json:"-"`
  15316. }
  15317. func (s *NodeGroupsScopedListWarning) MarshalJSON() ([]byte, error) {
  15318. type NoMethod NodeGroupsScopedListWarning
  15319. raw := NoMethod(*s)
  15320. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  15321. }
  15322. type NodeGroupsScopedListWarningData struct {
  15323. // Key: [Output Only] A key that provides more detail on the warning
  15324. // being returned. For example, for warnings where there are no results
  15325. // in a list request for a particular zone, this key might be scope and
  15326. // the key value might be the zone name. Other examples might be a key
  15327. // indicating a deprecated resource and a suggested replacement, or a
  15328. // warning about invalid network settings (for example, if an instance
  15329. // attempts to perform IP forwarding but is not enabled for IP
  15330. // forwarding).
  15331. Key string `json:"key,omitempty"`
  15332. // Value: [Output Only] A warning data value corresponding to the key.
  15333. Value string `json:"value,omitempty"`
  15334. // ForceSendFields is a list of field names (e.g. "Key") to
  15335. // unconditionally include in API requests. By default, fields with
  15336. // empty values are omitted from API requests. However, any non-pointer,
  15337. // non-interface field appearing in ForceSendFields will be sent to the
  15338. // server regardless of whether the field is empty or not. This may be
  15339. // used to include empty fields in Patch requests.
  15340. ForceSendFields []string `json:"-"`
  15341. // NullFields is a list of field names (e.g. "Key") to include in API
  15342. // requests with the JSON null value. By default, fields with empty
  15343. // values are omitted from API requests. However, any field with an
  15344. // empty value appearing in NullFields will be sent to the server as
  15345. // null. It is an error if a field in this list has a non-empty value.
  15346. // This may be used to include null fields in Patch requests.
  15347. NullFields []string `json:"-"`
  15348. }
  15349. func (s *NodeGroupsScopedListWarningData) MarshalJSON() ([]byte, error) {
  15350. type NoMethod NodeGroupsScopedListWarningData
  15351. raw := NoMethod(*s)
  15352. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  15353. }
  15354. type NodeGroupsSetNodeTemplateRequest struct {
  15355. // NodeTemplate: Full or partial URL of the node template resource to be
  15356. // updated for this node group.
  15357. NodeTemplate string `json:"nodeTemplate,omitempty"`
  15358. // ForceSendFields is a list of field names (e.g. "NodeTemplate") to
  15359. // unconditionally include in API requests. By default, fields with
  15360. // empty values are omitted from API requests. However, any non-pointer,
  15361. // non-interface field appearing in ForceSendFields will be sent to the
  15362. // server regardless of whether the field is empty or not. This may be
  15363. // used to include empty fields in Patch requests.
  15364. ForceSendFields []string `json:"-"`
  15365. // NullFields is a list of field names (e.g. "NodeTemplate") to include
  15366. // in API requests with the JSON null value. By default, fields with
  15367. // empty values are omitted from API requests. However, any field with
  15368. // an empty value appearing in NullFields will be sent to the server as
  15369. // null. It is an error if a field in this list has a non-empty value.
  15370. // This may be used to include null fields in Patch requests.
  15371. NullFields []string `json:"-"`
  15372. }
  15373. func (s *NodeGroupsSetNodeTemplateRequest) MarshalJSON() ([]byte, error) {
  15374. type NoMethod NodeGroupsSetNodeTemplateRequest
  15375. raw := NoMethod(*s)
  15376. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  15377. }
  15378. // NodeTemplate: A Node Template resource.
  15379. type NodeTemplate struct {
  15380. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  15381. // format.
  15382. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  15383. // Description: An optional description of this resource. Provide this
  15384. // property when you create the resource.
  15385. Description string `json:"description,omitempty"`
  15386. // Id: [Output Only] The unique identifier for the resource. This
  15387. // identifier is defined by the server.
  15388. Id uint64 `json:"id,omitempty,string"`
  15389. // Kind: [Output Only] The type of the resource. Always
  15390. // compute#nodeTemplate for node templates.
  15391. Kind string `json:"kind,omitempty"`
  15392. // Name: The name of the resource, provided by the client when initially
  15393. // creating the resource. The resource name must be 1-63 characters
  15394. // long, and comply with RFC1035. Specifically, the name must be 1-63
  15395. // characters long and match the regular expression
  15396. // `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be
  15397. // a lowercase letter, and all following characters must be a dash,
  15398. // lowercase letter, or digit, except the last charaicter, which cannot
  15399. // be a dash.
  15400. Name string `json:"name,omitempty"`
  15401. // NodeAffinityLabels: Labels to use for node affinity, which will be
  15402. // used in instance scheduling.
  15403. NodeAffinityLabels map[string]string `json:"nodeAffinityLabels,omitempty"`
  15404. // NodeType: The node type to use for nodes group that are created from
  15405. // this template.
  15406. NodeType string `json:"nodeType,omitempty"`
  15407. // NodeTypeFlexibility: The flexible properties of the desired node
  15408. // type. Node groups that use this node template will create nodes of a
  15409. // type that matches these properties.
  15410. //
  15411. // This field is mutually exclusive with the node_type property; you can
  15412. // only define one or the other, but not both.
  15413. NodeTypeFlexibility *NodeTemplateNodeTypeFlexibility `json:"nodeTypeFlexibility,omitempty"`
  15414. // Region: [Output Only] The name of the region where the node template
  15415. // resides, such as us-central1.
  15416. Region string `json:"region,omitempty"`
  15417. // SelfLink: [Output Only] Server-defined URL for the resource.
  15418. SelfLink string `json:"selfLink,omitempty"`
  15419. // Status: [Output Only] The status of the node template. One of the
  15420. // following values: CREATING, READY, and DELETING.
  15421. //
  15422. // Possible values:
  15423. // "CREATING"
  15424. // "DELETING"
  15425. // "INVALID"
  15426. // "READY"
  15427. Status string `json:"status,omitempty"`
  15428. // StatusMessage: [Output Only] An optional, human-readable explanation
  15429. // of the status.
  15430. StatusMessage string `json:"statusMessage,omitempty"`
  15431. // ServerResponse contains the HTTP response code and headers from the
  15432. // server.
  15433. googleapi.ServerResponse `json:"-"`
  15434. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  15435. // to unconditionally include in API requests. By default, fields with
  15436. // empty values are omitted from API requests. However, any non-pointer,
  15437. // non-interface field appearing in ForceSendFields will be sent to the
  15438. // server regardless of whether the field is empty or not. This may be
  15439. // used to include empty fields in Patch requests.
  15440. ForceSendFields []string `json:"-"`
  15441. // NullFields is a list of field names (e.g. "CreationTimestamp") to
  15442. // include in API requests with the JSON null value. By default, fields
  15443. // with empty values are omitted from API requests. However, any field
  15444. // with an empty value appearing in NullFields will be sent to the
  15445. // server as null. It is an error if a field in this list has a
  15446. // non-empty value. This may be used to include null fields in Patch
  15447. // requests.
  15448. NullFields []string `json:"-"`
  15449. }
  15450. func (s *NodeTemplate) MarshalJSON() ([]byte, error) {
  15451. type NoMethod NodeTemplate
  15452. raw := NoMethod(*s)
  15453. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  15454. }
  15455. type NodeTemplateAggregatedList struct {
  15456. // Id: [Output Only] Unique identifier for the resource; defined by the
  15457. // server.
  15458. Id string `json:"id,omitempty"`
  15459. // Items: A list of NodeTemplatesScopedList resources.
  15460. Items map[string]NodeTemplatesScopedList `json:"items,omitempty"`
  15461. // Kind: [Output Only] Type of resource.Always
  15462. // compute#nodeTemplateAggregatedList for aggregated lists of node
  15463. // templates.
  15464. Kind string `json:"kind,omitempty"`
  15465. // NextPageToken: [Output Only] This token allows you to get the next
  15466. // page of results for list requests. If the number of results is larger
  15467. // than maxResults, use the nextPageToken as a value for the query
  15468. // parameter pageToken in the next list request. Subsequent list
  15469. // requests will have their own nextPageToken to continue paging through
  15470. // the results.
  15471. NextPageToken string `json:"nextPageToken,omitempty"`
  15472. // SelfLink: [Output Only] Server-defined URL for this resource.
  15473. SelfLink string `json:"selfLink,omitempty"`
  15474. // Warning: [Output Only] Informational warning message.
  15475. Warning *NodeTemplateAggregatedListWarning `json:"warning,omitempty"`
  15476. // ServerResponse contains the HTTP response code and headers from the
  15477. // server.
  15478. googleapi.ServerResponse `json:"-"`
  15479. // ForceSendFields is a list of field names (e.g. "Id") to
  15480. // unconditionally include in API requests. By default, fields with
  15481. // empty values are omitted from API requests. However, any non-pointer,
  15482. // non-interface field appearing in ForceSendFields will be sent to the
  15483. // server regardless of whether the field is empty or not. This may be
  15484. // used to include empty fields in Patch requests.
  15485. ForceSendFields []string `json:"-"`
  15486. // NullFields is a list of field names (e.g. "Id") to include in API
  15487. // requests with the JSON null value. By default, fields with empty
  15488. // values are omitted from API requests. However, any field with an
  15489. // empty value appearing in NullFields will be sent to the server as
  15490. // null. It is an error if a field in this list has a non-empty value.
  15491. // This may be used to include null fields in Patch requests.
  15492. NullFields []string `json:"-"`
  15493. }
  15494. func (s *NodeTemplateAggregatedList) MarshalJSON() ([]byte, error) {
  15495. type NoMethod NodeTemplateAggregatedList
  15496. raw := NoMethod(*s)
  15497. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  15498. }
  15499. // NodeTemplateAggregatedListWarning: [Output Only] Informational
  15500. // warning message.
  15501. type NodeTemplateAggregatedListWarning struct {
  15502. // Code: [Output Only] A warning code, if applicable. For example,
  15503. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  15504. // the response.
  15505. //
  15506. // Possible values:
  15507. // "CLEANUP_FAILED"
  15508. // "DEPRECATED_RESOURCE_USED"
  15509. // "DEPRECATED_TYPE_USED"
  15510. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  15511. // "EXPERIMENTAL_TYPE_USED"
  15512. // "EXTERNAL_API_WARNING"
  15513. // "FIELD_VALUE_OVERRIDEN"
  15514. // "INJECTED_KERNELS_DEPRECATED"
  15515. // "MISSING_TYPE_DEPENDENCY"
  15516. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  15517. // "NEXT_HOP_CANNOT_IP_FORWARD"
  15518. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  15519. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  15520. // "NEXT_HOP_NOT_RUNNING"
  15521. // "NOT_CRITICAL_ERROR"
  15522. // "NO_RESULTS_ON_PAGE"
  15523. // "REQUIRED_TOS_AGREEMENT"
  15524. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  15525. // "RESOURCE_NOT_DELETED"
  15526. // "SCHEMA_VALIDATION_IGNORED"
  15527. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  15528. // "UNDECLARED_PROPERTIES"
  15529. // "UNREACHABLE"
  15530. Code string `json:"code,omitempty"`
  15531. // Data: [Output Only] Metadata about this warning in key: value format.
  15532. // For example:
  15533. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  15534. Data []*NodeTemplateAggregatedListWarningData `json:"data,omitempty"`
  15535. // Message: [Output Only] A human-readable description of the warning
  15536. // code.
  15537. Message string `json:"message,omitempty"`
  15538. // ForceSendFields is a list of field names (e.g. "Code") to
  15539. // unconditionally include in API requests. By default, fields with
  15540. // empty values are omitted from API requests. However, any non-pointer,
  15541. // non-interface field appearing in ForceSendFields will be sent to the
  15542. // server regardless of whether the field is empty or not. This may be
  15543. // used to include empty fields in Patch requests.
  15544. ForceSendFields []string `json:"-"`
  15545. // NullFields is a list of field names (e.g. "Code") to include in API
  15546. // requests with the JSON null value. By default, fields with empty
  15547. // values are omitted from API requests. However, any field with an
  15548. // empty value appearing in NullFields will be sent to the server as
  15549. // null. It is an error if a field in this list has a non-empty value.
  15550. // This may be used to include null fields in Patch requests.
  15551. NullFields []string `json:"-"`
  15552. }
  15553. func (s *NodeTemplateAggregatedListWarning) MarshalJSON() ([]byte, error) {
  15554. type NoMethod NodeTemplateAggregatedListWarning
  15555. raw := NoMethod(*s)
  15556. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  15557. }
  15558. type NodeTemplateAggregatedListWarningData struct {
  15559. // Key: [Output Only] A key that provides more detail on the warning
  15560. // being returned. For example, for warnings where there are no results
  15561. // in a list request for a particular zone, this key might be scope and
  15562. // the key value might be the zone name. Other examples might be a key
  15563. // indicating a deprecated resource and a suggested replacement, or a
  15564. // warning about invalid network settings (for example, if an instance
  15565. // attempts to perform IP forwarding but is not enabled for IP
  15566. // forwarding).
  15567. Key string `json:"key,omitempty"`
  15568. // Value: [Output Only] A warning data value corresponding to the key.
  15569. Value string `json:"value,omitempty"`
  15570. // ForceSendFields is a list of field names (e.g. "Key") to
  15571. // unconditionally include in API requests. By default, fields with
  15572. // empty values are omitted from API requests. However, any non-pointer,
  15573. // non-interface field appearing in ForceSendFields will be sent to the
  15574. // server regardless of whether the field is empty or not. This may be
  15575. // used to include empty fields in Patch requests.
  15576. ForceSendFields []string `json:"-"`
  15577. // NullFields is a list of field names (e.g. "Key") to include in API
  15578. // requests with the JSON null value. By default, fields with empty
  15579. // values are omitted from API requests. However, any field with an
  15580. // empty value appearing in NullFields will be sent to the server as
  15581. // null. It is an error if a field in this list has a non-empty value.
  15582. // This may be used to include null fields in Patch requests.
  15583. NullFields []string `json:"-"`
  15584. }
  15585. func (s *NodeTemplateAggregatedListWarningData) MarshalJSON() ([]byte, error) {
  15586. type NoMethod NodeTemplateAggregatedListWarningData
  15587. raw := NoMethod(*s)
  15588. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  15589. }
  15590. // NodeTemplateList: Contains a list of node templates.
  15591. type NodeTemplateList struct {
  15592. // Id: [Output Only] Unique identifier for the resource; defined by the
  15593. // server.
  15594. Id string `json:"id,omitempty"`
  15595. // Items: A list of NodeTemplate resources.
  15596. Items []*NodeTemplate `json:"items,omitempty"`
  15597. // Kind: [Output Only] Type of resource.Always compute#nodeTemplateList
  15598. // for lists of node templates.
  15599. Kind string `json:"kind,omitempty"`
  15600. // NextPageToken: [Output Only] This token allows you to get the next
  15601. // page of results for list requests. If the number of results is larger
  15602. // than maxResults, use the nextPageToken as a value for the query
  15603. // parameter pageToken in the next list request. Subsequent list
  15604. // requests will have their own nextPageToken to continue paging through
  15605. // the results.
  15606. NextPageToken string `json:"nextPageToken,omitempty"`
  15607. // SelfLink: [Output Only] Server-defined URL for this resource.
  15608. SelfLink string `json:"selfLink,omitempty"`
  15609. // Warning: [Output Only] Informational warning message.
  15610. Warning *NodeTemplateListWarning `json:"warning,omitempty"`
  15611. // ServerResponse contains the HTTP response code and headers from the
  15612. // server.
  15613. googleapi.ServerResponse `json:"-"`
  15614. // ForceSendFields is a list of field names (e.g. "Id") to
  15615. // unconditionally include in API requests. By default, fields with
  15616. // empty values are omitted from API requests. However, any non-pointer,
  15617. // non-interface field appearing in ForceSendFields will be sent to the
  15618. // server regardless of whether the field is empty or not. This may be
  15619. // used to include empty fields in Patch requests.
  15620. ForceSendFields []string `json:"-"`
  15621. // NullFields is a list of field names (e.g. "Id") to include in API
  15622. // requests with the JSON null value. By default, fields with empty
  15623. // values are omitted from API requests. However, any field with an
  15624. // empty value appearing in NullFields will be sent to the server as
  15625. // null. It is an error if a field in this list has a non-empty value.
  15626. // This may be used to include null fields in Patch requests.
  15627. NullFields []string `json:"-"`
  15628. }
  15629. func (s *NodeTemplateList) MarshalJSON() ([]byte, error) {
  15630. type NoMethod NodeTemplateList
  15631. raw := NoMethod(*s)
  15632. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  15633. }
  15634. // NodeTemplateListWarning: [Output Only] Informational warning message.
  15635. type NodeTemplateListWarning struct {
  15636. // Code: [Output Only] A warning code, if applicable. For example,
  15637. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  15638. // the response.
  15639. //
  15640. // Possible values:
  15641. // "CLEANUP_FAILED"
  15642. // "DEPRECATED_RESOURCE_USED"
  15643. // "DEPRECATED_TYPE_USED"
  15644. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  15645. // "EXPERIMENTAL_TYPE_USED"
  15646. // "EXTERNAL_API_WARNING"
  15647. // "FIELD_VALUE_OVERRIDEN"
  15648. // "INJECTED_KERNELS_DEPRECATED"
  15649. // "MISSING_TYPE_DEPENDENCY"
  15650. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  15651. // "NEXT_HOP_CANNOT_IP_FORWARD"
  15652. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  15653. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  15654. // "NEXT_HOP_NOT_RUNNING"
  15655. // "NOT_CRITICAL_ERROR"
  15656. // "NO_RESULTS_ON_PAGE"
  15657. // "REQUIRED_TOS_AGREEMENT"
  15658. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  15659. // "RESOURCE_NOT_DELETED"
  15660. // "SCHEMA_VALIDATION_IGNORED"
  15661. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  15662. // "UNDECLARED_PROPERTIES"
  15663. // "UNREACHABLE"
  15664. Code string `json:"code,omitempty"`
  15665. // Data: [Output Only] Metadata about this warning in key: value format.
  15666. // For example:
  15667. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  15668. Data []*NodeTemplateListWarningData `json:"data,omitempty"`
  15669. // Message: [Output Only] A human-readable description of the warning
  15670. // code.
  15671. Message string `json:"message,omitempty"`
  15672. // ForceSendFields is a list of field names (e.g. "Code") to
  15673. // unconditionally include in API requests. By default, fields with
  15674. // empty values are omitted from API requests. However, any non-pointer,
  15675. // non-interface field appearing in ForceSendFields will be sent to the
  15676. // server regardless of whether the field is empty or not. This may be
  15677. // used to include empty fields in Patch requests.
  15678. ForceSendFields []string `json:"-"`
  15679. // NullFields is a list of field names (e.g. "Code") to include in API
  15680. // requests with the JSON null value. By default, fields with empty
  15681. // values are omitted from API requests. However, any field with an
  15682. // empty value appearing in NullFields will be sent to the server as
  15683. // null. It is an error if a field in this list has a non-empty value.
  15684. // This may be used to include null fields in Patch requests.
  15685. NullFields []string `json:"-"`
  15686. }
  15687. func (s *NodeTemplateListWarning) MarshalJSON() ([]byte, error) {
  15688. type NoMethod NodeTemplateListWarning
  15689. raw := NoMethod(*s)
  15690. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  15691. }
  15692. type NodeTemplateListWarningData struct {
  15693. // Key: [Output Only] A key that provides more detail on the warning
  15694. // being returned. For example, for warnings where there are no results
  15695. // in a list request for a particular zone, this key might be scope and
  15696. // the key value might be the zone name. Other examples might be a key
  15697. // indicating a deprecated resource and a suggested replacement, or a
  15698. // warning about invalid network settings (for example, if an instance
  15699. // attempts to perform IP forwarding but is not enabled for IP
  15700. // forwarding).
  15701. Key string `json:"key,omitempty"`
  15702. // Value: [Output Only] A warning data value corresponding to the key.
  15703. Value string `json:"value,omitempty"`
  15704. // ForceSendFields is a list of field names (e.g. "Key") to
  15705. // unconditionally include in API requests. By default, fields with
  15706. // empty values are omitted from API requests. However, any non-pointer,
  15707. // non-interface field appearing in ForceSendFields will be sent to the
  15708. // server regardless of whether the field is empty or not. This may be
  15709. // used to include empty fields in Patch requests.
  15710. ForceSendFields []string `json:"-"`
  15711. // NullFields is a list of field names (e.g. "Key") to include in API
  15712. // requests with the JSON null value. By default, fields with empty
  15713. // values are omitted from API requests. However, any field with an
  15714. // empty value appearing in NullFields will be sent to the server as
  15715. // null. It is an error if a field in this list has a non-empty value.
  15716. // This may be used to include null fields in Patch requests.
  15717. NullFields []string `json:"-"`
  15718. }
  15719. func (s *NodeTemplateListWarningData) MarshalJSON() ([]byte, error) {
  15720. type NoMethod NodeTemplateListWarningData
  15721. raw := NoMethod(*s)
  15722. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  15723. }
  15724. type NodeTemplateNodeTypeFlexibility struct {
  15725. Cpus string `json:"cpus,omitempty"`
  15726. LocalSsd string `json:"localSsd,omitempty"`
  15727. Memory string `json:"memory,omitempty"`
  15728. // ForceSendFields is a list of field names (e.g. "Cpus") to
  15729. // unconditionally include in API requests. By default, fields with
  15730. // empty values are omitted from API requests. However, any non-pointer,
  15731. // non-interface field appearing in ForceSendFields will be sent to the
  15732. // server regardless of whether the field is empty or not. This may be
  15733. // used to include empty fields in Patch requests.
  15734. ForceSendFields []string `json:"-"`
  15735. // NullFields is a list of field names (e.g. "Cpus") to include in API
  15736. // requests with the JSON null value. By default, fields with empty
  15737. // values are omitted from API requests. However, any field with an
  15738. // empty value appearing in NullFields will be sent to the server as
  15739. // null. It is an error if a field in this list has a non-empty value.
  15740. // This may be used to include null fields in Patch requests.
  15741. NullFields []string `json:"-"`
  15742. }
  15743. func (s *NodeTemplateNodeTypeFlexibility) MarshalJSON() ([]byte, error) {
  15744. type NoMethod NodeTemplateNodeTypeFlexibility
  15745. raw := NoMethod(*s)
  15746. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  15747. }
  15748. type NodeTemplatesScopedList struct {
  15749. // NodeTemplates: [Output Only] A list of node templates contained in
  15750. // this scope.
  15751. NodeTemplates []*NodeTemplate `json:"nodeTemplates,omitempty"`
  15752. // Warning: [Output Only] An informational warning that appears when the
  15753. // node templates list is empty.
  15754. Warning *NodeTemplatesScopedListWarning `json:"warning,omitempty"`
  15755. // ForceSendFields is a list of field names (e.g. "NodeTemplates") to
  15756. // unconditionally include in API requests. By default, fields with
  15757. // empty values are omitted from API requests. However, any non-pointer,
  15758. // non-interface field appearing in ForceSendFields will be sent to the
  15759. // server regardless of whether the field is empty or not. This may be
  15760. // used to include empty fields in Patch requests.
  15761. ForceSendFields []string `json:"-"`
  15762. // NullFields is a list of field names (e.g. "NodeTemplates") to include
  15763. // in API requests with the JSON null value. By default, fields with
  15764. // empty values are omitted from API requests. However, any field with
  15765. // an empty value appearing in NullFields will be sent to the server as
  15766. // null. It is an error if a field in this list has a non-empty value.
  15767. // This may be used to include null fields in Patch requests.
  15768. NullFields []string `json:"-"`
  15769. }
  15770. func (s *NodeTemplatesScopedList) MarshalJSON() ([]byte, error) {
  15771. type NoMethod NodeTemplatesScopedList
  15772. raw := NoMethod(*s)
  15773. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  15774. }
  15775. // NodeTemplatesScopedListWarning: [Output Only] An informational
  15776. // warning that appears when the node templates list is empty.
  15777. type NodeTemplatesScopedListWarning struct {
  15778. // Code: [Output Only] A warning code, if applicable. For example,
  15779. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  15780. // the response.
  15781. //
  15782. // Possible values:
  15783. // "CLEANUP_FAILED"
  15784. // "DEPRECATED_RESOURCE_USED"
  15785. // "DEPRECATED_TYPE_USED"
  15786. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  15787. // "EXPERIMENTAL_TYPE_USED"
  15788. // "EXTERNAL_API_WARNING"
  15789. // "FIELD_VALUE_OVERRIDEN"
  15790. // "INJECTED_KERNELS_DEPRECATED"
  15791. // "MISSING_TYPE_DEPENDENCY"
  15792. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  15793. // "NEXT_HOP_CANNOT_IP_FORWARD"
  15794. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  15795. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  15796. // "NEXT_HOP_NOT_RUNNING"
  15797. // "NOT_CRITICAL_ERROR"
  15798. // "NO_RESULTS_ON_PAGE"
  15799. // "REQUIRED_TOS_AGREEMENT"
  15800. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  15801. // "RESOURCE_NOT_DELETED"
  15802. // "SCHEMA_VALIDATION_IGNORED"
  15803. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  15804. // "UNDECLARED_PROPERTIES"
  15805. // "UNREACHABLE"
  15806. Code string `json:"code,omitempty"`
  15807. // Data: [Output Only] Metadata about this warning in key: value format.
  15808. // For example:
  15809. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  15810. Data []*NodeTemplatesScopedListWarningData `json:"data,omitempty"`
  15811. // Message: [Output Only] A human-readable description of the warning
  15812. // code.
  15813. Message string `json:"message,omitempty"`
  15814. // ForceSendFields is a list of field names (e.g. "Code") to
  15815. // unconditionally include in API requests. By default, fields with
  15816. // empty values are omitted from API requests. However, any non-pointer,
  15817. // non-interface field appearing in ForceSendFields will be sent to the
  15818. // server regardless of whether the field is empty or not. This may be
  15819. // used to include empty fields in Patch requests.
  15820. ForceSendFields []string `json:"-"`
  15821. // NullFields is a list of field names (e.g. "Code") to include in API
  15822. // requests with the JSON null value. By default, fields with empty
  15823. // values are omitted from API requests. However, any field with an
  15824. // empty value appearing in NullFields will be sent to the server as
  15825. // null. It is an error if a field in this list has a non-empty value.
  15826. // This may be used to include null fields in Patch requests.
  15827. NullFields []string `json:"-"`
  15828. }
  15829. func (s *NodeTemplatesScopedListWarning) MarshalJSON() ([]byte, error) {
  15830. type NoMethod NodeTemplatesScopedListWarning
  15831. raw := NoMethod(*s)
  15832. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  15833. }
  15834. type NodeTemplatesScopedListWarningData struct {
  15835. // Key: [Output Only] A key that provides more detail on the warning
  15836. // being returned. For example, for warnings where there are no results
  15837. // in a list request for a particular zone, this key might be scope and
  15838. // the key value might be the zone name. Other examples might be a key
  15839. // indicating a deprecated resource and a suggested replacement, or a
  15840. // warning about invalid network settings (for example, if an instance
  15841. // attempts to perform IP forwarding but is not enabled for IP
  15842. // forwarding).
  15843. Key string `json:"key,omitempty"`
  15844. // Value: [Output Only] A warning data value corresponding to the key.
  15845. Value string `json:"value,omitempty"`
  15846. // ForceSendFields is a list of field names (e.g. "Key") to
  15847. // unconditionally include in API requests. By default, fields with
  15848. // empty values are omitted from API requests. However, any non-pointer,
  15849. // non-interface field appearing in ForceSendFields will be sent to the
  15850. // server regardless of whether the field is empty or not. This may be
  15851. // used to include empty fields in Patch requests.
  15852. ForceSendFields []string `json:"-"`
  15853. // NullFields is a list of field names (e.g. "Key") to include in API
  15854. // requests with the JSON null value. By default, fields with empty
  15855. // values are omitted from API requests. However, any field with an
  15856. // empty value appearing in NullFields will be sent to the server as
  15857. // null. It is an error if a field in this list has a non-empty value.
  15858. // This may be used to include null fields in Patch requests.
  15859. NullFields []string `json:"-"`
  15860. }
  15861. func (s *NodeTemplatesScopedListWarningData) MarshalJSON() ([]byte, error) {
  15862. type NoMethod NodeTemplatesScopedListWarningData
  15863. raw := NoMethod(*s)
  15864. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  15865. }
  15866. // NodeType: A Node Type resource.
  15867. type NodeType struct {
  15868. // CpuPlatform: [Output Only] The CPU platform used by this node type.
  15869. CpuPlatform string `json:"cpuPlatform,omitempty"`
  15870. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  15871. // format.
  15872. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  15873. // Deprecated: [Output Only] The deprecation status associated with this
  15874. // node type.
  15875. Deprecated *DeprecationStatus `json:"deprecated,omitempty"`
  15876. // Description: [Output Only] An optional textual description of the
  15877. // resource.
  15878. Description string `json:"description,omitempty"`
  15879. // GuestCpus: [Output Only] The number of virtual CPUs that are
  15880. // available to the node type.
  15881. GuestCpus int64 `json:"guestCpus,omitempty"`
  15882. // Id: [Output Only] The unique identifier for the resource. This
  15883. // identifier is defined by the server.
  15884. Id uint64 `json:"id,omitempty,string"`
  15885. // Kind: [Output Only] The type of the resource. Always compute#nodeType
  15886. // for node types.
  15887. Kind string `json:"kind,omitempty"`
  15888. // LocalSsdGb: [Output Only] Local SSD available to the node type,
  15889. // defined in GB.
  15890. LocalSsdGb int64 `json:"localSsdGb,omitempty"`
  15891. // MemoryMb: [Output Only] The amount of physical memory available to
  15892. // the node type, defined in MB.
  15893. MemoryMb int64 `json:"memoryMb,omitempty"`
  15894. // Name: [Output Only] Name of the resource.
  15895. Name string `json:"name,omitempty"`
  15896. // SelfLink: [Output Only] Server-defined URL for the resource.
  15897. SelfLink string `json:"selfLink,omitempty"`
  15898. // Zone: [Output Only] The name of the zone where the node type resides,
  15899. // such as us-central1-a.
  15900. Zone string `json:"zone,omitempty"`
  15901. // ServerResponse contains the HTTP response code and headers from the
  15902. // server.
  15903. googleapi.ServerResponse `json:"-"`
  15904. // ForceSendFields is a list of field names (e.g. "CpuPlatform") to
  15905. // unconditionally include in API requests. By default, fields with
  15906. // empty values are omitted from API requests. However, any non-pointer,
  15907. // non-interface field appearing in ForceSendFields will be sent to the
  15908. // server regardless of whether the field is empty or not. This may be
  15909. // used to include empty fields in Patch requests.
  15910. ForceSendFields []string `json:"-"`
  15911. // NullFields is a list of field names (e.g. "CpuPlatform") to include
  15912. // in API requests with the JSON null value. By default, fields with
  15913. // empty values are omitted from API requests. However, any field with
  15914. // an empty value appearing in NullFields will be sent to the server as
  15915. // null. It is an error if a field in this list has a non-empty value.
  15916. // This may be used to include null fields in Patch requests.
  15917. NullFields []string `json:"-"`
  15918. }
  15919. func (s *NodeType) MarshalJSON() ([]byte, error) {
  15920. type NoMethod NodeType
  15921. raw := NoMethod(*s)
  15922. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  15923. }
  15924. type NodeTypeAggregatedList struct {
  15925. // Id: [Output Only] Unique identifier for the resource; defined by the
  15926. // server.
  15927. Id string `json:"id,omitempty"`
  15928. // Items: A list of NodeTypesScopedList resources.
  15929. Items map[string]NodeTypesScopedList `json:"items,omitempty"`
  15930. // Kind: [Output Only] Type of resource.Always
  15931. // compute#nodeTypeAggregatedList for aggregated lists of node types.
  15932. Kind string `json:"kind,omitempty"`
  15933. // NextPageToken: [Output Only] This token allows you to get the next
  15934. // page of results for list requests. If the number of results is larger
  15935. // than maxResults, use the nextPageToken as a value for the query
  15936. // parameter pageToken in the next list request. Subsequent list
  15937. // requests will have their own nextPageToken to continue paging through
  15938. // the results.
  15939. NextPageToken string `json:"nextPageToken,omitempty"`
  15940. // SelfLink: [Output Only] Server-defined URL for this resource.
  15941. SelfLink string `json:"selfLink,omitempty"`
  15942. // Warning: [Output Only] Informational warning message.
  15943. Warning *NodeTypeAggregatedListWarning `json:"warning,omitempty"`
  15944. // ServerResponse contains the HTTP response code and headers from the
  15945. // server.
  15946. googleapi.ServerResponse `json:"-"`
  15947. // ForceSendFields is a list of field names (e.g. "Id") to
  15948. // unconditionally include in API requests. By default, fields with
  15949. // empty values are omitted from API requests. However, any non-pointer,
  15950. // non-interface field appearing in ForceSendFields will be sent to the
  15951. // server regardless of whether the field is empty or not. This may be
  15952. // used to include empty fields in Patch requests.
  15953. ForceSendFields []string `json:"-"`
  15954. // NullFields is a list of field names (e.g. "Id") to include in API
  15955. // requests with the JSON null value. By default, fields with empty
  15956. // values are omitted from API requests. However, any field with an
  15957. // empty value appearing in NullFields will be sent to the server as
  15958. // null. It is an error if a field in this list has a non-empty value.
  15959. // This may be used to include null fields in Patch requests.
  15960. NullFields []string `json:"-"`
  15961. }
  15962. func (s *NodeTypeAggregatedList) MarshalJSON() ([]byte, error) {
  15963. type NoMethod NodeTypeAggregatedList
  15964. raw := NoMethod(*s)
  15965. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  15966. }
  15967. // NodeTypeAggregatedListWarning: [Output Only] Informational warning
  15968. // message.
  15969. type NodeTypeAggregatedListWarning struct {
  15970. // Code: [Output Only] A warning code, if applicable. For example,
  15971. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  15972. // the response.
  15973. //
  15974. // Possible values:
  15975. // "CLEANUP_FAILED"
  15976. // "DEPRECATED_RESOURCE_USED"
  15977. // "DEPRECATED_TYPE_USED"
  15978. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  15979. // "EXPERIMENTAL_TYPE_USED"
  15980. // "EXTERNAL_API_WARNING"
  15981. // "FIELD_VALUE_OVERRIDEN"
  15982. // "INJECTED_KERNELS_DEPRECATED"
  15983. // "MISSING_TYPE_DEPENDENCY"
  15984. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  15985. // "NEXT_HOP_CANNOT_IP_FORWARD"
  15986. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  15987. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  15988. // "NEXT_HOP_NOT_RUNNING"
  15989. // "NOT_CRITICAL_ERROR"
  15990. // "NO_RESULTS_ON_PAGE"
  15991. // "REQUIRED_TOS_AGREEMENT"
  15992. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  15993. // "RESOURCE_NOT_DELETED"
  15994. // "SCHEMA_VALIDATION_IGNORED"
  15995. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  15996. // "UNDECLARED_PROPERTIES"
  15997. // "UNREACHABLE"
  15998. Code string `json:"code,omitempty"`
  15999. // Data: [Output Only] Metadata about this warning in key: value format.
  16000. // For example:
  16001. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  16002. Data []*NodeTypeAggregatedListWarningData `json:"data,omitempty"`
  16003. // Message: [Output Only] A human-readable description of the warning
  16004. // code.
  16005. Message string `json:"message,omitempty"`
  16006. // ForceSendFields is a list of field names (e.g. "Code") to
  16007. // unconditionally include in API requests. By default, fields with
  16008. // empty values are omitted from API requests. However, any non-pointer,
  16009. // non-interface field appearing in ForceSendFields will be sent to the
  16010. // server regardless of whether the field is empty or not. This may be
  16011. // used to include empty fields in Patch requests.
  16012. ForceSendFields []string `json:"-"`
  16013. // NullFields is a list of field names (e.g. "Code") to include in API
  16014. // requests with the JSON null value. By default, fields with empty
  16015. // values are omitted from API requests. However, any field with an
  16016. // empty value appearing in NullFields will be sent to the server as
  16017. // null. It is an error if a field in this list has a non-empty value.
  16018. // This may be used to include null fields in Patch requests.
  16019. NullFields []string `json:"-"`
  16020. }
  16021. func (s *NodeTypeAggregatedListWarning) MarshalJSON() ([]byte, error) {
  16022. type NoMethod NodeTypeAggregatedListWarning
  16023. raw := NoMethod(*s)
  16024. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  16025. }
  16026. type NodeTypeAggregatedListWarningData struct {
  16027. // Key: [Output Only] A key that provides more detail on the warning
  16028. // being returned. For example, for warnings where there are no results
  16029. // in a list request for a particular zone, this key might be scope and
  16030. // the key value might be the zone name. Other examples might be a key
  16031. // indicating a deprecated resource and a suggested replacement, or a
  16032. // warning about invalid network settings (for example, if an instance
  16033. // attempts to perform IP forwarding but is not enabled for IP
  16034. // forwarding).
  16035. Key string `json:"key,omitempty"`
  16036. // Value: [Output Only] A warning data value corresponding to the key.
  16037. Value string `json:"value,omitempty"`
  16038. // ForceSendFields is a list of field names (e.g. "Key") to
  16039. // unconditionally include in API requests. By default, fields with
  16040. // empty values are omitted from API requests. However, any non-pointer,
  16041. // non-interface field appearing in ForceSendFields will be sent to the
  16042. // server regardless of whether the field is empty or not. This may be
  16043. // used to include empty fields in Patch requests.
  16044. ForceSendFields []string `json:"-"`
  16045. // NullFields is a list of field names (e.g. "Key") to include in API
  16046. // requests with the JSON null value. By default, fields with empty
  16047. // values are omitted from API requests. However, any field with an
  16048. // empty value appearing in NullFields will be sent to the server as
  16049. // null. It is an error if a field in this list has a non-empty value.
  16050. // This may be used to include null fields in Patch requests.
  16051. NullFields []string `json:"-"`
  16052. }
  16053. func (s *NodeTypeAggregatedListWarningData) MarshalJSON() ([]byte, error) {
  16054. type NoMethod NodeTypeAggregatedListWarningData
  16055. raw := NoMethod(*s)
  16056. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  16057. }
  16058. // NodeTypeList: Contains a list of node types.
  16059. type NodeTypeList struct {
  16060. // Id: [Output Only] Unique identifier for the resource; defined by the
  16061. // server.
  16062. Id string `json:"id,omitempty"`
  16063. // Items: A list of NodeType resources.
  16064. Items []*NodeType `json:"items,omitempty"`
  16065. // Kind: [Output Only] Type of resource.Always compute#nodeTypeList for
  16066. // lists of node types.
  16067. Kind string `json:"kind,omitempty"`
  16068. // NextPageToken: [Output Only] This token allows you to get the next
  16069. // page of results for list requests. If the number of results is larger
  16070. // than maxResults, use the nextPageToken as a value for the query
  16071. // parameter pageToken in the next list request. Subsequent list
  16072. // requests will have their own nextPageToken to continue paging through
  16073. // the results.
  16074. NextPageToken string `json:"nextPageToken,omitempty"`
  16075. // SelfLink: [Output Only] Server-defined URL for this resource.
  16076. SelfLink string `json:"selfLink,omitempty"`
  16077. // Warning: [Output Only] Informational warning message.
  16078. Warning *NodeTypeListWarning `json:"warning,omitempty"`
  16079. // ServerResponse contains the HTTP response code and headers from the
  16080. // server.
  16081. googleapi.ServerResponse `json:"-"`
  16082. // ForceSendFields is a list of field names (e.g. "Id") to
  16083. // unconditionally include in API requests. By default, fields with
  16084. // empty values are omitted from API requests. However, any non-pointer,
  16085. // non-interface field appearing in ForceSendFields will be sent to the
  16086. // server regardless of whether the field is empty or not. This may be
  16087. // used to include empty fields in Patch requests.
  16088. ForceSendFields []string `json:"-"`
  16089. // NullFields is a list of field names (e.g. "Id") to include in API
  16090. // requests with the JSON null value. By default, fields with empty
  16091. // values are omitted from API requests. However, any field with an
  16092. // empty value appearing in NullFields will be sent to the server as
  16093. // null. It is an error if a field in this list has a non-empty value.
  16094. // This may be used to include null fields in Patch requests.
  16095. NullFields []string `json:"-"`
  16096. }
  16097. func (s *NodeTypeList) MarshalJSON() ([]byte, error) {
  16098. type NoMethod NodeTypeList
  16099. raw := NoMethod(*s)
  16100. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  16101. }
  16102. // NodeTypeListWarning: [Output Only] Informational warning message.
  16103. type NodeTypeListWarning struct {
  16104. // Code: [Output Only] A warning code, if applicable. For example,
  16105. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  16106. // the response.
  16107. //
  16108. // Possible values:
  16109. // "CLEANUP_FAILED"
  16110. // "DEPRECATED_RESOURCE_USED"
  16111. // "DEPRECATED_TYPE_USED"
  16112. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  16113. // "EXPERIMENTAL_TYPE_USED"
  16114. // "EXTERNAL_API_WARNING"
  16115. // "FIELD_VALUE_OVERRIDEN"
  16116. // "INJECTED_KERNELS_DEPRECATED"
  16117. // "MISSING_TYPE_DEPENDENCY"
  16118. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  16119. // "NEXT_HOP_CANNOT_IP_FORWARD"
  16120. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  16121. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  16122. // "NEXT_HOP_NOT_RUNNING"
  16123. // "NOT_CRITICAL_ERROR"
  16124. // "NO_RESULTS_ON_PAGE"
  16125. // "REQUIRED_TOS_AGREEMENT"
  16126. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  16127. // "RESOURCE_NOT_DELETED"
  16128. // "SCHEMA_VALIDATION_IGNORED"
  16129. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  16130. // "UNDECLARED_PROPERTIES"
  16131. // "UNREACHABLE"
  16132. Code string `json:"code,omitempty"`
  16133. // Data: [Output Only] Metadata about this warning in key: value format.
  16134. // For example:
  16135. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  16136. Data []*NodeTypeListWarningData `json:"data,omitempty"`
  16137. // Message: [Output Only] A human-readable description of the warning
  16138. // code.
  16139. Message string `json:"message,omitempty"`
  16140. // ForceSendFields is a list of field names (e.g. "Code") to
  16141. // unconditionally include in API requests. By default, fields with
  16142. // empty values are omitted from API requests. However, any non-pointer,
  16143. // non-interface field appearing in ForceSendFields will be sent to the
  16144. // server regardless of whether the field is empty or not. This may be
  16145. // used to include empty fields in Patch requests.
  16146. ForceSendFields []string `json:"-"`
  16147. // NullFields is a list of field names (e.g. "Code") to include in API
  16148. // requests with the JSON null value. By default, fields with empty
  16149. // values are omitted from API requests. However, any field with an
  16150. // empty value appearing in NullFields will be sent to the server as
  16151. // null. It is an error if a field in this list has a non-empty value.
  16152. // This may be used to include null fields in Patch requests.
  16153. NullFields []string `json:"-"`
  16154. }
  16155. func (s *NodeTypeListWarning) MarshalJSON() ([]byte, error) {
  16156. type NoMethod NodeTypeListWarning
  16157. raw := NoMethod(*s)
  16158. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  16159. }
  16160. type NodeTypeListWarningData struct {
  16161. // Key: [Output Only] A key that provides more detail on the warning
  16162. // being returned. For example, for warnings where there are no results
  16163. // in a list request for a particular zone, this key might be scope and
  16164. // the key value might be the zone name. Other examples might be a key
  16165. // indicating a deprecated resource and a suggested replacement, or a
  16166. // warning about invalid network settings (for example, if an instance
  16167. // attempts to perform IP forwarding but is not enabled for IP
  16168. // forwarding).
  16169. Key string `json:"key,omitempty"`
  16170. // Value: [Output Only] A warning data value corresponding to the key.
  16171. Value string `json:"value,omitempty"`
  16172. // ForceSendFields is a list of field names (e.g. "Key") to
  16173. // unconditionally include in API requests. By default, fields with
  16174. // empty values are omitted from API requests. However, any non-pointer,
  16175. // non-interface field appearing in ForceSendFields will be sent to the
  16176. // server regardless of whether the field is empty or not. This may be
  16177. // used to include empty fields in Patch requests.
  16178. ForceSendFields []string `json:"-"`
  16179. // NullFields is a list of field names (e.g. "Key") to include in API
  16180. // requests with the JSON null value. By default, fields with empty
  16181. // values are omitted from API requests. However, any field with an
  16182. // empty value appearing in NullFields will be sent to the server as
  16183. // null. It is an error if a field in this list has a non-empty value.
  16184. // This may be used to include null fields in Patch requests.
  16185. NullFields []string `json:"-"`
  16186. }
  16187. func (s *NodeTypeListWarningData) MarshalJSON() ([]byte, error) {
  16188. type NoMethod NodeTypeListWarningData
  16189. raw := NoMethod(*s)
  16190. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  16191. }
  16192. type NodeTypesScopedList struct {
  16193. // NodeTypes: [Output Only] A list of node types contained in this
  16194. // scope.
  16195. NodeTypes []*NodeType `json:"nodeTypes,omitempty"`
  16196. // Warning: [Output Only] An informational warning that appears when the
  16197. // node types list is empty.
  16198. Warning *NodeTypesScopedListWarning `json:"warning,omitempty"`
  16199. // ForceSendFields is a list of field names (e.g. "NodeTypes") to
  16200. // unconditionally include in API requests. By default, fields with
  16201. // empty values are omitted from API requests. However, any non-pointer,
  16202. // non-interface field appearing in ForceSendFields will be sent to the
  16203. // server regardless of whether the field is empty or not. This may be
  16204. // used to include empty fields in Patch requests.
  16205. ForceSendFields []string `json:"-"`
  16206. // NullFields is a list of field names (e.g. "NodeTypes") to include in
  16207. // API requests with the JSON null value. By default, fields with empty
  16208. // values are omitted from API requests. However, any field with an
  16209. // empty value appearing in NullFields will be sent to the server as
  16210. // null. It is an error if a field in this list has a non-empty value.
  16211. // This may be used to include null fields in Patch requests.
  16212. NullFields []string `json:"-"`
  16213. }
  16214. func (s *NodeTypesScopedList) MarshalJSON() ([]byte, error) {
  16215. type NoMethod NodeTypesScopedList
  16216. raw := NoMethod(*s)
  16217. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  16218. }
  16219. // NodeTypesScopedListWarning: [Output Only] An informational warning
  16220. // that appears when the node types list is empty.
  16221. type NodeTypesScopedListWarning struct {
  16222. // Code: [Output Only] A warning code, if applicable. For example,
  16223. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  16224. // the response.
  16225. //
  16226. // Possible values:
  16227. // "CLEANUP_FAILED"
  16228. // "DEPRECATED_RESOURCE_USED"
  16229. // "DEPRECATED_TYPE_USED"
  16230. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  16231. // "EXPERIMENTAL_TYPE_USED"
  16232. // "EXTERNAL_API_WARNING"
  16233. // "FIELD_VALUE_OVERRIDEN"
  16234. // "INJECTED_KERNELS_DEPRECATED"
  16235. // "MISSING_TYPE_DEPENDENCY"
  16236. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  16237. // "NEXT_HOP_CANNOT_IP_FORWARD"
  16238. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  16239. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  16240. // "NEXT_HOP_NOT_RUNNING"
  16241. // "NOT_CRITICAL_ERROR"
  16242. // "NO_RESULTS_ON_PAGE"
  16243. // "REQUIRED_TOS_AGREEMENT"
  16244. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  16245. // "RESOURCE_NOT_DELETED"
  16246. // "SCHEMA_VALIDATION_IGNORED"
  16247. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  16248. // "UNDECLARED_PROPERTIES"
  16249. // "UNREACHABLE"
  16250. Code string `json:"code,omitempty"`
  16251. // Data: [Output Only] Metadata about this warning in key: value format.
  16252. // For example:
  16253. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  16254. Data []*NodeTypesScopedListWarningData `json:"data,omitempty"`
  16255. // Message: [Output Only] A human-readable description of the warning
  16256. // code.
  16257. Message string `json:"message,omitempty"`
  16258. // ForceSendFields is a list of field names (e.g. "Code") to
  16259. // unconditionally include in API requests. By default, fields with
  16260. // empty values are omitted from API requests. However, any non-pointer,
  16261. // non-interface field appearing in ForceSendFields will be sent to the
  16262. // server regardless of whether the field is empty or not. This may be
  16263. // used to include empty fields in Patch requests.
  16264. ForceSendFields []string `json:"-"`
  16265. // NullFields is a list of field names (e.g. "Code") to include in API
  16266. // requests with the JSON null value. By default, fields with empty
  16267. // values are omitted from API requests. However, any field with an
  16268. // empty value appearing in NullFields will be sent to the server as
  16269. // null. It is an error if a field in this list has a non-empty value.
  16270. // This may be used to include null fields in Patch requests.
  16271. NullFields []string `json:"-"`
  16272. }
  16273. func (s *NodeTypesScopedListWarning) MarshalJSON() ([]byte, error) {
  16274. type NoMethod NodeTypesScopedListWarning
  16275. raw := NoMethod(*s)
  16276. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  16277. }
  16278. type NodeTypesScopedListWarningData struct {
  16279. // Key: [Output Only] A key that provides more detail on the warning
  16280. // being returned. For example, for warnings where there are no results
  16281. // in a list request for a particular zone, this key might be scope and
  16282. // the key value might be the zone name. Other examples might be a key
  16283. // indicating a deprecated resource and a suggested replacement, or a
  16284. // warning about invalid network settings (for example, if an instance
  16285. // attempts to perform IP forwarding but is not enabled for IP
  16286. // forwarding).
  16287. Key string `json:"key,omitempty"`
  16288. // Value: [Output Only] A warning data value corresponding to the key.
  16289. Value string `json:"value,omitempty"`
  16290. // ForceSendFields is a list of field names (e.g. "Key") to
  16291. // unconditionally include in API requests. By default, fields with
  16292. // empty values are omitted from API requests. However, any non-pointer,
  16293. // non-interface field appearing in ForceSendFields will be sent to the
  16294. // server regardless of whether the field is empty or not. This may be
  16295. // used to include empty fields in Patch requests.
  16296. ForceSendFields []string `json:"-"`
  16297. // NullFields is a list of field names (e.g. "Key") to include in API
  16298. // requests with the JSON null value. By default, fields with empty
  16299. // values are omitted from API requests. However, any field with an
  16300. // empty value appearing in NullFields will be sent to the server as
  16301. // null. It is an error if a field in this list has a non-empty value.
  16302. // This may be used to include null fields in Patch requests.
  16303. NullFields []string `json:"-"`
  16304. }
  16305. func (s *NodeTypesScopedListWarningData) MarshalJSON() ([]byte, error) {
  16306. type NoMethod NodeTypesScopedListWarningData
  16307. raw := NoMethod(*s)
  16308. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  16309. }
  16310. // Operation: An Operation resource, used to manage asynchronous API
  16311. // requests. (== resource_for v1.globalOperations ==) (== resource_for
  16312. // beta.globalOperations ==) (== resource_for v1.regionOperations ==)
  16313. // (== resource_for beta.regionOperations ==) (== resource_for
  16314. // v1.zoneOperations ==) (== resource_for beta.zoneOperations ==)
  16315. type Operation struct {
  16316. // ClientOperationId: [Output Only] The value of `requestId` if you
  16317. // provided it in the request. Not present otherwise.
  16318. ClientOperationId string `json:"clientOperationId,omitempty"`
  16319. // CreationTimestamp: [Deprecated] This field is deprecated.
  16320. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  16321. // Description: [Output Only] A textual description of the operation,
  16322. // which is set when the operation is created.
  16323. Description string `json:"description,omitempty"`
  16324. // EndTime: [Output Only] The time that this operation was completed.
  16325. // This value is in RFC3339 text format.
  16326. EndTime string `json:"endTime,omitempty"`
  16327. // Error: [Output Only] If errors are generated during processing of the
  16328. // operation, this field will be populated.
  16329. Error *OperationError `json:"error,omitempty"`
  16330. // HttpErrorMessage: [Output Only] If the operation fails, this field
  16331. // contains the HTTP error message that was returned, such as NOT FOUND.
  16332. HttpErrorMessage string `json:"httpErrorMessage,omitempty"`
  16333. // HttpErrorStatusCode: [Output Only] If the operation fails, this field
  16334. // contains the HTTP error status code that was returned. For example, a
  16335. // 404 means the resource was not found.
  16336. HttpErrorStatusCode int64 `json:"httpErrorStatusCode,omitempty"`
  16337. // Id: [Output Only] The unique identifier for the resource. This
  16338. // identifier is defined by the server.
  16339. Id uint64 `json:"id,omitempty,string"`
  16340. // InsertTime: [Output Only] The time that this operation was requested.
  16341. // This value is in RFC3339 text format.
  16342. InsertTime string `json:"insertTime,omitempty"`
  16343. // Kind: [Output Only] Type of the resource. Always compute#operation
  16344. // for Operation resources.
  16345. Kind string `json:"kind,omitempty"`
  16346. // Name: [Output Only] Name of the resource.
  16347. Name string `json:"name,omitempty"`
  16348. // OperationType: [Output Only] The type of operation, such as insert,
  16349. // update, or delete, and so on.
  16350. OperationType string `json:"operationType,omitempty"`
  16351. // Progress: [Output Only] An optional progress indicator that ranges
  16352. // from 0 to 100. There is no requirement that this be linear or support
  16353. // any granularity of operations. This should not be used to guess when
  16354. // the operation will be complete. This number should monotonically
  16355. // increase as the operation progresses.
  16356. Progress int64 `json:"progress,omitempty"`
  16357. // Region: [Output Only] The URL of the region where the operation
  16358. // resides. Only available when performing regional operations. You must
  16359. // specify this field as part of the HTTP request URL. It is not
  16360. // settable as a field in the request body.
  16361. Region string `json:"region,omitempty"`
  16362. // SelfLink: [Output Only] Server-defined URL for the resource.
  16363. SelfLink string `json:"selfLink,omitempty"`
  16364. // StartTime: [Output Only] The time that this operation was started by
  16365. // the server. This value is in RFC3339 text format.
  16366. StartTime string `json:"startTime,omitempty"`
  16367. // Status: [Output Only] The status of the operation, which can be one
  16368. // of the following: PENDING, RUNNING, or DONE.
  16369. //
  16370. // Possible values:
  16371. // "DONE"
  16372. // "PENDING"
  16373. // "RUNNING"
  16374. Status string `json:"status,omitempty"`
  16375. // StatusMessage: [Output Only] An optional textual description of the
  16376. // current status of the operation.
  16377. StatusMessage string `json:"statusMessage,omitempty"`
  16378. // TargetId: [Output Only] The unique target ID, which identifies a
  16379. // specific incarnation of the target resource.
  16380. TargetId uint64 `json:"targetId,omitempty,string"`
  16381. // TargetLink: [Output Only] The URL of the resource that the operation
  16382. // modifies. For operations related to creating a snapshot, this points
  16383. // to the persistent disk that the snapshot was created from.
  16384. TargetLink string `json:"targetLink,omitempty"`
  16385. // User: [Output Only] User who requested the operation, for example:
  16386. // user@example.com.
  16387. User string `json:"user,omitempty"`
  16388. // Warnings: [Output Only] If warning messages are generated during
  16389. // processing of the operation, this field will be populated.
  16390. Warnings []*OperationWarnings `json:"warnings,omitempty"`
  16391. // Zone: [Output Only] The URL of the zone where the operation resides.
  16392. // Only available when performing per-zone operations. You must specify
  16393. // this field as part of the HTTP request URL. It is not settable as a
  16394. // field in the request body.
  16395. Zone string `json:"zone,omitempty"`
  16396. // ServerResponse contains the HTTP response code and headers from the
  16397. // server.
  16398. googleapi.ServerResponse `json:"-"`
  16399. // ForceSendFields is a list of field names (e.g. "ClientOperationId")
  16400. // to unconditionally include in API requests. By default, fields with
  16401. // empty values are omitted from API requests. However, any non-pointer,
  16402. // non-interface field appearing in ForceSendFields will be sent to the
  16403. // server regardless of whether the field is empty or not. This may be
  16404. // used to include empty fields in Patch requests.
  16405. ForceSendFields []string `json:"-"`
  16406. // NullFields is a list of field names (e.g. "ClientOperationId") to
  16407. // include in API requests with the JSON null value. By default, fields
  16408. // with empty values are omitted from API requests. However, any field
  16409. // with an empty value appearing in NullFields will be sent to the
  16410. // server as null. It is an error if a field in this list has a
  16411. // non-empty value. This may be used to include null fields in Patch
  16412. // requests.
  16413. NullFields []string `json:"-"`
  16414. }
  16415. func (s *Operation) MarshalJSON() ([]byte, error) {
  16416. type NoMethod Operation
  16417. raw := NoMethod(*s)
  16418. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  16419. }
  16420. // OperationError: [Output Only] If errors are generated during
  16421. // processing of the operation, this field will be populated.
  16422. type OperationError struct {
  16423. // Errors: [Output Only] The array of errors encountered while
  16424. // processing this operation.
  16425. Errors []*OperationErrorErrors `json:"errors,omitempty"`
  16426. // ForceSendFields is a list of field names (e.g. "Errors") to
  16427. // unconditionally include in API requests. By default, fields with
  16428. // empty values are omitted from API requests. However, any non-pointer,
  16429. // non-interface field appearing in ForceSendFields will be sent to the
  16430. // server regardless of whether the field is empty or not. This may be
  16431. // used to include empty fields in Patch requests.
  16432. ForceSendFields []string `json:"-"`
  16433. // NullFields is a list of field names (e.g. "Errors") to include in API
  16434. // requests with the JSON null value. By default, fields with empty
  16435. // values are omitted from API requests. However, any field with an
  16436. // empty value appearing in NullFields will be sent to the server as
  16437. // null. It is an error if a field in this list has a non-empty value.
  16438. // This may be used to include null fields in Patch requests.
  16439. NullFields []string `json:"-"`
  16440. }
  16441. func (s *OperationError) MarshalJSON() ([]byte, error) {
  16442. type NoMethod OperationError
  16443. raw := NoMethod(*s)
  16444. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  16445. }
  16446. type OperationErrorErrors struct {
  16447. // Code: [Output Only] The error type identifier for this error.
  16448. Code string `json:"code,omitempty"`
  16449. // Location: [Output Only] Indicates the field in the request that
  16450. // caused the error. This property is optional.
  16451. Location string `json:"location,omitempty"`
  16452. // Message: [Output Only] An optional, human-readable error message.
  16453. Message string `json:"message,omitempty"`
  16454. // ForceSendFields is a list of field names (e.g. "Code") to
  16455. // unconditionally include in API requests. By default, fields with
  16456. // empty values are omitted from API requests. However, any non-pointer,
  16457. // non-interface field appearing in ForceSendFields will be sent to the
  16458. // server regardless of whether the field is empty or not. This may be
  16459. // used to include empty fields in Patch requests.
  16460. ForceSendFields []string `json:"-"`
  16461. // NullFields is a list of field names (e.g. "Code") to include in API
  16462. // requests with the JSON null value. By default, fields with empty
  16463. // values are omitted from API requests. However, any field with an
  16464. // empty value appearing in NullFields will be sent to the server as
  16465. // null. It is an error if a field in this list has a non-empty value.
  16466. // This may be used to include null fields in Patch requests.
  16467. NullFields []string `json:"-"`
  16468. }
  16469. func (s *OperationErrorErrors) MarshalJSON() ([]byte, error) {
  16470. type NoMethod OperationErrorErrors
  16471. raw := NoMethod(*s)
  16472. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  16473. }
  16474. type OperationWarnings struct {
  16475. // Code: [Output Only] A warning code, if applicable. For example,
  16476. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  16477. // the response.
  16478. //
  16479. // Possible values:
  16480. // "CLEANUP_FAILED"
  16481. // "DEPRECATED_RESOURCE_USED"
  16482. // "DEPRECATED_TYPE_USED"
  16483. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  16484. // "EXPERIMENTAL_TYPE_USED"
  16485. // "EXTERNAL_API_WARNING"
  16486. // "FIELD_VALUE_OVERRIDEN"
  16487. // "INJECTED_KERNELS_DEPRECATED"
  16488. // "MISSING_TYPE_DEPENDENCY"
  16489. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  16490. // "NEXT_HOP_CANNOT_IP_FORWARD"
  16491. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  16492. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  16493. // "NEXT_HOP_NOT_RUNNING"
  16494. // "NOT_CRITICAL_ERROR"
  16495. // "NO_RESULTS_ON_PAGE"
  16496. // "REQUIRED_TOS_AGREEMENT"
  16497. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  16498. // "RESOURCE_NOT_DELETED"
  16499. // "SCHEMA_VALIDATION_IGNORED"
  16500. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  16501. // "UNDECLARED_PROPERTIES"
  16502. // "UNREACHABLE"
  16503. Code string `json:"code,omitempty"`
  16504. // Data: [Output Only] Metadata about this warning in key: value format.
  16505. // For example:
  16506. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  16507. Data []*OperationWarningsData `json:"data,omitempty"`
  16508. // Message: [Output Only] A human-readable description of the warning
  16509. // code.
  16510. Message string `json:"message,omitempty"`
  16511. // ForceSendFields is a list of field names (e.g. "Code") to
  16512. // unconditionally include in API requests. By default, fields with
  16513. // empty values are omitted from API requests. However, any non-pointer,
  16514. // non-interface field appearing in ForceSendFields will be sent to the
  16515. // server regardless of whether the field is empty or not. This may be
  16516. // used to include empty fields in Patch requests.
  16517. ForceSendFields []string `json:"-"`
  16518. // NullFields is a list of field names (e.g. "Code") to include in API
  16519. // requests with the JSON null value. By default, fields with empty
  16520. // values are omitted from API requests. However, any field with an
  16521. // empty value appearing in NullFields will be sent to the server as
  16522. // null. It is an error if a field in this list has a non-empty value.
  16523. // This may be used to include null fields in Patch requests.
  16524. NullFields []string `json:"-"`
  16525. }
  16526. func (s *OperationWarnings) MarshalJSON() ([]byte, error) {
  16527. type NoMethod OperationWarnings
  16528. raw := NoMethod(*s)
  16529. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  16530. }
  16531. type OperationWarningsData struct {
  16532. // Key: [Output Only] A key that provides more detail on the warning
  16533. // being returned. For example, for warnings where there are no results
  16534. // in a list request for a particular zone, this key might be scope and
  16535. // the key value might be the zone name. Other examples might be a key
  16536. // indicating a deprecated resource and a suggested replacement, or a
  16537. // warning about invalid network settings (for example, if an instance
  16538. // attempts to perform IP forwarding but is not enabled for IP
  16539. // forwarding).
  16540. Key string `json:"key,omitempty"`
  16541. // Value: [Output Only] A warning data value corresponding to the key.
  16542. Value string `json:"value,omitempty"`
  16543. // ForceSendFields is a list of field names (e.g. "Key") 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. "Key") to include in API
  16551. // requests with the JSON null value. By default, fields with empty
  16552. // values are omitted from API requests. However, any field with an
  16553. // empty value appearing in NullFields will be sent to the server as
  16554. // null. It is an error if a field in this list has a non-empty value.
  16555. // This may be used to include null fields in Patch requests.
  16556. NullFields []string `json:"-"`
  16557. }
  16558. func (s *OperationWarningsData) MarshalJSON() ([]byte, error) {
  16559. type NoMethod OperationWarningsData
  16560. raw := NoMethod(*s)
  16561. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  16562. }
  16563. type OperationAggregatedList struct {
  16564. // Id: [Output Only] The unique identifier for the resource. This
  16565. // identifier is defined by the server.
  16566. Id string `json:"id,omitempty"`
  16567. // Items: [Output Only] A map of scoped operation lists.
  16568. Items map[string]OperationsScopedList `json:"items,omitempty"`
  16569. // Kind: [Output Only] Type of resource. Always
  16570. // compute#operationAggregatedList for aggregated lists of operations.
  16571. Kind string `json:"kind,omitempty"`
  16572. // NextPageToken: [Output Only] This token allows you to get the next
  16573. // page of results for list requests. If the number of results is larger
  16574. // than maxResults, use the nextPageToken as a value for the query
  16575. // parameter pageToken in the next list request. Subsequent list
  16576. // requests will have their own nextPageToken to continue paging through
  16577. // the results.
  16578. NextPageToken string `json:"nextPageToken,omitempty"`
  16579. // SelfLink: [Output Only] Server-defined URL for this resource.
  16580. SelfLink string `json:"selfLink,omitempty"`
  16581. // Warning: [Output Only] Informational warning message.
  16582. Warning *OperationAggregatedListWarning `json:"warning,omitempty"`
  16583. // ServerResponse contains the HTTP response code and headers from the
  16584. // server.
  16585. googleapi.ServerResponse `json:"-"`
  16586. // ForceSendFields is a list of field names (e.g. "Id") to
  16587. // unconditionally include in API requests. By default, fields with
  16588. // empty values are omitted from API requests. However, any non-pointer,
  16589. // non-interface field appearing in ForceSendFields will be sent to the
  16590. // server regardless of whether the field is empty or not. This may be
  16591. // used to include empty fields in Patch requests.
  16592. ForceSendFields []string `json:"-"`
  16593. // NullFields is a list of field names (e.g. "Id") to include in API
  16594. // requests with the JSON null value. By default, fields with empty
  16595. // values are omitted from API requests. However, any field with an
  16596. // empty value appearing in NullFields will be sent to the server as
  16597. // null. It is an error if a field in this list has a non-empty value.
  16598. // This may be used to include null fields in Patch requests.
  16599. NullFields []string `json:"-"`
  16600. }
  16601. func (s *OperationAggregatedList) MarshalJSON() ([]byte, error) {
  16602. type NoMethod OperationAggregatedList
  16603. raw := NoMethod(*s)
  16604. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  16605. }
  16606. // OperationAggregatedListWarning: [Output Only] Informational warning
  16607. // message.
  16608. type OperationAggregatedListWarning struct {
  16609. // Code: [Output Only] A warning code, if applicable. For example,
  16610. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  16611. // the response.
  16612. //
  16613. // Possible values:
  16614. // "CLEANUP_FAILED"
  16615. // "DEPRECATED_RESOURCE_USED"
  16616. // "DEPRECATED_TYPE_USED"
  16617. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  16618. // "EXPERIMENTAL_TYPE_USED"
  16619. // "EXTERNAL_API_WARNING"
  16620. // "FIELD_VALUE_OVERRIDEN"
  16621. // "INJECTED_KERNELS_DEPRECATED"
  16622. // "MISSING_TYPE_DEPENDENCY"
  16623. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  16624. // "NEXT_HOP_CANNOT_IP_FORWARD"
  16625. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  16626. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  16627. // "NEXT_HOP_NOT_RUNNING"
  16628. // "NOT_CRITICAL_ERROR"
  16629. // "NO_RESULTS_ON_PAGE"
  16630. // "REQUIRED_TOS_AGREEMENT"
  16631. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  16632. // "RESOURCE_NOT_DELETED"
  16633. // "SCHEMA_VALIDATION_IGNORED"
  16634. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  16635. // "UNDECLARED_PROPERTIES"
  16636. // "UNREACHABLE"
  16637. Code string `json:"code,omitempty"`
  16638. // Data: [Output Only] Metadata about this warning in key: value format.
  16639. // For example:
  16640. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  16641. Data []*OperationAggregatedListWarningData `json:"data,omitempty"`
  16642. // Message: [Output Only] A human-readable description of the warning
  16643. // code.
  16644. Message string `json:"message,omitempty"`
  16645. // ForceSendFields is a list of field names (e.g. "Code") to
  16646. // unconditionally include in API requests. By default, fields with
  16647. // empty values are omitted from API requests. However, any non-pointer,
  16648. // non-interface field appearing in ForceSendFields will be sent to the
  16649. // server regardless of whether the field is empty or not. This may be
  16650. // used to include empty fields in Patch requests.
  16651. ForceSendFields []string `json:"-"`
  16652. // NullFields is a list of field names (e.g. "Code") to include in API
  16653. // requests with the JSON null value. By default, fields with empty
  16654. // values are omitted from API requests. However, any field with an
  16655. // empty value appearing in NullFields will be sent to the server as
  16656. // null. It is an error if a field in this list has a non-empty value.
  16657. // This may be used to include null fields in Patch requests.
  16658. NullFields []string `json:"-"`
  16659. }
  16660. func (s *OperationAggregatedListWarning) MarshalJSON() ([]byte, error) {
  16661. type NoMethod OperationAggregatedListWarning
  16662. raw := NoMethod(*s)
  16663. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  16664. }
  16665. type OperationAggregatedListWarningData struct {
  16666. // Key: [Output Only] A key that provides more detail on the warning
  16667. // being returned. For example, for warnings where there are no results
  16668. // in a list request for a particular zone, this key might be scope and
  16669. // the key value might be the zone name. Other examples might be a key
  16670. // indicating a deprecated resource and a suggested replacement, or a
  16671. // warning about invalid network settings (for example, if an instance
  16672. // attempts to perform IP forwarding but is not enabled for IP
  16673. // forwarding).
  16674. Key string `json:"key,omitempty"`
  16675. // Value: [Output Only] A warning data value corresponding to the key.
  16676. Value string `json:"value,omitempty"`
  16677. // ForceSendFields is a list of field names (e.g. "Key") to
  16678. // unconditionally include in API requests. By default, fields with
  16679. // empty values are omitted from API requests. However, any non-pointer,
  16680. // non-interface field appearing in ForceSendFields will be sent to the
  16681. // server regardless of whether the field is empty or not. This may be
  16682. // used to include empty fields in Patch requests.
  16683. ForceSendFields []string `json:"-"`
  16684. // NullFields is a list of field names (e.g. "Key") to include in API
  16685. // requests with the JSON null value. By default, fields with empty
  16686. // values are omitted from API requests. However, any field with an
  16687. // empty value appearing in NullFields will be sent to the server as
  16688. // null. It is an error if a field in this list has a non-empty value.
  16689. // This may be used to include null fields in Patch requests.
  16690. NullFields []string `json:"-"`
  16691. }
  16692. func (s *OperationAggregatedListWarningData) MarshalJSON() ([]byte, error) {
  16693. type NoMethod OperationAggregatedListWarningData
  16694. raw := NoMethod(*s)
  16695. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  16696. }
  16697. // OperationList: Contains a list of Operation resources.
  16698. type OperationList struct {
  16699. // Id: [Output Only] The unique identifier for the resource. This
  16700. // identifier is defined by the server.
  16701. Id string `json:"id,omitempty"`
  16702. // Items: [Output Only] A list of Operation resources.
  16703. Items []*Operation `json:"items,omitempty"`
  16704. // Kind: [Output Only] Type of resource. Always compute#operations for
  16705. // Operations resource.
  16706. Kind string `json:"kind,omitempty"`
  16707. // NextPageToken: [Output Only] This token allows you to get the next
  16708. // page of results for list requests. If the number of results is larger
  16709. // than maxResults, use the nextPageToken as a value for the query
  16710. // parameter pageToken in the next list request. Subsequent list
  16711. // requests will have their own nextPageToken to continue paging through
  16712. // the results.
  16713. NextPageToken string `json:"nextPageToken,omitempty"`
  16714. // SelfLink: [Output Only] Server-defined URL for this resource.
  16715. SelfLink string `json:"selfLink,omitempty"`
  16716. // Warning: [Output Only] Informational warning message.
  16717. Warning *OperationListWarning `json:"warning,omitempty"`
  16718. // ServerResponse contains the HTTP response code and headers from the
  16719. // server.
  16720. googleapi.ServerResponse `json:"-"`
  16721. // ForceSendFields is a list of field names (e.g. "Id") to
  16722. // unconditionally include in API requests. By default, fields with
  16723. // empty values are omitted from API requests. However, any non-pointer,
  16724. // non-interface field appearing in ForceSendFields will be sent to the
  16725. // server regardless of whether the field is empty or not. This may be
  16726. // used to include empty fields in Patch requests.
  16727. ForceSendFields []string `json:"-"`
  16728. // NullFields is a list of field names (e.g. "Id") to include in API
  16729. // requests with the JSON null value. By default, fields with empty
  16730. // values are omitted from API requests. However, any field with an
  16731. // empty value appearing in NullFields will be sent to the server as
  16732. // null. It is an error if a field in this list has a non-empty value.
  16733. // This may be used to include null fields in Patch requests.
  16734. NullFields []string `json:"-"`
  16735. }
  16736. func (s *OperationList) MarshalJSON() ([]byte, error) {
  16737. type NoMethod OperationList
  16738. raw := NoMethod(*s)
  16739. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  16740. }
  16741. // OperationListWarning: [Output Only] Informational warning message.
  16742. type OperationListWarning struct {
  16743. // Code: [Output Only] A warning code, if applicable. For example,
  16744. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  16745. // the response.
  16746. //
  16747. // Possible values:
  16748. // "CLEANUP_FAILED"
  16749. // "DEPRECATED_RESOURCE_USED"
  16750. // "DEPRECATED_TYPE_USED"
  16751. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  16752. // "EXPERIMENTAL_TYPE_USED"
  16753. // "EXTERNAL_API_WARNING"
  16754. // "FIELD_VALUE_OVERRIDEN"
  16755. // "INJECTED_KERNELS_DEPRECATED"
  16756. // "MISSING_TYPE_DEPENDENCY"
  16757. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  16758. // "NEXT_HOP_CANNOT_IP_FORWARD"
  16759. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  16760. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  16761. // "NEXT_HOP_NOT_RUNNING"
  16762. // "NOT_CRITICAL_ERROR"
  16763. // "NO_RESULTS_ON_PAGE"
  16764. // "REQUIRED_TOS_AGREEMENT"
  16765. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  16766. // "RESOURCE_NOT_DELETED"
  16767. // "SCHEMA_VALIDATION_IGNORED"
  16768. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  16769. // "UNDECLARED_PROPERTIES"
  16770. // "UNREACHABLE"
  16771. Code string `json:"code,omitempty"`
  16772. // Data: [Output Only] Metadata about this warning in key: value format.
  16773. // For example:
  16774. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  16775. Data []*OperationListWarningData `json:"data,omitempty"`
  16776. // Message: [Output Only] A human-readable description of the warning
  16777. // code.
  16778. Message string `json:"message,omitempty"`
  16779. // ForceSendFields is a list of field names (e.g. "Code") to
  16780. // unconditionally include in API requests. By default, fields with
  16781. // empty values are omitted from API requests. However, any non-pointer,
  16782. // non-interface field appearing in ForceSendFields will be sent to the
  16783. // server regardless of whether the field is empty or not. This may be
  16784. // used to include empty fields in Patch requests.
  16785. ForceSendFields []string `json:"-"`
  16786. // NullFields is a list of field names (e.g. "Code") to include in API
  16787. // requests with the JSON null value. By default, fields with empty
  16788. // values are omitted from API requests. However, any field with an
  16789. // empty value appearing in NullFields will be sent to the server as
  16790. // null. It is an error if a field in this list has a non-empty value.
  16791. // This may be used to include null fields in Patch requests.
  16792. NullFields []string `json:"-"`
  16793. }
  16794. func (s *OperationListWarning) MarshalJSON() ([]byte, error) {
  16795. type NoMethod OperationListWarning
  16796. raw := NoMethod(*s)
  16797. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  16798. }
  16799. type OperationListWarningData struct {
  16800. // Key: [Output Only] A key that provides more detail on the warning
  16801. // being returned. For example, for warnings where there are no results
  16802. // in a list request for a particular zone, this key might be scope and
  16803. // the key value might be the zone name. Other examples might be a key
  16804. // indicating a deprecated resource and a suggested replacement, or a
  16805. // warning about invalid network settings (for example, if an instance
  16806. // attempts to perform IP forwarding but is not enabled for IP
  16807. // forwarding).
  16808. Key string `json:"key,omitempty"`
  16809. // Value: [Output Only] A warning data value corresponding to the key.
  16810. Value string `json:"value,omitempty"`
  16811. // ForceSendFields is a list of field names (e.g. "Key") to
  16812. // unconditionally include in API requests. By default, fields with
  16813. // empty values are omitted from API requests. However, any non-pointer,
  16814. // non-interface field appearing in ForceSendFields will be sent to the
  16815. // server regardless of whether the field is empty or not. This may be
  16816. // used to include empty fields in Patch requests.
  16817. ForceSendFields []string `json:"-"`
  16818. // NullFields is a list of field names (e.g. "Key") to include in API
  16819. // requests with the JSON null value. By default, fields with empty
  16820. // values are omitted from API requests. However, any field with an
  16821. // empty value appearing in NullFields will be sent to the server as
  16822. // null. It is an error if a field in this list has a non-empty value.
  16823. // This may be used to include null fields in Patch requests.
  16824. NullFields []string `json:"-"`
  16825. }
  16826. func (s *OperationListWarningData) MarshalJSON() ([]byte, error) {
  16827. type NoMethod OperationListWarningData
  16828. raw := NoMethod(*s)
  16829. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  16830. }
  16831. type OperationsScopedList struct {
  16832. // Operations: [Output Only] A list of operations contained in this
  16833. // scope.
  16834. Operations []*Operation `json:"operations,omitempty"`
  16835. // Warning: [Output Only] Informational warning which replaces the list
  16836. // of operations when the list is empty.
  16837. Warning *OperationsScopedListWarning `json:"warning,omitempty"`
  16838. // ForceSendFields is a list of field names (e.g. "Operations") to
  16839. // unconditionally include in API requests. By default, fields with
  16840. // empty values are omitted from API requests. However, any non-pointer,
  16841. // non-interface field appearing in ForceSendFields will be sent to the
  16842. // server regardless of whether the field is empty or not. This may be
  16843. // used to include empty fields in Patch requests.
  16844. ForceSendFields []string `json:"-"`
  16845. // NullFields is a list of field names (e.g. "Operations") to include in
  16846. // API requests with the JSON null value. By default, fields with empty
  16847. // values are omitted from API requests. However, any field with an
  16848. // empty value appearing in NullFields will be sent to the server as
  16849. // null. It is an error if a field in this list has a non-empty value.
  16850. // This may be used to include null fields in Patch requests.
  16851. NullFields []string `json:"-"`
  16852. }
  16853. func (s *OperationsScopedList) MarshalJSON() ([]byte, error) {
  16854. type NoMethod OperationsScopedList
  16855. raw := NoMethod(*s)
  16856. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  16857. }
  16858. // OperationsScopedListWarning: [Output Only] Informational warning
  16859. // which replaces the list of operations when the list is empty.
  16860. type OperationsScopedListWarning struct {
  16861. // Code: [Output Only] A warning code, if applicable. For example,
  16862. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  16863. // the response.
  16864. //
  16865. // Possible values:
  16866. // "CLEANUP_FAILED"
  16867. // "DEPRECATED_RESOURCE_USED"
  16868. // "DEPRECATED_TYPE_USED"
  16869. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  16870. // "EXPERIMENTAL_TYPE_USED"
  16871. // "EXTERNAL_API_WARNING"
  16872. // "FIELD_VALUE_OVERRIDEN"
  16873. // "INJECTED_KERNELS_DEPRECATED"
  16874. // "MISSING_TYPE_DEPENDENCY"
  16875. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  16876. // "NEXT_HOP_CANNOT_IP_FORWARD"
  16877. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  16878. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  16879. // "NEXT_HOP_NOT_RUNNING"
  16880. // "NOT_CRITICAL_ERROR"
  16881. // "NO_RESULTS_ON_PAGE"
  16882. // "REQUIRED_TOS_AGREEMENT"
  16883. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  16884. // "RESOURCE_NOT_DELETED"
  16885. // "SCHEMA_VALIDATION_IGNORED"
  16886. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  16887. // "UNDECLARED_PROPERTIES"
  16888. // "UNREACHABLE"
  16889. Code string `json:"code,omitempty"`
  16890. // Data: [Output Only] Metadata about this warning in key: value format.
  16891. // For example:
  16892. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  16893. Data []*OperationsScopedListWarningData `json:"data,omitempty"`
  16894. // Message: [Output Only] A human-readable description of the warning
  16895. // code.
  16896. Message string `json:"message,omitempty"`
  16897. // ForceSendFields is a list of field names (e.g. "Code") to
  16898. // unconditionally include in API requests. By default, fields with
  16899. // empty values are omitted from API requests. However, any non-pointer,
  16900. // non-interface field appearing in ForceSendFields will be sent to the
  16901. // server regardless of whether the field is empty or not. This may be
  16902. // used to include empty fields in Patch requests.
  16903. ForceSendFields []string `json:"-"`
  16904. // NullFields is a list of field names (e.g. "Code") to include in API
  16905. // requests with the JSON null value. By default, fields with empty
  16906. // values are omitted from API requests. However, any field with an
  16907. // empty value appearing in NullFields will be sent to the server as
  16908. // null. It is an error if a field in this list has a non-empty value.
  16909. // This may be used to include null fields in Patch requests.
  16910. NullFields []string `json:"-"`
  16911. }
  16912. func (s *OperationsScopedListWarning) MarshalJSON() ([]byte, error) {
  16913. type NoMethod OperationsScopedListWarning
  16914. raw := NoMethod(*s)
  16915. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  16916. }
  16917. type OperationsScopedListWarningData struct {
  16918. // Key: [Output Only] A key that provides more detail on the warning
  16919. // being returned. For example, for warnings where there are no results
  16920. // in a list request for a particular zone, this key might be scope and
  16921. // the key value might be the zone name. Other examples might be a key
  16922. // indicating a deprecated resource and a suggested replacement, or a
  16923. // warning about invalid network settings (for example, if an instance
  16924. // attempts to perform IP forwarding but is not enabled for IP
  16925. // forwarding).
  16926. Key string `json:"key,omitempty"`
  16927. // Value: [Output Only] A warning data value corresponding to the key.
  16928. Value string `json:"value,omitempty"`
  16929. // ForceSendFields is a list of field names (e.g. "Key") to
  16930. // unconditionally include in API requests. By default, fields with
  16931. // empty values are omitted from API requests. However, any non-pointer,
  16932. // non-interface field appearing in ForceSendFields will be sent to the
  16933. // server regardless of whether the field is empty or not. This may be
  16934. // used to include empty fields in Patch requests.
  16935. ForceSendFields []string `json:"-"`
  16936. // NullFields is a list of field names (e.g. "Key") to include in API
  16937. // requests with the JSON null value. By default, fields with empty
  16938. // values are omitted from API requests. However, any field with an
  16939. // empty value appearing in NullFields will be sent to the server as
  16940. // null. It is an error if a field in this list has a non-empty value.
  16941. // This may be used to include null fields in Patch requests.
  16942. NullFields []string `json:"-"`
  16943. }
  16944. func (s *OperationsScopedListWarningData) MarshalJSON() ([]byte, error) {
  16945. type NoMethod OperationsScopedListWarningData
  16946. raw := NoMethod(*s)
  16947. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  16948. }
  16949. // PathMatcher: A matcher for the path portion of the URL. The
  16950. // BackendService from the longest-matched rule will serve the URL. If
  16951. // no rule was matched, the default service will be used.
  16952. type PathMatcher struct {
  16953. // DefaultService: The full or partial URL to the BackendService
  16954. // resource. This will be used if none of the pathRules defined by this
  16955. // PathMatcher is matched by the URL's path portion. For example, the
  16956. // following are all valid URLs to a BackendService resource:
  16957. // -
  16958. // https://www.googleapis.com/compute/v1/projects/project/global/backendServices/backendService
  16959. // - compute/v1/projects/project/global/backendServices/backendService
  16960. //
  16961. // - global/backendServices/backendService
  16962. DefaultService string `json:"defaultService,omitempty"`
  16963. // Description: An optional description of this resource. Provide this
  16964. // property when you create the resource.
  16965. Description string `json:"description,omitempty"`
  16966. // Name: The name to which this PathMatcher is referred by the HostRule.
  16967. Name string `json:"name,omitempty"`
  16968. // PathRules: The list of path rules.
  16969. PathRules []*PathRule `json:"pathRules,omitempty"`
  16970. // ForceSendFields is a list of field names (e.g. "DefaultService") to
  16971. // unconditionally include in API requests. By default, fields with
  16972. // empty values are omitted from API requests. However, any non-pointer,
  16973. // non-interface field appearing in ForceSendFields will be sent to the
  16974. // server regardless of whether the field is empty or not. This may be
  16975. // used to include empty fields in Patch requests.
  16976. ForceSendFields []string `json:"-"`
  16977. // NullFields is a list of field names (e.g. "DefaultService") to
  16978. // include in API requests with the JSON null value. By default, fields
  16979. // with empty values are omitted from API requests. However, any field
  16980. // with an empty value appearing in NullFields will be sent to the
  16981. // server as null. It is an error if a field in this list has a
  16982. // non-empty value. This may be used to include null fields in Patch
  16983. // requests.
  16984. NullFields []string `json:"-"`
  16985. }
  16986. func (s *PathMatcher) MarshalJSON() ([]byte, error) {
  16987. type NoMethod PathMatcher
  16988. raw := NoMethod(*s)
  16989. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  16990. }
  16991. // PathRule: A path-matching rule for a URL. If matched, will use the
  16992. // specified BackendService to handle the traffic arriving at this URL.
  16993. type PathRule struct {
  16994. // Paths: The list of path patterns to match. Each must start with / and
  16995. // the only place a * is allowed is at the end following a /. The string
  16996. // fed to the path matcher does not include any text after the first ?
  16997. // or #, and those chars are not allowed here.
  16998. Paths []string `json:"paths,omitempty"`
  16999. // Service: The URL of the BackendService resource if this rule is
  17000. // matched.
  17001. Service string `json:"service,omitempty"`
  17002. // ForceSendFields is a list of field names (e.g. "Paths") to
  17003. // unconditionally include in API requests. By default, fields with
  17004. // empty values are omitted from API requests. However, any non-pointer,
  17005. // non-interface field appearing in ForceSendFields will be sent to the
  17006. // server regardless of whether the field is empty or not. This may be
  17007. // used to include empty fields in Patch requests.
  17008. ForceSendFields []string `json:"-"`
  17009. // NullFields is a list of field names (e.g. "Paths") to include in API
  17010. // requests with the JSON null value. By default, fields with empty
  17011. // values are omitted from API requests. However, any field with an
  17012. // empty value appearing in NullFields will be sent to the server as
  17013. // null. It is an error if a field in this list has a non-empty value.
  17014. // This may be used to include null fields in Patch requests.
  17015. NullFields []string `json:"-"`
  17016. }
  17017. func (s *PathRule) MarshalJSON() ([]byte, error) {
  17018. type NoMethod PathRule
  17019. raw := NoMethod(*s)
  17020. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  17021. }
  17022. // Policy: Defines an Identity and Access Management (IAM) policy. It is
  17023. // used to specify access control policies for Cloud Platform
  17024. // resources.
  17025. //
  17026. //
  17027. //
  17028. // A `Policy` consists of a list of `bindings`. A `binding` binds a list
  17029. // of `members` to a `role`, where the members can be user accounts,
  17030. // Google groups, Google domains, and service accounts. A `role` is a
  17031. // named list of permissions defined by IAM.
  17032. //
  17033. // **JSON Example**
  17034. //
  17035. // { "bindings": [ { "role": "roles/owner", "members": [
  17036. // "user:mike@example.com", "group:admins@example.com",
  17037. // "domain:google.com",
  17038. // "serviceAccount:my-other-app@appspot.gserviceaccount.com" ] }, {
  17039. // "role": "roles/viewer", "members": ["user:sean@example.com"] } ]
  17040. // }
  17041. //
  17042. // **YAML Example**
  17043. //
  17044. // bindings: - members: - user:mike@example.com -
  17045. // group:admins@example.com - domain:google.com -
  17046. // serviceAccount:my-other-app@appspot.gserviceaccount.com role:
  17047. // roles/owner - members: - user:sean@example.com role:
  17048. // roles/viewer
  17049. //
  17050. //
  17051. //
  17052. // For a description of IAM and its features, see the [IAM developer's
  17053. // guide](https://cloud.google.com/iam/docs).
  17054. type Policy struct {
  17055. // AuditConfigs: Specifies cloud audit logging configuration for this
  17056. // policy.
  17057. AuditConfigs []*AuditConfig `json:"auditConfigs,omitempty"`
  17058. // Bindings: Associates a list of `members` to a `role`. `bindings` with
  17059. // no members will result in an error.
  17060. Bindings []*Binding `json:"bindings,omitempty"`
  17061. // Etag: `etag` is used for optimistic concurrency control as a way to
  17062. // help prevent simultaneous updates of a policy from overwriting each
  17063. // other. It is strongly suggested that systems make use of the `etag`
  17064. // in the read-modify-write cycle to perform policy updates in order to
  17065. // avoid race conditions: An `etag` is returned in the response to
  17066. // `getIamPolicy`, and systems are expected to put that etag in the
  17067. // request to `setIamPolicy` to ensure that their change will be applied
  17068. // to the same version of the policy.
  17069. //
  17070. // If no `etag` is provided in the call to `setIamPolicy`, then the
  17071. // existing policy is overwritten blindly.
  17072. Etag string `json:"etag,omitempty"`
  17073. IamOwned bool `json:"iamOwned,omitempty"`
  17074. // Rules: If more than one rule is specified, the rules are applied in
  17075. // the following manner: - All matching LOG rules are always applied. -
  17076. // If any DENY/DENY_WITH_LOG rule matches, permission is denied. Logging
  17077. // will be applied if one or more matching rule requires logging. -
  17078. // Otherwise, if any ALLOW/ALLOW_WITH_LOG rule matches, permission is
  17079. // granted. Logging will be applied if one or more matching rule
  17080. // requires logging. - Otherwise, if no rule applies, permission is
  17081. // denied.
  17082. Rules []*Rule `json:"rules,omitempty"`
  17083. // Version: Deprecated.
  17084. Version int64 `json:"version,omitempty"`
  17085. // ServerResponse contains the HTTP response code and headers from the
  17086. // server.
  17087. googleapi.ServerResponse `json:"-"`
  17088. // ForceSendFields is a list of field names (e.g. "AuditConfigs") to
  17089. // unconditionally include in API requests. By default, fields with
  17090. // empty values are omitted from API requests. However, any non-pointer,
  17091. // non-interface field appearing in ForceSendFields will be sent to the
  17092. // server regardless of whether the field is empty or not. This may be
  17093. // used to include empty fields in Patch requests.
  17094. ForceSendFields []string `json:"-"`
  17095. // NullFields is a list of field names (e.g. "AuditConfigs") to include
  17096. // in API requests with the JSON null value. By default, fields with
  17097. // empty values are omitted from API requests. However, any field with
  17098. // an empty value appearing in NullFields will be sent to the server as
  17099. // null. It is an error if a field in this list has a non-empty value.
  17100. // This may be used to include null fields in Patch requests.
  17101. NullFields []string `json:"-"`
  17102. }
  17103. func (s *Policy) MarshalJSON() ([]byte, error) {
  17104. type NoMethod Policy
  17105. raw := NoMethod(*s)
  17106. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  17107. }
  17108. type PreconfiguredWafSet struct {
  17109. // ExpressionSets: List of entities that are currently supported for WAF
  17110. // rules.
  17111. ExpressionSets []*WafExpressionSet `json:"expressionSets,omitempty"`
  17112. // ForceSendFields is a list of field names (e.g. "ExpressionSets") to
  17113. // unconditionally include in API requests. By default, fields with
  17114. // empty values are omitted from API requests. However, any non-pointer,
  17115. // non-interface field appearing in ForceSendFields will be sent to the
  17116. // server regardless of whether the field is empty or not. This may be
  17117. // used to include empty fields in Patch requests.
  17118. ForceSendFields []string `json:"-"`
  17119. // NullFields is a list of field names (e.g. "ExpressionSets") to
  17120. // include in API requests with the JSON null value. By default, fields
  17121. // with empty values are omitted from API requests. However, any field
  17122. // with an empty value appearing in NullFields will be sent to the
  17123. // server as null. It is an error if a field in this list has a
  17124. // non-empty value. This may be used to include null fields in Patch
  17125. // requests.
  17126. NullFields []string `json:"-"`
  17127. }
  17128. func (s *PreconfiguredWafSet) MarshalJSON() ([]byte, error) {
  17129. type NoMethod PreconfiguredWafSet
  17130. raw := NoMethod(*s)
  17131. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  17132. }
  17133. // Project: A Project resource. For an overview of projects, see Cloud
  17134. // Platform Resource Hierarchy. (== resource_for v1.projects ==) (==
  17135. // resource_for beta.projects ==)
  17136. type Project struct {
  17137. // CommonInstanceMetadata: Metadata key/value pairs available to all
  17138. // instances contained in this project. See Custom metadata for more
  17139. // information.
  17140. CommonInstanceMetadata *Metadata `json:"commonInstanceMetadata,omitempty"`
  17141. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  17142. // format.
  17143. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  17144. // DefaultNetworkTier: This signifies the default network tier used for
  17145. // configuring resources of the project and can only take the following
  17146. // values: PREMIUM, STANDARD. Initially the default network tier is
  17147. // PREMIUM.
  17148. //
  17149. // Possible values:
  17150. // "PREMIUM"
  17151. // "STANDARD"
  17152. DefaultNetworkTier string `json:"defaultNetworkTier,omitempty"`
  17153. // DefaultServiceAccount: [Output Only] Default service account used by
  17154. // VMs running in this project.
  17155. DefaultServiceAccount string `json:"defaultServiceAccount,omitempty"`
  17156. // Description: An optional textual description of the resource.
  17157. Description string `json:"description,omitempty"`
  17158. // EnabledFeatures: Restricted features enabled for use on this project.
  17159. EnabledFeatures []string `json:"enabledFeatures,omitempty"`
  17160. // Id: [Output Only] The unique identifier for the resource. This
  17161. // identifier is defined by the server. This is not the project ID, and
  17162. // is just a unique ID used by Compute Engine to identify resources.
  17163. Id uint64 `json:"id,omitempty,string"`
  17164. // Kind: [Output Only] Type of the resource. Always compute#project for
  17165. // projects.
  17166. Kind string `json:"kind,omitempty"`
  17167. // Name: The project ID. For example: my-example-project. Use the
  17168. // project ID to make requests to Compute Engine.
  17169. Name string `json:"name,omitempty"`
  17170. // Quotas: [Output Only] Quotas assigned to this project.
  17171. Quotas []*Quota `json:"quotas,omitempty"`
  17172. // SelfLink: [Output Only] Server-defined URL for the resource.
  17173. SelfLink string `json:"selfLink,omitempty"`
  17174. // UsageExportLocation: The naming prefix for daily usage reports and
  17175. // the Google Cloud Storage bucket where they are stored.
  17176. UsageExportLocation *UsageExportLocation `json:"usageExportLocation,omitempty"`
  17177. // XpnProjectStatus: [Output Only] The role this project has in a shared
  17178. // VPC configuration. Currently only HOST projects are differentiated.
  17179. //
  17180. // Possible values:
  17181. // "HOST"
  17182. // "UNSPECIFIED_XPN_PROJECT_STATUS"
  17183. XpnProjectStatus string `json:"xpnProjectStatus,omitempty"`
  17184. // ServerResponse contains the HTTP response code and headers from the
  17185. // server.
  17186. googleapi.ServerResponse `json:"-"`
  17187. // ForceSendFields is a list of field names (e.g.
  17188. // "CommonInstanceMetadata") to unconditionally include in API requests.
  17189. // By default, fields with empty values are omitted from API requests.
  17190. // However, any non-pointer, non-interface field appearing in
  17191. // ForceSendFields will be sent to the server regardless of whether the
  17192. // field is empty or not. This may be used to include empty fields in
  17193. // Patch requests.
  17194. ForceSendFields []string `json:"-"`
  17195. // NullFields is a list of field names (e.g. "CommonInstanceMetadata")
  17196. // to include in API requests with the JSON null value. By default,
  17197. // fields with empty values are omitted from API requests. However, any
  17198. // field with an empty value appearing in NullFields will be sent to the
  17199. // server as null. It is an error if a field in this list has a
  17200. // non-empty value. This may be used to include null fields in Patch
  17201. // requests.
  17202. NullFields []string `json:"-"`
  17203. }
  17204. func (s *Project) MarshalJSON() ([]byte, error) {
  17205. type NoMethod Project
  17206. raw := NoMethod(*s)
  17207. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  17208. }
  17209. type ProjectsDisableXpnResourceRequest struct {
  17210. // XpnResource: Service resource (a.k.a service project) ID.
  17211. XpnResource *XpnResourceId `json:"xpnResource,omitempty"`
  17212. // ForceSendFields is a list of field names (e.g. "XpnResource") to
  17213. // unconditionally include in API requests. By default, fields with
  17214. // empty values are omitted from API requests. However, any non-pointer,
  17215. // non-interface field appearing in ForceSendFields will be sent to the
  17216. // server regardless of whether the field is empty or not. This may be
  17217. // used to include empty fields in Patch requests.
  17218. ForceSendFields []string `json:"-"`
  17219. // NullFields is a list of field names (e.g. "XpnResource") to include
  17220. // in API requests with the JSON null value. By default, fields with
  17221. // empty values are omitted from API requests. However, any field with
  17222. // an empty value appearing in NullFields will be sent to the server as
  17223. // null. It is an error if a field in this list has a non-empty value.
  17224. // This may be used to include null fields in Patch requests.
  17225. NullFields []string `json:"-"`
  17226. }
  17227. func (s *ProjectsDisableXpnResourceRequest) MarshalJSON() ([]byte, error) {
  17228. type NoMethod ProjectsDisableXpnResourceRequest
  17229. raw := NoMethod(*s)
  17230. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  17231. }
  17232. type ProjectsEnableXpnResourceRequest struct {
  17233. // XpnResource: Service resource (a.k.a service project) ID.
  17234. XpnResource *XpnResourceId `json:"xpnResource,omitempty"`
  17235. // ForceSendFields is a list of field names (e.g. "XpnResource") to
  17236. // unconditionally include in API requests. By default, fields with
  17237. // empty values are omitted from API requests. However, any non-pointer,
  17238. // non-interface field appearing in ForceSendFields will be sent to the
  17239. // server regardless of whether the field is empty or not. This may be
  17240. // used to include empty fields in Patch requests.
  17241. ForceSendFields []string `json:"-"`
  17242. // NullFields is a list of field names (e.g. "XpnResource") to include
  17243. // in API requests with the JSON null value. By default, fields with
  17244. // empty values are omitted from API requests. However, any field with
  17245. // an empty value appearing in NullFields will be sent to the server as
  17246. // null. It is an error if a field in this list has a non-empty value.
  17247. // This may be used to include null fields in Patch requests.
  17248. NullFields []string `json:"-"`
  17249. }
  17250. func (s *ProjectsEnableXpnResourceRequest) MarshalJSON() ([]byte, error) {
  17251. type NoMethod ProjectsEnableXpnResourceRequest
  17252. raw := NoMethod(*s)
  17253. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  17254. }
  17255. type ProjectsGetXpnResources struct {
  17256. // Kind: [Output Only] Type of resource. Always
  17257. // compute#projectsGetXpnResources for lists of service resources (a.k.a
  17258. // service projects)
  17259. Kind string `json:"kind,omitempty"`
  17260. // NextPageToken: [Output Only] This token allows you to get the next
  17261. // page of results for list requests. If the number of results is larger
  17262. // than maxResults, use the nextPageToken as a value for the query
  17263. // parameter pageToken in the next list request. Subsequent list
  17264. // requests will have their own nextPageToken to continue paging through
  17265. // the results.
  17266. NextPageToken string `json:"nextPageToken,omitempty"`
  17267. // Resources: Service resources (a.k.a service projects) attached to
  17268. // this project as their shared VPC host.
  17269. Resources []*XpnResourceId `json:"resources,omitempty"`
  17270. // ServerResponse contains the HTTP response code and headers from the
  17271. // server.
  17272. googleapi.ServerResponse `json:"-"`
  17273. // ForceSendFields is a list of field names (e.g. "Kind") to
  17274. // unconditionally include in API requests. By default, fields with
  17275. // empty values are omitted from API requests. However, any non-pointer,
  17276. // non-interface field appearing in ForceSendFields will be sent to the
  17277. // server regardless of whether the field is empty or not. This may be
  17278. // used to include empty fields in Patch requests.
  17279. ForceSendFields []string `json:"-"`
  17280. // NullFields is a list of field names (e.g. "Kind") to include in API
  17281. // requests with the JSON null value. By default, fields with empty
  17282. // values are omitted from API requests. However, any field with an
  17283. // empty value appearing in NullFields will be sent to the server as
  17284. // null. It is an error if a field in this list has a non-empty value.
  17285. // This may be used to include null fields in Patch requests.
  17286. NullFields []string `json:"-"`
  17287. }
  17288. func (s *ProjectsGetXpnResources) MarshalJSON() ([]byte, error) {
  17289. type NoMethod ProjectsGetXpnResources
  17290. raw := NoMethod(*s)
  17291. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  17292. }
  17293. type ProjectsListXpnHostsRequest struct {
  17294. // Organization: Optional organization ID managed by Cloud Resource
  17295. // Manager, for which to list shared VPC host projects. If not
  17296. // specified, the organization will be inferred from the project.
  17297. Organization string `json:"organization,omitempty"`
  17298. // ForceSendFields is a list of field names (e.g. "Organization") to
  17299. // unconditionally include in API requests. By default, fields with
  17300. // empty values are omitted from API requests. However, any non-pointer,
  17301. // non-interface field appearing in ForceSendFields will be sent to the
  17302. // server regardless of whether the field is empty or not. This may be
  17303. // used to include empty fields in Patch requests.
  17304. ForceSendFields []string `json:"-"`
  17305. // NullFields is a list of field names (e.g. "Organization") to include
  17306. // in API requests with the JSON null value. By default, fields with
  17307. // empty values are omitted from API requests. However, any field with
  17308. // an empty value appearing in NullFields will be sent to the server as
  17309. // null. It is an error if a field in this list has a non-empty value.
  17310. // This may be used to include null fields in Patch requests.
  17311. NullFields []string `json:"-"`
  17312. }
  17313. func (s *ProjectsListXpnHostsRequest) MarshalJSON() ([]byte, error) {
  17314. type NoMethod ProjectsListXpnHostsRequest
  17315. raw := NoMethod(*s)
  17316. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  17317. }
  17318. type ProjectsSetDefaultNetworkTierRequest struct {
  17319. // NetworkTier: Default network tier to be set.
  17320. //
  17321. // Possible values:
  17322. // "PREMIUM"
  17323. // "STANDARD"
  17324. NetworkTier string `json:"networkTier,omitempty"`
  17325. // ForceSendFields is a list of field names (e.g. "NetworkTier") to
  17326. // unconditionally include in API requests. By default, fields with
  17327. // empty values are omitted from API requests. However, any non-pointer,
  17328. // non-interface field appearing in ForceSendFields will be sent to the
  17329. // server regardless of whether the field is empty or not. This may be
  17330. // used to include empty fields in Patch requests.
  17331. ForceSendFields []string `json:"-"`
  17332. // NullFields is a list of field names (e.g. "NetworkTier") to include
  17333. // in API requests with the JSON null value. By default, fields with
  17334. // empty values are omitted from API requests. However, any field with
  17335. // an empty value appearing in NullFields will be sent to the server as
  17336. // null. It is an error if a field in this list has a non-empty value.
  17337. // This may be used to include null fields in Patch requests.
  17338. NullFields []string `json:"-"`
  17339. }
  17340. func (s *ProjectsSetDefaultNetworkTierRequest) MarshalJSON() ([]byte, error) {
  17341. type NoMethod ProjectsSetDefaultNetworkTierRequest
  17342. raw := NoMethod(*s)
  17343. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  17344. }
  17345. // Quota: A quotas entry.
  17346. type Quota struct {
  17347. // Limit: [Output Only] Quota limit for this metric.
  17348. Limit float64 `json:"limit,omitempty"`
  17349. // Metric: [Output Only] Name of the quota metric.
  17350. //
  17351. // Possible values:
  17352. // "AUTOSCALERS"
  17353. // "BACKEND_BUCKETS"
  17354. // "BACKEND_SERVICES"
  17355. // "COMMITMENTS"
  17356. // "CPUS"
  17357. // "CPUS_ALL_REGIONS"
  17358. // "DISKS_TOTAL_GB"
  17359. // "FIREWALLS"
  17360. // "FORWARDING_RULES"
  17361. // "HEALTH_CHECKS"
  17362. // "IMAGES"
  17363. // "INSTANCES"
  17364. // "INSTANCE_GROUPS"
  17365. // "INSTANCE_GROUP_MANAGERS"
  17366. // "INSTANCE_TEMPLATES"
  17367. // "INTERCONNECTS"
  17368. // "INTERCONNECT_ATTACHMENTS_PER_REGION"
  17369. // "INTERCONNECT_ATTACHMENTS_TOTAL_MBPS"
  17370. // "INTERNAL_ADDRESSES"
  17371. // "IN_USE_ADDRESSES"
  17372. // "LOCAL_SSD_TOTAL_GB"
  17373. // "NETWORKS"
  17374. // "NETWORK_ENDPOINT_GROUPS"
  17375. // "NVIDIA_K80_GPUS"
  17376. // "NVIDIA_P100_GPUS"
  17377. // "NVIDIA_V100_GPUS"
  17378. // "PREEMPTIBLE_CPUS"
  17379. // "PREEMPTIBLE_LOCAL_SSD_GB"
  17380. // "PREEMPTIBLE_NVIDIA_K80_GPUS"
  17381. // "PREEMPTIBLE_NVIDIA_P100_GPUS"
  17382. // "PREEMPTIBLE_NVIDIA_V100_GPUS"
  17383. // "REGIONAL_AUTOSCALERS"
  17384. // "REGIONAL_INSTANCE_GROUP_MANAGERS"
  17385. // "ROUTERS"
  17386. // "ROUTES"
  17387. // "SECURITY_POLICIES"
  17388. // "SECURITY_POLICY_RULES"
  17389. // "SNAPSHOTS"
  17390. // "SSD_TOTAL_GB"
  17391. // "SSL_CERTIFICATES"
  17392. // "STATIC_ADDRESSES"
  17393. // "SUBNETWORKS"
  17394. // "TARGET_HTTPS_PROXIES"
  17395. // "TARGET_HTTP_PROXIES"
  17396. // "TARGET_INSTANCES"
  17397. // "TARGET_POOLS"
  17398. // "TARGET_SSL_PROXIES"
  17399. // "TARGET_TCP_PROXIES"
  17400. // "TARGET_VPN_GATEWAYS"
  17401. // "URL_MAPS"
  17402. // "VPN_TUNNELS"
  17403. Metric string `json:"metric,omitempty"`
  17404. // Usage: [Output Only] Current usage of this metric.
  17405. Usage float64 `json:"usage,omitempty"`
  17406. // ForceSendFields is a list of field names (e.g. "Limit") to
  17407. // unconditionally include in API requests. By default, fields with
  17408. // empty values are omitted from API requests. However, any non-pointer,
  17409. // non-interface field appearing in ForceSendFields will be sent to the
  17410. // server regardless of whether the field is empty or not. This may be
  17411. // used to include empty fields in Patch requests.
  17412. ForceSendFields []string `json:"-"`
  17413. // NullFields is a list of field names (e.g. "Limit") to include in API
  17414. // requests with the JSON null value. By default, fields with empty
  17415. // values are omitted from API requests. However, any field with an
  17416. // empty value appearing in NullFields will be sent to the server as
  17417. // null. It is an error if a field in this list has a non-empty value.
  17418. // This may be used to include null fields in Patch requests.
  17419. NullFields []string `json:"-"`
  17420. }
  17421. func (s *Quota) MarshalJSON() ([]byte, error) {
  17422. type NoMethod Quota
  17423. raw := NoMethod(*s)
  17424. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  17425. }
  17426. func (s *Quota) UnmarshalJSON(data []byte) error {
  17427. type NoMethod Quota
  17428. var s1 struct {
  17429. Limit gensupport.JSONFloat64 `json:"limit"`
  17430. Usage gensupport.JSONFloat64 `json:"usage"`
  17431. *NoMethod
  17432. }
  17433. s1.NoMethod = (*NoMethod)(s)
  17434. if err := json.Unmarshal(data, &s1); err != nil {
  17435. return err
  17436. }
  17437. s.Limit = float64(s1.Limit)
  17438. s.Usage = float64(s1.Usage)
  17439. return nil
  17440. }
  17441. // Reference: Represents a reference to a resource.
  17442. type Reference struct {
  17443. // Kind: [Output Only] Type of the resource. Always compute#reference
  17444. // for references.
  17445. Kind string `json:"kind,omitempty"`
  17446. // ReferenceType: A description of the reference type with no implied
  17447. // semantics. Possible values include:
  17448. // - MEMBER_OF
  17449. ReferenceType string `json:"referenceType,omitempty"`
  17450. // Referrer: URL of the resource which refers to the target.
  17451. Referrer string `json:"referrer,omitempty"`
  17452. // Target: URL of the resource to which this reference points.
  17453. Target string `json:"target,omitempty"`
  17454. // ForceSendFields is a list of field names (e.g. "Kind") to
  17455. // unconditionally include in API requests. By default, fields with
  17456. // empty values are omitted from API requests. However, any non-pointer,
  17457. // non-interface field appearing in ForceSendFields will be sent to the
  17458. // server regardless of whether the field is empty or not. This may be
  17459. // used to include empty fields in Patch requests.
  17460. ForceSendFields []string `json:"-"`
  17461. // NullFields is a list of field names (e.g. "Kind") to include in API
  17462. // requests with the JSON null value. By default, fields with empty
  17463. // values are omitted from API requests. However, any field with an
  17464. // empty value appearing in NullFields will be sent to the server as
  17465. // null. It is an error if a field in this list has a non-empty value.
  17466. // This may be used to include null fields in Patch requests.
  17467. NullFields []string `json:"-"`
  17468. }
  17469. func (s *Reference) MarshalJSON() ([]byte, error) {
  17470. type NoMethod Reference
  17471. raw := NoMethod(*s)
  17472. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  17473. }
  17474. // Region: Region resource. (== resource_for beta.regions ==) (==
  17475. // resource_for v1.regions ==)
  17476. type Region struct {
  17477. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  17478. // format.
  17479. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  17480. // Deprecated: [Output Only] The deprecation status associated with this
  17481. // region.
  17482. Deprecated *DeprecationStatus `json:"deprecated,omitempty"`
  17483. // Description: [Output Only] Textual description of the resource.
  17484. Description string `json:"description,omitempty"`
  17485. // Id: [Output Only] The unique identifier for the resource. This
  17486. // identifier is defined by the server.
  17487. Id uint64 `json:"id,omitempty,string"`
  17488. // Kind: [Output Only] Type of the resource. Always compute#region for
  17489. // regions.
  17490. Kind string `json:"kind,omitempty"`
  17491. // Name: [Output Only] Name of the resource.
  17492. Name string `json:"name,omitempty"`
  17493. // Quotas: [Output Only] Quotas assigned to this region.
  17494. Quotas []*Quota `json:"quotas,omitempty"`
  17495. // SelfLink: [Output Only] Server-defined URL for the resource.
  17496. SelfLink string `json:"selfLink,omitempty"`
  17497. // Status: [Output Only] Status of the region, either UP or DOWN.
  17498. //
  17499. // Possible values:
  17500. // "DOWN"
  17501. // "UP"
  17502. Status string `json:"status,omitempty"`
  17503. // Zones: [Output Only] A list of zones available in this region, in the
  17504. // form of resource URLs.
  17505. Zones []string `json:"zones,omitempty"`
  17506. // ServerResponse contains the HTTP response code and headers from the
  17507. // server.
  17508. googleapi.ServerResponse `json:"-"`
  17509. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  17510. // to unconditionally include in API requests. By default, fields with
  17511. // empty values are omitted from API requests. However, any non-pointer,
  17512. // non-interface field appearing in ForceSendFields will be sent to the
  17513. // server regardless of whether the field is empty or not. This may be
  17514. // used to include empty fields in Patch requests.
  17515. ForceSendFields []string `json:"-"`
  17516. // NullFields is a list of field names (e.g. "CreationTimestamp") to
  17517. // include in API requests with the JSON null value. By default, fields
  17518. // with empty values are omitted from API requests. However, any field
  17519. // with an empty value appearing in NullFields will be sent to the
  17520. // server as null. It is an error if a field in this list has a
  17521. // non-empty value. This may be used to include null fields in Patch
  17522. // requests.
  17523. NullFields []string `json:"-"`
  17524. }
  17525. func (s *Region) MarshalJSON() ([]byte, error) {
  17526. type NoMethod Region
  17527. raw := NoMethod(*s)
  17528. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  17529. }
  17530. // RegionAutoscalerList: Contains a list of autoscalers.
  17531. type RegionAutoscalerList struct {
  17532. // Id: [Output Only] Unique identifier for the resource; defined by the
  17533. // server.
  17534. Id string `json:"id,omitempty"`
  17535. // Items: A list of Autoscaler resources.
  17536. Items []*Autoscaler `json:"items,omitempty"`
  17537. // Kind: Type of resource.
  17538. Kind string `json:"kind,omitempty"`
  17539. // NextPageToken: [Output Only] This token allows you to get the next
  17540. // page of results for list requests. If the number of results is larger
  17541. // than maxResults, use the nextPageToken as a value for the query
  17542. // parameter pageToken in the next list request. Subsequent list
  17543. // requests will have their own nextPageToken to continue paging through
  17544. // the results.
  17545. NextPageToken string `json:"nextPageToken,omitempty"`
  17546. // SelfLink: [Output Only] Server-defined URL for this resource.
  17547. SelfLink string `json:"selfLink,omitempty"`
  17548. // Warning: [Output Only] Informational warning message.
  17549. Warning *RegionAutoscalerListWarning `json:"warning,omitempty"`
  17550. // ServerResponse contains the HTTP response code and headers from the
  17551. // server.
  17552. googleapi.ServerResponse `json:"-"`
  17553. // ForceSendFields is a list of field names (e.g. "Id") to
  17554. // unconditionally include in API requests. By default, fields with
  17555. // empty values are omitted from API requests. However, any non-pointer,
  17556. // non-interface field appearing in ForceSendFields will be sent to the
  17557. // server regardless of whether the field is empty or not. This may be
  17558. // used to include empty fields in Patch requests.
  17559. ForceSendFields []string `json:"-"`
  17560. // NullFields is a list of field names (e.g. "Id") to include in API
  17561. // requests with the JSON null value. By default, fields with empty
  17562. // values are omitted from API requests. However, any field with an
  17563. // empty value appearing in NullFields will be sent to the server as
  17564. // null. It is an error if a field in this list has a non-empty value.
  17565. // This may be used to include null fields in Patch requests.
  17566. NullFields []string `json:"-"`
  17567. }
  17568. func (s *RegionAutoscalerList) MarshalJSON() ([]byte, error) {
  17569. type NoMethod RegionAutoscalerList
  17570. raw := NoMethod(*s)
  17571. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  17572. }
  17573. // RegionAutoscalerListWarning: [Output Only] Informational warning
  17574. // message.
  17575. type RegionAutoscalerListWarning struct {
  17576. // Code: [Output Only] A warning code, if applicable. For example,
  17577. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  17578. // the response.
  17579. //
  17580. // Possible values:
  17581. // "CLEANUP_FAILED"
  17582. // "DEPRECATED_RESOURCE_USED"
  17583. // "DEPRECATED_TYPE_USED"
  17584. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  17585. // "EXPERIMENTAL_TYPE_USED"
  17586. // "EXTERNAL_API_WARNING"
  17587. // "FIELD_VALUE_OVERRIDEN"
  17588. // "INJECTED_KERNELS_DEPRECATED"
  17589. // "MISSING_TYPE_DEPENDENCY"
  17590. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  17591. // "NEXT_HOP_CANNOT_IP_FORWARD"
  17592. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  17593. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  17594. // "NEXT_HOP_NOT_RUNNING"
  17595. // "NOT_CRITICAL_ERROR"
  17596. // "NO_RESULTS_ON_PAGE"
  17597. // "REQUIRED_TOS_AGREEMENT"
  17598. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  17599. // "RESOURCE_NOT_DELETED"
  17600. // "SCHEMA_VALIDATION_IGNORED"
  17601. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  17602. // "UNDECLARED_PROPERTIES"
  17603. // "UNREACHABLE"
  17604. Code string `json:"code,omitempty"`
  17605. // Data: [Output Only] Metadata about this warning in key: value format.
  17606. // For example:
  17607. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  17608. Data []*RegionAutoscalerListWarningData `json:"data,omitempty"`
  17609. // Message: [Output Only] A human-readable description of the warning
  17610. // code.
  17611. Message string `json:"message,omitempty"`
  17612. // ForceSendFields is a list of field names (e.g. "Code") to
  17613. // unconditionally include in API requests. By default, fields with
  17614. // empty values are omitted from API requests. However, any non-pointer,
  17615. // non-interface field appearing in ForceSendFields will be sent to the
  17616. // server regardless of whether the field is empty or not. This may be
  17617. // used to include empty fields in Patch requests.
  17618. ForceSendFields []string `json:"-"`
  17619. // NullFields is a list of field names (e.g. "Code") to include in API
  17620. // requests with the JSON null value. By default, fields with empty
  17621. // values are omitted from API requests. However, any field with an
  17622. // empty value appearing in NullFields will be sent to the server as
  17623. // null. It is an error if a field in this list has a non-empty value.
  17624. // This may be used to include null fields in Patch requests.
  17625. NullFields []string `json:"-"`
  17626. }
  17627. func (s *RegionAutoscalerListWarning) MarshalJSON() ([]byte, error) {
  17628. type NoMethod RegionAutoscalerListWarning
  17629. raw := NoMethod(*s)
  17630. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  17631. }
  17632. type RegionAutoscalerListWarningData struct {
  17633. // Key: [Output Only] A key that provides more detail on the warning
  17634. // being returned. For example, for warnings where there are no results
  17635. // in a list request for a particular zone, this key might be scope and
  17636. // the key value might be the zone name. Other examples might be a key
  17637. // indicating a deprecated resource and a suggested replacement, or a
  17638. // warning about invalid network settings (for example, if an instance
  17639. // attempts to perform IP forwarding but is not enabled for IP
  17640. // forwarding).
  17641. Key string `json:"key,omitempty"`
  17642. // Value: [Output Only] A warning data value corresponding to the key.
  17643. Value string `json:"value,omitempty"`
  17644. // ForceSendFields is a list of field names (e.g. "Key") to
  17645. // unconditionally include in API requests. By default, fields with
  17646. // empty values are omitted from API requests. However, any non-pointer,
  17647. // non-interface field appearing in ForceSendFields will be sent to the
  17648. // server regardless of whether the field is empty or not. This may be
  17649. // used to include empty fields in Patch requests.
  17650. ForceSendFields []string `json:"-"`
  17651. // NullFields is a list of field names (e.g. "Key") to include in API
  17652. // requests with the JSON null value. By default, fields with empty
  17653. // values are omitted from API requests. However, any field with an
  17654. // empty value appearing in NullFields will be sent to the server as
  17655. // null. It is an error if a field in this list has a non-empty value.
  17656. // This may be used to include null fields in Patch requests.
  17657. NullFields []string `json:"-"`
  17658. }
  17659. func (s *RegionAutoscalerListWarningData) MarshalJSON() ([]byte, error) {
  17660. type NoMethod RegionAutoscalerListWarningData
  17661. raw := NoMethod(*s)
  17662. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  17663. }
  17664. type RegionDiskTypeList struct {
  17665. // Id: [Output Only] Unique identifier for the resource; defined by the
  17666. // server.
  17667. Id string `json:"id,omitempty"`
  17668. // Items: A list of DiskType resources.
  17669. Items []*DiskType `json:"items,omitempty"`
  17670. // Kind: [Output Only] Type of resource. Always
  17671. // compute#regionDiskTypeList for region disk types.
  17672. Kind string `json:"kind,omitempty"`
  17673. // NextPageToken: [Output Only] This token allows you to get the next
  17674. // page of results for list requests. If the number of results is larger
  17675. // than maxResults, use the nextPageToken as a value for the query
  17676. // parameter pageToken in the next list request. Subsequent list
  17677. // requests will have their own nextPageToken to continue paging through
  17678. // the results.
  17679. NextPageToken string `json:"nextPageToken,omitempty"`
  17680. // SelfLink: [Output Only] Server-defined URL for this resource.
  17681. SelfLink string `json:"selfLink,omitempty"`
  17682. // Warning: [Output Only] Informational warning message.
  17683. Warning *RegionDiskTypeListWarning `json:"warning,omitempty"`
  17684. // ServerResponse contains the HTTP response code and headers from the
  17685. // server.
  17686. googleapi.ServerResponse `json:"-"`
  17687. // ForceSendFields is a list of field names (e.g. "Id") to
  17688. // unconditionally include in API requests. By default, fields with
  17689. // empty values are omitted from API requests. However, any non-pointer,
  17690. // non-interface field appearing in ForceSendFields will be sent to the
  17691. // server regardless of whether the field is empty or not. This may be
  17692. // used to include empty fields in Patch requests.
  17693. ForceSendFields []string `json:"-"`
  17694. // NullFields is a list of field names (e.g. "Id") to include in API
  17695. // requests with the JSON null value. By default, fields with empty
  17696. // values are omitted from API requests. However, any field with an
  17697. // empty value appearing in NullFields will be sent to the server as
  17698. // null. It is an error if a field in this list has a non-empty value.
  17699. // This may be used to include null fields in Patch requests.
  17700. NullFields []string `json:"-"`
  17701. }
  17702. func (s *RegionDiskTypeList) MarshalJSON() ([]byte, error) {
  17703. type NoMethod RegionDiskTypeList
  17704. raw := NoMethod(*s)
  17705. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  17706. }
  17707. // RegionDiskTypeListWarning: [Output Only] Informational warning
  17708. // message.
  17709. type RegionDiskTypeListWarning struct {
  17710. // Code: [Output Only] A warning code, if applicable. For example,
  17711. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  17712. // the response.
  17713. //
  17714. // Possible values:
  17715. // "CLEANUP_FAILED"
  17716. // "DEPRECATED_RESOURCE_USED"
  17717. // "DEPRECATED_TYPE_USED"
  17718. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  17719. // "EXPERIMENTAL_TYPE_USED"
  17720. // "EXTERNAL_API_WARNING"
  17721. // "FIELD_VALUE_OVERRIDEN"
  17722. // "INJECTED_KERNELS_DEPRECATED"
  17723. // "MISSING_TYPE_DEPENDENCY"
  17724. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  17725. // "NEXT_HOP_CANNOT_IP_FORWARD"
  17726. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  17727. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  17728. // "NEXT_HOP_NOT_RUNNING"
  17729. // "NOT_CRITICAL_ERROR"
  17730. // "NO_RESULTS_ON_PAGE"
  17731. // "REQUIRED_TOS_AGREEMENT"
  17732. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  17733. // "RESOURCE_NOT_DELETED"
  17734. // "SCHEMA_VALIDATION_IGNORED"
  17735. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  17736. // "UNDECLARED_PROPERTIES"
  17737. // "UNREACHABLE"
  17738. Code string `json:"code,omitempty"`
  17739. // Data: [Output Only] Metadata about this warning in key: value format.
  17740. // For example:
  17741. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  17742. Data []*RegionDiskTypeListWarningData `json:"data,omitempty"`
  17743. // Message: [Output Only] A human-readable description of the warning
  17744. // code.
  17745. Message string `json:"message,omitempty"`
  17746. // ForceSendFields is a list of field names (e.g. "Code") to
  17747. // unconditionally include in API requests. By default, fields with
  17748. // empty values are omitted from API requests. However, any non-pointer,
  17749. // non-interface field appearing in ForceSendFields will be sent to the
  17750. // server regardless of whether the field is empty or not. This may be
  17751. // used to include empty fields in Patch requests.
  17752. ForceSendFields []string `json:"-"`
  17753. // NullFields is a list of field names (e.g. "Code") to include in API
  17754. // requests with the JSON null value. By default, fields with empty
  17755. // values are omitted from API requests. However, any field with an
  17756. // empty value appearing in NullFields will be sent to the server as
  17757. // null. It is an error if a field in this list has a non-empty value.
  17758. // This may be used to include null fields in Patch requests.
  17759. NullFields []string `json:"-"`
  17760. }
  17761. func (s *RegionDiskTypeListWarning) MarshalJSON() ([]byte, error) {
  17762. type NoMethod RegionDiskTypeListWarning
  17763. raw := NoMethod(*s)
  17764. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  17765. }
  17766. type RegionDiskTypeListWarningData struct {
  17767. // Key: [Output Only] A key that provides more detail on the warning
  17768. // being returned. For example, for warnings where there are no results
  17769. // in a list request for a particular zone, this key might be scope and
  17770. // the key value might be the zone name. Other examples might be a key
  17771. // indicating a deprecated resource and a suggested replacement, or a
  17772. // warning about invalid network settings (for example, if an instance
  17773. // attempts to perform IP forwarding but is not enabled for IP
  17774. // forwarding).
  17775. Key string `json:"key,omitempty"`
  17776. // Value: [Output Only] A warning data value corresponding to the key.
  17777. Value string `json:"value,omitempty"`
  17778. // ForceSendFields is a list of field names (e.g. "Key") to
  17779. // unconditionally include in API requests. By default, fields with
  17780. // empty values are omitted from API requests. However, any non-pointer,
  17781. // non-interface field appearing in ForceSendFields will be sent to the
  17782. // server regardless of whether the field is empty or not. This may be
  17783. // used to include empty fields in Patch requests.
  17784. ForceSendFields []string `json:"-"`
  17785. // NullFields is a list of field names (e.g. "Key") to include in API
  17786. // requests with the JSON null value. By default, fields with empty
  17787. // values are omitted from API requests. However, any field with an
  17788. // empty value appearing in NullFields will be sent to the server as
  17789. // null. It is an error if a field in this list has a non-empty value.
  17790. // This may be used to include null fields in Patch requests.
  17791. NullFields []string `json:"-"`
  17792. }
  17793. func (s *RegionDiskTypeListWarningData) MarshalJSON() ([]byte, error) {
  17794. type NoMethod RegionDiskTypeListWarningData
  17795. raw := NoMethod(*s)
  17796. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  17797. }
  17798. type RegionDisksResizeRequest struct {
  17799. // SizeGb: The new size of the regional persistent disk, which is
  17800. // specified in GB.
  17801. SizeGb int64 `json:"sizeGb,omitempty,string"`
  17802. // ForceSendFields is a list of field names (e.g. "SizeGb") to
  17803. // unconditionally include in API requests. By default, fields with
  17804. // empty values are omitted from API requests. However, any non-pointer,
  17805. // non-interface field appearing in ForceSendFields will be sent to the
  17806. // server regardless of whether the field is empty or not. This may be
  17807. // used to include empty fields in Patch requests.
  17808. ForceSendFields []string `json:"-"`
  17809. // NullFields is a list of field names (e.g. "SizeGb") to include in API
  17810. // requests with the JSON null value. By default, fields with empty
  17811. // values are omitted from API requests. However, any field with an
  17812. // empty value appearing in NullFields will be sent to the server as
  17813. // null. It is an error if a field in this list has a non-empty value.
  17814. // This may be used to include null fields in Patch requests.
  17815. NullFields []string `json:"-"`
  17816. }
  17817. func (s *RegionDisksResizeRequest) MarshalJSON() ([]byte, error) {
  17818. type NoMethod RegionDisksResizeRequest
  17819. raw := NoMethod(*s)
  17820. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  17821. }
  17822. // RegionInstanceGroupList: Contains a list of InstanceGroup resources.
  17823. type RegionInstanceGroupList struct {
  17824. // Id: [Output Only] Unique identifier for the resource; defined by the
  17825. // server.
  17826. Id string `json:"id,omitempty"`
  17827. // Items: A list of InstanceGroup resources.
  17828. Items []*InstanceGroup `json:"items,omitempty"`
  17829. // Kind: The resource type.
  17830. Kind string `json:"kind,omitempty"`
  17831. // NextPageToken: [Output Only] This token allows you to get the next
  17832. // page of results for list requests. If the number of results is larger
  17833. // than maxResults, use the nextPageToken as a value for the query
  17834. // parameter pageToken in the next list request. Subsequent list
  17835. // requests will have their own nextPageToken to continue paging through
  17836. // the results.
  17837. NextPageToken string `json:"nextPageToken,omitempty"`
  17838. // SelfLink: [Output Only] Server-defined URL for this resource.
  17839. SelfLink string `json:"selfLink,omitempty"`
  17840. // Warning: [Output Only] Informational warning message.
  17841. Warning *RegionInstanceGroupListWarning `json:"warning,omitempty"`
  17842. // ServerResponse contains the HTTP response code and headers from the
  17843. // server.
  17844. googleapi.ServerResponse `json:"-"`
  17845. // ForceSendFields is a list of field names (e.g. "Id") to
  17846. // unconditionally include in API requests. By default, fields with
  17847. // empty values are omitted from API requests. However, any non-pointer,
  17848. // non-interface field appearing in ForceSendFields will be sent to the
  17849. // server regardless of whether the field is empty or not. This may be
  17850. // used to include empty fields in Patch requests.
  17851. ForceSendFields []string `json:"-"`
  17852. // NullFields is a list of field names (e.g. "Id") to include in API
  17853. // requests with the JSON null value. By default, fields with empty
  17854. // values are omitted from API requests. However, any field with an
  17855. // empty value appearing in NullFields will be sent to the server as
  17856. // null. It is an error if a field in this list has a non-empty value.
  17857. // This may be used to include null fields in Patch requests.
  17858. NullFields []string `json:"-"`
  17859. }
  17860. func (s *RegionInstanceGroupList) MarshalJSON() ([]byte, error) {
  17861. type NoMethod RegionInstanceGroupList
  17862. raw := NoMethod(*s)
  17863. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  17864. }
  17865. // RegionInstanceGroupListWarning: [Output Only] Informational warning
  17866. // message.
  17867. type RegionInstanceGroupListWarning struct {
  17868. // Code: [Output Only] A warning code, if applicable. For example,
  17869. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  17870. // the response.
  17871. //
  17872. // Possible values:
  17873. // "CLEANUP_FAILED"
  17874. // "DEPRECATED_RESOURCE_USED"
  17875. // "DEPRECATED_TYPE_USED"
  17876. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  17877. // "EXPERIMENTAL_TYPE_USED"
  17878. // "EXTERNAL_API_WARNING"
  17879. // "FIELD_VALUE_OVERRIDEN"
  17880. // "INJECTED_KERNELS_DEPRECATED"
  17881. // "MISSING_TYPE_DEPENDENCY"
  17882. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  17883. // "NEXT_HOP_CANNOT_IP_FORWARD"
  17884. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  17885. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  17886. // "NEXT_HOP_NOT_RUNNING"
  17887. // "NOT_CRITICAL_ERROR"
  17888. // "NO_RESULTS_ON_PAGE"
  17889. // "REQUIRED_TOS_AGREEMENT"
  17890. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  17891. // "RESOURCE_NOT_DELETED"
  17892. // "SCHEMA_VALIDATION_IGNORED"
  17893. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  17894. // "UNDECLARED_PROPERTIES"
  17895. // "UNREACHABLE"
  17896. Code string `json:"code,omitempty"`
  17897. // Data: [Output Only] Metadata about this warning in key: value format.
  17898. // For example:
  17899. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  17900. Data []*RegionInstanceGroupListWarningData `json:"data,omitempty"`
  17901. // Message: [Output Only] A human-readable description of the warning
  17902. // code.
  17903. Message string `json:"message,omitempty"`
  17904. // ForceSendFields is a list of field names (e.g. "Code") to
  17905. // unconditionally include in API requests. By default, fields with
  17906. // empty values are omitted from API requests. However, any non-pointer,
  17907. // non-interface field appearing in ForceSendFields will be sent to the
  17908. // server regardless of whether the field is empty or not. This may be
  17909. // used to include empty fields in Patch requests.
  17910. ForceSendFields []string `json:"-"`
  17911. // NullFields is a list of field names (e.g. "Code") to include in API
  17912. // requests with the JSON null value. By default, fields with empty
  17913. // values are omitted from API requests. However, any field with an
  17914. // empty value appearing in NullFields will be sent to the server as
  17915. // null. It is an error if a field in this list has a non-empty value.
  17916. // This may be used to include null fields in Patch requests.
  17917. NullFields []string `json:"-"`
  17918. }
  17919. func (s *RegionInstanceGroupListWarning) MarshalJSON() ([]byte, error) {
  17920. type NoMethod RegionInstanceGroupListWarning
  17921. raw := NoMethod(*s)
  17922. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  17923. }
  17924. type RegionInstanceGroupListWarningData struct {
  17925. // Key: [Output Only] A key that provides more detail on the warning
  17926. // being returned. For example, for warnings where there are no results
  17927. // in a list request for a particular zone, this key might be scope and
  17928. // the key value might be the zone name. Other examples might be a key
  17929. // indicating a deprecated resource and a suggested replacement, or a
  17930. // warning about invalid network settings (for example, if an instance
  17931. // attempts to perform IP forwarding but is not enabled for IP
  17932. // forwarding).
  17933. Key string `json:"key,omitempty"`
  17934. // Value: [Output Only] A warning data value corresponding to the key.
  17935. Value string `json:"value,omitempty"`
  17936. // ForceSendFields is a list of field names (e.g. "Key") to
  17937. // unconditionally include in API requests. By default, fields with
  17938. // empty values are omitted from API requests. However, any non-pointer,
  17939. // non-interface field appearing in ForceSendFields will be sent to the
  17940. // server regardless of whether the field is empty or not. This may be
  17941. // used to include empty fields in Patch requests.
  17942. ForceSendFields []string `json:"-"`
  17943. // NullFields is a list of field names (e.g. "Key") to include in API
  17944. // requests with the JSON null value. By default, fields with empty
  17945. // values are omitted from API requests. However, any field with an
  17946. // empty value appearing in NullFields will be sent to the server as
  17947. // null. It is an error if a field in this list has a non-empty value.
  17948. // This may be used to include null fields in Patch requests.
  17949. NullFields []string `json:"-"`
  17950. }
  17951. func (s *RegionInstanceGroupListWarningData) MarshalJSON() ([]byte, error) {
  17952. type NoMethod RegionInstanceGroupListWarningData
  17953. raw := NoMethod(*s)
  17954. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  17955. }
  17956. // RegionInstanceGroupManagerList: Contains a list of managed instance
  17957. // groups.
  17958. type RegionInstanceGroupManagerList struct {
  17959. // Id: [Output Only] Unique identifier for the resource; defined by the
  17960. // server.
  17961. Id string `json:"id,omitempty"`
  17962. // Items: A list of InstanceGroupManager resources.
  17963. Items []*InstanceGroupManager `json:"items,omitempty"`
  17964. // Kind: [Output Only] The resource type, which is always
  17965. // compute#instanceGroupManagerList for a list of managed instance
  17966. // groups that exist in th regional scope.
  17967. Kind string `json:"kind,omitempty"`
  17968. // NextPageToken: [Output Only] This token allows you to get the next
  17969. // page of results for list requests. If the number of results is larger
  17970. // than maxResults, use the nextPageToken as a value for the query
  17971. // parameter pageToken in the next list request. Subsequent list
  17972. // requests will have their own nextPageToken to continue paging through
  17973. // the results.
  17974. NextPageToken string `json:"nextPageToken,omitempty"`
  17975. // SelfLink: [Output Only] Server-defined URL for this resource.
  17976. SelfLink string `json:"selfLink,omitempty"`
  17977. // Warning: [Output Only] Informational warning message.
  17978. Warning *RegionInstanceGroupManagerListWarning `json:"warning,omitempty"`
  17979. // ServerResponse contains the HTTP response code and headers from the
  17980. // server.
  17981. googleapi.ServerResponse `json:"-"`
  17982. // ForceSendFields is a list of field names (e.g. "Id") to
  17983. // unconditionally include in API requests. By default, fields with
  17984. // empty values are omitted from API requests. However, any non-pointer,
  17985. // non-interface field appearing in ForceSendFields will be sent to the
  17986. // server regardless of whether the field is empty or not. This may be
  17987. // used to include empty fields in Patch requests.
  17988. ForceSendFields []string `json:"-"`
  17989. // NullFields is a list of field names (e.g. "Id") to include in API
  17990. // requests with the JSON null value. By default, fields with empty
  17991. // values are omitted from API requests. However, any field with an
  17992. // empty value appearing in NullFields will be sent to the server as
  17993. // null. It is an error if a field in this list has a non-empty value.
  17994. // This may be used to include null fields in Patch requests.
  17995. NullFields []string `json:"-"`
  17996. }
  17997. func (s *RegionInstanceGroupManagerList) MarshalJSON() ([]byte, error) {
  17998. type NoMethod RegionInstanceGroupManagerList
  17999. raw := NoMethod(*s)
  18000. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  18001. }
  18002. // RegionInstanceGroupManagerListWarning: [Output Only] Informational
  18003. // warning message.
  18004. type RegionInstanceGroupManagerListWarning struct {
  18005. // Code: [Output Only] A warning code, if applicable. For example,
  18006. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  18007. // the response.
  18008. //
  18009. // Possible values:
  18010. // "CLEANUP_FAILED"
  18011. // "DEPRECATED_RESOURCE_USED"
  18012. // "DEPRECATED_TYPE_USED"
  18013. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  18014. // "EXPERIMENTAL_TYPE_USED"
  18015. // "EXTERNAL_API_WARNING"
  18016. // "FIELD_VALUE_OVERRIDEN"
  18017. // "INJECTED_KERNELS_DEPRECATED"
  18018. // "MISSING_TYPE_DEPENDENCY"
  18019. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  18020. // "NEXT_HOP_CANNOT_IP_FORWARD"
  18021. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  18022. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  18023. // "NEXT_HOP_NOT_RUNNING"
  18024. // "NOT_CRITICAL_ERROR"
  18025. // "NO_RESULTS_ON_PAGE"
  18026. // "REQUIRED_TOS_AGREEMENT"
  18027. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  18028. // "RESOURCE_NOT_DELETED"
  18029. // "SCHEMA_VALIDATION_IGNORED"
  18030. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  18031. // "UNDECLARED_PROPERTIES"
  18032. // "UNREACHABLE"
  18033. Code string `json:"code,omitempty"`
  18034. // Data: [Output Only] Metadata about this warning in key: value format.
  18035. // For example:
  18036. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  18037. Data []*RegionInstanceGroupManagerListWarningData `json:"data,omitempty"`
  18038. // Message: [Output Only] A human-readable description of the warning
  18039. // code.
  18040. Message string `json:"message,omitempty"`
  18041. // ForceSendFields is a list of field names (e.g. "Code") to
  18042. // unconditionally include in API requests. By default, fields with
  18043. // empty values are omitted from API requests. However, any non-pointer,
  18044. // non-interface field appearing in ForceSendFields will be sent to the
  18045. // server regardless of whether the field is empty or not. This may be
  18046. // used to include empty fields in Patch requests.
  18047. ForceSendFields []string `json:"-"`
  18048. // NullFields is a list of field names (e.g. "Code") to include in API
  18049. // requests with the JSON null value. By default, fields with empty
  18050. // values are omitted from API requests. However, any field with an
  18051. // empty value appearing in NullFields will be sent to the server as
  18052. // null. It is an error if a field in this list has a non-empty value.
  18053. // This may be used to include null fields in Patch requests.
  18054. NullFields []string `json:"-"`
  18055. }
  18056. func (s *RegionInstanceGroupManagerListWarning) MarshalJSON() ([]byte, error) {
  18057. type NoMethod RegionInstanceGroupManagerListWarning
  18058. raw := NoMethod(*s)
  18059. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  18060. }
  18061. type RegionInstanceGroupManagerListWarningData struct {
  18062. // Key: [Output Only] A key that provides more detail on the warning
  18063. // being returned. For example, for warnings where there are no results
  18064. // in a list request for a particular zone, this key might be scope and
  18065. // the key value might be the zone name. Other examples might be a key
  18066. // indicating a deprecated resource and a suggested replacement, or a
  18067. // warning about invalid network settings (for example, if an instance
  18068. // attempts to perform IP forwarding but is not enabled for IP
  18069. // forwarding).
  18070. Key string `json:"key,omitempty"`
  18071. // Value: [Output Only] A warning data value corresponding to the key.
  18072. Value string `json:"value,omitempty"`
  18073. // ForceSendFields is a list of field names (e.g. "Key") to
  18074. // unconditionally include in API requests. By default, fields with
  18075. // empty values are omitted from API requests. However, any non-pointer,
  18076. // non-interface field appearing in ForceSendFields will be sent to the
  18077. // server regardless of whether the field is empty or not. This may be
  18078. // used to include empty fields in Patch requests.
  18079. ForceSendFields []string `json:"-"`
  18080. // NullFields is a list of field names (e.g. "Key") to include in API
  18081. // requests with the JSON null value. By default, fields with empty
  18082. // values are omitted from API requests. However, any field with an
  18083. // empty value appearing in NullFields will be sent to the server as
  18084. // null. It is an error if a field in this list has a non-empty value.
  18085. // This may be used to include null fields in Patch requests.
  18086. NullFields []string `json:"-"`
  18087. }
  18088. func (s *RegionInstanceGroupManagerListWarningData) MarshalJSON() ([]byte, error) {
  18089. type NoMethod RegionInstanceGroupManagerListWarningData
  18090. raw := NoMethod(*s)
  18091. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  18092. }
  18093. type RegionInstanceGroupManagersAbandonInstancesRequest struct {
  18094. // Instances: The URLs of one or more instances to abandon. This can be
  18095. // a full URL or a partial URL, such as
  18096. // zones/[ZONE]/instances/[INSTANCE_NAME].
  18097. Instances []string `json:"instances,omitempty"`
  18098. // ForceSendFields is a list of field names (e.g. "Instances") to
  18099. // unconditionally include in API requests. By default, fields with
  18100. // empty values are omitted from API requests. However, any non-pointer,
  18101. // non-interface field appearing in ForceSendFields will be sent to the
  18102. // server regardless of whether the field is empty or not. This may be
  18103. // used to include empty fields in Patch requests.
  18104. ForceSendFields []string `json:"-"`
  18105. // NullFields is a list of field names (e.g. "Instances") to include in
  18106. // API requests with the JSON null value. By default, fields with empty
  18107. // values are omitted from API requests. However, any field with an
  18108. // empty value appearing in NullFields will be sent to the server as
  18109. // null. It is an error if a field in this list has a non-empty value.
  18110. // This may be used to include null fields in Patch requests.
  18111. NullFields []string `json:"-"`
  18112. }
  18113. func (s *RegionInstanceGroupManagersAbandonInstancesRequest) MarshalJSON() ([]byte, error) {
  18114. type NoMethod RegionInstanceGroupManagersAbandonInstancesRequest
  18115. raw := NoMethod(*s)
  18116. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  18117. }
  18118. type RegionInstanceGroupManagersDeleteInstancesRequest struct {
  18119. // Instances: The URLs of one or more instances to delete. This can be a
  18120. // full URL or a partial URL, such as
  18121. // zones/[ZONE]/instances/[INSTANCE_NAME].
  18122. Instances []string `json:"instances,omitempty"`
  18123. // ForceSendFields is a list of field names (e.g. "Instances") to
  18124. // unconditionally include in API requests. By default, fields with
  18125. // empty values are omitted from API requests. However, any non-pointer,
  18126. // non-interface field appearing in ForceSendFields will be sent to the
  18127. // server regardless of whether the field is empty or not. This may be
  18128. // used to include empty fields in Patch requests.
  18129. ForceSendFields []string `json:"-"`
  18130. // NullFields is a list of field names (e.g. "Instances") to include in
  18131. // API requests with the JSON null value. By default, fields with empty
  18132. // values are omitted from API requests. However, any field with an
  18133. // empty value appearing in NullFields will be sent to the server as
  18134. // null. It is an error if a field in this list has a non-empty value.
  18135. // This may be used to include null fields in Patch requests.
  18136. NullFields []string `json:"-"`
  18137. }
  18138. func (s *RegionInstanceGroupManagersDeleteInstancesRequest) MarshalJSON() ([]byte, error) {
  18139. type NoMethod RegionInstanceGroupManagersDeleteInstancesRequest
  18140. raw := NoMethod(*s)
  18141. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  18142. }
  18143. type RegionInstanceGroupManagersListInstancesResponse struct {
  18144. // ManagedInstances: A list of managed instances.
  18145. ManagedInstances []*ManagedInstance `json:"managedInstances,omitempty"`
  18146. // NextPageToken: [Output Only] This token allows you to get the next
  18147. // page of results for list requests. If the number of results is larger
  18148. // than maxResults, use the nextPageToken as a value for the query
  18149. // parameter pageToken in the next list request. Subsequent list
  18150. // requests will have their own nextPageToken to continue paging through
  18151. // the results.
  18152. NextPageToken string `json:"nextPageToken,omitempty"`
  18153. // ServerResponse contains the HTTP response code and headers from the
  18154. // server.
  18155. googleapi.ServerResponse `json:"-"`
  18156. // ForceSendFields is a list of field names (e.g. "ManagedInstances") to
  18157. // unconditionally include in API requests. By default, fields with
  18158. // empty values are omitted from API requests. However, any non-pointer,
  18159. // non-interface field appearing in ForceSendFields will be sent to the
  18160. // server regardless of whether the field is empty or not. This may be
  18161. // used to include empty fields in Patch requests.
  18162. ForceSendFields []string `json:"-"`
  18163. // NullFields is a list of field names (e.g. "ManagedInstances") to
  18164. // include in API requests with the JSON null value. By default, fields
  18165. // with empty values are omitted from API requests. However, any field
  18166. // with an empty value appearing in NullFields will be sent to the
  18167. // server as null. It is an error if a field in this list has a
  18168. // non-empty value. This may be used to include null fields in Patch
  18169. // requests.
  18170. NullFields []string `json:"-"`
  18171. }
  18172. func (s *RegionInstanceGroupManagersListInstancesResponse) MarshalJSON() ([]byte, error) {
  18173. type NoMethod RegionInstanceGroupManagersListInstancesResponse
  18174. raw := NoMethod(*s)
  18175. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  18176. }
  18177. type RegionInstanceGroupManagersRecreateRequest struct {
  18178. // Instances: The URLs of one or more instances to recreate. This can be
  18179. // a full URL or a partial URL, such as
  18180. // zones/[ZONE]/instances/[INSTANCE_NAME].
  18181. Instances []string `json:"instances,omitempty"`
  18182. // ForceSendFields is a list of field names (e.g. "Instances") to
  18183. // unconditionally include in API requests. By default, fields with
  18184. // empty values are omitted from API requests. However, any non-pointer,
  18185. // non-interface field appearing in ForceSendFields will be sent to the
  18186. // server regardless of whether the field is empty or not. This may be
  18187. // used to include empty fields in Patch requests.
  18188. ForceSendFields []string `json:"-"`
  18189. // NullFields is a list of field names (e.g. "Instances") to include in
  18190. // API requests with the JSON null value. By default, fields with empty
  18191. // values are omitted from API requests. However, any field with an
  18192. // empty value appearing in NullFields will be sent to the server as
  18193. // null. It is an error if a field in this list has a non-empty value.
  18194. // This may be used to include null fields in Patch requests.
  18195. NullFields []string `json:"-"`
  18196. }
  18197. func (s *RegionInstanceGroupManagersRecreateRequest) MarshalJSON() ([]byte, error) {
  18198. type NoMethod RegionInstanceGroupManagersRecreateRequest
  18199. raw := NoMethod(*s)
  18200. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  18201. }
  18202. type RegionInstanceGroupManagersSetAutoHealingRequest struct {
  18203. AutoHealingPolicies []*InstanceGroupManagerAutoHealingPolicy `json:"autoHealingPolicies,omitempty"`
  18204. // ForceSendFields is a list of field names (e.g. "AutoHealingPolicies")
  18205. // to unconditionally include in API requests. By default, fields with
  18206. // empty values are omitted from API requests. However, any non-pointer,
  18207. // non-interface field appearing in ForceSendFields will be sent to the
  18208. // server regardless of whether the field is empty or not. This may be
  18209. // used to include empty fields in Patch requests.
  18210. ForceSendFields []string `json:"-"`
  18211. // NullFields is a list of field names (e.g. "AutoHealingPolicies") to
  18212. // include in API requests with the JSON null value. By default, fields
  18213. // with empty values are omitted from API requests. However, any field
  18214. // with an empty value appearing in NullFields will be sent to the
  18215. // server as null. It is an error if a field in this list has a
  18216. // non-empty value. This may be used to include null fields in Patch
  18217. // requests.
  18218. NullFields []string `json:"-"`
  18219. }
  18220. func (s *RegionInstanceGroupManagersSetAutoHealingRequest) MarshalJSON() ([]byte, error) {
  18221. type NoMethod RegionInstanceGroupManagersSetAutoHealingRequest
  18222. raw := NoMethod(*s)
  18223. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  18224. }
  18225. type RegionInstanceGroupManagersSetTargetPoolsRequest struct {
  18226. // Fingerprint: Fingerprint of the target pools information, which is a
  18227. // hash of the contents. This field is used for optimistic locking when
  18228. // you update the target pool entries. This field is optional.
  18229. Fingerprint string `json:"fingerprint,omitempty"`
  18230. // TargetPools: The URL of all TargetPool resources to which instances
  18231. // in the instanceGroup field are added. The target pools automatically
  18232. // apply to all of the instances in the managed instance group.
  18233. TargetPools []string `json:"targetPools,omitempty"`
  18234. // ForceSendFields is a list of field names (e.g. "Fingerprint") to
  18235. // unconditionally include in API requests. By default, fields with
  18236. // empty values are omitted from API requests. However, any non-pointer,
  18237. // non-interface field appearing in ForceSendFields will be sent to the
  18238. // server regardless of whether the field is empty or not. This may be
  18239. // used to include empty fields in Patch requests.
  18240. ForceSendFields []string `json:"-"`
  18241. // NullFields is a list of field names (e.g. "Fingerprint") to include
  18242. // in API requests with the JSON null value. By default, fields with
  18243. // empty values are omitted from API requests. However, any field with
  18244. // an empty value appearing in NullFields will be sent to the server as
  18245. // null. It is an error if a field in this list has a non-empty value.
  18246. // This may be used to include null fields in Patch requests.
  18247. NullFields []string `json:"-"`
  18248. }
  18249. func (s *RegionInstanceGroupManagersSetTargetPoolsRequest) MarshalJSON() ([]byte, error) {
  18250. type NoMethod RegionInstanceGroupManagersSetTargetPoolsRequest
  18251. raw := NoMethod(*s)
  18252. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  18253. }
  18254. type RegionInstanceGroupManagersSetTemplateRequest struct {
  18255. // InstanceTemplate: URL of the InstanceTemplate resource from which all
  18256. // new instances will be created.
  18257. InstanceTemplate string `json:"instanceTemplate,omitempty"`
  18258. // ForceSendFields is a list of field names (e.g. "InstanceTemplate") to
  18259. // unconditionally include in API requests. By default, fields with
  18260. // empty values are omitted from API requests. However, any non-pointer,
  18261. // non-interface field appearing in ForceSendFields will be sent to the
  18262. // server regardless of whether the field is empty or not. This may be
  18263. // used to include empty fields in Patch requests.
  18264. ForceSendFields []string `json:"-"`
  18265. // NullFields is a list of field names (e.g. "InstanceTemplate") to
  18266. // include in API requests with the JSON null value. By default, fields
  18267. // with empty values are omitted from API requests. However, any field
  18268. // with an empty value appearing in NullFields will be sent to the
  18269. // server as null. It is an error if a field in this list has a
  18270. // non-empty value. This may be used to include null fields in Patch
  18271. // requests.
  18272. NullFields []string `json:"-"`
  18273. }
  18274. func (s *RegionInstanceGroupManagersSetTemplateRequest) MarshalJSON() ([]byte, error) {
  18275. type NoMethod RegionInstanceGroupManagersSetTemplateRequest
  18276. raw := NoMethod(*s)
  18277. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  18278. }
  18279. type RegionInstanceGroupsListInstances struct {
  18280. // Id: [Output Only] Unique identifier for the resource; defined by the
  18281. // server.
  18282. Id string `json:"id,omitempty"`
  18283. // Items: A list of InstanceWithNamedPorts resources.
  18284. Items []*InstanceWithNamedPorts `json:"items,omitempty"`
  18285. // Kind: The resource type.
  18286. Kind string `json:"kind,omitempty"`
  18287. // NextPageToken: [Output Only] This token allows you to get the next
  18288. // page of results for list requests. If the number of results is larger
  18289. // than maxResults, use the nextPageToken as a value for the query
  18290. // parameter pageToken in the next list request. Subsequent list
  18291. // requests will have their own nextPageToken to continue paging through
  18292. // the results.
  18293. NextPageToken string `json:"nextPageToken,omitempty"`
  18294. // SelfLink: [Output Only] Server-defined URL for this resource.
  18295. SelfLink string `json:"selfLink,omitempty"`
  18296. // Warning: [Output Only] Informational warning message.
  18297. Warning *RegionInstanceGroupsListInstancesWarning `json:"warning,omitempty"`
  18298. // ServerResponse contains the HTTP response code and headers from the
  18299. // server.
  18300. googleapi.ServerResponse `json:"-"`
  18301. // ForceSendFields is a list of field names (e.g. "Id") to
  18302. // unconditionally include in API requests. By default, fields with
  18303. // empty values are omitted from API requests. However, any non-pointer,
  18304. // non-interface field appearing in ForceSendFields will be sent to the
  18305. // server regardless of whether the field is empty or not. This may be
  18306. // used to include empty fields in Patch requests.
  18307. ForceSendFields []string `json:"-"`
  18308. // NullFields is a list of field names (e.g. "Id") to include in API
  18309. // requests with the JSON null value. By default, fields with empty
  18310. // values are omitted from API requests. However, any field with an
  18311. // empty value appearing in NullFields will be sent to the server as
  18312. // null. It is an error if a field in this list has a non-empty value.
  18313. // This may be used to include null fields in Patch requests.
  18314. NullFields []string `json:"-"`
  18315. }
  18316. func (s *RegionInstanceGroupsListInstances) MarshalJSON() ([]byte, error) {
  18317. type NoMethod RegionInstanceGroupsListInstances
  18318. raw := NoMethod(*s)
  18319. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  18320. }
  18321. // RegionInstanceGroupsListInstancesWarning: [Output Only] Informational
  18322. // warning message.
  18323. type RegionInstanceGroupsListInstancesWarning struct {
  18324. // Code: [Output Only] A warning code, if applicable. For example,
  18325. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  18326. // the response.
  18327. //
  18328. // Possible values:
  18329. // "CLEANUP_FAILED"
  18330. // "DEPRECATED_RESOURCE_USED"
  18331. // "DEPRECATED_TYPE_USED"
  18332. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  18333. // "EXPERIMENTAL_TYPE_USED"
  18334. // "EXTERNAL_API_WARNING"
  18335. // "FIELD_VALUE_OVERRIDEN"
  18336. // "INJECTED_KERNELS_DEPRECATED"
  18337. // "MISSING_TYPE_DEPENDENCY"
  18338. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  18339. // "NEXT_HOP_CANNOT_IP_FORWARD"
  18340. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  18341. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  18342. // "NEXT_HOP_NOT_RUNNING"
  18343. // "NOT_CRITICAL_ERROR"
  18344. // "NO_RESULTS_ON_PAGE"
  18345. // "REQUIRED_TOS_AGREEMENT"
  18346. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  18347. // "RESOURCE_NOT_DELETED"
  18348. // "SCHEMA_VALIDATION_IGNORED"
  18349. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  18350. // "UNDECLARED_PROPERTIES"
  18351. // "UNREACHABLE"
  18352. Code string `json:"code,omitempty"`
  18353. // Data: [Output Only] Metadata about this warning in key: value format.
  18354. // For example:
  18355. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  18356. Data []*RegionInstanceGroupsListInstancesWarningData `json:"data,omitempty"`
  18357. // Message: [Output Only] A human-readable description of the warning
  18358. // code.
  18359. Message string `json:"message,omitempty"`
  18360. // ForceSendFields is a list of field names (e.g. "Code") to
  18361. // unconditionally include in API requests. By default, fields with
  18362. // empty values are omitted from API requests. However, any non-pointer,
  18363. // non-interface field appearing in ForceSendFields will be sent to the
  18364. // server regardless of whether the field is empty or not. This may be
  18365. // used to include empty fields in Patch requests.
  18366. ForceSendFields []string `json:"-"`
  18367. // NullFields is a list of field names (e.g. "Code") to include in API
  18368. // requests with the JSON null value. By default, fields with empty
  18369. // values are omitted from API requests. However, any field with an
  18370. // empty value appearing in NullFields will be sent to the server as
  18371. // null. It is an error if a field in this list has a non-empty value.
  18372. // This may be used to include null fields in Patch requests.
  18373. NullFields []string `json:"-"`
  18374. }
  18375. func (s *RegionInstanceGroupsListInstancesWarning) MarshalJSON() ([]byte, error) {
  18376. type NoMethod RegionInstanceGroupsListInstancesWarning
  18377. raw := NoMethod(*s)
  18378. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  18379. }
  18380. type RegionInstanceGroupsListInstancesWarningData struct {
  18381. // Key: [Output Only] A key that provides more detail on the warning
  18382. // being returned. For example, for warnings where there are no results
  18383. // in a list request for a particular zone, this key might be scope and
  18384. // the key value might be the zone name. Other examples might be a key
  18385. // indicating a deprecated resource and a suggested replacement, or a
  18386. // warning about invalid network settings (for example, if an instance
  18387. // attempts to perform IP forwarding but is not enabled for IP
  18388. // forwarding).
  18389. Key string `json:"key,omitempty"`
  18390. // Value: [Output Only] A warning data value corresponding to the key.
  18391. Value string `json:"value,omitempty"`
  18392. // ForceSendFields is a list of field names (e.g. "Key") to
  18393. // unconditionally include in API requests. By default, fields with
  18394. // empty values are omitted from API requests. However, any non-pointer,
  18395. // non-interface field appearing in ForceSendFields will be sent to the
  18396. // server regardless of whether the field is empty or not. This may be
  18397. // used to include empty fields in Patch requests.
  18398. ForceSendFields []string `json:"-"`
  18399. // NullFields is a list of field names (e.g. "Key") to include in API
  18400. // requests with the JSON null value. By default, fields with empty
  18401. // values are omitted from API requests. However, any field with an
  18402. // empty value appearing in NullFields will be sent to the server as
  18403. // null. It is an error if a field in this list has a non-empty value.
  18404. // This may be used to include null fields in Patch requests.
  18405. NullFields []string `json:"-"`
  18406. }
  18407. func (s *RegionInstanceGroupsListInstancesWarningData) MarshalJSON() ([]byte, error) {
  18408. type NoMethod RegionInstanceGroupsListInstancesWarningData
  18409. raw := NoMethod(*s)
  18410. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  18411. }
  18412. type RegionInstanceGroupsListInstancesRequest struct {
  18413. // InstanceState: Instances in which state should be returned. Valid
  18414. // options are: 'ALL', 'RUNNING'. By default, it lists all instances.
  18415. //
  18416. // Possible values:
  18417. // "ALL"
  18418. // "RUNNING"
  18419. InstanceState string `json:"instanceState,omitempty"`
  18420. // PortName: Name of port user is interested in. It is optional. If it
  18421. // is set, only information about this ports will be returned. If it is
  18422. // not set, all the named ports will be returned. Always lists all
  18423. // instances.
  18424. PortName string `json:"portName,omitempty"`
  18425. // ForceSendFields is a list of field names (e.g. "InstanceState") to
  18426. // unconditionally include in API requests. By default, fields with
  18427. // empty values are omitted from API requests. However, any non-pointer,
  18428. // non-interface field appearing in ForceSendFields will be sent to the
  18429. // server regardless of whether the field is empty or not. This may be
  18430. // used to include empty fields in Patch requests.
  18431. ForceSendFields []string `json:"-"`
  18432. // NullFields is a list of field names (e.g. "InstanceState") to include
  18433. // in API requests with the JSON null value. By default, fields with
  18434. // empty values are omitted from API requests. However, any field with
  18435. // an empty value appearing in NullFields will be sent to the server as
  18436. // null. It is an error if a field in this list has a non-empty value.
  18437. // This may be used to include null fields in Patch requests.
  18438. NullFields []string `json:"-"`
  18439. }
  18440. func (s *RegionInstanceGroupsListInstancesRequest) MarshalJSON() ([]byte, error) {
  18441. type NoMethod RegionInstanceGroupsListInstancesRequest
  18442. raw := NoMethod(*s)
  18443. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  18444. }
  18445. type RegionInstanceGroupsSetNamedPortsRequest struct {
  18446. // Fingerprint: The fingerprint of the named ports information for this
  18447. // instance group. Use this optional property to prevent conflicts when
  18448. // multiple users change the named ports settings concurrently. Obtain
  18449. // the fingerprint with the instanceGroups.get method. Then, include the
  18450. // fingerprint in your request to ensure that you do not overwrite
  18451. // changes that were applied from another concurrent request.
  18452. Fingerprint string `json:"fingerprint,omitempty"`
  18453. // NamedPorts: The list of named ports to set for this instance group.
  18454. NamedPorts []*NamedPort `json:"namedPorts,omitempty"`
  18455. // ForceSendFields is a list of field names (e.g. "Fingerprint") to
  18456. // unconditionally include in API requests. By default, fields with
  18457. // empty values are omitted from API requests. However, any non-pointer,
  18458. // non-interface field appearing in ForceSendFields will be sent to the
  18459. // server regardless of whether the field is empty or not. This may be
  18460. // used to include empty fields in Patch requests.
  18461. ForceSendFields []string `json:"-"`
  18462. // NullFields is a list of field names (e.g. "Fingerprint") to include
  18463. // in API requests with the JSON null value. By default, fields with
  18464. // empty values are omitted from API requests. However, any field with
  18465. // an empty value appearing in NullFields will be sent to the server as
  18466. // null. It is an error if a field in this list has a non-empty value.
  18467. // This may be used to include null fields in Patch requests.
  18468. NullFields []string `json:"-"`
  18469. }
  18470. func (s *RegionInstanceGroupsSetNamedPortsRequest) MarshalJSON() ([]byte, error) {
  18471. type NoMethod RegionInstanceGroupsSetNamedPortsRequest
  18472. raw := NoMethod(*s)
  18473. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  18474. }
  18475. // RegionList: Contains a list of region resources.
  18476. type RegionList struct {
  18477. // Id: [Output Only] Unique identifier for the resource; defined by the
  18478. // server.
  18479. Id string `json:"id,omitempty"`
  18480. // Items: A list of Region resources.
  18481. Items []*Region `json:"items,omitempty"`
  18482. // Kind: [Output Only] Type of resource. Always compute#regionList for
  18483. // lists of regions.
  18484. Kind string `json:"kind,omitempty"`
  18485. // NextPageToken: [Output Only] This token allows you to get the next
  18486. // page of results for list requests. If the number of results is larger
  18487. // than maxResults, use the nextPageToken as a value for the query
  18488. // parameter pageToken in the next list request. Subsequent list
  18489. // requests will have their own nextPageToken to continue paging through
  18490. // the results.
  18491. NextPageToken string `json:"nextPageToken,omitempty"`
  18492. // SelfLink: [Output Only] Server-defined URL for this resource.
  18493. SelfLink string `json:"selfLink,omitempty"`
  18494. // Warning: [Output Only] Informational warning message.
  18495. Warning *RegionListWarning `json:"warning,omitempty"`
  18496. // ServerResponse contains the HTTP response code and headers from the
  18497. // server.
  18498. googleapi.ServerResponse `json:"-"`
  18499. // ForceSendFields is a list of field names (e.g. "Id") to
  18500. // unconditionally include in API requests. By default, fields with
  18501. // empty values are omitted from API requests. However, any non-pointer,
  18502. // non-interface field appearing in ForceSendFields will be sent to the
  18503. // server regardless of whether the field is empty or not. This may be
  18504. // used to include empty fields in Patch requests.
  18505. ForceSendFields []string `json:"-"`
  18506. // NullFields is a list of field names (e.g. "Id") to include in API
  18507. // requests with the JSON null value. By default, fields with empty
  18508. // values are omitted from API requests. However, any field with an
  18509. // empty value appearing in NullFields will be sent to the server as
  18510. // null. It is an error if a field in this list has a non-empty value.
  18511. // This may be used to include null fields in Patch requests.
  18512. NullFields []string `json:"-"`
  18513. }
  18514. func (s *RegionList) MarshalJSON() ([]byte, error) {
  18515. type NoMethod RegionList
  18516. raw := NoMethod(*s)
  18517. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  18518. }
  18519. // RegionListWarning: [Output Only] Informational warning message.
  18520. type RegionListWarning struct {
  18521. // Code: [Output Only] A warning code, if applicable. For example,
  18522. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  18523. // the response.
  18524. //
  18525. // Possible values:
  18526. // "CLEANUP_FAILED"
  18527. // "DEPRECATED_RESOURCE_USED"
  18528. // "DEPRECATED_TYPE_USED"
  18529. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  18530. // "EXPERIMENTAL_TYPE_USED"
  18531. // "EXTERNAL_API_WARNING"
  18532. // "FIELD_VALUE_OVERRIDEN"
  18533. // "INJECTED_KERNELS_DEPRECATED"
  18534. // "MISSING_TYPE_DEPENDENCY"
  18535. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  18536. // "NEXT_HOP_CANNOT_IP_FORWARD"
  18537. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  18538. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  18539. // "NEXT_HOP_NOT_RUNNING"
  18540. // "NOT_CRITICAL_ERROR"
  18541. // "NO_RESULTS_ON_PAGE"
  18542. // "REQUIRED_TOS_AGREEMENT"
  18543. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  18544. // "RESOURCE_NOT_DELETED"
  18545. // "SCHEMA_VALIDATION_IGNORED"
  18546. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  18547. // "UNDECLARED_PROPERTIES"
  18548. // "UNREACHABLE"
  18549. Code string `json:"code,omitempty"`
  18550. // Data: [Output Only] Metadata about this warning in key: value format.
  18551. // For example:
  18552. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  18553. Data []*RegionListWarningData `json:"data,omitempty"`
  18554. // Message: [Output Only] A human-readable description of the warning
  18555. // code.
  18556. Message string `json:"message,omitempty"`
  18557. // ForceSendFields is a list of field names (e.g. "Code") to
  18558. // unconditionally include in API requests. By default, fields with
  18559. // empty values are omitted from API requests. However, any non-pointer,
  18560. // non-interface field appearing in ForceSendFields will be sent to the
  18561. // server regardless of whether the field is empty or not. This may be
  18562. // used to include empty fields in Patch requests.
  18563. ForceSendFields []string `json:"-"`
  18564. // NullFields is a list of field names (e.g. "Code") to include in API
  18565. // requests with the JSON null value. By default, fields with empty
  18566. // values are omitted from API requests. However, any field with an
  18567. // empty value appearing in NullFields will be sent to the server as
  18568. // null. It is an error if a field in this list has a non-empty value.
  18569. // This may be used to include null fields in Patch requests.
  18570. NullFields []string `json:"-"`
  18571. }
  18572. func (s *RegionListWarning) MarshalJSON() ([]byte, error) {
  18573. type NoMethod RegionListWarning
  18574. raw := NoMethod(*s)
  18575. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  18576. }
  18577. type RegionListWarningData struct {
  18578. // Key: [Output Only] A key that provides more detail on the warning
  18579. // being returned. For example, for warnings where there are no results
  18580. // in a list request for a particular zone, this key might be scope and
  18581. // the key value might be the zone name. Other examples might be a key
  18582. // indicating a deprecated resource and a suggested replacement, or a
  18583. // warning about invalid network settings (for example, if an instance
  18584. // attempts to perform IP forwarding but is not enabled for IP
  18585. // forwarding).
  18586. Key string `json:"key,omitempty"`
  18587. // Value: [Output Only] A warning data value corresponding to the key.
  18588. Value string `json:"value,omitempty"`
  18589. // ForceSendFields is a list of field names (e.g. "Key") to
  18590. // unconditionally include in API requests. By default, fields with
  18591. // empty values are omitted from API requests. However, any non-pointer,
  18592. // non-interface field appearing in ForceSendFields will be sent to the
  18593. // server regardless of whether the field is empty or not. This may be
  18594. // used to include empty fields in Patch requests.
  18595. ForceSendFields []string `json:"-"`
  18596. // NullFields is a list of field names (e.g. "Key") to include in API
  18597. // requests with the JSON null value. By default, fields with empty
  18598. // values are omitted from API requests. However, any field with an
  18599. // empty value appearing in NullFields will be sent to the server as
  18600. // null. It is an error if a field in this list has a non-empty value.
  18601. // This may be used to include null fields in Patch requests.
  18602. NullFields []string `json:"-"`
  18603. }
  18604. func (s *RegionListWarningData) MarshalJSON() ([]byte, error) {
  18605. type NoMethod RegionListWarningData
  18606. raw := NoMethod(*s)
  18607. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  18608. }
  18609. type RegionSetLabelsRequest struct {
  18610. // LabelFingerprint: The fingerprint of the previous set of labels for
  18611. // this resource, used to detect conflicts. The fingerprint is initially
  18612. // generated by Compute Engine and changes after every request to modify
  18613. // or update labels. You must always provide an up-to-date fingerprint
  18614. // hash in order to update or change labels. Make a get() request to the
  18615. // resource to get the latest fingerprint.
  18616. LabelFingerprint string `json:"labelFingerprint,omitempty"`
  18617. // Labels: The labels to set for this resource.
  18618. Labels map[string]string `json:"labels,omitempty"`
  18619. // ForceSendFields is a list of field names (e.g. "LabelFingerprint") to
  18620. // unconditionally include in API requests. By default, fields with
  18621. // empty values are omitted from API requests. However, any non-pointer,
  18622. // non-interface field appearing in ForceSendFields will be sent to the
  18623. // server regardless of whether the field is empty or not. This may be
  18624. // used to include empty fields in Patch requests.
  18625. ForceSendFields []string `json:"-"`
  18626. // NullFields is a list of field names (e.g. "LabelFingerprint") to
  18627. // include in API requests with the JSON null value. By default, fields
  18628. // with empty values are omitted from API requests. However, any field
  18629. // with an empty value appearing in NullFields will be sent to the
  18630. // server as null. It is an error if a field in this list has a
  18631. // non-empty value. This may be used to include null fields in Patch
  18632. // requests.
  18633. NullFields []string `json:"-"`
  18634. }
  18635. func (s *RegionSetLabelsRequest) MarshalJSON() ([]byte, error) {
  18636. type NoMethod RegionSetLabelsRequest
  18637. raw := NoMethod(*s)
  18638. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  18639. }
  18640. type RegionSetPolicyRequest struct {
  18641. // Bindings: Flatten Policy to create a backwacd compatible wire-format.
  18642. // Deprecated. Use 'policy' to specify bindings.
  18643. Bindings []*Binding `json:"bindings,omitempty"`
  18644. // Etag: Flatten Policy to create a backward compatible wire-format.
  18645. // Deprecated. Use 'policy' to specify the etag.
  18646. Etag string `json:"etag,omitempty"`
  18647. // Policy: REQUIRED: The complete policy to be applied to the
  18648. // 'resource'. The size of the policy is limited to a few 10s of KB. An
  18649. // empty policy is in general a valid policy but certain services (like
  18650. // Projects) might reject them.
  18651. Policy *Policy `json:"policy,omitempty"`
  18652. // ForceSendFields is a list of field names (e.g. "Bindings") to
  18653. // unconditionally include in API requests. By default, fields with
  18654. // empty values are omitted from API requests. However, any non-pointer,
  18655. // non-interface field appearing in ForceSendFields will be sent to the
  18656. // server regardless of whether the field is empty or not. This may be
  18657. // used to include empty fields in Patch requests.
  18658. ForceSendFields []string `json:"-"`
  18659. // NullFields is a list of field names (e.g. "Bindings") to include in
  18660. // API requests with the JSON null value. By default, fields with empty
  18661. // values are omitted from API requests. However, any field with an
  18662. // empty value appearing in NullFields will be sent to the server as
  18663. // null. It is an error if a field in this list has a non-empty value.
  18664. // This may be used to include null fields in Patch requests.
  18665. NullFields []string `json:"-"`
  18666. }
  18667. func (s *RegionSetPolicyRequest) MarshalJSON() ([]byte, error) {
  18668. type NoMethod RegionSetPolicyRequest
  18669. raw := NoMethod(*s)
  18670. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  18671. }
  18672. // ResourceCommitment: Commitment for a particular resource (a
  18673. // Commitment is composed of one or more of these).
  18674. type ResourceCommitment struct {
  18675. // Amount: The amount of the resource purchased (in a type-dependent
  18676. // unit, such as bytes). For vCPUs, this can just be an integer. For
  18677. // memory, this must be provided in MB. Memory must be a multiple of 256
  18678. // MB, with up to 6.5GB of memory per every vCPU.
  18679. Amount int64 `json:"amount,omitempty,string"`
  18680. // Type: Type of resource for which this commitment applies. Possible
  18681. // values are VCPU and MEMORY
  18682. //
  18683. // Possible values:
  18684. // "MEMORY"
  18685. // "UNSPECIFIED"
  18686. // "VCPU"
  18687. Type string `json:"type,omitempty"`
  18688. // ForceSendFields is a list of field names (e.g. "Amount") to
  18689. // unconditionally include in API requests. By default, fields with
  18690. // empty values are omitted from API requests. However, any non-pointer,
  18691. // non-interface field appearing in ForceSendFields will be sent to the
  18692. // server regardless of whether the field is empty or not. This may be
  18693. // used to include empty fields in Patch requests.
  18694. ForceSendFields []string `json:"-"`
  18695. // NullFields is a list of field names (e.g. "Amount") to include in API
  18696. // requests with the JSON null value. By default, fields with empty
  18697. // values are omitted from API requests. However, any field with an
  18698. // empty value appearing in NullFields will be sent to the server as
  18699. // null. It is an error if a field in this list has a non-empty value.
  18700. // This may be used to include null fields in Patch requests.
  18701. NullFields []string `json:"-"`
  18702. }
  18703. func (s *ResourceCommitment) MarshalJSON() ([]byte, error) {
  18704. type NoMethod ResourceCommitment
  18705. raw := NoMethod(*s)
  18706. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  18707. }
  18708. type ResourceGroupReference struct {
  18709. // Group: A URI referencing one of the instance groups listed in the
  18710. // backend service.
  18711. Group string `json:"group,omitempty"`
  18712. // ForceSendFields is a list of field names (e.g. "Group") to
  18713. // unconditionally include in API requests. By default, fields with
  18714. // empty values are omitted from API requests. However, any non-pointer,
  18715. // non-interface field appearing in ForceSendFields will be sent to the
  18716. // server regardless of whether the field is empty or not. This may be
  18717. // used to include empty fields in Patch requests.
  18718. ForceSendFields []string `json:"-"`
  18719. // NullFields is a list of field names (e.g. "Group") to include in API
  18720. // requests with the JSON null value. By default, fields with empty
  18721. // values are omitted from API requests. However, any field with an
  18722. // empty value appearing in NullFields will be sent to the server as
  18723. // null. It is an error if a field in this list has a non-empty value.
  18724. // This may be used to include null fields in Patch requests.
  18725. NullFields []string `json:"-"`
  18726. }
  18727. func (s *ResourceGroupReference) MarshalJSON() ([]byte, error) {
  18728. type NoMethod ResourceGroupReference
  18729. raw := NoMethod(*s)
  18730. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  18731. }
  18732. // Route: Represents a Route resource. A route specifies how certain
  18733. // packets should be handled by the network. Routes are associated with
  18734. // instances by tags and the set of routes for a particular instance is
  18735. // called its routing table.
  18736. //
  18737. // For each packet leaving an instance, the system searches that
  18738. // instance's routing table for a single best matching route. Routes
  18739. // match packets by destination IP address, preferring smaller or more
  18740. // specific ranges over larger ones. If there is a tie, the system
  18741. // selects the route with the smallest priority value. If there is still
  18742. // a tie, it uses the layer three and four packet headers to select just
  18743. // one of the remaining matching routes. The packet is then forwarded as
  18744. // specified by the nextHop field of the winning route - either to
  18745. // another instance destination, an instance gateway, or a Google
  18746. // Compute Engine-operated gateway.
  18747. //
  18748. // Packets that do not match any route in the sending instance's routing
  18749. // table are dropped. (== resource_for beta.routes ==) (== resource_for
  18750. // v1.routes ==)
  18751. type Route struct {
  18752. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  18753. // format.
  18754. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  18755. // Description: An optional description of this resource. Provide this
  18756. // property when you create the resource.
  18757. Description string `json:"description,omitempty"`
  18758. // DestRange: The destination range of outgoing packets that this route
  18759. // applies to. Only IPv4 is supported.
  18760. DestRange string `json:"destRange,omitempty"`
  18761. // Id: [Output Only] The unique identifier for the resource. This
  18762. // identifier is defined by the server.
  18763. Id uint64 `json:"id,omitempty,string"`
  18764. // Kind: [Output Only] Type of this resource. Always compute#routes for
  18765. // Route resources.
  18766. Kind string `json:"kind,omitempty"`
  18767. // Name: Name of the resource. Provided by the client when the resource
  18768. // is created. The name must be 1-63 characters long, and comply with
  18769. // RFC1035. Specifically, the name must be 1-63 characters long and
  18770. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  18771. // the first character must be a lowercase letter, and all following
  18772. // characters must be a dash, lowercase letter, or digit, except the
  18773. // last character, which cannot be a dash.
  18774. Name string `json:"name,omitempty"`
  18775. // Network: Fully-qualified URL of the network that this route applies
  18776. // to.
  18777. Network string `json:"network,omitempty"`
  18778. // NextHopGateway: The URL to a gateway that should handle matching
  18779. // packets. You can only specify the internet gateway using a full or
  18780. // partial valid URL:
  18781. // projects/<project-id>/global/gateways/default-internet-gateway
  18782. NextHopGateway string `json:"nextHopGateway,omitempty"`
  18783. // NextHopInstance: The URL to an instance that should handle matching
  18784. // packets. You can specify this as a full or partial URL. For
  18785. // example:
  18786. // https://www.googleapis.com/compute/v1/projects/project/zones/
  18787. // zone/instances/
  18788. NextHopInstance string `json:"nextHopInstance,omitempty"`
  18789. // NextHopIp: The network IP address of an instance that should handle
  18790. // matching packets. Only IPv4 is supported.
  18791. NextHopIp string `json:"nextHopIp,omitempty"`
  18792. // NextHopNetwork: The URL of the local network if it should handle
  18793. // matching packets.
  18794. NextHopNetwork string `json:"nextHopNetwork,omitempty"`
  18795. // NextHopPeering: [Output Only] The network peering name that should
  18796. // handle matching packets, which should conform to RFC1035.
  18797. NextHopPeering string `json:"nextHopPeering,omitempty"`
  18798. // NextHopVpnTunnel: The URL to a VpnTunnel that should handle matching
  18799. // packets.
  18800. NextHopVpnTunnel string `json:"nextHopVpnTunnel,omitempty"`
  18801. // Priority: The priority of this route. Priority is used to break ties
  18802. // in cases where there is more than one matching route of equal prefix
  18803. // length. In the case of two routes with equal prefix length, the one
  18804. // with the lowest-numbered priority value wins. Default value is 1000.
  18805. // Valid range is 0 through 65535.
  18806. Priority int64 `json:"priority,omitempty"`
  18807. // SelfLink: [Output Only] Server-defined fully-qualified URL for this
  18808. // resource.
  18809. SelfLink string `json:"selfLink,omitempty"`
  18810. // Tags: A list of instance tags to which this route applies.
  18811. Tags []string `json:"tags,omitempty"`
  18812. // Warnings: [Output Only] If potential misconfigurations are detected
  18813. // for this route, this field will be populated with warning messages.
  18814. Warnings []*RouteWarnings `json:"warnings,omitempty"`
  18815. // ServerResponse contains the HTTP response code and headers from the
  18816. // server.
  18817. googleapi.ServerResponse `json:"-"`
  18818. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  18819. // to unconditionally include in API requests. By default, fields with
  18820. // empty values are omitted from API requests. However, any non-pointer,
  18821. // non-interface field appearing in ForceSendFields will be sent to the
  18822. // server regardless of whether the field is empty or not. This may be
  18823. // used to include empty fields in Patch requests.
  18824. ForceSendFields []string `json:"-"`
  18825. // NullFields is a list of field names (e.g. "CreationTimestamp") to
  18826. // include in API requests with the JSON null value. By default, fields
  18827. // with empty values are omitted from API requests. However, any field
  18828. // with an empty value appearing in NullFields will be sent to the
  18829. // server as null. It is an error if a field in this list has a
  18830. // non-empty value. This may be used to include null fields in Patch
  18831. // requests.
  18832. NullFields []string `json:"-"`
  18833. }
  18834. func (s *Route) MarshalJSON() ([]byte, error) {
  18835. type NoMethod Route
  18836. raw := NoMethod(*s)
  18837. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  18838. }
  18839. type RouteWarnings struct {
  18840. // Code: [Output Only] A warning code, if applicable. For example,
  18841. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  18842. // the response.
  18843. //
  18844. // Possible values:
  18845. // "CLEANUP_FAILED"
  18846. // "DEPRECATED_RESOURCE_USED"
  18847. // "DEPRECATED_TYPE_USED"
  18848. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  18849. // "EXPERIMENTAL_TYPE_USED"
  18850. // "EXTERNAL_API_WARNING"
  18851. // "FIELD_VALUE_OVERRIDEN"
  18852. // "INJECTED_KERNELS_DEPRECATED"
  18853. // "MISSING_TYPE_DEPENDENCY"
  18854. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  18855. // "NEXT_HOP_CANNOT_IP_FORWARD"
  18856. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  18857. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  18858. // "NEXT_HOP_NOT_RUNNING"
  18859. // "NOT_CRITICAL_ERROR"
  18860. // "NO_RESULTS_ON_PAGE"
  18861. // "REQUIRED_TOS_AGREEMENT"
  18862. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  18863. // "RESOURCE_NOT_DELETED"
  18864. // "SCHEMA_VALIDATION_IGNORED"
  18865. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  18866. // "UNDECLARED_PROPERTIES"
  18867. // "UNREACHABLE"
  18868. Code string `json:"code,omitempty"`
  18869. // Data: [Output Only] Metadata about this warning in key: value format.
  18870. // For example:
  18871. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  18872. Data []*RouteWarningsData `json:"data,omitempty"`
  18873. // Message: [Output Only] A human-readable description of the warning
  18874. // code.
  18875. Message string `json:"message,omitempty"`
  18876. // ForceSendFields is a list of field names (e.g. "Code") to
  18877. // unconditionally include in API requests. By default, fields with
  18878. // empty values are omitted from API requests. However, any non-pointer,
  18879. // non-interface field appearing in ForceSendFields will be sent to the
  18880. // server regardless of whether the field is empty or not. This may be
  18881. // used to include empty fields in Patch requests.
  18882. ForceSendFields []string `json:"-"`
  18883. // NullFields is a list of field names (e.g. "Code") to include in API
  18884. // requests with the JSON null value. By default, fields with empty
  18885. // values are omitted from API requests. However, any field with an
  18886. // empty value appearing in NullFields will be sent to the server as
  18887. // null. It is an error if a field in this list has a non-empty value.
  18888. // This may be used to include null fields in Patch requests.
  18889. NullFields []string `json:"-"`
  18890. }
  18891. func (s *RouteWarnings) MarshalJSON() ([]byte, error) {
  18892. type NoMethod RouteWarnings
  18893. raw := NoMethod(*s)
  18894. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  18895. }
  18896. type RouteWarningsData struct {
  18897. // Key: [Output Only] A key that provides more detail on the warning
  18898. // being returned. For example, for warnings where there are no results
  18899. // in a list request for a particular zone, this key might be scope and
  18900. // the key value might be the zone name. Other examples might be a key
  18901. // indicating a deprecated resource and a suggested replacement, or a
  18902. // warning about invalid network settings (for example, if an instance
  18903. // attempts to perform IP forwarding but is not enabled for IP
  18904. // forwarding).
  18905. Key string `json:"key,omitempty"`
  18906. // Value: [Output Only] A warning data value corresponding to the key.
  18907. Value string `json:"value,omitempty"`
  18908. // ForceSendFields is a list of field names (e.g. "Key") to
  18909. // unconditionally include in API requests. By default, fields with
  18910. // empty values are omitted from API requests. However, any non-pointer,
  18911. // non-interface field appearing in ForceSendFields will be sent to the
  18912. // server regardless of whether the field is empty or not. This may be
  18913. // used to include empty fields in Patch requests.
  18914. ForceSendFields []string `json:"-"`
  18915. // NullFields is a list of field names (e.g. "Key") to include in API
  18916. // requests with the JSON null value. By default, fields with empty
  18917. // values are omitted from API requests. However, any field with an
  18918. // empty value appearing in NullFields will be sent to the server as
  18919. // null. It is an error if a field in this list has a non-empty value.
  18920. // This may be used to include null fields in Patch requests.
  18921. NullFields []string `json:"-"`
  18922. }
  18923. func (s *RouteWarningsData) MarshalJSON() ([]byte, error) {
  18924. type NoMethod RouteWarningsData
  18925. raw := NoMethod(*s)
  18926. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  18927. }
  18928. // RouteList: Contains a list of Route resources.
  18929. type RouteList struct {
  18930. // Id: [Output Only] Unique identifier for the resource; defined by the
  18931. // server.
  18932. Id string `json:"id,omitempty"`
  18933. // Items: A list of Route resources.
  18934. Items []*Route `json:"items,omitempty"`
  18935. // Kind: Type of resource.
  18936. Kind string `json:"kind,omitempty"`
  18937. // NextPageToken: [Output Only] This token allows you to get the next
  18938. // page of results for list requests. If the number of results is larger
  18939. // than maxResults, use the nextPageToken as a value for the query
  18940. // parameter pageToken in the next list request. Subsequent list
  18941. // requests will have their own nextPageToken to continue paging through
  18942. // the results.
  18943. NextPageToken string `json:"nextPageToken,omitempty"`
  18944. // SelfLink: [Output Only] Server-defined URL for this resource.
  18945. SelfLink string `json:"selfLink,omitempty"`
  18946. // Warning: [Output Only] Informational warning message.
  18947. Warning *RouteListWarning `json:"warning,omitempty"`
  18948. // ServerResponse contains the HTTP response code and headers from the
  18949. // server.
  18950. googleapi.ServerResponse `json:"-"`
  18951. // ForceSendFields is a list of field names (e.g. "Id") to
  18952. // unconditionally include in API requests. By default, fields with
  18953. // empty values are omitted from API requests. However, any non-pointer,
  18954. // non-interface field appearing in ForceSendFields will be sent to the
  18955. // server regardless of whether the field is empty or not. This may be
  18956. // used to include empty fields in Patch requests.
  18957. ForceSendFields []string `json:"-"`
  18958. // NullFields is a list of field names (e.g. "Id") to include in API
  18959. // requests with the JSON null value. By default, fields with empty
  18960. // values are omitted from API requests. However, any field with an
  18961. // empty value appearing in NullFields will be sent to the server as
  18962. // null. It is an error if a field in this list has a non-empty value.
  18963. // This may be used to include null fields in Patch requests.
  18964. NullFields []string `json:"-"`
  18965. }
  18966. func (s *RouteList) MarshalJSON() ([]byte, error) {
  18967. type NoMethod RouteList
  18968. raw := NoMethod(*s)
  18969. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  18970. }
  18971. // RouteListWarning: [Output Only] Informational warning message.
  18972. type RouteListWarning struct {
  18973. // Code: [Output Only] A warning code, if applicable. For example,
  18974. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  18975. // the response.
  18976. //
  18977. // Possible values:
  18978. // "CLEANUP_FAILED"
  18979. // "DEPRECATED_RESOURCE_USED"
  18980. // "DEPRECATED_TYPE_USED"
  18981. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  18982. // "EXPERIMENTAL_TYPE_USED"
  18983. // "EXTERNAL_API_WARNING"
  18984. // "FIELD_VALUE_OVERRIDEN"
  18985. // "INJECTED_KERNELS_DEPRECATED"
  18986. // "MISSING_TYPE_DEPENDENCY"
  18987. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  18988. // "NEXT_HOP_CANNOT_IP_FORWARD"
  18989. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  18990. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  18991. // "NEXT_HOP_NOT_RUNNING"
  18992. // "NOT_CRITICAL_ERROR"
  18993. // "NO_RESULTS_ON_PAGE"
  18994. // "REQUIRED_TOS_AGREEMENT"
  18995. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  18996. // "RESOURCE_NOT_DELETED"
  18997. // "SCHEMA_VALIDATION_IGNORED"
  18998. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  18999. // "UNDECLARED_PROPERTIES"
  19000. // "UNREACHABLE"
  19001. Code string `json:"code,omitempty"`
  19002. // Data: [Output Only] Metadata about this warning in key: value format.
  19003. // For example:
  19004. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  19005. Data []*RouteListWarningData `json:"data,omitempty"`
  19006. // Message: [Output Only] A human-readable description of the warning
  19007. // code.
  19008. Message string `json:"message,omitempty"`
  19009. // ForceSendFields is a list of field names (e.g. "Code") to
  19010. // unconditionally include in API requests. By default, fields with
  19011. // empty values are omitted from API requests. However, any non-pointer,
  19012. // non-interface field appearing in ForceSendFields will be sent to the
  19013. // server regardless of whether the field is empty or not. This may be
  19014. // used to include empty fields in Patch requests.
  19015. ForceSendFields []string `json:"-"`
  19016. // NullFields is a list of field names (e.g. "Code") to include in API
  19017. // requests with the JSON null value. By default, fields with empty
  19018. // values are omitted from API requests. However, any field with an
  19019. // empty value appearing in NullFields will be sent to the server as
  19020. // null. It is an error if a field in this list has a non-empty value.
  19021. // This may be used to include null fields in Patch requests.
  19022. NullFields []string `json:"-"`
  19023. }
  19024. func (s *RouteListWarning) MarshalJSON() ([]byte, error) {
  19025. type NoMethod RouteListWarning
  19026. raw := NoMethod(*s)
  19027. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  19028. }
  19029. type RouteListWarningData struct {
  19030. // Key: [Output Only] A key that provides more detail on the warning
  19031. // being returned. For example, for warnings where there are no results
  19032. // in a list request for a particular zone, this key might be scope and
  19033. // the key value might be the zone name. Other examples might be a key
  19034. // indicating a deprecated resource and a suggested replacement, or a
  19035. // warning about invalid network settings (for example, if an instance
  19036. // attempts to perform IP forwarding but is not enabled for IP
  19037. // forwarding).
  19038. Key string `json:"key,omitempty"`
  19039. // Value: [Output Only] A warning data value corresponding to the key.
  19040. Value string `json:"value,omitempty"`
  19041. // ForceSendFields is a list of field names (e.g. "Key") to
  19042. // unconditionally include in API requests. By default, fields with
  19043. // empty values are omitted from API requests. However, any non-pointer,
  19044. // non-interface field appearing in ForceSendFields will be sent to the
  19045. // server regardless of whether the field is empty or not. This may be
  19046. // used to include empty fields in Patch requests.
  19047. ForceSendFields []string `json:"-"`
  19048. // NullFields is a list of field names (e.g. "Key") to include in API
  19049. // requests with the JSON null value. By default, fields with empty
  19050. // values are omitted from API requests. However, any field with an
  19051. // empty value appearing in NullFields will be sent to the server as
  19052. // null. It is an error if a field in this list has a non-empty value.
  19053. // This may be used to include null fields in Patch requests.
  19054. NullFields []string `json:"-"`
  19055. }
  19056. func (s *RouteListWarningData) MarshalJSON() ([]byte, error) {
  19057. type NoMethod RouteListWarningData
  19058. raw := NoMethod(*s)
  19059. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  19060. }
  19061. // Router: Router resource.
  19062. type Router struct {
  19063. // Bgp: BGP information specific to this router.
  19064. Bgp *RouterBgp `json:"bgp,omitempty"`
  19065. // BgpPeers: BGP information that needs to be configured into the
  19066. // routing stack to establish the BGP peering. It must specify peer ASN
  19067. // and either interface name, IP, or peer IP. Please refer to RFC4273.
  19068. BgpPeers []*RouterBgpPeer `json:"bgpPeers,omitempty"`
  19069. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  19070. // format.
  19071. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  19072. // Description: An optional description of this resource. Provide this
  19073. // property when you create the resource.
  19074. Description string `json:"description,omitempty"`
  19075. // Id: [Output Only] The unique identifier for the resource. This
  19076. // identifier is defined by the server.
  19077. Id uint64 `json:"id,omitempty,string"`
  19078. // Interfaces: Router interfaces. Each interface requires either one
  19079. // linked resource (e.g. linkedVpnTunnel), or IP address and IP address
  19080. // range (e.g. ipRange), or both.
  19081. Interfaces []*RouterInterface `json:"interfaces,omitempty"`
  19082. // Kind: [Output Only] Type of resource. Always compute#router for
  19083. // routers.
  19084. Kind string `json:"kind,omitempty"`
  19085. // Name: Name of the resource. Provided by the client when the resource
  19086. // is created. The name must be 1-63 characters long, and comply with
  19087. // RFC1035. Specifically, the name must be 1-63 characters long and
  19088. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  19089. // the first character must be a lowercase letter, and all following
  19090. // characters must be a dash, lowercase letter, or digit, except the
  19091. // last character, which cannot be a dash.
  19092. Name string `json:"name,omitempty"`
  19093. // Network: URI of the network to which this router belongs.
  19094. Network string `json:"network,omitempty"`
  19095. // Region: [Output Only] URI of the region where the router resides. You
  19096. // must specify this field as part of the HTTP request URL. It is not
  19097. // settable as a field in the request body.
  19098. Region string `json:"region,omitempty"`
  19099. // SelfLink: [Output Only] Server-defined URL for the resource.
  19100. SelfLink string `json:"selfLink,omitempty"`
  19101. // ServerResponse contains the HTTP response code and headers from the
  19102. // server.
  19103. googleapi.ServerResponse `json:"-"`
  19104. // ForceSendFields is a list of field names (e.g. "Bgp") to
  19105. // unconditionally include in API requests. By default, fields with
  19106. // empty values are omitted from API requests. However, any non-pointer,
  19107. // non-interface field appearing in ForceSendFields will be sent to the
  19108. // server regardless of whether the field is empty or not. This may be
  19109. // used to include empty fields in Patch requests.
  19110. ForceSendFields []string `json:"-"`
  19111. // NullFields is a list of field names (e.g. "Bgp") to include in API
  19112. // requests with the JSON null value. By default, fields with empty
  19113. // values are omitted from API requests. However, any field with an
  19114. // empty value appearing in NullFields will be sent to the server as
  19115. // null. It is an error if a field in this list has a non-empty value.
  19116. // This may be used to include null fields in Patch requests.
  19117. NullFields []string `json:"-"`
  19118. }
  19119. func (s *Router) MarshalJSON() ([]byte, error) {
  19120. type NoMethod Router
  19121. raw := NoMethod(*s)
  19122. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  19123. }
  19124. // RouterAdvertisedIpRange: Description-tagged IP ranges for the router
  19125. // to advertise.
  19126. type RouterAdvertisedIpRange struct {
  19127. // Description: User-specified description for the IP range.
  19128. Description string `json:"description,omitempty"`
  19129. // Range: The IP range to advertise. The value must be a CIDR-formatted
  19130. // string.
  19131. Range string `json:"range,omitempty"`
  19132. // ForceSendFields is a list of field names (e.g. "Description") to
  19133. // unconditionally include in API requests. By default, fields with
  19134. // empty values are omitted from API requests. However, any non-pointer,
  19135. // non-interface field appearing in ForceSendFields will be sent to the
  19136. // server regardless of whether the field is empty or not. This may be
  19137. // used to include empty fields in Patch requests.
  19138. ForceSendFields []string `json:"-"`
  19139. // NullFields is a list of field names (e.g. "Description") to include
  19140. // in API requests with the JSON null value. By default, fields with
  19141. // empty values are omitted from API requests. However, any field with
  19142. // an empty value appearing in NullFields will be sent to the server as
  19143. // null. It is an error if a field in this list has a non-empty value.
  19144. // This may be used to include null fields in Patch requests.
  19145. NullFields []string `json:"-"`
  19146. }
  19147. func (s *RouterAdvertisedIpRange) MarshalJSON() ([]byte, error) {
  19148. type NoMethod RouterAdvertisedIpRange
  19149. raw := NoMethod(*s)
  19150. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  19151. }
  19152. // RouterAggregatedList: Contains a list of routers.
  19153. type RouterAggregatedList struct {
  19154. // Id: [Output Only] Unique identifier for the resource; defined by the
  19155. // server.
  19156. Id string `json:"id,omitempty"`
  19157. // Items: A list of Router resources.
  19158. Items map[string]RoutersScopedList `json:"items,omitempty"`
  19159. // Kind: Type of resource.
  19160. Kind string `json:"kind,omitempty"`
  19161. // NextPageToken: [Output Only] This token allows you to get the next
  19162. // page of results for list requests. If the number of results is larger
  19163. // than maxResults, use the nextPageToken as a value for the query
  19164. // parameter pageToken in the next list request. Subsequent list
  19165. // requests will have their own nextPageToken to continue paging through
  19166. // the results.
  19167. NextPageToken string `json:"nextPageToken,omitempty"`
  19168. // SelfLink: [Output Only] Server-defined URL for this resource.
  19169. SelfLink string `json:"selfLink,omitempty"`
  19170. // Warning: [Output Only] Informational warning message.
  19171. Warning *RouterAggregatedListWarning `json:"warning,omitempty"`
  19172. // ServerResponse contains the HTTP response code and headers from the
  19173. // server.
  19174. googleapi.ServerResponse `json:"-"`
  19175. // ForceSendFields is a list of field names (e.g. "Id") to
  19176. // unconditionally include in API requests. By default, fields with
  19177. // empty values are omitted from API requests. However, any non-pointer,
  19178. // non-interface field appearing in ForceSendFields will be sent to the
  19179. // server regardless of whether the field is empty or not. This may be
  19180. // used to include empty fields in Patch requests.
  19181. ForceSendFields []string `json:"-"`
  19182. // NullFields is a list of field names (e.g. "Id") to include in API
  19183. // requests with the JSON null value. By default, fields with empty
  19184. // values are omitted from API requests. However, any field with an
  19185. // empty value appearing in NullFields will be sent to the server as
  19186. // null. It is an error if a field in this list has a non-empty value.
  19187. // This may be used to include null fields in Patch requests.
  19188. NullFields []string `json:"-"`
  19189. }
  19190. func (s *RouterAggregatedList) MarshalJSON() ([]byte, error) {
  19191. type NoMethod RouterAggregatedList
  19192. raw := NoMethod(*s)
  19193. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  19194. }
  19195. // RouterAggregatedListWarning: [Output Only] Informational warning
  19196. // message.
  19197. type RouterAggregatedListWarning struct {
  19198. // Code: [Output Only] A warning code, if applicable. For example,
  19199. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  19200. // the response.
  19201. //
  19202. // Possible values:
  19203. // "CLEANUP_FAILED"
  19204. // "DEPRECATED_RESOURCE_USED"
  19205. // "DEPRECATED_TYPE_USED"
  19206. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  19207. // "EXPERIMENTAL_TYPE_USED"
  19208. // "EXTERNAL_API_WARNING"
  19209. // "FIELD_VALUE_OVERRIDEN"
  19210. // "INJECTED_KERNELS_DEPRECATED"
  19211. // "MISSING_TYPE_DEPENDENCY"
  19212. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  19213. // "NEXT_HOP_CANNOT_IP_FORWARD"
  19214. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  19215. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  19216. // "NEXT_HOP_NOT_RUNNING"
  19217. // "NOT_CRITICAL_ERROR"
  19218. // "NO_RESULTS_ON_PAGE"
  19219. // "REQUIRED_TOS_AGREEMENT"
  19220. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  19221. // "RESOURCE_NOT_DELETED"
  19222. // "SCHEMA_VALIDATION_IGNORED"
  19223. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  19224. // "UNDECLARED_PROPERTIES"
  19225. // "UNREACHABLE"
  19226. Code string `json:"code,omitempty"`
  19227. // Data: [Output Only] Metadata about this warning in key: value format.
  19228. // For example:
  19229. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  19230. Data []*RouterAggregatedListWarningData `json:"data,omitempty"`
  19231. // Message: [Output Only] A human-readable description of the warning
  19232. // code.
  19233. Message string `json:"message,omitempty"`
  19234. // ForceSendFields is a list of field names (e.g. "Code") to
  19235. // unconditionally include in API requests. By default, fields with
  19236. // empty values are omitted from API requests. However, any non-pointer,
  19237. // non-interface field appearing in ForceSendFields will be sent to the
  19238. // server regardless of whether the field is empty or not. This may be
  19239. // used to include empty fields in Patch requests.
  19240. ForceSendFields []string `json:"-"`
  19241. // NullFields is a list of field names (e.g. "Code") to include in API
  19242. // requests with the JSON null value. By default, fields with empty
  19243. // values are omitted from API requests. However, any field with an
  19244. // empty value appearing in NullFields will be sent to the server as
  19245. // null. It is an error if a field in this list has a non-empty value.
  19246. // This may be used to include null fields in Patch requests.
  19247. NullFields []string `json:"-"`
  19248. }
  19249. func (s *RouterAggregatedListWarning) MarshalJSON() ([]byte, error) {
  19250. type NoMethod RouterAggregatedListWarning
  19251. raw := NoMethod(*s)
  19252. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  19253. }
  19254. type RouterAggregatedListWarningData struct {
  19255. // Key: [Output Only] A key that provides more detail on the warning
  19256. // being returned. For example, for warnings where there are no results
  19257. // in a list request for a particular zone, this key might be scope and
  19258. // the key value might be the zone name. Other examples might be a key
  19259. // indicating a deprecated resource and a suggested replacement, or a
  19260. // warning about invalid network settings (for example, if an instance
  19261. // attempts to perform IP forwarding but is not enabled for IP
  19262. // forwarding).
  19263. Key string `json:"key,omitempty"`
  19264. // Value: [Output Only] A warning data value corresponding to the key.
  19265. Value string `json:"value,omitempty"`
  19266. // ForceSendFields is a list of field names (e.g. "Key") to
  19267. // unconditionally include in API requests. By default, fields with
  19268. // empty values are omitted from API requests. However, any non-pointer,
  19269. // non-interface field appearing in ForceSendFields will be sent to the
  19270. // server regardless of whether the field is empty or not. This may be
  19271. // used to include empty fields in Patch requests.
  19272. ForceSendFields []string `json:"-"`
  19273. // NullFields is a list of field names (e.g. "Key") to include in API
  19274. // requests with the JSON null value. By default, fields with empty
  19275. // values are omitted from API requests. However, any field with an
  19276. // empty value appearing in NullFields will be sent to the server as
  19277. // null. It is an error if a field in this list has a non-empty value.
  19278. // This may be used to include null fields in Patch requests.
  19279. NullFields []string `json:"-"`
  19280. }
  19281. func (s *RouterAggregatedListWarningData) MarshalJSON() ([]byte, error) {
  19282. type NoMethod RouterAggregatedListWarningData
  19283. raw := NoMethod(*s)
  19284. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  19285. }
  19286. type RouterBgp struct {
  19287. // AdvertiseMode: User-specified flag to indicate which mode to use for
  19288. // advertisement.
  19289. //
  19290. // Possible values:
  19291. // "CUSTOM"
  19292. // "DEFAULT"
  19293. AdvertiseMode string `json:"advertiseMode,omitempty"`
  19294. // AdvertisedGroups: User-specified list of prefix groups to advertise
  19295. // in custom mode. This field can only be populated if advertise_mode is
  19296. // CUSTOM and is advertised to all peers of the router. These groups
  19297. // will be advertised in addition to any specified prefixes. Leave this
  19298. // field blank to advertise no custom groups.
  19299. //
  19300. // Possible values:
  19301. // "ALL_SUBNETS"
  19302. AdvertisedGroups []string `json:"advertisedGroups,omitempty"`
  19303. // AdvertisedIpRanges: User-specified list of individual IP ranges to
  19304. // advertise in custom mode. This field can only be populated if
  19305. // advertise_mode is CUSTOM and is advertised to all peers of the
  19306. // router. These IP ranges will be advertised in addition to any
  19307. // specified groups. Leave this field blank to advertise no custom IP
  19308. // ranges.
  19309. AdvertisedIpRanges []*RouterAdvertisedIpRange `json:"advertisedIpRanges,omitempty"`
  19310. // Asn: Local BGP Autonomous System Number (ASN). Must be an RFC6996
  19311. // private ASN, either 16-bit or 32-bit. The value will be fixed for
  19312. // this router resource. All VPN tunnels that link to this router will
  19313. // have the same local ASN.
  19314. Asn int64 `json:"asn,omitempty"`
  19315. // ForceSendFields is a list of field names (e.g. "AdvertiseMode") to
  19316. // unconditionally include in API requests. By default, fields with
  19317. // empty values are omitted from API requests. However, any non-pointer,
  19318. // non-interface field appearing in ForceSendFields will be sent to the
  19319. // server regardless of whether the field is empty or not. This may be
  19320. // used to include empty fields in Patch requests.
  19321. ForceSendFields []string `json:"-"`
  19322. // NullFields is a list of field names (e.g. "AdvertiseMode") to include
  19323. // in API requests with the JSON null value. By default, fields with
  19324. // empty values are omitted from API requests. However, any field with
  19325. // an empty value appearing in NullFields will be sent to the server as
  19326. // null. It is an error if a field in this list has a non-empty value.
  19327. // This may be used to include null fields in Patch requests.
  19328. NullFields []string `json:"-"`
  19329. }
  19330. func (s *RouterBgp) MarshalJSON() ([]byte, error) {
  19331. type NoMethod RouterBgp
  19332. raw := NoMethod(*s)
  19333. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  19334. }
  19335. type RouterBgpPeer struct {
  19336. // AdvertiseMode: User-specified flag to indicate which mode to use for
  19337. // advertisement.
  19338. //
  19339. // Possible values:
  19340. // "CUSTOM"
  19341. // "DEFAULT"
  19342. AdvertiseMode string `json:"advertiseMode,omitempty"`
  19343. // AdvertisedGroups: User-specified list of prefix groups to advertise
  19344. // in custom mode. This field can only be populated if advertise_mode is
  19345. // CUSTOM and overrides the list defined for the router (in Bgp
  19346. // message). These groups will be advertised in addition to any
  19347. // specified prefixes. Leave this field blank to advertise no custom
  19348. // groups.
  19349. //
  19350. // Possible values:
  19351. // "ALL_SUBNETS"
  19352. AdvertisedGroups []string `json:"advertisedGroups,omitempty"`
  19353. // AdvertisedIpRanges: User-specified list of individual IP ranges to
  19354. // advertise in custom mode. This field can only be populated if
  19355. // advertise_mode is CUSTOM and overrides the list defined for the
  19356. // router (in Bgp message). These IP ranges will be advertised in
  19357. // addition to any specified groups. Leave this field blank to advertise
  19358. // no custom IP ranges.
  19359. AdvertisedIpRanges []*RouterAdvertisedIpRange `json:"advertisedIpRanges,omitempty"`
  19360. // AdvertisedRoutePriority: The priority of routes advertised to this
  19361. // BGP peer. In the case where there is more than one matching route of
  19362. // maximum length, the routes with lowest priority value win.
  19363. AdvertisedRoutePriority int64 `json:"advertisedRoutePriority,omitempty"`
  19364. // InterfaceName: Name of the interface the BGP peer is associated with.
  19365. InterfaceName string `json:"interfaceName,omitempty"`
  19366. // IpAddress: IP address of the interface inside Google Cloud Platform.
  19367. // Only IPv4 is supported.
  19368. IpAddress string `json:"ipAddress,omitempty"`
  19369. // ManagementType: [Output Only] Type of how the resource/configuration
  19370. // of the BGP peer is managed. MANAGED_BY_USER is the default value;
  19371. // MANAGED_BY_ATTACHMENT represents an BGP peer that is automatically
  19372. // created for PARTNER interconnectAttachment, Google will automatically
  19373. // create/delete this type of BGP peer when the PARTNER
  19374. // interconnectAttachment is created/deleted.
  19375. //
  19376. // Possible values:
  19377. // "MANAGED_BY_ATTACHMENT"
  19378. // "MANAGED_BY_USER"
  19379. ManagementType string `json:"managementType,omitempty"`
  19380. // Name: Name of this BGP peer. The name must be 1-63 characters long
  19381. // and comply with RFC1035.
  19382. Name string `json:"name,omitempty"`
  19383. // PeerAsn: Peer BGP Autonomous System Number (ASN). For VPN use case,
  19384. // this value can be different for every tunnel.
  19385. PeerAsn int64 `json:"peerAsn,omitempty"`
  19386. // PeerIpAddress: IP address of the BGP interface outside Google cloud.
  19387. // Only IPv4 is supported.
  19388. PeerIpAddress string `json:"peerIpAddress,omitempty"`
  19389. // ForceSendFields is a list of field names (e.g. "AdvertiseMode") to
  19390. // unconditionally include in API requests. By default, fields with
  19391. // empty values are omitted from API requests. However, any non-pointer,
  19392. // non-interface field appearing in ForceSendFields will be sent to the
  19393. // server regardless of whether the field is empty or not. This may be
  19394. // used to include empty fields in Patch requests.
  19395. ForceSendFields []string `json:"-"`
  19396. // NullFields is a list of field names (e.g. "AdvertiseMode") to include
  19397. // in API requests with the JSON null value. By default, fields with
  19398. // empty values are omitted from API requests. However, any field with
  19399. // an empty value appearing in NullFields will be sent to the server as
  19400. // null. It is an error if a field in this list has a non-empty value.
  19401. // This may be used to include null fields in Patch requests.
  19402. NullFields []string `json:"-"`
  19403. }
  19404. func (s *RouterBgpPeer) MarshalJSON() ([]byte, error) {
  19405. type NoMethod RouterBgpPeer
  19406. raw := NoMethod(*s)
  19407. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  19408. }
  19409. type RouterInterface struct {
  19410. // IpRange: IP address and range of the interface. The IP range must be
  19411. // in the RFC3927 link-local IP space. The value must be a
  19412. // CIDR-formatted string, for example: 169.254.0.1/30. NOTE: Do not
  19413. // truncate the address as it represents the IP address of the
  19414. // interface.
  19415. IpRange string `json:"ipRange,omitempty"`
  19416. // LinkedInterconnectAttachment: URI of the linked interconnect
  19417. // attachment. It must be in the same region as the router. Each
  19418. // interface can have at most one linked resource and it could either be
  19419. // a VPN Tunnel or an interconnect attachment.
  19420. LinkedInterconnectAttachment string `json:"linkedInterconnectAttachment,omitempty"`
  19421. // LinkedVpnTunnel: URI of the linked VPN tunnel. It must be in the same
  19422. // region as the router. Each interface can have at most one linked
  19423. // resource and it could either be a VPN Tunnel or an interconnect
  19424. // attachment.
  19425. LinkedVpnTunnel string `json:"linkedVpnTunnel,omitempty"`
  19426. // ManagementType: [Output Only] Type of how the resource/configuration
  19427. // of the interface is managed. MANAGED_BY_USER is the default value;
  19428. // MANAGED_BY_ATTACHMENT represents an interface that is automatically
  19429. // created for PARTNER type interconnectAttachment, Google will
  19430. // automatically create/update/delete this type of interface when the
  19431. // PARTNER interconnectAttachment is created/provisioned/deleted.
  19432. //
  19433. // Possible values:
  19434. // "MANAGED_BY_ATTACHMENT"
  19435. // "MANAGED_BY_USER"
  19436. ManagementType string `json:"managementType,omitempty"`
  19437. // Name: Name of this interface entry. The name must be 1-63 characters
  19438. // long and comply with RFC1035.
  19439. Name string `json:"name,omitempty"`
  19440. // ForceSendFields is a list of field names (e.g. "IpRange") to
  19441. // unconditionally include in API requests. By default, fields with
  19442. // empty values are omitted from API requests. However, any non-pointer,
  19443. // non-interface field appearing in ForceSendFields will be sent to the
  19444. // server regardless of whether the field is empty or not. This may be
  19445. // used to include empty fields in Patch requests.
  19446. ForceSendFields []string `json:"-"`
  19447. // NullFields is a list of field names (e.g. "IpRange") to include in
  19448. // API requests with the JSON null value. By default, fields with empty
  19449. // values are omitted from API requests. However, any field with an
  19450. // empty value appearing in NullFields will be sent to the server as
  19451. // null. It is an error if a field in this list has a non-empty value.
  19452. // This may be used to include null fields in Patch requests.
  19453. NullFields []string `json:"-"`
  19454. }
  19455. func (s *RouterInterface) MarshalJSON() ([]byte, error) {
  19456. type NoMethod RouterInterface
  19457. raw := NoMethod(*s)
  19458. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  19459. }
  19460. // RouterList: Contains a list of Router resources.
  19461. type RouterList struct {
  19462. // Id: [Output Only] Unique identifier for the resource; defined by the
  19463. // server.
  19464. Id string `json:"id,omitempty"`
  19465. // Items: A list of Router resources.
  19466. Items []*Router `json:"items,omitempty"`
  19467. // Kind: [Output Only] Type of resource. Always compute#router for
  19468. // routers.
  19469. Kind string `json:"kind,omitempty"`
  19470. // NextPageToken: [Output Only] This token allows you to get the next
  19471. // page of results for list requests. If the number of results is larger
  19472. // than maxResults, use the nextPageToken as a value for the query
  19473. // parameter pageToken in the next list request. Subsequent list
  19474. // requests will have their own nextPageToken to continue paging through
  19475. // the results.
  19476. NextPageToken string `json:"nextPageToken,omitempty"`
  19477. // SelfLink: [Output Only] Server-defined URL for this resource.
  19478. SelfLink string `json:"selfLink,omitempty"`
  19479. // Warning: [Output Only] Informational warning message.
  19480. Warning *RouterListWarning `json:"warning,omitempty"`
  19481. // ServerResponse contains the HTTP response code and headers from the
  19482. // server.
  19483. googleapi.ServerResponse `json:"-"`
  19484. // ForceSendFields is a list of field names (e.g. "Id") to
  19485. // unconditionally include in API requests. By default, fields with
  19486. // empty values are omitted from API requests. However, any non-pointer,
  19487. // non-interface field appearing in ForceSendFields will be sent to the
  19488. // server regardless of whether the field is empty or not. This may be
  19489. // used to include empty fields in Patch requests.
  19490. ForceSendFields []string `json:"-"`
  19491. // NullFields is a list of field names (e.g. "Id") to include in API
  19492. // requests with the JSON null value. By default, fields with empty
  19493. // values are omitted from API requests. However, any field with an
  19494. // empty value appearing in NullFields will be sent to the server as
  19495. // null. It is an error if a field in this list has a non-empty value.
  19496. // This may be used to include null fields in Patch requests.
  19497. NullFields []string `json:"-"`
  19498. }
  19499. func (s *RouterList) MarshalJSON() ([]byte, error) {
  19500. type NoMethod RouterList
  19501. raw := NoMethod(*s)
  19502. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  19503. }
  19504. // RouterListWarning: [Output Only] Informational warning message.
  19505. type RouterListWarning struct {
  19506. // Code: [Output Only] A warning code, if applicable. For example,
  19507. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  19508. // the response.
  19509. //
  19510. // Possible values:
  19511. // "CLEANUP_FAILED"
  19512. // "DEPRECATED_RESOURCE_USED"
  19513. // "DEPRECATED_TYPE_USED"
  19514. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  19515. // "EXPERIMENTAL_TYPE_USED"
  19516. // "EXTERNAL_API_WARNING"
  19517. // "FIELD_VALUE_OVERRIDEN"
  19518. // "INJECTED_KERNELS_DEPRECATED"
  19519. // "MISSING_TYPE_DEPENDENCY"
  19520. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  19521. // "NEXT_HOP_CANNOT_IP_FORWARD"
  19522. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  19523. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  19524. // "NEXT_HOP_NOT_RUNNING"
  19525. // "NOT_CRITICAL_ERROR"
  19526. // "NO_RESULTS_ON_PAGE"
  19527. // "REQUIRED_TOS_AGREEMENT"
  19528. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  19529. // "RESOURCE_NOT_DELETED"
  19530. // "SCHEMA_VALIDATION_IGNORED"
  19531. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  19532. // "UNDECLARED_PROPERTIES"
  19533. // "UNREACHABLE"
  19534. Code string `json:"code,omitempty"`
  19535. // Data: [Output Only] Metadata about this warning in key: value format.
  19536. // For example:
  19537. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  19538. Data []*RouterListWarningData `json:"data,omitempty"`
  19539. // Message: [Output Only] A human-readable description of the warning
  19540. // code.
  19541. Message string `json:"message,omitempty"`
  19542. // ForceSendFields is a list of field names (e.g. "Code") to
  19543. // unconditionally include in API requests. By default, fields with
  19544. // empty values are omitted from API requests. However, any non-pointer,
  19545. // non-interface field appearing in ForceSendFields will be sent to the
  19546. // server regardless of whether the field is empty or not. This may be
  19547. // used to include empty fields in Patch requests.
  19548. ForceSendFields []string `json:"-"`
  19549. // NullFields is a list of field names (e.g. "Code") to include in API
  19550. // requests with the JSON null value. By default, fields with empty
  19551. // values are omitted from API requests. However, any field with an
  19552. // empty value appearing in NullFields will be sent to the server as
  19553. // null. It is an error if a field in this list has a non-empty value.
  19554. // This may be used to include null fields in Patch requests.
  19555. NullFields []string `json:"-"`
  19556. }
  19557. func (s *RouterListWarning) MarshalJSON() ([]byte, error) {
  19558. type NoMethod RouterListWarning
  19559. raw := NoMethod(*s)
  19560. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  19561. }
  19562. type RouterListWarningData struct {
  19563. // Key: [Output Only] A key that provides more detail on the warning
  19564. // being returned. For example, for warnings where there are no results
  19565. // in a list request for a particular zone, this key might be scope and
  19566. // the key value might be the zone name. Other examples might be a key
  19567. // indicating a deprecated resource and a suggested replacement, or a
  19568. // warning about invalid network settings (for example, if an instance
  19569. // attempts to perform IP forwarding but is not enabled for IP
  19570. // forwarding).
  19571. Key string `json:"key,omitempty"`
  19572. // Value: [Output Only] A warning data value corresponding to the key.
  19573. Value string `json:"value,omitempty"`
  19574. // ForceSendFields is a list of field names (e.g. "Key") to
  19575. // unconditionally include in API requests. By default, fields with
  19576. // empty values are omitted from API requests. However, any non-pointer,
  19577. // non-interface field appearing in ForceSendFields will be sent to the
  19578. // server regardless of whether the field is empty or not. This may be
  19579. // used to include empty fields in Patch requests.
  19580. ForceSendFields []string `json:"-"`
  19581. // NullFields is a list of field names (e.g. "Key") to include in API
  19582. // requests with the JSON null value. By default, fields with empty
  19583. // values are omitted from API requests. However, any field with an
  19584. // empty value appearing in NullFields will be sent to the server as
  19585. // null. It is an error if a field in this list has a non-empty value.
  19586. // This may be used to include null fields in Patch requests.
  19587. NullFields []string `json:"-"`
  19588. }
  19589. func (s *RouterListWarningData) MarshalJSON() ([]byte, error) {
  19590. type NoMethod RouterListWarningData
  19591. raw := NoMethod(*s)
  19592. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  19593. }
  19594. type RouterStatus struct {
  19595. // BestRoutes: Best routes for this router's network.
  19596. BestRoutes []*Route `json:"bestRoutes,omitempty"`
  19597. // BestRoutesForRouter: Best routes learned by this router.
  19598. BestRoutesForRouter []*Route `json:"bestRoutesForRouter,omitempty"`
  19599. BgpPeerStatus []*RouterStatusBgpPeerStatus `json:"bgpPeerStatus,omitempty"`
  19600. // Network: URI of the network to which this router belongs.
  19601. Network string `json:"network,omitempty"`
  19602. // ForceSendFields is a list of field names (e.g. "BestRoutes") to
  19603. // unconditionally include in API requests. By default, fields with
  19604. // empty values are omitted from API requests. However, any non-pointer,
  19605. // non-interface field appearing in ForceSendFields will be sent to the
  19606. // server regardless of whether the field is empty or not. This may be
  19607. // used to include empty fields in Patch requests.
  19608. ForceSendFields []string `json:"-"`
  19609. // NullFields is a list of field names (e.g. "BestRoutes") to include in
  19610. // API requests with the JSON null value. By default, fields with empty
  19611. // values are omitted from API requests. However, any field with an
  19612. // empty value appearing in NullFields will be sent to the server as
  19613. // null. It is an error if a field in this list has a non-empty value.
  19614. // This may be used to include null fields in Patch requests.
  19615. NullFields []string `json:"-"`
  19616. }
  19617. func (s *RouterStatus) MarshalJSON() ([]byte, error) {
  19618. type NoMethod RouterStatus
  19619. raw := NoMethod(*s)
  19620. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  19621. }
  19622. type RouterStatusBgpPeerStatus struct {
  19623. // AdvertisedRoutes: Routes that were advertised to the remote BGP peer
  19624. AdvertisedRoutes []*Route `json:"advertisedRoutes,omitempty"`
  19625. // IpAddress: IP address of the local BGP interface.
  19626. IpAddress string `json:"ipAddress,omitempty"`
  19627. // LinkedVpnTunnel: URL of the VPN tunnel that this BGP peer controls.
  19628. LinkedVpnTunnel string `json:"linkedVpnTunnel,omitempty"`
  19629. // Name: Name of this BGP peer. Unique within the Routers resource.
  19630. Name string `json:"name,omitempty"`
  19631. // NumLearnedRoutes: Number of routes learned from the remote BGP Peer.
  19632. NumLearnedRoutes int64 `json:"numLearnedRoutes,omitempty"`
  19633. // PeerIpAddress: IP address of the remote BGP interface.
  19634. PeerIpAddress string `json:"peerIpAddress,omitempty"`
  19635. // State: BGP state as specified in RFC1771.
  19636. State string `json:"state,omitempty"`
  19637. // Status: Status of the BGP peer: {UP, DOWN}
  19638. //
  19639. // Possible values:
  19640. // "DOWN"
  19641. // "UNKNOWN"
  19642. // "UP"
  19643. Status string `json:"status,omitempty"`
  19644. // Uptime: Time this session has been up. Format: 14 years, 51 weeks, 6
  19645. // days, 23 hours, 59 minutes, 59 seconds
  19646. Uptime string `json:"uptime,omitempty"`
  19647. // UptimeSeconds: Time this session has been up, in seconds. Format: 145
  19648. UptimeSeconds string `json:"uptimeSeconds,omitempty"`
  19649. // ForceSendFields is a list of field names (e.g. "AdvertisedRoutes") to
  19650. // unconditionally include in API requests. By default, fields with
  19651. // empty values are omitted from API requests. However, any non-pointer,
  19652. // non-interface field appearing in ForceSendFields will be sent to the
  19653. // server regardless of whether the field is empty or not. This may be
  19654. // used to include empty fields in Patch requests.
  19655. ForceSendFields []string `json:"-"`
  19656. // NullFields is a list of field names (e.g. "AdvertisedRoutes") to
  19657. // include in API requests with the JSON null value. By default, fields
  19658. // with empty values are omitted from API requests. However, any field
  19659. // with an empty value appearing in NullFields will be sent to the
  19660. // server as null. It is an error if a field in this list has a
  19661. // non-empty value. This may be used to include null fields in Patch
  19662. // requests.
  19663. NullFields []string `json:"-"`
  19664. }
  19665. func (s *RouterStatusBgpPeerStatus) MarshalJSON() ([]byte, error) {
  19666. type NoMethod RouterStatusBgpPeerStatus
  19667. raw := NoMethod(*s)
  19668. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  19669. }
  19670. type RouterStatusResponse struct {
  19671. // Kind: Type of resource.
  19672. Kind string `json:"kind,omitempty"`
  19673. Result *RouterStatus `json:"result,omitempty"`
  19674. // ServerResponse contains the HTTP response code and headers from the
  19675. // server.
  19676. googleapi.ServerResponse `json:"-"`
  19677. // ForceSendFields is a list of field names (e.g. "Kind") to
  19678. // unconditionally include in API requests. By default, fields with
  19679. // empty values are omitted from API requests. However, any non-pointer,
  19680. // non-interface field appearing in ForceSendFields will be sent to the
  19681. // server regardless of whether the field is empty or not. This may be
  19682. // used to include empty fields in Patch requests.
  19683. ForceSendFields []string `json:"-"`
  19684. // NullFields is a list of field names (e.g. "Kind") to include in API
  19685. // requests with the JSON null value. By default, fields with empty
  19686. // values are omitted from API requests. However, any field with an
  19687. // empty value appearing in NullFields will be sent to the server as
  19688. // null. It is an error if a field in this list has a non-empty value.
  19689. // This may be used to include null fields in Patch requests.
  19690. NullFields []string `json:"-"`
  19691. }
  19692. func (s *RouterStatusResponse) MarshalJSON() ([]byte, error) {
  19693. type NoMethod RouterStatusResponse
  19694. raw := NoMethod(*s)
  19695. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  19696. }
  19697. type RoutersPreviewResponse struct {
  19698. // Resource: Preview of given router.
  19699. Resource *Router `json:"resource,omitempty"`
  19700. // ServerResponse contains the HTTP response code and headers from the
  19701. // server.
  19702. googleapi.ServerResponse `json:"-"`
  19703. // ForceSendFields is a list of field names (e.g. "Resource") 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. "Resource") to include in
  19711. // API requests with the JSON null value. By default, fields with empty
  19712. // values are omitted from API requests. However, any field with an
  19713. // 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 *RoutersPreviewResponse) MarshalJSON() ([]byte, error) {
  19719. type NoMethod RoutersPreviewResponse
  19720. raw := NoMethod(*s)
  19721. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  19722. }
  19723. type RoutersScopedList struct {
  19724. // Routers: A list of routers contained in this scope.
  19725. Routers []*Router `json:"routers,omitempty"`
  19726. // Warning: Informational warning which replaces the list of routers
  19727. // when the list is empty.
  19728. Warning *RoutersScopedListWarning `json:"warning,omitempty"`
  19729. // ForceSendFields is a list of field names (e.g. "Routers") to
  19730. // unconditionally include in API requests. By default, fields with
  19731. // empty values are omitted from API requests. However, any non-pointer,
  19732. // non-interface field appearing in ForceSendFields will be sent to the
  19733. // server regardless of whether the field is empty or not. This may be
  19734. // used to include empty fields in Patch requests.
  19735. ForceSendFields []string `json:"-"`
  19736. // NullFields is a list of field names (e.g. "Routers") to include in
  19737. // API requests with the JSON null value. By default, fields with empty
  19738. // values are omitted from API requests. However, any field with an
  19739. // empty value appearing in NullFields will be sent to the server as
  19740. // null. It is an error if a field in this list has a non-empty value.
  19741. // This may be used to include null fields in Patch requests.
  19742. NullFields []string `json:"-"`
  19743. }
  19744. func (s *RoutersScopedList) MarshalJSON() ([]byte, error) {
  19745. type NoMethod RoutersScopedList
  19746. raw := NoMethod(*s)
  19747. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  19748. }
  19749. // RoutersScopedListWarning: Informational warning which replaces the
  19750. // list of routers when the list is empty.
  19751. type RoutersScopedListWarning struct {
  19752. // Code: [Output Only] A warning code, if applicable. For example,
  19753. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  19754. // the response.
  19755. //
  19756. // Possible values:
  19757. // "CLEANUP_FAILED"
  19758. // "DEPRECATED_RESOURCE_USED"
  19759. // "DEPRECATED_TYPE_USED"
  19760. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  19761. // "EXPERIMENTAL_TYPE_USED"
  19762. // "EXTERNAL_API_WARNING"
  19763. // "FIELD_VALUE_OVERRIDEN"
  19764. // "INJECTED_KERNELS_DEPRECATED"
  19765. // "MISSING_TYPE_DEPENDENCY"
  19766. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  19767. // "NEXT_HOP_CANNOT_IP_FORWARD"
  19768. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  19769. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  19770. // "NEXT_HOP_NOT_RUNNING"
  19771. // "NOT_CRITICAL_ERROR"
  19772. // "NO_RESULTS_ON_PAGE"
  19773. // "REQUIRED_TOS_AGREEMENT"
  19774. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  19775. // "RESOURCE_NOT_DELETED"
  19776. // "SCHEMA_VALIDATION_IGNORED"
  19777. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  19778. // "UNDECLARED_PROPERTIES"
  19779. // "UNREACHABLE"
  19780. Code string `json:"code,omitempty"`
  19781. // Data: [Output Only] Metadata about this warning in key: value format.
  19782. // For example:
  19783. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  19784. Data []*RoutersScopedListWarningData `json:"data,omitempty"`
  19785. // Message: [Output Only] A human-readable description of the warning
  19786. // code.
  19787. Message string `json:"message,omitempty"`
  19788. // ForceSendFields is a list of field names (e.g. "Code") to
  19789. // unconditionally include in API requests. By default, fields with
  19790. // empty values are omitted from API requests. However, any non-pointer,
  19791. // non-interface field appearing in ForceSendFields will be sent to the
  19792. // server regardless of whether the field is empty or not. This may be
  19793. // used to include empty fields in Patch requests.
  19794. ForceSendFields []string `json:"-"`
  19795. // NullFields is a list of field names (e.g. "Code") to include in API
  19796. // requests with the JSON null value. By default, fields with empty
  19797. // values are omitted from API requests. However, any field with an
  19798. // empty value appearing in NullFields will be sent to the server as
  19799. // null. It is an error if a field in this list has a non-empty value.
  19800. // This may be used to include null fields in Patch requests.
  19801. NullFields []string `json:"-"`
  19802. }
  19803. func (s *RoutersScopedListWarning) MarshalJSON() ([]byte, error) {
  19804. type NoMethod RoutersScopedListWarning
  19805. raw := NoMethod(*s)
  19806. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  19807. }
  19808. type RoutersScopedListWarningData struct {
  19809. // Key: [Output Only] A key that provides more detail on the warning
  19810. // being returned. For example, for warnings where there are no results
  19811. // in a list request for a particular zone, this key might be scope and
  19812. // the key value might be the zone name. Other examples might be a key
  19813. // indicating a deprecated resource and a suggested replacement, or a
  19814. // warning about invalid network settings (for example, if an instance
  19815. // attempts to perform IP forwarding but is not enabled for IP
  19816. // forwarding).
  19817. Key string `json:"key,omitempty"`
  19818. // Value: [Output Only] A warning data value corresponding to the key.
  19819. Value string `json:"value,omitempty"`
  19820. // ForceSendFields is a list of field names (e.g. "Key") to
  19821. // unconditionally include in API requests. By default, fields with
  19822. // empty values are omitted from API requests. However, any non-pointer,
  19823. // non-interface field appearing in ForceSendFields will be sent to the
  19824. // server regardless of whether the field is empty or not. This may be
  19825. // used to include empty fields in Patch requests.
  19826. ForceSendFields []string `json:"-"`
  19827. // NullFields is a list of field names (e.g. "Key") to include in API
  19828. // requests with the JSON null value. By default, fields with empty
  19829. // values are omitted from API requests. However, any field with an
  19830. // empty value appearing in NullFields will be sent to the server as
  19831. // null. It is an error if a field in this list has a non-empty value.
  19832. // This may be used to include null fields in Patch requests.
  19833. NullFields []string `json:"-"`
  19834. }
  19835. func (s *RoutersScopedListWarningData) MarshalJSON() ([]byte, error) {
  19836. type NoMethod RoutersScopedListWarningData
  19837. raw := NoMethod(*s)
  19838. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  19839. }
  19840. // Rule: A rule to be applied in a Policy.
  19841. type Rule struct {
  19842. // Action: Required
  19843. //
  19844. // Possible values:
  19845. // "ALLOW"
  19846. // "ALLOW_WITH_LOG"
  19847. // "DENY"
  19848. // "DENY_WITH_LOG"
  19849. // "LOG"
  19850. // "NO_ACTION"
  19851. Action string `json:"action,omitempty"`
  19852. // Conditions: Additional restrictions that must be met. All conditions
  19853. // must pass for the rule to match.
  19854. Conditions []*Condition `json:"conditions,omitempty"`
  19855. // Description: Human-readable description of the rule.
  19856. Description string `json:"description,omitempty"`
  19857. // Ins: If one or more 'in' clauses are specified, the rule matches if
  19858. // the PRINCIPAL/AUTHORITY_SELECTOR is in at least one of these entries.
  19859. Ins []string `json:"ins,omitempty"`
  19860. // LogConfigs: The config returned to callers of
  19861. // tech.iam.IAM.CheckPolicy for any entries that match the LOG action.
  19862. LogConfigs []*LogConfig `json:"logConfigs,omitempty"`
  19863. // NotIns: If one or more 'not_in' clauses are specified, the rule
  19864. // matches if the PRINCIPAL/AUTHORITY_SELECTOR is in none of the
  19865. // entries.
  19866. NotIns []string `json:"notIns,omitempty"`
  19867. // Permissions: A permission is a string of form '..' (e.g.,
  19868. // 'storage.buckets.list'). A value of '*' matches all permissions, and
  19869. // a verb part of '*' (e.g., 'storage.buckets.*') matches all verbs.
  19870. Permissions []string `json:"permissions,omitempty"`
  19871. // ForceSendFields is a list of field names (e.g. "Action") to
  19872. // unconditionally include in API requests. By default, fields with
  19873. // empty values are omitted from API requests. However, any non-pointer,
  19874. // non-interface field appearing in ForceSendFields will be sent to the
  19875. // server regardless of whether the field is empty or not. This may be
  19876. // used to include empty fields in Patch requests.
  19877. ForceSendFields []string `json:"-"`
  19878. // NullFields is a list of field names (e.g. "Action") to include in API
  19879. // requests with the JSON null value. By default, fields with empty
  19880. // values are omitted from API requests. However, any field with an
  19881. // empty value appearing in NullFields will be sent to the server as
  19882. // null. It is an error if a field in this list has a non-empty value.
  19883. // This may be used to include null fields in Patch requests.
  19884. NullFields []string `json:"-"`
  19885. }
  19886. func (s *Rule) MarshalJSON() ([]byte, error) {
  19887. type NoMethod Rule
  19888. raw := NoMethod(*s)
  19889. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  19890. }
  19891. type SSLHealthCheck struct {
  19892. // Port: The TCP port number for the health check request. The default
  19893. // value is 443. Valid values are 1 through 65535.
  19894. Port int64 `json:"port,omitempty"`
  19895. // PortName: Port name as defined in InstanceGroup#NamedPort#name. If
  19896. // both port and port_name are defined, port takes precedence.
  19897. PortName string `json:"portName,omitempty"`
  19898. // PortSpecification: Specifies how port is selected for health
  19899. // checking, can be one of following values:
  19900. // USE_FIXED_PORT: The port number in
  19901. // port
  19902. // is used for health checking.
  19903. // USE_NAMED_PORT: The
  19904. // portName
  19905. // is used for health checking.
  19906. // USE_SERVING_PORT: For NetworkEndpointGroup, the port specified for
  19907. // each network endpoint is used for health checking. For other
  19908. // backends, the port or named port specified in the Backend Service is
  19909. // used for health checking.
  19910. //
  19911. //
  19912. // If not specified, SSL health check follows behavior specified
  19913. // in
  19914. // port
  19915. // and
  19916. // portName
  19917. // fields.
  19918. //
  19919. // Possible values:
  19920. // "USE_FIXED_PORT"
  19921. // "USE_NAMED_PORT"
  19922. // "USE_SERVING_PORT"
  19923. PortSpecification string `json:"portSpecification,omitempty"`
  19924. // ProxyHeader: Specifies the type of proxy header to append before
  19925. // sending data to the backend, either NONE or PROXY_V1. The default is
  19926. // NONE.
  19927. //
  19928. // Possible values:
  19929. // "NONE"
  19930. // "PROXY_V1"
  19931. ProxyHeader string `json:"proxyHeader,omitempty"`
  19932. // Request: The application data to send once the SSL connection has
  19933. // been established (default value is empty). If both request and
  19934. // response are empty, the connection establishment alone will indicate
  19935. // health. The request data can only be ASCII.
  19936. Request string `json:"request,omitempty"`
  19937. // Response: The bytes to match against the beginning of the response
  19938. // data. If left empty (the default value), any response will indicate
  19939. // health. The response data can only be ASCII.
  19940. Response string `json:"response,omitempty"`
  19941. // ForceSendFields is a list of field names (e.g. "Port") to
  19942. // unconditionally include in API requests. By default, fields with
  19943. // empty values are omitted from API requests. However, any non-pointer,
  19944. // non-interface field appearing in ForceSendFields will be sent to the
  19945. // server regardless of whether the field is empty or not. This may be
  19946. // used to include empty fields in Patch requests.
  19947. ForceSendFields []string `json:"-"`
  19948. // NullFields is a list of field names (e.g. "Port") to include in API
  19949. // requests with the JSON null value. By default, fields with empty
  19950. // values are omitted from API requests. However, any field with an
  19951. // empty value appearing in NullFields will be sent to the server as
  19952. // null. It is an error if a field in this list has a non-empty value.
  19953. // This may be used to include null fields in Patch requests.
  19954. NullFields []string `json:"-"`
  19955. }
  19956. func (s *SSLHealthCheck) MarshalJSON() ([]byte, error) {
  19957. type NoMethod SSLHealthCheck
  19958. raw := NoMethod(*s)
  19959. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  19960. }
  19961. // Scheduling: Sets the scheduling options for an Instance.
  19962. type Scheduling struct {
  19963. // AutomaticRestart: Specifies whether the instance should be
  19964. // automatically restarted if it is terminated by Compute Engine (not
  19965. // terminated by a user). You can only set the automatic restart option
  19966. // for standard instances. Preemptible instances cannot be automatically
  19967. // restarted.
  19968. //
  19969. // By default, this is set to true so an instance is automatically
  19970. // restarted if it is terminated by Compute Engine.
  19971. AutomaticRestart *bool `json:"automaticRestart,omitempty"`
  19972. // NodeAffinities: A set of node affinity and anti-affinity.
  19973. NodeAffinities []*SchedulingNodeAffinity `json:"nodeAffinities,omitempty"`
  19974. // OnHostMaintenance: Defines the maintenance behavior for this
  19975. // instance. For standard instances, the default behavior is MIGRATE.
  19976. // For preemptible instances, the default and only possible behavior is
  19977. // TERMINATE. For more information, see Setting Instance Scheduling
  19978. // Options.
  19979. //
  19980. // Possible values:
  19981. // "MIGRATE"
  19982. // "TERMINATE"
  19983. OnHostMaintenance string `json:"onHostMaintenance,omitempty"`
  19984. // Preemptible: Defines whether the instance is preemptible. This can
  19985. // only be set during instance creation, it cannot be set or changed
  19986. // after the instance has been created.
  19987. Preemptible bool `json:"preemptible,omitempty"`
  19988. // ForceSendFields is a list of field names (e.g. "AutomaticRestart") to
  19989. // unconditionally include in API requests. By default, fields with
  19990. // empty values are omitted from API requests. However, any non-pointer,
  19991. // non-interface field appearing in ForceSendFields will be sent to the
  19992. // server regardless of whether the field is empty or not. This may be
  19993. // used to include empty fields in Patch requests.
  19994. ForceSendFields []string `json:"-"`
  19995. // NullFields is a list of field names (e.g. "AutomaticRestart") to
  19996. // include in API requests with the JSON null value. By default, fields
  19997. // with empty values are omitted from API requests. However, any field
  19998. // with an empty value appearing in NullFields will be sent to the
  19999. // server as null. It is an error if a field in this list has a
  20000. // non-empty value. This may be used to include null fields in Patch
  20001. // requests.
  20002. NullFields []string `json:"-"`
  20003. }
  20004. func (s *Scheduling) MarshalJSON() ([]byte, error) {
  20005. type NoMethod Scheduling
  20006. raw := NoMethod(*s)
  20007. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  20008. }
  20009. // SchedulingNodeAffinity: Node Affinity: the configuration of desired
  20010. // nodes onto which this Instance could be scheduled.
  20011. type SchedulingNodeAffinity struct {
  20012. // Key: Corresponds to the label key of Node resource.
  20013. Key string `json:"key,omitempty"`
  20014. // Operator: Defines the operation of node selection.
  20015. //
  20016. // Possible values:
  20017. // "IN"
  20018. // "NOT_IN"
  20019. // "OPERATOR_UNSPECIFIED"
  20020. Operator string `json:"operator,omitempty"`
  20021. // Values: Corresponds to the label values of Node resource.
  20022. Values []string `json:"values,omitempty"`
  20023. // ForceSendFields is a list of field names (e.g. "Key") to
  20024. // unconditionally include in API requests. By default, fields with
  20025. // empty values are omitted from API requests. However, any non-pointer,
  20026. // non-interface field appearing in ForceSendFields will be sent to the
  20027. // server regardless of whether the field is empty or not. This may be
  20028. // used to include empty fields in Patch requests.
  20029. ForceSendFields []string `json:"-"`
  20030. // NullFields is a list of field names (e.g. "Key") to include in API
  20031. // requests with the JSON null value. By default, fields with empty
  20032. // values are omitted from API requests. However, any field with an
  20033. // empty value appearing in NullFields will be sent to the server as
  20034. // null. It is an error if a field in this list has a non-empty value.
  20035. // This may be used to include null fields in Patch requests.
  20036. NullFields []string `json:"-"`
  20037. }
  20038. func (s *SchedulingNodeAffinity) MarshalJSON() ([]byte, error) {
  20039. type NoMethod SchedulingNodeAffinity
  20040. raw := NoMethod(*s)
  20041. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  20042. }
  20043. type SecurityPoliciesListPreconfiguredExpressionSetsResponse struct {
  20044. PreconfiguredExpressionSets *SecurityPoliciesWafConfig `json:"preconfiguredExpressionSets,omitempty"`
  20045. // ServerResponse contains the HTTP response code and headers from the
  20046. // server.
  20047. googleapi.ServerResponse `json:"-"`
  20048. // ForceSendFields is a list of field names (e.g.
  20049. // "PreconfiguredExpressionSets") to unconditionally include in API
  20050. // requests. By default, fields with empty values are omitted from API
  20051. // requests. However, any non-pointer, non-interface field appearing in
  20052. // ForceSendFields will be sent to the server regardless of whether the
  20053. // field is empty or not. This may be used to include empty fields in
  20054. // Patch requests.
  20055. ForceSendFields []string `json:"-"`
  20056. // NullFields is a list of field names (e.g.
  20057. // "PreconfiguredExpressionSets") to include in API requests with the
  20058. // JSON null value. By default, fields with empty values are omitted
  20059. // from API requests. However, any field with an empty value appearing
  20060. // in NullFields will be sent to the server as null. It is an error if a
  20061. // field in this list has a non-empty value. This may be used to include
  20062. // null fields in Patch requests.
  20063. NullFields []string `json:"-"`
  20064. }
  20065. func (s *SecurityPoliciesListPreconfiguredExpressionSetsResponse) MarshalJSON() ([]byte, error) {
  20066. type NoMethod SecurityPoliciesListPreconfiguredExpressionSetsResponse
  20067. raw := NoMethod(*s)
  20068. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  20069. }
  20070. type SecurityPoliciesWafConfig struct {
  20071. WafRules *PreconfiguredWafSet `json:"wafRules,omitempty"`
  20072. // ForceSendFields is a list of field names (e.g. "WafRules") to
  20073. // unconditionally include in API requests. By default, fields with
  20074. // empty values are omitted from API requests. However, any non-pointer,
  20075. // non-interface field appearing in ForceSendFields will be sent to the
  20076. // server regardless of whether the field is empty or not. This may be
  20077. // used to include empty fields in Patch requests.
  20078. ForceSendFields []string `json:"-"`
  20079. // NullFields is a list of field names (e.g. "WafRules") to include in
  20080. // API requests with the JSON null value. By default, fields with empty
  20081. // values are omitted from API requests. However, any field with an
  20082. // empty value appearing in NullFields will be sent to the server as
  20083. // null. It is an error if a field in this list has a non-empty value.
  20084. // This may be used to include null fields in Patch requests.
  20085. NullFields []string `json:"-"`
  20086. }
  20087. func (s *SecurityPoliciesWafConfig) MarshalJSON() ([]byte, error) {
  20088. type NoMethod SecurityPoliciesWafConfig
  20089. raw := NoMethod(*s)
  20090. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  20091. }
  20092. // SecurityPolicy: A security policy is comprised of one or more rules.
  20093. // It can also be associated with one or more 'targets'. Next available
  20094. // tag: 11
  20095. type SecurityPolicy struct {
  20096. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  20097. // format.
  20098. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  20099. // Description: An optional description of this resource. Provide this
  20100. // property when you create the resource.
  20101. Description string `json:"description,omitempty"`
  20102. // Fingerprint: Specifies a fingerprint for this resource, which is
  20103. // essentially a hash of the metadata's contents and used for optimistic
  20104. // locking. The fingerprint is initially generated by Compute Engine and
  20105. // changes after every request to modify or update metadata. You must
  20106. // always provide an up-to-date fingerprint hash in order to update or
  20107. // change metadata.
  20108. //
  20109. // To see the latest fingerprint, make get() request to the security
  20110. // policy.
  20111. Fingerprint string `json:"fingerprint,omitempty"`
  20112. // Id: [Output Only] The unique identifier for the resource. This
  20113. // identifier is defined by the server.
  20114. Id uint64 `json:"id,omitempty,string"`
  20115. // Kind: [Output only] Type of the resource. Always
  20116. // compute#securityPolicyfor security policies
  20117. Kind string `json:"kind,omitempty"`
  20118. // Name: Name of the resource. Provided by the client when the resource
  20119. // is created. The name must be 1-63 characters long, and comply with
  20120. // RFC1035. Specifically, the name must be 1-63 characters long and
  20121. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  20122. // the first character must be a lowercase letter, and all following
  20123. // characters must be a dash, lowercase letter, or digit, except the
  20124. // last character, which cannot be a dash.
  20125. Name string `json:"name,omitempty"`
  20126. // Rules: A list of rules that belong to this policy. There must always
  20127. // be a default rule (rule with priority 2147483647 and match "*"). If
  20128. // no rules are provided when creating a security policy, a default rule
  20129. // with action "allow" will be added.
  20130. Rules []*SecurityPolicyRule `json:"rules,omitempty"`
  20131. // SelfLink: [Output Only] Server-defined URL for the resource.
  20132. SelfLink string `json:"selfLink,omitempty"`
  20133. // ServerResponse contains the HTTP response code and headers from the
  20134. // server.
  20135. googleapi.ServerResponse `json:"-"`
  20136. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  20137. // to unconditionally include in API requests. By default, fields with
  20138. // empty values are omitted from API requests. However, any non-pointer,
  20139. // non-interface field appearing in ForceSendFields will be sent to the
  20140. // server regardless of whether the field is empty or not. This may be
  20141. // used to include empty fields in Patch requests.
  20142. ForceSendFields []string `json:"-"`
  20143. // NullFields is a list of field names (e.g. "CreationTimestamp") to
  20144. // include in API requests with the JSON null value. By default, fields
  20145. // with empty values are omitted from API requests. However, any field
  20146. // with an empty value appearing in NullFields will be sent to the
  20147. // server as null. It is an error if a field in this list has a
  20148. // non-empty value. This may be used to include null fields in Patch
  20149. // requests.
  20150. NullFields []string `json:"-"`
  20151. }
  20152. func (s *SecurityPolicy) MarshalJSON() ([]byte, error) {
  20153. type NoMethod SecurityPolicy
  20154. raw := NoMethod(*s)
  20155. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  20156. }
  20157. type SecurityPolicyList struct {
  20158. // Id: [Output Only] Unique identifier for the resource; defined by the
  20159. // server.
  20160. Id string `json:"id,omitempty"`
  20161. // Items: A list of SecurityPolicy resources.
  20162. Items []*SecurityPolicy `json:"items,omitempty"`
  20163. // Kind: [Output Only] Type of resource. Always
  20164. // compute#securityPolicyList for listsof securityPolicies
  20165. Kind string `json:"kind,omitempty"`
  20166. // NextPageToken: [Output Only] This token allows you to get the next
  20167. // page of results for list requests. If the number of results is larger
  20168. // than maxResults, use the nextPageToken as a value for the query
  20169. // parameter pageToken in the next list request. Subsequent list
  20170. // requests will have their own nextPageToken to continue paging through
  20171. // the results.
  20172. NextPageToken string `json:"nextPageToken,omitempty"`
  20173. // Warning: [Output Only] Informational warning message.
  20174. Warning *SecurityPolicyListWarning `json:"warning,omitempty"`
  20175. // ServerResponse contains the HTTP response code and headers from the
  20176. // server.
  20177. googleapi.ServerResponse `json:"-"`
  20178. // ForceSendFields is a list of field names (e.g. "Id") to
  20179. // unconditionally include in API requests. By default, fields with
  20180. // empty values are omitted from API requests. However, any non-pointer,
  20181. // non-interface field appearing in ForceSendFields will be sent to the
  20182. // server regardless of whether the field is empty or not. This may be
  20183. // used to include empty fields in Patch requests.
  20184. ForceSendFields []string `json:"-"`
  20185. // NullFields is a list of field names (e.g. "Id") to include in API
  20186. // requests with the JSON null value. By default, fields with empty
  20187. // values are omitted from API requests. However, any field with an
  20188. // empty value appearing in NullFields will be sent to the server as
  20189. // null. It is an error if a field in this list has a non-empty value.
  20190. // This may be used to include null fields in Patch requests.
  20191. NullFields []string `json:"-"`
  20192. }
  20193. func (s *SecurityPolicyList) MarshalJSON() ([]byte, error) {
  20194. type NoMethod SecurityPolicyList
  20195. raw := NoMethod(*s)
  20196. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  20197. }
  20198. // SecurityPolicyListWarning: [Output Only] Informational warning
  20199. // message.
  20200. type SecurityPolicyListWarning struct {
  20201. // Code: [Output Only] A warning code, if applicable. For example,
  20202. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  20203. // the response.
  20204. //
  20205. // Possible values:
  20206. // "CLEANUP_FAILED"
  20207. // "DEPRECATED_RESOURCE_USED"
  20208. // "DEPRECATED_TYPE_USED"
  20209. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  20210. // "EXPERIMENTAL_TYPE_USED"
  20211. // "EXTERNAL_API_WARNING"
  20212. // "FIELD_VALUE_OVERRIDEN"
  20213. // "INJECTED_KERNELS_DEPRECATED"
  20214. // "MISSING_TYPE_DEPENDENCY"
  20215. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  20216. // "NEXT_HOP_CANNOT_IP_FORWARD"
  20217. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  20218. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  20219. // "NEXT_HOP_NOT_RUNNING"
  20220. // "NOT_CRITICAL_ERROR"
  20221. // "NO_RESULTS_ON_PAGE"
  20222. // "REQUIRED_TOS_AGREEMENT"
  20223. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  20224. // "RESOURCE_NOT_DELETED"
  20225. // "SCHEMA_VALIDATION_IGNORED"
  20226. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  20227. // "UNDECLARED_PROPERTIES"
  20228. // "UNREACHABLE"
  20229. Code string `json:"code,omitempty"`
  20230. // Data: [Output Only] Metadata about this warning in key: value format.
  20231. // For example:
  20232. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  20233. Data []*SecurityPolicyListWarningData `json:"data,omitempty"`
  20234. // Message: [Output Only] A human-readable description of the warning
  20235. // code.
  20236. Message string `json:"message,omitempty"`
  20237. // ForceSendFields is a list of field names (e.g. "Code") to
  20238. // unconditionally include in API requests. By default, fields with
  20239. // empty values are omitted from API requests. However, any non-pointer,
  20240. // non-interface field appearing in ForceSendFields will be sent to the
  20241. // server regardless of whether the field is empty or not. This may be
  20242. // used to include empty fields in Patch requests.
  20243. ForceSendFields []string `json:"-"`
  20244. // NullFields is a list of field names (e.g. "Code") to include in API
  20245. // requests with the JSON null value. By default, fields with empty
  20246. // values are omitted from API requests. However, any field with an
  20247. // empty value appearing in NullFields will be sent to the server as
  20248. // null. It is an error if a field in this list has a non-empty value.
  20249. // This may be used to include null fields in Patch requests.
  20250. NullFields []string `json:"-"`
  20251. }
  20252. func (s *SecurityPolicyListWarning) MarshalJSON() ([]byte, error) {
  20253. type NoMethod SecurityPolicyListWarning
  20254. raw := NoMethod(*s)
  20255. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  20256. }
  20257. type SecurityPolicyListWarningData struct {
  20258. // Key: [Output Only] A key that provides more detail on the warning
  20259. // being returned. For example, for warnings where there are no results
  20260. // in a list request for a particular zone, this key might be scope and
  20261. // the key value might be the zone name. Other examples might be a key
  20262. // indicating a deprecated resource and a suggested replacement, or a
  20263. // warning about invalid network settings (for example, if an instance
  20264. // attempts to perform IP forwarding but is not enabled for IP
  20265. // forwarding).
  20266. Key string `json:"key,omitempty"`
  20267. // Value: [Output Only] A warning data value corresponding to the key.
  20268. Value string `json:"value,omitempty"`
  20269. // ForceSendFields is a list of field names (e.g. "Key") to
  20270. // unconditionally include in API requests. By default, fields with
  20271. // empty values are omitted from API requests. However, any non-pointer,
  20272. // non-interface field appearing in ForceSendFields will be sent to the
  20273. // server regardless of whether the field is empty or not. This may be
  20274. // used to include empty fields in Patch requests.
  20275. ForceSendFields []string `json:"-"`
  20276. // NullFields is a list of field names (e.g. "Key") to include in API
  20277. // requests with the JSON null value. By default, fields with empty
  20278. // values are omitted from API requests. However, any field with an
  20279. // empty value appearing in NullFields will be sent to the server as
  20280. // null. It is an error if a field in this list has a non-empty value.
  20281. // This may be used to include null fields in Patch requests.
  20282. NullFields []string `json:"-"`
  20283. }
  20284. func (s *SecurityPolicyListWarningData) MarshalJSON() ([]byte, error) {
  20285. type NoMethod SecurityPolicyListWarningData
  20286. raw := NoMethod(*s)
  20287. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  20288. }
  20289. type SecurityPolicyReference struct {
  20290. SecurityPolicy string `json:"securityPolicy,omitempty"`
  20291. // ForceSendFields is a list of field names (e.g. "SecurityPolicy") to
  20292. // unconditionally include in API requests. By default, fields with
  20293. // empty values are omitted from API requests. However, any non-pointer,
  20294. // non-interface field appearing in ForceSendFields will be sent to the
  20295. // server regardless of whether the field is empty or not. This may be
  20296. // used to include empty fields in Patch requests.
  20297. ForceSendFields []string `json:"-"`
  20298. // NullFields is a list of field names (e.g. "SecurityPolicy") to
  20299. // include in API requests with the JSON null value. By default, fields
  20300. // with empty values are omitted from API requests. However, any field
  20301. // with an empty value appearing in NullFields will be sent to the
  20302. // server as null. It is an error if a field in this list has a
  20303. // non-empty value. This may be used to include null fields in Patch
  20304. // requests.
  20305. NullFields []string `json:"-"`
  20306. }
  20307. func (s *SecurityPolicyReference) MarshalJSON() ([]byte, error) {
  20308. type NoMethod SecurityPolicyReference
  20309. raw := NoMethod(*s)
  20310. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  20311. }
  20312. // SecurityPolicyRule: Represents a rule that describes one or more
  20313. // match conditions along with the action to be taken when traffic
  20314. // matches this condition (allow or deny).
  20315. type SecurityPolicyRule struct {
  20316. // Action: The Action to preform when the client connection triggers the
  20317. // rule. Can currently be either "allow" or "deny()" where valid values
  20318. // for status are 403, 404, and 502.
  20319. Action string `json:"action,omitempty"`
  20320. // Description: An optional description of this resource. Provide this
  20321. // property when you create the resource.
  20322. Description string `json:"description,omitempty"`
  20323. // Kind: [Output only] Type of the resource. Always
  20324. // compute#securityPolicyRule for security policy rules
  20325. Kind string `json:"kind,omitempty"`
  20326. // Match: A match condition that incoming traffic is evaluated against.
  20327. // If it evaluates to true, the corresponding ?action? is enforced.
  20328. Match *SecurityPolicyRuleMatcher `json:"match,omitempty"`
  20329. // Preview: If set to true, the specified action is not enforced.
  20330. Preview bool `json:"preview,omitempty"`
  20331. // Priority: An integer indicating the priority of a rule in the list.
  20332. // The priority must be a positive value between 0 and 2147483647. Rules
  20333. // are evaluated in the increasing order of priority.
  20334. Priority int64 `json:"priority,omitempty"`
  20335. // ServerResponse contains the HTTP response code and headers from the
  20336. // server.
  20337. googleapi.ServerResponse `json:"-"`
  20338. // ForceSendFields is a list of field names (e.g. "Action") to
  20339. // unconditionally include in API requests. By default, fields with
  20340. // empty values are omitted from API requests. However, any non-pointer,
  20341. // non-interface field appearing in ForceSendFields will be sent to the
  20342. // server regardless of whether the field is empty or not. This may be
  20343. // used to include empty fields in Patch requests.
  20344. ForceSendFields []string `json:"-"`
  20345. // NullFields is a list of field names (e.g. "Action") to include in API
  20346. // requests with the JSON null value. By default, fields with empty
  20347. // values are omitted from API requests. However, any field with an
  20348. // empty value appearing in NullFields will be sent to the server as
  20349. // null. It is an error if a field in this list has a non-empty value.
  20350. // This may be used to include null fields in Patch requests.
  20351. NullFields []string `json:"-"`
  20352. }
  20353. func (s *SecurityPolicyRule) MarshalJSON() ([]byte, error) {
  20354. type NoMethod SecurityPolicyRule
  20355. raw := NoMethod(*s)
  20356. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  20357. }
  20358. // SecurityPolicyRuleMatcher: Represents a match condition that incoming
  20359. // traffic is evaluated against. Exactly one field must be specified.
  20360. type SecurityPolicyRuleMatcher struct {
  20361. // Config: The configuration options available when specifying
  20362. // versioned_expr. This field must be specified if versioned_expr is
  20363. // specified and cannot be specified if versioned_expr is not specified.
  20364. Config *SecurityPolicyRuleMatcherConfig `json:"config,omitempty"`
  20365. // Expr: User defined CEVAL expression. A CEVAL expression is used to
  20366. // specify match criteria such as origin.ip, source.region_code and
  20367. // contents in the request header.
  20368. Expr *Expr `json:"expr,omitempty"`
  20369. // SrcIpRanges: CIDR IP address range.
  20370. SrcIpRanges []string `json:"srcIpRanges,omitempty"`
  20371. // VersionedExpr: Preconfigured versioned expression. If this field is
  20372. // specified, config must also be specified. Available preconfigured
  20373. // expressions along with their requirements are: SRC_IPS_V1 - must
  20374. // specify the corresponding src_ip_range field in config.
  20375. //
  20376. // Possible values:
  20377. // "SRC_IPS_V1"
  20378. // "VERSIONED_EXPR_UNSPECIFIED"
  20379. VersionedExpr string `json:"versionedExpr,omitempty"`
  20380. // ForceSendFields is a list of field names (e.g. "Config") to
  20381. // unconditionally include in API requests. By default, fields with
  20382. // empty values are omitted from API requests. However, any non-pointer,
  20383. // non-interface field appearing in ForceSendFields will be sent to the
  20384. // server regardless of whether the field is empty or not. This may be
  20385. // used to include empty fields in Patch requests.
  20386. ForceSendFields []string `json:"-"`
  20387. // NullFields is a list of field names (e.g. "Config") to include in API
  20388. // requests with the JSON null value. By default, fields with empty
  20389. // values are omitted from API requests. However, any field with an
  20390. // empty value appearing in NullFields will be sent to the server as
  20391. // null. It is an error if a field in this list has a non-empty value.
  20392. // This may be used to include null fields in Patch requests.
  20393. NullFields []string `json:"-"`
  20394. }
  20395. func (s *SecurityPolicyRuleMatcher) MarshalJSON() ([]byte, error) {
  20396. type NoMethod SecurityPolicyRuleMatcher
  20397. raw := NoMethod(*s)
  20398. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  20399. }
  20400. type SecurityPolicyRuleMatcherConfig struct {
  20401. // SrcIpRanges: CIDR IP address range.
  20402. SrcIpRanges []string `json:"srcIpRanges,omitempty"`
  20403. // ForceSendFields is a list of field names (e.g. "SrcIpRanges") to
  20404. // unconditionally include in API requests. By default, fields with
  20405. // empty values are omitted from API requests. However, any non-pointer,
  20406. // non-interface field appearing in ForceSendFields will be sent to the
  20407. // server regardless of whether the field is empty or not. This may be
  20408. // used to include empty fields in Patch requests.
  20409. ForceSendFields []string `json:"-"`
  20410. // NullFields is a list of field names (e.g. "SrcIpRanges") to include
  20411. // in API requests with the JSON null value. By default, fields with
  20412. // empty values are omitted from API requests. However, any field with
  20413. // an empty value appearing in NullFields will be sent to the server as
  20414. // null. It is an error if a field in this list has a non-empty value.
  20415. // This may be used to include null fields in Patch requests.
  20416. NullFields []string `json:"-"`
  20417. }
  20418. func (s *SecurityPolicyRuleMatcherConfig) MarshalJSON() ([]byte, error) {
  20419. type NoMethod SecurityPolicyRuleMatcherConfig
  20420. raw := NoMethod(*s)
  20421. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  20422. }
  20423. // SerialPortOutput: An instance's serial console output.
  20424. type SerialPortOutput struct {
  20425. // Contents: [Output Only] The contents of the console output.
  20426. Contents string `json:"contents,omitempty"`
  20427. // Kind: [Output Only] Type of the resource. Always
  20428. // compute#serialPortOutput for serial port output.
  20429. Kind string `json:"kind,omitempty"`
  20430. // Next: [Output Only] The position of the next byte of content from the
  20431. // serial console output. Use this value in the next request as the
  20432. // start parameter.
  20433. Next int64 `json:"next,omitempty,string"`
  20434. // SelfLink: [Output Only] Server-defined URL for this resource.
  20435. SelfLink string `json:"selfLink,omitempty"`
  20436. // Start: The starting byte position of the output that was returned.
  20437. // This should match the start parameter sent with the request. If the
  20438. // serial console output exceeds the size of the buffer, older output
  20439. // will be overwritten by newer content and the start values will be
  20440. // mismatched.
  20441. Start int64 `json:"start,omitempty,string"`
  20442. // ServerResponse contains the HTTP response code and headers from the
  20443. // server.
  20444. googleapi.ServerResponse `json:"-"`
  20445. // ForceSendFields is a list of field names (e.g. "Contents") to
  20446. // unconditionally include in API requests. By default, fields with
  20447. // empty values are omitted from API requests. However, any non-pointer,
  20448. // non-interface field appearing in ForceSendFields will be sent to the
  20449. // server regardless of whether the field is empty or not. This may be
  20450. // used to include empty fields in Patch requests.
  20451. ForceSendFields []string `json:"-"`
  20452. // NullFields is a list of field names (e.g. "Contents") to include in
  20453. // API requests with the JSON null value. By default, fields with empty
  20454. // values are omitted from API requests. However, any field with an
  20455. // empty value appearing in NullFields will be sent to the server as
  20456. // null. It is an error if a field in this list has a non-empty value.
  20457. // This may be used to include null fields in Patch requests.
  20458. NullFields []string `json:"-"`
  20459. }
  20460. func (s *SerialPortOutput) MarshalJSON() ([]byte, error) {
  20461. type NoMethod SerialPortOutput
  20462. raw := NoMethod(*s)
  20463. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  20464. }
  20465. // ServiceAccount: A service account.
  20466. type ServiceAccount struct {
  20467. // Email: Email address of the service account.
  20468. Email string `json:"email,omitempty"`
  20469. // Scopes: The list of scopes to be made available for this service
  20470. // account.
  20471. Scopes []string `json:"scopes,omitempty"`
  20472. // ForceSendFields is a list of field names (e.g. "Email") to
  20473. // unconditionally include in API requests. By default, fields with
  20474. // empty values are omitted from API requests. However, any non-pointer,
  20475. // non-interface field appearing in ForceSendFields will be sent to the
  20476. // server regardless of whether the field is empty or not. This may be
  20477. // used to include empty fields in Patch requests.
  20478. ForceSendFields []string `json:"-"`
  20479. // NullFields is a list of field names (e.g. "Email") to include in API
  20480. // requests with the JSON null value. By default, fields with empty
  20481. // values are omitted from API requests. However, any field with an
  20482. // empty value appearing in NullFields will be sent to the server as
  20483. // null. It is an error if a field in this list has a non-empty value.
  20484. // This may be used to include null fields in Patch requests.
  20485. NullFields []string `json:"-"`
  20486. }
  20487. func (s *ServiceAccount) MarshalJSON() ([]byte, error) {
  20488. type NoMethod ServiceAccount
  20489. raw := NoMethod(*s)
  20490. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  20491. }
  20492. // ShieldedVmConfig: A set of Shielded VM options.
  20493. type ShieldedVmConfig struct {
  20494. // EnableIntegrityMonitoring: Defines whether the instance should have
  20495. // integrity monitoring enabled.
  20496. EnableIntegrityMonitoring bool `json:"enableIntegrityMonitoring,omitempty"`
  20497. // EnableSecureBoot: Defines whether the instance should have secure
  20498. // boot enabled.
  20499. EnableSecureBoot bool `json:"enableSecureBoot,omitempty"`
  20500. // EnableVtpm: Defines whether the instance should have the TPM enabled.
  20501. EnableVtpm bool `json:"enableVtpm,omitempty"`
  20502. // ForceSendFields is a list of field names (e.g.
  20503. // "EnableIntegrityMonitoring") to unconditionally include in API
  20504. // requests. By default, fields with empty values are omitted from API
  20505. // requests. However, any non-pointer, non-interface field appearing in
  20506. // ForceSendFields will be sent to the server regardless of whether the
  20507. // field is empty or not. This may be used to include empty fields in
  20508. // Patch requests.
  20509. ForceSendFields []string `json:"-"`
  20510. // NullFields is a list of field names (e.g.
  20511. // "EnableIntegrityMonitoring") to include in API requests with the JSON
  20512. // null value. By default, fields with empty values are omitted from API
  20513. // requests. However, any field with an empty value appearing in
  20514. // NullFields will be sent to the server as null. It is an error if a
  20515. // field in this list has a non-empty value. This may be used to include
  20516. // null fields in Patch requests.
  20517. NullFields []string `json:"-"`
  20518. }
  20519. func (s *ShieldedVmConfig) MarshalJSON() ([]byte, error) {
  20520. type NoMethod ShieldedVmConfig
  20521. raw := NoMethod(*s)
  20522. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  20523. }
  20524. // ShieldedVmIntegrityPolicy: The policy describes how boot integrity
  20525. // measurements are evaluated.
  20526. type ShieldedVmIntegrityPolicy struct {
  20527. // UpdateAutoLearnPolicy: Triggers an auto relearn event: the integrity
  20528. // monitoring module copies existing guest measurements to the baseline.
  20529. UpdateAutoLearnPolicy bool `json:"updateAutoLearnPolicy,omitempty"`
  20530. // ForceSendFields is a list of field names (e.g.
  20531. // "UpdateAutoLearnPolicy") to unconditionally include in API requests.
  20532. // By default, fields with empty values are omitted from API requests.
  20533. // However, any non-pointer, non-interface field appearing in
  20534. // ForceSendFields will be sent to the server regardless of whether the
  20535. // field is empty or not. This may be used to include empty fields in
  20536. // Patch requests.
  20537. ForceSendFields []string `json:"-"`
  20538. // NullFields is a list of field names (e.g. "UpdateAutoLearnPolicy") to
  20539. // include in API requests with the JSON null value. By default, fields
  20540. // with empty values are omitted from API requests. However, any field
  20541. // with an empty value appearing in NullFields will be sent to the
  20542. // server as null. It is an error if a field in this list has a
  20543. // non-empty value. This may be used to include null fields in Patch
  20544. // requests.
  20545. NullFields []string `json:"-"`
  20546. }
  20547. func (s *ShieldedVmIntegrityPolicy) MarshalJSON() ([]byte, error) {
  20548. type NoMethod ShieldedVmIntegrityPolicy
  20549. raw := NoMethod(*s)
  20550. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  20551. }
  20552. // SignedUrlKey: Represents a customer-supplied Signing Key used by
  20553. // Cloud CDN Signed URLs
  20554. type SignedUrlKey struct {
  20555. // KeyName: Name of the key. The name must be 1-63 characters long, and
  20556. // comply with RFC1035. Specifically, the name must be 1-63 characters
  20557. // long and match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?`
  20558. // which means the first character must be a lowercase letter, and all
  20559. // following characters must be a dash, lowercase letter, or digit,
  20560. // except the last character, which cannot be a dash.
  20561. KeyName string `json:"keyName,omitempty"`
  20562. // KeyValue: 128-bit key value used for signing the URL. The key value
  20563. // must be a valid RFC 4648 Section 5 base64url encoded string.
  20564. KeyValue string `json:"keyValue,omitempty"`
  20565. // ForceSendFields is a list of field names (e.g. "KeyName") to
  20566. // unconditionally include in API requests. By default, fields with
  20567. // empty values are omitted from API requests. However, any non-pointer,
  20568. // non-interface field appearing in ForceSendFields will be sent to the
  20569. // server regardless of whether the field is empty or not. This may be
  20570. // used to include empty fields in Patch requests.
  20571. ForceSendFields []string `json:"-"`
  20572. // NullFields is a list of field names (e.g. "KeyName") to include in
  20573. // API requests with the JSON null value. By default, fields with empty
  20574. // values are omitted from API requests. However, any field with an
  20575. // empty value appearing in NullFields will be sent to the server as
  20576. // null. It is an error if a field in this list has a non-empty value.
  20577. // This may be used to include null fields in Patch requests.
  20578. NullFields []string `json:"-"`
  20579. }
  20580. func (s *SignedUrlKey) MarshalJSON() ([]byte, error) {
  20581. type NoMethod SignedUrlKey
  20582. raw := NoMethod(*s)
  20583. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  20584. }
  20585. // Snapshot: A persistent disk snapshot resource. (== resource_for
  20586. // beta.snapshots ==) (== resource_for v1.snapshots ==)
  20587. type Snapshot struct {
  20588. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  20589. // format.
  20590. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  20591. // Description: An optional description of this resource. Provide this
  20592. // property when you create the resource.
  20593. Description string `json:"description,omitempty"`
  20594. // DiskSizeGb: [Output Only] Size of the snapshot, specified in GB.
  20595. DiskSizeGb int64 `json:"diskSizeGb,omitempty,string"`
  20596. // Id: [Output Only] The unique identifier for the resource. This
  20597. // identifier is defined by the server.
  20598. Id uint64 `json:"id,omitempty,string"`
  20599. // Kind: [Output Only] Type of the resource. Always compute#snapshot for
  20600. // Snapshot resources.
  20601. Kind string `json:"kind,omitempty"`
  20602. // LabelFingerprint: A fingerprint for the labels being applied to this
  20603. // snapshot, which is essentially a hash of the labels set used for
  20604. // optimistic locking. The fingerprint is initially generated by Compute
  20605. // Engine and changes after every request to modify or update labels.
  20606. // You must always provide an up-to-date fingerprint hash in order to
  20607. // update or change labels.
  20608. //
  20609. // To see the latest fingerprint, make a get() request to retrieve a
  20610. // snapshot.
  20611. LabelFingerprint string `json:"labelFingerprint,omitempty"`
  20612. // Labels: Labels to apply to this snapshot. These can be later modified
  20613. // by the setLabels method. Label values may be empty.
  20614. Labels map[string]string `json:"labels,omitempty"`
  20615. // LicenseCodes: [Output Only] Integer license codes indicating which
  20616. // licenses are attached to this snapshot.
  20617. LicenseCodes googleapi.Int64s `json:"licenseCodes,omitempty"`
  20618. // Licenses: [Output Only] A list of public visible licenses that apply
  20619. // to this snapshot. This can be because the original image had licenses
  20620. // attached (such as a Windows image).
  20621. Licenses []string `json:"licenses,omitempty"`
  20622. // Name: Name of the resource; provided by the client when the resource
  20623. // is created. The name must be 1-63 characters long, and comply with
  20624. // RFC1035. Specifically, the name must be 1-63 characters long and
  20625. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  20626. // the first character must be a lowercase letter, and all following
  20627. // characters must be a dash, lowercase letter, or digit, except the
  20628. // last character, which cannot be a dash.
  20629. Name string `json:"name,omitempty"`
  20630. // SelfLink: [Output Only] Server-defined URL for the resource.
  20631. SelfLink string `json:"selfLink,omitempty"`
  20632. // SnapshotEncryptionKey: Encrypts the snapshot using a
  20633. // customer-supplied encryption key.
  20634. //
  20635. // After you encrypt a snapshot using a customer-supplied key, you must
  20636. // provide the same key if you use the image later For example, you must
  20637. // provide the encryption key when you create a disk from the encrypted
  20638. // snapshot in a future request.
  20639. //
  20640. // Customer-supplied encryption keys do not protect access to metadata
  20641. // of the disk.
  20642. //
  20643. // If you do not provide an encryption key when creating the snapshot,
  20644. // then the snapshot will be encrypted using an automatically generated
  20645. // key and you do not need to provide a key to use the snapshot later.
  20646. SnapshotEncryptionKey *CustomerEncryptionKey `json:"snapshotEncryptionKey,omitempty"`
  20647. // SourceDisk: [Output Only] The source disk used to create this
  20648. // snapshot.
  20649. SourceDisk string `json:"sourceDisk,omitempty"`
  20650. // SourceDiskEncryptionKey: The customer-supplied encryption key of the
  20651. // source disk. Required if the source disk is protected by a
  20652. // customer-supplied encryption key.
  20653. SourceDiskEncryptionKey *CustomerEncryptionKey `json:"sourceDiskEncryptionKey,omitempty"`
  20654. // SourceDiskId: [Output Only] The ID value of the disk used to create
  20655. // this snapshot. This value may be used to determine whether the
  20656. // snapshot was taken from the current or a previous instance of a given
  20657. // disk name.
  20658. SourceDiskId string `json:"sourceDiskId,omitempty"`
  20659. // Status: [Output Only] The status of the snapshot. This can be
  20660. // CREATING, DELETING, FAILED, READY, or UPLOADING.
  20661. //
  20662. // Possible values:
  20663. // "CREATING"
  20664. // "DELETING"
  20665. // "FAILED"
  20666. // "READY"
  20667. // "UPLOADING"
  20668. Status string `json:"status,omitempty"`
  20669. // StorageBytes: [Output Only] A size of the storage used by the
  20670. // snapshot. As snapshots share storage, this number is expected to
  20671. // change with snapshot creation/deletion.
  20672. StorageBytes int64 `json:"storageBytes,omitempty,string"`
  20673. // StorageBytesStatus: [Output Only] An indicator whether storageBytes
  20674. // is in a stable state or it is being adjusted as a result of shared
  20675. // storage reallocation. This status can either be UPDATING, meaning the
  20676. // size of the snapshot is being updated, or UP_TO_DATE, meaning the
  20677. // size of the snapshot is up-to-date.
  20678. //
  20679. // Possible values:
  20680. // "UPDATING"
  20681. // "UP_TO_DATE"
  20682. StorageBytesStatus string `json:"storageBytesStatus,omitempty"`
  20683. // ServerResponse contains the HTTP response code and headers from the
  20684. // server.
  20685. googleapi.ServerResponse `json:"-"`
  20686. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  20687. // to unconditionally include in API requests. By default, fields with
  20688. // empty values are omitted from API requests. However, any non-pointer,
  20689. // non-interface field appearing in ForceSendFields will be sent to the
  20690. // server regardless of whether the field is empty or not. This may be
  20691. // used to include empty fields in Patch requests.
  20692. ForceSendFields []string `json:"-"`
  20693. // NullFields is a list of field names (e.g. "CreationTimestamp") to
  20694. // include in API requests with the JSON null value. By default, fields
  20695. // with empty values are omitted from API requests. However, any field
  20696. // with an empty value appearing in NullFields will be sent to the
  20697. // server as null. It is an error if a field in this list has a
  20698. // non-empty value. This may be used to include null fields in Patch
  20699. // requests.
  20700. NullFields []string `json:"-"`
  20701. }
  20702. func (s *Snapshot) MarshalJSON() ([]byte, error) {
  20703. type NoMethod Snapshot
  20704. raw := NoMethod(*s)
  20705. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  20706. }
  20707. // SnapshotList: Contains a list of Snapshot resources.
  20708. type SnapshotList struct {
  20709. // Id: [Output Only] Unique identifier for the resource; defined by the
  20710. // server.
  20711. Id string `json:"id,omitempty"`
  20712. // Items: A list of Snapshot resources.
  20713. Items []*Snapshot `json:"items,omitempty"`
  20714. // Kind: Type of resource.
  20715. Kind string `json:"kind,omitempty"`
  20716. // NextPageToken: [Output Only] This token allows you to get the next
  20717. // page of results for list requests. If the number of results is larger
  20718. // than maxResults, use the nextPageToken as a value for the query
  20719. // parameter pageToken in the next list request. Subsequent list
  20720. // requests will have their own nextPageToken to continue paging through
  20721. // the results.
  20722. NextPageToken string `json:"nextPageToken,omitempty"`
  20723. // SelfLink: [Output Only] Server-defined URL for this resource.
  20724. SelfLink string `json:"selfLink,omitempty"`
  20725. // Warning: [Output Only] Informational warning message.
  20726. Warning *SnapshotListWarning `json:"warning,omitempty"`
  20727. // ServerResponse contains the HTTP response code and headers from the
  20728. // server.
  20729. googleapi.ServerResponse `json:"-"`
  20730. // ForceSendFields is a list of field names (e.g. "Id") to
  20731. // unconditionally include in API requests. By default, fields with
  20732. // empty values are omitted from API requests. However, any non-pointer,
  20733. // non-interface field appearing in ForceSendFields will be sent to the
  20734. // server regardless of whether the field is empty or not. This may be
  20735. // used to include empty fields in Patch requests.
  20736. ForceSendFields []string `json:"-"`
  20737. // NullFields is a list of field names (e.g. "Id") to include in API
  20738. // requests with the JSON null value. By default, fields with empty
  20739. // values are omitted from API requests. However, any field with an
  20740. // empty value appearing in NullFields will be sent to the server as
  20741. // null. It is an error if a field in this list has a non-empty value.
  20742. // This may be used to include null fields in Patch requests.
  20743. NullFields []string `json:"-"`
  20744. }
  20745. func (s *SnapshotList) MarshalJSON() ([]byte, error) {
  20746. type NoMethod SnapshotList
  20747. raw := NoMethod(*s)
  20748. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  20749. }
  20750. // SnapshotListWarning: [Output Only] Informational warning message.
  20751. type SnapshotListWarning struct {
  20752. // Code: [Output Only] A warning code, if applicable. For example,
  20753. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  20754. // the response.
  20755. //
  20756. // Possible values:
  20757. // "CLEANUP_FAILED"
  20758. // "DEPRECATED_RESOURCE_USED"
  20759. // "DEPRECATED_TYPE_USED"
  20760. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  20761. // "EXPERIMENTAL_TYPE_USED"
  20762. // "EXTERNAL_API_WARNING"
  20763. // "FIELD_VALUE_OVERRIDEN"
  20764. // "INJECTED_KERNELS_DEPRECATED"
  20765. // "MISSING_TYPE_DEPENDENCY"
  20766. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  20767. // "NEXT_HOP_CANNOT_IP_FORWARD"
  20768. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  20769. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  20770. // "NEXT_HOP_NOT_RUNNING"
  20771. // "NOT_CRITICAL_ERROR"
  20772. // "NO_RESULTS_ON_PAGE"
  20773. // "REQUIRED_TOS_AGREEMENT"
  20774. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  20775. // "RESOURCE_NOT_DELETED"
  20776. // "SCHEMA_VALIDATION_IGNORED"
  20777. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  20778. // "UNDECLARED_PROPERTIES"
  20779. // "UNREACHABLE"
  20780. Code string `json:"code,omitempty"`
  20781. // Data: [Output Only] Metadata about this warning in key: value format.
  20782. // For example:
  20783. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  20784. Data []*SnapshotListWarningData `json:"data,omitempty"`
  20785. // Message: [Output Only] A human-readable description of the warning
  20786. // code.
  20787. Message string `json:"message,omitempty"`
  20788. // ForceSendFields is a list of field names (e.g. "Code") to
  20789. // unconditionally include in API requests. By default, fields with
  20790. // empty values are omitted from API requests. However, any non-pointer,
  20791. // non-interface field appearing in ForceSendFields will be sent to the
  20792. // server regardless of whether the field is empty or not. This may be
  20793. // used to include empty fields in Patch requests.
  20794. ForceSendFields []string `json:"-"`
  20795. // NullFields is a list of field names (e.g. "Code") to include in API
  20796. // requests with the JSON null value. By default, fields with empty
  20797. // values are omitted from API requests. However, any field with an
  20798. // empty value appearing in NullFields will be sent to the server as
  20799. // null. It is an error if a field in this list has a non-empty value.
  20800. // This may be used to include null fields in Patch requests.
  20801. NullFields []string `json:"-"`
  20802. }
  20803. func (s *SnapshotListWarning) MarshalJSON() ([]byte, error) {
  20804. type NoMethod SnapshotListWarning
  20805. raw := NoMethod(*s)
  20806. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  20807. }
  20808. type SnapshotListWarningData struct {
  20809. // Key: [Output Only] A key that provides more detail on the warning
  20810. // being returned. For example, for warnings where there are no results
  20811. // in a list request for a particular zone, this key might be scope and
  20812. // the key value might be the zone name. Other examples might be a key
  20813. // indicating a deprecated resource and a suggested replacement, or a
  20814. // warning about invalid network settings (for example, if an instance
  20815. // attempts to perform IP forwarding but is not enabled for IP
  20816. // forwarding).
  20817. Key string `json:"key,omitempty"`
  20818. // Value: [Output Only] A warning data value corresponding to the key.
  20819. Value string `json:"value,omitempty"`
  20820. // ForceSendFields is a list of field names (e.g. "Key") to
  20821. // unconditionally include in API requests. By default, fields with
  20822. // empty values are omitted from API requests. However, any non-pointer,
  20823. // non-interface field appearing in ForceSendFields will be sent to the
  20824. // server regardless of whether the field is empty or not. This may be
  20825. // used to include empty fields in Patch requests.
  20826. ForceSendFields []string `json:"-"`
  20827. // NullFields is a list of field names (e.g. "Key") to include in API
  20828. // requests with the JSON null value. By default, fields with empty
  20829. // values are omitted from API requests. However, any field with an
  20830. // empty value appearing in NullFields will be sent to the server as
  20831. // null. It is an error if a field in this list has a non-empty value.
  20832. // This may be used to include null fields in Patch requests.
  20833. NullFields []string `json:"-"`
  20834. }
  20835. func (s *SnapshotListWarningData) MarshalJSON() ([]byte, error) {
  20836. type NoMethod SnapshotListWarningData
  20837. raw := NoMethod(*s)
  20838. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  20839. }
  20840. // SourceInstanceParams: A specification of the parameters to use when
  20841. // creating the instance template from a source instance.
  20842. type SourceInstanceParams struct {
  20843. // DiskConfigs: Attached disks configuration. If not provided, defaults
  20844. // are applied: For boot disk and any other R/W disks, new custom images
  20845. // will be created from each disk. For read-only disks, they will be
  20846. // attached in read-only mode. Local SSD disks will be created as blank
  20847. // volumes.
  20848. DiskConfigs []*DiskInstantiationConfig `json:"diskConfigs,omitempty"`
  20849. // ForceSendFields is a list of field names (e.g. "DiskConfigs") to
  20850. // unconditionally include in API requests. By default, fields with
  20851. // empty values are omitted from API requests. However, any non-pointer,
  20852. // non-interface field appearing in ForceSendFields will be sent to the
  20853. // server regardless of whether the field is empty or not. This may be
  20854. // used to include empty fields in Patch requests.
  20855. ForceSendFields []string `json:"-"`
  20856. // NullFields is a list of field names (e.g. "DiskConfigs") to include
  20857. // in API requests with the JSON null value. By default, fields with
  20858. // empty values are omitted from API requests. However, any field with
  20859. // an empty value appearing in NullFields will be sent to the server as
  20860. // null. It is an error if a field in this list has a non-empty value.
  20861. // This may be used to include null fields in Patch requests.
  20862. NullFields []string `json:"-"`
  20863. }
  20864. func (s *SourceInstanceParams) MarshalJSON() ([]byte, error) {
  20865. type NoMethod SourceInstanceParams
  20866. raw := NoMethod(*s)
  20867. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  20868. }
  20869. // SslCertificate: An SslCertificate resource. This resource provides a
  20870. // mechanism to upload an SSL key and certificate to the load balancer
  20871. // to serve secure connections from the user. (== resource_for
  20872. // beta.sslCertificates ==) (== resource_for v1.sslCertificates ==)
  20873. type SslCertificate struct {
  20874. // Certificate: A local certificate file. The certificate must be in PEM
  20875. // format. The certificate chain must be no greater than 5 certs long.
  20876. // The chain must include at least one intermediate cert.
  20877. Certificate string `json:"certificate,omitempty"`
  20878. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  20879. // format.
  20880. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  20881. // Description: An optional description of this resource. Provide this
  20882. // property when you create the resource.
  20883. Description string `json:"description,omitempty"`
  20884. // Id: [Output Only] The unique identifier for the resource. This
  20885. // identifier is defined by the server.
  20886. Id uint64 `json:"id,omitempty,string"`
  20887. // Kind: [Output Only] Type of the resource. Always
  20888. // compute#sslCertificate for SSL certificates.
  20889. Kind string `json:"kind,omitempty"`
  20890. // Name: Name of the resource. Provided by the client when the resource
  20891. // is created. The name must be 1-63 characters long, and comply with
  20892. // RFC1035. Specifically, the name must be 1-63 characters long and
  20893. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  20894. // the first character must be a lowercase letter, and all following
  20895. // characters must be a dash, lowercase letter, or digit, except the
  20896. // last character, which cannot be a dash.
  20897. Name string `json:"name,omitempty"`
  20898. // PrivateKey: A write-only private key in PEM format. Only insert
  20899. // requests will include this field.
  20900. PrivateKey string `json:"privateKey,omitempty"`
  20901. // SelfLink: [Output only] Server-defined URL for the resource.
  20902. SelfLink string `json:"selfLink,omitempty"`
  20903. // ServerResponse contains the HTTP response code and headers from the
  20904. // server.
  20905. googleapi.ServerResponse `json:"-"`
  20906. // ForceSendFields is a list of field names (e.g. "Certificate") to
  20907. // unconditionally include in API requests. By default, fields with
  20908. // empty values are omitted from API requests. However, any non-pointer,
  20909. // non-interface field appearing in ForceSendFields will be sent to the
  20910. // server regardless of whether the field is empty or not. This may be
  20911. // used to include empty fields in Patch requests.
  20912. ForceSendFields []string `json:"-"`
  20913. // NullFields is a list of field names (e.g. "Certificate") to include
  20914. // in API requests with the JSON null value. By default, fields with
  20915. // empty values are omitted from API requests. However, any field with
  20916. // an empty value appearing in NullFields will be sent to the server as
  20917. // null. It is an error if a field in this list has a non-empty value.
  20918. // This may be used to include null fields in Patch requests.
  20919. NullFields []string `json:"-"`
  20920. }
  20921. func (s *SslCertificate) MarshalJSON() ([]byte, error) {
  20922. type NoMethod SslCertificate
  20923. raw := NoMethod(*s)
  20924. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  20925. }
  20926. // SslCertificateList: Contains a list of SslCertificate resources.
  20927. type SslCertificateList struct {
  20928. // Id: [Output Only] Unique identifier for the resource; defined by the
  20929. // server.
  20930. Id string `json:"id,omitempty"`
  20931. // Items: A list of SslCertificate resources.
  20932. Items []*SslCertificate `json:"items,omitempty"`
  20933. // Kind: Type of resource.
  20934. Kind string `json:"kind,omitempty"`
  20935. // NextPageToken: [Output Only] This token allows you to get the next
  20936. // page of results for list requests. If the number of results is larger
  20937. // than maxResults, use the nextPageToken as a value for the query
  20938. // parameter pageToken in the next list request. Subsequent list
  20939. // requests will have their own nextPageToken to continue paging through
  20940. // the results.
  20941. NextPageToken string `json:"nextPageToken,omitempty"`
  20942. // SelfLink: [Output Only] Server-defined URL for this resource.
  20943. SelfLink string `json:"selfLink,omitempty"`
  20944. // Warning: [Output Only] Informational warning message.
  20945. Warning *SslCertificateListWarning `json:"warning,omitempty"`
  20946. // ServerResponse contains the HTTP response code and headers from the
  20947. // server.
  20948. googleapi.ServerResponse `json:"-"`
  20949. // ForceSendFields is a list of field names (e.g. "Id") to
  20950. // unconditionally include in API requests. By default, fields with
  20951. // empty values are omitted from API requests. However, any non-pointer,
  20952. // non-interface field appearing in ForceSendFields will be sent to the
  20953. // server regardless of whether the field is empty or not. This may be
  20954. // used to include empty fields in Patch requests.
  20955. ForceSendFields []string `json:"-"`
  20956. // NullFields is a list of field names (e.g. "Id") to include in API
  20957. // requests with the JSON null value. By default, fields with empty
  20958. // values are omitted from API requests. However, any field with an
  20959. // empty value appearing in NullFields will be sent to the server as
  20960. // null. It is an error if a field in this list has a non-empty value.
  20961. // This may be used to include null fields in Patch requests.
  20962. NullFields []string `json:"-"`
  20963. }
  20964. func (s *SslCertificateList) MarshalJSON() ([]byte, error) {
  20965. type NoMethod SslCertificateList
  20966. raw := NoMethod(*s)
  20967. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  20968. }
  20969. // SslCertificateListWarning: [Output Only] Informational warning
  20970. // message.
  20971. type SslCertificateListWarning struct {
  20972. // Code: [Output Only] A warning code, if applicable. For example,
  20973. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  20974. // the response.
  20975. //
  20976. // Possible values:
  20977. // "CLEANUP_FAILED"
  20978. // "DEPRECATED_RESOURCE_USED"
  20979. // "DEPRECATED_TYPE_USED"
  20980. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  20981. // "EXPERIMENTAL_TYPE_USED"
  20982. // "EXTERNAL_API_WARNING"
  20983. // "FIELD_VALUE_OVERRIDEN"
  20984. // "INJECTED_KERNELS_DEPRECATED"
  20985. // "MISSING_TYPE_DEPENDENCY"
  20986. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  20987. // "NEXT_HOP_CANNOT_IP_FORWARD"
  20988. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  20989. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  20990. // "NEXT_HOP_NOT_RUNNING"
  20991. // "NOT_CRITICAL_ERROR"
  20992. // "NO_RESULTS_ON_PAGE"
  20993. // "REQUIRED_TOS_AGREEMENT"
  20994. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  20995. // "RESOURCE_NOT_DELETED"
  20996. // "SCHEMA_VALIDATION_IGNORED"
  20997. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  20998. // "UNDECLARED_PROPERTIES"
  20999. // "UNREACHABLE"
  21000. Code string `json:"code,omitempty"`
  21001. // Data: [Output Only] Metadata about this warning in key: value format.
  21002. // For example:
  21003. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  21004. Data []*SslCertificateListWarningData `json:"data,omitempty"`
  21005. // Message: [Output Only] A human-readable description of the warning
  21006. // code.
  21007. Message string `json:"message,omitempty"`
  21008. // ForceSendFields is a list of field names (e.g. "Code") to
  21009. // unconditionally include in API requests. By default, fields with
  21010. // empty values are omitted from API requests. However, any non-pointer,
  21011. // non-interface field appearing in ForceSendFields will be sent to the
  21012. // server regardless of whether the field is empty or not. This may be
  21013. // used to include empty fields in Patch requests.
  21014. ForceSendFields []string `json:"-"`
  21015. // NullFields is a list of field names (e.g. "Code") to include in API
  21016. // requests with the JSON null value. By default, fields with empty
  21017. // values are omitted from API requests. However, any field with an
  21018. // empty value appearing in NullFields will be sent to the server as
  21019. // null. It is an error if a field in this list has a non-empty value.
  21020. // This may be used to include null fields in Patch requests.
  21021. NullFields []string `json:"-"`
  21022. }
  21023. func (s *SslCertificateListWarning) MarshalJSON() ([]byte, error) {
  21024. type NoMethod SslCertificateListWarning
  21025. raw := NoMethod(*s)
  21026. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  21027. }
  21028. type SslCertificateListWarningData struct {
  21029. // Key: [Output Only] A key that provides more detail on the warning
  21030. // being returned. For example, for warnings where there are no results
  21031. // in a list request for a particular zone, this key might be scope and
  21032. // the key value might be the zone name. Other examples might be a key
  21033. // indicating a deprecated resource and a suggested replacement, or a
  21034. // warning about invalid network settings (for example, if an instance
  21035. // attempts to perform IP forwarding but is not enabled for IP
  21036. // forwarding).
  21037. Key string `json:"key,omitempty"`
  21038. // Value: [Output Only] A warning data value corresponding to the key.
  21039. Value string `json:"value,omitempty"`
  21040. // ForceSendFields is a list of field names (e.g. "Key") to
  21041. // unconditionally include in API requests. By default, fields with
  21042. // empty values are omitted from API requests. However, any non-pointer,
  21043. // non-interface field appearing in ForceSendFields will be sent to the
  21044. // server regardless of whether the field is empty or not. This may be
  21045. // used to include empty fields in Patch requests.
  21046. ForceSendFields []string `json:"-"`
  21047. // NullFields is a list of field names (e.g. "Key") to include in API
  21048. // requests with the JSON null value. By default, fields with empty
  21049. // values are omitted from API requests. However, any field with an
  21050. // empty value appearing in NullFields will be sent to the server as
  21051. // null. It is an error if a field in this list has a non-empty value.
  21052. // This may be used to include null fields in Patch requests.
  21053. NullFields []string `json:"-"`
  21054. }
  21055. func (s *SslCertificateListWarningData) MarshalJSON() ([]byte, error) {
  21056. type NoMethod SslCertificateListWarningData
  21057. raw := NoMethod(*s)
  21058. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  21059. }
  21060. type SslPoliciesList struct {
  21061. // Id: [Output Only] Unique identifier for the resource; defined by the
  21062. // server.
  21063. Id string `json:"id,omitempty"`
  21064. // Items: A list of SslPolicy resources.
  21065. Items []*SslPolicy `json:"items,omitempty"`
  21066. // Kind: [Output Only] Type of the resource. Always
  21067. // compute#sslPoliciesList for lists of sslPolicies.
  21068. Kind string `json:"kind,omitempty"`
  21069. // NextPageToken: [Output Only] This token allows you to get the next
  21070. // page of results for list requests. If the number of results is larger
  21071. // than maxResults, use the nextPageToken as a value for the query
  21072. // parameter pageToken in the next list request. Subsequent list
  21073. // requests will have their own nextPageToken to continue paging through
  21074. // the results.
  21075. NextPageToken string `json:"nextPageToken,omitempty"`
  21076. // SelfLink: [Output Only] Server-defined URL for this resource.
  21077. SelfLink string `json:"selfLink,omitempty"`
  21078. // Warning: [Output Only] Informational warning message.
  21079. Warning *SslPoliciesListWarning `json:"warning,omitempty"`
  21080. // ServerResponse contains the HTTP response code and headers from the
  21081. // server.
  21082. googleapi.ServerResponse `json:"-"`
  21083. // ForceSendFields is a list of field names (e.g. "Id") to
  21084. // unconditionally include in API requests. By default, fields with
  21085. // empty values are omitted from API requests. However, any non-pointer,
  21086. // non-interface field appearing in ForceSendFields will be sent to the
  21087. // server regardless of whether the field is empty or not. This may be
  21088. // used to include empty fields in Patch requests.
  21089. ForceSendFields []string `json:"-"`
  21090. // NullFields is a list of field names (e.g. "Id") to include in API
  21091. // requests with the JSON null value. By default, fields with empty
  21092. // values are omitted from API requests. However, any field with an
  21093. // empty value appearing in NullFields will be sent to the server as
  21094. // null. It is an error if a field in this list has a non-empty value.
  21095. // This may be used to include null fields in Patch requests.
  21096. NullFields []string `json:"-"`
  21097. }
  21098. func (s *SslPoliciesList) MarshalJSON() ([]byte, error) {
  21099. type NoMethod SslPoliciesList
  21100. raw := NoMethod(*s)
  21101. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  21102. }
  21103. // SslPoliciesListWarning: [Output Only] Informational warning message.
  21104. type SslPoliciesListWarning struct {
  21105. // Code: [Output Only] A warning code, if applicable. For example,
  21106. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  21107. // the response.
  21108. //
  21109. // Possible values:
  21110. // "CLEANUP_FAILED"
  21111. // "DEPRECATED_RESOURCE_USED"
  21112. // "DEPRECATED_TYPE_USED"
  21113. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  21114. // "EXPERIMENTAL_TYPE_USED"
  21115. // "EXTERNAL_API_WARNING"
  21116. // "FIELD_VALUE_OVERRIDEN"
  21117. // "INJECTED_KERNELS_DEPRECATED"
  21118. // "MISSING_TYPE_DEPENDENCY"
  21119. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  21120. // "NEXT_HOP_CANNOT_IP_FORWARD"
  21121. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  21122. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  21123. // "NEXT_HOP_NOT_RUNNING"
  21124. // "NOT_CRITICAL_ERROR"
  21125. // "NO_RESULTS_ON_PAGE"
  21126. // "REQUIRED_TOS_AGREEMENT"
  21127. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  21128. // "RESOURCE_NOT_DELETED"
  21129. // "SCHEMA_VALIDATION_IGNORED"
  21130. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  21131. // "UNDECLARED_PROPERTIES"
  21132. // "UNREACHABLE"
  21133. Code string `json:"code,omitempty"`
  21134. // Data: [Output Only] Metadata about this warning in key: value format.
  21135. // For example:
  21136. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  21137. Data []*SslPoliciesListWarningData `json:"data,omitempty"`
  21138. // Message: [Output Only] A human-readable description of the warning
  21139. // code.
  21140. Message string `json:"message,omitempty"`
  21141. // ForceSendFields is a list of field names (e.g. "Code") to
  21142. // unconditionally include in API requests. By default, fields with
  21143. // empty values are omitted from API requests. However, any non-pointer,
  21144. // non-interface field appearing in ForceSendFields will be sent to the
  21145. // server regardless of whether the field is empty or not. This may be
  21146. // used to include empty fields in Patch requests.
  21147. ForceSendFields []string `json:"-"`
  21148. // NullFields is a list of field names (e.g. "Code") to include in API
  21149. // requests with the JSON null value. By default, fields with empty
  21150. // values are omitted from API requests. However, any field with an
  21151. // empty value appearing in NullFields will be sent to the server as
  21152. // null. It is an error if a field in this list has a non-empty value.
  21153. // This may be used to include null fields in Patch requests.
  21154. NullFields []string `json:"-"`
  21155. }
  21156. func (s *SslPoliciesListWarning) MarshalJSON() ([]byte, error) {
  21157. type NoMethod SslPoliciesListWarning
  21158. raw := NoMethod(*s)
  21159. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  21160. }
  21161. type SslPoliciesListWarningData struct {
  21162. // Key: [Output Only] A key that provides more detail on the warning
  21163. // being returned. For example, for warnings where there are no results
  21164. // in a list request for a particular zone, this key might be scope and
  21165. // the key value might be the zone name. Other examples might be a key
  21166. // indicating a deprecated resource and a suggested replacement, or a
  21167. // warning about invalid network settings (for example, if an instance
  21168. // attempts to perform IP forwarding but is not enabled for IP
  21169. // forwarding).
  21170. Key string `json:"key,omitempty"`
  21171. // Value: [Output Only] A warning data value corresponding to the key.
  21172. Value string `json:"value,omitempty"`
  21173. // ForceSendFields is a list of field names (e.g. "Key") to
  21174. // unconditionally include in API requests. By default, fields with
  21175. // empty values are omitted from API requests. However, any non-pointer,
  21176. // non-interface field appearing in ForceSendFields will be sent to the
  21177. // server regardless of whether the field is empty or not. This may be
  21178. // used to include empty fields in Patch requests.
  21179. ForceSendFields []string `json:"-"`
  21180. // NullFields is a list of field names (e.g. "Key") to include in API
  21181. // requests with the JSON null value. By default, fields with empty
  21182. // values are omitted from API requests. However, any field with an
  21183. // empty value appearing in NullFields will be sent to the server as
  21184. // null. It is an error if a field in this list has a non-empty value.
  21185. // This may be used to include null fields in Patch requests.
  21186. NullFields []string `json:"-"`
  21187. }
  21188. func (s *SslPoliciesListWarningData) MarshalJSON() ([]byte, error) {
  21189. type NoMethod SslPoliciesListWarningData
  21190. raw := NoMethod(*s)
  21191. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  21192. }
  21193. type SslPoliciesListAvailableFeaturesResponse struct {
  21194. Features []string `json:"features,omitempty"`
  21195. // ServerResponse contains the HTTP response code and headers from the
  21196. // server.
  21197. googleapi.ServerResponse `json:"-"`
  21198. // ForceSendFields is a list of field names (e.g. "Features") to
  21199. // unconditionally include in API requests. By default, fields with
  21200. // empty values are omitted from API requests. However, any non-pointer,
  21201. // non-interface field appearing in ForceSendFields will be sent to the
  21202. // server regardless of whether the field is empty or not. This may be
  21203. // used to include empty fields in Patch requests.
  21204. ForceSendFields []string `json:"-"`
  21205. // NullFields is a list of field names (e.g. "Features") to include in
  21206. // API requests with the JSON null value. By default, fields with empty
  21207. // values are omitted from API requests. However, any field with an
  21208. // empty value appearing in NullFields will be sent to the server as
  21209. // null. It is an error if a field in this list has a non-empty value.
  21210. // This may be used to include null fields in Patch requests.
  21211. NullFields []string `json:"-"`
  21212. }
  21213. func (s *SslPoliciesListAvailableFeaturesResponse) MarshalJSON() ([]byte, error) {
  21214. type NoMethod SslPoliciesListAvailableFeaturesResponse
  21215. raw := NoMethod(*s)
  21216. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  21217. }
  21218. // SslPolicy: A SSL policy specifies the server-side support for SSL
  21219. // features. This can be attached to a TargetHttpsProxy or a
  21220. // TargetSslProxy. This affects connections between clients and the
  21221. // HTTPS or SSL proxy load balancer. They do not affect the connection
  21222. // between the load balancers and the backends.
  21223. type SslPolicy struct {
  21224. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  21225. // format.
  21226. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  21227. // CustomFeatures: A list of features enabled when the selected profile
  21228. // is CUSTOM. The
  21229. // - method returns the set of features that can be specified in this
  21230. // list. This field must be empty if the profile is not CUSTOM.
  21231. CustomFeatures []string `json:"customFeatures,omitempty"`
  21232. // Description: An optional description of this resource. Provide this
  21233. // property when you create the resource.
  21234. Description string `json:"description,omitempty"`
  21235. // EnabledFeatures: [Output Only] The list of features enabled in the
  21236. // SSL policy.
  21237. EnabledFeatures []string `json:"enabledFeatures,omitempty"`
  21238. // Fingerprint: Fingerprint of this resource. A hash of the contents
  21239. // stored in this object. This field is used in optimistic locking. This
  21240. // field will be ignored when inserting a SslPolicy. An up-to-date
  21241. // fingerprint must be provided in order to update the SslPolicy.
  21242. Fingerprint string `json:"fingerprint,omitempty"`
  21243. // Id: [Output Only] The unique identifier for the resource. This
  21244. // identifier is defined by the server.
  21245. Id uint64 `json:"id,omitempty,string"`
  21246. // Kind: [Output only] Type of the resource. Always compute#sslPolicyfor
  21247. // SSL policies.
  21248. Kind string `json:"kind,omitempty"`
  21249. // MinTlsVersion: The minimum version of SSL protocol that can be used
  21250. // by the clients to establish a connection with the load balancer. This
  21251. // can be one of TLS_1_0, TLS_1_1, TLS_1_2.
  21252. //
  21253. // Possible values:
  21254. // "TLS_1_0"
  21255. // "TLS_1_1"
  21256. // "TLS_1_2"
  21257. MinTlsVersion string `json:"minTlsVersion,omitempty"`
  21258. // Name: Name of the resource. The name must be 1-63 characters long,
  21259. // and comply with RFC1035. Specifically, the name must be 1-63
  21260. // characters long and match the regular expression
  21261. // `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be
  21262. // a lowercase letter, and all following characters must be a dash,
  21263. // lowercase letter, or digit, except the last character, which cannot
  21264. // be a dash.
  21265. Name string `json:"name,omitempty"`
  21266. // Profile: Profile specifies the set of SSL features that can be used
  21267. // by the load balancer when negotiating SSL with clients. This can be
  21268. // one of COMPATIBLE, MODERN, RESTRICTED, or CUSTOM. If using CUSTOM,
  21269. // the set of SSL features to enable must be specified in the
  21270. // customFeatures field.
  21271. //
  21272. // Possible values:
  21273. // "COMPATIBLE"
  21274. // "CUSTOM"
  21275. // "MODERN"
  21276. // "RESTRICTED"
  21277. Profile string `json:"profile,omitempty"`
  21278. // SelfLink: [Output Only] Server-defined URL for the resource.
  21279. SelfLink string `json:"selfLink,omitempty"`
  21280. // Warnings: [Output Only] If potential misconfigurations are detected
  21281. // for this SSL policy, this field will be populated with warning
  21282. // messages.
  21283. Warnings []*SslPolicyWarnings `json:"warnings,omitempty"`
  21284. // ServerResponse contains the HTTP response code and headers from the
  21285. // server.
  21286. googleapi.ServerResponse `json:"-"`
  21287. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  21288. // to unconditionally include in API requests. By default, fields with
  21289. // empty values are omitted from API requests. However, any non-pointer,
  21290. // non-interface field appearing in ForceSendFields will be sent to the
  21291. // server regardless of whether the field is empty or not. This may be
  21292. // used to include empty fields in Patch requests.
  21293. ForceSendFields []string `json:"-"`
  21294. // NullFields is a list of field names (e.g. "CreationTimestamp") to
  21295. // include in API requests with the JSON null value. By default, fields
  21296. // with empty values are omitted from API requests. However, any field
  21297. // with an empty value appearing in NullFields will be sent to the
  21298. // server as null. It is an error if a field in this list has a
  21299. // non-empty value. This may be used to include null fields in Patch
  21300. // requests.
  21301. NullFields []string `json:"-"`
  21302. }
  21303. func (s *SslPolicy) MarshalJSON() ([]byte, error) {
  21304. type NoMethod SslPolicy
  21305. raw := NoMethod(*s)
  21306. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  21307. }
  21308. type SslPolicyWarnings struct {
  21309. // Code: [Output Only] A warning code, if applicable. For example,
  21310. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  21311. // the response.
  21312. //
  21313. // Possible values:
  21314. // "CLEANUP_FAILED"
  21315. // "DEPRECATED_RESOURCE_USED"
  21316. // "DEPRECATED_TYPE_USED"
  21317. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  21318. // "EXPERIMENTAL_TYPE_USED"
  21319. // "EXTERNAL_API_WARNING"
  21320. // "FIELD_VALUE_OVERRIDEN"
  21321. // "INJECTED_KERNELS_DEPRECATED"
  21322. // "MISSING_TYPE_DEPENDENCY"
  21323. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  21324. // "NEXT_HOP_CANNOT_IP_FORWARD"
  21325. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  21326. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  21327. // "NEXT_HOP_NOT_RUNNING"
  21328. // "NOT_CRITICAL_ERROR"
  21329. // "NO_RESULTS_ON_PAGE"
  21330. // "REQUIRED_TOS_AGREEMENT"
  21331. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  21332. // "RESOURCE_NOT_DELETED"
  21333. // "SCHEMA_VALIDATION_IGNORED"
  21334. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  21335. // "UNDECLARED_PROPERTIES"
  21336. // "UNREACHABLE"
  21337. Code string `json:"code,omitempty"`
  21338. // Data: [Output Only] Metadata about this warning in key: value format.
  21339. // For example:
  21340. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  21341. Data []*SslPolicyWarningsData `json:"data,omitempty"`
  21342. // Message: [Output Only] A human-readable description of the warning
  21343. // code.
  21344. Message string `json:"message,omitempty"`
  21345. // ForceSendFields is a list of field names (e.g. "Code") to
  21346. // unconditionally include in API requests. By default, fields with
  21347. // empty values are omitted from API requests. However, any non-pointer,
  21348. // non-interface field appearing in ForceSendFields will be sent to the
  21349. // server regardless of whether the field is empty or not. This may be
  21350. // used to include empty fields in Patch requests.
  21351. ForceSendFields []string `json:"-"`
  21352. // NullFields is a list of field names (e.g. "Code") to include in API
  21353. // requests with the JSON null value. By default, fields with empty
  21354. // values are omitted from API requests. However, any field with an
  21355. // empty value appearing in NullFields will be sent to the server as
  21356. // null. It is an error if a field in this list has a non-empty value.
  21357. // This may be used to include null fields in Patch requests.
  21358. NullFields []string `json:"-"`
  21359. }
  21360. func (s *SslPolicyWarnings) MarshalJSON() ([]byte, error) {
  21361. type NoMethod SslPolicyWarnings
  21362. raw := NoMethod(*s)
  21363. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  21364. }
  21365. type SslPolicyWarningsData struct {
  21366. // Key: [Output Only] A key that provides more detail on the warning
  21367. // being returned. For example, for warnings where there are no results
  21368. // in a list request for a particular zone, this key might be scope and
  21369. // the key value might be the zone name. Other examples might be a key
  21370. // indicating a deprecated resource and a suggested replacement, or a
  21371. // warning about invalid network settings (for example, if an instance
  21372. // attempts to perform IP forwarding but is not enabled for IP
  21373. // forwarding).
  21374. Key string `json:"key,omitempty"`
  21375. // Value: [Output Only] A warning data value corresponding to the key.
  21376. Value string `json:"value,omitempty"`
  21377. // ForceSendFields is a list of field names (e.g. "Key") to
  21378. // unconditionally include in API requests. By default, fields with
  21379. // empty values are omitted from API requests. However, any non-pointer,
  21380. // non-interface field appearing in ForceSendFields will be sent to the
  21381. // server regardless of whether the field is empty or not. This may be
  21382. // used to include empty fields in Patch requests.
  21383. ForceSendFields []string `json:"-"`
  21384. // NullFields is a list of field names (e.g. "Key") to include in API
  21385. // requests with the JSON null value. By default, fields with empty
  21386. // values are omitted from API requests. However, any field with an
  21387. // empty value appearing in NullFields will be sent to the server as
  21388. // null. It is an error if a field in this list has a non-empty value.
  21389. // This may be used to include null fields in Patch requests.
  21390. NullFields []string `json:"-"`
  21391. }
  21392. func (s *SslPolicyWarningsData) MarshalJSON() ([]byte, error) {
  21393. type NoMethod SslPolicyWarningsData
  21394. raw := NoMethod(*s)
  21395. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  21396. }
  21397. type SslPolicyReference struct {
  21398. // SslPolicy: URL of the SSL policy resource. Set this to empty string
  21399. // to clear any existing SSL policy associated with the target proxy
  21400. // resource.
  21401. SslPolicy string `json:"sslPolicy,omitempty"`
  21402. // ForceSendFields is a list of field names (e.g. "SslPolicy") to
  21403. // unconditionally include in API requests. By default, fields with
  21404. // empty values are omitted from API requests. However, any non-pointer,
  21405. // non-interface field appearing in ForceSendFields will be sent to the
  21406. // server regardless of whether the field is empty or not. This may be
  21407. // used to include empty fields in Patch requests.
  21408. ForceSendFields []string `json:"-"`
  21409. // NullFields is a list of field names (e.g. "SslPolicy") to include in
  21410. // API requests with the JSON null value. By default, fields with empty
  21411. // values are omitted from API requests. However, any field with an
  21412. // empty value appearing in NullFields will be sent to the server as
  21413. // null. It is an error if a field in this list has a non-empty value.
  21414. // This may be used to include null fields in Patch requests.
  21415. NullFields []string `json:"-"`
  21416. }
  21417. func (s *SslPolicyReference) MarshalJSON() ([]byte, error) {
  21418. type NoMethod SslPolicyReference
  21419. raw := NoMethod(*s)
  21420. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  21421. }
  21422. // Subnetwork: A Subnetwork resource. (== resource_for beta.subnetworks
  21423. // ==) (== resource_for v1.subnetworks ==)
  21424. type Subnetwork struct {
  21425. // AllowSubnetCidrRoutesOverlap: Whether this subnetwork can conflict
  21426. // with static routes. Setting this to true allows this subnetwork's
  21427. // primary and secondary ranges to conflict with routes that have
  21428. // already been configured on the corresponding network. Static routes
  21429. // will take precedence over the subnetwork route if the route prefix
  21430. // length is at least as large as the subnetwork prefix length.
  21431. //
  21432. // Also, packets destined to IPs within subnetwork may contain
  21433. // private/sensitive data and are prevented from leaving the virtual
  21434. // network. Setting this field to true will disable this feature.
  21435. //
  21436. // The default value is false and applies to all existing subnetworks
  21437. // and automatically created subnetworks.
  21438. //
  21439. // This field cannot be set to true at resource creation time.
  21440. AllowSubnetCidrRoutesOverlap bool `json:"allowSubnetCidrRoutesOverlap,omitempty"`
  21441. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  21442. // format.
  21443. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  21444. // Description: An optional description of this resource. Provide this
  21445. // property when you create the resource. This field can be set only at
  21446. // resource creation time.
  21447. Description string `json:"description,omitempty"`
  21448. // EnableFlowLogs: Whether to enable flow logging for this subnetwork.
  21449. EnableFlowLogs bool `json:"enableFlowLogs,omitempty"`
  21450. // Fingerprint: Fingerprint of this resource. A hash of the contents
  21451. // stored in this object. This field is used in optimistic locking. This
  21452. // field will be ignored when inserting a Subnetwork. An up-to-date
  21453. // fingerprint must be provided in order to update the Subnetwork.
  21454. Fingerprint string `json:"fingerprint,omitempty"`
  21455. // GatewayAddress: [Output Only] The gateway address for default routes
  21456. // to reach destination addresses outside this subnetwork.
  21457. GatewayAddress string `json:"gatewayAddress,omitempty"`
  21458. // Id: [Output Only] The unique identifier for the resource. This
  21459. // identifier is defined by the server.
  21460. Id uint64 `json:"id,omitempty,string"`
  21461. // IpCidrRange: The range of internal addresses that are owned by this
  21462. // subnetwork. Provide this property when you create the subnetwork. For
  21463. // example, 10.0.0.0/8 or 192.168.0.0/16. Ranges must be unique and
  21464. // non-overlapping within a network. Only IPv4 is supported. This field
  21465. // can be set only at resource creation time.
  21466. IpCidrRange string `json:"ipCidrRange,omitempty"`
  21467. // Kind: [Output Only] Type of the resource. Always compute#subnetwork
  21468. // for Subnetwork resources.
  21469. Kind string `json:"kind,omitempty"`
  21470. // Name: The name of the resource, provided by the client when initially
  21471. // creating the resource. The name must be 1-63 characters long, and
  21472. // comply with RFC1035. Specifically, the name must be 1-63 characters
  21473. // long and match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?`
  21474. // which means the first character must be a lowercase letter, and all
  21475. // following characters must be a dash, lowercase letter, or digit,
  21476. // except the last character, which cannot be a dash.
  21477. Name string `json:"name,omitempty"`
  21478. // Network: The URL of the network to which this subnetwork belongs,
  21479. // provided by the client when initially creating the subnetwork. Only
  21480. // networks that are in the distributed mode can have subnetworks. This
  21481. // field can be set only at resource creation time.
  21482. Network string `json:"network,omitempty"`
  21483. // PrivateIpGoogleAccess: Whether the VMs in this subnet can access
  21484. // Google services without assigned external IP addresses. This field
  21485. // can be both set at resource creation time and updated using
  21486. // setPrivateIpGoogleAccess.
  21487. PrivateIpGoogleAccess bool `json:"privateIpGoogleAccess,omitempty"`
  21488. // Region: URL of the region where the Subnetwork resides. This field
  21489. // can be set only at resource creation time.
  21490. Region string `json:"region,omitempty"`
  21491. // SecondaryIpRanges: An array of configurations for secondary IP ranges
  21492. // for VM instances contained in this subnetwork. The primary IP of such
  21493. // VM must belong to the primary ipCidrRange of the subnetwork. The
  21494. // alias IPs may belong to either primary or secondary ranges.
  21495. SecondaryIpRanges []*SubnetworkSecondaryRange `json:"secondaryIpRanges,omitempty"`
  21496. // SelfLink: [Output Only] Server-defined URL for the resource.
  21497. SelfLink string `json:"selfLink,omitempty"`
  21498. // ServerResponse contains the HTTP response code and headers from the
  21499. // server.
  21500. googleapi.ServerResponse `json:"-"`
  21501. // ForceSendFields is a list of field names (e.g.
  21502. // "AllowSubnetCidrRoutesOverlap") to unconditionally include in API
  21503. // requests. By default, fields with empty values are omitted from API
  21504. // requests. However, any non-pointer, non-interface field appearing in
  21505. // ForceSendFields will be sent to the server regardless of whether the
  21506. // field is empty or not. This may be used to include empty fields in
  21507. // Patch requests.
  21508. ForceSendFields []string `json:"-"`
  21509. // NullFields is a list of field names (e.g.
  21510. // "AllowSubnetCidrRoutesOverlap") to include in API requests with the
  21511. // JSON null value. By default, fields with empty values are omitted
  21512. // from API requests. However, any field with an empty value appearing
  21513. // in NullFields will be sent to the server as null. It is an error if a
  21514. // field in this list has a non-empty value. This may be used to include
  21515. // null fields in Patch requests.
  21516. NullFields []string `json:"-"`
  21517. }
  21518. func (s *Subnetwork) MarshalJSON() ([]byte, error) {
  21519. type NoMethod Subnetwork
  21520. raw := NoMethod(*s)
  21521. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  21522. }
  21523. type SubnetworkAggregatedList struct {
  21524. // Id: [Output Only] Unique identifier for the resource; defined by the
  21525. // server.
  21526. Id string `json:"id,omitempty"`
  21527. // Items: A list of SubnetworksScopedList resources.
  21528. Items map[string]SubnetworksScopedList `json:"items,omitempty"`
  21529. // Kind: [Output Only] Type of resource. Always
  21530. // compute#subnetworkAggregatedList for aggregated lists of subnetworks.
  21531. Kind string `json:"kind,omitempty"`
  21532. // NextPageToken: [Output Only] This token allows you to get the next
  21533. // page of results for list requests. If the number of results is larger
  21534. // than maxResults, use the nextPageToken as a value for the query
  21535. // parameter pageToken in the next list request. Subsequent list
  21536. // requests will have their own nextPageToken to continue paging through
  21537. // the results.
  21538. NextPageToken string `json:"nextPageToken,omitempty"`
  21539. // SelfLink: [Output Only] Server-defined URL for this resource.
  21540. SelfLink string `json:"selfLink,omitempty"`
  21541. // Warning: [Output Only] Informational warning message.
  21542. Warning *SubnetworkAggregatedListWarning `json:"warning,omitempty"`
  21543. // ServerResponse contains the HTTP response code and headers from the
  21544. // server.
  21545. googleapi.ServerResponse `json:"-"`
  21546. // ForceSendFields is a list of field names (e.g. "Id") to
  21547. // unconditionally include in API requests. By default, fields with
  21548. // empty values are omitted from API requests. However, any non-pointer,
  21549. // non-interface field appearing in ForceSendFields will be sent to the
  21550. // server regardless of whether the field is empty or not. This may be
  21551. // used to include empty fields in Patch requests.
  21552. ForceSendFields []string `json:"-"`
  21553. // NullFields is a list of field names (e.g. "Id") to include in API
  21554. // requests with the JSON null value. By default, fields with empty
  21555. // values are omitted from API requests. However, any field with an
  21556. // empty value appearing in NullFields will be sent to the server as
  21557. // null. It is an error if a field in this list has a non-empty value.
  21558. // This may be used to include null fields in Patch requests.
  21559. NullFields []string `json:"-"`
  21560. }
  21561. func (s *SubnetworkAggregatedList) MarshalJSON() ([]byte, error) {
  21562. type NoMethod SubnetworkAggregatedList
  21563. raw := NoMethod(*s)
  21564. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  21565. }
  21566. // SubnetworkAggregatedListWarning: [Output Only] Informational warning
  21567. // message.
  21568. type SubnetworkAggregatedListWarning struct {
  21569. // Code: [Output Only] A warning code, if applicable. For example,
  21570. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  21571. // the response.
  21572. //
  21573. // Possible values:
  21574. // "CLEANUP_FAILED"
  21575. // "DEPRECATED_RESOURCE_USED"
  21576. // "DEPRECATED_TYPE_USED"
  21577. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  21578. // "EXPERIMENTAL_TYPE_USED"
  21579. // "EXTERNAL_API_WARNING"
  21580. // "FIELD_VALUE_OVERRIDEN"
  21581. // "INJECTED_KERNELS_DEPRECATED"
  21582. // "MISSING_TYPE_DEPENDENCY"
  21583. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  21584. // "NEXT_HOP_CANNOT_IP_FORWARD"
  21585. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  21586. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  21587. // "NEXT_HOP_NOT_RUNNING"
  21588. // "NOT_CRITICAL_ERROR"
  21589. // "NO_RESULTS_ON_PAGE"
  21590. // "REQUIRED_TOS_AGREEMENT"
  21591. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  21592. // "RESOURCE_NOT_DELETED"
  21593. // "SCHEMA_VALIDATION_IGNORED"
  21594. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  21595. // "UNDECLARED_PROPERTIES"
  21596. // "UNREACHABLE"
  21597. Code string `json:"code,omitempty"`
  21598. // Data: [Output Only] Metadata about this warning in key: value format.
  21599. // For example:
  21600. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  21601. Data []*SubnetworkAggregatedListWarningData `json:"data,omitempty"`
  21602. // Message: [Output Only] A human-readable description of the warning
  21603. // code.
  21604. Message string `json:"message,omitempty"`
  21605. // ForceSendFields is a list of field names (e.g. "Code") to
  21606. // unconditionally include in API requests. By default, fields with
  21607. // empty values are omitted from API requests. However, any non-pointer,
  21608. // non-interface field appearing in ForceSendFields will be sent to the
  21609. // server regardless of whether the field is empty or not. This may be
  21610. // used to include empty fields in Patch requests.
  21611. ForceSendFields []string `json:"-"`
  21612. // NullFields is a list of field names (e.g. "Code") to include in API
  21613. // requests with the JSON null value. By default, fields with empty
  21614. // values are omitted from API requests. However, any field with an
  21615. // empty value appearing in NullFields will be sent to the server as
  21616. // null. It is an error if a field in this list has a non-empty value.
  21617. // This may be used to include null fields in Patch requests.
  21618. NullFields []string `json:"-"`
  21619. }
  21620. func (s *SubnetworkAggregatedListWarning) MarshalJSON() ([]byte, error) {
  21621. type NoMethod SubnetworkAggregatedListWarning
  21622. raw := NoMethod(*s)
  21623. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  21624. }
  21625. type SubnetworkAggregatedListWarningData struct {
  21626. // Key: [Output Only] A key that provides more detail on the warning
  21627. // being returned. For example, for warnings where there are no results
  21628. // in a list request for a particular zone, this key might be scope and
  21629. // the key value might be the zone name. Other examples might be a key
  21630. // indicating a deprecated resource and a suggested replacement, or a
  21631. // warning about invalid network settings (for example, if an instance
  21632. // attempts to perform IP forwarding but is not enabled for IP
  21633. // forwarding).
  21634. Key string `json:"key,omitempty"`
  21635. // Value: [Output Only] A warning data value corresponding to the key.
  21636. Value string `json:"value,omitempty"`
  21637. // ForceSendFields is a list of field names (e.g. "Key") to
  21638. // unconditionally include in API requests. By default, fields with
  21639. // empty values are omitted from API requests. However, any non-pointer,
  21640. // non-interface field appearing in ForceSendFields will be sent to the
  21641. // server regardless of whether the field is empty or not. This may be
  21642. // used to include empty fields in Patch requests.
  21643. ForceSendFields []string `json:"-"`
  21644. // NullFields is a list of field names (e.g. "Key") to include in API
  21645. // requests with the JSON null value. By default, fields with empty
  21646. // values are omitted from API requests. However, any field with an
  21647. // empty value appearing in NullFields will be sent to the server as
  21648. // null. It is an error if a field in this list has a non-empty value.
  21649. // This may be used to include null fields in Patch requests.
  21650. NullFields []string `json:"-"`
  21651. }
  21652. func (s *SubnetworkAggregatedListWarningData) MarshalJSON() ([]byte, error) {
  21653. type NoMethod SubnetworkAggregatedListWarningData
  21654. raw := NoMethod(*s)
  21655. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  21656. }
  21657. // SubnetworkList: Contains a list of Subnetwork resources.
  21658. type SubnetworkList struct {
  21659. // Id: [Output Only] Unique identifier for the resource; defined by the
  21660. // server.
  21661. Id string `json:"id,omitempty"`
  21662. // Items: A list of Subnetwork resources.
  21663. Items []*Subnetwork `json:"items,omitempty"`
  21664. // Kind: [Output Only] Type of resource. Always compute#subnetworkList
  21665. // for lists of subnetworks.
  21666. Kind string `json:"kind,omitempty"`
  21667. // NextPageToken: [Output Only] This token allows you to get the next
  21668. // page of results for list requests. If the number of results is larger
  21669. // than maxResults, use the nextPageToken as a value for the query
  21670. // parameter pageToken in the next list request. Subsequent list
  21671. // requests will have their own nextPageToken to continue paging through
  21672. // the results.
  21673. NextPageToken string `json:"nextPageToken,omitempty"`
  21674. // SelfLink: [Output Only] Server-defined URL for this resource.
  21675. SelfLink string `json:"selfLink,omitempty"`
  21676. // Warning: [Output Only] Informational warning message.
  21677. Warning *SubnetworkListWarning `json:"warning,omitempty"`
  21678. // ServerResponse contains the HTTP response code and headers from the
  21679. // server.
  21680. googleapi.ServerResponse `json:"-"`
  21681. // ForceSendFields is a list of field names (e.g. "Id") to
  21682. // unconditionally include in API requests. By default, fields with
  21683. // empty values are omitted from API requests. However, any non-pointer,
  21684. // non-interface field appearing in ForceSendFields will be sent to the
  21685. // server regardless of whether the field is empty or not. This may be
  21686. // used to include empty fields in Patch requests.
  21687. ForceSendFields []string `json:"-"`
  21688. // NullFields is a list of field names (e.g. "Id") to include in API
  21689. // requests with the JSON null value. By default, fields with empty
  21690. // values are omitted from API requests. However, any field with an
  21691. // empty value appearing in NullFields will be sent to the server as
  21692. // null. It is an error if a field in this list has a non-empty value.
  21693. // This may be used to include null fields in Patch requests.
  21694. NullFields []string `json:"-"`
  21695. }
  21696. func (s *SubnetworkList) MarshalJSON() ([]byte, error) {
  21697. type NoMethod SubnetworkList
  21698. raw := NoMethod(*s)
  21699. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  21700. }
  21701. // SubnetworkListWarning: [Output Only] Informational warning message.
  21702. type SubnetworkListWarning struct {
  21703. // Code: [Output Only] A warning code, if applicable. For example,
  21704. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  21705. // the response.
  21706. //
  21707. // Possible values:
  21708. // "CLEANUP_FAILED"
  21709. // "DEPRECATED_RESOURCE_USED"
  21710. // "DEPRECATED_TYPE_USED"
  21711. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  21712. // "EXPERIMENTAL_TYPE_USED"
  21713. // "EXTERNAL_API_WARNING"
  21714. // "FIELD_VALUE_OVERRIDEN"
  21715. // "INJECTED_KERNELS_DEPRECATED"
  21716. // "MISSING_TYPE_DEPENDENCY"
  21717. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  21718. // "NEXT_HOP_CANNOT_IP_FORWARD"
  21719. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  21720. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  21721. // "NEXT_HOP_NOT_RUNNING"
  21722. // "NOT_CRITICAL_ERROR"
  21723. // "NO_RESULTS_ON_PAGE"
  21724. // "REQUIRED_TOS_AGREEMENT"
  21725. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  21726. // "RESOURCE_NOT_DELETED"
  21727. // "SCHEMA_VALIDATION_IGNORED"
  21728. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  21729. // "UNDECLARED_PROPERTIES"
  21730. // "UNREACHABLE"
  21731. Code string `json:"code,omitempty"`
  21732. // Data: [Output Only] Metadata about this warning in key: value format.
  21733. // For example:
  21734. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  21735. Data []*SubnetworkListWarningData `json:"data,omitempty"`
  21736. // Message: [Output Only] A human-readable description of the warning
  21737. // code.
  21738. Message string `json:"message,omitempty"`
  21739. // ForceSendFields is a list of field names (e.g. "Code") to
  21740. // unconditionally include in API requests. By default, fields with
  21741. // empty values are omitted from API requests. However, any non-pointer,
  21742. // non-interface field appearing in ForceSendFields will be sent to the
  21743. // server regardless of whether the field is empty or not. This may be
  21744. // used to include empty fields in Patch requests.
  21745. ForceSendFields []string `json:"-"`
  21746. // NullFields is a list of field names (e.g. "Code") to include in API
  21747. // requests with the JSON null value. By default, fields with empty
  21748. // values are omitted from API requests. However, any field with an
  21749. // empty value appearing in NullFields will be sent to the server as
  21750. // null. It is an error if a field in this list has a non-empty value.
  21751. // This may be used to include null fields in Patch requests.
  21752. NullFields []string `json:"-"`
  21753. }
  21754. func (s *SubnetworkListWarning) MarshalJSON() ([]byte, error) {
  21755. type NoMethod SubnetworkListWarning
  21756. raw := NoMethod(*s)
  21757. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  21758. }
  21759. type SubnetworkListWarningData struct {
  21760. // Key: [Output Only] A key that provides more detail on the warning
  21761. // being returned. For example, for warnings where there are no results
  21762. // in a list request for a particular zone, this key might be scope and
  21763. // the key value might be the zone name. Other examples might be a key
  21764. // indicating a deprecated resource and a suggested replacement, or a
  21765. // warning about invalid network settings (for example, if an instance
  21766. // attempts to perform IP forwarding but is not enabled for IP
  21767. // forwarding).
  21768. Key string `json:"key,omitempty"`
  21769. // Value: [Output Only] A warning data value corresponding to the key.
  21770. Value string `json:"value,omitempty"`
  21771. // ForceSendFields is a list of field names (e.g. "Key") to
  21772. // unconditionally include in API requests. By default, fields with
  21773. // empty values are omitted from API requests. However, any non-pointer,
  21774. // non-interface field appearing in ForceSendFields will be sent to the
  21775. // server regardless of whether the field is empty or not. This may be
  21776. // used to include empty fields in Patch requests.
  21777. ForceSendFields []string `json:"-"`
  21778. // NullFields is a list of field names (e.g. "Key") to include in API
  21779. // requests with the JSON null value. By default, fields with empty
  21780. // values are omitted from API requests. However, any field with an
  21781. // empty value appearing in NullFields will be sent to the server as
  21782. // null. It is an error if a field in this list has a non-empty value.
  21783. // This may be used to include null fields in Patch requests.
  21784. NullFields []string `json:"-"`
  21785. }
  21786. func (s *SubnetworkListWarningData) MarshalJSON() ([]byte, error) {
  21787. type NoMethod SubnetworkListWarningData
  21788. raw := NoMethod(*s)
  21789. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  21790. }
  21791. // SubnetworkSecondaryRange: Represents a secondary IP range of a
  21792. // subnetwork.
  21793. type SubnetworkSecondaryRange struct {
  21794. // IpCidrRange: The range of IP addresses belonging to this subnetwork
  21795. // secondary range. Provide this property when you create the
  21796. // subnetwork. Ranges must be unique and non-overlapping with all
  21797. // primary and secondary IP ranges within a network. Only IPv4 is
  21798. // supported.
  21799. IpCidrRange string `json:"ipCidrRange,omitempty"`
  21800. // RangeName: The name associated with this subnetwork secondary range,
  21801. // used when adding an alias IP range to a VM instance. The name must be
  21802. // 1-63 characters long, and comply with RFC1035. The name must be
  21803. // unique within the subnetwork.
  21804. RangeName string `json:"rangeName,omitempty"`
  21805. // ForceSendFields is a list of field names (e.g. "IpCidrRange") to
  21806. // unconditionally include in API requests. By default, fields with
  21807. // empty values are omitted from API requests. However, any non-pointer,
  21808. // non-interface field appearing in ForceSendFields will be sent to the
  21809. // server regardless of whether the field is empty or not. This may be
  21810. // used to include empty fields in Patch requests.
  21811. ForceSendFields []string `json:"-"`
  21812. // NullFields is a list of field names (e.g. "IpCidrRange") to include
  21813. // in API requests with the JSON null value. By default, fields with
  21814. // empty values are omitted from API requests. However, any field with
  21815. // an empty value appearing in NullFields will be sent to the server as
  21816. // null. It is an error if a field in this list has a non-empty value.
  21817. // This may be used to include null fields in Patch requests.
  21818. NullFields []string `json:"-"`
  21819. }
  21820. func (s *SubnetworkSecondaryRange) MarshalJSON() ([]byte, error) {
  21821. type NoMethod SubnetworkSecondaryRange
  21822. raw := NoMethod(*s)
  21823. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  21824. }
  21825. type SubnetworksExpandIpCidrRangeRequest struct {
  21826. // IpCidrRange: The IP (in CIDR format or netmask) of internal addresses
  21827. // that are legal on this Subnetwork. This range should be disjoint from
  21828. // other subnetworks within this network. This range can only be larger
  21829. // than (i.e. a superset of) the range previously defined before the
  21830. // update.
  21831. IpCidrRange string `json:"ipCidrRange,omitempty"`
  21832. // ForceSendFields is a list of field names (e.g. "IpCidrRange") to
  21833. // unconditionally include in API requests. By default, fields with
  21834. // empty values are omitted from API requests. However, any non-pointer,
  21835. // non-interface field appearing in ForceSendFields will be sent to the
  21836. // server regardless of whether the field is empty or not. This may be
  21837. // used to include empty fields in Patch requests.
  21838. ForceSendFields []string `json:"-"`
  21839. // NullFields is a list of field names (e.g. "IpCidrRange") to include
  21840. // in API requests with the JSON null value. By default, fields with
  21841. // empty values are omitted from API requests. However, any field with
  21842. // an empty value appearing in NullFields will be sent to the server as
  21843. // null. It is an error if a field in this list has a non-empty value.
  21844. // This may be used to include null fields in Patch requests.
  21845. NullFields []string `json:"-"`
  21846. }
  21847. func (s *SubnetworksExpandIpCidrRangeRequest) MarshalJSON() ([]byte, error) {
  21848. type NoMethod SubnetworksExpandIpCidrRangeRequest
  21849. raw := NoMethod(*s)
  21850. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  21851. }
  21852. type SubnetworksScopedList struct {
  21853. // Subnetworks: A list of subnetworks contained in this scope.
  21854. Subnetworks []*Subnetwork `json:"subnetworks,omitempty"`
  21855. // Warning: An informational warning that appears when the list of
  21856. // addresses is empty.
  21857. Warning *SubnetworksScopedListWarning `json:"warning,omitempty"`
  21858. // ForceSendFields is a list of field names (e.g. "Subnetworks") to
  21859. // unconditionally include in API requests. By default, fields with
  21860. // empty values are omitted from API requests. However, any non-pointer,
  21861. // non-interface field appearing in ForceSendFields will be sent to the
  21862. // server regardless of whether the field is empty or not. This may be
  21863. // used to include empty fields in Patch requests.
  21864. ForceSendFields []string `json:"-"`
  21865. // NullFields is a list of field names (e.g. "Subnetworks") to include
  21866. // in API requests with the JSON null value. By default, fields with
  21867. // empty values are omitted from API requests. However, any field with
  21868. // an empty value appearing in NullFields will be sent to the server as
  21869. // null. It is an error if a field in this list has a non-empty value.
  21870. // This may be used to include null fields in Patch requests.
  21871. NullFields []string `json:"-"`
  21872. }
  21873. func (s *SubnetworksScopedList) MarshalJSON() ([]byte, error) {
  21874. type NoMethod SubnetworksScopedList
  21875. raw := NoMethod(*s)
  21876. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  21877. }
  21878. // SubnetworksScopedListWarning: An informational warning that appears
  21879. // when the list of addresses is empty.
  21880. type SubnetworksScopedListWarning struct {
  21881. // Code: [Output Only] A warning code, if applicable. For example,
  21882. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  21883. // the response.
  21884. //
  21885. // Possible values:
  21886. // "CLEANUP_FAILED"
  21887. // "DEPRECATED_RESOURCE_USED"
  21888. // "DEPRECATED_TYPE_USED"
  21889. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  21890. // "EXPERIMENTAL_TYPE_USED"
  21891. // "EXTERNAL_API_WARNING"
  21892. // "FIELD_VALUE_OVERRIDEN"
  21893. // "INJECTED_KERNELS_DEPRECATED"
  21894. // "MISSING_TYPE_DEPENDENCY"
  21895. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  21896. // "NEXT_HOP_CANNOT_IP_FORWARD"
  21897. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  21898. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  21899. // "NEXT_HOP_NOT_RUNNING"
  21900. // "NOT_CRITICAL_ERROR"
  21901. // "NO_RESULTS_ON_PAGE"
  21902. // "REQUIRED_TOS_AGREEMENT"
  21903. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  21904. // "RESOURCE_NOT_DELETED"
  21905. // "SCHEMA_VALIDATION_IGNORED"
  21906. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  21907. // "UNDECLARED_PROPERTIES"
  21908. // "UNREACHABLE"
  21909. Code string `json:"code,omitempty"`
  21910. // Data: [Output Only] Metadata about this warning in key: value format.
  21911. // For example:
  21912. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  21913. Data []*SubnetworksScopedListWarningData `json:"data,omitempty"`
  21914. // Message: [Output Only] A human-readable description of the warning
  21915. // code.
  21916. Message string `json:"message,omitempty"`
  21917. // ForceSendFields is a list of field names (e.g. "Code") to
  21918. // unconditionally include in API requests. By default, fields with
  21919. // empty values are omitted from API requests. However, any non-pointer,
  21920. // non-interface field appearing in ForceSendFields will be sent to the
  21921. // server regardless of whether the field is empty or not. This may be
  21922. // used to include empty fields in Patch requests.
  21923. ForceSendFields []string `json:"-"`
  21924. // NullFields is a list of field names (e.g. "Code") to include in API
  21925. // requests with the JSON null value. By default, fields with empty
  21926. // values are omitted from API requests. However, any field with an
  21927. // empty value appearing in NullFields will be sent to the server as
  21928. // null. It is an error if a field in this list has a non-empty value.
  21929. // This may be used to include null fields in Patch requests.
  21930. NullFields []string `json:"-"`
  21931. }
  21932. func (s *SubnetworksScopedListWarning) MarshalJSON() ([]byte, error) {
  21933. type NoMethod SubnetworksScopedListWarning
  21934. raw := NoMethod(*s)
  21935. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  21936. }
  21937. type SubnetworksScopedListWarningData struct {
  21938. // Key: [Output Only] A key that provides more detail on the warning
  21939. // being returned. For example, for warnings where there are no results
  21940. // in a list request for a particular zone, this key might be scope and
  21941. // the key value might be the zone name. Other examples might be a key
  21942. // indicating a deprecated resource and a suggested replacement, or a
  21943. // warning about invalid network settings (for example, if an instance
  21944. // attempts to perform IP forwarding but is not enabled for IP
  21945. // forwarding).
  21946. Key string `json:"key,omitempty"`
  21947. // Value: [Output Only] A warning data value corresponding to the key.
  21948. Value string `json:"value,omitempty"`
  21949. // ForceSendFields is a list of field names (e.g. "Key") to
  21950. // unconditionally include in API requests. By default, fields with
  21951. // empty values are omitted from API requests. However, any non-pointer,
  21952. // non-interface field appearing in ForceSendFields will be sent to the
  21953. // server regardless of whether the field is empty or not. This may be
  21954. // used to include empty fields in Patch requests.
  21955. ForceSendFields []string `json:"-"`
  21956. // NullFields is a list of field names (e.g. "Key") to include in API
  21957. // requests with the JSON null value. By default, fields with empty
  21958. // values are omitted from API requests. However, any field with an
  21959. // empty value appearing in NullFields will be sent to the server as
  21960. // null. It is an error if a field in this list has a non-empty value.
  21961. // This may be used to include null fields in Patch requests.
  21962. NullFields []string `json:"-"`
  21963. }
  21964. func (s *SubnetworksScopedListWarningData) MarshalJSON() ([]byte, error) {
  21965. type NoMethod SubnetworksScopedListWarningData
  21966. raw := NoMethod(*s)
  21967. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  21968. }
  21969. type SubnetworksSetPrivateIpGoogleAccessRequest struct {
  21970. PrivateIpGoogleAccess bool `json:"privateIpGoogleAccess,omitempty"`
  21971. // ForceSendFields is a list of field names (e.g.
  21972. // "PrivateIpGoogleAccess") to unconditionally include in API requests.
  21973. // By default, fields with empty values are omitted from API requests.
  21974. // However, any non-pointer, non-interface field appearing in
  21975. // ForceSendFields will be sent to the server regardless of whether the
  21976. // field is empty or not. This may be used to include empty fields in
  21977. // Patch requests.
  21978. ForceSendFields []string `json:"-"`
  21979. // NullFields is a list of field names (e.g. "PrivateIpGoogleAccess") to
  21980. // include in API requests with the JSON null value. By default, fields
  21981. // with empty values are omitted from API requests. However, any field
  21982. // with an empty value appearing in NullFields will be sent to the
  21983. // server as null. It is an error if a field in this list has a
  21984. // non-empty value. This may be used to include null fields in Patch
  21985. // requests.
  21986. NullFields []string `json:"-"`
  21987. }
  21988. func (s *SubnetworksSetPrivateIpGoogleAccessRequest) MarshalJSON() ([]byte, error) {
  21989. type NoMethod SubnetworksSetPrivateIpGoogleAccessRequest
  21990. raw := NoMethod(*s)
  21991. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  21992. }
  21993. type TCPHealthCheck struct {
  21994. // Port: The TCP port number for the health check request. The default
  21995. // value is 80. Valid values are 1 through 65535.
  21996. Port int64 `json:"port,omitempty"`
  21997. // PortName: Port name as defined in InstanceGroup#NamedPort#name. If
  21998. // both port and port_name are defined, port takes precedence.
  21999. PortName string `json:"portName,omitempty"`
  22000. // ProxyHeader: Specifies the type of proxy header to append before
  22001. // sending data to the backend, either NONE or PROXY_V1. The default is
  22002. // NONE.
  22003. //
  22004. // Possible values:
  22005. // "NONE"
  22006. // "PROXY_V1"
  22007. ProxyHeader string `json:"proxyHeader,omitempty"`
  22008. // Request: The application data to send once the TCP connection has
  22009. // been established (default value is empty). If both request and
  22010. // response are empty, the connection establishment alone will indicate
  22011. // health. The request data can only be ASCII.
  22012. Request string `json:"request,omitempty"`
  22013. // Response: The bytes to match against the beginning of the response
  22014. // data. If left empty (the default value), any response will indicate
  22015. // health. The response data can only be ASCII.
  22016. Response string `json:"response,omitempty"`
  22017. // ForceSendFields is a list of field names (e.g. "Port") to
  22018. // unconditionally include in API requests. By default, fields with
  22019. // empty values are omitted from API requests. However, any non-pointer,
  22020. // non-interface field appearing in ForceSendFields will be sent to the
  22021. // server regardless of whether the field is empty or not. This may be
  22022. // used to include empty fields in Patch requests.
  22023. ForceSendFields []string `json:"-"`
  22024. // NullFields is a list of field names (e.g. "Port") to include in API
  22025. // requests with the JSON null value. By default, fields with empty
  22026. // values are omitted from API requests. However, any field with an
  22027. // empty value appearing in NullFields will be sent to the server as
  22028. // null. It is an error if a field in this list has a non-empty value.
  22029. // This may be used to include null fields in Patch requests.
  22030. NullFields []string `json:"-"`
  22031. }
  22032. func (s *TCPHealthCheck) MarshalJSON() ([]byte, error) {
  22033. type NoMethod TCPHealthCheck
  22034. raw := NoMethod(*s)
  22035. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  22036. }
  22037. // Tags: A set of instance tags.
  22038. type Tags struct {
  22039. // Fingerprint: Specifies a fingerprint for this request, which is
  22040. // essentially a hash of the tags' contents and used for optimistic
  22041. // locking. The fingerprint is initially generated by Compute Engine and
  22042. // changes after every request to modify or update tags. You must always
  22043. // provide an up-to-date fingerprint hash in order to update or change
  22044. // tags.
  22045. //
  22046. // To see the latest fingerprint, make get() request to the instance.
  22047. Fingerprint string `json:"fingerprint,omitempty"`
  22048. // Items: An array of tags. Each tag must be 1-63 characters long, and
  22049. // comply with RFC1035.
  22050. Items []string `json:"items,omitempty"`
  22051. // ForceSendFields is a list of field names (e.g. "Fingerprint") to
  22052. // unconditionally include in API requests. By default, fields with
  22053. // empty values are omitted from API requests. However, any non-pointer,
  22054. // non-interface field appearing in ForceSendFields will be sent to the
  22055. // server regardless of whether the field is empty or not. This may be
  22056. // used to include empty fields in Patch requests.
  22057. ForceSendFields []string `json:"-"`
  22058. // NullFields is a list of field names (e.g. "Fingerprint") to include
  22059. // in API requests with the JSON null value. By default, fields with
  22060. // empty values are omitted from API requests. However, any field with
  22061. // an empty value appearing in NullFields will be sent to the server as
  22062. // null. It is an error if a field in this list has a non-empty value.
  22063. // This may be used to include null fields in Patch requests.
  22064. NullFields []string `json:"-"`
  22065. }
  22066. func (s *Tags) MarshalJSON() ([]byte, error) {
  22067. type NoMethod Tags
  22068. raw := NoMethod(*s)
  22069. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  22070. }
  22071. // TargetHttpProxy: A TargetHttpProxy resource. This resource defines an
  22072. // HTTP proxy. (== resource_for beta.targetHttpProxies ==) (==
  22073. // resource_for v1.targetHttpProxies ==)
  22074. type TargetHttpProxy struct {
  22075. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  22076. // format.
  22077. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  22078. // Description: An optional description of this resource. Provide this
  22079. // property when you create the resource.
  22080. Description string `json:"description,omitempty"`
  22081. // Id: [Output Only] The unique identifier for the resource. This
  22082. // identifier is defined by the server.
  22083. Id uint64 `json:"id,omitempty,string"`
  22084. // Kind: [Output Only] Type of resource. Always compute#targetHttpProxy
  22085. // for target HTTP proxies.
  22086. Kind string `json:"kind,omitempty"`
  22087. // Name: Name of the resource. Provided by the client when the resource
  22088. // is created. The name must be 1-63 characters long, and comply with
  22089. // RFC1035. Specifically, the name must be 1-63 characters long and
  22090. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  22091. // the first character must be a lowercase letter, and all following
  22092. // characters must be a dash, lowercase letter, or digit, except the
  22093. // last character, which cannot be a dash.
  22094. Name string `json:"name,omitempty"`
  22095. // SelfLink: [Output Only] Server-defined URL for the resource.
  22096. SelfLink string `json:"selfLink,omitempty"`
  22097. // UrlMap: URL to the UrlMap resource that defines the mapping from URL
  22098. // to the BackendService.
  22099. UrlMap string `json:"urlMap,omitempty"`
  22100. // ServerResponse contains the HTTP response code and headers from the
  22101. // server.
  22102. googleapi.ServerResponse `json:"-"`
  22103. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  22104. // to unconditionally include in API requests. By default, fields with
  22105. // empty values are omitted from API requests. However, any non-pointer,
  22106. // non-interface field appearing in ForceSendFields will be sent to the
  22107. // server regardless of whether the field is empty or not. This may be
  22108. // used to include empty fields in Patch requests.
  22109. ForceSendFields []string `json:"-"`
  22110. // NullFields is a list of field names (e.g. "CreationTimestamp") to
  22111. // include in API requests with the JSON null value. By default, fields
  22112. // with empty values are omitted from API requests. However, any field
  22113. // with an empty value appearing in NullFields will be sent to the
  22114. // server as null. It is an error if a field in this list has a
  22115. // non-empty value. This may be used to include null fields in Patch
  22116. // requests.
  22117. NullFields []string `json:"-"`
  22118. }
  22119. func (s *TargetHttpProxy) MarshalJSON() ([]byte, error) {
  22120. type NoMethod TargetHttpProxy
  22121. raw := NoMethod(*s)
  22122. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  22123. }
  22124. // TargetHttpProxyList: A list of TargetHttpProxy resources.
  22125. type TargetHttpProxyList struct {
  22126. // Id: [Output Only] Unique identifier for the resource; defined by the
  22127. // server.
  22128. Id string `json:"id,omitempty"`
  22129. // Items: A list of TargetHttpProxy resources.
  22130. Items []*TargetHttpProxy `json:"items,omitempty"`
  22131. // Kind: Type of resource. Always compute#targetHttpProxyList for lists
  22132. // of target HTTP proxies.
  22133. Kind string `json:"kind,omitempty"`
  22134. // NextPageToken: [Output Only] This token allows you to get the next
  22135. // page of results for list requests. If the number of results is larger
  22136. // than maxResults, use the nextPageToken as a value for the query
  22137. // parameter pageToken in the next list request. Subsequent list
  22138. // requests will have their own nextPageToken to continue paging through
  22139. // the results.
  22140. NextPageToken string `json:"nextPageToken,omitempty"`
  22141. // SelfLink: [Output Only] Server-defined URL for this resource.
  22142. SelfLink string `json:"selfLink,omitempty"`
  22143. // Warning: [Output Only] Informational warning message.
  22144. Warning *TargetHttpProxyListWarning `json:"warning,omitempty"`
  22145. // ServerResponse contains the HTTP response code and headers from the
  22146. // server.
  22147. googleapi.ServerResponse `json:"-"`
  22148. // ForceSendFields is a list of field names (e.g. "Id") to
  22149. // unconditionally include in API requests. By default, fields with
  22150. // empty values are omitted from API requests. However, any non-pointer,
  22151. // non-interface field appearing in ForceSendFields will be sent to the
  22152. // server regardless of whether the field is empty or not. This may be
  22153. // used to include empty fields in Patch requests.
  22154. ForceSendFields []string `json:"-"`
  22155. // NullFields is a list of field names (e.g. "Id") to include in API
  22156. // requests with the JSON null value. By default, fields with empty
  22157. // values are omitted from API requests. However, any field with an
  22158. // empty value appearing in NullFields will be sent to the server as
  22159. // null. It is an error if a field in this list has a non-empty value.
  22160. // This may be used to include null fields in Patch requests.
  22161. NullFields []string `json:"-"`
  22162. }
  22163. func (s *TargetHttpProxyList) MarshalJSON() ([]byte, error) {
  22164. type NoMethod TargetHttpProxyList
  22165. raw := NoMethod(*s)
  22166. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  22167. }
  22168. // TargetHttpProxyListWarning: [Output Only] Informational warning
  22169. // message.
  22170. type TargetHttpProxyListWarning struct {
  22171. // Code: [Output Only] A warning code, if applicable. For example,
  22172. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  22173. // the response.
  22174. //
  22175. // Possible values:
  22176. // "CLEANUP_FAILED"
  22177. // "DEPRECATED_RESOURCE_USED"
  22178. // "DEPRECATED_TYPE_USED"
  22179. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  22180. // "EXPERIMENTAL_TYPE_USED"
  22181. // "EXTERNAL_API_WARNING"
  22182. // "FIELD_VALUE_OVERRIDEN"
  22183. // "INJECTED_KERNELS_DEPRECATED"
  22184. // "MISSING_TYPE_DEPENDENCY"
  22185. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  22186. // "NEXT_HOP_CANNOT_IP_FORWARD"
  22187. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  22188. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  22189. // "NEXT_HOP_NOT_RUNNING"
  22190. // "NOT_CRITICAL_ERROR"
  22191. // "NO_RESULTS_ON_PAGE"
  22192. // "REQUIRED_TOS_AGREEMENT"
  22193. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  22194. // "RESOURCE_NOT_DELETED"
  22195. // "SCHEMA_VALIDATION_IGNORED"
  22196. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  22197. // "UNDECLARED_PROPERTIES"
  22198. // "UNREACHABLE"
  22199. Code string `json:"code,omitempty"`
  22200. // Data: [Output Only] Metadata about this warning in key: value format.
  22201. // For example:
  22202. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  22203. Data []*TargetHttpProxyListWarningData `json:"data,omitempty"`
  22204. // Message: [Output Only] A human-readable description of the warning
  22205. // code.
  22206. Message string `json:"message,omitempty"`
  22207. // ForceSendFields is a list of field names (e.g. "Code") to
  22208. // unconditionally include in API requests. By default, fields with
  22209. // empty values are omitted from API requests. However, any non-pointer,
  22210. // non-interface field appearing in ForceSendFields will be sent to the
  22211. // server regardless of whether the field is empty or not. This may be
  22212. // used to include empty fields in Patch requests.
  22213. ForceSendFields []string `json:"-"`
  22214. // NullFields is a list of field names (e.g. "Code") to include in API
  22215. // requests with the JSON null value. By default, fields with empty
  22216. // values are omitted from API requests. However, any field with an
  22217. // empty value appearing in NullFields will be sent to the server as
  22218. // null. It is an error if a field in this list has a non-empty value.
  22219. // This may be used to include null fields in Patch requests.
  22220. NullFields []string `json:"-"`
  22221. }
  22222. func (s *TargetHttpProxyListWarning) MarshalJSON() ([]byte, error) {
  22223. type NoMethod TargetHttpProxyListWarning
  22224. raw := NoMethod(*s)
  22225. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  22226. }
  22227. type TargetHttpProxyListWarningData struct {
  22228. // Key: [Output Only] A key that provides more detail on the warning
  22229. // being returned. For example, for warnings where there are no results
  22230. // in a list request for a particular zone, this key might be scope and
  22231. // the key value might be the zone name. Other examples might be a key
  22232. // indicating a deprecated resource and a suggested replacement, or a
  22233. // warning about invalid network settings (for example, if an instance
  22234. // attempts to perform IP forwarding but is not enabled for IP
  22235. // forwarding).
  22236. Key string `json:"key,omitempty"`
  22237. // Value: [Output Only] A warning data value corresponding to the key.
  22238. Value string `json:"value,omitempty"`
  22239. // ForceSendFields is a list of field names (e.g. "Key") to
  22240. // unconditionally include in API requests. By default, fields with
  22241. // empty values are omitted from API requests. However, any non-pointer,
  22242. // non-interface field appearing in ForceSendFields will be sent to the
  22243. // server regardless of whether the field is empty or not. This may be
  22244. // used to include empty fields in Patch requests.
  22245. ForceSendFields []string `json:"-"`
  22246. // NullFields is a list of field names (e.g. "Key") to include in API
  22247. // requests with the JSON null value. By default, fields with empty
  22248. // values are omitted from API requests. However, any field with an
  22249. // empty value appearing in NullFields will be sent to the server as
  22250. // null. It is an error if a field in this list has a non-empty value.
  22251. // This may be used to include null fields in Patch requests.
  22252. NullFields []string `json:"-"`
  22253. }
  22254. func (s *TargetHttpProxyListWarningData) MarshalJSON() ([]byte, error) {
  22255. type NoMethod TargetHttpProxyListWarningData
  22256. raw := NoMethod(*s)
  22257. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  22258. }
  22259. type TargetHttpsProxiesSetQuicOverrideRequest struct {
  22260. // QuicOverride: QUIC policy for the TargetHttpsProxy resource.
  22261. //
  22262. // Possible values:
  22263. // "DISABLE"
  22264. // "ENABLE"
  22265. // "NONE"
  22266. QuicOverride string `json:"quicOverride,omitempty"`
  22267. // ForceSendFields is a list of field names (e.g. "QuicOverride") to
  22268. // unconditionally include in API requests. By default, fields with
  22269. // empty values are omitted from API requests. However, any non-pointer,
  22270. // non-interface field appearing in ForceSendFields will be sent to the
  22271. // server regardless of whether the field is empty or not. This may be
  22272. // used to include empty fields in Patch requests.
  22273. ForceSendFields []string `json:"-"`
  22274. // NullFields is a list of field names (e.g. "QuicOverride") to include
  22275. // in API requests with the JSON null value. By default, fields with
  22276. // empty values are omitted from API requests. However, any field with
  22277. // an empty value appearing in NullFields will be sent to the server as
  22278. // null. It is an error if a field in this list has a non-empty value.
  22279. // This may be used to include null fields in Patch requests.
  22280. NullFields []string `json:"-"`
  22281. }
  22282. func (s *TargetHttpsProxiesSetQuicOverrideRequest) MarshalJSON() ([]byte, error) {
  22283. type NoMethod TargetHttpsProxiesSetQuicOverrideRequest
  22284. raw := NoMethod(*s)
  22285. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  22286. }
  22287. type TargetHttpsProxiesSetSslCertificatesRequest struct {
  22288. // SslCertificates: New set of SslCertificate resources to associate
  22289. // with this TargetHttpsProxy resource. Currently exactly one
  22290. // SslCertificate resource must be specified.
  22291. SslCertificates []string `json:"sslCertificates,omitempty"`
  22292. // ForceSendFields is a list of field names (e.g. "SslCertificates") to
  22293. // unconditionally include in API requests. By default, fields with
  22294. // empty values are omitted from API requests. However, any non-pointer,
  22295. // non-interface field appearing in ForceSendFields will be sent to the
  22296. // server regardless of whether the field is empty or not. This may be
  22297. // used to include empty fields in Patch requests.
  22298. ForceSendFields []string `json:"-"`
  22299. // NullFields is a list of field names (e.g. "SslCertificates") to
  22300. // include in API requests with the JSON null value. By default, fields
  22301. // with empty values are omitted from API requests. However, any field
  22302. // with an empty value appearing in NullFields will be sent to the
  22303. // server as null. It is an error if a field in this list has a
  22304. // non-empty value. This may be used to include null fields in Patch
  22305. // requests.
  22306. NullFields []string `json:"-"`
  22307. }
  22308. func (s *TargetHttpsProxiesSetSslCertificatesRequest) MarshalJSON() ([]byte, error) {
  22309. type NoMethod TargetHttpsProxiesSetSslCertificatesRequest
  22310. raw := NoMethod(*s)
  22311. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  22312. }
  22313. // TargetHttpsProxy: A TargetHttpsProxy resource. This resource defines
  22314. // an HTTPS proxy. (== resource_for beta.targetHttpsProxies ==) (==
  22315. // resource_for v1.targetHttpsProxies ==)
  22316. type TargetHttpsProxy struct {
  22317. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  22318. // format.
  22319. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  22320. // Description: An optional description of this resource. Provide this
  22321. // property when you create the resource.
  22322. Description string `json:"description,omitempty"`
  22323. // Id: [Output Only] The unique identifier for the resource. This
  22324. // identifier is defined by the server.
  22325. Id uint64 `json:"id,omitempty,string"`
  22326. // Kind: [Output Only] Type of resource. Always compute#targetHttpsProxy
  22327. // for target HTTPS proxies.
  22328. Kind string `json:"kind,omitempty"`
  22329. // Name: Name of the resource. Provided by the client when the resource
  22330. // is created. The name must be 1-63 characters long, and comply with
  22331. // RFC1035. Specifically, the name must be 1-63 characters long and
  22332. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  22333. // the first character must be a lowercase letter, and all following
  22334. // characters must be a dash, lowercase letter, or digit, except the
  22335. // last character, which cannot be a dash.
  22336. Name string `json:"name,omitempty"`
  22337. // QuicOverride: Specifies the QUIC override policy for this
  22338. // TargetHttpsProxy resource. This determines whether the load balancer
  22339. // will attempt to negotiate QUIC with clients or not. Can specify one
  22340. // of NONE, ENABLE, or DISABLE. Specify ENABLE to always enable QUIC,
  22341. // Enables QUIC when set to ENABLE, and disables QUIC when set to
  22342. // DISABLE. If NONE is specified, uses the QUIC policy with no user
  22343. // overrides, which is equivalent to DISABLE. Not specifying this field
  22344. // is equivalent to specifying NONE.
  22345. //
  22346. // Possible values:
  22347. // "DISABLE"
  22348. // "ENABLE"
  22349. // "NONE"
  22350. QuicOverride string `json:"quicOverride,omitempty"`
  22351. // SelfLink: [Output Only] Server-defined URL for the resource.
  22352. SelfLink string `json:"selfLink,omitempty"`
  22353. // SslCertificates: URLs to SslCertificate resources that are used to
  22354. // authenticate connections between users and the load balancer.
  22355. // Currently, exactly one SSL certificate must be specified.
  22356. SslCertificates []string `json:"sslCertificates,omitempty"`
  22357. // SslPolicy: URL of SslPolicy resource that will be associated with the
  22358. // TargetHttpsProxy resource. If not set, the TargetHttpsProxy resource
  22359. // will not have any SSL policy configured.
  22360. SslPolicy string `json:"sslPolicy,omitempty"`
  22361. // UrlMap: A fully-qualified or valid partial URL to the UrlMap resource
  22362. // that defines the mapping from URL to the BackendService. For example,
  22363. // the following are all valid URLs for specifying a URL map:
  22364. // -
  22365. // https://www.googleapis.compute/v1/projects/project/global/urlMaps/url-map
  22366. // - projects/project/global/urlMaps/url-map
  22367. // - global/urlMaps/url-map
  22368. UrlMap string `json:"urlMap,omitempty"`
  22369. // ServerResponse contains the HTTP response code and headers from the
  22370. // server.
  22371. googleapi.ServerResponse `json:"-"`
  22372. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  22373. // to unconditionally include in API requests. By default, fields with
  22374. // empty values are omitted from API requests. However, any non-pointer,
  22375. // non-interface field appearing in ForceSendFields will be sent to the
  22376. // server regardless of whether the field is empty or not. This may be
  22377. // used to include empty fields in Patch requests.
  22378. ForceSendFields []string `json:"-"`
  22379. // NullFields is a list of field names (e.g. "CreationTimestamp") to
  22380. // include in API requests with the JSON null value. By default, fields
  22381. // with empty values are omitted from API requests. However, any field
  22382. // with an empty value appearing in NullFields will be sent to the
  22383. // server as null. It is an error if a field in this list has a
  22384. // non-empty value. This may be used to include null fields in Patch
  22385. // requests.
  22386. NullFields []string `json:"-"`
  22387. }
  22388. func (s *TargetHttpsProxy) MarshalJSON() ([]byte, error) {
  22389. type NoMethod TargetHttpsProxy
  22390. raw := NoMethod(*s)
  22391. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  22392. }
  22393. // TargetHttpsProxyList: Contains a list of TargetHttpsProxy resources.
  22394. type TargetHttpsProxyList struct {
  22395. // Id: [Output Only] Unique identifier for the resource; defined by the
  22396. // server.
  22397. Id string `json:"id,omitempty"`
  22398. // Items: A list of TargetHttpsProxy resources.
  22399. Items []*TargetHttpsProxy `json:"items,omitempty"`
  22400. // Kind: Type of resource. Always compute#targetHttpsProxyList for lists
  22401. // of target HTTPS proxies.
  22402. Kind string `json:"kind,omitempty"`
  22403. // NextPageToken: [Output Only] This token allows you to get the next
  22404. // page of results for list requests. If the number of results is larger
  22405. // than maxResults, use the nextPageToken as a value for the query
  22406. // parameter pageToken in the next list request. Subsequent list
  22407. // requests will have their own nextPageToken to continue paging through
  22408. // the results.
  22409. NextPageToken string `json:"nextPageToken,omitempty"`
  22410. // SelfLink: [Output Only] Server-defined URL for this resource.
  22411. SelfLink string `json:"selfLink,omitempty"`
  22412. // Warning: [Output Only] Informational warning message.
  22413. Warning *TargetHttpsProxyListWarning `json:"warning,omitempty"`
  22414. // ServerResponse contains the HTTP response code and headers from the
  22415. // server.
  22416. googleapi.ServerResponse `json:"-"`
  22417. // ForceSendFields is a list of field names (e.g. "Id") to
  22418. // unconditionally include in API requests. By default, fields with
  22419. // empty values are omitted from API requests. However, any non-pointer,
  22420. // non-interface field appearing in ForceSendFields will be sent to the
  22421. // server regardless of whether the field is empty or not. This may be
  22422. // used to include empty fields in Patch requests.
  22423. ForceSendFields []string `json:"-"`
  22424. // NullFields is a list of field names (e.g. "Id") to include in API
  22425. // requests with the JSON null value. By default, fields with empty
  22426. // values are omitted from API requests. However, any field with an
  22427. // empty value appearing in NullFields will be sent to the server as
  22428. // null. It is an error if a field in this list has a non-empty value.
  22429. // This may be used to include null fields in Patch requests.
  22430. NullFields []string `json:"-"`
  22431. }
  22432. func (s *TargetHttpsProxyList) MarshalJSON() ([]byte, error) {
  22433. type NoMethod TargetHttpsProxyList
  22434. raw := NoMethod(*s)
  22435. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  22436. }
  22437. // TargetHttpsProxyListWarning: [Output Only] Informational warning
  22438. // message.
  22439. type TargetHttpsProxyListWarning struct {
  22440. // Code: [Output Only] A warning code, if applicable. For example,
  22441. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  22442. // the response.
  22443. //
  22444. // Possible values:
  22445. // "CLEANUP_FAILED"
  22446. // "DEPRECATED_RESOURCE_USED"
  22447. // "DEPRECATED_TYPE_USED"
  22448. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  22449. // "EXPERIMENTAL_TYPE_USED"
  22450. // "EXTERNAL_API_WARNING"
  22451. // "FIELD_VALUE_OVERRIDEN"
  22452. // "INJECTED_KERNELS_DEPRECATED"
  22453. // "MISSING_TYPE_DEPENDENCY"
  22454. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  22455. // "NEXT_HOP_CANNOT_IP_FORWARD"
  22456. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  22457. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  22458. // "NEXT_HOP_NOT_RUNNING"
  22459. // "NOT_CRITICAL_ERROR"
  22460. // "NO_RESULTS_ON_PAGE"
  22461. // "REQUIRED_TOS_AGREEMENT"
  22462. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  22463. // "RESOURCE_NOT_DELETED"
  22464. // "SCHEMA_VALIDATION_IGNORED"
  22465. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  22466. // "UNDECLARED_PROPERTIES"
  22467. // "UNREACHABLE"
  22468. Code string `json:"code,omitempty"`
  22469. // Data: [Output Only] Metadata about this warning in key: value format.
  22470. // For example:
  22471. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  22472. Data []*TargetHttpsProxyListWarningData `json:"data,omitempty"`
  22473. // Message: [Output Only] A human-readable description of the warning
  22474. // code.
  22475. Message string `json:"message,omitempty"`
  22476. // ForceSendFields is a list of field names (e.g. "Code") to
  22477. // unconditionally include in API requests. By default, fields with
  22478. // empty values are omitted from API requests. However, any non-pointer,
  22479. // non-interface field appearing in ForceSendFields will be sent to the
  22480. // server regardless of whether the field is empty or not. This may be
  22481. // used to include empty fields in Patch requests.
  22482. ForceSendFields []string `json:"-"`
  22483. // NullFields is a list of field names (e.g. "Code") to include in API
  22484. // requests with the JSON null value. By default, fields with empty
  22485. // values are omitted from API requests. However, any field with an
  22486. // empty value appearing in NullFields will be sent to the server as
  22487. // null. It is an error if a field in this list has a non-empty value.
  22488. // This may be used to include null fields in Patch requests.
  22489. NullFields []string `json:"-"`
  22490. }
  22491. func (s *TargetHttpsProxyListWarning) MarshalJSON() ([]byte, error) {
  22492. type NoMethod TargetHttpsProxyListWarning
  22493. raw := NoMethod(*s)
  22494. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  22495. }
  22496. type TargetHttpsProxyListWarningData struct {
  22497. // Key: [Output Only] A key that provides more detail on the warning
  22498. // being returned. For example, for warnings where there are no results
  22499. // in a list request for a particular zone, this key might be scope and
  22500. // the key value might be the zone name. Other examples might be a key
  22501. // indicating a deprecated resource and a suggested replacement, or a
  22502. // warning about invalid network settings (for example, if an instance
  22503. // attempts to perform IP forwarding but is not enabled for IP
  22504. // forwarding).
  22505. Key string `json:"key,omitempty"`
  22506. // Value: [Output Only] A warning data value corresponding to the key.
  22507. Value string `json:"value,omitempty"`
  22508. // ForceSendFields is a list of field names (e.g. "Key") to
  22509. // unconditionally include in API requests. By default, fields with
  22510. // empty values are omitted from API requests. However, any non-pointer,
  22511. // non-interface field appearing in ForceSendFields will be sent to the
  22512. // server regardless of whether the field is empty or not. This may be
  22513. // used to include empty fields in Patch requests.
  22514. ForceSendFields []string `json:"-"`
  22515. // NullFields is a list of field names (e.g. "Key") to include in API
  22516. // requests with the JSON null value. By default, fields with empty
  22517. // values are omitted from API requests. However, any field with an
  22518. // empty value appearing in NullFields will be sent to the server as
  22519. // null. It is an error if a field in this list has a non-empty value.
  22520. // This may be used to include null fields in Patch requests.
  22521. NullFields []string `json:"-"`
  22522. }
  22523. func (s *TargetHttpsProxyListWarningData) MarshalJSON() ([]byte, error) {
  22524. type NoMethod TargetHttpsProxyListWarningData
  22525. raw := NoMethod(*s)
  22526. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  22527. }
  22528. // TargetInstance: A TargetInstance resource. This resource defines an
  22529. // endpoint instance that terminates traffic of certain protocols. (==
  22530. // resource_for beta.targetInstances ==) (== resource_for
  22531. // v1.targetInstances ==)
  22532. type TargetInstance struct {
  22533. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  22534. // format.
  22535. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  22536. // Description: An optional description of this resource. Provide this
  22537. // property when you create the resource.
  22538. Description string `json:"description,omitempty"`
  22539. // Id: [Output Only] The unique identifier for the resource. This
  22540. // identifier is defined by the server.
  22541. Id uint64 `json:"id,omitempty,string"`
  22542. // Instance: A URL to the virtual machine instance that handles traffic
  22543. // for this target instance. When creating a target instance, you can
  22544. // provide the fully-qualified URL or a valid partial URL to the desired
  22545. // virtual machine. For example, the following are all valid URLs:
  22546. // -
  22547. // https://www.googleapis.com/compute/v1/projects/project/zones/zone/instances/instance
  22548. // - projects/project/zones/zone/instances/instance
  22549. // - zones/zone/instances/instance
  22550. Instance string `json:"instance,omitempty"`
  22551. // Kind: [Output Only] The type of the resource. Always
  22552. // compute#targetInstance for target instances.
  22553. Kind string `json:"kind,omitempty"`
  22554. // Name: Name of the resource. Provided by the client when the resource
  22555. // is created. The name must be 1-63 characters long, and comply with
  22556. // RFC1035. Specifically, the name must be 1-63 characters long and
  22557. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  22558. // the first character must be a lowercase letter, and all following
  22559. // characters must be a dash, lowercase letter, or digit, except the
  22560. // last character, which cannot be a dash.
  22561. Name string `json:"name,omitempty"`
  22562. // NatPolicy: NAT option controlling how IPs are NAT'ed to the instance.
  22563. // Currently only NO_NAT (default value) is supported.
  22564. //
  22565. // Possible values:
  22566. // "NO_NAT"
  22567. NatPolicy string `json:"natPolicy,omitempty"`
  22568. // SelfLink: [Output Only] Server-defined URL for the resource.
  22569. SelfLink string `json:"selfLink,omitempty"`
  22570. // Zone: [Output Only] URL of the zone where the target instance
  22571. // resides. You must specify this field as part of the HTTP request URL.
  22572. // It is not settable as a field in the request body.
  22573. Zone string `json:"zone,omitempty"`
  22574. // ServerResponse contains the HTTP response code and headers from the
  22575. // server.
  22576. googleapi.ServerResponse `json:"-"`
  22577. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  22578. // to unconditionally include in API requests. By default, fields with
  22579. // empty values are omitted from API requests. However, any non-pointer,
  22580. // non-interface field appearing in ForceSendFields will be sent to the
  22581. // server regardless of whether the field is empty or not. This may be
  22582. // used to include empty fields in Patch requests.
  22583. ForceSendFields []string `json:"-"`
  22584. // NullFields is a list of field names (e.g. "CreationTimestamp") to
  22585. // include in API requests with the JSON null value. By default, fields
  22586. // with empty values are omitted from API requests. However, any field
  22587. // with an empty value appearing in NullFields will be sent to the
  22588. // server as null. It is an error if a field in this list has a
  22589. // non-empty value. This may be used to include null fields in Patch
  22590. // requests.
  22591. NullFields []string `json:"-"`
  22592. }
  22593. func (s *TargetInstance) MarshalJSON() ([]byte, error) {
  22594. type NoMethod TargetInstance
  22595. raw := NoMethod(*s)
  22596. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  22597. }
  22598. type TargetInstanceAggregatedList struct {
  22599. // Id: [Output Only] Unique identifier for the resource; defined by the
  22600. // server.
  22601. Id string `json:"id,omitempty"`
  22602. // Items: A list of TargetInstance resources.
  22603. Items map[string]TargetInstancesScopedList `json:"items,omitempty"`
  22604. // Kind: Type of resource.
  22605. Kind string `json:"kind,omitempty"`
  22606. // NextPageToken: [Output Only] This token allows you to get the next
  22607. // page of results for list requests. If the number of results is larger
  22608. // than maxResults, use the nextPageToken as a value for the query
  22609. // parameter pageToken in the next list request. Subsequent list
  22610. // requests will have their own nextPageToken to continue paging through
  22611. // the results.
  22612. NextPageToken string `json:"nextPageToken,omitempty"`
  22613. // SelfLink: [Output Only] Server-defined URL for this resource.
  22614. SelfLink string `json:"selfLink,omitempty"`
  22615. // Warning: [Output Only] Informational warning message.
  22616. Warning *TargetInstanceAggregatedListWarning `json:"warning,omitempty"`
  22617. // ServerResponse contains the HTTP response code and headers from the
  22618. // server.
  22619. googleapi.ServerResponse `json:"-"`
  22620. // ForceSendFields is a list of field names (e.g. "Id") to
  22621. // unconditionally include in API requests. By default, fields with
  22622. // empty values are omitted from API requests. However, any non-pointer,
  22623. // non-interface field appearing in ForceSendFields will be sent to the
  22624. // server regardless of whether the field is empty or not. This may be
  22625. // used to include empty fields in Patch requests.
  22626. ForceSendFields []string `json:"-"`
  22627. // NullFields is a list of field names (e.g. "Id") to include in API
  22628. // requests with the JSON null value. By default, fields with empty
  22629. // values are omitted from API requests. However, any field with an
  22630. // empty value appearing in NullFields will be sent to the server as
  22631. // null. It is an error if a field in this list has a non-empty value.
  22632. // This may be used to include null fields in Patch requests.
  22633. NullFields []string `json:"-"`
  22634. }
  22635. func (s *TargetInstanceAggregatedList) MarshalJSON() ([]byte, error) {
  22636. type NoMethod TargetInstanceAggregatedList
  22637. raw := NoMethod(*s)
  22638. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  22639. }
  22640. // TargetInstanceAggregatedListWarning: [Output Only] Informational
  22641. // warning message.
  22642. type TargetInstanceAggregatedListWarning struct {
  22643. // Code: [Output Only] A warning code, if applicable. For example,
  22644. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  22645. // the response.
  22646. //
  22647. // Possible values:
  22648. // "CLEANUP_FAILED"
  22649. // "DEPRECATED_RESOURCE_USED"
  22650. // "DEPRECATED_TYPE_USED"
  22651. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  22652. // "EXPERIMENTAL_TYPE_USED"
  22653. // "EXTERNAL_API_WARNING"
  22654. // "FIELD_VALUE_OVERRIDEN"
  22655. // "INJECTED_KERNELS_DEPRECATED"
  22656. // "MISSING_TYPE_DEPENDENCY"
  22657. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  22658. // "NEXT_HOP_CANNOT_IP_FORWARD"
  22659. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  22660. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  22661. // "NEXT_HOP_NOT_RUNNING"
  22662. // "NOT_CRITICAL_ERROR"
  22663. // "NO_RESULTS_ON_PAGE"
  22664. // "REQUIRED_TOS_AGREEMENT"
  22665. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  22666. // "RESOURCE_NOT_DELETED"
  22667. // "SCHEMA_VALIDATION_IGNORED"
  22668. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  22669. // "UNDECLARED_PROPERTIES"
  22670. // "UNREACHABLE"
  22671. Code string `json:"code,omitempty"`
  22672. // Data: [Output Only] Metadata about this warning in key: value format.
  22673. // For example:
  22674. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  22675. Data []*TargetInstanceAggregatedListWarningData `json:"data,omitempty"`
  22676. // Message: [Output Only] A human-readable description of the warning
  22677. // code.
  22678. Message string `json:"message,omitempty"`
  22679. // ForceSendFields is a list of field names (e.g. "Code") 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. "Code") 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 *TargetInstanceAggregatedListWarning) MarshalJSON() ([]byte, error) {
  22695. type NoMethod TargetInstanceAggregatedListWarning
  22696. raw := NoMethod(*s)
  22697. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  22698. }
  22699. type TargetInstanceAggregatedListWarningData struct {
  22700. // Key: [Output Only] A key that provides more detail on the warning
  22701. // being returned. For example, for warnings where there are no results
  22702. // in a list request for a particular zone, this key might be scope and
  22703. // the key value might be the zone name. Other examples might be a key
  22704. // indicating a deprecated resource and a suggested replacement, or a
  22705. // warning about invalid network settings (for example, if an instance
  22706. // attempts to perform IP forwarding but is not enabled for IP
  22707. // forwarding).
  22708. Key string `json:"key,omitempty"`
  22709. // Value: [Output Only] A warning data value corresponding to the key.
  22710. Value string `json:"value,omitempty"`
  22711. // ForceSendFields is a list of field names (e.g. "Key") to
  22712. // unconditionally include in API requests. By default, fields with
  22713. // empty values are omitted from API requests. However, any non-pointer,
  22714. // non-interface field appearing in ForceSendFields will be sent to the
  22715. // server regardless of whether the field is empty or not. This may be
  22716. // used to include empty fields in Patch requests.
  22717. ForceSendFields []string `json:"-"`
  22718. // NullFields is a list of field names (e.g. "Key") to include in API
  22719. // requests with the JSON null value. By default, fields with empty
  22720. // values are omitted from API requests. However, any field with an
  22721. // empty value appearing in NullFields will be sent to the server as
  22722. // null. It is an error if a field in this list has a non-empty value.
  22723. // This may be used to include null fields in Patch requests.
  22724. NullFields []string `json:"-"`
  22725. }
  22726. func (s *TargetInstanceAggregatedListWarningData) MarshalJSON() ([]byte, error) {
  22727. type NoMethod TargetInstanceAggregatedListWarningData
  22728. raw := NoMethod(*s)
  22729. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  22730. }
  22731. // TargetInstanceList: Contains a list of TargetInstance resources.
  22732. type TargetInstanceList struct {
  22733. // Id: [Output Only] Unique identifier for the resource; defined by the
  22734. // server.
  22735. Id string `json:"id,omitempty"`
  22736. // Items: A list of TargetInstance resources.
  22737. Items []*TargetInstance `json:"items,omitempty"`
  22738. // Kind: Type of resource.
  22739. Kind string `json:"kind,omitempty"`
  22740. // NextPageToken: [Output Only] This token allows you to get the next
  22741. // page of results for list requests. If the number of results is larger
  22742. // than maxResults, use the nextPageToken as a value for the query
  22743. // parameter pageToken in the next list request. Subsequent list
  22744. // requests will have their own nextPageToken to continue paging through
  22745. // the results.
  22746. NextPageToken string `json:"nextPageToken,omitempty"`
  22747. // SelfLink: [Output Only] Server-defined URL for this resource.
  22748. SelfLink string `json:"selfLink,omitempty"`
  22749. // Warning: [Output Only] Informational warning message.
  22750. Warning *TargetInstanceListWarning `json:"warning,omitempty"`
  22751. // ServerResponse contains the HTTP response code and headers from the
  22752. // server.
  22753. googleapi.ServerResponse `json:"-"`
  22754. // ForceSendFields is a list of field names (e.g. "Id") to
  22755. // unconditionally include in API requests. By default, fields with
  22756. // empty values are omitted from API requests. However, any non-pointer,
  22757. // non-interface field appearing in ForceSendFields will be sent to the
  22758. // server regardless of whether the field is empty or not. This may be
  22759. // used to include empty fields in Patch requests.
  22760. ForceSendFields []string `json:"-"`
  22761. // NullFields is a list of field names (e.g. "Id") to include in API
  22762. // requests with the JSON null value. By default, fields with empty
  22763. // values are omitted from API requests. However, any field with an
  22764. // empty value appearing in NullFields will be sent to the server as
  22765. // null. It is an error if a field in this list has a non-empty value.
  22766. // This may be used to include null fields in Patch requests.
  22767. NullFields []string `json:"-"`
  22768. }
  22769. func (s *TargetInstanceList) MarshalJSON() ([]byte, error) {
  22770. type NoMethod TargetInstanceList
  22771. raw := NoMethod(*s)
  22772. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  22773. }
  22774. // TargetInstanceListWarning: [Output Only] Informational warning
  22775. // message.
  22776. type TargetInstanceListWarning struct {
  22777. // Code: [Output Only] A warning code, if applicable. For example,
  22778. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  22779. // the response.
  22780. //
  22781. // Possible values:
  22782. // "CLEANUP_FAILED"
  22783. // "DEPRECATED_RESOURCE_USED"
  22784. // "DEPRECATED_TYPE_USED"
  22785. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  22786. // "EXPERIMENTAL_TYPE_USED"
  22787. // "EXTERNAL_API_WARNING"
  22788. // "FIELD_VALUE_OVERRIDEN"
  22789. // "INJECTED_KERNELS_DEPRECATED"
  22790. // "MISSING_TYPE_DEPENDENCY"
  22791. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  22792. // "NEXT_HOP_CANNOT_IP_FORWARD"
  22793. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  22794. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  22795. // "NEXT_HOP_NOT_RUNNING"
  22796. // "NOT_CRITICAL_ERROR"
  22797. // "NO_RESULTS_ON_PAGE"
  22798. // "REQUIRED_TOS_AGREEMENT"
  22799. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  22800. // "RESOURCE_NOT_DELETED"
  22801. // "SCHEMA_VALIDATION_IGNORED"
  22802. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  22803. // "UNDECLARED_PROPERTIES"
  22804. // "UNREACHABLE"
  22805. Code string `json:"code,omitempty"`
  22806. // Data: [Output Only] Metadata about this warning in key: value format.
  22807. // For example:
  22808. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  22809. Data []*TargetInstanceListWarningData `json:"data,omitempty"`
  22810. // Message: [Output Only] A human-readable description of the warning
  22811. // code.
  22812. Message string `json:"message,omitempty"`
  22813. // ForceSendFields is a list of field names (e.g. "Code") to
  22814. // unconditionally include in API requests. By default, fields with
  22815. // empty values are omitted from API requests. However, any non-pointer,
  22816. // non-interface field appearing in ForceSendFields will be sent to the
  22817. // server regardless of whether the field is empty or not. This may be
  22818. // used to include empty fields in Patch requests.
  22819. ForceSendFields []string `json:"-"`
  22820. // NullFields is a list of field names (e.g. "Code") to include in API
  22821. // requests with the JSON null value. By default, fields with empty
  22822. // values are omitted from API requests. However, any field with an
  22823. // empty value appearing in NullFields will be sent to the server as
  22824. // null. It is an error if a field in this list has a non-empty value.
  22825. // This may be used to include null fields in Patch requests.
  22826. NullFields []string `json:"-"`
  22827. }
  22828. func (s *TargetInstanceListWarning) MarshalJSON() ([]byte, error) {
  22829. type NoMethod TargetInstanceListWarning
  22830. raw := NoMethod(*s)
  22831. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  22832. }
  22833. type TargetInstanceListWarningData struct {
  22834. // Key: [Output Only] A key that provides more detail on the warning
  22835. // being returned. For example, for warnings where there are no results
  22836. // in a list request for a particular zone, this key might be scope and
  22837. // the key value might be the zone name. Other examples might be a key
  22838. // indicating a deprecated resource and a suggested replacement, or a
  22839. // warning about invalid network settings (for example, if an instance
  22840. // attempts to perform IP forwarding but is not enabled for IP
  22841. // forwarding).
  22842. Key string `json:"key,omitempty"`
  22843. // Value: [Output Only] A warning data value corresponding to the key.
  22844. Value string `json:"value,omitempty"`
  22845. // ForceSendFields is a list of field names (e.g. "Key") to
  22846. // unconditionally include in API requests. By default, fields with
  22847. // empty values are omitted from API requests. However, any non-pointer,
  22848. // non-interface field appearing in ForceSendFields will be sent to the
  22849. // server regardless of whether the field is empty or not. This may be
  22850. // used to include empty fields in Patch requests.
  22851. ForceSendFields []string `json:"-"`
  22852. // NullFields is a list of field names (e.g. "Key") to include in API
  22853. // requests with the JSON null value. By default, fields with empty
  22854. // values are omitted from API requests. However, any field with an
  22855. // empty value appearing in NullFields will be sent to the server as
  22856. // null. It is an error if a field in this list has a non-empty value.
  22857. // This may be used to include null fields in Patch requests.
  22858. NullFields []string `json:"-"`
  22859. }
  22860. func (s *TargetInstanceListWarningData) MarshalJSON() ([]byte, error) {
  22861. type NoMethod TargetInstanceListWarningData
  22862. raw := NoMethod(*s)
  22863. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  22864. }
  22865. type TargetInstancesScopedList struct {
  22866. // TargetInstances: A list of target instances contained in this scope.
  22867. TargetInstances []*TargetInstance `json:"targetInstances,omitempty"`
  22868. // Warning: Informational warning which replaces the list of addresses
  22869. // when the list is empty.
  22870. Warning *TargetInstancesScopedListWarning `json:"warning,omitempty"`
  22871. // ForceSendFields is a list of field names (e.g. "TargetInstances") to
  22872. // unconditionally include in API requests. By default, fields with
  22873. // empty values are omitted from API requests. However, any non-pointer,
  22874. // non-interface field appearing in ForceSendFields will be sent to the
  22875. // server regardless of whether the field is empty or not. This may be
  22876. // used to include empty fields in Patch requests.
  22877. ForceSendFields []string `json:"-"`
  22878. // NullFields is a list of field names (e.g. "TargetInstances") to
  22879. // include in API requests with the JSON null value. By default, fields
  22880. // with empty values are omitted from API requests. However, any field
  22881. // with an empty value appearing in NullFields will be sent to the
  22882. // server as null. It is an error if a field in this list has a
  22883. // non-empty value. This may be used to include null fields in Patch
  22884. // requests.
  22885. NullFields []string `json:"-"`
  22886. }
  22887. func (s *TargetInstancesScopedList) MarshalJSON() ([]byte, error) {
  22888. type NoMethod TargetInstancesScopedList
  22889. raw := NoMethod(*s)
  22890. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  22891. }
  22892. // TargetInstancesScopedListWarning: Informational warning which
  22893. // replaces the list of addresses when the list is empty.
  22894. type TargetInstancesScopedListWarning struct {
  22895. // Code: [Output Only] A warning code, if applicable. For example,
  22896. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  22897. // the response.
  22898. //
  22899. // Possible values:
  22900. // "CLEANUP_FAILED"
  22901. // "DEPRECATED_RESOURCE_USED"
  22902. // "DEPRECATED_TYPE_USED"
  22903. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  22904. // "EXPERIMENTAL_TYPE_USED"
  22905. // "EXTERNAL_API_WARNING"
  22906. // "FIELD_VALUE_OVERRIDEN"
  22907. // "INJECTED_KERNELS_DEPRECATED"
  22908. // "MISSING_TYPE_DEPENDENCY"
  22909. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  22910. // "NEXT_HOP_CANNOT_IP_FORWARD"
  22911. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  22912. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  22913. // "NEXT_HOP_NOT_RUNNING"
  22914. // "NOT_CRITICAL_ERROR"
  22915. // "NO_RESULTS_ON_PAGE"
  22916. // "REQUIRED_TOS_AGREEMENT"
  22917. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  22918. // "RESOURCE_NOT_DELETED"
  22919. // "SCHEMA_VALIDATION_IGNORED"
  22920. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  22921. // "UNDECLARED_PROPERTIES"
  22922. // "UNREACHABLE"
  22923. Code string `json:"code,omitempty"`
  22924. // Data: [Output Only] Metadata about this warning in key: value format.
  22925. // For example:
  22926. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  22927. Data []*TargetInstancesScopedListWarningData `json:"data,omitempty"`
  22928. // Message: [Output Only] A human-readable description of the warning
  22929. // code.
  22930. Message string `json:"message,omitempty"`
  22931. // ForceSendFields is a list of field names (e.g. "Code") to
  22932. // unconditionally include in API requests. By default, fields with
  22933. // empty values are omitted from API requests. However, any non-pointer,
  22934. // non-interface field appearing in ForceSendFields will be sent to the
  22935. // server regardless of whether the field is empty or not. This may be
  22936. // used to include empty fields in Patch requests.
  22937. ForceSendFields []string `json:"-"`
  22938. // NullFields is a list of field names (e.g. "Code") to include in API
  22939. // requests with the JSON null value. By default, fields with empty
  22940. // values are omitted from API requests. However, any field with an
  22941. // empty value appearing in NullFields will be sent to the server as
  22942. // null. It is an error if a field in this list has a non-empty value.
  22943. // This may be used to include null fields in Patch requests.
  22944. NullFields []string `json:"-"`
  22945. }
  22946. func (s *TargetInstancesScopedListWarning) MarshalJSON() ([]byte, error) {
  22947. type NoMethod TargetInstancesScopedListWarning
  22948. raw := NoMethod(*s)
  22949. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  22950. }
  22951. type TargetInstancesScopedListWarningData struct {
  22952. // Key: [Output Only] A key that provides more detail on the warning
  22953. // being returned. For example, for warnings where there are no results
  22954. // in a list request for a particular zone, this key might be scope and
  22955. // the key value might be the zone name. Other examples might be a key
  22956. // indicating a deprecated resource and a suggested replacement, or a
  22957. // warning about invalid network settings (for example, if an instance
  22958. // attempts to perform IP forwarding but is not enabled for IP
  22959. // forwarding).
  22960. Key string `json:"key,omitempty"`
  22961. // Value: [Output Only] A warning data value corresponding to the key.
  22962. Value string `json:"value,omitempty"`
  22963. // ForceSendFields is a list of field names (e.g. "Key") to
  22964. // unconditionally include in API requests. By default, fields with
  22965. // empty values are omitted from API requests. However, any non-pointer,
  22966. // non-interface field appearing in ForceSendFields will be sent to the
  22967. // server regardless of whether the field is empty or not. This may be
  22968. // used to include empty fields in Patch requests.
  22969. ForceSendFields []string `json:"-"`
  22970. // NullFields is a list of field names (e.g. "Key") to include in API
  22971. // requests with the JSON null value. By default, fields with empty
  22972. // values are omitted from API requests. However, any field with an
  22973. // empty value appearing in NullFields will be sent to the server as
  22974. // null. It is an error if a field in this list has a non-empty value.
  22975. // This may be used to include null fields in Patch requests.
  22976. NullFields []string `json:"-"`
  22977. }
  22978. func (s *TargetInstancesScopedListWarningData) MarshalJSON() ([]byte, error) {
  22979. type NoMethod TargetInstancesScopedListWarningData
  22980. raw := NoMethod(*s)
  22981. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  22982. }
  22983. // TargetPool: A TargetPool resource. This resource defines a pool of
  22984. // instances, an associated HttpHealthCheck resource, and the fallback
  22985. // target pool. (== resource_for beta.targetPools ==) (== resource_for
  22986. // v1.targetPools ==)
  22987. type TargetPool struct {
  22988. // BackupPool: This field is applicable only when the containing target
  22989. // pool is serving a forwarding rule as the primary pool, and its
  22990. // failoverRatio field is properly set to a value between [0,
  22991. // 1].
  22992. //
  22993. // backupPool and failoverRatio together define the fallback behavior of
  22994. // the primary target pool: if the ratio of the healthy instances in the
  22995. // primary pool is at or below failoverRatio, traffic arriving at the
  22996. // load-balanced IP will be directed to the backup pool.
  22997. //
  22998. // In case where failoverRatio and backupPool are not set, or all the
  22999. // instances in the backup pool are unhealthy, the traffic will be
  23000. // directed back to the primary pool in the "force" mode, where traffic
  23001. // will be spread to the healthy instances with the best effort, or to
  23002. // all instances when no instance is healthy.
  23003. BackupPool string `json:"backupPool,omitempty"`
  23004. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  23005. // format.
  23006. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  23007. // Description: An optional description of this resource. Provide this
  23008. // property when you create the resource.
  23009. Description string `json:"description,omitempty"`
  23010. // FailoverRatio: This field is applicable only when the containing
  23011. // target pool is serving a forwarding rule as the primary pool (i.e.,
  23012. // not as a backup pool to some other target pool). The value of the
  23013. // field must be in [0, 1].
  23014. //
  23015. // If set, backupPool must also be set. They together define the
  23016. // fallback behavior of the primary target pool: if the ratio of the
  23017. // healthy instances in the primary pool is at or below this number,
  23018. // traffic arriving at the load-balanced IP will be directed to the
  23019. // backup pool.
  23020. //
  23021. // In case where failoverRatio is not set or all the instances in the
  23022. // backup pool are unhealthy, the traffic will be directed back to the
  23023. // primary pool in the "force" mode, where traffic will be spread to the
  23024. // healthy instances with the best effort, or to all instances when no
  23025. // instance is healthy.
  23026. FailoverRatio float64 `json:"failoverRatio,omitempty"`
  23027. // HealthChecks: The URL of the HttpHealthCheck resource. A member
  23028. // instance in this pool is considered healthy if and only if the health
  23029. // checks pass. An empty list means all member instances will be
  23030. // considered healthy at all times. Only HttpHealthChecks are supported.
  23031. // Only one health check may be specified.
  23032. HealthChecks []string `json:"healthChecks,omitempty"`
  23033. // Id: [Output Only] The unique identifier for the resource. This
  23034. // identifier is defined by the server.
  23035. Id uint64 `json:"id,omitempty,string"`
  23036. // Instances: A list of resource URLs to the virtual machine instances
  23037. // serving this pool. They must live in zones contained in the same
  23038. // region as this pool.
  23039. Instances []string `json:"instances,omitempty"`
  23040. // Kind: [Output Only] Type of the resource. Always compute#targetPool
  23041. // for target pools.
  23042. Kind string `json:"kind,omitempty"`
  23043. // Name: Name of the resource. Provided by the client when the resource
  23044. // is created. The name must be 1-63 characters long, and comply with
  23045. // RFC1035. Specifically, the name must be 1-63 characters long and
  23046. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  23047. // the first character must be a lowercase letter, and all following
  23048. // characters must be a dash, lowercase letter, or digit, except the
  23049. // last character, which cannot be a dash.
  23050. Name string `json:"name,omitempty"`
  23051. // Region: [Output Only] URL of the region where the target pool
  23052. // resides.
  23053. Region string `json:"region,omitempty"`
  23054. // SelfLink: [Output Only] Server-defined URL for the resource.
  23055. SelfLink string `json:"selfLink,omitempty"`
  23056. // SessionAffinity: Sesssion affinity option, must be one of the
  23057. // following values:
  23058. // NONE: Connections from the same client IP may go to any instance in
  23059. // the pool.
  23060. // CLIENT_IP: Connections from the same client IP will go to the same
  23061. // instance in the pool while that instance remains
  23062. // healthy.
  23063. // CLIENT_IP_PROTO: Connections from the same client IP with the same IP
  23064. // protocol will go to the same instance in the pool while that instance
  23065. // remains healthy.
  23066. //
  23067. // Possible values:
  23068. // "CLIENT_IP"
  23069. // "CLIENT_IP_PORT_PROTO"
  23070. // "CLIENT_IP_PROTO"
  23071. // "GENERATED_COOKIE"
  23072. // "NONE"
  23073. SessionAffinity string `json:"sessionAffinity,omitempty"`
  23074. // ServerResponse contains the HTTP response code and headers from the
  23075. // server.
  23076. googleapi.ServerResponse `json:"-"`
  23077. // ForceSendFields is a list of field names (e.g. "BackupPool") to
  23078. // unconditionally include in API requests. By default, fields with
  23079. // empty values are omitted from API requests. However, any non-pointer,
  23080. // non-interface field appearing in ForceSendFields will be sent to the
  23081. // server regardless of whether the field is empty or not. This may be
  23082. // used to include empty fields in Patch requests.
  23083. ForceSendFields []string `json:"-"`
  23084. // NullFields is a list of field names (e.g. "BackupPool") to include in
  23085. // API requests with the JSON null value. By default, fields with empty
  23086. // values are omitted from API requests. However, any field with an
  23087. // empty value appearing in NullFields will be sent to the server as
  23088. // null. It is an error if a field in this list has a non-empty value.
  23089. // This may be used to include null fields in Patch requests.
  23090. NullFields []string `json:"-"`
  23091. }
  23092. func (s *TargetPool) MarshalJSON() ([]byte, error) {
  23093. type NoMethod TargetPool
  23094. raw := NoMethod(*s)
  23095. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  23096. }
  23097. func (s *TargetPool) UnmarshalJSON(data []byte) error {
  23098. type NoMethod TargetPool
  23099. var s1 struct {
  23100. FailoverRatio gensupport.JSONFloat64 `json:"failoverRatio"`
  23101. *NoMethod
  23102. }
  23103. s1.NoMethod = (*NoMethod)(s)
  23104. if err := json.Unmarshal(data, &s1); err != nil {
  23105. return err
  23106. }
  23107. s.FailoverRatio = float64(s1.FailoverRatio)
  23108. return nil
  23109. }
  23110. type TargetPoolAggregatedList struct {
  23111. // Id: [Output Only] Unique identifier for the resource; defined by the
  23112. // server.
  23113. Id string `json:"id,omitempty"`
  23114. // Items: A list of TargetPool resources.
  23115. Items map[string]TargetPoolsScopedList `json:"items,omitempty"`
  23116. // Kind: [Output Only] Type of resource. Always
  23117. // compute#targetPoolAggregatedList for aggregated lists of target
  23118. // pools.
  23119. Kind string `json:"kind,omitempty"`
  23120. // NextPageToken: [Output Only] This token allows you to get the next
  23121. // page of results for list requests. If the number of results is larger
  23122. // than maxResults, use the nextPageToken as a value for the query
  23123. // parameter pageToken in the next list request. Subsequent list
  23124. // requests will have their own nextPageToken to continue paging through
  23125. // the results.
  23126. NextPageToken string `json:"nextPageToken,omitempty"`
  23127. // SelfLink: [Output Only] Server-defined URL for this resource.
  23128. SelfLink string `json:"selfLink,omitempty"`
  23129. // Warning: [Output Only] Informational warning message.
  23130. Warning *TargetPoolAggregatedListWarning `json:"warning,omitempty"`
  23131. // ServerResponse contains the HTTP response code and headers from the
  23132. // server.
  23133. googleapi.ServerResponse `json:"-"`
  23134. // ForceSendFields is a list of field names (e.g. "Id") to
  23135. // unconditionally include in API requests. By default, fields with
  23136. // empty values are omitted from API requests. However, any non-pointer,
  23137. // non-interface field appearing in ForceSendFields will be sent to the
  23138. // server regardless of whether the field is empty or not. This may be
  23139. // used to include empty fields in Patch requests.
  23140. ForceSendFields []string `json:"-"`
  23141. // NullFields is a list of field names (e.g. "Id") to include in API
  23142. // requests with the JSON null value. By default, fields with empty
  23143. // values are omitted from API requests. However, any field with an
  23144. // empty value appearing in NullFields will be sent to the server as
  23145. // null. It is an error if a field in this list has a non-empty value.
  23146. // This may be used to include null fields in Patch requests.
  23147. NullFields []string `json:"-"`
  23148. }
  23149. func (s *TargetPoolAggregatedList) MarshalJSON() ([]byte, error) {
  23150. type NoMethod TargetPoolAggregatedList
  23151. raw := NoMethod(*s)
  23152. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  23153. }
  23154. // TargetPoolAggregatedListWarning: [Output Only] Informational warning
  23155. // message.
  23156. type TargetPoolAggregatedListWarning struct {
  23157. // Code: [Output Only] A warning code, if applicable. For example,
  23158. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  23159. // the response.
  23160. //
  23161. // Possible values:
  23162. // "CLEANUP_FAILED"
  23163. // "DEPRECATED_RESOURCE_USED"
  23164. // "DEPRECATED_TYPE_USED"
  23165. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  23166. // "EXPERIMENTAL_TYPE_USED"
  23167. // "EXTERNAL_API_WARNING"
  23168. // "FIELD_VALUE_OVERRIDEN"
  23169. // "INJECTED_KERNELS_DEPRECATED"
  23170. // "MISSING_TYPE_DEPENDENCY"
  23171. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  23172. // "NEXT_HOP_CANNOT_IP_FORWARD"
  23173. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  23174. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  23175. // "NEXT_HOP_NOT_RUNNING"
  23176. // "NOT_CRITICAL_ERROR"
  23177. // "NO_RESULTS_ON_PAGE"
  23178. // "REQUIRED_TOS_AGREEMENT"
  23179. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  23180. // "RESOURCE_NOT_DELETED"
  23181. // "SCHEMA_VALIDATION_IGNORED"
  23182. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  23183. // "UNDECLARED_PROPERTIES"
  23184. // "UNREACHABLE"
  23185. Code string `json:"code,omitempty"`
  23186. // Data: [Output Only] Metadata about this warning in key: value format.
  23187. // For example:
  23188. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  23189. Data []*TargetPoolAggregatedListWarningData `json:"data,omitempty"`
  23190. // Message: [Output Only] A human-readable description of the warning
  23191. // code.
  23192. Message string `json:"message,omitempty"`
  23193. // ForceSendFields is a list of field names (e.g. "Code") to
  23194. // unconditionally include in API requests. By default, fields with
  23195. // empty values are omitted from API requests. However, any non-pointer,
  23196. // non-interface field appearing in ForceSendFields will be sent to the
  23197. // server regardless of whether the field is empty or not. This may be
  23198. // used to include empty fields in Patch requests.
  23199. ForceSendFields []string `json:"-"`
  23200. // NullFields is a list of field names (e.g. "Code") to include in API
  23201. // requests with the JSON null value. By default, fields with empty
  23202. // values are omitted from API requests. However, any field with an
  23203. // empty value appearing in NullFields will be sent to the server as
  23204. // null. It is an error if a field in this list has a non-empty value.
  23205. // This may be used to include null fields in Patch requests.
  23206. NullFields []string `json:"-"`
  23207. }
  23208. func (s *TargetPoolAggregatedListWarning) MarshalJSON() ([]byte, error) {
  23209. type NoMethod TargetPoolAggregatedListWarning
  23210. raw := NoMethod(*s)
  23211. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  23212. }
  23213. type TargetPoolAggregatedListWarningData struct {
  23214. // Key: [Output Only] A key that provides more detail on the warning
  23215. // being returned. For example, for warnings where there are no results
  23216. // in a list request for a particular zone, this key might be scope and
  23217. // the key value might be the zone name. Other examples might be a key
  23218. // indicating a deprecated resource and a suggested replacement, or a
  23219. // warning about invalid network settings (for example, if an instance
  23220. // attempts to perform IP forwarding but is not enabled for IP
  23221. // forwarding).
  23222. Key string `json:"key,omitempty"`
  23223. // Value: [Output Only] A warning data value corresponding to the key.
  23224. Value string `json:"value,omitempty"`
  23225. // ForceSendFields is a list of field names (e.g. "Key") to
  23226. // unconditionally include in API requests. By default, fields with
  23227. // empty values are omitted from API requests. However, any non-pointer,
  23228. // non-interface field appearing in ForceSendFields will be sent to the
  23229. // server regardless of whether the field is empty or not. This may be
  23230. // used to include empty fields in Patch requests.
  23231. ForceSendFields []string `json:"-"`
  23232. // NullFields is a list of field names (e.g. "Key") to include in API
  23233. // requests with the JSON null value. By default, fields with empty
  23234. // values are omitted from API requests. However, any field with an
  23235. // empty value appearing in NullFields will be sent to the server as
  23236. // null. It is an error if a field in this list has a non-empty value.
  23237. // This may be used to include null fields in Patch requests.
  23238. NullFields []string `json:"-"`
  23239. }
  23240. func (s *TargetPoolAggregatedListWarningData) MarshalJSON() ([]byte, error) {
  23241. type NoMethod TargetPoolAggregatedListWarningData
  23242. raw := NoMethod(*s)
  23243. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  23244. }
  23245. type TargetPoolInstanceHealth struct {
  23246. HealthStatus []*HealthStatus `json:"healthStatus,omitempty"`
  23247. // Kind: [Output Only] Type of resource. Always
  23248. // compute#targetPoolInstanceHealth when checking the health of an
  23249. // instance.
  23250. Kind string `json:"kind,omitempty"`
  23251. // ServerResponse contains the HTTP response code and headers from the
  23252. // server.
  23253. googleapi.ServerResponse `json:"-"`
  23254. // ForceSendFields is a list of field names (e.g. "HealthStatus") to
  23255. // unconditionally include in API requests. By default, fields with
  23256. // empty values are omitted from API requests. However, any non-pointer,
  23257. // non-interface field appearing in ForceSendFields will be sent to the
  23258. // server regardless of whether the field is empty or not. This may be
  23259. // used to include empty fields in Patch requests.
  23260. ForceSendFields []string `json:"-"`
  23261. // NullFields is a list of field names (e.g. "HealthStatus") to include
  23262. // in API requests with the JSON null value. By default, fields with
  23263. // empty values are omitted from API requests. However, any field with
  23264. // an empty value appearing in NullFields will be sent to the server as
  23265. // null. It is an error if a field in this list has a non-empty value.
  23266. // This may be used to include null fields in Patch requests.
  23267. NullFields []string `json:"-"`
  23268. }
  23269. func (s *TargetPoolInstanceHealth) MarshalJSON() ([]byte, error) {
  23270. type NoMethod TargetPoolInstanceHealth
  23271. raw := NoMethod(*s)
  23272. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  23273. }
  23274. // TargetPoolList: Contains a list of TargetPool resources.
  23275. type TargetPoolList struct {
  23276. // Id: [Output Only] Unique identifier for the resource; defined by the
  23277. // server.
  23278. Id string `json:"id,omitempty"`
  23279. // Items: A list of TargetPool resources.
  23280. Items []*TargetPool `json:"items,omitempty"`
  23281. // Kind: [Output Only] Type of resource. Always compute#targetPoolList
  23282. // for lists of target pools.
  23283. Kind string `json:"kind,omitempty"`
  23284. // NextPageToken: [Output Only] This token allows you to get the next
  23285. // page of results for list requests. If the number of results is larger
  23286. // than maxResults, use the nextPageToken as a value for the query
  23287. // parameter pageToken in the next list request. Subsequent list
  23288. // requests will have their own nextPageToken to continue paging through
  23289. // the results.
  23290. NextPageToken string `json:"nextPageToken,omitempty"`
  23291. // SelfLink: [Output Only] Server-defined URL for this resource.
  23292. SelfLink string `json:"selfLink,omitempty"`
  23293. // Warning: [Output Only] Informational warning message.
  23294. Warning *TargetPoolListWarning `json:"warning,omitempty"`
  23295. // ServerResponse contains the HTTP response code and headers from the
  23296. // server.
  23297. googleapi.ServerResponse `json:"-"`
  23298. // ForceSendFields is a list of field names (e.g. "Id") to
  23299. // unconditionally include in API requests. By default, fields with
  23300. // empty values are omitted from API requests. However, any non-pointer,
  23301. // non-interface field appearing in ForceSendFields will be sent to the
  23302. // server regardless of whether the field is empty or not. This may be
  23303. // used to include empty fields in Patch requests.
  23304. ForceSendFields []string `json:"-"`
  23305. // NullFields is a list of field names (e.g. "Id") to include in API
  23306. // requests with the JSON null value. By default, fields with empty
  23307. // values are omitted from API requests. However, any field with an
  23308. // empty value appearing in NullFields will be sent to the server as
  23309. // null. It is an error if a field in this list has a non-empty value.
  23310. // This may be used to include null fields in Patch requests.
  23311. NullFields []string `json:"-"`
  23312. }
  23313. func (s *TargetPoolList) MarshalJSON() ([]byte, error) {
  23314. type NoMethod TargetPoolList
  23315. raw := NoMethod(*s)
  23316. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  23317. }
  23318. // TargetPoolListWarning: [Output Only] Informational warning message.
  23319. type TargetPoolListWarning struct {
  23320. // Code: [Output Only] A warning code, if applicable. For example,
  23321. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  23322. // the response.
  23323. //
  23324. // Possible values:
  23325. // "CLEANUP_FAILED"
  23326. // "DEPRECATED_RESOURCE_USED"
  23327. // "DEPRECATED_TYPE_USED"
  23328. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  23329. // "EXPERIMENTAL_TYPE_USED"
  23330. // "EXTERNAL_API_WARNING"
  23331. // "FIELD_VALUE_OVERRIDEN"
  23332. // "INJECTED_KERNELS_DEPRECATED"
  23333. // "MISSING_TYPE_DEPENDENCY"
  23334. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  23335. // "NEXT_HOP_CANNOT_IP_FORWARD"
  23336. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  23337. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  23338. // "NEXT_HOP_NOT_RUNNING"
  23339. // "NOT_CRITICAL_ERROR"
  23340. // "NO_RESULTS_ON_PAGE"
  23341. // "REQUIRED_TOS_AGREEMENT"
  23342. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  23343. // "RESOURCE_NOT_DELETED"
  23344. // "SCHEMA_VALIDATION_IGNORED"
  23345. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  23346. // "UNDECLARED_PROPERTIES"
  23347. // "UNREACHABLE"
  23348. Code string `json:"code,omitempty"`
  23349. // Data: [Output Only] Metadata about this warning in key: value format.
  23350. // For example:
  23351. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  23352. Data []*TargetPoolListWarningData `json:"data,omitempty"`
  23353. // Message: [Output Only] A human-readable description of the warning
  23354. // code.
  23355. Message string `json:"message,omitempty"`
  23356. // ForceSendFields is a list of field names (e.g. "Code") to
  23357. // unconditionally include in API requests. By default, fields with
  23358. // empty values are omitted from API requests. However, any non-pointer,
  23359. // non-interface field appearing in ForceSendFields will be sent to the
  23360. // server regardless of whether the field is empty or not. This may be
  23361. // used to include empty fields in Patch requests.
  23362. ForceSendFields []string `json:"-"`
  23363. // NullFields is a list of field names (e.g. "Code") to include in API
  23364. // requests with the JSON null value. By default, fields with empty
  23365. // values are omitted from API requests. However, any field with an
  23366. // empty value appearing in NullFields will be sent to the server as
  23367. // null. It is an error if a field in this list has a non-empty value.
  23368. // This may be used to include null fields in Patch requests.
  23369. NullFields []string `json:"-"`
  23370. }
  23371. func (s *TargetPoolListWarning) MarshalJSON() ([]byte, error) {
  23372. type NoMethod TargetPoolListWarning
  23373. raw := NoMethod(*s)
  23374. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  23375. }
  23376. type TargetPoolListWarningData struct {
  23377. // Key: [Output Only] A key that provides more detail on the warning
  23378. // being returned. For example, for warnings where there are no results
  23379. // in a list request for a particular zone, this key might be scope and
  23380. // the key value might be the zone name. Other examples might be a key
  23381. // indicating a deprecated resource and a suggested replacement, or a
  23382. // warning about invalid network settings (for example, if an instance
  23383. // attempts to perform IP forwarding but is not enabled for IP
  23384. // forwarding).
  23385. Key string `json:"key,omitempty"`
  23386. // Value: [Output Only] A warning data value corresponding to the key.
  23387. Value string `json:"value,omitempty"`
  23388. // ForceSendFields is a list of field names (e.g. "Key") to
  23389. // unconditionally include in API requests. By default, fields with
  23390. // empty values are omitted from API requests. However, any non-pointer,
  23391. // non-interface field appearing in ForceSendFields will be sent to the
  23392. // server regardless of whether the field is empty or not. This may be
  23393. // used to include empty fields in Patch requests.
  23394. ForceSendFields []string `json:"-"`
  23395. // NullFields is a list of field names (e.g. "Key") to include in API
  23396. // requests with the JSON null value. By default, fields with empty
  23397. // values are omitted from API requests. However, any field with an
  23398. // empty value appearing in NullFields will be sent to the server as
  23399. // null. It is an error if a field in this list has a non-empty value.
  23400. // This may be used to include null fields in Patch requests.
  23401. NullFields []string `json:"-"`
  23402. }
  23403. func (s *TargetPoolListWarningData) MarshalJSON() ([]byte, error) {
  23404. type NoMethod TargetPoolListWarningData
  23405. raw := NoMethod(*s)
  23406. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  23407. }
  23408. type TargetPoolsAddHealthCheckRequest struct {
  23409. // HealthChecks: The HttpHealthCheck to add to the target pool.
  23410. HealthChecks []*HealthCheckReference `json:"healthChecks,omitempty"`
  23411. // ForceSendFields is a list of field names (e.g. "HealthChecks") to
  23412. // unconditionally include in API requests. By default, fields with
  23413. // empty values are omitted from API requests. However, any non-pointer,
  23414. // non-interface field appearing in ForceSendFields will be sent to the
  23415. // server regardless of whether the field is empty or not. This may be
  23416. // used to include empty fields in Patch requests.
  23417. ForceSendFields []string `json:"-"`
  23418. // NullFields is a list of field names (e.g. "HealthChecks") to include
  23419. // in API requests with the JSON null value. By default, fields with
  23420. // empty values are omitted from API requests. However, any field with
  23421. // an empty value appearing in NullFields will be sent to the server as
  23422. // null. It is an error if a field in this list has a non-empty value.
  23423. // This may be used to include null fields in Patch requests.
  23424. NullFields []string `json:"-"`
  23425. }
  23426. func (s *TargetPoolsAddHealthCheckRequest) MarshalJSON() ([]byte, error) {
  23427. type NoMethod TargetPoolsAddHealthCheckRequest
  23428. raw := NoMethod(*s)
  23429. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  23430. }
  23431. type TargetPoolsAddInstanceRequest struct {
  23432. // Instances: A full or partial URL to an instance to add to this target
  23433. // pool. This can be a full or partial URL. For example, the following
  23434. // are valid URLs:
  23435. // -
  23436. // https://www.googleapis.com/compute/v1/projects/project-id/zones/zone/instances/instance-name
  23437. // - projects/project-id/zones/zone/instances/instance-name
  23438. // - zones/zone/instances/instance-name
  23439. Instances []*InstanceReference `json:"instances,omitempty"`
  23440. // ForceSendFields is a list of field names (e.g. "Instances") to
  23441. // unconditionally include in API requests. By default, fields with
  23442. // empty values are omitted from API requests. However, any non-pointer,
  23443. // non-interface field appearing in ForceSendFields will be sent to the
  23444. // server regardless of whether the field is empty or not. This may be
  23445. // used to include empty fields in Patch requests.
  23446. ForceSendFields []string `json:"-"`
  23447. // NullFields is a list of field names (e.g. "Instances") to include in
  23448. // API requests with the JSON null value. By default, fields with empty
  23449. // values are omitted from API requests. However, any field with an
  23450. // empty value appearing in NullFields will be sent to the server as
  23451. // null. It is an error if a field in this list has a non-empty value.
  23452. // This may be used to include null fields in Patch requests.
  23453. NullFields []string `json:"-"`
  23454. }
  23455. func (s *TargetPoolsAddInstanceRequest) MarshalJSON() ([]byte, error) {
  23456. type NoMethod TargetPoolsAddInstanceRequest
  23457. raw := NoMethod(*s)
  23458. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  23459. }
  23460. type TargetPoolsRemoveHealthCheckRequest struct {
  23461. // HealthChecks: Health check URL to be removed. This can be a full or
  23462. // valid partial URL. For example, the following are valid URLs:
  23463. // -
  23464. // https://www.googleapis.com/compute/beta/projects/project/global/httpHealthChecks/health-check
  23465. // - projects/project/global/httpHealthChecks/health-check
  23466. // - global/httpHealthChecks/health-check
  23467. HealthChecks []*HealthCheckReference `json:"healthChecks,omitempty"`
  23468. // ForceSendFields is a list of field names (e.g. "HealthChecks") to
  23469. // unconditionally include in API requests. By default, fields with
  23470. // empty values are omitted from API requests. However, any non-pointer,
  23471. // non-interface field appearing in ForceSendFields will be sent to the
  23472. // server regardless of whether the field is empty or not. This may be
  23473. // used to include empty fields in Patch requests.
  23474. ForceSendFields []string `json:"-"`
  23475. // NullFields is a list of field names (e.g. "HealthChecks") to include
  23476. // in API requests with the JSON null value. By default, fields with
  23477. // empty values are omitted from API requests. However, any field with
  23478. // an empty value appearing in NullFields will be sent to the server as
  23479. // null. It is an error if a field in this list has a non-empty value.
  23480. // This may be used to include null fields in Patch requests.
  23481. NullFields []string `json:"-"`
  23482. }
  23483. func (s *TargetPoolsRemoveHealthCheckRequest) MarshalJSON() ([]byte, error) {
  23484. type NoMethod TargetPoolsRemoveHealthCheckRequest
  23485. raw := NoMethod(*s)
  23486. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  23487. }
  23488. type TargetPoolsRemoveInstanceRequest struct {
  23489. // Instances: URLs of the instances to be removed from target pool.
  23490. Instances []*InstanceReference `json:"instances,omitempty"`
  23491. // ForceSendFields is a list of field names (e.g. "Instances") to
  23492. // unconditionally include in API requests. By default, fields with
  23493. // empty values are omitted from API requests. However, any non-pointer,
  23494. // non-interface field appearing in ForceSendFields will be sent to the
  23495. // server regardless of whether the field is empty or not. This may be
  23496. // used to include empty fields in Patch requests.
  23497. ForceSendFields []string `json:"-"`
  23498. // NullFields is a list of field names (e.g. "Instances") to include in
  23499. // API requests with the JSON null value. By default, fields with empty
  23500. // values are omitted from API requests. However, any field with an
  23501. // empty value appearing in NullFields will be sent to the server as
  23502. // null. It is an error if a field in this list has a non-empty value.
  23503. // This may be used to include null fields in Patch requests.
  23504. NullFields []string `json:"-"`
  23505. }
  23506. func (s *TargetPoolsRemoveInstanceRequest) MarshalJSON() ([]byte, error) {
  23507. type NoMethod TargetPoolsRemoveInstanceRequest
  23508. raw := NoMethod(*s)
  23509. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  23510. }
  23511. type TargetPoolsScopedList struct {
  23512. // TargetPools: A list of target pools contained in this scope.
  23513. TargetPools []*TargetPool `json:"targetPools,omitempty"`
  23514. // Warning: Informational warning which replaces the list of addresses
  23515. // when the list is empty.
  23516. Warning *TargetPoolsScopedListWarning `json:"warning,omitempty"`
  23517. // ForceSendFields is a list of field names (e.g. "TargetPools") to
  23518. // unconditionally include in API requests. By default, fields with
  23519. // empty values are omitted from API requests. However, any non-pointer,
  23520. // non-interface field appearing in ForceSendFields will be sent to the
  23521. // server regardless of whether the field is empty or not. This may be
  23522. // used to include empty fields in Patch requests.
  23523. ForceSendFields []string `json:"-"`
  23524. // NullFields is a list of field names (e.g. "TargetPools") to include
  23525. // in API requests with the JSON null value. By default, fields with
  23526. // empty values are omitted from API requests. However, any field with
  23527. // an empty value appearing in NullFields will be sent to the server as
  23528. // null. It is an error if a field in this list has a non-empty value.
  23529. // This may be used to include null fields in Patch requests.
  23530. NullFields []string `json:"-"`
  23531. }
  23532. func (s *TargetPoolsScopedList) MarshalJSON() ([]byte, error) {
  23533. type NoMethod TargetPoolsScopedList
  23534. raw := NoMethod(*s)
  23535. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  23536. }
  23537. // TargetPoolsScopedListWarning: Informational warning which replaces
  23538. // the list of addresses when the list is empty.
  23539. type TargetPoolsScopedListWarning struct {
  23540. // Code: [Output Only] A warning code, if applicable. For example,
  23541. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  23542. // the response.
  23543. //
  23544. // Possible values:
  23545. // "CLEANUP_FAILED"
  23546. // "DEPRECATED_RESOURCE_USED"
  23547. // "DEPRECATED_TYPE_USED"
  23548. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  23549. // "EXPERIMENTAL_TYPE_USED"
  23550. // "EXTERNAL_API_WARNING"
  23551. // "FIELD_VALUE_OVERRIDEN"
  23552. // "INJECTED_KERNELS_DEPRECATED"
  23553. // "MISSING_TYPE_DEPENDENCY"
  23554. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  23555. // "NEXT_HOP_CANNOT_IP_FORWARD"
  23556. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  23557. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  23558. // "NEXT_HOP_NOT_RUNNING"
  23559. // "NOT_CRITICAL_ERROR"
  23560. // "NO_RESULTS_ON_PAGE"
  23561. // "REQUIRED_TOS_AGREEMENT"
  23562. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  23563. // "RESOURCE_NOT_DELETED"
  23564. // "SCHEMA_VALIDATION_IGNORED"
  23565. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  23566. // "UNDECLARED_PROPERTIES"
  23567. // "UNREACHABLE"
  23568. Code string `json:"code,omitempty"`
  23569. // Data: [Output Only] Metadata about this warning in key: value format.
  23570. // For example:
  23571. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  23572. Data []*TargetPoolsScopedListWarningData `json:"data,omitempty"`
  23573. // Message: [Output Only] A human-readable description of the warning
  23574. // code.
  23575. Message string `json:"message,omitempty"`
  23576. // ForceSendFields is a list of field names (e.g. "Code") to
  23577. // unconditionally include in API requests. By default, fields with
  23578. // empty values are omitted from API requests. However, any non-pointer,
  23579. // non-interface field appearing in ForceSendFields will be sent to the
  23580. // server regardless of whether the field is empty or not. This may be
  23581. // used to include empty fields in Patch requests.
  23582. ForceSendFields []string `json:"-"`
  23583. // NullFields is a list of field names (e.g. "Code") to include in API
  23584. // requests with the JSON null value. By default, fields with empty
  23585. // values are omitted from API requests. However, any field with an
  23586. // empty value appearing in NullFields will be sent to the server as
  23587. // null. It is an error if a field in this list has a non-empty value.
  23588. // This may be used to include null fields in Patch requests.
  23589. NullFields []string `json:"-"`
  23590. }
  23591. func (s *TargetPoolsScopedListWarning) MarshalJSON() ([]byte, error) {
  23592. type NoMethod TargetPoolsScopedListWarning
  23593. raw := NoMethod(*s)
  23594. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  23595. }
  23596. type TargetPoolsScopedListWarningData struct {
  23597. // Key: [Output Only] A key that provides more detail on the warning
  23598. // being returned. For example, for warnings where there are no results
  23599. // in a list request for a particular zone, this key might be scope and
  23600. // the key value might be the zone name. Other examples might be a key
  23601. // indicating a deprecated resource and a suggested replacement, or a
  23602. // warning about invalid network settings (for example, if an instance
  23603. // attempts to perform IP forwarding but is not enabled for IP
  23604. // forwarding).
  23605. Key string `json:"key,omitempty"`
  23606. // Value: [Output Only] A warning data value corresponding to the key.
  23607. Value string `json:"value,omitempty"`
  23608. // ForceSendFields is a list of field names (e.g. "Key") to
  23609. // unconditionally include in API requests. By default, fields with
  23610. // empty values are omitted from API requests. However, any non-pointer,
  23611. // non-interface field appearing in ForceSendFields will be sent to the
  23612. // server regardless of whether the field is empty or not. This may be
  23613. // used to include empty fields in Patch requests.
  23614. ForceSendFields []string `json:"-"`
  23615. // NullFields is a list of field names (e.g. "Key") to include in API
  23616. // requests with the JSON null value. By default, fields with empty
  23617. // values are omitted from API requests. However, any field with an
  23618. // empty value appearing in NullFields will be sent to the server as
  23619. // null. It is an error if a field in this list has a non-empty value.
  23620. // This may be used to include null fields in Patch requests.
  23621. NullFields []string `json:"-"`
  23622. }
  23623. func (s *TargetPoolsScopedListWarningData) MarshalJSON() ([]byte, error) {
  23624. type NoMethod TargetPoolsScopedListWarningData
  23625. raw := NoMethod(*s)
  23626. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  23627. }
  23628. type TargetReference struct {
  23629. Target string `json:"target,omitempty"`
  23630. // ForceSendFields is a list of field names (e.g. "Target") to
  23631. // unconditionally include in API requests. By default, fields with
  23632. // empty values are omitted from API requests. However, any non-pointer,
  23633. // non-interface field appearing in ForceSendFields will be sent to the
  23634. // server regardless of whether the field is empty or not. This may be
  23635. // used to include empty fields in Patch requests.
  23636. ForceSendFields []string `json:"-"`
  23637. // NullFields is a list of field names (e.g. "Target") to include in API
  23638. // requests with the JSON null value. By default, fields with empty
  23639. // values are omitted from API requests. However, any field with an
  23640. // empty value appearing in NullFields will be sent to the server as
  23641. // null. It is an error if a field in this list has a non-empty value.
  23642. // This may be used to include null fields in Patch requests.
  23643. NullFields []string `json:"-"`
  23644. }
  23645. func (s *TargetReference) MarshalJSON() ([]byte, error) {
  23646. type NoMethod TargetReference
  23647. raw := NoMethod(*s)
  23648. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  23649. }
  23650. type TargetSslProxiesSetBackendServiceRequest struct {
  23651. // Service: The URL of the new BackendService resource for the
  23652. // targetSslProxy.
  23653. Service string `json:"service,omitempty"`
  23654. // ForceSendFields is a list of field names (e.g. "Service") to
  23655. // unconditionally include in API requests. By default, fields with
  23656. // empty values are omitted from API requests. However, any non-pointer,
  23657. // non-interface field appearing in ForceSendFields will be sent to the
  23658. // server regardless of whether the field is empty or not. This may be
  23659. // used to include empty fields in Patch requests.
  23660. ForceSendFields []string `json:"-"`
  23661. // NullFields is a list of field names (e.g. "Service") to include in
  23662. // API requests with the JSON null value. By default, fields with empty
  23663. // values are omitted from API requests. However, any field with an
  23664. // empty value appearing in NullFields will be sent to the server as
  23665. // null. It is an error if a field in this list has a non-empty value.
  23666. // This may be used to include null fields in Patch requests.
  23667. NullFields []string `json:"-"`
  23668. }
  23669. func (s *TargetSslProxiesSetBackendServiceRequest) MarshalJSON() ([]byte, error) {
  23670. type NoMethod TargetSslProxiesSetBackendServiceRequest
  23671. raw := NoMethod(*s)
  23672. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  23673. }
  23674. type TargetSslProxiesSetProxyHeaderRequest struct {
  23675. // ProxyHeader: The new type of proxy header to append before sending
  23676. // data to the backend. NONE or PROXY_V1 are allowed.
  23677. //
  23678. // Possible values:
  23679. // "NONE"
  23680. // "PROXY_V1"
  23681. ProxyHeader string `json:"proxyHeader,omitempty"`
  23682. // ForceSendFields is a list of field names (e.g. "ProxyHeader") to
  23683. // unconditionally include in API requests. By default, fields with
  23684. // empty values are omitted from API requests. However, any non-pointer,
  23685. // non-interface field appearing in ForceSendFields will be sent to the
  23686. // server regardless of whether the field is empty or not. This may be
  23687. // used to include empty fields in Patch requests.
  23688. ForceSendFields []string `json:"-"`
  23689. // NullFields is a list of field names (e.g. "ProxyHeader") to include
  23690. // in API requests with the JSON null value. By default, fields with
  23691. // empty values are omitted from API requests. However, any field with
  23692. // an empty value appearing in NullFields will be sent to the server as
  23693. // null. It is an error if a field in this list has a non-empty value.
  23694. // This may be used to include null fields in Patch requests.
  23695. NullFields []string `json:"-"`
  23696. }
  23697. func (s *TargetSslProxiesSetProxyHeaderRequest) MarshalJSON() ([]byte, error) {
  23698. type NoMethod TargetSslProxiesSetProxyHeaderRequest
  23699. raw := NoMethod(*s)
  23700. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  23701. }
  23702. type TargetSslProxiesSetSslCertificatesRequest struct {
  23703. // SslCertificates: New set of URLs to SslCertificate resources to
  23704. // associate with this TargetSslProxy. Currently exactly one ssl
  23705. // certificate must be specified.
  23706. SslCertificates []string `json:"sslCertificates,omitempty"`
  23707. // ForceSendFields is a list of field names (e.g. "SslCertificates") to
  23708. // unconditionally include in API requests. By default, fields with
  23709. // empty values are omitted from API requests. However, any non-pointer,
  23710. // non-interface field appearing in ForceSendFields will be sent to the
  23711. // server regardless of whether the field is empty or not. This may be
  23712. // used to include empty fields in Patch requests.
  23713. ForceSendFields []string `json:"-"`
  23714. // NullFields is a list of field names (e.g. "SslCertificates") to
  23715. // include in API requests with the JSON null value. By default, fields
  23716. // with empty values are omitted from API requests. However, any field
  23717. // with an empty value appearing in NullFields will be sent to the
  23718. // server as null. It is an error if a field in this list has a
  23719. // non-empty value. This may be used to include null fields in Patch
  23720. // requests.
  23721. NullFields []string `json:"-"`
  23722. }
  23723. func (s *TargetSslProxiesSetSslCertificatesRequest) MarshalJSON() ([]byte, error) {
  23724. type NoMethod TargetSslProxiesSetSslCertificatesRequest
  23725. raw := NoMethod(*s)
  23726. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  23727. }
  23728. // TargetSslProxy: A TargetSslProxy resource. This resource defines an
  23729. // SSL proxy. (== resource_for beta.targetSslProxies ==) (==
  23730. // resource_for v1.targetSslProxies ==)
  23731. type TargetSslProxy struct {
  23732. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  23733. // format.
  23734. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  23735. // Description: An optional description of this resource. Provide this
  23736. // property when you create the resource.
  23737. Description string `json:"description,omitempty"`
  23738. // Id: [Output Only] The unique identifier for the resource. This
  23739. // identifier is defined by the server.
  23740. Id uint64 `json:"id,omitempty,string"`
  23741. // Kind: [Output Only] Type of the resource. Always
  23742. // compute#targetSslProxy for target SSL proxies.
  23743. Kind string `json:"kind,omitempty"`
  23744. // Name: Name of the resource. Provided by the client when the resource
  23745. // is created. The name must be 1-63 characters long, and comply with
  23746. // RFC1035. Specifically, the name must be 1-63 characters long and
  23747. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  23748. // the first character must be a lowercase letter, and all following
  23749. // characters must be a dash, lowercase letter, or digit, except the
  23750. // last character, which cannot be a dash.
  23751. Name string `json:"name,omitempty"`
  23752. // ProxyHeader: Specifies the type of proxy header to append before
  23753. // sending data to the backend, either NONE or PROXY_V1. The default is
  23754. // NONE.
  23755. //
  23756. // Possible values:
  23757. // "NONE"
  23758. // "PROXY_V1"
  23759. ProxyHeader string `json:"proxyHeader,omitempty"`
  23760. // SelfLink: [Output Only] Server-defined URL for the resource.
  23761. SelfLink string `json:"selfLink,omitempty"`
  23762. // Service: URL to the BackendService resource.
  23763. Service string `json:"service,omitempty"`
  23764. // SslCertificates: URLs to SslCertificate resources that are used to
  23765. // authenticate connections to Backends. Currently exactly one SSL
  23766. // certificate must be specified.
  23767. SslCertificates []string `json:"sslCertificates,omitempty"`
  23768. // SslPolicy: URL of SslPolicy resource that will be associated with the
  23769. // TargetSslProxy resource. If not set, the TargetSslProxy resource will
  23770. // not have any SSL policy configured.
  23771. SslPolicy string `json:"sslPolicy,omitempty"`
  23772. // ServerResponse contains the HTTP response code and headers from the
  23773. // server.
  23774. googleapi.ServerResponse `json:"-"`
  23775. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  23776. // to unconditionally include in API requests. By default, fields with
  23777. // empty values are omitted from API requests. However, any non-pointer,
  23778. // non-interface field appearing in ForceSendFields will be sent to the
  23779. // server regardless of whether the field is empty or not. This may be
  23780. // used to include empty fields in Patch requests.
  23781. ForceSendFields []string `json:"-"`
  23782. // NullFields is a list of field names (e.g. "CreationTimestamp") to
  23783. // include in API requests with the JSON null value. By default, fields
  23784. // with empty values are omitted from API requests. However, any field
  23785. // with an empty value appearing in NullFields will be sent to the
  23786. // server as null. It is an error if a field in this list has a
  23787. // non-empty value. This may be used to include null fields in Patch
  23788. // requests.
  23789. NullFields []string `json:"-"`
  23790. }
  23791. func (s *TargetSslProxy) MarshalJSON() ([]byte, error) {
  23792. type NoMethod TargetSslProxy
  23793. raw := NoMethod(*s)
  23794. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  23795. }
  23796. // TargetSslProxyList: Contains a list of TargetSslProxy resources.
  23797. type TargetSslProxyList struct {
  23798. // Id: [Output Only] Unique identifier for the resource; defined by the
  23799. // server.
  23800. Id string `json:"id,omitempty"`
  23801. // Items: A list of TargetSslProxy resources.
  23802. Items []*TargetSslProxy `json:"items,omitempty"`
  23803. // Kind: Type of resource.
  23804. Kind string `json:"kind,omitempty"`
  23805. // NextPageToken: [Output Only] This token allows you to get the next
  23806. // page of results for list requests. If the number of results is larger
  23807. // than maxResults, use the nextPageToken as a value for the query
  23808. // parameter pageToken in the next list request. Subsequent list
  23809. // requests will have their own nextPageToken to continue paging through
  23810. // the results.
  23811. NextPageToken string `json:"nextPageToken,omitempty"`
  23812. // SelfLink: [Output Only] Server-defined URL for this resource.
  23813. SelfLink string `json:"selfLink,omitempty"`
  23814. // Warning: [Output Only] Informational warning message.
  23815. Warning *TargetSslProxyListWarning `json:"warning,omitempty"`
  23816. // ServerResponse contains the HTTP response code and headers from the
  23817. // server.
  23818. googleapi.ServerResponse `json:"-"`
  23819. // ForceSendFields is a list of field names (e.g. "Id") to
  23820. // unconditionally include in API requests. By default, fields with
  23821. // empty values are omitted from API requests. However, any non-pointer,
  23822. // non-interface field appearing in ForceSendFields will be sent to the
  23823. // server regardless of whether the field is empty or not. This may be
  23824. // used to include empty fields in Patch requests.
  23825. ForceSendFields []string `json:"-"`
  23826. // NullFields is a list of field names (e.g. "Id") to include in API
  23827. // requests with the JSON null value. By default, fields with empty
  23828. // values are omitted from API requests. However, any field with an
  23829. // empty value appearing in NullFields will be sent to the server as
  23830. // null. It is an error if a field in this list has a non-empty value.
  23831. // This may be used to include null fields in Patch requests.
  23832. NullFields []string `json:"-"`
  23833. }
  23834. func (s *TargetSslProxyList) MarshalJSON() ([]byte, error) {
  23835. type NoMethod TargetSslProxyList
  23836. raw := NoMethod(*s)
  23837. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  23838. }
  23839. // TargetSslProxyListWarning: [Output Only] Informational warning
  23840. // message.
  23841. type TargetSslProxyListWarning struct {
  23842. // Code: [Output Only] A warning code, if applicable. For example,
  23843. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  23844. // the response.
  23845. //
  23846. // Possible values:
  23847. // "CLEANUP_FAILED"
  23848. // "DEPRECATED_RESOURCE_USED"
  23849. // "DEPRECATED_TYPE_USED"
  23850. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  23851. // "EXPERIMENTAL_TYPE_USED"
  23852. // "EXTERNAL_API_WARNING"
  23853. // "FIELD_VALUE_OVERRIDEN"
  23854. // "INJECTED_KERNELS_DEPRECATED"
  23855. // "MISSING_TYPE_DEPENDENCY"
  23856. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  23857. // "NEXT_HOP_CANNOT_IP_FORWARD"
  23858. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  23859. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  23860. // "NEXT_HOP_NOT_RUNNING"
  23861. // "NOT_CRITICAL_ERROR"
  23862. // "NO_RESULTS_ON_PAGE"
  23863. // "REQUIRED_TOS_AGREEMENT"
  23864. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  23865. // "RESOURCE_NOT_DELETED"
  23866. // "SCHEMA_VALIDATION_IGNORED"
  23867. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  23868. // "UNDECLARED_PROPERTIES"
  23869. // "UNREACHABLE"
  23870. Code string `json:"code,omitempty"`
  23871. // Data: [Output Only] Metadata about this warning in key: value format.
  23872. // For example:
  23873. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  23874. Data []*TargetSslProxyListWarningData `json:"data,omitempty"`
  23875. // Message: [Output Only] A human-readable description of the warning
  23876. // code.
  23877. Message string `json:"message,omitempty"`
  23878. // ForceSendFields is a list of field names (e.g. "Code") to
  23879. // unconditionally include in API requests. By default, fields with
  23880. // empty values are omitted from API requests. However, any non-pointer,
  23881. // non-interface field appearing in ForceSendFields will be sent to the
  23882. // server regardless of whether the field is empty or not. This may be
  23883. // used to include empty fields in Patch requests.
  23884. ForceSendFields []string `json:"-"`
  23885. // NullFields is a list of field names (e.g. "Code") to include in API
  23886. // requests with the JSON null value. By default, fields with empty
  23887. // values are omitted from API requests. However, any field with an
  23888. // empty value appearing in NullFields will be sent to the server as
  23889. // null. It is an error if a field in this list has a non-empty value.
  23890. // This may be used to include null fields in Patch requests.
  23891. NullFields []string `json:"-"`
  23892. }
  23893. func (s *TargetSslProxyListWarning) MarshalJSON() ([]byte, error) {
  23894. type NoMethod TargetSslProxyListWarning
  23895. raw := NoMethod(*s)
  23896. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  23897. }
  23898. type TargetSslProxyListWarningData struct {
  23899. // Key: [Output Only] A key that provides more detail on the warning
  23900. // being returned. For example, for warnings where there are no results
  23901. // in a list request for a particular zone, this key might be scope and
  23902. // the key value might be the zone name. Other examples might be a key
  23903. // indicating a deprecated resource and a suggested replacement, or a
  23904. // warning about invalid network settings (for example, if an instance
  23905. // attempts to perform IP forwarding but is not enabled for IP
  23906. // forwarding).
  23907. Key string `json:"key,omitempty"`
  23908. // Value: [Output Only] A warning data value corresponding to the key.
  23909. Value string `json:"value,omitempty"`
  23910. // ForceSendFields is a list of field names (e.g. "Key") to
  23911. // unconditionally include in API requests. By default, fields with
  23912. // empty values are omitted from API requests. However, any non-pointer,
  23913. // non-interface field appearing in ForceSendFields will be sent to the
  23914. // server regardless of whether the field is empty or not. This may be
  23915. // used to include empty fields in Patch requests.
  23916. ForceSendFields []string `json:"-"`
  23917. // NullFields is a list of field names (e.g. "Key") to include in API
  23918. // requests with the JSON null value. By default, fields with empty
  23919. // values are omitted from API requests. However, any field with an
  23920. // empty value appearing in NullFields will be sent to the server as
  23921. // null. It is an error if a field in this list has a non-empty value.
  23922. // This may be used to include null fields in Patch requests.
  23923. NullFields []string `json:"-"`
  23924. }
  23925. func (s *TargetSslProxyListWarningData) MarshalJSON() ([]byte, error) {
  23926. type NoMethod TargetSslProxyListWarningData
  23927. raw := NoMethod(*s)
  23928. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  23929. }
  23930. type TargetTcpProxiesSetBackendServiceRequest struct {
  23931. // Service: The URL of the new BackendService resource for the
  23932. // targetTcpProxy.
  23933. Service string `json:"service,omitempty"`
  23934. // ForceSendFields is a list of field names (e.g. "Service") to
  23935. // unconditionally include in API requests. By default, fields with
  23936. // empty values are omitted from API requests. However, any non-pointer,
  23937. // non-interface field appearing in ForceSendFields will be sent to the
  23938. // server regardless of whether the field is empty or not. This may be
  23939. // used to include empty fields in Patch requests.
  23940. ForceSendFields []string `json:"-"`
  23941. // NullFields is a list of field names (e.g. "Service") to include in
  23942. // API requests with the JSON null value. By default, fields with empty
  23943. // values are omitted from API requests. However, any field with an
  23944. // empty value appearing in NullFields will be sent to the server as
  23945. // null. It is an error if a field in this list has a non-empty value.
  23946. // This may be used to include null fields in Patch requests.
  23947. NullFields []string `json:"-"`
  23948. }
  23949. func (s *TargetTcpProxiesSetBackendServiceRequest) MarshalJSON() ([]byte, error) {
  23950. type NoMethod TargetTcpProxiesSetBackendServiceRequest
  23951. raw := NoMethod(*s)
  23952. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  23953. }
  23954. type TargetTcpProxiesSetProxyHeaderRequest struct {
  23955. // ProxyHeader: The new type of proxy header to append before sending
  23956. // data to the backend. NONE or PROXY_V1 are allowed.
  23957. //
  23958. // Possible values:
  23959. // "NONE"
  23960. // "PROXY_V1"
  23961. ProxyHeader string `json:"proxyHeader,omitempty"`
  23962. // ForceSendFields is a list of field names (e.g. "ProxyHeader") to
  23963. // unconditionally include in API requests. By default, fields with
  23964. // empty values are omitted from API requests. However, any non-pointer,
  23965. // non-interface field appearing in ForceSendFields will be sent to the
  23966. // server regardless of whether the field is empty or not. This may be
  23967. // used to include empty fields in Patch requests.
  23968. ForceSendFields []string `json:"-"`
  23969. // NullFields is a list of field names (e.g. "ProxyHeader") to include
  23970. // in API requests with the JSON null value. By default, fields with
  23971. // empty values are omitted from API requests. However, any field with
  23972. // an empty value appearing in NullFields will be sent to the server as
  23973. // null. It is an error if a field in this list has a non-empty value.
  23974. // This may be used to include null fields in Patch requests.
  23975. NullFields []string `json:"-"`
  23976. }
  23977. func (s *TargetTcpProxiesSetProxyHeaderRequest) MarshalJSON() ([]byte, error) {
  23978. type NoMethod TargetTcpProxiesSetProxyHeaderRequest
  23979. raw := NoMethod(*s)
  23980. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  23981. }
  23982. // TargetTcpProxy: A TargetTcpProxy resource. This resource defines a
  23983. // TCP proxy. (== resource_for beta.targetTcpProxies ==) (==
  23984. // resource_for v1.targetTcpProxies ==)
  23985. type TargetTcpProxy struct {
  23986. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  23987. // format.
  23988. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  23989. // Description: An optional description of this resource. Provide this
  23990. // property when you create the resource.
  23991. Description string `json:"description,omitempty"`
  23992. // Id: [Output Only] The unique identifier for the resource. This
  23993. // identifier is defined by the server.
  23994. Id uint64 `json:"id,omitempty,string"`
  23995. // Kind: [Output Only] Type of the resource. Always
  23996. // compute#targetTcpProxy for target TCP proxies.
  23997. Kind string `json:"kind,omitempty"`
  23998. // Name: Name of the resource. Provided by the client when the resource
  23999. // is created. The name must be 1-63 characters long, and comply with
  24000. // RFC1035. Specifically, the name must be 1-63 characters long and
  24001. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  24002. // the first character must be a lowercase letter, and all following
  24003. // characters must be a dash, lowercase letter, or digit, except the
  24004. // last character, which cannot be a dash.
  24005. Name string `json:"name,omitempty"`
  24006. // ProxyHeader: Specifies the type of proxy header to append before
  24007. // sending data to the backend, either NONE or PROXY_V1. The default is
  24008. // NONE.
  24009. //
  24010. // Possible values:
  24011. // "NONE"
  24012. // "PROXY_V1"
  24013. ProxyHeader string `json:"proxyHeader,omitempty"`
  24014. // SelfLink: [Output Only] Server-defined URL for the resource.
  24015. SelfLink string `json:"selfLink,omitempty"`
  24016. // Service: URL to the BackendService resource.
  24017. Service string `json:"service,omitempty"`
  24018. // ServerResponse contains the HTTP response code and headers from the
  24019. // server.
  24020. googleapi.ServerResponse `json:"-"`
  24021. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  24022. // to unconditionally include in API requests. By default, fields with
  24023. // empty values are omitted from API requests. However, any non-pointer,
  24024. // non-interface field appearing in ForceSendFields will be sent to the
  24025. // server regardless of whether the field is empty or not. This may be
  24026. // used to include empty fields in Patch requests.
  24027. ForceSendFields []string `json:"-"`
  24028. // NullFields is a list of field names (e.g. "CreationTimestamp") to
  24029. // include in API requests with the JSON null value. By default, fields
  24030. // with empty values are omitted from API requests. However, any field
  24031. // with an empty value appearing in NullFields will be sent to the
  24032. // server as null. It is an error if a field in this list has a
  24033. // non-empty value. This may be used to include null fields in Patch
  24034. // requests.
  24035. NullFields []string `json:"-"`
  24036. }
  24037. func (s *TargetTcpProxy) MarshalJSON() ([]byte, error) {
  24038. type NoMethod TargetTcpProxy
  24039. raw := NoMethod(*s)
  24040. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  24041. }
  24042. // TargetTcpProxyList: Contains a list of TargetTcpProxy resources.
  24043. type TargetTcpProxyList struct {
  24044. // Id: [Output Only] Unique identifier for the resource; defined by the
  24045. // server.
  24046. Id string `json:"id,omitempty"`
  24047. // Items: A list of TargetTcpProxy resources.
  24048. Items []*TargetTcpProxy `json:"items,omitempty"`
  24049. // Kind: Type of resource.
  24050. Kind string `json:"kind,omitempty"`
  24051. // NextPageToken: [Output Only] This token allows you to get the next
  24052. // page of results for list requests. If the number of results is larger
  24053. // than maxResults, use the nextPageToken as a value for the query
  24054. // parameter pageToken in the next list request. Subsequent list
  24055. // requests will have their own nextPageToken to continue paging through
  24056. // the results.
  24057. NextPageToken string `json:"nextPageToken,omitempty"`
  24058. // SelfLink: [Output Only] Server-defined URL for this resource.
  24059. SelfLink string `json:"selfLink,omitempty"`
  24060. // Warning: [Output Only] Informational warning message.
  24061. Warning *TargetTcpProxyListWarning `json:"warning,omitempty"`
  24062. // ServerResponse contains the HTTP response code and headers from the
  24063. // server.
  24064. googleapi.ServerResponse `json:"-"`
  24065. // ForceSendFields is a list of field names (e.g. "Id") to
  24066. // unconditionally include in API requests. By default, fields with
  24067. // empty values are omitted from API requests. However, any non-pointer,
  24068. // non-interface field appearing in ForceSendFields will be sent to the
  24069. // server regardless of whether the field is empty or not. This may be
  24070. // used to include empty fields in Patch requests.
  24071. ForceSendFields []string `json:"-"`
  24072. // NullFields is a list of field names (e.g. "Id") to include in API
  24073. // requests with the JSON null value. By default, fields with empty
  24074. // values are omitted from API requests. However, any field with an
  24075. // empty value appearing in NullFields will be sent to the server as
  24076. // null. It is an error if a field in this list has a non-empty value.
  24077. // This may be used to include null fields in Patch requests.
  24078. NullFields []string `json:"-"`
  24079. }
  24080. func (s *TargetTcpProxyList) MarshalJSON() ([]byte, error) {
  24081. type NoMethod TargetTcpProxyList
  24082. raw := NoMethod(*s)
  24083. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  24084. }
  24085. // TargetTcpProxyListWarning: [Output Only] Informational warning
  24086. // message.
  24087. type TargetTcpProxyListWarning struct {
  24088. // Code: [Output Only] A warning code, if applicable. For example,
  24089. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  24090. // the response.
  24091. //
  24092. // Possible values:
  24093. // "CLEANUP_FAILED"
  24094. // "DEPRECATED_RESOURCE_USED"
  24095. // "DEPRECATED_TYPE_USED"
  24096. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  24097. // "EXPERIMENTAL_TYPE_USED"
  24098. // "EXTERNAL_API_WARNING"
  24099. // "FIELD_VALUE_OVERRIDEN"
  24100. // "INJECTED_KERNELS_DEPRECATED"
  24101. // "MISSING_TYPE_DEPENDENCY"
  24102. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  24103. // "NEXT_HOP_CANNOT_IP_FORWARD"
  24104. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  24105. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  24106. // "NEXT_HOP_NOT_RUNNING"
  24107. // "NOT_CRITICAL_ERROR"
  24108. // "NO_RESULTS_ON_PAGE"
  24109. // "REQUIRED_TOS_AGREEMENT"
  24110. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  24111. // "RESOURCE_NOT_DELETED"
  24112. // "SCHEMA_VALIDATION_IGNORED"
  24113. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  24114. // "UNDECLARED_PROPERTIES"
  24115. // "UNREACHABLE"
  24116. Code string `json:"code,omitempty"`
  24117. // Data: [Output Only] Metadata about this warning in key: value format.
  24118. // For example:
  24119. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  24120. Data []*TargetTcpProxyListWarningData `json:"data,omitempty"`
  24121. // Message: [Output Only] A human-readable description of the warning
  24122. // code.
  24123. Message string `json:"message,omitempty"`
  24124. // ForceSendFields is a list of field names (e.g. "Code") to
  24125. // unconditionally include in API requests. By default, fields with
  24126. // empty values are omitted from API requests. However, any non-pointer,
  24127. // non-interface field appearing in ForceSendFields will be sent to the
  24128. // server regardless of whether the field is empty or not. This may be
  24129. // used to include empty fields in Patch requests.
  24130. ForceSendFields []string `json:"-"`
  24131. // NullFields is a list of field names (e.g. "Code") to include in API
  24132. // requests with the JSON null value. By default, fields with empty
  24133. // values are omitted from API requests. However, any field with an
  24134. // empty value appearing in NullFields will be sent to the server as
  24135. // null. It is an error if a field in this list has a non-empty value.
  24136. // This may be used to include null fields in Patch requests.
  24137. NullFields []string `json:"-"`
  24138. }
  24139. func (s *TargetTcpProxyListWarning) MarshalJSON() ([]byte, error) {
  24140. type NoMethod TargetTcpProxyListWarning
  24141. raw := NoMethod(*s)
  24142. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  24143. }
  24144. type TargetTcpProxyListWarningData struct {
  24145. // Key: [Output Only] A key that provides more detail on the warning
  24146. // being returned. For example, for warnings where there are no results
  24147. // in a list request for a particular zone, this key might be scope and
  24148. // the key value might be the zone name. Other examples might be a key
  24149. // indicating a deprecated resource and a suggested replacement, or a
  24150. // warning about invalid network settings (for example, if an instance
  24151. // attempts to perform IP forwarding but is not enabled for IP
  24152. // forwarding).
  24153. Key string `json:"key,omitempty"`
  24154. // Value: [Output Only] A warning data value corresponding to the key.
  24155. Value string `json:"value,omitempty"`
  24156. // ForceSendFields is a list of field names (e.g. "Key") to
  24157. // unconditionally include in API requests. By default, fields with
  24158. // empty values are omitted from API requests. However, any non-pointer,
  24159. // non-interface field appearing in ForceSendFields will be sent to the
  24160. // server regardless of whether the field is empty or not. This may be
  24161. // used to include empty fields in Patch requests.
  24162. ForceSendFields []string `json:"-"`
  24163. // NullFields is a list of field names (e.g. "Key") to include in API
  24164. // requests with the JSON null value. By default, fields with empty
  24165. // values are omitted from API requests. However, any field with an
  24166. // empty value appearing in NullFields will be sent to the server as
  24167. // null. It is an error if a field in this list has a non-empty value.
  24168. // This may be used to include null fields in Patch requests.
  24169. NullFields []string `json:"-"`
  24170. }
  24171. func (s *TargetTcpProxyListWarningData) MarshalJSON() ([]byte, error) {
  24172. type NoMethod TargetTcpProxyListWarningData
  24173. raw := NoMethod(*s)
  24174. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  24175. }
  24176. // TargetVpnGateway: Represents a Target VPN gateway resource. (==
  24177. // resource_for beta.targetVpnGateways ==) (== resource_for
  24178. // v1.targetVpnGateways ==)
  24179. type TargetVpnGateway struct {
  24180. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  24181. // format.
  24182. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  24183. // Description: An optional description of this resource. Provide this
  24184. // property when you create the resource.
  24185. Description string `json:"description,omitempty"`
  24186. // ForwardingRules: [Output Only] A list of URLs to the ForwardingRule
  24187. // resources. ForwardingRules are created using
  24188. // compute.forwardingRules.insert and associated to a VPN gateway.
  24189. ForwardingRules []string `json:"forwardingRules,omitempty"`
  24190. // Id: [Output Only] The unique identifier for the resource. This
  24191. // identifier is defined by the server.
  24192. Id uint64 `json:"id,omitempty,string"`
  24193. // Kind: [Output Only] Type of resource. Always compute#targetVpnGateway
  24194. // for target VPN gateways.
  24195. Kind string `json:"kind,omitempty"`
  24196. // LabelFingerprint: A fingerprint for the labels being applied to this
  24197. // TargetVpnGateway, which is essentially a hash of the labels set used
  24198. // for optimistic locking. The fingerprint is initially generated by
  24199. // Compute Engine and changes after every request to modify or update
  24200. // labels. You must always provide an up-to-date fingerprint hash in
  24201. // order to update or change labels.
  24202. //
  24203. // To see the latest fingerprint, make a get() request to retrieve an
  24204. // TargetVpnGateway.
  24205. LabelFingerprint string `json:"labelFingerprint,omitempty"`
  24206. // Labels: Labels to apply to this TargetVpnGateway resource. These can
  24207. // be later modified by the setLabels method. Each label key/value must
  24208. // comply with RFC1035. Label values may be empty.
  24209. Labels map[string]string `json:"labels,omitempty"`
  24210. // Name: Name of the resource. Provided by the client when the resource
  24211. // is created. The name must be 1-63 characters long, and comply with
  24212. // RFC1035. Specifically, the name must be 1-63 characters long and
  24213. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  24214. // the first character must be a lowercase letter, and all following
  24215. // characters must be a dash, lowercase letter, or digit, except the
  24216. // last character, which cannot be a dash.
  24217. Name string `json:"name,omitempty"`
  24218. // Network: URL of the network to which this VPN gateway is attached.
  24219. // Provided by the client when the VPN gateway is created.
  24220. Network string `json:"network,omitempty"`
  24221. // Region: [Output Only] URL of the region where the target VPN gateway
  24222. // resides. You must specify this field as part of the HTTP request URL.
  24223. // It is not settable as a field in the request body.
  24224. Region string `json:"region,omitempty"`
  24225. // SelfLink: [Output Only] Server-defined URL for the resource.
  24226. SelfLink string `json:"selfLink,omitempty"`
  24227. // Status: [Output Only] The status of the VPN gateway.
  24228. //
  24229. // Possible values:
  24230. // "CREATING"
  24231. // "DELETING"
  24232. // "FAILED"
  24233. // "READY"
  24234. Status string `json:"status,omitempty"`
  24235. // Tunnels: [Output Only] A list of URLs to VpnTunnel resources.
  24236. // VpnTunnels are created using compute.vpntunnels.insert method and
  24237. // associated to a VPN gateway.
  24238. Tunnels []string `json:"tunnels,omitempty"`
  24239. // ServerResponse contains the HTTP response code and headers from the
  24240. // server.
  24241. googleapi.ServerResponse `json:"-"`
  24242. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  24243. // to unconditionally include in API requests. By default, fields with
  24244. // empty values are omitted from API requests. However, any non-pointer,
  24245. // non-interface field appearing in ForceSendFields will be sent to the
  24246. // server regardless of whether the field is empty or not. This may be
  24247. // used to include empty fields in Patch requests.
  24248. ForceSendFields []string `json:"-"`
  24249. // NullFields is a list of field names (e.g. "CreationTimestamp") to
  24250. // include in API requests with the JSON null value. By default, fields
  24251. // with empty values are omitted from API requests. However, any field
  24252. // with an empty value appearing in NullFields will be sent to the
  24253. // server as null. It is an error if a field in this list has a
  24254. // non-empty value. This may be used to include null fields in Patch
  24255. // requests.
  24256. NullFields []string `json:"-"`
  24257. }
  24258. func (s *TargetVpnGateway) MarshalJSON() ([]byte, error) {
  24259. type NoMethod TargetVpnGateway
  24260. raw := NoMethod(*s)
  24261. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  24262. }
  24263. type TargetVpnGatewayAggregatedList struct {
  24264. // Id: [Output Only] Unique identifier for the resource; defined by the
  24265. // server.
  24266. Id string `json:"id,omitempty"`
  24267. // Items: A list of TargetVpnGateway resources.
  24268. Items map[string]TargetVpnGatewaysScopedList `json:"items,omitempty"`
  24269. // Kind: [Output Only] Type of resource. Always compute#targetVpnGateway
  24270. // for target VPN gateways.
  24271. Kind string `json:"kind,omitempty"`
  24272. // NextPageToken: [Output Only] This token allows you to get the next
  24273. // page of results for list requests. If the number of results is larger
  24274. // than maxResults, use the nextPageToken as a value for the query
  24275. // parameter pageToken in the next list request. Subsequent list
  24276. // requests will have their own nextPageToken to continue paging through
  24277. // the results.
  24278. NextPageToken string `json:"nextPageToken,omitempty"`
  24279. // SelfLink: [Output Only] Server-defined URL for this resource.
  24280. SelfLink string `json:"selfLink,omitempty"`
  24281. // Warning: [Output Only] Informational warning message.
  24282. Warning *TargetVpnGatewayAggregatedListWarning `json:"warning,omitempty"`
  24283. // ServerResponse contains the HTTP response code and headers from the
  24284. // server.
  24285. googleapi.ServerResponse `json:"-"`
  24286. // ForceSendFields is a list of field names (e.g. "Id") to
  24287. // unconditionally include in API requests. By default, fields with
  24288. // empty values are omitted from API requests. However, any non-pointer,
  24289. // non-interface field appearing in ForceSendFields will be sent to the
  24290. // server regardless of whether the field is empty or not. This may be
  24291. // used to include empty fields in Patch requests.
  24292. ForceSendFields []string `json:"-"`
  24293. // NullFields is a list of field names (e.g. "Id") to include in API
  24294. // requests with the JSON null value. By default, fields with empty
  24295. // values are omitted from API requests. However, any field with an
  24296. // empty value appearing in NullFields will be sent to the server as
  24297. // null. It is an error if a field in this list has a non-empty value.
  24298. // This may be used to include null fields in Patch requests.
  24299. NullFields []string `json:"-"`
  24300. }
  24301. func (s *TargetVpnGatewayAggregatedList) MarshalJSON() ([]byte, error) {
  24302. type NoMethod TargetVpnGatewayAggregatedList
  24303. raw := NoMethod(*s)
  24304. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  24305. }
  24306. // TargetVpnGatewayAggregatedListWarning: [Output Only] Informational
  24307. // warning message.
  24308. type TargetVpnGatewayAggregatedListWarning struct {
  24309. // Code: [Output Only] A warning code, if applicable. For example,
  24310. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  24311. // the response.
  24312. //
  24313. // Possible values:
  24314. // "CLEANUP_FAILED"
  24315. // "DEPRECATED_RESOURCE_USED"
  24316. // "DEPRECATED_TYPE_USED"
  24317. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  24318. // "EXPERIMENTAL_TYPE_USED"
  24319. // "EXTERNAL_API_WARNING"
  24320. // "FIELD_VALUE_OVERRIDEN"
  24321. // "INJECTED_KERNELS_DEPRECATED"
  24322. // "MISSING_TYPE_DEPENDENCY"
  24323. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  24324. // "NEXT_HOP_CANNOT_IP_FORWARD"
  24325. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  24326. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  24327. // "NEXT_HOP_NOT_RUNNING"
  24328. // "NOT_CRITICAL_ERROR"
  24329. // "NO_RESULTS_ON_PAGE"
  24330. // "REQUIRED_TOS_AGREEMENT"
  24331. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  24332. // "RESOURCE_NOT_DELETED"
  24333. // "SCHEMA_VALIDATION_IGNORED"
  24334. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  24335. // "UNDECLARED_PROPERTIES"
  24336. // "UNREACHABLE"
  24337. Code string `json:"code,omitempty"`
  24338. // Data: [Output Only] Metadata about this warning in key: value format.
  24339. // For example:
  24340. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  24341. Data []*TargetVpnGatewayAggregatedListWarningData `json:"data,omitempty"`
  24342. // Message: [Output Only] A human-readable description of the warning
  24343. // code.
  24344. Message string `json:"message,omitempty"`
  24345. // ForceSendFields is a list of field names (e.g. "Code") to
  24346. // unconditionally include in API requests. By default, fields with
  24347. // empty values are omitted from API requests. However, any non-pointer,
  24348. // non-interface field appearing in ForceSendFields will be sent to the
  24349. // server regardless of whether the field is empty or not. This may be
  24350. // used to include empty fields in Patch requests.
  24351. ForceSendFields []string `json:"-"`
  24352. // NullFields is a list of field names (e.g. "Code") to include in API
  24353. // requests with the JSON null value. By default, fields with empty
  24354. // values are omitted from API requests. However, any field with an
  24355. // empty value appearing in NullFields will be sent to the server as
  24356. // null. It is an error if a field in this list has a non-empty value.
  24357. // This may be used to include null fields in Patch requests.
  24358. NullFields []string `json:"-"`
  24359. }
  24360. func (s *TargetVpnGatewayAggregatedListWarning) MarshalJSON() ([]byte, error) {
  24361. type NoMethod TargetVpnGatewayAggregatedListWarning
  24362. raw := NoMethod(*s)
  24363. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  24364. }
  24365. type TargetVpnGatewayAggregatedListWarningData struct {
  24366. // Key: [Output Only] A key that provides more detail on the warning
  24367. // being returned. For example, for warnings where there are no results
  24368. // in a list request for a particular zone, this key might be scope and
  24369. // the key value might be the zone name. Other examples might be a key
  24370. // indicating a deprecated resource and a suggested replacement, or a
  24371. // warning about invalid network settings (for example, if an instance
  24372. // attempts to perform IP forwarding but is not enabled for IP
  24373. // forwarding).
  24374. Key string `json:"key,omitempty"`
  24375. // Value: [Output Only] A warning data value corresponding to the key.
  24376. Value string `json:"value,omitempty"`
  24377. // ForceSendFields is a list of field names (e.g. "Key") to
  24378. // unconditionally include in API requests. By default, fields with
  24379. // empty values are omitted from API requests. However, any non-pointer,
  24380. // non-interface field appearing in ForceSendFields will be sent to the
  24381. // server regardless of whether the field is empty or not. This may be
  24382. // used to include empty fields in Patch requests.
  24383. ForceSendFields []string `json:"-"`
  24384. // NullFields is a list of field names (e.g. "Key") to include in API
  24385. // requests with the JSON null value. By default, fields with empty
  24386. // values are omitted from API requests. However, any field with an
  24387. // empty value appearing in NullFields will be sent to the server as
  24388. // null. It is an error if a field in this list has a non-empty value.
  24389. // This may be used to include null fields in Patch requests.
  24390. NullFields []string `json:"-"`
  24391. }
  24392. func (s *TargetVpnGatewayAggregatedListWarningData) MarshalJSON() ([]byte, error) {
  24393. type NoMethod TargetVpnGatewayAggregatedListWarningData
  24394. raw := NoMethod(*s)
  24395. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  24396. }
  24397. // TargetVpnGatewayList: Contains a list of TargetVpnGateway resources.
  24398. type TargetVpnGatewayList struct {
  24399. // Id: [Output Only] Unique identifier for the resource; defined by the
  24400. // server.
  24401. Id string `json:"id,omitempty"`
  24402. // Items: A list of TargetVpnGateway resources.
  24403. Items []*TargetVpnGateway `json:"items,omitempty"`
  24404. // Kind: [Output Only] Type of resource. Always compute#targetVpnGateway
  24405. // for target VPN gateways.
  24406. Kind string `json:"kind,omitempty"`
  24407. // NextPageToken: [Output Only] This token allows you to get the next
  24408. // page of results for list requests. If the number of results is larger
  24409. // than maxResults, use the nextPageToken as a value for the query
  24410. // parameter pageToken in the next list request. Subsequent list
  24411. // requests will have their own nextPageToken to continue paging through
  24412. // the results.
  24413. NextPageToken string `json:"nextPageToken,omitempty"`
  24414. // SelfLink: [Output Only] Server-defined URL for this resource.
  24415. SelfLink string `json:"selfLink,omitempty"`
  24416. // Warning: [Output Only] Informational warning message.
  24417. Warning *TargetVpnGatewayListWarning `json:"warning,omitempty"`
  24418. // ServerResponse contains the HTTP response code and headers from the
  24419. // server.
  24420. googleapi.ServerResponse `json:"-"`
  24421. // ForceSendFields is a list of field names (e.g. "Id") to
  24422. // unconditionally include in API requests. By default, fields with
  24423. // empty values are omitted from API requests. However, any non-pointer,
  24424. // non-interface field appearing in ForceSendFields will be sent to the
  24425. // server regardless of whether the field is empty or not. This may be
  24426. // used to include empty fields in Patch requests.
  24427. ForceSendFields []string `json:"-"`
  24428. // NullFields is a list of field names (e.g. "Id") to include in API
  24429. // requests with the JSON null value. By default, fields with empty
  24430. // values are omitted from API requests. However, any field with an
  24431. // empty value appearing in NullFields will be sent to the server as
  24432. // null. It is an error if a field in this list has a non-empty value.
  24433. // This may be used to include null fields in Patch requests.
  24434. NullFields []string `json:"-"`
  24435. }
  24436. func (s *TargetVpnGatewayList) MarshalJSON() ([]byte, error) {
  24437. type NoMethod TargetVpnGatewayList
  24438. raw := NoMethod(*s)
  24439. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  24440. }
  24441. // TargetVpnGatewayListWarning: [Output Only] Informational warning
  24442. // message.
  24443. type TargetVpnGatewayListWarning 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 []*TargetVpnGatewayListWarningData `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 *TargetVpnGatewayListWarning) MarshalJSON() ([]byte, error) {
  24496. type NoMethod TargetVpnGatewayListWarning
  24497. raw := NoMethod(*s)
  24498. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  24499. }
  24500. type TargetVpnGatewayListWarningData 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 *TargetVpnGatewayListWarningData) MarshalJSON() ([]byte, error) {
  24528. type NoMethod TargetVpnGatewayListWarningData
  24529. raw := NoMethod(*s)
  24530. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  24531. }
  24532. type TargetVpnGatewaysScopedList struct {
  24533. // TargetVpnGateways: [Output Only] A list of target vpn gateways
  24534. // contained in this scope.
  24535. TargetVpnGateways []*TargetVpnGateway `json:"targetVpnGateways,omitempty"`
  24536. // Warning: [Output Only] Informational warning which replaces the list
  24537. // of addresses when the list is empty.
  24538. Warning *TargetVpnGatewaysScopedListWarning `json:"warning,omitempty"`
  24539. // ForceSendFields is a list of field names (e.g. "TargetVpnGateways")
  24540. // to unconditionally include in API requests. By default, fields with
  24541. // empty values are omitted from API requests. However, any non-pointer,
  24542. // non-interface field appearing in ForceSendFields will be sent to the
  24543. // server regardless of whether the field is empty or not. This may be
  24544. // used to include empty fields in Patch requests.
  24545. ForceSendFields []string `json:"-"`
  24546. // NullFields is a list of field names (e.g. "TargetVpnGateways") to
  24547. // include in API requests with the JSON null value. By default, fields
  24548. // with empty values are omitted from API requests. However, any field
  24549. // with an empty value appearing in NullFields will be sent to the
  24550. // server as null. It is an error if a field in this list has a
  24551. // non-empty value. This may be used to include null fields in Patch
  24552. // requests.
  24553. NullFields []string `json:"-"`
  24554. }
  24555. func (s *TargetVpnGatewaysScopedList) MarshalJSON() ([]byte, error) {
  24556. type NoMethod TargetVpnGatewaysScopedList
  24557. raw := NoMethod(*s)
  24558. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  24559. }
  24560. // TargetVpnGatewaysScopedListWarning: [Output Only] Informational
  24561. // warning which replaces the list of addresses when the list is empty.
  24562. type TargetVpnGatewaysScopedListWarning struct {
  24563. // Code: [Output Only] A warning code, if applicable. For example,
  24564. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  24565. // the response.
  24566. //
  24567. // Possible values:
  24568. // "CLEANUP_FAILED"
  24569. // "DEPRECATED_RESOURCE_USED"
  24570. // "DEPRECATED_TYPE_USED"
  24571. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  24572. // "EXPERIMENTAL_TYPE_USED"
  24573. // "EXTERNAL_API_WARNING"
  24574. // "FIELD_VALUE_OVERRIDEN"
  24575. // "INJECTED_KERNELS_DEPRECATED"
  24576. // "MISSING_TYPE_DEPENDENCY"
  24577. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  24578. // "NEXT_HOP_CANNOT_IP_FORWARD"
  24579. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  24580. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  24581. // "NEXT_HOP_NOT_RUNNING"
  24582. // "NOT_CRITICAL_ERROR"
  24583. // "NO_RESULTS_ON_PAGE"
  24584. // "REQUIRED_TOS_AGREEMENT"
  24585. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  24586. // "RESOURCE_NOT_DELETED"
  24587. // "SCHEMA_VALIDATION_IGNORED"
  24588. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  24589. // "UNDECLARED_PROPERTIES"
  24590. // "UNREACHABLE"
  24591. Code string `json:"code,omitempty"`
  24592. // Data: [Output Only] Metadata about this warning in key: value format.
  24593. // For example:
  24594. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  24595. Data []*TargetVpnGatewaysScopedListWarningData `json:"data,omitempty"`
  24596. // Message: [Output Only] A human-readable description of the warning
  24597. // code.
  24598. Message string `json:"message,omitempty"`
  24599. // ForceSendFields is a list of field names (e.g. "Code") to
  24600. // unconditionally include in API requests. By default, fields with
  24601. // empty values are omitted from API requests. However, any non-pointer,
  24602. // non-interface field appearing in ForceSendFields will be sent to the
  24603. // server regardless of whether the field is empty or not. This may be
  24604. // used to include empty fields in Patch requests.
  24605. ForceSendFields []string `json:"-"`
  24606. // NullFields is a list of field names (e.g. "Code") to include in API
  24607. // requests with the JSON null value. By default, fields with empty
  24608. // values are omitted from API requests. However, any field with an
  24609. // empty value appearing in NullFields will be sent to the server as
  24610. // null. It is an error if a field in this list has a non-empty value.
  24611. // This may be used to include null fields in Patch requests.
  24612. NullFields []string `json:"-"`
  24613. }
  24614. func (s *TargetVpnGatewaysScopedListWarning) MarshalJSON() ([]byte, error) {
  24615. type NoMethod TargetVpnGatewaysScopedListWarning
  24616. raw := NoMethod(*s)
  24617. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  24618. }
  24619. type TargetVpnGatewaysScopedListWarningData struct {
  24620. // Key: [Output Only] A key that provides more detail on the warning
  24621. // being returned. For example, for warnings where there are no results
  24622. // in a list request for a particular zone, this key might be scope and
  24623. // the key value might be the zone name. Other examples might be a key
  24624. // indicating a deprecated resource and a suggested replacement, or a
  24625. // warning about invalid network settings (for example, if an instance
  24626. // attempts to perform IP forwarding but is not enabled for IP
  24627. // forwarding).
  24628. Key string `json:"key,omitempty"`
  24629. // Value: [Output Only] A warning data value corresponding to the key.
  24630. Value string `json:"value,omitempty"`
  24631. // ForceSendFields is a list of field names (e.g. "Key") to
  24632. // unconditionally include in API requests. By default, fields with
  24633. // empty values are omitted from API requests. However, any non-pointer,
  24634. // non-interface field appearing in ForceSendFields will be sent to the
  24635. // server regardless of whether the field is empty or not. This may be
  24636. // used to include empty fields in Patch requests.
  24637. ForceSendFields []string `json:"-"`
  24638. // NullFields is a list of field names (e.g. "Key") to include in API
  24639. // requests with the JSON null value. By default, fields with empty
  24640. // values are omitted from API requests. However, any field with an
  24641. // empty value appearing in NullFields will be sent to the server as
  24642. // null. It is an error if a field in this list has a non-empty value.
  24643. // This may be used to include null fields in Patch requests.
  24644. NullFields []string `json:"-"`
  24645. }
  24646. func (s *TargetVpnGatewaysScopedListWarningData) MarshalJSON() ([]byte, error) {
  24647. type NoMethod TargetVpnGatewaysScopedListWarningData
  24648. raw := NoMethod(*s)
  24649. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  24650. }
  24651. type TestFailure struct {
  24652. ActualService string `json:"actualService,omitempty"`
  24653. ExpectedService string `json:"expectedService,omitempty"`
  24654. Host string `json:"host,omitempty"`
  24655. Path string `json:"path,omitempty"`
  24656. // ForceSendFields is a list of field names (e.g. "ActualService") to
  24657. // unconditionally include in API requests. By default, fields with
  24658. // empty values are omitted from API requests. However, any non-pointer,
  24659. // non-interface field appearing in ForceSendFields will be sent to the
  24660. // server regardless of whether the field is empty or not. This may be
  24661. // used to include empty fields in Patch requests.
  24662. ForceSendFields []string `json:"-"`
  24663. // NullFields is a list of field names (e.g. "ActualService") to include
  24664. // in API requests with the JSON null value. By default, fields with
  24665. // empty values are omitted from API requests. However, any field with
  24666. // an empty value appearing in NullFields will be sent to the server as
  24667. // null. It is an error if a field in this list has a non-empty value.
  24668. // This may be used to include null fields in Patch requests.
  24669. NullFields []string `json:"-"`
  24670. }
  24671. func (s *TestFailure) MarshalJSON() ([]byte, error) {
  24672. type NoMethod TestFailure
  24673. raw := NoMethod(*s)
  24674. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  24675. }
  24676. type TestPermissionsRequest struct {
  24677. // Permissions: The set of permissions to check for the 'resource'.
  24678. // Permissions with wildcards (such as '*' or 'storage.*') are not
  24679. // allowed.
  24680. Permissions []string `json:"permissions,omitempty"`
  24681. // ForceSendFields is a list of field names (e.g. "Permissions") to
  24682. // unconditionally include in API requests. By default, fields with
  24683. // empty values are omitted from API requests. However, any non-pointer,
  24684. // non-interface field appearing in ForceSendFields will be sent to the
  24685. // server regardless of whether the field is empty or not. This may be
  24686. // used to include empty fields in Patch requests.
  24687. ForceSendFields []string `json:"-"`
  24688. // NullFields is a list of field names (e.g. "Permissions") to include
  24689. // in API requests with the JSON null value. By default, fields with
  24690. // empty values are omitted from API requests. However, any field with
  24691. // an empty value appearing in NullFields will be sent to the server as
  24692. // null. It is an error if a field in this list has a non-empty value.
  24693. // This may be used to include null fields in Patch requests.
  24694. NullFields []string `json:"-"`
  24695. }
  24696. func (s *TestPermissionsRequest) MarshalJSON() ([]byte, error) {
  24697. type NoMethod TestPermissionsRequest
  24698. raw := NoMethod(*s)
  24699. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  24700. }
  24701. type TestPermissionsResponse struct {
  24702. // Permissions: A subset of `TestPermissionsRequest.permissions` that
  24703. // the caller is allowed.
  24704. Permissions []string `json:"permissions,omitempty"`
  24705. // ServerResponse contains the HTTP response code and headers from the
  24706. // server.
  24707. googleapi.ServerResponse `json:"-"`
  24708. // ForceSendFields is a list of field names (e.g. "Permissions") to
  24709. // unconditionally include in API requests. By default, fields with
  24710. // empty values are omitted from API requests. However, any non-pointer,
  24711. // non-interface field appearing in ForceSendFields will be sent to the
  24712. // server regardless of whether the field is empty or not. This may be
  24713. // used to include empty fields in Patch requests.
  24714. ForceSendFields []string `json:"-"`
  24715. // NullFields is a list of field names (e.g. "Permissions") to include
  24716. // in API requests with the JSON null value. By default, fields with
  24717. // empty values are omitted from API requests. However, any field with
  24718. // an empty value appearing in NullFields will be sent to the server as
  24719. // null. It is an error if a field in this list has a non-empty value.
  24720. // This may be used to include null fields in Patch requests.
  24721. NullFields []string `json:"-"`
  24722. }
  24723. func (s *TestPermissionsResponse) MarshalJSON() ([]byte, error) {
  24724. type NoMethod TestPermissionsResponse
  24725. raw := NoMethod(*s)
  24726. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  24727. }
  24728. type UDPHealthCheck struct {
  24729. // Port: The UDP port number for the health check request. Valid values
  24730. // are 1 through 65535.
  24731. Port int64 `json:"port,omitempty"`
  24732. // PortName: Port name as defined in InstanceGroup#NamedPort#name. If
  24733. // both port and port_name are defined, port takes precedence.
  24734. PortName string `json:"portName,omitempty"`
  24735. // Request: Raw data of request to send in payload of UDP packet. It is
  24736. // an error if this is empty. The request data can only be ASCII.
  24737. Request string `json:"request,omitempty"`
  24738. // Response: The bytes to match against the beginning of the response
  24739. // data. It is an error if this is empty. The response data can only be
  24740. // ASCII.
  24741. Response string `json:"response,omitempty"`
  24742. // ForceSendFields is a list of field names (e.g. "Port") to
  24743. // unconditionally include in API requests. By default, fields with
  24744. // empty values are omitted from API requests. However, any non-pointer,
  24745. // non-interface field appearing in ForceSendFields will be sent to the
  24746. // server regardless of whether the field is empty or not. This may be
  24747. // used to include empty fields in Patch requests.
  24748. ForceSendFields []string `json:"-"`
  24749. // NullFields is a list of field names (e.g. "Port") to include in API
  24750. // requests with the JSON null value. By default, fields with empty
  24751. // values are omitted from API requests. However, any field with an
  24752. // empty value appearing in NullFields will be sent to the server as
  24753. // null. It is an error if a field in this list has a non-empty value.
  24754. // This may be used to include null fields in Patch requests.
  24755. NullFields []string `json:"-"`
  24756. }
  24757. func (s *UDPHealthCheck) MarshalJSON() ([]byte, error) {
  24758. type NoMethod UDPHealthCheck
  24759. raw := NoMethod(*s)
  24760. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  24761. }
  24762. // UrlMap: A UrlMap resource. This resource defines the mapping from URL
  24763. // to the BackendService resource, based on the "longest-match" of the
  24764. // URL's host and path.
  24765. type UrlMap struct {
  24766. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  24767. // format.
  24768. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  24769. // DefaultService: The URL of the BackendService resource if none of the
  24770. // hostRules match.
  24771. DefaultService string `json:"defaultService,omitempty"`
  24772. // Description: An optional description of this resource. Provide this
  24773. // property when you create the resource.
  24774. Description string `json:"description,omitempty"`
  24775. // Fingerprint: Fingerprint of this resource. A hash of the contents
  24776. // stored in this object. This field is used in optimistic locking. This
  24777. // field will be ignored when inserting a UrlMap. An up-to-date
  24778. // fingerprint must be provided in order to update the UrlMap.
  24779. Fingerprint string `json:"fingerprint,omitempty"`
  24780. // HostRules: The list of HostRules to use against the URL.
  24781. HostRules []*HostRule `json:"hostRules,omitempty"`
  24782. // Id: [Output Only] The unique identifier for the resource. This
  24783. // identifier is defined by the server.
  24784. Id uint64 `json:"id,omitempty,string"`
  24785. // Kind: [Output Only] Type of the resource. Always compute#urlMaps for
  24786. // url maps.
  24787. Kind string `json:"kind,omitempty"`
  24788. // Name: Name of the resource. Provided by the client when the resource
  24789. // is created. The name must be 1-63 characters long, and comply with
  24790. // RFC1035. Specifically, the name must be 1-63 characters long and
  24791. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  24792. // the first character must be a lowercase letter, and all following
  24793. // characters must be a dash, lowercase letter, or digit, except the
  24794. // last character, which cannot be a dash.
  24795. Name string `json:"name,omitempty"`
  24796. // PathMatchers: The list of named PathMatchers to use against the URL.
  24797. PathMatchers []*PathMatcher `json:"pathMatchers,omitempty"`
  24798. // SelfLink: [Output Only] Server-defined URL for the resource.
  24799. SelfLink string `json:"selfLink,omitempty"`
  24800. // Tests: The list of expected URL mapping tests. Request to update this
  24801. // UrlMap will succeed only if all of the test cases pass. You can
  24802. // specify a maximum of 100 tests per UrlMap.
  24803. Tests []*UrlMapTest `json:"tests,omitempty"`
  24804. // ServerResponse contains the HTTP response code and headers from the
  24805. // server.
  24806. googleapi.ServerResponse `json:"-"`
  24807. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  24808. // to unconditionally include in API requests. By default, fields with
  24809. // empty values are omitted from API requests. However, any non-pointer,
  24810. // non-interface field appearing in ForceSendFields will be sent to the
  24811. // server regardless of whether the field is empty or not. This may be
  24812. // used to include empty fields in Patch requests.
  24813. ForceSendFields []string `json:"-"`
  24814. // NullFields is a list of field names (e.g. "CreationTimestamp") to
  24815. // include in API requests with the JSON null value. By default, fields
  24816. // with empty values are omitted from API requests. However, any field
  24817. // with an empty value appearing in NullFields will be sent to the
  24818. // server as null. It is an error if a field in this list has a
  24819. // non-empty value. This may be used to include null fields in Patch
  24820. // requests.
  24821. NullFields []string `json:"-"`
  24822. }
  24823. func (s *UrlMap) MarshalJSON() ([]byte, error) {
  24824. type NoMethod UrlMap
  24825. raw := NoMethod(*s)
  24826. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  24827. }
  24828. // UrlMapList: Contains a list of UrlMap resources.
  24829. type UrlMapList struct {
  24830. // Id: [Output Only] Unique identifier for the resource; defined by the
  24831. // server.
  24832. Id string `json:"id,omitempty"`
  24833. // Items: A list of UrlMap resources.
  24834. Items []*UrlMap `json:"items,omitempty"`
  24835. // Kind: Type of resource.
  24836. Kind string `json:"kind,omitempty"`
  24837. // NextPageToken: [Output Only] This token allows you to get the next
  24838. // page of results for list requests. If the number of results is larger
  24839. // than maxResults, use the nextPageToken as a value for the query
  24840. // parameter pageToken in the next list request. Subsequent list
  24841. // requests will have their own nextPageToken to continue paging through
  24842. // the results.
  24843. NextPageToken string `json:"nextPageToken,omitempty"`
  24844. // SelfLink: [Output Only] Server-defined URL for this resource.
  24845. SelfLink string `json:"selfLink,omitempty"`
  24846. // Warning: [Output Only] Informational warning message.
  24847. Warning *UrlMapListWarning `json:"warning,omitempty"`
  24848. // ServerResponse contains the HTTP response code and headers from the
  24849. // server.
  24850. googleapi.ServerResponse `json:"-"`
  24851. // ForceSendFields is a list of field names (e.g. "Id") to
  24852. // unconditionally include in API requests. By default, fields with
  24853. // empty values are omitted from API requests. However, any non-pointer,
  24854. // non-interface field appearing in ForceSendFields will be sent to the
  24855. // server regardless of whether the field is empty or not. This may be
  24856. // used to include empty fields in Patch requests.
  24857. ForceSendFields []string `json:"-"`
  24858. // NullFields is a list of field names (e.g. "Id") to include in API
  24859. // requests with the JSON null value. By default, fields with empty
  24860. // values are omitted from API requests. However, any field with an
  24861. // empty value appearing in NullFields will be sent to the server as
  24862. // null. It is an error if a field in this list has a non-empty value.
  24863. // This may be used to include null fields in Patch requests.
  24864. NullFields []string `json:"-"`
  24865. }
  24866. func (s *UrlMapList) MarshalJSON() ([]byte, error) {
  24867. type NoMethod UrlMapList
  24868. raw := NoMethod(*s)
  24869. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  24870. }
  24871. // UrlMapListWarning: [Output Only] Informational warning message.
  24872. type UrlMapListWarning struct {
  24873. // Code: [Output Only] A warning code, if applicable. For example,
  24874. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  24875. // the response.
  24876. //
  24877. // Possible values:
  24878. // "CLEANUP_FAILED"
  24879. // "DEPRECATED_RESOURCE_USED"
  24880. // "DEPRECATED_TYPE_USED"
  24881. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  24882. // "EXPERIMENTAL_TYPE_USED"
  24883. // "EXTERNAL_API_WARNING"
  24884. // "FIELD_VALUE_OVERRIDEN"
  24885. // "INJECTED_KERNELS_DEPRECATED"
  24886. // "MISSING_TYPE_DEPENDENCY"
  24887. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  24888. // "NEXT_HOP_CANNOT_IP_FORWARD"
  24889. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  24890. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  24891. // "NEXT_HOP_NOT_RUNNING"
  24892. // "NOT_CRITICAL_ERROR"
  24893. // "NO_RESULTS_ON_PAGE"
  24894. // "REQUIRED_TOS_AGREEMENT"
  24895. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  24896. // "RESOURCE_NOT_DELETED"
  24897. // "SCHEMA_VALIDATION_IGNORED"
  24898. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  24899. // "UNDECLARED_PROPERTIES"
  24900. // "UNREACHABLE"
  24901. Code string `json:"code,omitempty"`
  24902. // Data: [Output Only] Metadata about this warning in key: value format.
  24903. // For example:
  24904. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  24905. Data []*UrlMapListWarningData `json:"data,omitempty"`
  24906. // Message: [Output Only] A human-readable description of the warning
  24907. // code.
  24908. Message string `json:"message,omitempty"`
  24909. // ForceSendFields is a list of field names (e.g. "Code") to
  24910. // unconditionally include in API requests. By default, fields with
  24911. // empty values are omitted from API requests. However, any non-pointer,
  24912. // non-interface field appearing in ForceSendFields will be sent to the
  24913. // server regardless of whether the field is empty or not. This may be
  24914. // used to include empty fields in Patch requests.
  24915. ForceSendFields []string `json:"-"`
  24916. // NullFields is a list of field names (e.g. "Code") to include in API
  24917. // requests with the JSON null value. By default, fields with empty
  24918. // values are omitted from API requests. However, any field with an
  24919. // empty value appearing in NullFields will be sent to the server as
  24920. // null. It is an error if a field in this list has a non-empty value.
  24921. // This may be used to include null fields in Patch requests.
  24922. NullFields []string `json:"-"`
  24923. }
  24924. func (s *UrlMapListWarning) MarshalJSON() ([]byte, error) {
  24925. type NoMethod UrlMapListWarning
  24926. raw := NoMethod(*s)
  24927. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  24928. }
  24929. type UrlMapListWarningData struct {
  24930. // Key: [Output Only] A key that provides more detail on the warning
  24931. // being returned. For example, for warnings where there are no results
  24932. // in a list request for a particular zone, this key might be scope and
  24933. // the key value might be the zone name. Other examples might be a key
  24934. // indicating a deprecated resource and a suggested replacement, or a
  24935. // warning about invalid network settings (for example, if an instance
  24936. // attempts to perform IP forwarding but is not enabled for IP
  24937. // forwarding).
  24938. Key string `json:"key,omitempty"`
  24939. // Value: [Output Only] A warning data value corresponding to the key.
  24940. Value string `json:"value,omitempty"`
  24941. // ForceSendFields is a list of field names (e.g. "Key") to
  24942. // unconditionally include in API requests. By default, fields with
  24943. // empty values are omitted from API requests. However, any non-pointer,
  24944. // non-interface field appearing in ForceSendFields will be sent to the
  24945. // server regardless of whether the field is empty or not. This may be
  24946. // used to include empty fields in Patch requests.
  24947. ForceSendFields []string `json:"-"`
  24948. // NullFields is a list of field names (e.g. "Key") to include in API
  24949. // requests with the JSON null value. By default, fields with empty
  24950. // values are omitted from API requests. However, any field with an
  24951. // empty value appearing in NullFields will be sent to the server as
  24952. // null. It is an error if a field in this list has a non-empty value.
  24953. // This may be used to include null fields in Patch requests.
  24954. NullFields []string `json:"-"`
  24955. }
  24956. func (s *UrlMapListWarningData) MarshalJSON() ([]byte, error) {
  24957. type NoMethod UrlMapListWarningData
  24958. raw := NoMethod(*s)
  24959. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  24960. }
  24961. type UrlMapReference struct {
  24962. UrlMap string `json:"urlMap,omitempty"`
  24963. // ForceSendFields is a list of field names (e.g. "UrlMap") to
  24964. // unconditionally include in API requests. By default, fields with
  24965. // empty values are omitted from API requests. However, any non-pointer,
  24966. // non-interface field appearing in ForceSendFields will be sent to the
  24967. // server regardless of whether the field is empty or not. This may be
  24968. // used to include empty fields in Patch requests.
  24969. ForceSendFields []string `json:"-"`
  24970. // NullFields is a list of field names (e.g. "UrlMap") to include in API
  24971. // requests with the JSON null value. By default, fields with empty
  24972. // values are omitted from API requests. However, any field with an
  24973. // empty value appearing in NullFields will be sent to the server as
  24974. // null. It is an error if a field in this list has a non-empty value.
  24975. // This may be used to include null fields in Patch requests.
  24976. NullFields []string `json:"-"`
  24977. }
  24978. func (s *UrlMapReference) MarshalJSON() ([]byte, error) {
  24979. type NoMethod UrlMapReference
  24980. raw := NoMethod(*s)
  24981. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  24982. }
  24983. // UrlMapTest: Message for the expected URL mappings.
  24984. type UrlMapTest struct {
  24985. // Description: Description of this test case.
  24986. Description string `json:"description,omitempty"`
  24987. // Host: Host portion of the URL.
  24988. Host string `json:"host,omitempty"`
  24989. // Path: Path portion of the URL.
  24990. Path string `json:"path,omitempty"`
  24991. // Service: Expected BackendService resource the given URL should be
  24992. // mapped to.
  24993. Service string `json:"service,omitempty"`
  24994. // ForceSendFields is a list of field names (e.g. "Description") to
  24995. // unconditionally include in API requests. By default, fields with
  24996. // empty values are omitted from API requests. However, any non-pointer,
  24997. // non-interface field appearing in ForceSendFields will be sent to the
  24998. // server regardless of whether the field is empty or not. This may be
  24999. // used to include empty fields in Patch requests.
  25000. ForceSendFields []string `json:"-"`
  25001. // NullFields is a list of field names (e.g. "Description") to include
  25002. // in API requests with the JSON null value. By default, fields with
  25003. // empty values are omitted from API requests. However, any field with
  25004. // an empty value appearing in NullFields will be sent to the server as
  25005. // null. It is an error if a field in this list has a non-empty value.
  25006. // This may be used to include null fields in Patch requests.
  25007. NullFields []string `json:"-"`
  25008. }
  25009. func (s *UrlMapTest) MarshalJSON() ([]byte, error) {
  25010. type NoMethod UrlMapTest
  25011. raw := NoMethod(*s)
  25012. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  25013. }
  25014. // UrlMapValidationResult: Message representing the validation result
  25015. // for a UrlMap.
  25016. type UrlMapValidationResult struct {
  25017. LoadErrors []string `json:"loadErrors,omitempty"`
  25018. // LoadSucceeded: Whether the given UrlMap can be successfully loaded.
  25019. // If false, 'loadErrors' indicates the reasons.
  25020. LoadSucceeded bool `json:"loadSucceeded,omitempty"`
  25021. TestFailures []*TestFailure `json:"testFailures,omitempty"`
  25022. // TestPassed: If successfully loaded, this field indicates whether the
  25023. // test passed. If false, 'testFailures's indicate the reason of
  25024. // failure.
  25025. TestPassed bool `json:"testPassed,omitempty"`
  25026. // ForceSendFields is a list of field names (e.g. "LoadErrors") to
  25027. // unconditionally include in API requests. By default, fields with
  25028. // empty values are omitted from API requests. However, any non-pointer,
  25029. // non-interface field appearing in ForceSendFields will be sent to the
  25030. // server regardless of whether the field is empty or not. This may be
  25031. // used to include empty fields in Patch requests.
  25032. ForceSendFields []string `json:"-"`
  25033. // NullFields is a list of field names (e.g. "LoadErrors") to include in
  25034. // API requests with the JSON null value. By default, fields with empty
  25035. // values are omitted from API requests. However, any field with an
  25036. // empty value appearing in NullFields will be sent to the server as
  25037. // null. It is an error if a field in this list has a non-empty value.
  25038. // This may be used to include null fields in Patch requests.
  25039. NullFields []string `json:"-"`
  25040. }
  25041. func (s *UrlMapValidationResult) MarshalJSON() ([]byte, error) {
  25042. type NoMethod UrlMapValidationResult
  25043. raw := NoMethod(*s)
  25044. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  25045. }
  25046. type UrlMapsValidateRequest struct {
  25047. // Resource: Content of the UrlMap to be validated.
  25048. Resource *UrlMap `json:"resource,omitempty"`
  25049. // ForceSendFields is a list of field names (e.g. "Resource") to
  25050. // unconditionally include in API requests. By default, fields with
  25051. // empty values are omitted from API requests. However, any non-pointer,
  25052. // non-interface field appearing in ForceSendFields will be sent to the
  25053. // server regardless of whether the field is empty or not. This may be
  25054. // used to include empty fields in Patch requests.
  25055. ForceSendFields []string `json:"-"`
  25056. // NullFields is a list of field names (e.g. "Resource") to include in
  25057. // API requests with the JSON null value. By default, fields with empty
  25058. // values are omitted from API requests. However, any field with an
  25059. // empty value appearing in NullFields will be sent to the server as
  25060. // null. It is an error if a field in this list has a non-empty value.
  25061. // This may be used to include null fields in Patch requests.
  25062. NullFields []string `json:"-"`
  25063. }
  25064. func (s *UrlMapsValidateRequest) MarshalJSON() ([]byte, error) {
  25065. type NoMethod UrlMapsValidateRequest
  25066. raw := NoMethod(*s)
  25067. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  25068. }
  25069. type UrlMapsValidateResponse struct {
  25070. Result *UrlMapValidationResult `json:"result,omitempty"`
  25071. // ServerResponse contains the HTTP response code and headers from the
  25072. // server.
  25073. googleapi.ServerResponse `json:"-"`
  25074. // ForceSendFields is a list of field names (e.g. "Result") to
  25075. // unconditionally include in API requests. By default, fields with
  25076. // empty values are omitted from API requests. However, any non-pointer,
  25077. // non-interface field appearing in ForceSendFields will be sent to the
  25078. // server regardless of whether the field is empty or not. This may be
  25079. // used to include empty fields in Patch requests.
  25080. ForceSendFields []string `json:"-"`
  25081. // NullFields is a list of field names (e.g. "Result") to include in API
  25082. // requests with the JSON null value. By default, fields with empty
  25083. // values are omitted from API requests. However, any field with an
  25084. // empty value appearing in NullFields will be sent to the server as
  25085. // null. It is an error if a field in this list has a non-empty value.
  25086. // This may be used to include null fields in Patch requests.
  25087. NullFields []string `json:"-"`
  25088. }
  25089. func (s *UrlMapsValidateResponse) MarshalJSON() ([]byte, error) {
  25090. type NoMethod UrlMapsValidateResponse
  25091. raw := NoMethod(*s)
  25092. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  25093. }
  25094. // UsableSubnetwork: Subnetwork which the current user has
  25095. // compute.subnetworks.use permission on.
  25096. type UsableSubnetwork struct {
  25097. // IpCidrRange: The range of internal addresses that are owned by this
  25098. // subnetwork.
  25099. IpCidrRange string `json:"ipCidrRange,omitempty"`
  25100. // Network: Network URL.
  25101. Network string `json:"network,omitempty"`
  25102. // SecondaryIpRanges: Secondary IP ranges.
  25103. SecondaryIpRanges []*UsableSubnetworkSecondaryRange `json:"secondaryIpRanges,omitempty"`
  25104. // Subnetwork: Subnetwork URL.
  25105. Subnetwork string `json:"subnetwork,omitempty"`
  25106. // ForceSendFields is a list of field names (e.g. "IpCidrRange") to
  25107. // unconditionally include in API requests. By default, fields with
  25108. // empty values are omitted from API requests. However, any non-pointer,
  25109. // non-interface field appearing in ForceSendFields will be sent to the
  25110. // server regardless of whether the field is empty or not. This may be
  25111. // used to include empty fields in Patch requests.
  25112. ForceSendFields []string `json:"-"`
  25113. // NullFields is a list of field names (e.g. "IpCidrRange") to include
  25114. // in API requests with the JSON null value. By default, fields with
  25115. // empty values are omitted from API requests. However, any field with
  25116. // an empty value appearing in NullFields will be sent to the server as
  25117. // null. It is an error if a field in this list has a non-empty value.
  25118. // This may be used to include null fields in Patch requests.
  25119. NullFields []string `json:"-"`
  25120. }
  25121. func (s *UsableSubnetwork) MarshalJSON() ([]byte, error) {
  25122. type NoMethod UsableSubnetwork
  25123. raw := NoMethod(*s)
  25124. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  25125. }
  25126. // UsableSubnetworkSecondaryRange: Secondary IP range of a usable
  25127. // subnetwork.
  25128. type UsableSubnetworkSecondaryRange struct {
  25129. // IpCidrRange: The range of IP addresses belonging to this subnetwork
  25130. // secondary range.
  25131. IpCidrRange string `json:"ipCidrRange,omitempty"`
  25132. // RangeName: The name associated with this subnetwork secondary range,
  25133. // used when adding an alias IP range to a VM instance. The name must be
  25134. // 1-63 characters long, and comply with RFC1035. The name must be
  25135. // unique within the subnetwork.
  25136. RangeName string `json:"rangeName,omitempty"`
  25137. // ForceSendFields is a list of field names (e.g. "IpCidrRange") to
  25138. // unconditionally include in API requests. By default, fields with
  25139. // empty values are omitted from API requests. However, any non-pointer,
  25140. // non-interface field appearing in ForceSendFields will be sent to the
  25141. // server regardless of whether the field is empty or not. This may be
  25142. // used to include empty fields in Patch requests.
  25143. ForceSendFields []string `json:"-"`
  25144. // NullFields is a list of field names (e.g. "IpCidrRange") to include
  25145. // in API requests with the JSON null value. By default, fields with
  25146. // empty values are omitted from API requests. However, any field with
  25147. // an empty value appearing in NullFields will be sent to the server as
  25148. // null. It is an error if a field in this list has a non-empty value.
  25149. // This may be used to include null fields in Patch requests.
  25150. NullFields []string `json:"-"`
  25151. }
  25152. func (s *UsableSubnetworkSecondaryRange) MarshalJSON() ([]byte, error) {
  25153. type NoMethod UsableSubnetworkSecondaryRange
  25154. raw := NoMethod(*s)
  25155. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  25156. }
  25157. type UsableSubnetworksAggregatedList struct {
  25158. // Id: [Output Only] The unique identifier for the resource. This
  25159. // identifier is defined by the server.
  25160. Id string `json:"id,omitempty"`
  25161. // Items: [Output] A list of usable subnetwork URLs.
  25162. Items []*UsableSubnetwork `json:"items,omitempty"`
  25163. // Kind: [Output Only] Type of resource. Always
  25164. // compute#usableSubnetworksAggregatedList for aggregated lists of
  25165. // usable subnetworks.
  25166. Kind string `json:"kind,omitempty"`
  25167. // NextPageToken: [Output Only] This token allows you to get the next
  25168. // page of results for list requests. If the number of results is larger
  25169. // than maxResults, use the nextPageToken as a value for the query
  25170. // parameter pageToken in the next list request. Subsequent list
  25171. // requests will have their own nextPageToken to continue paging through
  25172. // the results.
  25173. NextPageToken string `json:"nextPageToken,omitempty"`
  25174. // SelfLink: [Output Only] Server-defined URL for this resource.
  25175. SelfLink string `json:"selfLink,omitempty"`
  25176. // Warning: [Output Only] Informational warning message.
  25177. Warning *UsableSubnetworksAggregatedListWarning `json:"warning,omitempty"`
  25178. // ServerResponse contains the HTTP response code and headers from the
  25179. // server.
  25180. googleapi.ServerResponse `json:"-"`
  25181. // ForceSendFields is a list of field names (e.g. "Id") to
  25182. // unconditionally include in API requests. By default, fields with
  25183. // empty values are omitted from API requests. However, any non-pointer,
  25184. // non-interface field appearing in ForceSendFields will be sent to the
  25185. // server regardless of whether the field is empty or not. This may be
  25186. // used to include empty fields in Patch requests.
  25187. ForceSendFields []string `json:"-"`
  25188. // NullFields is a list of field names (e.g. "Id") to include in API
  25189. // requests with the JSON null value. By default, fields with empty
  25190. // values are omitted from API requests. However, any field with an
  25191. // empty value appearing in NullFields will be sent to the server as
  25192. // null. It is an error if a field in this list has a non-empty value.
  25193. // This may be used to include null fields in Patch requests.
  25194. NullFields []string `json:"-"`
  25195. }
  25196. func (s *UsableSubnetworksAggregatedList) MarshalJSON() ([]byte, error) {
  25197. type NoMethod UsableSubnetworksAggregatedList
  25198. raw := NoMethod(*s)
  25199. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  25200. }
  25201. // UsableSubnetworksAggregatedListWarning: [Output Only] Informational
  25202. // warning message.
  25203. type UsableSubnetworksAggregatedListWarning struct {
  25204. // Code: [Output Only] A warning code, if applicable. For example,
  25205. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  25206. // the response.
  25207. //
  25208. // Possible values:
  25209. // "CLEANUP_FAILED"
  25210. // "DEPRECATED_RESOURCE_USED"
  25211. // "DEPRECATED_TYPE_USED"
  25212. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  25213. // "EXPERIMENTAL_TYPE_USED"
  25214. // "EXTERNAL_API_WARNING"
  25215. // "FIELD_VALUE_OVERRIDEN"
  25216. // "INJECTED_KERNELS_DEPRECATED"
  25217. // "MISSING_TYPE_DEPENDENCY"
  25218. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  25219. // "NEXT_HOP_CANNOT_IP_FORWARD"
  25220. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  25221. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  25222. // "NEXT_HOP_NOT_RUNNING"
  25223. // "NOT_CRITICAL_ERROR"
  25224. // "NO_RESULTS_ON_PAGE"
  25225. // "REQUIRED_TOS_AGREEMENT"
  25226. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  25227. // "RESOURCE_NOT_DELETED"
  25228. // "SCHEMA_VALIDATION_IGNORED"
  25229. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  25230. // "UNDECLARED_PROPERTIES"
  25231. // "UNREACHABLE"
  25232. Code string `json:"code,omitempty"`
  25233. // Data: [Output Only] Metadata about this warning in key: value format.
  25234. // For example:
  25235. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  25236. Data []*UsableSubnetworksAggregatedListWarningData `json:"data,omitempty"`
  25237. // Message: [Output Only] A human-readable description of the warning
  25238. // code.
  25239. Message string `json:"message,omitempty"`
  25240. // ForceSendFields is a list of field names (e.g. "Code") to
  25241. // unconditionally include in API requests. By default, fields with
  25242. // empty values are omitted from API requests. However, any non-pointer,
  25243. // non-interface field appearing in ForceSendFields will be sent to the
  25244. // server regardless of whether the field is empty or not. This may be
  25245. // used to include empty fields in Patch requests.
  25246. ForceSendFields []string `json:"-"`
  25247. // NullFields is a list of field names (e.g. "Code") to include in API
  25248. // requests with the JSON null value. By default, fields with empty
  25249. // values are omitted from API requests. However, any field with an
  25250. // empty value appearing in NullFields will be sent to the server as
  25251. // null. It is an error if a field in this list has a non-empty value.
  25252. // This may be used to include null fields in Patch requests.
  25253. NullFields []string `json:"-"`
  25254. }
  25255. func (s *UsableSubnetworksAggregatedListWarning) MarshalJSON() ([]byte, error) {
  25256. type NoMethod UsableSubnetworksAggregatedListWarning
  25257. raw := NoMethod(*s)
  25258. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  25259. }
  25260. type UsableSubnetworksAggregatedListWarningData struct {
  25261. // Key: [Output Only] A key that provides more detail on the warning
  25262. // being returned. For example, for warnings where there are no results
  25263. // in a list request for a particular zone, this key might be scope and
  25264. // the key value might be the zone name. Other examples might be a key
  25265. // indicating a deprecated resource and a suggested replacement, or a
  25266. // warning about invalid network settings (for example, if an instance
  25267. // attempts to perform IP forwarding but is not enabled for IP
  25268. // forwarding).
  25269. Key string `json:"key,omitempty"`
  25270. // Value: [Output Only] A warning data value corresponding to the key.
  25271. Value string `json:"value,omitempty"`
  25272. // ForceSendFields is a list of field names (e.g. "Key") to
  25273. // unconditionally include in API requests. By default, fields with
  25274. // empty values are omitted from API requests. However, any non-pointer,
  25275. // non-interface field appearing in ForceSendFields will be sent to the
  25276. // server regardless of whether the field is empty or not. This may be
  25277. // used to include empty fields in Patch requests.
  25278. ForceSendFields []string `json:"-"`
  25279. // NullFields is a list of field names (e.g. "Key") to include in API
  25280. // requests with the JSON null value. By default, fields with empty
  25281. // values are omitted from API requests. However, any field with an
  25282. // empty value appearing in NullFields will be sent to the server as
  25283. // null. It is an error if a field in this list has a non-empty value.
  25284. // This may be used to include null fields in Patch requests.
  25285. NullFields []string `json:"-"`
  25286. }
  25287. func (s *UsableSubnetworksAggregatedListWarningData) MarshalJSON() ([]byte, error) {
  25288. type NoMethod UsableSubnetworksAggregatedListWarningData
  25289. raw := NoMethod(*s)
  25290. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  25291. }
  25292. // UsageExportLocation: The location in Cloud Storage and naming method
  25293. // of the daily usage report. Contains bucket_name and report_name
  25294. // prefix.
  25295. type UsageExportLocation struct {
  25296. // BucketName: The name of an existing bucket in Cloud Storage where the
  25297. // usage report object is stored. The Google Service Account is granted
  25298. // write access to this bucket. This can either be the bucket name by
  25299. // itself, such as example-bucket, or the bucket name with gs:// or
  25300. // https://storage.googleapis.com/ in front of it, such as
  25301. // gs://example-bucket.
  25302. BucketName string `json:"bucketName,omitempty"`
  25303. // ReportNamePrefix: An optional prefix for the name of the usage report
  25304. // object stored in bucketName. If not supplied, defaults to usage. The
  25305. // report is stored as a CSV file named
  25306. // report_name_prefix_gce_YYYYMMDD.csv where YYYYMMDD is the day of the
  25307. // usage according to Pacific Time. If you supply a prefix, it should
  25308. // conform to Cloud Storage object naming conventions.
  25309. ReportNamePrefix string `json:"reportNamePrefix,omitempty"`
  25310. // ForceSendFields is a list of field names (e.g. "BucketName") to
  25311. // unconditionally include in API requests. By default, fields with
  25312. // empty values are omitted from API requests. However, any non-pointer,
  25313. // non-interface field appearing in ForceSendFields will be sent to the
  25314. // server regardless of whether the field is empty or not. This may be
  25315. // used to include empty fields in Patch requests.
  25316. ForceSendFields []string `json:"-"`
  25317. // NullFields is a list of field names (e.g. "BucketName") to include in
  25318. // API requests with the JSON null value. By default, fields with empty
  25319. // values are omitted from API requests. However, any field with an
  25320. // empty value appearing in NullFields will be sent to the server as
  25321. // null. It is an error if a field in this list has a non-empty value.
  25322. // This may be used to include null fields in Patch requests.
  25323. NullFields []string `json:"-"`
  25324. }
  25325. func (s *UsageExportLocation) MarshalJSON() ([]byte, error) {
  25326. type NoMethod UsageExportLocation
  25327. raw := NoMethod(*s)
  25328. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  25329. }
  25330. // VpnTunnel: VPN tunnel resource. (== resource_for beta.vpnTunnels ==)
  25331. // (== resource_for v1.vpnTunnels ==)
  25332. type VpnTunnel struct {
  25333. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  25334. // format.
  25335. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  25336. // Description: An optional description of this resource. Provide this
  25337. // property when you create the resource.
  25338. Description string `json:"description,omitempty"`
  25339. // DetailedStatus: [Output Only] Detailed status message for the VPN
  25340. // tunnel.
  25341. DetailedStatus string `json:"detailedStatus,omitempty"`
  25342. // Id: [Output Only] The unique identifier for the resource. This
  25343. // identifier is defined by the server.
  25344. Id uint64 `json:"id,omitempty,string"`
  25345. // IkeVersion: IKE protocol version to use when establishing the VPN
  25346. // tunnel with peer VPN gateway. Acceptable IKE versions are 1 or 2.
  25347. // Default version is 2.
  25348. IkeVersion int64 `json:"ikeVersion,omitempty"`
  25349. // Kind: [Output Only] Type of resource. Always compute#vpnTunnel for
  25350. // VPN tunnels.
  25351. Kind string `json:"kind,omitempty"`
  25352. // LabelFingerprint: A fingerprint for the labels being applied to this
  25353. // VpnTunnel, which is essentially a hash of the labels set used for
  25354. // optimistic locking. The fingerprint is initially generated by Compute
  25355. // Engine and changes after every request to modify or update labels.
  25356. // You must always provide an up-to-date fingerprint hash in order to
  25357. // update or change labels.
  25358. //
  25359. // To see the latest fingerprint, make a get() request to retrieve a
  25360. // VpnTunnel.
  25361. LabelFingerprint string `json:"labelFingerprint,omitempty"`
  25362. // Labels: Labels to apply to this VpnTunnel. These can be later
  25363. // modified by the setLabels method. Each label key/value pair must
  25364. // comply with RFC1035. Label values may be empty.
  25365. Labels map[string]string `json:"labels,omitempty"`
  25366. // LocalTrafficSelector: Local traffic selector to use when establishing
  25367. // the VPN tunnel with peer VPN gateway. The value should be a CIDR
  25368. // formatted string, for example: 192.168.0.0/16. The ranges should be
  25369. // disjoint. Only IPv4 is supported.
  25370. LocalTrafficSelector []string `json:"localTrafficSelector,omitempty"`
  25371. // Name: Name of the resource. Provided by the client when the resource
  25372. // is created. The name must be 1-63 characters long, and comply with
  25373. // RFC1035. Specifically, the name must be 1-63 characters long and
  25374. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  25375. // the first character must be a lowercase letter, and all following
  25376. // characters must be a dash, lowercase letter, or digit, except the
  25377. // last character, which cannot be a dash.
  25378. Name string `json:"name,omitempty"`
  25379. // PeerIp: IP address of the peer VPN gateway. Only IPv4 is supported.
  25380. PeerIp string `json:"peerIp,omitempty"`
  25381. // Region: [Output Only] URL of the region where the VPN tunnel resides.
  25382. // You must specify this field as part of the HTTP request URL. It is
  25383. // not settable as a field in the request body.
  25384. Region string `json:"region,omitempty"`
  25385. // RemoteTrafficSelector: Remote traffic selectors to use when
  25386. // establishing the VPN tunnel with peer VPN gateway. The value should
  25387. // be a CIDR formatted string, for example: 192.168.0.0/16. The ranges
  25388. // should be disjoint. Only IPv4 is supported.
  25389. RemoteTrafficSelector []string `json:"remoteTrafficSelector,omitempty"`
  25390. // Router: URL of router resource to be used for dynamic routing.
  25391. Router string `json:"router,omitempty"`
  25392. // SelfLink: [Output Only] Server-defined URL for the resource.
  25393. SelfLink string `json:"selfLink,omitempty"`
  25394. // SharedSecret: Shared secret used to set the secure session between
  25395. // the Cloud VPN gateway and the peer VPN gateway.
  25396. SharedSecret string `json:"sharedSecret,omitempty"`
  25397. // SharedSecretHash: Hash of the shared secret.
  25398. SharedSecretHash string `json:"sharedSecretHash,omitempty"`
  25399. // Status: [Output Only] The status of the VPN tunnel.
  25400. //
  25401. // Possible values:
  25402. // "ALLOCATING_RESOURCES"
  25403. // "AUTHORIZATION_ERROR"
  25404. // "DEPROVISIONING"
  25405. // "ESTABLISHED"
  25406. // "FAILED"
  25407. // "FIRST_HANDSHAKE"
  25408. // "NEGOTIATION_FAILURE"
  25409. // "NETWORK_ERROR"
  25410. // "NO_INCOMING_PACKETS"
  25411. // "PROVISIONING"
  25412. // "REJECTED"
  25413. // "WAITING_FOR_FULL_CONFIG"
  25414. Status string `json:"status,omitempty"`
  25415. // TargetVpnGateway: URL of the Target VPN gateway with which this VPN
  25416. // tunnel is associated. Provided by the client when the VPN tunnel is
  25417. // created.
  25418. TargetVpnGateway string `json:"targetVpnGateway,omitempty"`
  25419. // ServerResponse contains the HTTP response code and headers from the
  25420. // server.
  25421. googleapi.ServerResponse `json:"-"`
  25422. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  25423. // to unconditionally include in API requests. By default, fields with
  25424. // empty values are omitted from API requests. However, any non-pointer,
  25425. // non-interface field appearing in ForceSendFields will be sent to the
  25426. // server regardless of whether the field is empty or not. This may be
  25427. // used to include empty fields in Patch requests.
  25428. ForceSendFields []string `json:"-"`
  25429. // NullFields is a list of field names (e.g. "CreationTimestamp") to
  25430. // include in API requests with the JSON null value. By default, fields
  25431. // with empty values are omitted from API requests. However, any field
  25432. // with an empty value appearing in NullFields will be sent to the
  25433. // server as null. It is an error if a field in this list has a
  25434. // non-empty value. This may be used to include null fields in Patch
  25435. // requests.
  25436. NullFields []string `json:"-"`
  25437. }
  25438. func (s *VpnTunnel) MarshalJSON() ([]byte, error) {
  25439. type NoMethod VpnTunnel
  25440. raw := NoMethod(*s)
  25441. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  25442. }
  25443. type VpnTunnelAggregatedList struct {
  25444. // Id: [Output Only] Unique identifier for the resource; defined by the
  25445. // server.
  25446. Id string `json:"id,omitempty"`
  25447. // Items: A list of VpnTunnelsScopedList resources.
  25448. Items map[string]VpnTunnelsScopedList `json:"items,omitempty"`
  25449. // Kind: [Output Only] Type of resource. Always compute#vpnTunnel for
  25450. // VPN tunnels.
  25451. Kind string `json:"kind,omitempty"`
  25452. // NextPageToken: [Output Only] This token allows you to get the next
  25453. // page of results for list requests. If the number of results is larger
  25454. // than maxResults, use the nextPageToken as a value for the query
  25455. // parameter pageToken in the next list request. Subsequent list
  25456. // requests will have their own nextPageToken to continue paging through
  25457. // the results.
  25458. NextPageToken string `json:"nextPageToken,omitempty"`
  25459. // SelfLink: [Output Only] Server-defined URL for this resource.
  25460. SelfLink string `json:"selfLink,omitempty"`
  25461. // Warning: [Output Only] Informational warning message.
  25462. Warning *VpnTunnelAggregatedListWarning `json:"warning,omitempty"`
  25463. // ServerResponse contains the HTTP response code and headers from the
  25464. // server.
  25465. googleapi.ServerResponse `json:"-"`
  25466. // ForceSendFields is a list of field names (e.g. "Id") to
  25467. // unconditionally include in API requests. By default, fields with
  25468. // empty values are omitted from API requests. However, any non-pointer,
  25469. // non-interface field appearing in ForceSendFields will be sent to the
  25470. // server regardless of whether the field is empty or not. This may be
  25471. // used to include empty fields in Patch requests.
  25472. ForceSendFields []string `json:"-"`
  25473. // NullFields is a list of field names (e.g. "Id") to include in API
  25474. // requests with the JSON null value. By default, fields with empty
  25475. // values are omitted from API requests. However, any field with an
  25476. // empty value appearing in NullFields will be sent to the server as
  25477. // null. It is an error if a field in this list has a non-empty value.
  25478. // This may be used to include null fields in Patch requests.
  25479. NullFields []string `json:"-"`
  25480. }
  25481. func (s *VpnTunnelAggregatedList) MarshalJSON() ([]byte, error) {
  25482. type NoMethod VpnTunnelAggregatedList
  25483. raw := NoMethod(*s)
  25484. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  25485. }
  25486. // VpnTunnelAggregatedListWarning: [Output Only] Informational warning
  25487. // message.
  25488. type VpnTunnelAggregatedListWarning struct {
  25489. // Code: [Output Only] A warning code, if applicable. For example,
  25490. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  25491. // the response.
  25492. //
  25493. // Possible values:
  25494. // "CLEANUP_FAILED"
  25495. // "DEPRECATED_RESOURCE_USED"
  25496. // "DEPRECATED_TYPE_USED"
  25497. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  25498. // "EXPERIMENTAL_TYPE_USED"
  25499. // "EXTERNAL_API_WARNING"
  25500. // "FIELD_VALUE_OVERRIDEN"
  25501. // "INJECTED_KERNELS_DEPRECATED"
  25502. // "MISSING_TYPE_DEPENDENCY"
  25503. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  25504. // "NEXT_HOP_CANNOT_IP_FORWARD"
  25505. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  25506. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  25507. // "NEXT_HOP_NOT_RUNNING"
  25508. // "NOT_CRITICAL_ERROR"
  25509. // "NO_RESULTS_ON_PAGE"
  25510. // "REQUIRED_TOS_AGREEMENT"
  25511. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  25512. // "RESOURCE_NOT_DELETED"
  25513. // "SCHEMA_VALIDATION_IGNORED"
  25514. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  25515. // "UNDECLARED_PROPERTIES"
  25516. // "UNREACHABLE"
  25517. Code string `json:"code,omitempty"`
  25518. // Data: [Output Only] Metadata about this warning in key: value format.
  25519. // For example:
  25520. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  25521. Data []*VpnTunnelAggregatedListWarningData `json:"data,omitempty"`
  25522. // Message: [Output Only] A human-readable description of the warning
  25523. // code.
  25524. Message string `json:"message,omitempty"`
  25525. // ForceSendFields is a list of field names (e.g. "Code") to
  25526. // unconditionally include in API requests. By default, fields with
  25527. // empty values are omitted from API requests. However, any non-pointer,
  25528. // non-interface field appearing in ForceSendFields will be sent to the
  25529. // server regardless of whether the field is empty or not. This may be
  25530. // used to include empty fields in Patch requests.
  25531. ForceSendFields []string `json:"-"`
  25532. // NullFields is a list of field names (e.g. "Code") to include in API
  25533. // requests with the JSON null value. By default, fields with empty
  25534. // values are omitted from API requests. However, any field with an
  25535. // empty value appearing in NullFields will be sent to the server as
  25536. // null. It is an error if a field in this list has a non-empty value.
  25537. // This may be used to include null fields in Patch requests.
  25538. NullFields []string `json:"-"`
  25539. }
  25540. func (s *VpnTunnelAggregatedListWarning) MarshalJSON() ([]byte, error) {
  25541. type NoMethod VpnTunnelAggregatedListWarning
  25542. raw := NoMethod(*s)
  25543. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  25544. }
  25545. type VpnTunnelAggregatedListWarningData struct {
  25546. // Key: [Output Only] A key that provides more detail on the warning
  25547. // being returned. For example, for warnings where there are no results
  25548. // in a list request for a particular zone, this key might be scope and
  25549. // the key value might be the zone name. Other examples might be a key
  25550. // indicating a deprecated resource and a suggested replacement, or a
  25551. // warning about invalid network settings (for example, if an instance
  25552. // attempts to perform IP forwarding but is not enabled for IP
  25553. // forwarding).
  25554. Key string `json:"key,omitempty"`
  25555. // Value: [Output Only] A warning data value corresponding to the key.
  25556. Value string `json:"value,omitempty"`
  25557. // ForceSendFields is a list of field names (e.g. "Key") to
  25558. // unconditionally include in API requests. By default, fields with
  25559. // empty values are omitted from API requests. However, any non-pointer,
  25560. // non-interface field appearing in ForceSendFields will be sent to the
  25561. // server regardless of whether the field is empty or not. This may be
  25562. // used to include empty fields in Patch requests.
  25563. ForceSendFields []string `json:"-"`
  25564. // NullFields is a list of field names (e.g. "Key") to include in API
  25565. // requests with the JSON null value. By default, fields with empty
  25566. // values are omitted from API requests. However, any field with an
  25567. // empty value appearing in NullFields will be sent to the server as
  25568. // null. It is an error if a field in this list has a non-empty value.
  25569. // This may be used to include null fields in Patch requests.
  25570. NullFields []string `json:"-"`
  25571. }
  25572. func (s *VpnTunnelAggregatedListWarningData) MarshalJSON() ([]byte, error) {
  25573. type NoMethod VpnTunnelAggregatedListWarningData
  25574. raw := NoMethod(*s)
  25575. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  25576. }
  25577. // VpnTunnelList: Contains a list of VpnTunnel resources.
  25578. type VpnTunnelList struct {
  25579. // Id: [Output Only] Unique identifier for the resource; defined by the
  25580. // server.
  25581. Id string `json:"id,omitempty"`
  25582. // Items: A list of VpnTunnel resources.
  25583. Items []*VpnTunnel `json:"items,omitempty"`
  25584. // Kind: [Output Only] Type of resource. Always compute#vpnTunnel for
  25585. // VPN tunnels.
  25586. Kind string `json:"kind,omitempty"`
  25587. // NextPageToken: [Output Only] This token allows you to get the next
  25588. // page of results for list requests. If the number of results is larger
  25589. // than maxResults, use the nextPageToken as a value for the query
  25590. // parameter pageToken in the next list request. Subsequent list
  25591. // requests will have their own nextPageToken to continue paging through
  25592. // the results.
  25593. NextPageToken string `json:"nextPageToken,omitempty"`
  25594. // SelfLink: [Output Only] Server-defined URL for this resource.
  25595. SelfLink string `json:"selfLink,omitempty"`
  25596. // Warning: [Output Only] Informational warning message.
  25597. Warning *VpnTunnelListWarning `json:"warning,omitempty"`
  25598. // ServerResponse contains the HTTP response code and headers from the
  25599. // server.
  25600. googleapi.ServerResponse `json:"-"`
  25601. // ForceSendFields is a list of field names (e.g. "Id") to
  25602. // unconditionally include in API requests. By default, fields with
  25603. // empty values are omitted from API requests. However, any non-pointer,
  25604. // non-interface field appearing in ForceSendFields will be sent to the
  25605. // server regardless of whether the field is empty or not. This may be
  25606. // used to include empty fields in Patch requests.
  25607. ForceSendFields []string `json:"-"`
  25608. // NullFields is a list of field names (e.g. "Id") to include in API
  25609. // requests with the JSON null value. By default, fields with empty
  25610. // values are omitted from API requests. However, any field with an
  25611. // empty value appearing in NullFields will be sent to the server as
  25612. // null. It is an error if a field in this list has a non-empty value.
  25613. // This may be used to include null fields in Patch requests.
  25614. NullFields []string `json:"-"`
  25615. }
  25616. func (s *VpnTunnelList) MarshalJSON() ([]byte, error) {
  25617. type NoMethod VpnTunnelList
  25618. raw := NoMethod(*s)
  25619. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  25620. }
  25621. // VpnTunnelListWarning: [Output Only] Informational warning message.
  25622. type VpnTunnelListWarning struct {
  25623. // Code: [Output Only] A warning code, if applicable. For example,
  25624. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  25625. // the response.
  25626. //
  25627. // Possible values:
  25628. // "CLEANUP_FAILED"
  25629. // "DEPRECATED_RESOURCE_USED"
  25630. // "DEPRECATED_TYPE_USED"
  25631. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  25632. // "EXPERIMENTAL_TYPE_USED"
  25633. // "EXTERNAL_API_WARNING"
  25634. // "FIELD_VALUE_OVERRIDEN"
  25635. // "INJECTED_KERNELS_DEPRECATED"
  25636. // "MISSING_TYPE_DEPENDENCY"
  25637. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  25638. // "NEXT_HOP_CANNOT_IP_FORWARD"
  25639. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  25640. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  25641. // "NEXT_HOP_NOT_RUNNING"
  25642. // "NOT_CRITICAL_ERROR"
  25643. // "NO_RESULTS_ON_PAGE"
  25644. // "REQUIRED_TOS_AGREEMENT"
  25645. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  25646. // "RESOURCE_NOT_DELETED"
  25647. // "SCHEMA_VALIDATION_IGNORED"
  25648. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  25649. // "UNDECLARED_PROPERTIES"
  25650. // "UNREACHABLE"
  25651. Code string `json:"code,omitempty"`
  25652. // Data: [Output Only] Metadata about this warning in key: value format.
  25653. // For example:
  25654. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  25655. Data []*VpnTunnelListWarningData `json:"data,omitempty"`
  25656. // Message: [Output Only] A human-readable description of the warning
  25657. // code.
  25658. Message string `json:"message,omitempty"`
  25659. // ForceSendFields is a list of field names (e.g. "Code") to
  25660. // unconditionally include in API requests. By default, fields with
  25661. // empty values are omitted from API requests. However, any non-pointer,
  25662. // non-interface field appearing in ForceSendFields will be sent to the
  25663. // server regardless of whether the field is empty or not. This may be
  25664. // used to include empty fields in Patch requests.
  25665. ForceSendFields []string `json:"-"`
  25666. // NullFields is a list of field names (e.g. "Code") to include in API
  25667. // requests with the JSON null value. By default, fields with empty
  25668. // values are omitted from API requests. However, any field with an
  25669. // empty value appearing in NullFields will be sent to the server as
  25670. // null. It is an error if a field in this list has a non-empty value.
  25671. // This may be used to include null fields in Patch requests.
  25672. NullFields []string `json:"-"`
  25673. }
  25674. func (s *VpnTunnelListWarning) MarshalJSON() ([]byte, error) {
  25675. type NoMethod VpnTunnelListWarning
  25676. raw := NoMethod(*s)
  25677. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  25678. }
  25679. type VpnTunnelListWarningData struct {
  25680. // Key: [Output Only] A key that provides more detail on the warning
  25681. // being returned. For example, for warnings where there are no results
  25682. // in a list request for a particular zone, this key might be scope and
  25683. // the key value might be the zone name. Other examples might be a key
  25684. // indicating a deprecated resource and a suggested replacement, or a
  25685. // warning about invalid network settings (for example, if an instance
  25686. // attempts to perform IP forwarding but is not enabled for IP
  25687. // forwarding).
  25688. Key string `json:"key,omitempty"`
  25689. // Value: [Output Only] A warning data value corresponding to the key.
  25690. Value string `json:"value,omitempty"`
  25691. // ForceSendFields is a list of field names (e.g. "Key") to
  25692. // unconditionally include in API requests. By default, fields with
  25693. // empty values are omitted from API requests. However, any non-pointer,
  25694. // non-interface field appearing in ForceSendFields will be sent to the
  25695. // server regardless of whether the field is empty or not. This may be
  25696. // used to include empty fields in Patch requests.
  25697. ForceSendFields []string `json:"-"`
  25698. // NullFields is a list of field names (e.g. "Key") to include in API
  25699. // requests with the JSON null value. By default, fields with empty
  25700. // values are omitted from API requests. However, any field with an
  25701. // empty value appearing in NullFields will be sent to the server as
  25702. // null. It is an error if a field in this list has a non-empty value.
  25703. // This may be used to include null fields in Patch requests.
  25704. NullFields []string `json:"-"`
  25705. }
  25706. func (s *VpnTunnelListWarningData) MarshalJSON() ([]byte, error) {
  25707. type NoMethod VpnTunnelListWarningData
  25708. raw := NoMethod(*s)
  25709. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  25710. }
  25711. type VpnTunnelsScopedList struct {
  25712. // VpnTunnels: A list of vpn tunnels contained in this scope.
  25713. VpnTunnels []*VpnTunnel `json:"vpnTunnels,omitempty"`
  25714. // Warning: Informational warning which replaces the list of addresses
  25715. // when the list is empty.
  25716. Warning *VpnTunnelsScopedListWarning `json:"warning,omitempty"`
  25717. // ForceSendFields is a list of field names (e.g. "VpnTunnels") to
  25718. // unconditionally include in API requests. By default, fields with
  25719. // empty values are omitted from API requests. However, any non-pointer,
  25720. // non-interface field appearing in ForceSendFields will be sent to the
  25721. // server regardless of whether the field is empty or not. This may be
  25722. // used to include empty fields in Patch requests.
  25723. ForceSendFields []string `json:"-"`
  25724. // NullFields is a list of field names (e.g. "VpnTunnels") to include in
  25725. // API requests with the JSON null value. By default, fields with empty
  25726. // values are omitted from API requests. However, any field with an
  25727. // empty value appearing in NullFields will be sent to the server as
  25728. // null. It is an error if a field in this list has a non-empty value.
  25729. // This may be used to include null fields in Patch requests.
  25730. NullFields []string `json:"-"`
  25731. }
  25732. func (s *VpnTunnelsScopedList) MarshalJSON() ([]byte, error) {
  25733. type NoMethod VpnTunnelsScopedList
  25734. raw := NoMethod(*s)
  25735. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  25736. }
  25737. // VpnTunnelsScopedListWarning: Informational warning which replaces the
  25738. // list of addresses when the list is empty.
  25739. type VpnTunnelsScopedListWarning struct {
  25740. // Code: [Output Only] A warning code, if applicable. For example,
  25741. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  25742. // the response.
  25743. //
  25744. // Possible values:
  25745. // "CLEANUP_FAILED"
  25746. // "DEPRECATED_RESOURCE_USED"
  25747. // "DEPRECATED_TYPE_USED"
  25748. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  25749. // "EXPERIMENTAL_TYPE_USED"
  25750. // "EXTERNAL_API_WARNING"
  25751. // "FIELD_VALUE_OVERRIDEN"
  25752. // "INJECTED_KERNELS_DEPRECATED"
  25753. // "MISSING_TYPE_DEPENDENCY"
  25754. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  25755. // "NEXT_HOP_CANNOT_IP_FORWARD"
  25756. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  25757. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  25758. // "NEXT_HOP_NOT_RUNNING"
  25759. // "NOT_CRITICAL_ERROR"
  25760. // "NO_RESULTS_ON_PAGE"
  25761. // "REQUIRED_TOS_AGREEMENT"
  25762. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  25763. // "RESOURCE_NOT_DELETED"
  25764. // "SCHEMA_VALIDATION_IGNORED"
  25765. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  25766. // "UNDECLARED_PROPERTIES"
  25767. // "UNREACHABLE"
  25768. Code string `json:"code,omitempty"`
  25769. // Data: [Output Only] Metadata about this warning in key: value format.
  25770. // For example:
  25771. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  25772. Data []*VpnTunnelsScopedListWarningData `json:"data,omitempty"`
  25773. // Message: [Output Only] A human-readable description of the warning
  25774. // code.
  25775. Message string `json:"message,omitempty"`
  25776. // ForceSendFields is a list of field names (e.g. "Code") to
  25777. // unconditionally include in API requests. By default, fields with
  25778. // empty values are omitted from API requests. However, any non-pointer,
  25779. // non-interface field appearing in ForceSendFields will be sent to the
  25780. // server regardless of whether the field is empty or not. This may be
  25781. // used to include empty fields in Patch requests.
  25782. ForceSendFields []string `json:"-"`
  25783. // NullFields is a list of field names (e.g. "Code") to include in API
  25784. // requests with the JSON null value. By default, fields with empty
  25785. // values are omitted from API requests. However, any field with an
  25786. // empty value appearing in NullFields will be sent to the server as
  25787. // null. It is an error if a field in this list has a non-empty value.
  25788. // This may be used to include null fields in Patch requests.
  25789. NullFields []string `json:"-"`
  25790. }
  25791. func (s *VpnTunnelsScopedListWarning) MarshalJSON() ([]byte, error) {
  25792. type NoMethod VpnTunnelsScopedListWarning
  25793. raw := NoMethod(*s)
  25794. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  25795. }
  25796. type VpnTunnelsScopedListWarningData struct {
  25797. // Key: [Output Only] A key that provides more detail on the warning
  25798. // being returned. For example, for warnings where there are no results
  25799. // in a list request for a particular zone, this key might be scope and
  25800. // the key value might be the zone name. Other examples might be a key
  25801. // indicating a deprecated resource and a suggested replacement, or a
  25802. // warning about invalid network settings (for example, if an instance
  25803. // attempts to perform IP forwarding but is not enabled for IP
  25804. // forwarding).
  25805. Key string `json:"key,omitempty"`
  25806. // Value: [Output Only] A warning data value corresponding to the key.
  25807. Value string `json:"value,omitempty"`
  25808. // ForceSendFields is a list of field names (e.g. "Key") to
  25809. // unconditionally include in API requests. By default, fields with
  25810. // empty values are omitted from API requests. However, any non-pointer,
  25811. // non-interface field appearing in ForceSendFields will be sent to the
  25812. // server regardless of whether the field is empty or not. This may be
  25813. // used to include empty fields in Patch requests.
  25814. ForceSendFields []string `json:"-"`
  25815. // NullFields is a list of field names (e.g. "Key") to include in API
  25816. // requests with the JSON null value. By default, fields with empty
  25817. // values are omitted from API requests. However, any field with an
  25818. // empty value appearing in NullFields will be sent to the server as
  25819. // null. It is an error if a field in this list has a non-empty value.
  25820. // This may be used to include null fields in Patch requests.
  25821. NullFields []string `json:"-"`
  25822. }
  25823. func (s *VpnTunnelsScopedListWarningData) MarshalJSON() ([]byte, error) {
  25824. type NoMethod VpnTunnelsScopedListWarningData
  25825. raw := NoMethod(*s)
  25826. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  25827. }
  25828. type WafExpressionSet struct {
  25829. // Aliases: A list of alternate IDs. The format should be: - E.g.
  25830. // XSS-stable Generic suffix like "stable" is particularly useful if a
  25831. // policy likes to avail newer set of expressions without having to
  25832. // change the policy. A given alias name can't be used for more than one
  25833. // entity set.
  25834. Aliases []string `json:"aliases,omitempty"`
  25835. // Expressions: List of available expressions.
  25836. Expressions []*WafExpressionSetExpression `json:"expressions,omitempty"`
  25837. // Id: Google specified expression set ID. The format should be: - E.g.
  25838. // XSS-20170329
  25839. Id string `json:"id,omitempty"`
  25840. // ForceSendFields is a list of field names (e.g. "Aliases") to
  25841. // unconditionally include in API requests. By default, fields with
  25842. // empty values are omitted from API requests. However, any non-pointer,
  25843. // non-interface field appearing in ForceSendFields will be sent to the
  25844. // server regardless of whether the field is empty or not. This may be
  25845. // used to include empty fields in Patch requests.
  25846. ForceSendFields []string `json:"-"`
  25847. // NullFields is a list of field names (e.g. "Aliases") to include in
  25848. // API requests with the JSON null value. By default, fields with empty
  25849. // values are omitted from API requests. However, any field with an
  25850. // empty value appearing in NullFields will be sent to the server as
  25851. // null. It is an error if a field in this list has a non-empty value.
  25852. // This may be used to include null fields in Patch requests.
  25853. NullFields []string `json:"-"`
  25854. }
  25855. func (s *WafExpressionSet) MarshalJSON() ([]byte, error) {
  25856. type NoMethod WafExpressionSet
  25857. raw := NoMethod(*s)
  25858. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  25859. }
  25860. type WafExpressionSetExpression struct {
  25861. // Id: Expression ID should uniquely identify the origin of the
  25862. // expression. E.g. owasp-crs-v020901-id973337 identifies Owasp core
  25863. // rule set version 2.9.1 rule id 973337. The ID could be used to
  25864. // determine the individual attack definition that has been detected. It
  25865. // could also be used to exclude it from the policy in case of false
  25866. // positive.
  25867. Id string `json:"id,omitempty"`
  25868. // ForceSendFields is a list of field names (e.g. "Id") to
  25869. // unconditionally include in API requests. By default, fields with
  25870. // empty values are omitted from API requests. However, any non-pointer,
  25871. // non-interface field appearing in ForceSendFields will be sent to the
  25872. // server regardless of whether the field is empty or not. This may be
  25873. // used to include empty fields in Patch requests.
  25874. ForceSendFields []string `json:"-"`
  25875. // NullFields is a list of field names (e.g. "Id") to include in API
  25876. // requests with the JSON null value. By default, fields with empty
  25877. // values are omitted from API requests. However, any field with an
  25878. // empty value appearing in NullFields will be sent to the server as
  25879. // null. It is an error if a field in this list has a non-empty value.
  25880. // This may be used to include null fields in Patch requests.
  25881. NullFields []string `json:"-"`
  25882. }
  25883. func (s *WafExpressionSetExpression) MarshalJSON() ([]byte, error) {
  25884. type NoMethod WafExpressionSetExpression
  25885. raw := NoMethod(*s)
  25886. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  25887. }
  25888. type XpnHostList struct {
  25889. // Id: [Output Only] Unique identifier for the resource; defined by the
  25890. // server.
  25891. Id string `json:"id,omitempty"`
  25892. // Items: [Output Only] A list of shared VPC host project URLs.
  25893. Items []*Project `json:"items,omitempty"`
  25894. // Kind: [Output Only] Type of resource. Always compute#xpnHostList for
  25895. // lists of shared VPC hosts.
  25896. Kind string `json:"kind,omitempty"`
  25897. // NextPageToken: [Output Only] This token allows you to get the next
  25898. // page of results for list requests. If the number of results is larger
  25899. // than maxResults, use the nextPageToken as a value for the query
  25900. // parameter pageToken in the next list request. Subsequent list
  25901. // requests will have their own nextPageToken to continue paging through
  25902. // the results.
  25903. NextPageToken string `json:"nextPageToken,omitempty"`
  25904. // SelfLink: [Output Only] Server-defined URL for this resource.
  25905. SelfLink string `json:"selfLink,omitempty"`
  25906. // Warning: [Output Only] Informational warning message.
  25907. Warning *XpnHostListWarning `json:"warning,omitempty"`
  25908. // ServerResponse contains the HTTP response code and headers from the
  25909. // server.
  25910. googleapi.ServerResponse `json:"-"`
  25911. // ForceSendFields is a list of field names (e.g. "Id") to
  25912. // unconditionally include in API requests. By default, fields with
  25913. // empty values are omitted from API requests. However, any non-pointer,
  25914. // non-interface field appearing in ForceSendFields will be sent to the
  25915. // server regardless of whether the field is empty or not. This may be
  25916. // used to include empty fields in Patch requests.
  25917. ForceSendFields []string `json:"-"`
  25918. // NullFields is a list of field names (e.g. "Id") to include in API
  25919. // requests with the JSON null value. By default, fields with empty
  25920. // values are omitted from API requests. However, any field with an
  25921. // empty value appearing in NullFields will be sent to the server as
  25922. // null. It is an error if a field in this list has a non-empty value.
  25923. // This may be used to include null fields in Patch requests.
  25924. NullFields []string `json:"-"`
  25925. }
  25926. func (s *XpnHostList) MarshalJSON() ([]byte, error) {
  25927. type NoMethod XpnHostList
  25928. raw := NoMethod(*s)
  25929. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  25930. }
  25931. // XpnHostListWarning: [Output Only] Informational warning message.
  25932. type XpnHostListWarning struct {
  25933. // Code: [Output Only] A warning code, if applicable. For example,
  25934. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  25935. // the response.
  25936. //
  25937. // Possible values:
  25938. // "CLEANUP_FAILED"
  25939. // "DEPRECATED_RESOURCE_USED"
  25940. // "DEPRECATED_TYPE_USED"
  25941. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  25942. // "EXPERIMENTAL_TYPE_USED"
  25943. // "EXTERNAL_API_WARNING"
  25944. // "FIELD_VALUE_OVERRIDEN"
  25945. // "INJECTED_KERNELS_DEPRECATED"
  25946. // "MISSING_TYPE_DEPENDENCY"
  25947. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  25948. // "NEXT_HOP_CANNOT_IP_FORWARD"
  25949. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  25950. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  25951. // "NEXT_HOP_NOT_RUNNING"
  25952. // "NOT_CRITICAL_ERROR"
  25953. // "NO_RESULTS_ON_PAGE"
  25954. // "REQUIRED_TOS_AGREEMENT"
  25955. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  25956. // "RESOURCE_NOT_DELETED"
  25957. // "SCHEMA_VALIDATION_IGNORED"
  25958. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  25959. // "UNDECLARED_PROPERTIES"
  25960. // "UNREACHABLE"
  25961. Code string `json:"code,omitempty"`
  25962. // Data: [Output Only] Metadata about this warning in key: value format.
  25963. // For example:
  25964. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  25965. Data []*XpnHostListWarningData `json:"data,omitempty"`
  25966. // Message: [Output Only] A human-readable description of the warning
  25967. // code.
  25968. Message string `json:"message,omitempty"`
  25969. // ForceSendFields is a list of field names (e.g. "Code") to
  25970. // unconditionally include in API requests. By default, fields with
  25971. // empty values are omitted from API requests. However, any non-pointer,
  25972. // non-interface field appearing in ForceSendFields will be sent to the
  25973. // server regardless of whether the field is empty or not. This may be
  25974. // used to include empty fields in Patch requests.
  25975. ForceSendFields []string `json:"-"`
  25976. // NullFields is a list of field names (e.g. "Code") to include in API
  25977. // requests with the JSON null value. By default, fields with empty
  25978. // values are omitted from API requests. However, any field with an
  25979. // empty value appearing in NullFields will be sent to the server as
  25980. // null. It is an error if a field in this list has a non-empty value.
  25981. // This may be used to include null fields in Patch requests.
  25982. NullFields []string `json:"-"`
  25983. }
  25984. func (s *XpnHostListWarning) MarshalJSON() ([]byte, error) {
  25985. type NoMethod XpnHostListWarning
  25986. raw := NoMethod(*s)
  25987. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  25988. }
  25989. type XpnHostListWarningData struct {
  25990. // Key: [Output Only] A key that provides more detail on the warning
  25991. // being returned. For example, for warnings where there are no results
  25992. // in a list request for a particular zone, this key might be scope and
  25993. // the key value might be the zone name. Other examples might be a key
  25994. // indicating a deprecated resource and a suggested replacement, or a
  25995. // warning about invalid network settings (for example, if an instance
  25996. // attempts to perform IP forwarding but is not enabled for IP
  25997. // forwarding).
  25998. Key string `json:"key,omitempty"`
  25999. // Value: [Output Only] A warning data value corresponding to the key.
  26000. Value string `json:"value,omitempty"`
  26001. // ForceSendFields is a list of field names (e.g. "Key") to
  26002. // unconditionally include in API requests. By default, fields with
  26003. // empty values are omitted from API requests. However, any non-pointer,
  26004. // non-interface field appearing in ForceSendFields will be sent to the
  26005. // server regardless of whether the field is empty or not. This may be
  26006. // used to include empty fields in Patch requests.
  26007. ForceSendFields []string `json:"-"`
  26008. // NullFields is a list of field names (e.g. "Key") to include in API
  26009. // requests with the JSON null value. By default, fields with empty
  26010. // values are omitted from API requests. However, any field with an
  26011. // empty value appearing in NullFields will be sent to the server as
  26012. // null. It is an error if a field in this list has a non-empty value.
  26013. // This may be used to include null fields in Patch requests.
  26014. NullFields []string `json:"-"`
  26015. }
  26016. func (s *XpnHostListWarningData) MarshalJSON() ([]byte, error) {
  26017. type NoMethod XpnHostListWarningData
  26018. raw := NoMethod(*s)
  26019. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  26020. }
  26021. // XpnResourceId: Service resource (a.k.a service project) ID.
  26022. type XpnResourceId struct {
  26023. // Id: The ID of the service resource. In the case of projects, this
  26024. // field matches the project ID (e.g., my-project), not the project
  26025. // number (e.g., 12345678).
  26026. Id string `json:"id,omitempty"`
  26027. // Type: The type of the service resource.
  26028. //
  26029. // Possible values:
  26030. // "PROJECT"
  26031. // "XPN_RESOURCE_TYPE_UNSPECIFIED"
  26032. Type string `json:"type,omitempty"`
  26033. // ForceSendFields is a list of field names (e.g. "Id") to
  26034. // unconditionally include in API requests. By default, fields with
  26035. // empty values are omitted from API requests. However, any non-pointer,
  26036. // non-interface field appearing in ForceSendFields will be sent to the
  26037. // server regardless of whether the field is empty or not. This may be
  26038. // used to include empty fields in Patch requests.
  26039. ForceSendFields []string `json:"-"`
  26040. // NullFields is a list of field names (e.g. "Id") to include in API
  26041. // requests with the JSON null value. By default, fields with empty
  26042. // values are omitted from API requests. However, any field with an
  26043. // empty value appearing in NullFields will be sent to the server as
  26044. // null. It is an error if a field in this list has a non-empty value.
  26045. // This may be used to include null fields in Patch requests.
  26046. NullFields []string `json:"-"`
  26047. }
  26048. func (s *XpnResourceId) MarshalJSON() ([]byte, error) {
  26049. type NoMethod XpnResourceId
  26050. raw := NoMethod(*s)
  26051. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  26052. }
  26053. // Zone: A Zone resource. (== resource_for beta.zones ==) (==
  26054. // resource_for v1.zones ==)
  26055. type Zone struct {
  26056. // AvailableCpuPlatforms: [Output Only] Available cpu/platform
  26057. // selections for the zone.
  26058. AvailableCpuPlatforms []string `json:"availableCpuPlatforms,omitempty"`
  26059. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  26060. // format.
  26061. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  26062. // Deprecated: [Output Only] The deprecation status associated with this
  26063. // zone.
  26064. Deprecated *DeprecationStatus `json:"deprecated,omitempty"`
  26065. // Description: [Output Only] Textual description of the resource.
  26066. Description string `json:"description,omitempty"`
  26067. // Id: [Output Only] The unique identifier for the resource. This
  26068. // identifier is defined by the server.
  26069. Id uint64 `json:"id,omitempty,string"`
  26070. // Kind: [Output Only] Type of the resource. Always compute#zone for
  26071. // zones.
  26072. Kind string `json:"kind,omitempty"`
  26073. // Name: [Output Only] Name of the resource.
  26074. Name string `json:"name,omitempty"`
  26075. // Region: [Output Only] Full URL reference to the region which hosts
  26076. // the zone.
  26077. Region string `json:"region,omitempty"`
  26078. // SelfLink: [Output Only] Server-defined URL for the resource.
  26079. SelfLink string `json:"selfLink,omitempty"`
  26080. // Status: [Output Only] Status of the zone, either UP or DOWN.
  26081. //
  26082. // Possible values:
  26083. // "DOWN"
  26084. // "UP"
  26085. Status string `json:"status,omitempty"`
  26086. // ServerResponse contains the HTTP response code and headers from the
  26087. // server.
  26088. googleapi.ServerResponse `json:"-"`
  26089. // ForceSendFields is a list of field names (e.g.
  26090. // "AvailableCpuPlatforms") to unconditionally include in API requests.
  26091. // By default, fields with empty values are omitted from API requests.
  26092. // However, any non-pointer, non-interface field appearing in
  26093. // ForceSendFields will be sent to the server regardless of whether the
  26094. // field is empty or not. This may be used to include empty fields in
  26095. // Patch requests.
  26096. ForceSendFields []string `json:"-"`
  26097. // NullFields is a list of field names (e.g. "AvailableCpuPlatforms") to
  26098. // include in API requests with the JSON null value. By default, fields
  26099. // with empty values are omitted from API requests. However, any field
  26100. // with an empty value appearing in NullFields will be sent to the
  26101. // server as null. It is an error if a field in this list has a
  26102. // non-empty value. This may be used to include null fields in Patch
  26103. // requests.
  26104. NullFields []string `json:"-"`
  26105. }
  26106. func (s *Zone) MarshalJSON() ([]byte, error) {
  26107. type NoMethod Zone
  26108. raw := NoMethod(*s)
  26109. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  26110. }
  26111. // ZoneList: Contains a list of zone resources.
  26112. type ZoneList struct {
  26113. // Id: [Output Only] Unique identifier for the resource; defined by the
  26114. // server.
  26115. Id string `json:"id,omitempty"`
  26116. // Items: A list of Zone resources.
  26117. Items []*Zone `json:"items,omitempty"`
  26118. // Kind: Type of resource.
  26119. Kind string `json:"kind,omitempty"`
  26120. // NextPageToken: [Output Only] This token allows you to get the next
  26121. // page of results for list requests. If the number of results is larger
  26122. // than maxResults, use the nextPageToken as a value for the query
  26123. // parameter pageToken in the next list request. Subsequent list
  26124. // requests will have their own nextPageToken to continue paging through
  26125. // the results.
  26126. NextPageToken string `json:"nextPageToken,omitempty"`
  26127. // SelfLink: [Output Only] Server-defined URL for this resource.
  26128. SelfLink string `json:"selfLink,omitempty"`
  26129. // Warning: [Output Only] Informational warning message.
  26130. Warning *ZoneListWarning `json:"warning,omitempty"`
  26131. // ServerResponse contains the HTTP response code and headers from the
  26132. // server.
  26133. googleapi.ServerResponse `json:"-"`
  26134. // ForceSendFields is a list of field names (e.g. "Id") to
  26135. // unconditionally include in API requests. By default, fields with
  26136. // empty values are omitted from API requests. However, any non-pointer,
  26137. // non-interface field appearing in ForceSendFields will be sent to the
  26138. // server regardless of whether the field is empty or not. This may be
  26139. // used to include empty fields in Patch requests.
  26140. ForceSendFields []string `json:"-"`
  26141. // NullFields is a list of field names (e.g. "Id") to include in API
  26142. // requests with the JSON null value. By default, fields with empty
  26143. // values are omitted from API requests. However, any field with an
  26144. // empty value appearing in NullFields will be sent to the server as
  26145. // null. It is an error if a field in this list has a non-empty value.
  26146. // This may be used to include null fields in Patch requests.
  26147. NullFields []string `json:"-"`
  26148. }
  26149. func (s *ZoneList) MarshalJSON() ([]byte, error) {
  26150. type NoMethod ZoneList
  26151. raw := NoMethod(*s)
  26152. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  26153. }
  26154. // ZoneListWarning: [Output Only] Informational warning message.
  26155. type ZoneListWarning struct {
  26156. // Code: [Output Only] A warning code, if applicable. For example,
  26157. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  26158. // the response.
  26159. //
  26160. // Possible values:
  26161. // "CLEANUP_FAILED"
  26162. // "DEPRECATED_RESOURCE_USED"
  26163. // "DEPRECATED_TYPE_USED"
  26164. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  26165. // "EXPERIMENTAL_TYPE_USED"
  26166. // "EXTERNAL_API_WARNING"
  26167. // "FIELD_VALUE_OVERRIDEN"
  26168. // "INJECTED_KERNELS_DEPRECATED"
  26169. // "MISSING_TYPE_DEPENDENCY"
  26170. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  26171. // "NEXT_HOP_CANNOT_IP_FORWARD"
  26172. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  26173. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  26174. // "NEXT_HOP_NOT_RUNNING"
  26175. // "NOT_CRITICAL_ERROR"
  26176. // "NO_RESULTS_ON_PAGE"
  26177. // "REQUIRED_TOS_AGREEMENT"
  26178. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  26179. // "RESOURCE_NOT_DELETED"
  26180. // "SCHEMA_VALIDATION_IGNORED"
  26181. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  26182. // "UNDECLARED_PROPERTIES"
  26183. // "UNREACHABLE"
  26184. Code string `json:"code,omitempty"`
  26185. // Data: [Output Only] Metadata about this warning in key: value format.
  26186. // For example:
  26187. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  26188. Data []*ZoneListWarningData `json:"data,omitempty"`
  26189. // Message: [Output Only] A human-readable description of the warning
  26190. // code.
  26191. Message string `json:"message,omitempty"`
  26192. // ForceSendFields is a list of field names (e.g. "Code") to
  26193. // unconditionally include in API requests. By default, fields with
  26194. // empty values are omitted from API requests. However, any non-pointer,
  26195. // non-interface field appearing in ForceSendFields will be sent to the
  26196. // server regardless of whether the field is empty or not. This may be
  26197. // used to include empty fields in Patch requests.
  26198. ForceSendFields []string `json:"-"`
  26199. // NullFields is a list of field names (e.g. "Code") to include in API
  26200. // requests with the JSON null value. By default, fields with empty
  26201. // values are omitted from API requests. However, any field with an
  26202. // empty value appearing in NullFields will be sent to the server as
  26203. // null. It is an error if a field in this list has a non-empty value.
  26204. // This may be used to include null fields in Patch requests.
  26205. NullFields []string `json:"-"`
  26206. }
  26207. func (s *ZoneListWarning) MarshalJSON() ([]byte, error) {
  26208. type NoMethod ZoneListWarning
  26209. raw := NoMethod(*s)
  26210. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  26211. }
  26212. type ZoneListWarningData struct {
  26213. // Key: [Output Only] A key that provides more detail on the warning
  26214. // being returned. For example, for warnings where there are no results
  26215. // in a list request for a particular zone, this key might be scope and
  26216. // the key value might be the zone name. Other examples might be a key
  26217. // indicating a deprecated resource and a suggested replacement, or a
  26218. // warning about invalid network settings (for example, if an instance
  26219. // attempts to perform IP forwarding but is not enabled for IP
  26220. // forwarding).
  26221. Key string `json:"key,omitempty"`
  26222. // Value: [Output Only] A warning data value corresponding to the key.
  26223. Value string `json:"value,omitempty"`
  26224. // ForceSendFields is a list of field names (e.g. "Key") to
  26225. // unconditionally include in API requests. By default, fields with
  26226. // empty values are omitted from API requests. However, any non-pointer,
  26227. // non-interface field appearing in ForceSendFields will be sent to the
  26228. // server regardless of whether the field is empty or not. This may be
  26229. // used to include empty fields in Patch requests.
  26230. ForceSendFields []string `json:"-"`
  26231. // NullFields is a list of field names (e.g. "Key") to include in API
  26232. // requests with the JSON null value. By default, fields with empty
  26233. // values are omitted from API requests. However, any field with an
  26234. // empty value appearing in NullFields will be sent to the server as
  26235. // null. It is an error if a field in this list has a non-empty value.
  26236. // This may be used to include null fields in Patch requests.
  26237. NullFields []string `json:"-"`
  26238. }
  26239. func (s *ZoneListWarningData) MarshalJSON() ([]byte, error) {
  26240. type NoMethod ZoneListWarningData
  26241. raw := NoMethod(*s)
  26242. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  26243. }
  26244. type ZoneSetLabelsRequest struct {
  26245. // LabelFingerprint: The fingerprint of the previous set of labels for
  26246. // this resource, used to detect conflicts. The fingerprint is initially
  26247. // generated by Compute Engine and changes after every request to modify
  26248. // or update labels. You must always provide an up-to-date fingerprint
  26249. // hash in order to update or change labels. Make a get() request to the
  26250. // resource to get the latest fingerprint.
  26251. LabelFingerprint string `json:"labelFingerprint,omitempty"`
  26252. // Labels: The labels to set for this resource.
  26253. Labels map[string]string `json:"labels,omitempty"`
  26254. // ForceSendFields is a list of field names (e.g. "LabelFingerprint") to
  26255. // unconditionally include in API requests. By default, fields with
  26256. // empty values are omitted from API requests. However, any non-pointer,
  26257. // non-interface field appearing in ForceSendFields will be sent to the
  26258. // server regardless of whether the field is empty or not. This may be
  26259. // used to include empty fields in Patch requests.
  26260. ForceSendFields []string `json:"-"`
  26261. // NullFields is a list of field names (e.g. "LabelFingerprint") to
  26262. // include in API requests with the JSON null value. By default, fields
  26263. // with empty values are omitted from API requests. However, any field
  26264. // with an empty value appearing in NullFields will be sent to the
  26265. // server as null. It is an error if a field in this list has a
  26266. // non-empty value. This may be used to include null fields in Patch
  26267. // requests.
  26268. NullFields []string `json:"-"`
  26269. }
  26270. func (s *ZoneSetLabelsRequest) MarshalJSON() ([]byte, error) {
  26271. type NoMethod ZoneSetLabelsRequest
  26272. raw := NoMethod(*s)
  26273. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  26274. }
  26275. type ZoneSetPolicyRequest struct {
  26276. // Bindings: Flatten Policy to create a backwacd compatible wire-format.
  26277. // Deprecated. Use 'policy' to specify bindings.
  26278. Bindings []*Binding `json:"bindings,omitempty"`
  26279. // Etag: Flatten Policy to create a backward compatible wire-format.
  26280. // Deprecated. Use 'policy' to specify the etag.
  26281. Etag string `json:"etag,omitempty"`
  26282. // Policy: REQUIRED: The complete policy to be applied to the
  26283. // 'resource'. The size of the policy is limited to a few 10s of KB. An
  26284. // empty policy is in general a valid policy but certain services (like
  26285. // Projects) might reject them.
  26286. Policy *Policy `json:"policy,omitempty"`
  26287. // ForceSendFields is a list of field names (e.g. "Bindings") to
  26288. // unconditionally include in API requests. By default, fields with
  26289. // empty values are omitted from API requests. However, any non-pointer,
  26290. // non-interface field appearing in ForceSendFields will be sent to the
  26291. // server regardless of whether the field is empty or not. This may be
  26292. // used to include empty fields in Patch requests.
  26293. ForceSendFields []string `json:"-"`
  26294. // NullFields is a list of field names (e.g. "Bindings") to include in
  26295. // API requests with the JSON null value. By default, fields with empty
  26296. // values are omitted from API requests. However, any field with an
  26297. // empty value appearing in NullFields will be sent to the server as
  26298. // null. It is an error if a field in this list has a non-empty value.
  26299. // This may be used to include null fields in Patch requests.
  26300. NullFields []string `json:"-"`
  26301. }
  26302. func (s *ZoneSetPolicyRequest) MarshalJSON() ([]byte, error) {
  26303. type NoMethod ZoneSetPolicyRequest
  26304. raw := NoMethod(*s)
  26305. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  26306. }
  26307. // method id "compute.acceleratorTypes.aggregatedList":
  26308. type AcceleratorTypesAggregatedListCall struct {
  26309. s *Service
  26310. project string
  26311. urlParams_ gensupport.URLParams
  26312. ifNoneMatch_ string
  26313. ctx_ context.Context
  26314. header_ http.Header
  26315. }
  26316. // AggregatedList: Retrieves an aggregated list of accelerator types.
  26317. func (r *AcceleratorTypesService) AggregatedList(project string) *AcceleratorTypesAggregatedListCall {
  26318. c := &AcceleratorTypesAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  26319. c.project = project
  26320. return c
  26321. }
  26322. // Filter sets the optional parameter "filter": A filter expression that
  26323. // filters resources listed in the response. The expression must specify
  26324. // the field name, a comparison operator, and the value that you want to
  26325. // use for filtering. The value must be a string, a number, or a
  26326. // boolean. The comparison operator must be either =, !=, >, or <.
  26327. //
  26328. // For example, if you are filtering Compute Engine instances, you can
  26329. // exclude instances named example-instance by specifying name !=
  26330. // example-instance.
  26331. //
  26332. // You can also filter nested fields. For example, you could specify
  26333. // scheduling.automaticRestart = false to include instances only if they
  26334. // are not scheduled for automatic restarts. You can use filtering on
  26335. // nested fields to filter based on resource labels.
  26336. //
  26337. // To filter on multiple expressions, provide each separate expression
  26338. // within parentheses. For example, (scheduling.automaticRestart = true)
  26339. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  26340. // AND expression. However, you can include AND and OR expressions
  26341. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  26342. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  26343. // true).
  26344. func (c *AcceleratorTypesAggregatedListCall) Filter(filter string) *AcceleratorTypesAggregatedListCall {
  26345. c.urlParams_.Set("filter", filter)
  26346. return c
  26347. }
  26348. // MaxResults sets the optional parameter "maxResults": The maximum
  26349. // number of results per page that should be returned. If the number of
  26350. // available results is larger than maxResults, Compute Engine returns a
  26351. // nextPageToken that can be used to get the next page of results in
  26352. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  26353. // (Default: 500)
  26354. func (c *AcceleratorTypesAggregatedListCall) MaxResults(maxResults int64) *AcceleratorTypesAggregatedListCall {
  26355. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  26356. return c
  26357. }
  26358. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  26359. // a certain order. By default, results are returned in alphanumerical
  26360. // order based on the resource name.
  26361. //
  26362. // You can also sort results in descending order based on the creation
  26363. // timestamp using orderBy="creationTimestamp desc". This sorts results
  26364. // based on the creationTimestamp field in reverse chronological order
  26365. // (newest result first). Use this to sort resources like operations so
  26366. // that the newest operation is returned first.
  26367. //
  26368. // Currently, only sorting by name or creationTimestamp desc is
  26369. // supported.
  26370. func (c *AcceleratorTypesAggregatedListCall) OrderBy(orderBy string) *AcceleratorTypesAggregatedListCall {
  26371. c.urlParams_.Set("orderBy", orderBy)
  26372. return c
  26373. }
  26374. // PageToken sets the optional parameter "pageToken": Specifies a page
  26375. // token to use. Set pageToken to the nextPageToken returned by a
  26376. // previous list request to get the next page of results.
  26377. func (c *AcceleratorTypesAggregatedListCall) PageToken(pageToken string) *AcceleratorTypesAggregatedListCall {
  26378. c.urlParams_.Set("pageToken", pageToken)
  26379. return c
  26380. }
  26381. // Fields allows partial responses to be retrieved. See
  26382. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  26383. // for more information.
  26384. func (c *AcceleratorTypesAggregatedListCall) Fields(s ...googleapi.Field) *AcceleratorTypesAggregatedListCall {
  26385. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  26386. return c
  26387. }
  26388. // IfNoneMatch sets the optional parameter which makes the operation
  26389. // fail if the object's ETag matches the given value. This is useful for
  26390. // getting updates only after the object has changed since the last
  26391. // request. Use googleapi.IsNotModified to check whether the response
  26392. // error from Do is the result of In-None-Match.
  26393. func (c *AcceleratorTypesAggregatedListCall) IfNoneMatch(entityTag string) *AcceleratorTypesAggregatedListCall {
  26394. c.ifNoneMatch_ = entityTag
  26395. return c
  26396. }
  26397. // Context sets the context to be used in this call's Do method. Any
  26398. // pending HTTP request will be aborted if the provided context is
  26399. // canceled.
  26400. func (c *AcceleratorTypesAggregatedListCall) Context(ctx context.Context) *AcceleratorTypesAggregatedListCall {
  26401. c.ctx_ = ctx
  26402. return c
  26403. }
  26404. // Header returns an http.Header that can be modified by the caller to
  26405. // add HTTP headers to the request.
  26406. func (c *AcceleratorTypesAggregatedListCall) Header() http.Header {
  26407. if c.header_ == nil {
  26408. c.header_ = make(http.Header)
  26409. }
  26410. return c.header_
  26411. }
  26412. func (c *AcceleratorTypesAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  26413. reqHeaders := make(http.Header)
  26414. for k, v := range c.header_ {
  26415. reqHeaders[k] = v
  26416. }
  26417. reqHeaders.Set("User-Agent", c.s.userAgent())
  26418. if c.ifNoneMatch_ != "" {
  26419. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  26420. }
  26421. var body io.Reader = nil
  26422. c.urlParams_.Set("alt", alt)
  26423. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/acceleratorTypes")
  26424. urls += "?" + c.urlParams_.Encode()
  26425. req, _ := http.NewRequest("GET", urls, body)
  26426. req.Header = reqHeaders
  26427. googleapi.Expand(req.URL, map[string]string{
  26428. "project": c.project,
  26429. })
  26430. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  26431. }
  26432. // Do executes the "compute.acceleratorTypes.aggregatedList" call.
  26433. // Exactly one of *AcceleratorTypeAggregatedList or error will be
  26434. // non-nil. Any non-2xx status code is an error. Response headers are in
  26435. // either *AcceleratorTypeAggregatedList.ServerResponse.Header or (if a
  26436. // response was returned at all) in error.(*googleapi.Error).Header. Use
  26437. // googleapi.IsNotModified to check whether the returned error was
  26438. // because http.StatusNotModified was returned.
  26439. func (c *AcceleratorTypesAggregatedListCall) Do(opts ...googleapi.CallOption) (*AcceleratorTypeAggregatedList, error) {
  26440. gensupport.SetOptions(c.urlParams_, opts...)
  26441. res, err := c.doRequest("json")
  26442. if res != nil && res.StatusCode == http.StatusNotModified {
  26443. if res.Body != nil {
  26444. res.Body.Close()
  26445. }
  26446. return nil, &googleapi.Error{
  26447. Code: res.StatusCode,
  26448. Header: res.Header,
  26449. }
  26450. }
  26451. if err != nil {
  26452. return nil, err
  26453. }
  26454. defer googleapi.CloseBody(res)
  26455. if err := googleapi.CheckResponse(res); err != nil {
  26456. return nil, err
  26457. }
  26458. ret := &AcceleratorTypeAggregatedList{
  26459. ServerResponse: googleapi.ServerResponse{
  26460. Header: res.Header,
  26461. HTTPStatusCode: res.StatusCode,
  26462. },
  26463. }
  26464. target := &ret
  26465. if err := gensupport.DecodeResponse(target, res); err != nil {
  26466. return nil, err
  26467. }
  26468. return ret, nil
  26469. // {
  26470. // "description": "Retrieves an aggregated list of accelerator types.",
  26471. // "httpMethod": "GET",
  26472. // "id": "compute.acceleratorTypes.aggregatedList",
  26473. // "parameterOrder": [
  26474. // "project"
  26475. // ],
  26476. // "parameters": {
  26477. // "filter": {
  26478. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  26479. // "location": "query",
  26480. // "type": "string"
  26481. // },
  26482. // "maxResults": {
  26483. // "default": "500",
  26484. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  26485. // "format": "uint32",
  26486. // "location": "query",
  26487. // "minimum": "0",
  26488. // "type": "integer"
  26489. // },
  26490. // "orderBy": {
  26491. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  26492. // "location": "query",
  26493. // "type": "string"
  26494. // },
  26495. // "pageToken": {
  26496. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  26497. // "location": "query",
  26498. // "type": "string"
  26499. // },
  26500. // "project": {
  26501. // "description": "Project ID for this request.",
  26502. // "location": "path",
  26503. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  26504. // "required": true,
  26505. // "type": "string"
  26506. // }
  26507. // },
  26508. // "path": "{project}/aggregated/acceleratorTypes",
  26509. // "response": {
  26510. // "$ref": "AcceleratorTypeAggregatedList"
  26511. // },
  26512. // "scopes": [
  26513. // "https://www.googleapis.com/auth/cloud-platform",
  26514. // "https://www.googleapis.com/auth/compute",
  26515. // "https://www.googleapis.com/auth/compute.readonly"
  26516. // ]
  26517. // }
  26518. }
  26519. // Pages invokes f for each page of results.
  26520. // A non-nil error returned from f will halt the iteration.
  26521. // The provided context supersedes any context provided to the Context method.
  26522. func (c *AcceleratorTypesAggregatedListCall) Pages(ctx context.Context, f func(*AcceleratorTypeAggregatedList) error) error {
  26523. c.ctx_ = ctx
  26524. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  26525. for {
  26526. x, err := c.Do()
  26527. if err != nil {
  26528. return err
  26529. }
  26530. if err := f(x); err != nil {
  26531. return err
  26532. }
  26533. if x.NextPageToken == "" {
  26534. return nil
  26535. }
  26536. c.PageToken(x.NextPageToken)
  26537. }
  26538. }
  26539. // method id "compute.acceleratorTypes.get":
  26540. type AcceleratorTypesGetCall struct {
  26541. s *Service
  26542. project string
  26543. zone string
  26544. acceleratorType string
  26545. urlParams_ gensupport.URLParams
  26546. ifNoneMatch_ string
  26547. ctx_ context.Context
  26548. header_ http.Header
  26549. }
  26550. // Get: Returns the specified accelerator type.
  26551. func (r *AcceleratorTypesService) Get(project string, zone string, acceleratorType string) *AcceleratorTypesGetCall {
  26552. c := &AcceleratorTypesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  26553. c.project = project
  26554. c.zone = zone
  26555. c.acceleratorType = acceleratorType
  26556. return c
  26557. }
  26558. // Fields allows partial responses to be retrieved. See
  26559. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  26560. // for more information.
  26561. func (c *AcceleratorTypesGetCall) Fields(s ...googleapi.Field) *AcceleratorTypesGetCall {
  26562. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  26563. return c
  26564. }
  26565. // IfNoneMatch sets the optional parameter which makes the operation
  26566. // fail if the object's ETag matches the given value. This is useful for
  26567. // getting updates only after the object has changed since the last
  26568. // request. Use googleapi.IsNotModified to check whether the response
  26569. // error from Do is the result of In-None-Match.
  26570. func (c *AcceleratorTypesGetCall) IfNoneMatch(entityTag string) *AcceleratorTypesGetCall {
  26571. c.ifNoneMatch_ = entityTag
  26572. return c
  26573. }
  26574. // Context sets the context to be used in this call's Do method. Any
  26575. // pending HTTP request will be aborted if the provided context is
  26576. // canceled.
  26577. func (c *AcceleratorTypesGetCall) Context(ctx context.Context) *AcceleratorTypesGetCall {
  26578. c.ctx_ = ctx
  26579. return c
  26580. }
  26581. // Header returns an http.Header that can be modified by the caller to
  26582. // add HTTP headers to the request.
  26583. func (c *AcceleratorTypesGetCall) Header() http.Header {
  26584. if c.header_ == nil {
  26585. c.header_ = make(http.Header)
  26586. }
  26587. return c.header_
  26588. }
  26589. func (c *AcceleratorTypesGetCall) doRequest(alt string) (*http.Response, error) {
  26590. reqHeaders := make(http.Header)
  26591. for k, v := range c.header_ {
  26592. reqHeaders[k] = v
  26593. }
  26594. reqHeaders.Set("User-Agent", c.s.userAgent())
  26595. if c.ifNoneMatch_ != "" {
  26596. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  26597. }
  26598. var body io.Reader = nil
  26599. c.urlParams_.Set("alt", alt)
  26600. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/acceleratorTypes/{acceleratorType}")
  26601. urls += "?" + c.urlParams_.Encode()
  26602. req, _ := http.NewRequest("GET", urls, body)
  26603. req.Header = reqHeaders
  26604. googleapi.Expand(req.URL, map[string]string{
  26605. "project": c.project,
  26606. "zone": c.zone,
  26607. "acceleratorType": c.acceleratorType,
  26608. })
  26609. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  26610. }
  26611. // Do executes the "compute.acceleratorTypes.get" call.
  26612. // Exactly one of *AcceleratorType or error will be non-nil. Any non-2xx
  26613. // status code is an error. Response headers are in either
  26614. // *AcceleratorType.ServerResponse.Header or (if a response was returned
  26615. // at all) in error.(*googleapi.Error).Header. Use
  26616. // googleapi.IsNotModified to check whether the returned error was
  26617. // because http.StatusNotModified was returned.
  26618. func (c *AcceleratorTypesGetCall) Do(opts ...googleapi.CallOption) (*AcceleratorType, error) {
  26619. gensupport.SetOptions(c.urlParams_, opts...)
  26620. res, err := c.doRequest("json")
  26621. if res != nil && res.StatusCode == http.StatusNotModified {
  26622. if res.Body != nil {
  26623. res.Body.Close()
  26624. }
  26625. return nil, &googleapi.Error{
  26626. Code: res.StatusCode,
  26627. Header: res.Header,
  26628. }
  26629. }
  26630. if err != nil {
  26631. return nil, err
  26632. }
  26633. defer googleapi.CloseBody(res)
  26634. if err := googleapi.CheckResponse(res); err != nil {
  26635. return nil, err
  26636. }
  26637. ret := &AcceleratorType{
  26638. ServerResponse: googleapi.ServerResponse{
  26639. Header: res.Header,
  26640. HTTPStatusCode: res.StatusCode,
  26641. },
  26642. }
  26643. target := &ret
  26644. if err := gensupport.DecodeResponse(target, res); err != nil {
  26645. return nil, err
  26646. }
  26647. return ret, nil
  26648. // {
  26649. // "description": "Returns the specified accelerator type.",
  26650. // "httpMethod": "GET",
  26651. // "id": "compute.acceleratorTypes.get",
  26652. // "parameterOrder": [
  26653. // "project",
  26654. // "zone",
  26655. // "acceleratorType"
  26656. // ],
  26657. // "parameters": {
  26658. // "acceleratorType": {
  26659. // "description": "Name of the accelerator type to return.",
  26660. // "location": "path",
  26661. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  26662. // "required": true,
  26663. // "type": "string"
  26664. // },
  26665. // "project": {
  26666. // "description": "Project ID for this request.",
  26667. // "location": "path",
  26668. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  26669. // "required": true,
  26670. // "type": "string"
  26671. // },
  26672. // "zone": {
  26673. // "description": "The name of the zone for this request.",
  26674. // "location": "path",
  26675. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  26676. // "required": true,
  26677. // "type": "string"
  26678. // }
  26679. // },
  26680. // "path": "{project}/zones/{zone}/acceleratorTypes/{acceleratorType}",
  26681. // "response": {
  26682. // "$ref": "AcceleratorType"
  26683. // },
  26684. // "scopes": [
  26685. // "https://www.googleapis.com/auth/cloud-platform",
  26686. // "https://www.googleapis.com/auth/compute",
  26687. // "https://www.googleapis.com/auth/compute.readonly"
  26688. // ]
  26689. // }
  26690. }
  26691. // method id "compute.acceleratorTypes.list":
  26692. type AcceleratorTypesListCall struct {
  26693. s *Service
  26694. project string
  26695. zone string
  26696. urlParams_ gensupport.URLParams
  26697. ifNoneMatch_ string
  26698. ctx_ context.Context
  26699. header_ http.Header
  26700. }
  26701. // List: Retrieves a list of accelerator types available to the
  26702. // specified project.
  26703. func (r *AcceleratorTypesService) List(project string, zone string) *AcceleratorTypesListCall {
  26704. c := &AcceleratorTypesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  26705. c.project = project
  26706. c.zone = zone
  26707. return c
  26708. }
  26709. // Filter sets the optional parameter "filter": A filter expression that
  26710. // filters resources listed in the response. The expression must specify
  26711. // the field name, a comparison operator, and the value that you want to
  26712. // use for filtering. The value must be a string, a number, or a
  26713. // boolean. The comparison operator must be either =, !=, >, or <.
  26714. //
  26715. // For example, if you are filtering Compute Engine instances, you can
  26716. // exclude instances named example-instance by specifying name !=
  26717. // example-instance.
  26718. //
  26719. // You can also filter nested fields. For example, you could specify
  26720. // scheduling.automaticRestart = false to include instances only if they
  26721. // are not scheduled for automatic restarts. You can use filtering on
  26722. // nested fields to filter based on resource labels.
  26723. //
  26724. // To filter on multiple expressions, provide each separate expression
  26725. // within parentheses. For example, (scheduling.automaticRestart = true)
  26726. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  26727. // AND expression. However, you can include AND and OR expressions
  26728. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  26729. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  26730. // true).
  26731. func (c *AcceleratorTypesListCall) Filter(filter string) *AcceleratorTypesListCall {
  26732. c.urlParams_.Set("filter", filter)
  26733. return c
  26734. }
  26735. // MaxResults sets the optional parameter "maxResults": The maximum
  26736. // number of results per page that should be returned. If the number of
  26737. // available results is larger than maxResults, Compute Engine returns a
  26738. // nextPageToken that can be used to get the next page of results in
  26739. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  26740. // (Default: 500)
  26741. func (c *AcceleratorTypesListCall) MaxResults(maxResults int64) *AcceleratorTypesListCall {
  26742. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  26743. return c
  26744. }
  26745. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  26746. // a certain order. By default, results are returned in alphanumerical
  26747. // order based on the resource name.
  26748. //
  26749. // You can also sort results in descending order based on the creation
  26750. // timestamp using orderBy="creationTimestamp desc". This sorts results
  26751. // based on the creationTimestamp field in reverse chronological order
  26752. // (newest result first). Use this to sort resources like operations so
  26753. // that the newest operation is returned first.
  26754. //
  26755. // Currently, only sorting by name or creationTimestamp desc is
  26756. // supported.
  26757. func (c *AcceleratorTypesListCall) OrderBy(orderBy string) *AcceleratorTypesListCall {
  26758. c.urlParams_.Set("orderBy", orderBy)
  26759. return c
  26760. }
  26761. // PageToken sets the optional parameter "pageToken": Specifies a page
  26762. // token to use. Set pageToken to the nextPageToken returned by a
  26763. // previous list request to get the next page of results.
  26764. func (c *AcceleratorTypesListCall) PageToken(pageToken string) *AcceleratorTypesListCall {
  26765. c.urlParams_.Set("pageToken", pageToken)
  26766. return c
  26767. }
  26768. // Fields allows partial responses to be retrieved. See
  26769. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  26770. // for more information.
  26771. func (c *AcceleratorTypesListCall) Fields(s ...googleapi.Field) *AcceleratorTypesListCall {
  26772. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  26773. return c
  26774. }
  26775. // IfNoneMatch sets the optional parameter which makes the operation
  26776. // fail if the object's ETag matches the given value. This is useful for
  26777. // getting updates only after the object has changed since the last
  26778. // request. Use googleapi.IsNotModified to check whether the response
  26779. // error from Do is the result of In-None-Match.
  26780. func (c *AcceleratorTypesListCall) IfNoneMatch(entityTag string) *AcceleratorTypesListCall {
  26781. c.ifNoneMatch_ = entityTag
  26782. return c
  26783. }
  26784. // Context sets the context to be used in this call's Do method. Any
  26785. // pending HTTP request will be aborted if the provided context is
  26786. // canceled.
  26787. func (c *AcceleratorTypesListCall) Context(ctx context.Context) *AcceleratorTypesListCall {
  26788. c.ctx_ = ctx
  26789. return c
  26790. }
  26791. // Header returns an http.Header that can be modified by the caller to
  26792. // add HTTP headers to the request.
  26793. func (c *AcceleratorTypesListCall) Header() http.Header {
  26794. if c.header_ == nil {
  26795. c.header_ = make(http.Header)
  26796. }
  26797. return c.header_
  26798. }
  26799. func (c *AcceleratorTypesListCall) doRequest(alt string) (*http.Response, error) {
  26800. reqHeaders := make(http.Header)
  26801. for k, v := range c.header_ {
  26802. reqHeaders[k] = v
  26803. }
  26804. reqHeaders.Set("User-Agent", c.s.userAgent())
  26805. if c.ifNoneMatch_ != "" {
  26806. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  26807. }
  26808. var body io.Reader = nil
  26809. c.urlParams_.Set("alt", alt)
  26810. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/acceleratorTypes")
  26811. urls += "?" + c.urlParams_.Encode()
  26812. req, _ := http.NewRequest("GET", urls, body)
  26813. req.Header = reqHeaders
  26814. googleapi.Expand(req.URL, map[string]string{
  26815. "project": c.project,
  26816. "zone": c.zone,
  26817. })
  26818. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  26819. }
  26820. // Do executes the "compute.acceleratorTypes.list" call.
  26821. // Exactly one of *AcceleratorTypeList or error will be non-nil. Any
  26822. // non-2xx status code is an error. Response headers are in either
  26823. // *AcceleratorTypeList.ServerResponse.Header or (if a response was
  26824. // returned at all) in error.(*googleapi.Error).Header. Use
  26825. // googleapi.IsNotModified to check whether the returned error was
  26826. // because http.StatusNotModified was returned.
  26827. func (c *AcceleratorTypesListCall) Do(opts ...googleapi.CallOption) (*AcceleratorTypeList, error) {
  26828. gensupport.SetOptions(c.urlParams_, opts...)
  26829. res, err := c.doRequest("json")
  26830. if res != nil && res.StatusCode == http.StatusNotModified {
  26831. if res.Body != nil {
  26832. res.Body.Close()
  26833. }
  26834. return nil, &googleapi.Error{
  26835. Code: res.StatusCode,
  26836. Header: res.Header,
  26837. }
  26838. }
  26839. if err != nil {
  26840. return nil, err
  26841. }
  26842. defer googleapi.CloseBody(res)
  26843. if err := googleapi.CheckResponse(res); err != nil {
  26844. return nil, err
  26845. }
  26846. ret := &AcceleratorTypeList{
  26847. ServerResponse: googleapi.ServerResponse{
  26848. Header: res.Header,
  26849. HTTPStatusCode: res.StatusCode,
  26850. },
  26851. }
  26852. target := &ret
  26853. if err := gensupport.DecodeResponse(target, res); err != nil {
  26854. return nil, err
  26855. }
  26856. return ret, nil
  26857. // {
  26858. // "description": "Retrieves a list of accelerator types available to the specified project.",
  26859. // "httpMethod": "GET",
  26860. // "id": "compute.acceleratorTypes.list",
  26861. // "parameterOrder": [
  26862. // "project",
  26863. // "zone"
  26864. // ],
  26865. // "parameters": {
  26866. // "filter": {
  26867. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  26868. // "location": "query",
  26869. // "type": "string"
  26870. // },
  26871. // "maxResults": {
  26872. // "default": "500",
  26873. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  26874. // "format": "uint32",
  26875. // "location": "query",
  26876. // "minimum": "0",
  26877. // "type": "integer"
  26878. // },
  26879. // "orderBy": {
  26880. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  26881. // "location": "query",
  26882. // "type": "string"
  26883. // },
  26884. // "pageToken": {
  26885. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  26886. // "location": "query",
  26887. // "type": "string"
  26888. // },
  26889. // "project": {
  26890. // "description": "Project ID for this request.",
  26891. // "location": "path",
  26892. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  26893. // "required": true,
  26894. // "type": "string"
  26895. // },
  26896. // "zone": {
  26897. // "description": "The name of the zone for this request.",
  26898. // "location": "path",
  26899. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  26900. // "required": true,
  26901. // "type": "string"
  26902. // }
  26903. // },
  26904. // "path": "{project}/zones/{zone}/acceleratorTypes",
  26905. // "response": {
  26906. // "$ref": "AcceleratorTypeList"
  26907. // },
  26908. // "scopes": [
  26909. // "https://www.googleapis.com/auth/cloud-platform",
  26910. // "https://www.googleapis.com/auth/compute",
  26911. // "https://www.googleapis.com/auth/compute.readonly"
  26912. // ]
  26913. // }
  26914. }
  26915. // Pages invokes f for each page of results.
  26916. // A non-nil error returned from f will halt the iteration.
  26917. // The provided context supersedes any context provided to the Context method.
  26918. func (c *AcceleratorTypesListCall) Pages(ctx context.Context, f func(*AcceleratorTypeList) error) error {
  26919. c.ctx_ = ctx
  26920. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  26921. for {
  26922. x, err := c.Do()
  26923. if err != nil {
  26924. return err
  26925. }
  26926. if err := f(x); err != nil {
  26927. return err
  26928. }
  26929. if x.NextPageToken == "" {
  26930. return nil
  26931. }
  26932. c.PageToken(x.NextPageToken)
  26933. }
  26934. }
  26935. // method id "compute.addresses.aggregatedList":
  26936. type AddressesAggregatedListCall struct {
  26937. s *Service
  26938. project string
  26939. urlParams_ gensupport.URLParams
  26940. ifNoneMatch_ string
  26941. ctx_ context.Context
  26942. header_ http.Header
  26943. }
  26944. // AggregatedList: Retrieves an aggregated list of addresses.
  26945. // For details, see https://cloud.google.com/compute/docs/reference/latest/addresses/aggregatedList
  26946. func (r *AddressesService) AggregatedList(project string) *AddressesAggregatedListCall {
  26947. c := &AddressesAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  26948. c.project = project
  26949. return c
  26950. }
  26951. // Filter sets the optional parameter "filter": A filter expression that
  26952. // filters resources listed in the response. The expression must specify
  26953. // the field name, a comparison operator, and the value that you want to
  26954. // use for filtering. The value must be a string, a number, or a
  26955. // boolean. The comparison operator must be either =, !=, >, or <.
  26956. //
  26957. // For example, if you are filtering Compute Engine instances, you can
  26958. // exclude instances named example-instance by specifying name !=
  26959. // example-instance.
  26960. //
  26961. // You can also filter nested fields. For example, you could specify
  26962. // scheduling.automaticRestart = false to include instances only if they
  26963. // are not scheduled for automatic restarts. You can use filtering on
  26964. // nested fields to filter based on resource labels.
  26965. //
  26966. // To filter on multiple expressions, provide each separate expression
  26967. // within parentheses. For example, (scheduling.automaticRestart = true)
  26968. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  26969. // AND expression. However, you can include AND and OR expressions
  26970. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  26971. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  26972. // true).
  26973. func (c *AddressesAggregatedListCall) Filter(filter string) *AddressesAggregatedListCall {
  26974. c.urlParams_.Set("filter", filter)
  26975. return c
  26976. }
  26977. // MaxResults sets the optional parameter "maxResults": The maximum
  26978. // number of results per page that should be returned. If the number of
  26979. // available results is larger than maxResults, Compute Engine returns a
  26980. // nextPageToken that can be used to get the next page of results in
  26981. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  26982. // (Default: 500)
  26983. func (c *AddressesAggregatedListCall) MaxResults(maxResults int64) *AddressesAggregatedListCall {
  26984. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  26985. return c
  26986. }
  26987. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  26988. // a certain order. By default, results are returned in alphanumerical
  26989. // order based on the resource name.
  26990. //
  26991. // You can also sort results in descending order based on the creation
  26992. // timestamp using orderBy="creationTimestamp desc". This sorts results
  26993. // based on the creationTimestamp field in reverse chronological order
  26994. // (newest result first). Use this to sort resources like operations so
  26995. // that the newest operation is returned first.
  26996. //
  26997. // Currently, only sorting by name or creationTimestamp desc is
  26998. // supported.
  26999. func (c *AddressesAggregatedListCall) OrderBy(orderBy string) *AddressesAggregatedListCall {
  27000. c.urlParams_.Set("orderBy", orderBy)
  27001. return c
  27002. }
  27003. // PageToken sets the optional parameter "pageToken": Specifies a page
  27004. // token to use. Set pageToken to the nextPageToken returned by a
  27005. // previous list request to get the next page of results.
  27006. func (c *AddressesAggregatedListCall) PageToken(pageToken string) *AddressesAggregatedListCall {
  27007. c.urlParams_.Set("pageToken", pageToken)
  27008. return c
  27009. }
  27010. // Fields allows partial responses to be retrieved. See
  27011. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  27012. // for more information.
  27013. func (c *AddressesAggregatedListCall) Fields(s ...googleapi.Field) *AddressesAggregatedListCall {
  27014. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  27015. return c
  27016. }
  27017. // IfNoneMatch sets the optional parameter which makes the operation
  27018. // fail if the object's ETag matches the given value. This is useful for
  27019. // getting updates only after the object has changed since the last
  27020. // request. Use googleapi.IsNotModified to check whether the response
  27021. // error from Do is the result of In-None-Match.
  27022. func (c *AddressesAggregatedListCall) IfNoneMatch(entityTag string) *AddressesAggregatedListCall {
  27023. c.ifNoneMatch_ = entityTag
  27024. return c
  27025. }
  27026. // Context sets the context to be used in this call's Do method. Any
  27027. // pending HTTP request will be aborted if the provided context is
  27028. // canceled.
  27029. func (c *AddressesAggregatedListCall) Context(ctx context.Context) *AddressesAggregatedListCall {
  27030. c.ctx_ = ctx
  27031. return c
  27032. }
  27033. // Header returns an http.Header that can be modified by the caller to
  27034. // add HTTP headers to the request.
  27035. func (c *AddressesAggregatedListCall) Header() http.Header {
  27036. if c.header_ == nil {
  27037. c.header_ = make(http.Header)
  27038. }
  27039. return c.header_
  27040. }
  27041. func (c *AddressesAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  27042. reqHeaders := make(http.Header)
  27043. for k, v := range c.header_ {
  27044. reqHeaders[k] = v
  27045. }
  27046. reqHeaders.Set("User-Agent", c.s.userAgent())
  27047. if c.ifNoneMatch_ != "" {
  27048. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  27049. }
  27050. var body io.Reader = nil
  27051. c.urlParams_.Set("alt", alt)
  27052. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/addresses")
  27053. urls += "?" + c.urlParams_.Encode()
  27054. req, _ := http.NewRequest("GET", urls, body)
  27055. req.Header = reqHeaders
  27056. googleapi.Expand(req.URL, map[string]string{
  27057. "project": c.project,
  27058. })
  27059. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  27060. }
  27061. // Do executes the "compute.addresses.aggregatedList" call.
  27062. // Exactly one of *AddressAggregatedList or error will be non-nil. Any
  27063. // non-2xx status code is an error. Response headers are in either
  27064. // *AddressAggregatedList.ServerResponse.Header or (if a response was
  27065. // returned at all) in error.(*googleapi.Error).Header. Use
  27066. // googleapi.IsNotModified to check whether the returned error was
  27067. // because http.StatusNotModified was returned.
  27068. func (c *AddressesAggregatedListCall) Do(opts ...googleapi.CallOption) (*AddressAggregatedList, error) {
  27069. gensupport.SetOptions(c.urlParams_, opts...)
  27070. res, err := c.doRequest("json")
  27071. if res != nil && res.StatusCode == http.StatusNotModified {
  27072. if res.Body != nil {
  27073. res.Body.Close()
  27074. }
  27075. return nil, &googleapi.Error{
  27076. Code: res.StatusCode,
  27077. Header: res.Header,
  27078. }
  27079. }
  27080. if err != nil {
  27081. return nil, err
  27082. }
  27083. defer googleapi.CloseBody(res)
  27084. if err := googleapi.CheckResponse(res); err != nil {
  27085. return nil, err
  27086. }
  27087. ret := &AddressAggregatedList{
  27088. ServerResponse: googleapi.ServerResponse{
  27089. Header: res.Header,
  27090. HTTPStatusCode: res.StatusCode,
  27091. },
  27092. }
  27093. target := &ret
  27094. if err := gensupport.DecodeResponse(target, res); err != nil {
  27095. return nil, err
  27096. }
  27097. return ret, nil
  27098. // {
  27099. // "description": "Retrieves an aggregated list of addresses.",
  27100. // "httpMethod": "GET",
  27101. // "id": "compute.addresses.aggregatedList",
  27102. // "parameterOrder": [
  27103. // "project"
  27104. // ],
  27105. // "parameters": {
  27106. // "filter": {
  27107. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  27108. // "location": "query",
  27109. // "type": "string"
  27110. // },
  27111. // "maxResults": {
  27112. // "default": "500",
  27113. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  27114. // "format": "uint32",
  27115. // "location": "query",
  27116. // "minimum": "0",
  27117. // "type": "integer"
  27118. // },
  27119. // "orderBy": {
  27120. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  27121. // "location": "query",
  27122. // "type": "string"
  27123. // },
  27124. // "pageToken": {
  27125. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  27126. // "location": "query",
  27127. // "type": "string"
  27128. // },
  27129. // "project": {
  27130. // "description": "Project ID for this request.",
  27131. // "location": "path",
  27132. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  27133. // "required": true,
  27134. // "type": "string"
  27135. // }
  27136. // },
  27137. // "path": "{project}/aggregated/addresses",
  27138. // "response": {
  27139. // "$ref": "AddressAggregatedList"
  27140. // },
  27141. // "scopes": [
  27142. // "https://www.googleapis.com/auth/cloud-platform",
  27143. // "https://www.googleapis.com/auth/compute",
  27144. // "https://www.googleapis.com/auth/compute.readonly"
  27145. // ]
  27146. // }
  27147. }
  27148. // Pages invokes f for each page of results.
  27149. // A non-nil error returned from f will halt the iteration.
  27150. // The provided context supersedes any context provided to the Context method.
  27151. func (c *AddressesAggregatedListCall) Pages(ctx context.Context, f func(*AddressAggregatedList) error) error {
  27152. c.ctx_ = ctx
  27153. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  27154. for {
  27155. x, err := c.Do()
  27156. if err != nil {
  27157. return err
  27158. }
  27159. if err := f(x); err != nil {
  27160. return err
  27161. }
  27162. if x.NextPageToken == "" {
  27163. return nil
  27164. }
  27165. c.PageToken(x.NextPageToken)
  27166. }
  27167. }
  27168. // method id "compute.addresses.delete":
  27169. type AddressesDeleteCall struct {
  27170. s *Service
  27171. project string
  27172. region string
  27173. address string
  27174. urlParams_ gensupport.URLParams
  27175. ctx_ context.Context
  27176. header_ http.Header
  27177. }
  27178. // Delete: Deletes the specified address resource.
  27179. // For details, see https://cloud.google.com/compute/docs/reference/latest/addresses/delete
  27180. func (r *AddressesService) Delete(project string, region string, address string) *AddressesDeleteCall {
  27181. c := &AddressesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  27182. c.project = project
  27183. c.region = region
  27184. c.address = address
  27185. return c
  27186. }
  27187. // RequestId sets the optional parameter "requestId": An optional
  27188. // request ID to identify requests. Specify a unique request ID so that
  27189. // if you must retry your request, the server will know to ignore the
  27190. // request if it has already been completed.
  27191. //
  27192. // For example, consider a situation where you make an initial request
  27193. // and the request times out. If you make the request again with the
  27194. // same request ID, the server can check if original operation with the
  27195. // same request ID was received, and if so, will ignore the second
  27196. // request. This prevents clients from accidentally creating duplicate
  27197. // commitments.
  27198. //
  27199. // The request ID must be a valid UUID with the exception that zero UUID
  27200. // is not supported (00000000-0000-0000-0000-000000000000).
  27201. func (c *AddressesDeleteCall) RequestId(requestId string) *AddressesDeleteCall {
  27202. c.urlParams_.Set("requestId", requestId)
  27203. return c
  27204. }
  27205. // Fields allows partial responses to be retrieved. See
  27206. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  27207. // for more information.
  27208. func (c *AddressesDeleteCall) Fields(s ...googleapi.Field) *AddressesDeleteCall {
  27209. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  27210. return c
  27211. }
  27212. // Context sets the context to be used in this call's Do method. Any
  27213. // pending HTTP request will be aborted if the provided context is
  27214. // canceled.
  27215. func (c *AddressesDeleteCall) Context(ctx context.Context) *AddressesDeleteCall {
  27216. c.ctx_ = ctx
  27217. return c
  27218. }
  27219. // Header returns an http.Header that can be modified by the caller to
  27220. // add HTTP headers to the request.
  27221. func (c *AddressesDeleteCall) Header() http.Header {
  27222. if c.header_ == nil {
  27223. c.header_ = make(http.Header)
  27224. }
  27225. return c.header_
  27226. }
  27227. func (c *AddressesDeleteCall) doRequest(alt string) (*http.Response, error) {
  27228. reqHeaders := make(http.Header)
  27229. for k, v := range c.header_ {
  27230. reqHeaders[k] = v
  27231. }
  27232. reqHeaders.Set("User-Agent", c.s.userAgent())
  27233. var body io.Reader = nil
  27234. c.urlParams_.Set("alt", alt)
  27235. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/addresses/{address}")
  27236. urls += "?" + c.urlParams_.Encode()
  27237. req, _ := http.NewRequest("DELETE", urls, body)
  27238. req.Header = reqHeaders
  27239. googleapi.Expand(req.URL, map[string]string{
  27240. "project": c.project,
  27241. "region": c.region,
  27242. "address": c.address,
  27243. })
  27244. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  27245. }
  27246. // Do executes the "compute.addresses.delete" call.
  27247. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  27248. // status code is an error. Response headers are in either
  27249. // *Operation.ServerResponse.Header or (if a response was returned at
  27250. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  27251. // to check whether the returned error was because
  27252. // http.StatusNotModified was returned.
  27253. func (c *AddressesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  27254. gensupport.SetOptions(c.urlParams_, opts...)
  27255. res, err := c.doRequest("json")
  27256. if res != nil && res.StatusCode == http.StatusNotModified {
  27257. if res.Body != nil {
  27258. res.Body.Close()
  27259. }
  27260. return nil, &googleapi.Error{
  27261. Code: res.StatusCode,
  27262. Header: res.Header,
  27263. }
  27264. }
  27265. if err != nil {
  27266. return nil, err
  27267. }
  27268. defer googleapi.CloseBody(res)
  27269. if err := googleapi.CheckResponse(res); err != nil {
  27270. return nil, err
  27271. }
  27272. ret := &Operation{
  27273. ServerResponse: googleapi.ServerResponse{
  27274. Header: res.Header,
  27275. HTTPStatusCode: res.StatusCode,
  27276. },
  27277. }
  27278. target := &ret
  27279. if err := gensupport.DecodeResponse(target, res); err != nil {
  27280. return nil, err
  27281. }
  27282. return ret, nil
  27283. // {
  27284. // "description": "Deletes the specified address resource.",
  27285. // "httpMethod": "DELETE",
  27286. // "id": "compute.addresses.delete",
  27287. // "parameterOrder": [
  27288. // "project",
  27289. // "region",
  27290. // "address"
  27291. // ],
  27292. // "parameters": {
  27293. // "address": {
  27294. // "description": "Name of the address resource to delete.",
  27295. // "location": "path",
  27296. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  27297. // "required": true,
  27298. // "type": "string"
  27299. // },
  27300. // "project": {
  27301. // "description": "Project ID for this request.",
  27302. // "location": "path",
  27303. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  27304. // "required": true,
  27305. // "type": "string"
  27306. // },
  27307. // "region": {
  27308. // "description": "Name of the region for this request.",
  27309. // "location": "path",
  27310. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  27311. // "required": true,
  27312. // "type": "string"
  27313. // },
  27314. // "requestId": {
  27315. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  27316. // "location": "query",
  27317. // "type": "string"
  27318. // }
  27319. // },
  27320. // "path": "{project}/regions/{region}/addresses/{address}",
  27321. // "response": {
  27322. // "$ref": "Operation"
  27323. // },
  27324. // "scopes": [
  27325. // "https://www.googleapis.com/auth/cloud-platform",
  27326. // "https://www.googleapis.com/auth/compute"
  27327. // ]
  27328. // }
  27329. }
  27330. // method id "compute.addresses.get":
  27331. type AddressesGetCall struct {
  27332. s *Service
  27333. project string
  27334. region string
  27335. address string
  27336. urlParams_ gensupport.URLParams
  27337. ifNoneMatch_ string
  27338. ctx_ context.Context
  27339. header_ http.Header
  27340. }
  27341. // Get: Returns the specified address resource.
  27342. // For details, see https://cloud.google.com/compute/docs/reference/latest/addresses/get
  27343. func (r *AddressesService) Get(project string, region string, address string) *AddressesGetCall {
  27344. c := &AddressesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  27345. c.project = project
  27346. c.region = region
  27347. c.address = address
  27348. return c
  27349. }
  27350. // Fields allows partial responses to be retrieved. See
  27351. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  27352. // for more information.
  27353. func (c *AddressesGetCall) Fields(s ...googleapi.Field) *AddressesGetCall {
  27354. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  27355. return c
  27356. }
  27357. // IfNoneMatch sets the optional parameter which makes the operation
  27358. // fail if the object's ETag matches the given value. This is useful for
  27359. // getting updates only after the object has changed since the last
  27360. // request. Use googleapi.IsNotModified to check whether the response
  27361. // error from Do is the result of In-None-Match.
  27362. func (c *AddressesGetCall) IfNoneMatch(entityTag string) *AddressesGetCall {
  27363. c.ifNoneMatch_ = entityTag
  27364. return c
  27365. }
  27366. // Context sets the context to be used in this call's Do method. Any
  27367. // pending HTTP request will be aborted if the provided context is
  27368. // canceled.
  27369. func (c *AddressesGetCall) Context(ctx context.Context) *AddressesGetCall {
  27370. c.ctx_ = ctx
  27371. return c
  27372. }
  27373. // Header returns an http.Header that can be modified by the caller to
  27374. // add HTTP headers to the request.
  27375. func (c *AddressesGetCall) Header() http.Header {
  27376. if c.header_ == nil {
  27377. c.header_ = make(http.Header)
  27378. }
  27379. return c.header_
  27380. }
  27381. func (c *AddressesGetCall) doRequest(alt string) (*http.Response, error) {
  27382. reqHeaders := make(http.Header)
  27383. for k, v := range c.header_ {
  27384. reqHeaders[k] = v
  27385. }
  27386. reqHeaders.Set("User-Agent", c.s.userAgent())
  27387. if c.ifNoneMatch_ != "" {
  27388. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  27389. }
  27390. var body io.Reader = nil
  27391. c.urlParams_.Set("alt", alt)
  27392. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/addresses/{address}")
  27393. urls += "?" + c.urlParams_.Encode()
  27394. req, _ := http.NewRequest("GET", urls, body)
  27395. req.Header = reqHeaders
  27396. googleapi.Expand(req.URL, map[string]string{
  27397. "project": c.project,
  27398. "region": c.region,
  27399. "address": c.address,
  27400. })
  27401. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  27402. }
  27403. // Do executes the "compute.addresses.get" call.
  27404. // Exactly one of *Address or error will be non-nil. Any non-2xx status
  27405. // code is an error. Response headers are in either
  27406. // *Address.ServerResponse.Header or (if a response was returned at all)
  27407. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  27408. // check whether the returned error was because http.StatusNotModified
  27409. // was returned.
  27410. func (c *AddressesGetCall) Do(opts ...googleapi.CallOption) (*Address, error) {
  27411. gensupport.SetOptions(c.urlParams_, opts...)
  27412. res, err := c.doRequest("json")
  27413. if res != nil && res.StatusCode == http.StatusNotModified {
  27414. if res.Body != nil {
  27415. res.Body.Close()
  27416. }
  27417. return nil, &googleapi.Error{
  27418. Code: res.StatusCode,
  27419. Header: res.Header,
  27420. }
  27421. }
  27422. if err != nil {
  27423. return nil, err
  27424. }
  27425. defer googleapi.CloseBody(res)
  27426. if err := googleapi.CheckResponse(res); err != nil {
  27427. return nil, err
  27428. }
  27429. ret := &Address{
  27430. ServerResponse: googleapi.ServerResponse{
  27431. Header: res.Header,
  27432. HTTPStatusCode: res.StatusCode,
  27433. },
  27434. }
  27435. target := &ret
  27436. if err := gensupport.DecodeResponse(target, res); err != nil {
  27437. return nil, err
  27438. }
  27439. return ret, nil
  27440. // {
  27441. // "description": "Returns the specified address resource.",
  27442. // "httpMethod": "GET",
  27443. // "id": "compute.addresses.get",
  27444. // "parameterOrder": [
  27445. // "project",
  27446. // "region",
  27447. // "address"
  27448. // ],
  27449. // "parameters": {
  27450. // "address": {
  27451. // "description": "Name of the address resource to return.",
  27452. // "location": "path",
  27453. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  27454. // "required": true,
  27455. // "type": "string"
  27456. // },
  27457. // "project": {
  27458. // "description": "Project ID for this request.",
  27459. // "location": "path",
  27460. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  27461. // "required": true,
  27462. // "type": "string"
  27463. // },
  27464. // "region": {
  27465. // "description": "Name of the region for this request.",
  27466. // "location": "path",
  27467. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  27468. // "required": true,
  27469. // "type": "string"
  27470. // }
  27471. // },
  27472. // "path": "{project}/regions/{region}/addresses/{address}",
  27473. // "response": {
  27474. // "$ref": "Address"
  27475. // },
  27476. // "scopes": [
  27477. // "https://www.googleapis.com/auth/cloud-platform",
  27478. // "https://www.googleapis.com/auth/compute",
  27479. // "https://www.googleapis.com/auth/compute.readonly"
  27480. // ]
  27481. // }
  27482. }
  27483. // method id "compute.addresses.insert":
  27484. type AddressesInsertCall struct {
  27485. s *Service
  27486. project string
  27487. region string
  27488. address *Address
  27489. urlParams_ gensupport.URLParams
  27490. ctx_ context.Context
  27491. header_ http.Header
  27492. }
  27493. // Insert: Creates an address resource in the specified project using
  27494. // the data included in the request.
  27495. // For details, see https://cloud.google.com/compute/docs/reference/latest/addresses/insert
  27496. func (r *AddressesService) Insert(project string, region string, address *Address) *AddressesInsertCall {
  27497. c := &AddressesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  27498. c.project = project
  27499. c.region = region
  27500. c.address = address
  27501. return c
  27502. }
  27503. // RequestId sets the optional parameter "requestId": An optional
  27504. // request ID to identify requests. Specify a unique request ID so that
  27505. // if you must retry your request, the server will know to ignore the
  27506. // request if it has already been completed.
  27507. //
  27508. // For example, consider a situation where you make an initial request
  27509. // and the request times out. If you make the request again with the
  27510. // same request ID, the server can check if original operation with the
  27511. // same request ID was received, and if so, will ignore the second
  27512. // request. This prevents clients from accidentally creating duplicate
  27513. // commitments.
  27514. //
  27515. // The request ID must be a valid UUID with the exception that zero UUID
  27516. // is not supported (00000000-0000-0000-0000-000000000000).
  27517. func (c *AddressesInsertCall) RequestId(requestId string) *AddressesInsertCall {
  27518. c.urlParams_.Set("requestId", requestId)
  27519. return c
  27520. }
  27521. // Fields allows partial responses to be retrieved. See
  27522. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  27523. // for more information.
  27524. func (c *AddressesInsertCall) Fields(s ...googleapi.Field) *AddressesInsertCall {
  27525. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  27526. return c
  27527. }
  27528. // Context sets the context to be used in this call's Do method. Any
  27529. // pending HTTP request will be aborted if the provided context is
  27530. // canceled.
  27531. func (c *AddressesInsertCall) Context(ctx context.Context) *AddressesInsertCall {
  27532. c.ctx_ = ctx
  27533. return c
  27534. }
  27535. // Header returns an http.Header that can be modified by the caller to
  27536. // add HTTP headers to the request.
  27537. func (c *AddressesInsertCall) Header() http.Header {
  27538. if c.header_ == nil {
  27539. c.header_ = make(http.Header)
  27540. }
  27541. return c.header_
  27542. }
  27543. func (c *AddressesInsertCall) doRequest(alt string) (*http.Response, error) {
  27544. reqHeaders := make(http.Header)
  27545. for k, v := range c.header_ {
  27546. reqHeaders[k] = v
  27547. }
  27548. reqHeaders.Set("User-Agent", c.s.userAgent())
  27549. var body io.Reader = nil
  27550. body, err := googleapi.WithoutDataWrapper.JSONReader(c.address)
  27551. if err != nil {
  27552. return nil, err
  27553. }
  27554. reqHeaders.Set("Content-Type", "application/json")
  27555. c.urlParams_.Set("alt", alt)
  27556. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/addresses")
  27557. urls += "?" + c.urlParams_.Encode()
  27558. req, _ := http.NewRequest("POST", urls, body)
  27559. req.Header = reqHeaders
  27560. googleapi.Expand(req.URL, map[string]string{
  27561. "project": c.project,
  27562. "region": c.region,
  27563. })
  27564. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  27565. }
  27566. // Do executes the "compute.addresses.insert" call.
  27567. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  27568. // status code is an error. Response headers are in either
  27569. // *Operation.ServerResponse.Header or (if a response was returned at
  27570. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  27571. // to check whether the returned error was because
  27572. // http.StatusNotModified was returned.
  27573. func (c *AddressesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  27574. gensupport.SetOptions(c.urlParams_, opts...)
  27575. res, err := c.doRequest("json")
  27576. if res != nil && res.StatusCode == http.StatusNotModified {
  27577. if res.Body != nil {
  27578. res.Body.Close()
  27579. }
  27580. return nil, &googleapi.Error{
  27581. Code: res.StatusCode,
  27582. Header: res.Header,
  27583. }
  27584. }
  27585. if err != nil {
  27586. return nil, err
  27587. }
  27588. defer googleapi.CloseBody(res)
  27589. if err := googleapi.CheckResponse(res); err != nil {
  27590. return nil, err
  27591. }
  27592. ret := &Operation{
  27593. ServerResponse: googleapi.ServerResponse{
  27594. Header: res.Header,
  27595. HTTPStatusCode: res.StatusCode,
  27596. },
  27597. }
  27598. target := &ret
  27599. if err := gensupport.DecodeResponse(target, res); err != nil {
  27600. return nil, err
  27601. }
  27602. return ret, nil
  27603. // {
  27604. // "description": "Creates an address resource in the specified project using the data included in the request.",
  27605. // "httpMethod": "POST",
  27606. // "id": "compute.addresses.insert",
  27607. // "parameterOrder": [
  27608. // "project",
  27609. // "region"
  27610. // ],
  27611. // "parameters": {
  27612. // "project": {
  27613. // "description": "Project ID for this request.",
  27614. // "location": "path",
  27615. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  27616. // "required": true,
  27617. // "type": "string"
  27618. // },
  27619. // "region": {
  27620. // "description": "Name of the region for this request.",
  27621. // "location": "path",
  27622. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  27623. // "required": true,
  27624. // "type": "string"
  27625. // },
  27626. // "requestId": {
  27627. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  27628. // "location": "query",
  27629. // "type": "string"
  27630. // }
  27631. // },
  27632. // "path": "{project}/regions/{region}/addresses",
  27633. // "request": {
  27634. // "$ref": "Address"
  27635. // },
  27636. // "response": {
  27637. // "$ref": "Operation"
  27638. // },
  27639. // "scopes": [
  27640. // "https://www.googleapis.com/auth/cloud-platform",
  27641. // "https://www.googleapis.com/auth/compute"
  27642. // ]
  27643. // }
  27644. }
  27645. // method id "compute.addresses.list":
  27646. type AddressesListCall struct {
  27647. s *Service
  27648. project string
  27649. region string
  27650. urlParams_ gensupport.URLParams
  27651. ifNoneMatch_ string
  27652. ctx_ context.Context
  27653. header_ http.Header
  27654. }
  27655. // List: Retrieves a list of addresses contained within the specified
  27656. // region.
  27657. // For details, see https://cloud.google.com/compute/docs/reference/latest/addresses/list
  27658. func (r *AddressesService) List(project string, region string) *AddressesListCall {
  27659. c := &AddressesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  27660. c.project = project
  27661. c.region = region
  27662. return c
  27663. }
  27664. // Filter sets the optional parameter "filter": A filter expression that
  27665. // filters resources listed in the response. The expression must specify
  27666. // the field name, a comparison operator, and the value that you want to
  27667. // use for filtering. The value must be a string, a number, or a
  27668. // boolean. The comparison operator must be either =, !=, >, or <.
  27669. //
  27670. // For example, if you are filtering Compute Engine instances, you can
  27671. // exclude instances named example-instance by specifying name !=
  27672. // example-instance.
  27673. //
  27674. // You can also filter nested fields. For example, you could specify
  27675. // scheduling.automaticRestart = false to include instances only if they
  27676. // are not scheduled for automatic restarts. You can use filtering on
  27677. // nested fields to filter based on resource labels.
  27678. //
  27679. // To filter on multiple expressions, provide each separate expression
  27680. // within parentheses. For example, (scheduling.automaticRestart = true)
  27681. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  27682. // AND expression. However, you can include AND and OR expressions
  27683. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  27684. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  27685. // true).
  27686. func (c *AddressesListCall) Filter(filter string) *AddressesListCall {
  27687. c.urlParams_.Set("filter", filter)
  27688. return c
  27689. }
  27690. // MaxResults sets the optional parameter "maxResults": The maximum
  27691. // number of results per page that should be returned. If the number of
  27692. // available results is larger than maxResults, Compute Engine returns a
  27693. // nextPageToken that can be used to get the next page of results in
  27694. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  27695. // (Default: 500)
  27696. func (c *AddressesListCall) MaxResults(maxResults int64) *AddressesListCall {
  27697. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  27698. return c
  27699. }
  27700. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  27701. // a certain order. By default, results are returned in alphanumerical
  27702. // order based on the resource name.
  27703. //
  27704. // You can also sort results in descending order based on the creation
  27705. // timestamp using orderBy="creationTimestamp desc". This sorts results
  27706. // based on the creationTimestamp field in reverse chronological order
  27707. // (newest result first). Use this to sort resources like operations so
  27708. // that the newest operation is returned first.
  27709. //
  27710. // Currently, only sorting by name or creationTimestamp desc is
  27711. // supported.
  27712. func (c *AddressesListCall) OrderBy(orderBy string) *AddressesListCall {
  27713. c.urlParams_.Set("orderBy", orderBy)
  27714. return c
  27715. }
  27716. // PageToken sets the optional parameter "pageToken": Specifies a page
  27717. // token to use. Set pageToken to the nextPageToken returned by a
  27718. // previous list request to get the next page of results.
  27719. func (c *AddressesListCall) PageToken(pageToken string) *AddressesListCall {
  27720. c.urlParams_.Set("pageToken", pageToken)
  27721. return c
  27722. }
  27723. // Fields allows partial responses to be retrieved. See
  27724. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  27725. // for more information.
  27726. func (c *AddressesListCall) Fields(s ...googleapi.Field) *AddressesListCall {
  27727. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  27728. return c
  27729. }
  27730. // IfNoneMatch sets the optional parameter which makes the operation
  27731. // fail if the object's ETag matches the given value. This is useful for
  27732. // getting updates only after the object has changed since the last
  27733. // request. Use googleapi.IsNotModified to check whether the response
  27734. // error from Do is the result of In-None-Match.
  27735. func (c *AddressesListCall) IfNoneMatch(entityTag string) *AddressesListCall {
  27736. c.ifNoneMatch_ = entityTag
  27737. return c
  27738. }
  27739. // Context sets the context to be used in this call's Do method. Any
  27740. // pending HTTP request will be aborted if the provided context is
  27741. // canceled.
  27742. func (c *AddressesListCall) Context(ctx context.Context) *AddressesListCall {
  27743. c.ctx_ = ctx
  27744. return c
  27745. }
  27746. // Header returns an http.Header that can be modified by the caller to
  27747. // add HTTP headers to the request.
  27748. func (c *AddressesListCall) Header() http.Header {
  27749. if c.header_ == nil {
  27750. c.header_ = make(http.Header)
  27751. }
  27752. return c.header_
  27753. }
  27754. func (c *AddressesListCall) doRequest(alt string) (*http.Response, error) {
  27755. reqHeaders := make(http.Header)
  27756. for k, v := range c.header_ {
  27757. reqHeaders[k] = v
  27758. }
  27759. reqHeaders.Set("User-Agent", c.s.userAgent())
  27760. if c.ifNoneMatch_ != "" {
  27761. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  27762. }
  27763. var body io.Reader = nil
  27764. c.urlParams_.Set("alt", alt)
  27765. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/addresses")
  27766. urls += "?" + c.urlParams_.Encode()
  27767. req, _ := http.NewRequest("GET", urls, body)
  27768. req.Header = reqHeaders
  27769. googleapi.Expand(req.URL, map[string]string{
  27770. "project": c.project,
  27771. "region": c.region,
  27772. })
  27773. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  27774. }
  27775. // Do executes the "compute.addresses.list" call.
  27776. // Exactly one of *AddressList or error will be non-nil. Any non-2xx
  27777. // status code is an error. Response headers are in either
  27778. // *AddressList.ServerResponse.Header or (if a response was returned at
  27779. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  27780. // to check whether the returned error was because
  27781. // http.StatusNotModified was returned.
  27782. func (c *AddressesListCall) Do(opts ...googleapi.CallOption) (*AddressList, error) {
  27783. gensupport.SetOptions(c.urlParams_, opts...)
  27784. res, err := c.doRequest("json")
  27785. if res != nil && res.StatusCode == http.StatusNotModified {
  27786. if res.Body != nil {
  27787. res.Body.Close()
  27788. }
  27789. return nil, &googleapi.Error{
  27790. Code: res.StatusCode,
  27791. Header: res.Header,
  27792. }
  27793. }
  27794. if err != nil {
  27795. return nil, err
  27796. }
  27797. defer googleapi.CloseBody(res)
  27798. if err := googleapi.CheckResponse(res); err != nil {
  27799. return nil, err
  27800. }
  27801. ret := &AddressList{
  27802. ServerResponse: googleapi.ServerResponse{
  27803. Header: res.Header,
  27804. HTTPStatusCode: res.StatusCode,
  27805. },
  27806. }
  27807. target := &ret
  27808. if err := gensupport.DecodeResponse(target, res); err != nil {
  27809. return nil, err
  27810. }
  27811. return ret, nil
  27812. // {
  27813. // "description": "Retrieves a list of addresses contained within the specified region.",
  27814. // "httpMethod": "GET",
  27815. // "id": "compute.addresses.list",
  27816. // "parameterOrder": [
  27817. // "project",
  27818. // "region"
  27819. // ],
  27820. // "parameters": {
  27821. // "filter": {
  27822. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  27823. // "location": "query",
  27824. // "type": "string"
  27825. // },
  27826. // "maxResults": {
  27827. // "default": "500",
  27828. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  27829. // "format": "uint32",
  27830. // "location": "query",
  27831. // "minimum": "0",
  27832. // "type": "integer"
  27833. // },
  27834. // "orderBy": {
  27835. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  27836. // "location": "query",
  27837. // "type": "string"
  27838. // },
  27839. // "pageToken": {
  27840. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  27841. // "location": "query",
  27842. // "type": "string"
  27843. // },
  27844. // "project": {
  27845. // "description": "Project ID for this request.",
  27846. // "location": "path",
  27847. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  27848. // "required": true,
  27849. // "type": "string"
  27850. // },
  27851. // "region": {
  27852. // "description": "Name of the region for this request.",
  27853. // "location": "path",
  27854. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  27855. // "required": true,
  27856. // "type": "string"
  27857. // }
  27858. // },
  27859. // "path": "{project}/regions/{region}/addresses",
  27860. // "response": {
  27861. // "$ref": "AddressList"
  27862. // },
  27863. // "scopes": [
  27864. // "https://www.googleapis.com/auth/cloud-platform",
  27865. // "https://www.googleapis.com/auth/compute",
  27866. // "https://www.googleapis.com/auth/compute.readonly"
  27867. // ]
  27868. // }
  27869. }
  27870. // Pages invokes f for each page of results.
  27871. // A non-nil error returned from f will halt the iteration.
  27872. // The provided context supersedes any context provided to the Context method.
  27873. func (c *AddressesListCall) Pages(ctx context.Context, f func(*AddressList) error) error {
  27874. c.ctx_ = ctx
  27875. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  27876. for {
  27877. x, err := c.Do()
  27878. if err != nil {
  27879. return err
  27880. }
  27881. if err := f(x); err != nil {
  27882. return err
  27883. }
  27884. if x.NextPageToken == "" {
  27885. return nil
  27886. }
  27887. c.PageToken(x.NextPageToken)
  27888. }
  27889. }
  27890. // method id "compute.addresses.setLabels":
  27891. type AddressesSetLabelsCall struct {
  27892. s *Service
  27893. project string
  27894. region string
  27895. resource string
  27896. regionsetlabelsrequest *RegionSetLabelsRequest
  27897. urlParams_ gensupport.URLParams
  27898. ctx_ context.Context
  27899. header_ http.Header
  27900. }
  27901. // SetLabels: Sets the labels on an Address. To learn more about labels,
  27902. // read the Labeling Resources documentation.
  27903. func (r *AddressesService) SetLabels(project string, region string, resource string, regionsetlabelsrequest *RegionSetLabelsRequest) *AddressesSetLabelsCall {
  27904. c := &AddressesSetLabelsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  27905. c.project = project
  27906. c.region = region
  27907. c.resource = resource
  27908. c.regionsetlabelsrequest = regionsetlabelsrequest
  27909. return c
  27910. }
  27911. // RequestId sets the optional parameter "requestId": An optional
  27912. // request ID to identify requests. Specify a unique request ID so that
  27913. // if you must retry your request, the server will know to ignore the
  27914. // request if it has already been completed.
  27915. //
  27916. // For example, consider a situation where you make an initial request
  27917. // and the request times out. If you make the request again with the
  27918. // same request ID, the server can check if original operation with the
  27919. // same request ID was received, and if so, will ignore the second
  27920. // request. This prevents clients from accidentally creating duplicate
  27921. // commitments.
  27922. //
  27923. // The request ID must be a valid UUID with the exception that zero UUID
  27924. // is not supported (00000000-0000-0000-0000-000000000000).
  27925. func (c *AddressesSetLabelsCall) RequestId(requestId string) *AddressesSetLabelsCall {
  27926. c.urlParams_.Set("requestId", requestId)
  27927. return c
  27928. }
  27929. // Fields allows partial responses to be retrieved. See
  27930. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  27931. // for more information.
  27932. func (c *AddressesSetLabelsCall) Fields(s ...googleapi.Field) *AddressesSetLabelsCall {
  27933. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  27934. return c
  27935. }
  27936. // Context sets the context to be used in this call's Do method. Any
  27937. // pending HTTP request will be aborted if the provided context is
  27938. // canceled.
  27939. func (c *AddressesSetLabelsCall) Context(ctx context.Context) *AddressesSetLabelsCall {
  27940. c.ctx_ = ctx
  27941. return c
  27942. }
  27943. // Header returns an http.Header that can be modified by the caller to
  27944. // add HTTP headers to the request.
  27945. func (c *AddressesSetLabelsCall) Header() http.Header {
  27946. if c.header_ == nil {
  27947. c.header_ = make(http.Header)
  27948. }
  27949. return c.header_
  27950. }
  27951. func (c *AddressesSetLabelsCall) doRequest(alt string) (*http.Response, error) {
  27952. reqHeaders := make(http.Header)
  27953. for k, v := range c.header_ {
  27954. reqHeaders[k] = v
  27955. }
  27956. reqHeaders.Set("User-Agent", c.s.userAgent())
  27957. var body io.Reader = nil
  27958. body, err := googleapi.WithoutDataWrapper.JSONReader(c.regionsetlabelsrequest)
  27959. if err != nil {
  27960. return nil, err
  27961. }
  27962. reqHeaders.Set("Content-Type", "application/json")
  27963. c.urlParams_.Set("alt", alt)
  27964. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/addresses/{resource}/setLabels")
  27965. urls += "?" + c.urlParams_.Encode()
  27966. req, _ := http.NewRequest("POST", urls, body)
  27967. req.Header = reqHeaders
  27968. googleapi.Expand(req.URL, map[string]string{
  27969. "project": c.project,
  27970. "region": c.region,
  27971. "resource": c.resource,
  27972. })
  27973. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  27974. }
  27975. // Do executes the "compute.addresses.setLabels" call.
  27976. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  27977. // status code is an error. Response headers are in either
  27978. // *Operation.ServerResponse.Header or (if a response was returned at
  27979. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  27980. // to check whether the returned error was because
  27981. // http.StatusNotModified was returned.
  27982. func (c *AddressesSetLabelsCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  27983. gensupport.SetOptions(c.urlParams_, opts...)
  27984. res, err := c.doRequest("json")
  27985. if res != nil && res.StatusCode == http.StatusNotModified {
  27986. if res.Body != nil {
  27987. res.Body.Close()
  27988. }
  27989. return nil, &googleapi.Error{
  27990. Code: res.StatusCode,
  27991. Header: res.Header,
  27992. }
  27993. }
  27994. if err != nil {
  27995. return nil, err
  27996. }
  27997. defer googleapi.CloseBody(res)
  27998. if err := googleapi.CheckResponse(res); err != nil {
  27999. return nil, err
  28000. }
  28001. ret := &Operation{
  28002. ServerResponse: googleapi.ServerResponse{
  28003. Header: res.Header,
  28004. HTTPStatusCode: res.StatusCode,
  28005. },
  28006. }
  28007. target := &ret
  28008. if err := gensupport.DecodeResponse(target, res); err != nil {
  28009. return nil, err
  28010. }
  28011. return ret, nil
  28012. // {
  28013. // "description": "Sets the labels on an Address. To learn more about labels, read the Labeling Resources documentation.",
  28014. // "httpMethod": "POST",
  28015. // "id": "compute.addresses.setLabels",
  28016. // "parameterOrder": [
  28017. // "project",
  28018. // "region",
  28019. // "resource"
  28020. // ],
  28021. // "parameters": {
  28022. // "project": {
  28023. // "description": "Project ID for this request.",
  28024. // "location": "path",
  28025. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  28026. // "required": true,
  28027. // "type": "string"
  28028. // },
  28029. // "region": {
  28030. // "description": "The region for this request.",
  28031. // "location": "path",
  28032. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  28033. // "required": true,
  28034. // "type": "string"
  28035. // },
  28036. // "requestId": {
  28037. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  28038. // "location": "query",
  28039. // "type": "string"
  28040. // },
  28041. // "resource": {
  28042. // "description": "Name of the resource for this request.",
  28043. // "location": "path",
  28044. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  28045. // "required": true,
  28046. // "type": "string"
  28047. // }
  28048. // },
  28049. // "path": "{project}/regions/{region}/addresses/{resource}/setLabels",
  28050. // "request": {
  28051. // "$ref": "RegionSetLabelsRequest"
  28052. // },
  28053. // "response": {
  28054. // "$ref": "Operation"
  28055. // },
  28056. // "scopes": [
  28057. // "https://www.googleapis.com/auth/cloud-platform",
  28058. // "https://www.googleapis.com/auth/compute"
  28059. // ]
  28060. // }
  28061. }
  28062. // method id "compute.addresses.testIamPermissions":
  28063. type AddressesTestIamPermissionsCall struct {
  28064. s *Service
  28065. project string
  28066. region string
  28067. resource string
  28068. testpermissionsrequest *TestPermissionsRequest
  28069. urlParams_ gensupport.URLParams
  28070. ctx_ context.Context
  28071. header_ http.Header
  28072. }
  28073. // TestIamPermissions: Returns permissions that a caller has on the
  28074. // specified resource.
  28075. func (r *AddressesService) TestIamPermissions(project string, region string, resource string, testpermissionsrequest *TestPermissionsRequest) *AddressesTestIamPermissionsCall {
  28076. c := &AddressesTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  28077. c.project = project
  28078. c.region = region
  28079. c.resource = resource
  28080. c.testpermissionsrequest = testpermissionsrequest
  28081. return c
  28082. }
  28083. // Fields allows partial responses to be retrieved. See
  28084. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  28085. // for more information.
  28086. func (c *AddressesTestIamPermissionsCall) Fields(s ...googleapi.Field) *AddressesTestIamPermissionsCall {
  28087. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  28088. return c
  28089. }
  28090. // Context sets the context to be used in this call's Do method. Any
  28091. // pending HTTP request will be aborted if the provided context is
  28092. // canceled.
  28093. func (c *AddressesTestIamPermissionsCall) Context(ctx context.Context) *AddressesTestIamPermissionsCall {
  28094. c.ctx_ = ctx
  28095. return c
  28096. }
  28097. // Header returns an http.Header that can be modified by the caller to
  28098. // add HTTP headers to the request.
  28099. func (c *AddressesTestIamPermissionsCall) Header() http.Header {
  28100. if c.header_ == nil {
  28101. c.header_ = make(http.Header)
  28102. }
  28103. return c.header_
  28104. }
  28105. func (c *AddressesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  28106. reqHeaders := make(http.Header)
  28107. for k, v := range c.header_ {
  28108. reqHeaders[k] = v
  28109. }
  28110. reqHeaders.Set("User-Agent", c.s.userAgent())
  28111. var body io.Reader = nil
  28112. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  28113. if err != nil {
  28114. return nil, err
  28115. }
  28116. reqHeaders.Set("Content-Type", "application/json")
  28117. c.urlParams_.Set("alt", alt)
  28118. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/addresses/{resource}/testIamPermissions")
  28119. urls += "?" + c.urlParams_.Encode()
  28120. req, _ := http.NewRequest("POST", urls, body)
  28121. req.Header = reqHeaders
  28122. googleapi.Expand(req.URL, map[string]string{
  28123. "project": c.project,
  28124. "region": c.region,
  28125. "resource": c.resource,
  28126. })
  28127. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  28128. }
  28129. // Do executes the "compute.addresses.testIamPermissions" call.
  28130. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  28131. // non-2xx status code is an error. Response headers are in either
  28132. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  28133. // returned at all) in error.(*googleapi.Error).Header. Use
  28134. // googleapi.IsNotModified to check whether the returned error was
  28135. // because http.StatusNotModified was returned.
  28136. func (c *AddressesTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  28137. gensupport.SetOptions(c.urlParams_, opts...)
  28138. res, err := c.doRequest("json")
  28139. if res != nil && res.StatusCode == http.StatusNotModified {
  28140. if res.Body != nil {
  28141. res.Body.Close()
  28142. }
  28143. return nil, &googleapi.Error{
  28144. Code: res.StatusCode,
  28145. Header: res.Header,
  28146. }
  28147. }
  28148. if err != nil {
  28149. return nil, err
  28150. }
  28151. defer googleapi.CloseBody(res)
  28152. if err := googleapi.CheckResponse(res); err != nil {
  28153. return nil, err
  28154. }
  28155. ret := &TestPermissionsResponse{
  28156. ServerResponse: googleapi.ServerResponse{
  28157. Header: res.Header,
  28158. HTTPStatusCode: res.StatusCode,
  28159. },
  28160. }
  28161. target := &ret
  28162. if err := gensupport.DecodeResponse(target, res); err != nil {
  28163. return nil, err
  28164. }
  28165. return ret, nil
  28166. // {
  28167. // "description": "Returns permissions that a caller has on the specified resource.",
  28168. // "httpMethod": "POST",
  28169. // "id": "compute.addresses.testIamPermissions",
  28170. // "parameterOrder": [
  28171. // "project",
  28172. // "region",
  28173. // "resource"
  28174. // ],
  28175. // "parameters": {
  28176. // "project": {
  28177. // "description": "Project ID for this request.",
  28178. // "location": "path",
  28179. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  28180. // "required": true,
  28181. // "type": "string"
  28182. // },
  28183. // "region": {
  28184. // "description": "The name of the region for this request.",
  28185. // "location": "path",
  28186. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  28187. // "required": true,
  28188. // "type": "string"
  28189. // },
  28190. // "resource": {
  28191. // "description": "Name of the resource for this request.",
  28192. // "location": "path",
  28193. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  28194. // "required": true,
  28195. // "type": "string"
  28196. // }
  28197. // },
  28198. // "path": "{project}/regions/{region}/addresses/{resource}/testIamPermissions",
  28199. // "request": {
  28200. // "$ref": "TestPermissionsRequest"
  28201. // },
  28202. // "response": {
  28203. // "$ref": "TestPermissionsResponse"
  28204. // },
  28205. // "scopes": [
  28206. // "https://www.googleapis.com/auth/cloud-platform",
  28207. // "https://www.googleapis.com/auth/compute",
  28208. // "https://www.googleapis.com/auth/compute.readonly"
  28209. // ]
  28210. // }
  28211. }
  28212. // method id "compute.autoscalers.aggregatedList":
  28213. type AutoscalersAggregatedListCall struct {
  28214. s *Service
  28215. project string
  28216. urlParams_ gensupport.URLParams
  28217. ifNoneMatch_ string
  28218. ctx_ context.Context
  28219. header_ http.Header
  28220. }
  28221. // AggregatedList: Retrieves an aggregated list of autoscalers.
  28222. func (r *AutoscalersService) AggregatedList(project string) *AutoscalersAggregatedListCall {
  28223. c := &AutoscalersAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  28224. c.project = project
  28225. return c
  28226. }
  28227. // Filter sets the optional parameter "filter": A filter expression that
  28228. // filters resources listed in the response. The expression must specify
  28229. // the field name, a comparison operator, and the value that you want to
  28230. // use for filtering. The value must be a string, a number, or a
  28231. // boolean. The comparison operator must be either =, !=, >, or <.
  28232. //
  28233. // For example, if you are filtering Compute Engine instances, you can
  28234. // exclude instances named example-instance by specifying name !=
  28235. // example-instance.
  28236. //
  28237. // You can also filter nested fields. For example, you could specify
  28238. // scheduling.automaticRestart = false to include instances only if they
  28239. // are not scheduled for automatic restarts. You can use filtering on
  28240. // nested fields to filter based on resource labels.
  28241. //
  28242. // To filter on multiple expressions, provide each separate expression
  28243. // within parentheses. For example, (scheduling.automaticRestart = true)
  28244. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  28245. // AND expression. However, you can include AND and OR expressions
  28246. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  28247. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  28248. // true).
  28249. func (c *AutoscalersAggregatedListCall) Filter(filter string) *AutoscalersAggregatedListCall {
  28250. c.urlParams_.Set("filter", filter)
  28251. return c
  28252. }
  28253. // MaxResults sets the optional parameter "maxResults": The maximum
  28254. // number of results per page that should be returned. If the number of
  28255. // available results is larger than maxResults, Compute Engine returns a
  28256. // nextPageToken that can be used to get the next page of results in
  28257. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  28258. // (Default: 500)
  28259. func (c *AutoscalersAggregatedListCall) MaxResults(maxResults int64) *AutoscalersAggregatedListCall {
  28260. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  28261. return c
  28262. }
  28263. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  28264. // a certain order. By default, results are returned in alphanumerical
  28265. // order based on the resource name.
  28266. //
  28267. // You can also sort results in descending order based on the creation
  28268. // timestamp using orderBy="creationTimestamp desc". This sorts results
  28269. // based on the creationTimestamp field in reverse chronological order
  28270. // (newest result first). Use this to sort resources like operations so
  28271. // that the newest operation is returned first.
  28272. //
  28273. // Currently, only sorting by name or creationTimestamp desc is
  28274. // supported.
  28275. func (c *AutoscalersAggregatedListCall) OrderBy(orderBy string) *AutoscalersAggregatedListCall {
  28276. c.urlParams_.Set("orderBy", orderBy)
  28277. return c
  28278. }
  28279. // PageToken sets the optional parameter "pageToken": Specifies a page
  28280. // token to use. Set pageToken to the nextPageToken returned by a
  28281. // previous list request to get the next page of results.
  28282. func (c *AutoscalersAggregatedListCall) PageToken(pageToken string) *AutoscalersAggregatedListCall {
  28283. c.urlParams_.Set("pageToken", pageToken)
  28284. return c
  28285. }
  28286. // Fields allows partial responses to be retrieved. See
  28287. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  28288. // for more information.
  28289. func (c *AutoscalersAggregatedListCall) Fields(s ...googleapi.Field) *AutoscalersAggregatedListCall {
  28290. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  28291. return c
  28292. }
  28293. // IfNoneMatch sets the optional parameter which makes the operation
  28294. // fail if the object's ETag matches the given value. This is useful for
  28295. // getting updates only after the object has changed since the last
  28296. // request. Use googleapi.IsNotModified to check whether the response
  28297. // error from Do is the result of In-None-Match.
  28298. func (c *AutoscalersAggregatedListCall) IfNoneMatch(entityTag string) *AutoscalersAggregatedListCall {
  28299. c.ifNoneMatch_ = entityTag
  28300. return c
  28301. }
  28302. // Context sets the context to be used in this call's Do method. Any
  28303. // pending HTTP request will be aborted if the provided context is
  28304. // canceled.
  28305. func (c *AutoscalersAggregatedListCall) Context(ctx context.Context) *AutoscalersAggregatedListCall {
  28306. c.ctx_ = ctx
  28307. return c
  28308. }
  28309. // Header returns an http.Header that can be modified by the caller to
  28310. // add HTTP headers to the request.
  28311. func (c *AutoscalersAggregatedListCall) Header() http.Header {
  28312. if c.header_ == nil {
  28313. c.header_ = make(http.Header)
  28314. }
  28315. return c.header_
  28316. }
  28317. func (c *AutoscalersAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  28318. reqHeaders := make(http.Header)
  28319. for k, v := range c.header_ {
  28320. reqHeaders[k] = v
  28321. }
  28322. reqHeaders.Set("User-Agent", c.s.userAgent())
  28323. if c.ifNoneMatch_ != "" {
  28324. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  28325. }
  28326. var body io.Reader = nil
  28327. c.urlParams_.Set("alt", alt)
  28328. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/autoscalers")
  28329. urls += "?" + c.urlParams_.Encode()
  28330. req, _ := http.NewRequest("GET", urls, body)
  28331. req.Header = reqHeaders
  28332. googleapi.Expand(req.URL, map[string]string{
  28333. "project": c.project,
  28334. })
  28335. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  28336. }
  28337. // Do executes the "compute.autoscalers.aggregatedList" call.
  28338. // Exactly one of *AutoscalerAggregatedList or error will be non-nil.
  28339. // Any non-2xx status code is an error. Response headers are in either
  28340. // *AutoscalerAggregatedList.ServerResponse.Header or (if a response was
  28341. // returned at all) in error.(*googleapi.Error).Header. Use
  28342. // googleapi.IsNotModified to check whether the returned error was
  28343. // because http.StatusNotModified was returned.
  28344. func (c *AutoscalersAggregatedListCall) Do(opts ...googleapi.CallOption) (*AutoscalerAggregatedList, error) {
  28345. gensupport.SetOptions(c.urlParams_, opts...)
  28346. res, err := c.doRequest("json")
  28347. if res != nil && res.StatusCode == http.StatusNotModified {
  28348. if res.Body != nil {
  28349. res.Body.Close()
  28350. }
  28351. return nil, &googleapi.Error{
  28352. Code: res.StatusCode,
  28353. Header: res.Header,
  28354. }
  28355. }
  28356. if err != nil {
  28357. return nil, err
  28358. }
  28359. defer googleapi.CloseBody(res)
  28360. if err := googleapi.CheckResponse(res); err != nil {
  28361. return nil, err
  28362. }
  28363. ret := &AutoscalerAggregatedList{
  28364. ServerResponse: googleapi.ServerResponse{
  28365. Header: res.Header,
  28366. HTTPStatusCode: res.StatusCode,
  28367. },
  28368. }
  28369. target := &ret
  28370. if err := gensupport.DecodeResponse(target, res); err != nil {
  28371. return nil, err
  28372. }
  28373. return ret, nil
  28374. // {
  28375. // "description": "Retrieves an aggregated list of autoscalers.",
  28376. // "httpMethod": "GET",
  28377. // "id": "compute.autoscalers.aggregatedList",
  28378. // "parameterOrder": [
  28379. // "project"
  28380. // ],
  28381. // "parameters": {
  28382. // "filter": {
  28383. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  28384. // "location": "query",
  28385. // "type": "string"
  28386. // },
  28387. // "maxResults": {
  28388. // "default": "500",
  28389. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  28390. // "format": "uint32",
  28391. // "location": "query",
  28392. // "minimum": "0",
  28393. // "type": "integer"
  28394. // },
  28395. // "orderBy": {
  28396. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  28397. // "location": "query",
  28398. // "type": "string"
  28399. // },
  28400. // "pageToken": {
  28401. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  28402. // "location": "query",
  28403. // "type": "string"
  28404. // },
  28405. // "project": {
  28406. // "description": "Project ID for this request.",
  28407. // "location": "path",
  28408. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  28409. // "required": true,
  28410. // "type": "string"
  28411. // }
  28412. // },
  28413. // "path": "{project}/aggregated/autoscalers",
  28414. // "response": {
  28415. // "$ref": "AutoscalerAggregatedList"
  28416. // },
  28417. // "scopes": [
  28418. // "https://www.googleapis.com/auth/cloud-platform",
  28419. // "https://www.googleapis.com/auth/compute",
  28420. // "https://www.googleapis.com/auth/compute.readonly"
  28421. // ]
  28422. // }
  28423. }
  28424. // Pages invokes f for each page of results.
  28425. // A non-nil error returned from f will halt the iteration.
  28426. // The provided context supersedes any context provided to the Context method.
  28427. func (c *AutoscalersAggregatedListCall) Pages(ctx context.Context, f func(*AutoscalerAggregatedList) error) error {
  28428. c.ctx_ = ctx
  28429. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  28430. for {
  28431. x, err := c.Do()
  28432. if err != nil {
  28433. return err
  28434. }
  28435. if err := f(x); err != nil {
  28436. return err
  28437. }
  28438. if x.NextPageToken == "" {
  28439. return nil
  28440. }
  28441. c.PageToken(x.NextPageToken)
  28442. }
  28443. }
  28444. // method id "compute.autoscalers.delete":
  28445. type AutoscalersDeleteCall struct {
  28446. s *Service
  28447. project string
  28448. zone string
  28449. autoscaler string
  28450. urlParams_ gensupport.URLParams
  28451. ctx_ context.Context
  28452. header_ http.Header
  28453. }
  28454. // Delete: Deletes the specified autoscaler.
  28455. func (r *AutoscalersService) Delete(project string, zone string, autoscaler string) *AutoscalersDeleteCall {
  28456. c := &AutoscalersDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  28457. c.project = project
  28458. c.zone = zone
  28459. c.autoscaler = autoscaler
  28460. return c
  28461. }
  28462. // RequestId sets the optional parameter "requestId": An optional
  28463. // request ID to identify requests. Specify a unique request ID so that
  28464. // if you must retry your request, the server will know to ignore the
  28465. // request if it has already been completed.
  28466. //
  28467. // For example, consider a situation where you make an initial request
  28468. // and the request times out. If you make the request again with the
  28469. // same request ID, the server can check if original operation with the
  28470. // same request ID was received, and if so, will ignore the second
  28471. // request. This prevents clients from accidentally creating duplicate
  28472. // commitments.
  28473. //
  28474. // The request ID must be a valid UUID with the exception that zero UUID
  28475. // is not supported (00000000-0000-0000-0000-000000000000).
  28476. func (c *AutoscalersDeleteCall) RequestId(requestId string) *AutoscalersDeleteCall {
  28477. c.urlParams_.Set("requestId", requestId)
  28478. return c
  28479. }
  28480. // Fields allows partial responses to be retrieved. See
  28481. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  28482. // for more information.
  28483. func (c *AutoscalersDeleteCall) Fields(s ...googleapi.Field) *AutoscalersDeleteCall {
  28484. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  28485. return c
  28486. }
  28487. // Context sets the context to be used in this call's Do method. Any
  28488. // pending HTTP request will be aborted if the provided context is
  28489. // canceled.
  28490. func (c *AutoscalersDeleteCall) Context(ctx context.Context) *AutoscalersDeleteCall {
  28491. c.ctx_ = ctx
  28492. return c
  28493. }
  28494. // Header returns an http.Header that can be modified by the caller to
  28495. // add HTTP headers to the request.
  28496. func (c *AutoscalersDeleteCall) Header() http.Header {
  28497. if c.header_ == nil {
  28498. c.header_ = make(http.Header)
  28499. }
  28500. return c.header_
  28501. }
  28502. func (c *AutoscalersDeleteCall) doRequest(alt string) (*http.Response, error) {
  28503. reqHeaders := make(http.Header)
  28504. for k, v := range c.header_ {
  28505. reqHeaders[k] = v
  28506. }
  28507. reqHeaders.Set("User-Agent", c.s.userAgent())
  28508. var body io.Reader = nil
  28509. c.urlParams_.Set("alt", alt)
  28510. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/autoscalers/{autoscaler}")
  28511. urls += "?" + c.urlParams_.Encode()
  28512. req, _ := http.NewRequest("DELETE", urls, body)
  28513. req.Header = reqHeaders
  28514. googleapi.Expand(req.URL, map[string]string{
  28515. "project": c.project,
  28516. "zone": c.zone,
  28517. "autoscaler": c.autoscaler,
  28518. })
  28519. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  28520. }
  28521. // Do executes the "compute.autoscalers.delete" call.
  28522. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  28523. // status code is an error. Response headers are in either
  28524. // *Operation.ServerResponse.Header or (if a response was returned at
  28525. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  28526. // to check whether the returned error was because
  28527. // http.StatusNotModified was returned.
  28528. func (c *AutoscalersDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  28529. gensupport.SetOptions(c.urlParams_, opts...)
  28530. res, err := c.doRequest("json")
  28531. if res != nil && res.StatusCode == http.StatusNotModified {
  28532. if res.Body != nil {
  28533. res.Body.Close()
  28534. }
  28535. return nil, &googleapi.Error{
  28536. Code: res.StatusCode,
  28537. Header: res.Header,
  28538. }
  28539. }
  28540. if err != nil {
  28541. return nil, err
  28542. }
  28543. defer googleapi.CloseBody(res)
  28544. if err := googleapi.CheckResponse(res); err != nil {
  28545. return nil, err
  28546. }
  28547. ret := &Operation{
  28548. ServerResponse: googleapi.ServerResponse{
  28549. Header: res.Header,
  28550. HTTPStatusCode: res.StatusCode,
  28551. },
  28552. }
  28553. target := &ret
  28554. if err := gensupport.DecodeResponse(target, res); err != nil {
  28555. return nil, err
  28556. }
  28557. return ret, nil
  28558. // {
  28559. // "description": "Deletes the specified autoscaler.",
  28560. // "httpMethod": "DELETE",
  28561. // "id": "compute.autoscalers.delete",
  28562. // "parameterOrder": [
  28563. // "project",
  28564. // "zone",
  28565. // "autoscaler"
  28566. // ],
  28567. // "parameters": {
  28568. // "autoscaler": {
  28569. // "description": "Name of the autoscaler to delete.",
  28570. // "location": "path",
  28571. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  28572. // "required": true,
  28573. // "type": "string"
  28574. // },
  28575. // "project": {
  28576. // "description": "Project ID for this request.",
  28577. // "location": "path",
  28578. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  28579. // "required": true,
  28580. // "type": "string"
  28581. // },
  28582. // "requestId": {
  28583. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  28584. // "location": "query",
  28585. // "type": "string"
  28586. // },
  28587. // "zone": {
  28588. // "description": "Name of the zone for this request.",
  28589. // "location": "path",
  28590. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  28591. // "required": true,
  28592. // "type": "string"
  28593. // }
  28594. // },
  28595. // "path": "{project}/zones/{zone}/autoscalers/{autoscaler}",
  28596. // "response": {
  28597. // "$ref": "Operation"
  28598. // },
  28599. // "scopes": [
  28600. // "https://www.googleapis.com/auth/cloud-platform",
  28601. // "https://www.googleapis.com/auth/compute"
  28602. // ]
  28603. // }
  28604. }
  28605. // method id "compute.autoscalers.get":
  28606. type AutoscalersGetCall struct {
  28607. s *Service
  28608. project string
  28609. zone string
  28610. autoscaler string
  28611. urlParams_ gensupport.URLParams
  28612. ifNoneMatch_ string
  28613. ctx_ context.Context
  28614. header_ http.Header
  28615. }
  28616. // Get: Returns the specified autoscaler resource. Gets a list of
  28617. // available autoscalers by making a list() request.
  28618. func (r *AutoscalersService) Get(project string, zone string, autoscaler string) *AutoscalersGetCall {
  28619. c := &AutoscalersGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  28620. c.project = project
  28621. c.zone = zone
  28622. c.autoscaler = autoscaler
  28623. return c
  28624. }
  28625. // Fields allows partial responses to be retrieved. See
  28626. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  28627. // for more information.
  28628. func (c *AutoscalersGetCall) Fields(s ...googleapi.Field) *AutoscalersGetCall {
  28629. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  28630. return c
  28631. }
  28632. // IfNoneMatch sets the optional parameter which makes the operation
  28633. // fail if the object's ETag matches the given value. This is useful for
  28634. // getting updates only after the object has changed since the last
  28635. // request. Use googleapi.IsNotModified to check whether the response
  28636. // error from Do is the result of In-None-Match.
  28637. func (c *AutoscalersGetCall) IfNoneMatch(entityTag string) *AutoscalersGetCall {
  28638. c.ifNoneMatch_ = entityTag
  28639. return c
  28640. }
  28641. // Context sets the context to be used in this call's Do method. Any
  28642. // pending HTTP request will be aborted if the provided context is
  28643. // canceled.
  28644. func (c *AutoscalersGetCall) Context(ctx context.Context) *AutoscalersGetCall {
  28645. c.ctx_ = ctx
  28646. return c
  28647. }
  28648. // Header returns an http.Header that can be modified by the caller to
  28649. // add HTTP headers to the request.
  28650. func (c *AutoscalersGetCall) Header() http.Header {
  28651. if c.header_ == nil {
  28652. c.header_ = make(http.Header)
  28653. }
  28654. return c.header_
  28655. }
  28656. func (c *AutoscalersGetCall) doRequest(alt string) (*http.Response, error) {
  28657. reqHeaders := make(http.Header)
  28658. for k, v := range c.header_ {
  28659. reqHeaders[k] = v
  28660. }
  28661. reqHeaders.Set("User-Agent", c.s.userAgent())
  28662. if c.ifNoneMatch_ != "" {
  28663. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  28664. }
  28665. var body io.Reader = nil
  28666. c.urlParams_.Set("alt", alt)
  28667. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/autoscalers/{autoscaler}")
  28668. urls += "?" + c.urlParams_.Encode()
  28669. req, _ := http.NewRequest("GET", urls, body)
  28670. req.Header = reqHeaders
  28671. googleapi.Expand(req.URL, map[string]string{
  28672. "project": c.project,
  28673. "zone": c.zone,
  28674. "autoscaler": c.autoscaler,
  28675. })
  28676. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  28677. }
  28678. // Do executes the "compute.autoscalers.get" call.
  28679. // Exactly one of *Autoscaler or error will be non-nil. Any non-2xx
  28680. // status code is an error. Response headers are in either
  28681. // *Autoscaler.ServerResponse.Header or (if a response was returned at
  28682. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  28683. // to check whether the returned error was because
  28684. // http.StatusNotModified was returned.
  28685. func (c *AutoscalersGetCall) Do(opts ...googleapi.CallOption) (*Autoscaler, error) {
  28686. gensupport.SetOptions(c.urlParams_, opts...)
  28687. res, err := c.doRequest("json")
  28688. if res != nil && res.StatusCode == http.StatusNotModified {
  28689. if res.Body != nil {
  28690. res.Body.Close()
  28691. }
  28692. return nil, &googleapi.Error{
  28693. Code: res.StatusCode,
  28694. Header: res.Header,
  28695. }
  28696. }
  28697. if err != nil {
  28698. return nil, err
  28699. }
  28700. defer googleapi.CloseBody(res)
  28701. if err := googleapi.CheckResponse(res); err != nil {
  28702. return nil, err
  28703. }
  28704. ret := &Autoscaler{
  28705. ServerResponse: googleapi.ServerResponse{
  28706. Header: res.Header,
  28707. HTTPStatusCode: res.StatusCode,
  28708. },
  28709. }
  28710. target := &ret
  28711. if err := gensupport.DecodeResponse(target, res); err != nil {
  28712. return nil, err
  28713. }
  28714. return ret, nil
  28715. // {
  28716. // "description": "Returns the specified autoscaler resource. Gets a list of available autoscalers by making a list() request.",
  28717. // "httpMethod": "GET",
  28718. // "id": "compute.autoscalers.get",
  28719. // "parameterOrder": [
  28720. // "project",
  28721. // "zone",
  28722. // "autoscaler"
  28723. // ],
  28724. // "parameters": {
  28725. // "autoscaler": {
  28726. // "description": "Name of the autoscaler to return.",
  28727. // "location": "path",
  28728. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  28729. // "required": true,
  28730. // "type": "string"
  28731. // },
  28732. // "project": {
  28733. // "description": "Project ID for this request.",
  28734. // "location": "path",
  28735. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  28736. // "required": true,
  28737. // "type": "string"
  28738. // },
  28739. // "zone": {
  28740. // "description": "Name of the zone for this request.",
  28741. // "location": "path",
  28742. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  28743. // "required": true,
  28744. // "type": "string"
  28745. // }
  28746. // },
  28747. // "path": "{project}/zones/{zone}/autoscalers/{autoscaler}",
  28748. // "response": {
  28749. // "$ref": "Autoscaler"
  28750. // },
  28751. // "scopes": [
  28752. // "https://www.googleapis.com/auth/cloud-platform",
  28753. // "https://www.googleapis.com/auth/compute",
  28754. // "https://www.googleapis.com/auth/compute.readonly"
  28755. // ]
  28756. // }
  28757. }
  28758. // method id "compute.autoscalers.insert":
  28759. type AutoscalersInsertCall struct {
  28760. s *Service
  28761. project string
  28762. zone string
  28763. autoscaler *Autoscaler
  28764. urlParams_ gensupport.URLParams
  28765. ctx_ context.Context
  28766. header_ http.Header
  28767. }
  28768. // Insert: Creates an autoscaler in the specified project using the data
  28769. // included in the request.
  28770. func (r *AutoscalersService) Insert(project string, zone string, autoscaler *Autoscaler) *AutoscalersInsertCall {
  28771. c := &AutoscalersInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  28772. c.project = project
  28773. c.zone = zone
  28774. c.autoscaler = autoscaler
  28775. return c
  28776. }
  28777. // RequestId sets the optional parameter "requestId": An optional
  28778. // request ID to identify requests. Specify a unique request ID so that
  28779. // if you must retry your request, the server will know to ignore the
  28780. // request if it has already been completed.
  28781. //
  28782. // For example, consider a situation where you make an initial request
  28783. // and the request times out. If you make the request again with the
  28784. // same request ID, the server can check if original operation with the
  28785. // same request ID was received, and if so, will ignore the second
  28786. // request. This prevents clients from accidentally creating duplicate
  28787. // commitments.
  28788. //
  28789. // The request ID must be a valid UUID with the exception that zero UUID
  28790. // is not supported (00000000-0000-0000-0000-000000000000).
  28791. func (c *AutoscalersInsertCall) RequestId(requestId string) *AutoscalersInsertCall {
  28792. c.urlParams_.Set("requestId", requestId)
  28793. return c
  28794. }
  28795. // Fields allows partial responses to be retrieved. See
  28796. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  28797. // for more information.
  28798. func (c *AutoscalersInsertCall) Fields(s ...googleapi.Field) *AutoscalersInsertCall {
  28799. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  28800. return c
  28801. }
  28802. // Context sets the context to be used in this call's Do method. Any
  28803. // pending HTTP request will be aborted if the provided context is
  28804. // canceled.
  28805. func (c *AutoscalersInsertCall) Context(ctx context.Context) *AutoscalersInsertCall {
  28806. c.ctx_ = ctx
  28807. return c
  28808. }
  28809. // Header returns an http.Header that can be modified by the caller to
  28810. // add HTTP headers to the request.
  28811. func (c *AutoscalersInsertCall) Header() http.Header {
  28812. if c.header_ == nil {
  28813. c.header_ = make(http.Header)
  28814. }
  28815. return c.header_
  28816. }
  28817. func (c *AutoscalersInsertCall) doRequest(alt string) (*http.Response, error) {
  28818. reqHeaders := make(http.Header)
  28819. for k, v := range c.header_ {
  28820. reqHeaders[k] = v
  28821. }
  28822. reqHeaders.Set("User-Agent", c.s.userAgent())
  28823. var body io.Reader = nil
  28824. body, err := googleapi.WithoutDataWrapper.JSONReader(c.autoscaler)
  28825. if err != nil {
  28826. return nil, err
  28827. }
  28828. reqHeaders.Set("Content-Type", "application/json")
  28829. c.urlParams_.Set("alt", alt)
  28830. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/autoscalers")
  28831. urls += "?" + c.urlParams_.Encode()
  28832. req, _ := http.NewRequest("POST", urls, body)
  28833. req.Header = reqHeaders
  28834. googleapi.Expand(req.URL, map[string]string{
  28835. "project": c.project,
  28836. "zone": c.zone,
  28837. })
  28838. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  28839. }
  28840. // Do executes the "compute.autoscalers.insert" call.
  28841. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  28842. // status code is an error. Response headers are in either
  28843. // *Operation.ServerResponse.Header or (if a response was returned at
  28844. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  28845. // to check whether the returned error was because
  28846. // http.StatusNotModified was returned.
  28847. func (c *AutoscalersInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  28848. gensupport.SetOptions(c.urlParams_, opts...)
  28849. res, err := c.doRequest("json")
  28850. if res != nil && res.StatusCode == http.StatusNotModified {
  28851. if res.Body != nil {
  28852. res.Body.Close()
  28853. }
  28854. return nil, &googleapi.Error{
  28855. Code: res.StatusCode,
  28856. Header: res.Header,
  28857. }
  28858. }
  28859. if err != nil {
  28860. return nil, err
  28861. }
  28862. defer googleapi.CloseBody(res)
  28863. if err := googleapi.CheckResponse(res); err != nil {
  28864. return nil, err
  28865. }
  28866. ret := &Operation{
  28867. ServerResponse: googleapi.ServerResponse{
  28868. Header: res.Header,
  28869. HTTPStatusCode: res.StatusCode,
  28870. },
  28871. }
  28872. target := &ret
  28873. if err := gensupport.DecodeResponse(target, res); err != nil {
  28874. return nil, err
  28875. }
  28876. return ret, nil
  28877. // {
  28878. // "description": "Creates an autoscaler in the specified project using the data included in the request.",
  28879. // "httpMethod": "POST",
  28880. // "id": "compute.autoscalers.insert",
  28881. // "parameterOrder": [
  28882. // "project",
  28883. // "zone"
  28884. // ],
  28885. // "parameters": {
  28886. // "project": {
  28887. // "description": "Project ID for this request.",
  28888. // "location": "path",
  28889. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  28890. // "required": true,
  28891. // "type": "string"
  28892. // },
  28893. // "requestId": {
  28894. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  28895. // "location": "query",
  28896. // "type": "string"
  28897. // },
  28898. // "zone": {
  28899. // "description": "Name of the zone for this request.",
  28900. // "location": "path",
  28901. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  28902. // "required": true,
  28903. // "type": "string"
  28904. // }
  28905. // },
  28906. // "path": "{project}/zones/{zone}/autoscalers",
  28907. // "request": {
  28908. // "$ref": "Autoscaler"
  28909. // },
  28910. // "response": {
  28911. // "$ref": "Operation"
  28912. // },
  28913. // "scopes": [
  28914. // "https://www.googleapis.com/auth/cloud-platform",
  28915. // "https://www.googleapis.com/auth/compute"
  28916. // ]
  28917. // }
  28918. }
  28919. // method id "compute.autoscalers.list":
  28920. type AutoscalersListCall struct {
  28921. s *Service
  28922. project string
  28923. zone string
  28924. urlParams_ gensupport.URLParams
  28925. ifNoneMatch_ string
  28926. ctx_ context.Context
  28927. header_ http.Header
  28928. }
  28929. // List: Retrieves a list of autoscalers contained within the specified
  28930. // zone.
  28931. func (r *AutoscalersService) List(project string, zone string) *AutoscalersListCall {
  28932. c := &AutoscalersListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  28933. c.project = project
  28934. c.zone = zone
  28935. return c
  28936. }
  28937. // Filter sets the optional parameter "filter": A filter expression that
  28938. // filters resources listed in the response. The expression must specify
  28939. // the field name, a comparison operator, and the value that you want to
  28940. // use for filtering. The value must be a string, a number, or a
  28941. // boolean. The comparison operator must be either =, !=, >, or <.
  28942. //
  28943. // For example, if you are filtering Compute Engine instances, you can
  28944. // exclude instances named example-instance by specifying name !=
  28945. // example-instance.
  28946. //
  28947. // You can also filter nested fields. For example, you could specify
  28948. // scheduling.automaticRestart = false to include instances only if they
  28949. // are not scheduled for automatic restarts. You can use filtering on
  28950. // nested fields to filter based on resource labels.
  28951. //
  28952. // To filter on multiple expressions, provide each separate expression
  28953. // within parentheses. For example, (scheduling.automaticRestart = true)
  28954. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  28955. // AND expression. However, you can include AND and OR expressions
  28956. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  28957. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  28958. // true).
  28959. func (c *AutoscalersListCall) Filter(filter string) *AutoscalersListCall {
  28960. c.urlParams_.Set("filter", filter)
  28961. return c
  28962. }
  28963. // MaxResults sets the optional parameter "maxResults": The maximum
  28964. // number of results per page that should be returned. If the number of
  28965. // available results is larger than maxResults, Compute Engine returns a
  28966. // nextPageToken that can be used to get the next page of results in
  28967. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  28968. // (Default: 500)
  28969. func (c *AutoscalersListCall) MaxResults(maxResults int64) *AutoscalersListCall {
  28970. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  28971. return c
  28972. }
  28973. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  28974. // a certain order. By default, results are returned in alphanumerical
  28975. // order based on the resource name.
  28976. //
  28977. // You can also sort results in descending order based on the creation
  28978. // timestamp using orderBy="creationTimestamp desc". This sorts results
  28979. // based on the creationTimestamp field in reverse chronological order
  28980. // (newest result first). Use this to sort resources like operations so
  28981. // that the newest operation is returned first.
  28982. //
  28983. // Currently, only sorting by name or creationTimestamp desc is
  28984. // supported.
  28985. func (c *AutoscalersListCall) OrderBy(orderBy string) *AutoscalersListCall {
  28986. c.urlParams_.Set("orderBy", orderBy)
  28987. return c
  28988. }
  28989. // PageToken sets the optional parameter "pageToken": Specifies a page
  28990. // token to use. Set pageToken to the nextPageToken returned by a
  28991. // previous list request to get the next page of results.
  28992. func (c *AutoscalersListCall) PageToken(pageToken string) *AutoscalersListCall {
  28993. c.urlParams_.Set("pageToken", pageToken)
  28994. return c
  28995. }
  28996. // Fields allows partial responses to be retrieved. See
  28997. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  28998. // for more information.
  28999. func (c *AutoscalersListCall) Fields(s ...googleapi.Field) *AutoscalersListCall {
  29000. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  29001. return c
  29002. }
  29003. // IfNoneMatch sets the optional parameter which makes the operation
  29004. // fail if the object's ETag matches the given value. This is useful for
  29005. // getting updates only after the object has changed since the last
  29006. // request. Use googleapi.IsNotModified to check whether the response
  29007. // error from Do is the result of In-None-Match.
  29008. func (c *AutoscalersListCall) IfNoneMatch(entityTag string) *AutoscalersListCall {
  29009. c.ifNoneMatch_ = entityTag
  29010. return c
  29011. }
  29012. // Context sets the context to be used in this call's Do method. Any
  29013. // pending HTTP request will be aborted if the provided context is
  29014. // canceled.
  29015. func (c *AutoscalersListCall) Context(ctx context.Context) *AutoscalersListCall {
  29016. c.ctx_ = ctx
  29017. return c
  29018. }
  29019. // Header returns an http.Header that can be modified by the caller to
  29020. // add HTTP headers to the request.
  29021. func (c *AutoscalersListCall) Header() http.Header {
  29022. if c.header_ == nil {
  29023. c.header_ = make(http.Header)
  29024. }
  29025. return c.header_
  29026. }
  29027. func (c *AutoscalersListCall) doRequest(alt string) (*http.Response, error) {
  29028. reqHeaders := make(http.Header)
  29029. for k, v := range c.header_ {
  29030. reqHeaders[k] = v
  29031. }
  29032. reqHeaders.Set("User-Agent", c.s.userAgent())
  29033. if c.ifNoneMatch_ != "" {
  29034. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  29035. }
  29036. var body io.Reader = nil
  29037. c.urlParams_.Set("alt", alt)
  29038. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/autoscalers")
  29039. urls += "?" + c.urlParams_.Encode()
  29040. req, _ := http.NewRequest("GET", urls, body)
  29041. req.Header = reqHeaders
  29042. googleapi.Expand(req.URL, map[string]string{
  29043. "project": c.project,
  29044. "zone": c.zone,
  29045. })
  29046. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  29047. }
  29048. // Do executes the "compute.autoscalers.list" call.
  29049. // Exactly one of *AutoscalerList or error will be non-nil. Any non-2xx
  29050. // status code is an error. Response headers are in either
  29051. // *AutoscalerList.ServerResponse.Header or (if a response was returned
  29052. // at all) in error.(*googleapi.Error).Header. Use
  29053. // googleapi.IsNotModified to check whether the returned error was
  29054. // because http.StatusNotModified was returned.
  29055. func (c *AutoscalersListCall) Do(opts ...googleapi.CallOption) (*AutoscalerList, error) {
  29056. gensupport.SetOptions(c.urlParams_, opts...)
  29057. res, err := c.doRequest("json")
  29058. if res != nil && res.StatusCode == http.StatusNotModified {
  29059. if res.Body != nil {
  29060. res.Body.Close()
  29061. }
  29062. return nil, &googleapi.Error{
  29063. Code: res.StatusCode,
  29064. Header: res.Header,
  29065. }
  29066. }
  29067. if err != nil {
  29068. return nil, err
  29069. }
  29070. defer googleapi.CloseBody(res)
  29071. if err := googleapi.CheckResponse(res); err != nil {
  29072. return nil, err
  29073. }
  29074. ret := &AutoscalerList{
  29075. ServerResponse: googleapi.ServerResponse{
  29076. Header: res.Header,
  29077. HTTPStatusCode: res.StatusCode,
  29078. },
  29079. }
  29080. target := &ret
  29081. if err := gensupport.DecodeResponse(target, res); err != nil {
  29082. return nil, err
  29083. }
  29084. return ret, nil
  29085. // {
  29086. // "description": "Retrieves a list of autoscalers contained within the specified zone.",
  29087. // "httpMethod": "GET",
  29088. // "id": "compute.autoscalers.list",
  29089. // "parameterOrder": [
  29090. // "project",
  29091. // "zone"
  29092. // ],
  29093. // "parameters": {
  29094. // "filter": {
  29095. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  29096. // "location": "query",
  29097. // "type": "string"
  29098. // },
  29099. // "maxResults": {
  29100. // "default": "500",
  29101. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  29102. // "format": "uint32",
  29103. // "location": "query",
  29104. // "minimum": "0",
  29105. // "type": "integer"
  29106. // },
  29107. // "orderBy": {
  29108. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  29109. // "location": "query",
  29110. // "type": "string"
  29111. // },
  29112. // "pageToken": {
  29113. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  29114. // "location": "query",
  29115. // "type": "string"
  29116. // },
  29117. // "project": {
  29118. // "description": "Project ID for this request.",
  29119. // "location": "path",
  29120. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  29121. // "required": true,
  29122. // "type": "string"
  29123. // },
  29124. // "zone": {
  29125. // "description": "Name of the zone for this request.",
  29126. // "location": "path",
  29127. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  29128. // "required": true,
  29129. // "type": "string"
  29130. // }
  29131. // },
  29132. // "path": "{project}/zones/{zone}/autoscalers",
  29133. // "response": {
  29134. // "$ref": "AutoscalerList"
  29135. // },
  29136. // "scopes": [
  29137. // "https://www.googleapis.com/auth/cloud-platform",
  29138. // "https://www.googleapis.com/auth/compute",
  29139. // "https://www.googleapis.com/auth/compute.readonly"
  29140. // ]
  29141. // }
  29142. }
  29143. // Pages invokes f for each page of results.
  29144. // A non-nil error returned from f will halt the iteration.
  29145. // The provided context supersedes any context provided to the Context method.
  29146. func (c *AutoscalersListCall) Pages(ctx context.Context, f func(*AutoscalerList) error) error {
  29147. c.ctx_ = ctx
  29148. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  29149. for {
  29150. x, err := c.Do()
  29151. if err != nil {
  29152. return err
  29153. }
  29154. if err := f(x); err != nil {
  29155. return err
  29156. }
  29157. if x.NextPageToken == "" {
  29158. return nil
  29159. }
  29160. c.PageToken(x.NextPageToken)
  29161. }
  29162. }
  29163. // method id "compute.autoscalers.patch":
  29164. type AutoscalersPatchCall struct {
  29165. s *Service
  29166. project string
  29167. zone string
  29168. autoscaler *Autoscaler
  29169. urlParams_ gensupport.URLParams
  29170. ctx_ context.Context
  29171. header_ http.Header
  29172. }
  29173. // Patch: Updates an autoscaler in the specified project using the data
  29174. // included in the request. This method supports PATCH semantics and
  29175. // uses the JSON merge patch format and processing rules.
  29176. func (r *AutoscalersService) Patch(project string, zone string, autoscaler *Autoscaler) *AutoscalersPatchCall {
  29177. c := &AutoscalersPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  29178. c.project = project
  29179. c.zone = zone
  29180. c.autoscaler = autoscaler
  29181. return c
  29182. }
  29183. // Autoscaler sets the optional parameter "autoscaler": Name of the
  29184. // autoscaler to patch.
  29185. func (c *AutoscalersPatchCall) Autoscaler(autoscaler string) *AutoscalersPatchCall {
  29186. c.urlParams_.Set("autoscaler", autoscaler)
  29187. return c
  29188. }
  29189. // RequestId sets the optional parameter "requestId": An optional
  29190. // request ID to identify requests. Specify a unique request ID so that
  29191. // if you must retry your request, the server will know to ignore the
  29192. // request if it has already been completed.
  29193. //
  29194. // For example, consider a situation where you make an initial request
  29195. // and the request times out. If you make the request again with the
  29196. // same request ID, the server can check if original operation with the
  29197. // same request ID was received, and if so, will ignore the second
  29198. // request. This prevents clients from accidentally creating duplicate
  29199. // commitments.
  29200. //
  29201. // The request ID must be a valid UUID with the exception that zero UUID
  29202. // is not supported (00000000-0000-0000-0000-000000000000).
  29203. func (c *AutoscalersPatchCall) RequestId(requestId string) *AutoscalersPatchCall {
  29204. c.urlParams_.Set("requestId", requestId)
  29205. return c
  29206. }
  29207. // Fields allows partial responses to be retrieved. See
  29208. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  29209. // for more information.
  29210. func (c *AutoscalersPatchCall) Fields(s ...googleapi.Field) *AutoscalersPatchCall {
  29211. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  29212. return c
  29213. }
  29214. // Context sets the context to be used in this call's Do method. Any
  29215. // pending HTTP request will be aborted if the provided context is
  29216. // canceled.
  29217. func (c *AutoscalersPatchCall) Context(ctx context.Context) *AutoscalersPatchCall {
  29218. c.ctx_ = ctx
  29219. return c
  29220. }
  29221. // Header returns an http.Header that can be modified by the caller to
  29222. // add HTTP headers to the request.
  29223. func (c *AutoscalersPatchCall) Header() http.Header {
  29224. if c.header_ == nil {
  29225. c.header_ = make(http.Header)
  29226. }
  29227. return c.header_
  29228. }
  29229. func (c *AutoscalersPatchCall) doRequest(alt string) (*http.Response, error) {
  29230. reqHeaders := make(http.Header)
  29231. for k, v := range c.header_ {
  29232. reqHeaders[k] = v
  29233. }
  29234. reqHeaders.Set("User-Agent", c.s.userAgent())
  29235. var body io.Reader = nil
  29236. body, err := googleapi.WithoutDataWrapper.JSONReader(c.autoscaler)
  29237. if err != nil {
  29238. return nil, err
  29239. }
  29240. reqHeaders.Set("Content-Type", "application/json")
  29241. c.urlParams_.Set("alt", alt)
  29242. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/autoscalers")
  29243. urls += "?" + c.urlParams_.Encode()
  29244. req, _ := http.NewRequest("PATCH", urls, body)
  29245. req.Header = reqHeaders
  29246. googleapi.Expand(req.URL, map[string]string{
  29247. "project": c.project,
  29248. "zone": c.zone,
  29249. })
  29250. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  29251. }
  29252. // Do executes the "compute.autoscalers.patch" call.
  29253. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  29254. // status code is an error. Response headers are in either
  29255. // *Operation.ServerResponse.Header or (if a response was returned at
  29256. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  29257. // to check whether the returned error was because
  29258. // http.StatusNotModified was returned.
  29259. func (c *AutoscalersPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  29260. gensupport.SetOptions(c.urlParams_, opts...)
  29261. res, err := c.doRequest("json")
  29262. if res != nil && res.StatusCode == http.StatusNotModified {
  29263. if res.Body != nil {
  29264. res.Body.Close()
  29265. }
  29266. return nil, &googleapi.Error{
  29267. Code: res.StatusCode,
  29268. Header: res.Header,
  29269. }
  29270. }
  29271. if err != nil {
  29272. return nil, err
  29273. }
  29274. defer googleapi.CloseBody(res)
  29275. if err := googleapi.CheckResponse(res); err != nil {
  29276. return nil, err
  29277. }
  29278. ret := &Operation{
  29279. ServerResponse: googleapi.ServerResponse{
  29280. Header: res.Header,
  29281. HTTPStatusCode: res.StatusCode,
  29282. },
  29283. }
  29284. target := &ret
  29285. if err := gensupport.DecodeResponse(target, res); err != nil {
  29286. return nil, err
  29287. }
  29288. return ret, nil
  29289. // {
  29290. // "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.",
  29291. // "httpMethod": "PATCH",
  29292. // "id": "compute.autoscalers.patch",
  29293. // "parameterOrder": [
  29294. // "project",
  29295. // "zone"
  29296. // ],
  29297. // "parameters": {
  29298. // "autoscaler": {
  29299. // "description": "Name of the autoscaler to patch.",
  29300. // "location": "query",
  29301. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  29302. // "type": "string"
  29303. // },
  29304. // "project": {
  29305. // "description": "Project ID for this request.",
  29306. // "location": "path",
  29307. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  29308. // "required": true,
  29309. // "type": "string"
  29310. // },
  29311. // "requestId": {
  29312. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  29313. // "location": "query",
  29314. // "type": "string"
  29315. // },
  29316. // "zone": {
  29317. // "description": "Name of the zone for this request.",
  29318. // "location": "path",
  29319. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  29320. // "required": true,
  29321. // "type": "string"
  29322. // }
  29323. // },
  29324. // "path": "{project}/zones/{zone}/autoscalers",
  29325. // "request": {
  29326. // "$ref": "Autoscaler"
  29327. // },
  29328. // "response": {
  29329. // "$ref": "Operation"
  29330. // },
  29331. // "scopes": [
  29332. // "https://www.googleapis.com/auth/cloud-platform",
  29333. // "https://www.googleapis.com/auth/compute"
  29334. // ]
  29335. // }
  29336. }
  29337. // method id "compute.autoscalers.testIamPermissions":
  29338. type AutoscalersTestIamPermissionsCall struct {
  29339. s *Service
  29340. project string
  29341. zone string
  29342. resource string
  29343. testpermissionsrequest *TestPermissionsRequest
  29344. urlParams_ gensupport.URLParams
  29345. ctx_ context.Context
  29346. header_ http.Header
  29347. }
  29348. // TestIamPermissions: Returns permissions that a caller has on the
  29349. // specified resource.
  29350. func (r *AutoscalersService) TestIamPermissions(project string, zone string, resource string, testpermissionsrequest *TestPermissionsRequest) *AutoscalersTestIamPermissionsCall {
  29351. c := &AutoscalersTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  29352. c.project = project
  29353. c.zone = zone
  29354. c.resource = resource
  29355. c.testpermissionsrequest = testpermissionsrequest
  29356. return c
  29357. }
  29358. // Fields allows partial responses to be retrieved. See
  29359. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  29360. // for more information.
  29361. func (c *AutoscalersTestIamPermissionsCall) Fields(s ...googleapi.Field) *AutoscalersTestIamPermissionsCall {
  29362. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  29363. return c
  29364. }
  29365. // Context sets the context to be used in this call's Do method. Any
  29366. // pending HTTP request will be aborted if the provided context is
  29367. // canceled.
  29368. func (c *AutoscalersTestIamPermissionsCall) Context(ctx context.Context) *AutoscalersTestIamPermissionsCall {
  29369. c.ctx_ = ctx
  29370. return c
  29371. }
  29372. // Header returns an http.Header that can be modified by the caller to
  29373. // add HTTP headers to the request.
  29374. func (c *AutoscalersTestIamPermissionsCall) Header() http.Header {
  29375. if c.header_ == nil {
  29376. c.header_ = make(http.Header)
  29377. }
  29378. return c.header_
  29379. }
  29380. func (c *AutoscalersTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  29381. reqHeaders := make(http.Header)
  29382. for k, v := range c.header_ {
  29383. reqHeaders[k] = v
  29384. }
  29385. reqHeaders.Set("User-Agent", c.s.userAgent())
  29386. var body io.Reader = nil
  29387. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  29388. if err != nil {
  29389. return nil, err
  29390. }
  29391. reqHeaders.Set("Content-Type", "application/json")
  29392. c.urlParams_.Set("alt", alt)
  29393. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/autoscalers/{resource}/testIamPermissions")
  29394. urls += "?" + c.urlParams_.Encode()
  29395. req, _ := http.NewRequest("POST", urls, body)
  29396. req.Header = reqHeaders
  29397. googleapi.Expand(req.URL, map[string]string{
  29398. "project": c.project,
  29399. "zone": c.zone,
  29400. "resource": c.resource,
  29401. })
  29402. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  29403. }
  29404. // Do executes the "compute.autoscalers.testIamPermissions" call.
  29405. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  29406. // non-2xx status code is an error. Response headers are in either
  29407. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  29408. // returned at all) in error.(*googleapi.Error).Header. Use
  29409. // googleapi.IsNotModified to check whether the returned error was
  29410. // because http.StatusNotModified was returned.
  29411. func (c *AutoscalersTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  29412. gensupport.SetOptions(c.urlParams_, opts...)
  29413. res, err := c.doRequest("json")
  29414. if res != nil && res.StatusCode == http.StatusNotModified {
  29415. if res.Body != nil {
  29416. res.Body.Close()
  29417. }
  29418. return nil, &googleapi.Error{
  29419. Code: res.StatusCode,
  29420. Header: res.Header,
  29421. }
  29422. }
  29423. if err != nil {
  29424. return nil, err
  29425. }
  29426. defer googleapi.CloseBody(res)
  29427. if err := googleapi.CheckResponse(res); err != nil {
  29428. return nil, err
  29429. }
  29430. ret := &TestPermissionsResponse{
  29431. ServerResponse: googleapi.ServerResponse{
  29432. Header: res.Header,
  29433. HTTPStatusCode: res.StatusCode,
  29434. },
  29435. }
  29436. target := &ret
  29437. if err := gensupport.DecodeResponse(target, res); err != nil {
  29438. return nil, err
  29439. }
  29440. return ret, nil
  29441. // {
  29442. // "description": "Returns permissions that a caller has on the specified resource.",
  29443. // "httpMethod": "POST",
  29444. // "id": "compute.autoscalers.testIamPermissions",
  29445. // "parameterOrder": [
  29446. // "project",
  29447. // "zone",
  29448. // "resource"
  29449. // ],
  29450. // "parameters": {
  29451. // "project": {
  29452. // "description": "Project ID for this request.",
  29453. // "location": "path",
  29454. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  29455. // "required": true,
  29456. // "type": "string"
  29457. // },
  29458. // "resource": {
  29459. // "description": "Name of the resource for this request.",
  29460. // "location": "path",
  29461. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  29462. // "required": true,
  29463. // "type": "string"
  29464. // },
  29465. // "zone": {
  29466. // "description": "The name of the zone for this request.",
  29467. // "location": "path",
  29468. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  29469. // "required": true,
  29470. // "type": "string"
  29471. // }
  29472. // },
  29473. // "path": "{project}/zones/{zone}/autoscalers/{resource}/testIamPermissions",
  29474. // "request": {
  29475. // "$ref": "TestPermissionsRequest"
  29476. // },
  29477. // "response": {
  29478. // "$ref": "TestPermissionsResponse"
  29479. // },
  29480. // "scopes": [
  29481. // "https://www.googleapis.com/auth/cloud-platform",
  29482. // "https://www.googleapis.com/auth/compute",
  29483. // "https://www.googleapis.com/auth/compute.readonly"
  29484. // ]
  29485. // }
  29486. }
  29487. // method id "compute.autoscalers.update":
  29488. type AutoscalersUpdateCall struct {
  29489. s *Service
  29490. project string
  29491. zone string
  29492. autoscaler *Autoscaler
  29493. urlParams_ gensupport.URLParams
  29494. ctx_ context.Context
  29495. header_ http.Header
  29496. }
  29497. // Update: Updates an autoscaler in the specified project using the data
  29498. // included in the request.
  29499. func (r *AutoscalersService) Update(project string, zone string, autoscaler *Autoscaler) *AutoscalersUpdateCall {
  29500. c := &AutoscalersUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  29501. c.project = project
  29502. c.zone = zone
  29503. c.autoscaler = autoscaler
  29504. return c
  29505. }
  29506. // Autoscaler sets the optional parameter "autoscaler": Name of the
  29507. // autoscaler to update.
  29508. func (c *AutoscalersUpdateCall) Autoscaler(autoscaler string) *AutoscalersUpdateCall {
  29509. c.urlParams_.Set("autoscaler", autoscaler)
  29510. return c
  29511. }
  29512. // RequestId sets the optional parameter "requestId": An optional
  29513. // request ID to identify requests. Specify a unique request ID so that
  29514. // if you must retry your request, the server will know to ignore the
  29515. // request if it has already been completed.
  29516. //
  29517. // For example, consider a situation where you make an initial request
  29518. // and the request times out. If you make the request again with the
  29519. // same request ID, the server can check if original operation with the
  29520. // same request ID was received, and if so, will ignore the second
  29521. // request. This prevents clients from accidentally creating duplicate
  29522. // commitments.
  29523. //
  29524. // The request ID must be a valid UUID with the exception that zero UUID
  29525. // is not supported (00000000-0000-0000-0000-000000000000).
  29526. func (c *AutoscalersUpdateCall) RequestId(requestId string) *AutoscalersUpdateCall {
  29527. c.urlParams_.Set("requestId", requestId)
  29528. return c
  29529. }
  29530. // Fields allows partial responses to be retrieved. See
  29531. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  29532. // for more information.
  29533. func (c *AutoscalersUpdateCall) Fields(s ...googleapi.Field) *AutoscalersUpdateCall {
  29534. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  29535. return c
  29536. }
  29537. // Context sets the context to be used in this call's Do method. Any
  29538. // pending HTTP request will be aborted if the provided context is
  29539. // canceled.
  29540. func (c *AutoscalersUpdateCall) Context(ctx context.Context) *AutoscalersUpdateCall {
  29541. c.ctx_ = ctx
  29542. return c
  29543. }
  29544. // Header returns an http.Header that can be modified by the caller to
  29545. // add HTTP headers to the request.
  29546. func (c *AutoscalersUpdateCall) Header() http.Header {
  29547. if c.header_ == nil {
  29548. c.header_ = make(http.Header)
  29549. }
  29550. return c.header_
  29551. }
  29552. func (c *AutoscalersUpdateCall) doRequest(alt string) (*http.Response, error) {
  29553. reqHeaders := make(http.Header)
  29554. for k, v := range c.header_ {
  29555. reqHeaders[k] = v
  29556. }
  29557. reqHeaders.Set("User-Agent", c.s.userAgent())
  29558. var body io.Reader = nil
  29559. body, err := googleapi.WithoutDataWrapper.JSONReader(c.autoscaler)
  29560. if err != nil {
  29561. return nil, err
  29562. }
  29563. reqHeaders.Set("Content-Type", "application/json")
  29564. c.urlParams_.Set("alt", alt)
  29565. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/autoscalers")
  29566. urls += "?" + c.urlParams_.Encode()
  29567. req, _ := http.NewRequest("PUT", urls, body)
  29568. req.Header = reqHeaders
  29569. googleapi.Expand(req.URL, map[string]string{
  29570. "project": c.project,
  29571. "zone": c.zone,
  29572. })
  29573. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  29574. }
  29575. // Do executes the "compute.autoscalers.update" call.
  29576. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  29577. // status code is an error. Response headers are in either
  29578. // *Operation.ServerResponse.Header or (if a response was returned at
  29579. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  29580. // to check whether the returned error was because
  29581. // http.StatusNotModified was returned.
  29582. func (c *AutoscalersUpdateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  29583. gensupport.SetOptions(c.urlParams_, opts...)
  29584. res, err := c.doRequest("json")
  29585. if res != nil && res.StatusCode == http.StatusNotModified {
  29586. if res.Body != nil {
  29587. res.Body.Close()
  29588. }
  29589. return nil, &googleapi.Error{
  29590. Code: res.StatusCode,
  29591. Header: res.Header,
  29592. }
  29593. }
  29594. if err != nil {
  29595. return nil, err
  29596. }
  29597. defer googleapi.CloseBody(res)
  29598. if err := googleapi.CheckResponse(res); err != nil {
  29599. return nil, err
  29600. }
  29601. ret := &Operation{
  29602. ServerResponse: googleapi.ServerResponse{
  29603. Header: res.Header,
  29604. HTTPStatusCode: res.StatusCode,
  29605. },
  29606. }
  29607. target := &ret
  29608. if err := gensupport.DecodeResponse(target, res); err != nil {
  29609. return nil, err
  29610. }
  29611. return ret, nil
  29612. // {
  29613. // "description": "Updates an autoscaler in the specified project using the data included in the request.",
  29614. // "httpMethod": "PUT",
  29615. // "id": "compute.autoscalers.update",
  29616. // "parameterOrder": [
  29617. // "project",
  29618. // "zone"
  29619. // ],
  29620. // "parameters": {
  29621. // "autoscaler": {
  29622. // "description": "Name of the autoscaler to update.",
  29623. // "location": "query",
  29624. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  29625. // "type": "string"
  29626. // },
  29627. // "project": {
  29628. // "description": "Project ID for this request.",
  29629. // "location": "path",
  29630. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  29631. // "required": true,
  29632. // "type": "string"
  29633. // },
  29634. // "requestId": {
  29635. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  29636. // "location": "query",
  29637. // "type": "string"
  29638. // },
  29639. // "zone": {
  29640. // "description": "Name of the zone for this request.",
  29641. // "location": "path",
  29642. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  29643. // "required": true,
  29644. // "type": "string"
  29645. // }
  29646. // },
  29647. // "path": "{project}/zones/{zone}/autoscalers",
  29648. // "request": {
  29649. // "$ref": "Autoscaler"
  29650. // },
  29651. // "response": {
  29652. // "$ref": "Operation"
  29653. // },
  29654. // "scopes": [
  29655. // "https://www.googleapis.com/auth/cloud-platform",
  29656. // "https://www.googleapis.com/auth/compute"
  29657. // ]
  29658. // }
  29659. }
  29660. // method id "compute.backendBuckets.addSignedUrlKey":
  29661. type BackendBucketsAddSignedUrlKeyCall struct {
  29662. s *Service
  29663. project string
  29664. backendBucket string
  29665. signedurlkey *SignedUrlKey
  29666. urlParams_ gensupport.URLParams
  29667. ctx_ context.Context
  29668. header_ http.Header
  29669. }
  29670. // AddSignedUrlKey: Adds the given Signed URL Key to the backend bucket.
  29671. func (r *BackendBucketsService) AddSignedUrlKey(project string, backendBucket string, signedurlkey *SignedUrlKey) *BackendBucketsAddSignedUrlKeyCall {
  29672. c := &BackendBucketsAddSignedUrlKeyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  29673. c.project = project
  29674. c.backendBucket = backendBucket
  29675. c.signedurlkey = signedurlkey
  29676. return c
  29677. }
  29678. // RequestId sets the optional parameter "requestId": An optional
  29679. // request ID to identify requests. Specify a unique request ID so that
  29680. // if you must retry your request, the server will know to ignore the
  29681. // request if it has already been completed.
  29682. //
  29683. // For example, consider a situation where you make an initial request
  29684. // and the request times out. If you make the request again with the
  29685. // same request ID, the server can check if original operation with the
  29686. // same request ID was received, and if so, will ignore the second
  29687. // request. This prevents clients from accidentally creating duplicate
  29688. // commitments.
  29689. //
  29690. // The request ID must be a valid UUID with the exception that zero UUID
  29691. // is not supported (00000000-0000-0000-0000-000000000000).
  29692. func (c *BackendBucketsAddSignedUrlKeyCall) RequestId(requestId string) *BackendBucketsAddSignedUrlKeyCall {
  29693. c.urlParams_.Set("requestId", requestId)
  29694. return c
  29695. }
  29696. // Fields allows partial responses to be retrieved. See
  29697. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  29698. // for more information.
  29699. func (c *BackendBucketsAddSignedUrlKeyCall) Fields(s ...googleapi.Field) *BackendBucketsAddSignedUrlKeyCall {
  29700. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  29701. return c
  29702. }
  29703. // Context sets the context to be used in this call's Do method. Any
  29704. // pending HTTP request will be aborted if the provided context is
  29705. // canceled.
  29706. func (c *BackendBucketsAddSignedUrlKeyCall) Context(ctx context.Context) *BackendBucketsAddSignedUrlKeyCall {
  29707. c.ctx_ = ctx
  29708. return c
  29709. }
  29710. // Header returns an http.Header that can be modified by the caller to
  29711. // add HTTP headers to the request.
  29712. func (c *BackendBucketsAddSignedUrlKeyCall) Header() http.Header {
  29713. if c.header_ == nil {
  29714. c.header_ = make(http.Header)
  29715. }
  29716. return c.header_
  29717. }
  29718. func (c *BackendBucketsAddSignedUrlKeyCall) doRequest(alt string) (*http.Response, error) {
  29719. reqHeaders := make(http.Header)
  29720. for k, v := range c.header_ {
  29721. reqHeaders[k] = v
  29722. }
  29723. reqHeaders.Set("User-Agent", c.s.userAgent())
  29724. var body io.Reader = nil
  29725. body, err := googleapi.WithoutDataWrapper.JSONReader(c.signedurlkey)
  29726. if err != nil {
  29727. return nil, err
  29728. }
  29729. reqHeaders.Set("Content-Type", "application/json")
  29730. c.urlParams_.Set("alt", alt)
  29731. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/backendBuckets/{backendBucket}/addSignedUrlKey")
  29732. urls += "?" + c.urlParams_.Encode()
  29733. req, _ := http.NewRequest("POST", urls, body)
  29734. req.Header = reqHeaders
  29735. googleapi.Expand(req.URL, map[string]string{
  29736. "project": c.project,
  29737. "backendBucket": c.backendBucket,
  29738. })
  29739. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  29740. }
  29741. // Do executes the "compute.backendBuckets.addSignedUrlKey" call.
  29742. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  29743. // status code is an error. Response headers are in either
  29744. // *Operation.ServerResponse.Header or (if a response was returned at
  29745. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  29746. // to check whether the returned error was because
  29747. // http.StatusNotModified was returned.
  29748. func (c *BackendBucketsAddSignedUrlKeyCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  29749. gensupport.SetOptions(c.urlParams_, opts...)
  29750. res, err := c.doRequest("json")
  29751. if res != nil && res.StatusCode == http.StatusNotModified {
  29752. if res.Body != nil {
  29753. res.Body.Close()
  29754. }
  29755. return nil, &googleapi.Error{
  29756. Code: res.StatusCode,
  29757. Header: res.Header,
  29758. }
  29759. }
  29760. if err != nil {
  29761. return nil, err
  29762. }
  29763. defer googleapi.CloseBody(res)
  29764. if err := googleapi.CheckResponse(res); err != nil {
  29765. return nil, err
  29766. }
  29767. ret := &Operation{
  29768. ServerResponse: googleapi.ServerResponse{
  29769. Header: res.Header,
  29770. HTTPStatusCode: res.StatusCode,
  29771. },
  29772. }
  29773. target := &ret
  29774. if err := gensupport.DecodeResponse(target, res); err != nil {
  29775. return nil, err
  29776. }
  29777. return ret, nil
  29778. // {
  29779. // "description": "Adds the given Signed URL Key to the backend bucket.",
  29780. // "httpMethod": "POST",
  29781. // "id": "compute.backendBuckets.addSignedUrlKey",
  29782. // "parameterOrder": [
  29783. // "project",
  29784. // "backendBucket"
  29785. // ],
  29786. // "parameters": {
  29787. // "backendBucket": {
  29788. // "description": "Name of the BackendBucket resource to which the Signed URL Key should be added. The name should conform to RFC1035.",
  29789. // "location": "path",
  29790. // "required": true,
  29791. // "type": "string"
  29792. // },
  29793. // "project": {
  29794. // "description": "Project ID for this request.",
  29795. // "location": "path",
  29796. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  29797. // "required": true,
  29798. // "type": "string"
  29799. // },
  29800. // "requestId": {
  29801. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  29802. // "location": "query",
  29803. // "type": "string"
  29804. // }
  29805. // },
  29806. // "path": "{project}/global/backendBuckets/{backendBucket}/addSignedUrlKey",
  29807. // "request": {
  29808. // "$ref": "SignedUrlKey"
  29809. // },
  29810. // "response": {
  29811. // "$ref": "Operation"
  29812. // },
  29813. // "scopes": [
  29814. // "https://www.googleapis.com/auth/cloud-platform",
  29815. // "https://www.googleapis.com/auth/compute"
  29816. // ]
  29817. // }
  29818. }
  29819. // method id "compute.backendBuckets.delete":
  29820. type BackendBucketsDeleteCall struct {
  29821. s *Service
  29822. project string
  29823. backendBucket string
  29824. urlParams_ gensupport.URLParams
  29825. ctx_ context.Context
  29826. header_ http.Header
  29827. }
  29828. // Delete: Deletes the specified BackendBucket resource.
  29829. func (r *BackendBucketsService) Delete(project string, backendBucket string) *BackendBucketsDeleteCall {
  29830. c := &BackendBucketsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  29831. c.project = project
  29832. c.backendBucket = backendBucket
  29833. return c
  29834. }
  29835. // RequestId sets the optional parameter "requestId": An optional
  29836. // request ID to identify requests. Specify a unique request ID so that
  29837. // if you must retry your request, the server will know to ignore the
  29838. // request if it has already been completed.
  29839. //
  29840. // For example, consider a situation where you make an initial request
  29841. // and the request times out. If you make the request again with the
  29842. // same request ID, the server can check if original operation with the
  29843. // same request ID was received, and if so, will ignore the second
  29844. // request. This prevents clients from accidentally creating duplicate
  29845. // commitments.
  29846. //
  29847. // The request ID must be a valid UUID with the exception that zero UUID
  29848. // is not supported (00000000-0000-0000-0000-000000000000).
  29849. func (c *BackendBucketsDeleteCall) RequestId(requestId string) *BackendBucketsDeleteCall {
  29850. c.urlParams_.Set("requestId", requestId)
  29851. return c
  29852. }
  29853. // Fields allows partial responses to be retrieved. See
  29854. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  29855. // for more information.
  29856. func (c *BackendBucketsDeleteCall) Fields(s ...googleapi.Field) *BackendBucketsDeleteCall {
  29857. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  29858. return c
  29859. }
  29860. // Context sets the context to be used in this call's Do method. Any
  29861. // pending HTTP request will be aborted if the provided context is
  29862. // canceled.
  29863. func (c *BackendBucketsDeleteCall) Context(ctx context.Context) *BackendBucketsDeleteCall {
  29864. c.ctx_ = ctx
  29865. return c
  29866. }
  29867. // Header returns an http.Header that can be modified by the caller to
  29868. // add HTTP headers to the request.
  29869. func (c *BackendBucketsDeleteCall) Header() http.Header {
  29870. if c.header_ == nil {
  29871. c.header_ = make(http.Header)
  29872. }
  29873. return c.header_
  29874. }
  29875. func (c *BackendBucketsDeleteCall) doRequest(alt string) (*http.Response, error) {
  29876. reqHeaders := make(http.Header)
  29877. for k, v := range c.header_ {
  29878. reqHeaders[k] = v
  29879. }
  29880. reqHeaders.Set("User-Agent", c.s.userAgent())
  29881. var body io.Reader = nil
  29882. c.urlParams_.Set("alt", alt)
  29883. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/backendBuckets/{backendBucket}")
  29884. urls += "?" + c.urlParams_.Encode()
  29885. req, _ := http.NewRequest("DELETE", urls, body)
  29886. req.Header = reqHeaders
  29887. googleapi.Expand(req.URL, map[string]string{
  29888. "project": c.project,
  29889. "backendBucket": c.backendBucket,
  29890. })
  29891. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  29892. }
  29893. // Do executes the "compute.backendBuckets.delete" call.
  29894. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  29895. // status code is an error. Response headers are in either
  29896. // *Operation.ServerResponse.Header or (if a response was returned at
  29897. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  29898. // to check whether the returned error was because
  29899. // http.StatusNotModified was returned.
  29900. func (c *BackendBucketsDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  29901. gensupport.SetOptions(c.urlParams_, opts...)
  29902. res, err := c.doRequest("json")
  29903. if res != nil && res.StatusCode == http.StatusNotModified {
  29904. if res.Body != nil {
  29905. res.Body.Close()
  29906. }
  29907. return nil, &googleapi.Error{
  29908. Code: res.StatusCode,
  29909. Header: res.Header,
  29910. }
  29911. }
  29912. if err != nil {
  29913. return nil, err
  29914. }
  29915. defer googleapi.CloseBody(res)
  29916. if err := googleapi.CheckResponse(res); err != nil {
  29917. return nil, err
  29918. }
  29919. ret := &Operation{
  29920. ServerResponse: googleapi.ServerResponse{
  29921. Header: res.Header,
  29922. HTTPStatusCode: res.StatusCode,
  29923. },
  29924. }
  29925. target := &ret
  29926. if err := gensupport.DecodeResponse(target, res); err != nil {
  29927. return nil, err
  29928. }
  29929. return ret, nil
  29930. // {
  29931. // "description": "Deletes the specified BackendBucket resource.",
  29932. // "httpMethod": "DELETE",
  29933. // "id": "compute.backendBuckets.delete",
  29934. // "parameterOrder": [
  29935. // "project",
  29936. // "backendBucket"
  29937. // ],
  29938. // "parameters": {
  29939. // "backendBucket": {
  29940. // "description": "Name of the BackendBucket resource to delete.",
  29941. // "location": "path",
  29942. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  29943. // "required": true,
  29944. // "type": "string"
  29945. // },
  29946. // "project": {
  29947. // "description": "Project ID for this request.",
  29948. // "location": "path",
  29949. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  29950. // "required": true,
  29951. // "type": "string"
  29952. // },
  29953. // "requestId": {
  29954. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  29955. // "location": "query",
  29956. // "type": "string"
  29957. // }
  29958. // },
  29959. // "path": "{project}/global/backendBuckets/{backendBucket}",
  29960. // "response": {
  29961. // "$ref": "Operation"
  29962. // },
  29963. // "scopes": [
  29964. // "https://www.googleapis.com/auth/cloud-platform",
  29965. // "https://www.googleapis.com/auth/compute"
  29966. // ]
  29967. // }
  29968. }
  29969. // method id "compute.backendBuckets.deleteSignedUrlKey":
  29970. type BackendBucketsDeleteSignedUrlKeyCall struct {
  29971. s *Service
  29972. project string
  29973. backendBucket string
  29974. urlParams_ gensupport.URLParams
  29975. ctx_ context.Context
  29976. header_ http.Header
  29977. }
  29978. // DeleteSignedUrlKey: Deletes the given Signed URL Key from the backend
  29979. // bucket.
  29980. func (r *BackendBucketsService) DeleteSignedUrlKey(project string, backendBucket string, keyName string) *BackendBucketsDeleteSignedUrlKeyCall {
  29981. c := &BackendBucketsDeleteSignedUrlKeyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  29982. c.project = project
  29983. c.backendBucket = backendBucket
  29984. c.urlParams_.Set("keyName", keyName)
  29985. return c
  29986. }
  29987. // RequestId sets the optional parameter "requestId": An optional
  29988. // request ID to identify requests. Specify a unique request ID so that
  29989. // if you must retry your request, the server will know to ignore the
  29990. // request if it has already been completed.
  29991. //
  29992. // For example, consider a situation where you make an initial request
  29993. // and the request times out. If you make the request again with the
  29994. // same request ID, the server can check if original operation with the
  29995. // same request ID was received, and if so, will ignore the second
  29996. // request. This prevents clients from accidentally creating duplicate
  29997. // commitments.
  29998. //
  29999. // The request ID must be a valid UUID with the exception that zero UUID
  30000. // is not supported (00000000-0000-0000-0000-000000000000).
  30001. func (c *BackendBucketsDeleteSignedUrlKeyCall) RequestId(requestId string) *BackendBucketsDeleteSignedUrlKeyCall {
  30002. c.urlParams_.Set("requestId", requestId)
  30003. return c
  30004. }
  30005. // Fields allows partial responses to be retrieved. See
  30006. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  30007. // for more information.
  30008. func (c *BackendBucketsDeleteSignedUrlKeyCall) Fields(s ...googleapi.Field) *BackendBucketsDeleteSignedUrlKeyCall {
  30009. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  30010. return c
  30011. }
  30012. // Context sets the context to be used in this call's Do method. Any
  30013. // pending HTTP request will be aborted if the provided context is
  30014. // canceled.
  30015. func (c *BackendBucketsDeleteSignedUrlKeyCall) Context(ctx context.Context) *BackendBucketsDeleteSignedUrlKeyCall {
  30016. c.ctx_ = ctx
  30017. return c
  30018. }
  30019. // Header returns an http.Header that can be modified by the caller to
  30020. // add HTTP headers to the request.
  30021. func (c *BackendBucketsDeleteSignedUrlKeyCall) Header() http.Header {
  30022. if c.header_ == nil {
  30023. c.header_ = make(http.Header)
  30024. }
  30025. return c.header_
  30026. }
  30027. func (c *BackendBucketsDeleteSignedUrlKeyCall) doRequest(alt string) (*http.Response, error) {
  30028. reqHeaders := make(http.Header)
  30029. for k, v := range c.header_ {
  30030. reqHeaders[k] = v
  30031. }
  30032. reqHeaders.Set("User-Agent", c.s.userAgent())
  30033. var body io.Reader = nil
  30034. c.urlParams_.Set("alt", alt)
  30035. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/backendBuckets/{backendBucket}/deleteSignedUrlKey")
  30036. urls += "?" + c.urlParams_.Encode()
  30037. req, _ := http.NewRequest("POST", urls, body)
  30038. req.Header = reqHeaders
  30039. googleapi.Expand(req.URL, map[string]string{
  30040. "project": c.project,
  30041. "backendBucket": c.backendBucket,
  30042. })
  30043. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  30044. }
  30045. // Do executes the "compute.backendBuckets.deleteSignedUrlKey" call.
  30046. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  30047. // status code is an error. Response headers are in either
  30048. // *Operation.ServerResponse.Header or (if a response was returned at
  30049. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  30050. // to check whether the returned error was because
  30051. // http.StatusNotModified was returned.
  30052. func (c *BackendBucketsDeleteSignedUrlKeyCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  30053. gensupport.SetOptions(c.urlParams_, opts...)
  30054. res, err := c.doRequest("json")
  30055. if res != nil && res.StatusCode == http.StatusNotModified {
  30056. if res.Body != nil {
  30057. res.Body.Close()
  30058. }
  30059. return nil, &googleapi.Error{
  30060. Code: res.StatusCode,
  30061. Header: res.Header,
  30062. }
  30063. }
  30064. if err != nil {
  30065. return nil, err
  30066. }
  30067. defer googleapi.CloseBody(res)
  30068. if err := googleapi.CheckResponse(res); err != nil {
  30069. return nil, err
  30070. }
  30071. ret := &Operation{
  30072. ServerResponse: googleapi.ServerResponse{
  30073. Header: res.Header,
  30074. HTTPStatusCode: res.StatusCode,
  30075. },
  30076. }
  30077. target := &ret
  30078. if err := gensupport.DecodeResponse(target, res); err != nil {
  30079. return nil, err
  30080. }
  30081. return ret, nil
  30082. // {
  30083. // "description": "Deletes the given Signed URL Key from the backend bucket.",
  30084. // "httpMethod": "POST",
  30085. // "id": "compute.backendBuckets.deleteSignedUrlKey",
  30086. // "parameterOrder": [
  30087. // "project",
  30088. // "backendBucket",
  30089. // "keyName"
  30090. // ],
  30091. // "parameters": {
  30092. // "backendBucket": {
  30093. // "description": "Name of the BackendBucket resource to which the Signed URL Key should be added. The name should conform to RFC1035.",
  30094. // "location": "path",
  30095. // "required": true,
  30096. // "type": "string"
  30097. // },
  30098. // "keyName": {
  30099. // "description": "The name of the Signed URL Key to delete.",
  30100. // "location": "query",
  30101. // "required": true,
  30102. // "type": "string"
  30103. // },
  30104. // "project": {
  30105. // "description": "Project ID for this request.",
  30106. // "location": "path",
  30107. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  30108. // "required": true,
  30109. // "type": "string"
  30110. // },
  30111. // "requestId": {
  30112. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  30113. // "location": "query",
  30114. // "type": "string"
  30115. // }
  30116. // },
  30117. // "path": "{project}/global/backendBuckets/{backendBucket}/deleteSignedUrlKey",
  30118. // "response": {
  30119. // "$ref": "Operation"
  30120. // },
  30121. // "scopes": [
  30122. // "https://www.googleapis.com/auth/cloud-platform",
  30123. // "https://www.googleapis.com/auth/compute"
  30124. // ]
  30125. // }
  30126. }
  30127. // method id "compute.backendBuckets.get":
  30128. type BackendBucketsGetCall struct {
  30129. s *Service
  30130. project string
  30131. backendBucket string
  30132. urlParams_ gensupport.URLParams
  30133. ifNoneMatch_ string
  30134. ctx_ context.Context
  30135. header_ http.Header
  30136. }
  30137. // Get: Returns the specified BackendBucket resource. Gets a list of
  30138. // available backend buckets by making a list() request.
  30139. func (r *BackendBucketsService) Get(project string, backendBucket string) *BackendBucketsGetCall {
  30140. c := &BackendBucketsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  30141. c.project = project
  30142. c.backendBucket = backendBucket
  30143. return c
  30144. }
  30145. // Fields allows partial responses to be retrieved. See
  30146. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  30147. // for more information.
  30148. func (c *BackendBucketsGetCall) Fields(s ...googleapi.Field) *BackendBucketsGetCall {
  30149. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  30150. return c
  30151. }
  30152. // IfNoneMatch sets the optional parameter which makes the operation
  30153. // fail if the object's ETag matches the given value. This is useful for
  30154. // getting updates only after the object has changed since the last
  30155. // request. Use googleapi.IsNotModified to check whether the response
  30156. // error from Do is the result of In-None-Match.
  30157. func (c *BackendBucketsGetCall) IfNoneMatch(entityTag string) *BackendBucketsGetCall {
  30158. c.ifNoneMatch_ = entityTag
  30159. return c
  30160. }
  30161. // Context sets the context to be used in this call's Do method. Any
  30162. // pending HTTP request will be aborted if the provided context is
  30163. // canceled.
  30164. func (c *BackendBucketsGetCall) Context(ctx context.Context) *BackendBucketsGetCall {
  30165. c.ctx_ = ctx
  30166. return c
  30167. }
  30168. // Header returns an http.Header that can be modified by the caller to
  30169. // add HTTP headers to the request.
  30170. func (c *BackendBucketsGetCall) Header() http.Header {
  30171. if c.header_ == nil {
  30172. c.header_ = make(http.Header)
  30173. }
  30174. return c.header_
  30175. }
  30176. func (c *BackendBucketsGetCall) doRequest(alt string) (*http.Response, error) {
  30177. reqHeaders := make(http.Header)
  30178. for k, v := range c.header_ {
  30179. reqHeaders[k] = v
  30180. }
  30181. reqHeaders.Set("User-Agent", c.s.userAgent())
  30182. if c.ifNoneMatch_ != "" {
  30183. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  30184. }
  30185. var body io.Reader = nil
  30186. c.urlParams_.Set("alt", alt)
  30187. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/backendBuckets/{backendBucket}")
  30188. urls += "?" + c.urlParams_.Encode()
  30189. req, _ := http.NewRequest("GET", urls, body)
  30190. req.Header = reqHeaders
  30191. googleapi.Expand(req.URL, map[string]string{
  30192. "project": c.project,
  30193. "backendBucket": c.backendBucket,
  30194. })
  30195. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  30196. }
  30197. // Do executes the "compute.backendBuckets.get" call.
  30198. // Exactly one of *BackendBucket or error will be non-nil. Any non-2xx
  30199. // status code is an error. Response headers are in either
  30200. // *BackendBucket.ServerResponse.Header or (if a response was returned
  30201. // at all) in error.(*googleapi.Error).Header. Use
  30202. // googleapi.IsNotModified to check whether the returned error was
  30203. // because http.StatusNotModified was returned.
  30204. func (c *BackendBucketsGetCall) Do(opts ...googleapi.CallOption) (*BackendBucket, error) {
  30205. gensupport.SetOptions(c.urlParams_, opts...)
  30206. res, err := c.doRequest("json")
  30207. if res != nil && res.StatusCode == http.StatusNotModified {
  30208. if res.Body != nil {
  30209. res.Body.Close()
  30210. }
  30211. return nil, &googleapi.Error{
  30212. Code: res.StatusCode,
  30213. Header: res.Header,
  30214. }
  30215. }
  30216. if err != nil {
  30217. return nil, err
  30218. }
  30219. defer googleapi.CloseBody(res)
  30220. if err := googleapi.CheckResponse(res); err != nil {
  30221. return nil, err
  30222. }
  30223. ret := &BackendBucket{
  30224. ServerResponse: googleapi.ServerResponse{
  30225. Header: res.Header,
  30226. HTTPStatusCode: res.StatusCode,
  30227. },
  30228. }
  30229. target := &ret
  30230. if err := gensupport.DecodeResponse(target, res); err != nil {
  30231. return nil, err
  30232. }
  30233. return ret, nil
  30234. // {
  30235. // "description": "Returns the specified BackendBucket resource. Gets a list of available backend buckets by making a list() request.",
  30236. // "httpMethod": "GET",
  30237. // "id": "compute.backendBuckets.get",
  30238. // "parameterOrder": [
  30239. // "project",
  30240. // "backendBucket"
  30241. // ],
  30242. // "parameters": {
  30243. // "backendBucket": {
  30244. // "description": "Name of the BackendBucket resource to return.",
  30245. // "location": "path",
  30246. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  30247. // "required": true,
  30248. // "type": "string"
  30249. // },
  30250. // "project": {
  30251. // "description": "Project ID for this request.",
  30252. // "location": "path",
  30253. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  30254. // "required": true,
  30255. // "type": "string"
  30256. // }
  30257. // },
  30258. // "path": "{project}/global/backendBuckets/{backendBucket}",
  30259. // "response": {
  30260. // "$ref": "BackendBucket"
  30261. // },
  30262. // "scopes": [
  30263. // "https://www.googleapis.com/auth/cloud-platform",
  30264. // "https://www.googleapis.com/auth/compute",
  30265. // "https://www.googleapis.com/auth/compute.readonly"
  30266. // ]
  30267. // }
  30268. }
  30269. // method id "compute.backendBuckets.insert":
  30270. type BackendBucketsInsertCall struct {
  30271. s *Service
  30272. project string
  30273. backendbucket *BackendBucket
  30274. urlParams_ gensupport.URLParams
  30275. ctx_ context.Context
  30276. header_ http.Header
  30277. }
  30278. // Insert: Creates a BackendBucket resource in the specified project
  30279. // using the data included in the request.
  30280. func (r *BackendBucketsService) Insert(project string, backendbucket *BackendBucket) *BackendBucketsInsertCall {
  30281. c := &BackendBucketsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  30282. c.project = project
  30283. c.backendbucket = backendbucket
  30284. return c
  30285. }
  30286. // RequestId sets the optional parameter "requestId": An optional
  30287. // request ID to identify requests. Specify a unique request ID so that
  30288. // if you must retry your request, the server will know to ignore the
  30289. // request if it has already been completed.
  30290. //
  30291. // For example, consider a situation where you make an initial request
  30292. // and the request times out. If you make the request again with the
  30293. // same request ID, the server can check if original operation with the
  30294. // same request ID was received, and if so, will ignore the second
  30295. // request. This prevents clients from accidentally creating duplicate
  30296. // commitments.
  30297. //
  30298. // The request ID must be a valid UUID with the exception that zero UUID
  30299. // is not supported (00000000-0000-0000-0000-000000000000).
  30300. func (c *BackendBucketsInsertCall) RequestId(requestId string) *BackendBucketsInsertCall {
  30301. c.urlParams_.Set("requestId", requestId)
  30302. return c
  30303. }
  30304. // Fields allows partial responses to be retrieved. See
  30305. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  30306. // for more information.
  30307. func (c *BackendBucketsInsertCall) Fields(s ...googleapi.Field) *BackendBucketsInsertCall {
  30308. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  30309. return c
  30310. }
  30311. // Context sets the context to be used in this call's Do method. Any
  30312. // pending HTTP request will be aborted if the provided context is
  30313. // canceled.
  30314. func (c *BackendBucketsInsertCall) Context(ctx context.Context) *BackendBucketsInsertCall {
  30315. c.ctx_ = ctx
  30316. return c
  30317. }
  30318. // Header returns an http.Header that can be modified by the caller to
  30319. // add HTTP headers to the request.
  30320. func (c *BackendBucketsInsertCall) Header() http.Header {
  30321. if c.header_ == nil {
  30322. c.header_ = make(http.Header)
  30323. }
  30324. return c.header_
  30325. }
  30326. func (c *BackendBucketsInsertCall) doRequest(alt string) (*http.Response, error) {
  30327. reqHeaders := make(http.Header)
  30328. for k, v := range c.header_ {
  30329. reqHeaders[k] = v
  30330. }
  30331. reqHeaders.Set("User-Agent", c.s.userAgent())
  30332. var body io.Reader = nil
  30333. body, err := googleapi.WithoutDataWrapper.JSONReader(c.backendbucket)
  30334. if err != nil {
  30335. return nil, err
  30336. }
  30337. reqHeaders.Set("Content-Type", "application/json")
  30338. c.urlParams_.Set("alt", alt)
  30339. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/backendBuckets")
  30340. urls += "?" + c.urlParams_.Encode()
  30341. req, _ := http.NewRequest("POST", urls, body)
  30342. req.Header = reqHeaders
  30343. googleapi.Expand(req.URL, map[string]string{
  30344. "project": c.project,
  30345. })
  30346. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  30347. }
  30348. // Do executes the "compute.backendBuckets.insert" call.
  30349. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  30350. // status code is an error. Response headers are in either
  30351. // *Operation.ServerResponse.Header or (if a response was returned at
  30352. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  30353. // to check whether the returned error was because
  30354. // http.StatusNotModified was returned.
  30355. func (c *BackendBucketsInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  30356. gensupport.SetOptions(c.urlParams_, opts...)
  30357. res, err := c.doRequest("json")
  30358. if res != nil && res.StatusCode == http.StatusNotModified {
  30359. if res.Body != nil {
  30360. res.Body.Close()
  30361. }
  30362. return nil, &googleapi.Error{
  30363. Code: res.StatusCode,
  30364. Header: res.Header,
  30365. }
  30366. }
  30367. if err != nil {
  30368. return nil, err
  30369. }
  30370. defer googleapi.CloseBody(res)
  30371. if err := googleapi.CheckResponse(res); err != nil {
  30372. return nil, err
  30373. }
  30374. ret := &Operation{
  30375. ServerResponse: googleapi.ServerResponse{
  30376. Header: res.Header,
  30377. HTTPStatusCode: res.StatusCode,
  30378. },
  30379. }
  30380. target := &ret
  30381. if err := gensupport.DecodeResponse(target, res); err != nil {
  30382. return nil, err
  30383. }
  30384. return ret, nil
  30385. // {
  30386. // "description": "Creates a BackendBucket resource in the specified project using the data included in the request.",
  30387. // "httpMethod": "POST",
  30388. // "id": "compute.backendBuckets.insert",
  30389. // "parameterOrder": [
  30390. // "project"
  30391. // ],
  30392. // "parameters": {
  30393. // "project": {
  30394. // "description": "Project ID for this request.",
  30395. // "location": "path",
  30396. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  30397. // "required": true,
  30398. // "type": "string"
  30399. // },
  30400. // "requestId": {
  30401. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  30402. // "location": "query",
  30403. // "type": "string"
  30404. // }
  30405. // },
  30406. // "path": "{project}/global/backendBuckets",
  30407. // "request": {
  30408. // "$ref": "BackendBucket"
  30409. // },
  30410. // "response": {
  30411. // "$ref": "Operation"
  30412. // },
  30413. // "scopes": [
  30414. // "https://www.googleapis.com/auth/cloud-platform",
  30415. // "https://www.googleapis.com/auth/compute"
  30416. // ]
  30417. // }
  30418. }
  30419. // method id "compute.backendBuckets.list":
  30420. type BackendBucketsListCall struct {
  30421. s *Service
  30422. project string
  30423. urlParams_ gensupport.URLParams
  30424. ifNoneMatch_ string
  30425. ctx_ context.Context
  30426. header_ http.Header
  30427. }
  30428. // List: Retrieves the list of BackendBucket resources available to the
  30429. // specified project.
  30430. func (r *BackendBucketsService) List(project string) *BackendBucketsListCall {
  30431. c := &BackendBucketsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  30432. c.project = project
  30433. return c
  30434. }
  30435. // Filter sets the optional parameter "filter": A filter expression that
  30436. // filters resources listed in the response. The expression must specify
  30437. // the field name, a comparison operator, and the value that you want to
  30438. // use for filtering. The value must be a string, a number, or a
  30439. // boolean. The comparison operator must be either =, !=, >, or <.
  30440. //
  30441. // For example, if you are filtering Compute Engine instances, you can
  30442. // exclude instances named example-instance by specifying name !=
  30443. // example-instance.
  30444. //
  30445. // You can also filter nested fields. For example, you could specify
  30446. // scheduling.automaticRestart = false to include instances only if they
  30447. // are not scheduled for automatic restarts. You can use filtering on
  30448. // nested fields to filter based on resource labels.
  30449. //
  30450. // To filter on multiple expressions, provide each separate expression
  30451. // within parentheses. For example, (scheduling.automaticRestart = true)
  30452. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  30453. // AND expression. However, you can include AND and OR expressions
  30454. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  30455. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  30456. // true).
  30457. func (c *BackendBucketsListCall) Filter(filter string) *BackendBucketsListCall {
  30458. c.urlParams_.Set("filter", filter)
  30459. return c
  30460. }
  30461. // MaxResults sets the optional parameter "maxResults": The maximum
  30462. // number of results per page that should be returned. If the number of
  30463. // available results is larger than maxResults, Compute Engine returns a
  30464. // nextPageToken that can be used to get the next page of results in
  30465. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  30466. // (Default: 500)
  30467. func (c *BackendBucketsListCall) MaxResults(maxResults int64) *BackendBucketsListCall {
  30468. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  30469. return c
  30470. }
  30471. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  30472. // a certain order. By default, results are returned in alphanumerical
  30473. // order based on the resource name.
  30474. //
  30475. // You can also sort results in descending order based on the creation
  30476. // timestamp using orderBy="creationTimestamp desc". This sorts results
  30477. // based on the creationTimestamp field in reverse chronological order
  30478. // (newest result first). Use this to sort resources like operations so
  30479. // that the newest operation is returned first.
  30480. //
  30481. // Currently, only sorting by name or creationTimestamp desc is
  30482. // supported.
  30483. func (c *BackendBucketsListCall) OrderBy(orderBy string) *BackendBucketsListCall {
  30484. c.urlParams_.Set("orderBy", orderBy)
  30485. return c
  30486. }
  30487. // PageToken sets the optional parameter "pageToken": Specifies a page
  30488. // token to use. Set pageToken to the nextPageToken returned by a
  30489. // previous list request to get the next page of results.
  30490. func (c *BackendBucketsListCall) PageToken(pageToken string) *BackendBucketsListCall {
  30491. c.urlParams_.Set("pageToken", pageToken)
  30492. return c
  30493. }
  30494. // Fields allows partial responses to be retrieved. See
  30495. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  30496. // for more information.
  30497. func (c *BackendBucketsListCall) Fields(s ...googleapi.Field) *BackendBucketsListCall {
  30498. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  30499. return c
  30500. }
  30501. // IfNoneMatch sets the optional parameter which makes the operation
  30502. // fail if the object's ETag matches the given value. This is useful for
  30503. // getting updates only after the object has changed since the last
  30504. // request. Use googleapi.IsNotModified to check whether the response
  30505. // error from Do is the result of In-None-Match.
  30506. func (c *BackendBucketsListCall) IfNoneMatch(entityTag string) *BackendBucketsListCall {
  30507. c.ifNoneMatch_ = entityTag
  30508. return c
  30509. }
  30510. // Context sets the context to be used in this call's Do method. Any
  30511. // pending HTTP request will be aborted if the provided context is
  30512. // canceled.
  30513. func (c *BackendBucketsListCall) Context(ctx context.Context) *BackendBucketsListCall {
  30514. c.ctx_ = ctx
  30515. return c
  30516. }
  30517. // Header returns an http.Header that can be modified by the caller to
  30518. // add HTTP headers to the request.
  30519. func (c *BackendBucketsListCall) Header() http.Header {
  30520. if c.header_ == nil {
  30521. c.header_ = make(http.Header)
  30522. }
  30523. return c.header_
  30524. }
  30525. func (c *BackendBucketsListCall) doRequest(alt string) (*http.Response, error) {
  30526. reqHeaders := make(http.Header)
  30527. for k, v := range c.header_ {
  30528. reqHeaders[k] = v
  30529. }
  30530. reqHeaders.Set("User-Agent", c.s.userAgent())
  30531. if c.ifNoneMatch_ != "" {
  30532. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  30533. }
  30534. var body io.Reader = nil
  30535. c.urlParams_.Set("alt", alt)
  30536. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/backendBuckets")
  30537. urls += "?" + c.urlParams_.Encode()
  30538. req, _ := http.NewRequest("GET", urls, body)
  30539. req.Header = reqHeaders
  30540. googleapi.Expand(req.URL, map[string]string{
  30541. "project": c.project,
  30542. })
  30543. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  30544. }
  30545. // Do executes the "compute.backendBuckets.list" call.
  30546. // Exactly one of *BackendBucketList or error will be non-nil. Any
  30547. // non-2xx status code is an error. Response headers are in either
  30548. // *BackendBucketList.ServerResponse.Header or (if a response was
  30549. // returned at all) in error.(*googleapi.Error).Header. Use
  30550. // googleapi.IsNotModified to check whether the returned error was
  30551. // because http.StatusNotModified was returned.
  30552. func (c *BackendBucketsListCall) Do(opts ...googleapi.CallOption) (*BackendBucketList, error) {
  30553. gensupport.SetOptions(c.urlParams_, opts...)
  30554. res, err := c.doRequest("json")
  30555. if res != nil && res.StatusCode == http.StatusNotModified {
  30556. if res.Body != nil {
  30557. res.Body.Close()
  30558. }
  30559. return nil, &googleapi.Error{
  30560. Code: res.StatusCode,
  30561. Header: res.Header,
  30562. }
  30563. }
  30564. if err != nil {
  30565. return nil, err
  30566. }
  30567. defer googleapi.CloseBody(res)
  30568. if err := googleapi.CheckResponse(res); err != nil {
  30569. return nil, err
  30570. }
  30571. ret := &BackendBucketList{
  30572. ServerResponse: googleapi.ServerResponse{
  30573. Header: res.Header,
  30574. HTTPStatusCode: res.StatusCode,
  30575. },
  30576. }
  30577. target := &ret
  30578. if err := gensupport.DecodeResponse(target, res); err != nil {
  30579. return nil, err
  30580. }
  30581. return ret, nil
  30582. // {
  30583. // "description": "Retrieves the list of BackendBucket resources available to the specified project.",
  30584. // "httpMethod": "GET",
  30585. // "id": "compute.backendBuckets.list",
  30586. // "parameterOrder": [
  30587. // "project"
  30588. // ],
  30589. // "parameters": {
  30590. // "filter": {
  30591. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  30592. // "location": "query",
  30593. // "type": "string"
  30594. // },
  30595. // "maxResults": {
  30596. // "default": "500",
  30597. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  30598. // "format": "uint32",
  30599. // "location": "query",
  30600. // "minimum": "0",
  30601. // "type": "integer"
  30602. // },
  30603. // "orderBy": {
  30604. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  30605. // "location": "query",
  30606. // "type": "string"
  30607. // },
  30608. // "pageToken": {
  30609. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  30610. // "location": "query",
  30611. // "type": "string"
  30612. // },
  30613. // "project": {
  30614. // "description": "Project ID for this request.",
  30615. // "location": "path",
  30616. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  30617. // "required": true,
  30618. // "type": "string"
  30619. // }
  30620. // },
  30621. // "path": "{project}/global/backendBuckets",
  30622. // "response": {
  30623. // "$ref": "BackendBucketList"
  30624. // },
  30625. // "scopes": [
  30626. // "https://www.googleapis.com/auth/cloud-platform",
  30627. // "https://www.googleapis.com/auth/compute",
  30628. // "https://www.googleapis.com/auth/compute.readonly"
  30629. // ]
  30630. // }
  30631. }
  30632. // Pages invokes f for each page of results.
  30633. // A non-nil error returned from f will halt the iteration.
  30634. // The provided context supersedes any context provided to the Context method.
  30635. func (c *BackendBucketsListCall) Pages(ctx context.Context, f func(*BackendBucketList) error) error {
  30636. c.ctx_ = ctx
  30637. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  30638. for {
  30639. x, err := c.Do()
  30640. if err != nil {
  30641. return err
  30642. }
  30643. if err := f(x); err != nil {
  30644. return err
  30645. }
  30646. if x.NextPageToken == "" {
  30647. return nil
  30648. }
  30649. c.PageToken(x.NextPageToken)
  30650. }
  30651. }
  30652. // method id "compute.backendBuckets.patch":
  30653. type BackendBucketsPatchCall struct {
  30654. s *Service
  30655. project string
  30656. backendBucket string
  30657. backendbucket *BackendBucket
  30658. urlParams_ gensupport.URLParams
  30659. ctx_ context.Context
  30660. header_ http.Header
  30661. }
  30662. // Patch: Updates the specified BackendBucket resource with the data
  30663. // included in the request. This method supports PATCH semantics and
  30664. // uses the JSON merge patch format and processing rules.
  30665. func (r *BackendBucketsService) Patch(project string, backendBucket string, backendbucket *BackendBucket) *BackendBucketsPatchCall {
  30666. c := &BackendBucketsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  30667. c.project = project
  30668. c.backendBucket = backendBucket
  30669. c.backendbucket = backendbucket
  30670. return c
  30671. }
  30672. // RequestId sets the optional parameter "requestId": An optional
  30673. // request ID to identify requests. Specify a unique request ID so that
  30674. // if you must retry your request, the server will know to ignore the
  30675. // request if it has already been completed.
  30676. //
  30677. // For example, consider a situation where you make an initial request
  30678. // and the request times out. If you make the request again with the
  30679. // same request ID, the server can check if original operation with the
  30680. // same request ID was received, and if so, will ignore the second
  30681. // request. This prevents clients from accidentally creating duplicate
  30682. // commitments.
  30683. //
  30684. // The request ID must be a valid UUID with the exception that zero UUID
  30685. // is not supported (00000000-0000-0000-0000-000000000000).
  30686. func (c *BackendBucketsPatchCall) RequestId(requestId string) *BackendBucketsPatchCall {
  30687. c.urlParams_.Set("requestId", requestId)
  30688. return c
  30689. }
  30690. // Fields allows partial responses to be retrieved. See
  30691. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  30692. // for more information.
  30693. func (c *BackendBucketsPatchCall) Fields(s ...googleapi.Field) *BackendBucketsPatchCall {
  30694. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  30695. return c
  30696. }
  30697. // Context sets the context to be used in this call's Do method. Any
  30698. // pending HTTP request will be aborted if the provided context is
  30699. // canceled.
  30700. func (c *BackendBucketsPatchCall) Context(ctx context.Context) *BackendBucketsPatchCall {
  30701. c.ctx_ = ctx
  30702. return c
  30703. }
  30704. // Header returns an http.Header that can be modified by the caller to
  30705. // add HTTP headers to the request.
  30706. func (c *BackendBucketsPatchCall) Header() http.Header {
  30707. if c.header_ == nil {
  30708. c.header_ = make(http.Header)
  30709. }
  30710. return c.header_
  30711. }
  30712. func (c *BackendBucketsPatchCall) doRequest(alt string) (*http.Response, error) {
  30713. reqHeaders := make(http.Header)
  30714. for k, v := range c.header_ {
  30715. reqHeaders[k] = v
  30716. }
  30717. reqHeaders.Set("User-Agent", c.s.userAgent())
  30718. var body io.Reader = nil
  30719. body, err := googleapi.WithoutDataWrapper.JSONReader(c.backendbucket)
  30720. if err != nil {
  30721. return nil, err
  30722. }
  30723. reqHeaders.Set("Content-Type", "application/json")
  30724. c.urlParams_.Set("alt", alt)
  30725. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/backendBuckets/{backendBucket}")
  30726. urls += "?" + c.urlParams_.Encode()
  30727. req, _ := http.NewRequest("PATCH", urls, body)
  30728. req.Header = reqHeaders
  30729. googleapi.Expand(req.URL, map[string]string{
  30730. "project": c.project,
  30731. "backendBucket": c.backendBucket,
  30732. })
  30733. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  30734. }
  30735. // Do executes the "compute.backendBuckets.patch" call.
  30736. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  30737. // status code is an error. Response headers are in either
  30738. // *Operation.ServerResponse.Header or (if a response was returned at
  30739. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  30740. // to check whether the returned error was because
  30741. // http.StatusNotModified was returned.
  30742. func (c *BackendBucketsPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  30743. gensupport.SetOptions(c.urlParams_, opts...)
  30744. res, err := c.doRequest("json")
  30745. if res != nil && res.StatusCode == http.StatusNotModified {
  30746. if res.Body != nil {
  30747. res.Body.Close()
  30748. }
  30749. return nil, &googleapi.Error{
  30750. Code: res.StatusCode,
  30751. Header: res.Header,
  30752. }
  30753. }
  30754. if err != nil {
  30755. return nil, err
  30756. }
  30757. defer googleapi.CloseBody(res)
  30758. if err := googleapi.CheckResponse(res); err != nil {
  30759. return nil, err
  30760. }
  30761. ret := &Operation{
  30762. ServerResponse: googleapi.ServerResponse{
  30763. Header: res.Header,
  30764. HTTPStatusCode: res.StatusCode,
  30765. },
  30766. }
  30767. target := &ret
  30768. if err := gensupport.DecodeResponse(target, res); err != nil {
  30769. return nil, err
  30770. }
  30771. return ret, nil
  30772. // {
  30773. // "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.",
  30774. // "httpMethod": "PATCH",
  30775. // "id": "compute.backendBuckets.patch",
  30776. // "parameterOrder": [
  30777. // "project",
  30778. // "backendBucket"
  30779. // ],
  30780. // "parameters": {
  30781. // "backendBucket": {
  30782. // "description": "Name of the BackendBucket resource to patch.",
  30783. // "location": "path",
  30784. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  30785. // "required": true,
  30786. // "type": "string"
  30787. // },
  30788. // "project": {
  30789. // "description": "Project ID for this request.",
  30790. // "location": "path",
  30791. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  30792. // "required": true,
  30793. // "type": "string"
  30794. // },
  30795. // "requestId": {
  30796. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  30797. // "location": "query",
  30798. // "type": "string"
  30799. // }
  30800. // },
  30801. // "path": "{project}/global/backendBuckets/{backendBucket}",
  30802. // "request": {
  30803. // "$ref": "BackendBucket"
  30804. // },
  30805. // "response": {
  30806. // "$ref": "Operation"
  30807. // },
  30808. // "scopes": [
  30809. // "https://www.googleapis.com/auth/cloud-platform",
  30810. // "https://www.googleapis.com/auth/compute"
  30811. // ]
  30812. // }
  30813. }
  30814. // method id "compute.backendBuckets.update":
  30815. type BackendBucketsUpdateCall struct {
  30816. s *Service
  30817. project string
  30818. backendBucket string
  30819. backendbucket *BackendBucket
  30820. urlParams_ gensupport.URLParams
  30821. ctx_ context.Context
  30822. header_ http.Header
  30823. }
  30824. // Update: Updates the specified BackendBucket resource with the data
  30825. // included in the request.
  30826. func (r *BackendBucketsService) Update(project string, backendBucket string, backendbucket *BackendBucket) *BackendBucketsUpdateCall {
  30827. c := &BackendBucketsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  30828. c.project = project
  30829. c.backendBucket = backendBucket
  30830. c.backendbucket = backendbucket
  30831. return c
  30832. }
  30833. // RequestId sets the optional parameter "requestId": An optional
  30834. // request ID to identify requests. Specify a unique request ID so that
  30835. // if you must retry your request, the server will know to ignore the
  30836. // request if it has already been completed.
  30837. //
  30838. // For example, consider a situation where you make an initial request
  30839. // and the request times out. If you make the request again with the
  30840. // same request ID, the server can check if original operation with the
  30841. // same request ID was received, and if so, will ignore the second
  30842. // request. This prevents clients from accidentally creating duplicate
  30843. // commitments.
  30844. //
  30845. // The request ID must be a valid UUID with the exception that zero UUID
  30846. // is not supported (00000000-0000-0000-0000-000000000000).
  30847. func (c *BackendBucketsUpdateCall) RequestId(requestId string) *BackendBucketsUpdateCall {
  30848. c.urlParams_.Set("requestId", requestId)
  30849. return c
  30850. }
  30851. // Fields allows partial responses to be retrieved. See
  30852. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  30853. // for more information.
  30854. func (c *BackendBucketsUpdateCall) Fields(s ...googleapi.Field) *BackendBucketsUpdateCall {
  30855. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  30856. return c
  30857. }
  30858. // Context sets the context to be used in this call's Do method. Any
  30859. // pending HTTP request will be aborted if the provided context is
  30860. // canceled.
  30861. func (c *BackendBucketsUpdateCall) Context(ctx context.Context) *BackendBucketsUpdateCall {
  30862. c.ctx_ = ctx
  30863. return c
  30864. }
  30865. // Header returns an http.Header that can be modified by the caller to
  30866. // add HTTP headers to the request.
  30867. func (c *BackendBucketsUpdateCall) Header() http.Header {
  30868. if c.header_ == nil {
  30869. c.header_ = make(http.Header)
  30870. }
  30871. return c.header_
  30872. }
  30873. func (c *BackendBucketsUpdateCall) doRequest(alt string) (*http.Response, error) {
  30874. reqHeaders := make(http.Header)
  30875. for k, v := range c.header_ {
  30876. reqHeaders[k] = v
  30877. }
  30878. reqHeaders.Set("User-Agent", c.s.userAgent())
  30879. var body io.Reader = nil
  30880. body, err := googleapi.WithoutDataWrapper.JSONReader(c.backendbucket)
  30881. if err != nil {
  30882. return nil, err
  30883. }
  30884. reqHeaders.Set("Content-Type", "application/json")
  30885. c.urlParams_.Set("alt", alt)
  30886. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/backendBuckets/{backendBucket}")
  30887. urls += "?" + c.urlParams_.Encode()
  30888. req, _ := http.NewRequest("PUT", urls, body)
  30889. req.Header = reqHeaders
  30890. googleapi.Expand(req.URL, map[string]string{
  30891. "project": c.project,
  30892. "backendBucket": c.backendBucket,
  30893. })
  30894. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  30895. }
  30896. // Do executes the "compute.backendBuckets.update" call.
  30897. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  30898. // status code is an error. Response headers are in either
  30899. // *Operation.ServerResponse.Header or (if a response was returned at
  30900. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  30901. // to check whether the returned error was because
  30902. // http.StatusNotModified was returned.
  30903. func (c *BackendBucketsUpdateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  30904. gensupport.SetOptions(c.urlParams_, opts...)
  30905. res, err := c.doRequest("json")
  30906. if res != nil && res.StatusCode == http.StatusNotModified {
  30907. if res.Body != nil {
  30908. res.Body.Close()
  30909. }
  30910. return nil, &googleapi.Error{
  30911. Code: res.StatusCode,
  30912. Header: res.Header,
  30913. }
  30914. }
  30915. if err != nil {
  30916. return nil, err
  30917. }
  30918. defer googleapi.CloseBody(res)
  30919. if err := googleapi.CheckResponse(res); err != nil {
  30920. return nil, err
  30921. }
  30922. ret := &Operation{
  30923. ServerResponse: googleapi.ServerResponse{
  30924. Header: res.Header,
  30925. HTTPStatusCode: res.StatusCode,
  30926. },
  30927. }
  30928. target := &ret
  30929. if err := gensupport.DecodeResponse(target, res); err != nil {
  30930. return nil, err
  30931. }
  30932. return ret, nil
  30933. // {
  30934. // "description": "Updates the specified BackendBucket resource with the data included in the request.",
  30935. // "httpMethod": "PUT",
  30936. // "id": "compute.backendBuckets.update",
  30937. // "parameterOrder": [
  30938. // "project",
  30939. // "backendBucket"
  30940. // ],
  30941. // "parameters": {
  30942. // "backendBucket": {
  30943. // "description": "Name of the BackendBucket resource to update.",
  30944. // "location": "path",
  30945. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  30946. // "required": true,
  30947. // "type": "string"
  30948. // },
  30949. // "project": {
  30950. // "description": "Project ID for this request.",
  30951. // "location": "path",
  30952. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  30953. // "required": true,
  30954. // "type": "string"
  30955. // },
  30956. // "requestId": {
  30957. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  30958. // "location": "query",
  30959. // "type": "string"
  30960. // }
  30961. // },
  30962. // "path": "{project}/global/backendBuckets/{backendBucket}",
  30963. // "request": {
  30964. // "$ref": "BackendBucket"
  30965. // },
  30966. // "response": {
  30967. // "$ref": "Operation"
  30968. // },
  30969. // "scopes": [
  30970. // "https://www.googleapis.com/auth/cloud-platform",
  30971. // "https://www.googleapis.com/auth/compute"
  30972. // ]
  30973. // }
  30974. }
  30975. // method id "compute.backendServices.addSignedUrlKey":
  30976. type BackendServicesAddSignedUrlKeyCall struct {
  30977. s *Service
  30978. project string
  30979. backendService string
  30980. signedurlkey *SignedUrlKey
  30981. urlParams_ gensupport.URLParams
  30982. ctx_ context.Context
  30983. header_ http.Header
  30984. }
  30985. // AddSignedUrlKey: Adds the given Signed URL Key to the specified
  30986. // backend service.
  30987. func (r *BackendServicesService) AddSignedUrlKey(project string, backendService string, signedurlkey *SignedUrlKey) *BackendServicesAddSignedUrlKeyCall {
  30988. c := &BackendServicesAddSignedUrlKeyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  30989. c.project = project
  30990. c.backendService = backendService
  30991. c.signedurlkey = signedurlkey
  30992. return c
  30993. }
  30994. // RequestId sets the optional parameter "requestId": An optional
  30995. // request ID to identify requests. Specify a unique request ID so that
  30996. // if you must retry your request, the server will know to ignore the
  30997. // request if it has already been completed.
  30998. //
  30999. // For example, consider a situation where you make an initial request
  31000. // and the request times out. If you make the request again with the
  31001. // same request ID, the server can check if original operation with the
  31002. // same request ID was received, and if so, will ignore the second
  31003. // request. This prevents clients from accidentally creating duplicate
  31004. // commitments.
  31005. //
  31006. // The request ID must be a valid UUID with the exception that zero UUID
  31007. // is not supported (00000000-0000-0000-0000-000000000000).
  31008. func (c *BackendServicesAddSignedUrlKeyCall) RequestId(requestId string) *BackendServicesAddSignedUrlKeyCall {
  31009. c.urlParams_.Set("requestId", requestId)
  31010. return c
  31011. }
  31012. // Fields allows partial responses to be retrieved. See
  31013. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  31014. // for more information.
  31015. func (c *BackendServicesAddSignedUrlKeyCall) Fields(s ...googleapi.Field) *BackendServicesAddSignedUrlKeyCall {
  31016. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  31017. return c
  31018. }
  31019. // Context sets the context to be used in this call's Do method. Any
  31020. // pending HTTP request will be aborted if the provided context is
  31021. // canceled.
  31022. func (c *BackendServicesAddSignedUrlKeyCall) Context(ctx context.Context) *BackendServicesAddSignedUrlKeyCall {
  31023. c.ctx_ = ctx
  31024. return c
  31025. }
  31026. // Header returns an http.Header that can be modified by the caller to
  31027. // add HTTP headers to the request.
  31028. func (c *BackendServicesAddSignedUrlKeyCall) Header() http.Header {
  31029. if c.header_ == nil {
  31030. c.header_ = make(http.Header)
  31031. }
  31032. return c.header_
  31033. }
  31034. func (c *BackendServicesAddSignedUrlKeyCall) doRequest(alt string) (*http.Response, error) {
  31035. reqHeaders := make(http.Header)
  31036. for k, v := range c.header_ {
  31037. reqHeaders[k] = v
  31038. }
  31039. reqHeaders.Set("User-Agent", c.s.userAgent())
  31040. var body io.Reader = nil
  31041. body, err := googleapi.WithoutDataWrapper.JSONReader(c.signedurlkey)
  31042. if err != nil {
  31043. return nil, err
  31044. }
  31045. reqHeaders.Set("Content-Type", "application/json")
  31046. c.urlParams_.Set("alt", alt)
  31047. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/backendServices/{backendService}/addSignedUrlKey")
  31048. urls += "?" + c.urlParams_.Encode()
  31049. req, _ := http.NewRequest("POST", urls, body)
  31050. req.Header = reqHeaders
  31051. googleapi.Expand(req.URL, map[string]string{
  31052. "project": c.project,
  31053. "backendService": c.backendService,
  31054. })
  31055. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  31056. }
  31057. // Do executes the "compute.backendServices.addSignedUrlKey" call.
  31058. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  31059. // status code is an error. Response headers are in either
  31060. // *Operation.ServerResponse.Header or (if a response was returned at
  31061. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  31062. // to check whether the returned error was because
  31063. // http.StatusNotModified was returned.
  31064. func (c *BackendServicesAddSignedUrlKeyCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  31065. gensupport.SetOptions(c.urlParams_, opts...)
  31066. res, err := c.doRequest("json")
  31067. if res != nil && res.StatusCode == http.StatusNotModified {
  31068. if res.Body != nil {
  31069. res.Body.Close()
  31070. }
  31071. return nil, &googleapi.Error{
  31072. Code: res.StatusCode,
  31073. Header: res.Header,
  31074. }
  31075. }
  31076. if err != nil {
  31077. return nil, err
  31078. }
  31079. defer googleapi.CloseBody(res)
  31080. if err := googleapi.CheckResponse(res); err != nil {
  31081. return nil, err
  31082. }
  31083. ret := &Operation{
  31084. ServerResponse: googleapi.ServerResponse{
  31085. Header: res.Header,
  31086. HTTPStatusCode: res.StatusCode,
  31087. },
  31088. }
  31089. target := &ret
  31090. if err := gensupport.DecodeResponse(target, res); err != nil {
  31091. return nil, err
  31092. }
  31093. return ret, nil
  31094. // {
  31095. // "description": "Adds the given Signed URL Key to the specified backend service.",
  31096. // "httpMethod": "POST",
  31097. // "id": "compute.backendServices.addSignedUrlKey",
  31098. // "parameterOrder": [
  31099. // "project",
  31100. // "backendService"
  31101. // ],
  31102. // "parameters": {
  31103. // "backendService": {
  31104. // "description": "Name of the BackendService resource to which the Signed URL Key should be added. The name should conform to RFC1035.",
  31105. // "location": "path",
  31106. // "required": true,
  31107. // "type": "string"
  31108. // },
  31109. // "project": {
  31110. // "description": "Project ID for this request.",
  31111. // "location": "path",
  31112. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  31113. // "required": true,
  31114. // "type": "string"
  31115. // },
  31116. // "requestId": {
  31117. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  31118. // "location": "query",
  31119. // "type": "string"
  31120. // }
  31121. // },
  31122. // "path": "{project}/global/backendServices/{backendService}/addSignedUrlKey",
  31123. // "request": {
  31124. // "$ref": "SignedUrlKey"
  31125. // },
  31126. // "response": {
  31127. // "$ref": "Operation"
  31128. // },
  31129. // "scopes": [
  31130. // "https://www.googleapis.com/auth/cloud-platform",
  31131. // "https://www.googleapis.com/auth/compute"
  31132. // ]
  31133. // }
  31134. }
  31135. // method id "compute.backendServices.aggregatedList":
  31136. type BackendServicesAggregatedListCall struct {
  31137. s *Service
  31138. project string
  31139. urlParams_ gensupport.URLParams
  31140. ifNoneMatch_ string
  31141. ctx_ context.Context
  31142. header_ http.Header
  31143. }
  31144. // AggregatedList: Retrieves the list of all BackendService resources,
  31145. // regional and global, available to the specified project.
  31146. func (r *BackendServicesService) AggregatedList(project string) *BackendServicesAggregatedListCall {
  31147. c := &BackendServicesAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  31148. c.project = project
  31149. return c
  31150. }
  31151. // Filter sets the optional parameter "filter": A filter expression that
  31152. // filters resources listed in the response. The expression must specify
  31153. // the field name, a comparison operator, and the value that you want to
  31154. // use for filtering. The value must be a string, a number, or a
  31155. // boolean. The comparison operator must be either =, !=, >, or <.
  31156. //
  31157. // For example, if you are filtering Compute Engine instances, you can
  31158. // exclude instances named example-instance by specifying name !=
  31159. // example-instance.
  31160. //
  31161. // You can also filter nested fields. For example, you could specify
  31162. // scheduling.automaticRestart = false to include instances only if they
  31163. // are not scheduled for automatic restarts. You can use filtering on
  31164. // nested fields to filter based on resource labels.
  31165. //
  31166. // To filter on multiple expressions, provide each separate expression
  31167. // within parentheses. For example, (scheduling.automaticRestart = true)
  31168. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  31169. // AND expression. However, you can include AND and OR expressions
  31170. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  31171. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  31172. // true).
  31173. func (c *BackendServicesAggregatedListCall) Filter(filter string) *BackendServicesAggregatedListCall {
  31174. c.urlParams_.Set("filter", filter)
  31175. return c
  31176. }
  31177. // MaxResults sets the optional parameter "maxResults": The maximum
  31178. // number of results per page that should be returned. If the number of
  31179. // available results is larger than maxResults, Compute Engine returns a
  31180. // nextPageToken that can be used to get the next page of results in
  31181. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  31182. // (Default: 500)
  31183. func (c *BackendServicesAggregatedListCall) MaxResults(maxResults int64) *BackendServicesAggregatedListCall {
  31184. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  31185. return c
  31186. }
  31187. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  31188. // a certain order. By default, results are returned in alphanumerical
  31189. // order based on the resource name.
  31190. //
  31191. // You can also sort results in descending order based on the creation
  31192. // timestamp using orderBy="creationTimestamp desc". This sorts results
  31193. // based on the creationTimestamp field in reverse chronological order
  31194. // (newest result first). Use this to sort resources like operations so
  31195. // that the newest operation is returned first.
  31196. //
  31197. // Currently, only sorting by name or creationTimestamp desc is
  31198. // supported.
  31199. func (c *BackendServicesAggregatedListCall) OrderBy(orderBy string) *BackendServicesAggregatedListCall {
  31200. c.urlParams_.Set("orderBy", orderBy)
  31201. return c
  31202. }
  31203. // PageToken sets the optional parameter "pageToken": Specifies a page
  31204. // token to use. Set pageToken to the nextPageToken returned by a
  31205. // previous list request to get the next page of results.
  31206. func (c *BackendServicesAggregatedListCall) PageToken(pageToken string) *BackendServicesAggregatedListCall {
  31207. c.urlParams_.Set("pageToken", pageToken)
  31208. return c
  31209. }
  31210. // Fields allows partial responses to be retrieved. See
  31211. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  31212. // for more information.
  31213. func (c *BackendServicesAggregatedListCall) Fields(s ...googleapi.Field) *BackendServicesAggregatedListCall {
  31214. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  31215. return c
  31216. }
  31217. // IfNoneMatch sets the optional parameter which makes the operation
  31218. // fail if the object's ETag matches the given value. This is useful for
  31219. // getting updates only after the object has changed since the last
  31220. // request. Use googleapi.IsNotModified to check whether the response
  31221. // error from Do is the result of In-None-Match.
  31222. func (c *BackendServicesAggregatedListCall) IfNoneMatch(entityTag string) *BackendServicesAggregatedListCall {
  31223. c.ifNoneMatch_ = entityTag
  31224. return c
  31225. }
  31226. // Context sets the context to be used in this call's Do method. Any
  31227. // pending HTTP request will be aborted if the provided context is
  31228. // canceled.
  31229. func (c *BackendServicesAggregatedListCall) Context(ctx context.Context) *BackendServicesAggregatedListCall {
  31230. c.ctx_ = ctx
  31231. return c
  31232. }
  31233. // Header returns an http.Header that can be modified by the caller to
  31234. // add HTTP headers to the request.
  31235. func (c *BackendServicesAggregatedListCall) Header() http.Header {
  31236. if c.header_ == nil {
  31237. c.header_ = make(http.Header)
  31238. }
  31239. return c.header_
  31240. }
  31241. func (c *BackendServicesAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  31242. reqHeaders := make(http.Header)
  31243. for k, v := range c.header_ {
  31244. reqHeaders[k] = v
  31245. }
  31246. reqHeaders.Set("User-Agent", c.s.userAgent())
  31247. if c.ifNoneMatch_ != "" {
  31248. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  31249. }
  31250. var body io.Reader = nil
  31251. c.urlParams_.Set("alt", alt)
  31252. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/backendServices")
  31253. urls += "?" + c.urlParams_.Encode()
  31254. req, _ := http.NewRequest("GET", urls, body)
  31255. req.Header = reqHeaders
  31256. googleapi.Expand(req.URL, map[string]string{
  31257. "project": c.project,
  31258. })
  31259. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  31260. }
  31261. // Do executes the "compute.backendServices.aggregatedList" call.
  31262. // Exactly one of *BackendServiceAggregatedList or error will be
  31263. // non-nil. Any non-2xx status code is an error. Response headers are in
  31264. // either *BackendServiceAggregatedList.ServerResponse.Header or (if a
  31265. // response was returned at all) in error.(*googleapi.Error).Header. Use
  31266. // googleapi.IsNotModified to check whether the returned error was
  31267. // because http.StatusNotModified was returned.
  31268. func (c *BackendServicesAggregatedListCall) Do(opts ...googleapi.CallOption) (*BackendServiceAggregatedList, error) {
  31269. gensupport.SetOptions(c.urlParams_, opts...)
  31270. res, err := c.doRequest("json")
  31271. if res != nil && res.StatusCode == http.StatusNotModified {
  31272. if res.Body != nil {
  31273. res.Body.Close()
  31274. }
  31275. return nil, &googleapi.Error{
  31276. Code: res.StatusCode,
  31277. Header: res.Header,
  31278. }
  31279. }
  31280. if err != nil {
  31281. return nil, err
  31282. }
  31283. defer googleapi.CloseBody(res)
  31284. if err := googleapi.CheckResponse(res); err != nil {
  31285. return nil, err
  31286. }
  31287. ret := &BackendServiceAggregatedList{
  31288. ServerResponse: googleapi.ServerResponse{
  31289. Header: res.Header,
  31290. HTTPStatusCode: res.StatusCode,
  31291. },
  31292. }
  31293. target := &ret
  31294. if err := gensupport.DecodeResponse(target, res); err != nil {
  31295. return nil, err
  31296. }
  31297. return ret, nil
  31298. // {
  31299. // "description": "Retrieves the list of all BackendService resources, regional and global, available to the specified project.",
  31300. // "httpMethod": "GET",
  31301. // "id": "compute.backendServices.aggregatedList",
  31302. // "parameterOrder": [
  31303. // "project"
  31304. // ],
  31305. // "parameters": {
  31306. // "filter": {
  31307. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  31308. // "location": "query",
  31309. // "type": "string"
  31310. // },
  31311. // "maxResults": {
  31312. // "default": "500",
  31313. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  31314. // "format": "uint32",
  31315. // "location": "query",
  31316. // "minimum": "0",
  31317. // "type": "integer"
  31318. // },
  31319. // "orderBy": {
  31320. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  31321. // "location": "query",
  31322. // "type": "string"
  31323. // },
  31324. // "pageToken": {
  31325. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  31326. // "location": "query",
  31327. // "type": "string"
  31328. // },
  31329. // "project": {
  31330. // "description": "Name of the project scoping this request.",
  31331. // "location": "path",
  31332. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  31333. // "required": true,
  31334. // "type": "string"
  31335. // }
  31336. // },
  31337. // "path": "{project}/aggregated/backendServices",
  31338. // "response": {
  31339. // "$ref": "BackendServiceAggregatedList"
  31340. // },
  31341. // "scopes": [
  31342. // "https://www.googleapis.com/auth/cloud-platform",
  31343. // "https://www.googleapis.com/auth/compute",
  31344. // "https://www.googleapis.com/auth/compute.readonly"
  31345. // ]
  31346. // }
  31347. }
  31348. // Pages invokes f for each page of results.
  31349. // A non-nil error returned from f will halt the iteration.
  31350. // The provided context supersedes any context provided to the Context method.
  31351. func (c *BackendServicesAggregatedListCall) Pages(ctx context.Context, f func(*BackendServiceAggregatedList) error) error {
  31352. c.ctx_ = ctx
  31353. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  31354. for {
  31355. x, err := c.Do()
  31356. if err != nil {
  31357. return err
  31358. }
  31359. if err := f(x); err != nil {
  31360. return err
  31361. }
  31362. if x.NextPageToken == "" {
  31363. return nil
  31364. }
  31365. c.PageToken(x.NextPageToken)
  31366. }
  31367. }
  31368. // method id "compute.backendServices.delete":
  31369. type BackendServicesDeleteCall struct {
  31370. s *Service
  31371. project string
  31372. backendService string
  31373. urlParams_ gensupport.URLParams
  31374. ctx_ context.Context
  31375. header_ http.Header
  31376. }
  31377. // Delete: Deletes the specified BackendService resource.
  31378. // For details, see https://cloud.google.com/compute/docs/reference/latest/backendServices/delete
  31379. func (r *BackendServicesService) Delete(project string, backendService string) *BackendServicesDeleteCall {
  31380. c := &BackendServicesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  31381. c.project = project
  31382. c.backendService = backendService
  31383. return c
  31384. }
  31385. // RequestId sets the optional parameter "requestId": An optional
  31386. // request ID to identify requests. Specify a unique request ID so that
  31387. // if you must retry your request, the server will know to ignore the
  31388. // request if it has already been completed.
  31389. //
  31390. // For example, consider a situation where you make an initial request
  31391. // and the request times out. If you make the request again with the
  31392. // same request ID, the server can check if original operation with the
  31393. // same request ID was received, and if so, will ignore the second
  31394. // request. This prevents clients from accidentally creating duplicate
  31395. // commitments.
  31396. //
  31397. // The request ID must be a valid UUID with the exception that zero UUID
  31398. // is not supported (00000000-0000-0000-0000-000000000000).
  31399. func (c *BackendServicesDeleteCall) RequestId(requestId string) *BackendServicesDeleteCall {
  31400. c.urlParams_.Set("requestId", requestId)
  31401. return c
  31402. }
  31403. // Fields allows partial responses to be retrieved. See
  31404. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  31405. // for more information.
  31406. func (c *BackendServicesDeleteCall) Fields(s ...googleapi.Field) *BackendServicesDeleteCall {
  31407. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  31408. return c
  31409. }
  31410. // Context sets the context to be used in this call's Do method. Any
  31411. // pending HTTP request will be aborted if the provided context is
  31412. // canceled.
  31413. func (c *BackendServicesDeleteCall) Context(ctx context.Context) *BackendServicesDeleteCall {
  31414. c.ctx_ = ctx
  31415. return c
  31416. }
  31417. // Header returns an http.Header that can be modified by the caller to
  31418. // add HTTP headers to the request.
  31419. func (c *BackendServicesDeleteCall) Header() http.Header {
  31420. if c.header_ == nil {
  31421. c.header_ = make(http.Header)
  31422. }
  31423. return c.header_
  31424. }
  31425. func (c *BackendServicesDeleteCall) doRequest(alt string) (*http.Response, error) {
  31426. reqHeaders := make(http.Header)
  31427. for k, v := range c.header_ {
  31428. reqHeaders[k] = v
  31429. }
  31430. reqHeaders.Set("User-Agent", c.s.userAgent())
  31431. var body io.Reader = nil
  31432. c.urlParams_.Set("alt", alt)
  31433. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/backendServices/{backendService}")
  31434. urls += "?" + c.urlParams_.Encode()
  31435. req, _ := http.NewRequest("DELETE", urls, body)
  31436. req.Header = reqHeaders
  31437. googleapi.Expand(req.URL, map[string]string{
  31438. "project": c.project,
  31439. "backendService": c.backendService,
  31440. })
  31441. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  31442. }
  31443. // Do executes the "compute.backendServices.delete" call.
  31444. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  31445. // status code is an error. Response headers are in either
  31446. // *Operation.ServerResponse.Header or (if a response was returned at
  31447. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  31448. // to check whether the returned error was because
  31449. // http.StatusNotModified was returned.
  31450. func (c *BackendServicesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  31451. gensupport.SetOptions(c.urlParams_, opts...)
  31452. res, err := c.doRequest("json")
  31453. if res != nil && res.StatusCode == http.StatusNotModified {
  31454. if res.Body != nil {
  31455. res.Body.Close()
  31456. }
  31457. return nil, &googleapi.Error{
  31458. Code: res.StatusCode,
  31459. Header: res.Header,
  31460. }
  31461. }
  31462. if err != nil {
  31463. return nil, err
  31464. }
  31465. defer googleapi.CloseBody(res)
  31466. if err := googleapi.CheckResponse(res); err != nil {
  31467. return nil, err
  31468. }
  31469. ret := &Operation{
  31470. ServerResponse: googleapi.ServerResponse{
  31471. Header: res.Header,
  31472. HTTPStatusCode: res.StatusCode,
  31473. },
  31474. }
  31475. target := &ret
  31476. if err := gensupport.DecodeResponse(target, res); err != nil {
  31477. return nil, err
  31478. }
  31479. return ret, nil
  31480. // {
  31481. // "description": "Deletes the specified BackendService resource.",
  31482. // "httpMethod": "DELETE",
  31483. // "id": "compute.backendServices.delete",
  31484. // "parameterOrder": [
  31485. // "project",
  31486. // "backendService"
  31487. // ],
  31488. // "parameters": {
  31489. // "backendService": {
  31490. // "description": "Name of the BackendService resource to delete.",
  31491. // "location": "path",
  31492. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  31493. // "required": true,
  31494. // "type": "string"
  31495. // },
  31496. // "project": {
  31497. // "description": "Project ID for this request.",
  31498. // "location": "path",
  31499. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  31500. // "required": true,
  31501. // "type": "string"
  31502. // },
  31503. // "requestId": {
  31504. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  31505. // "location": "query",
  31506. // "type": "string"
  31507. // }
  31508. // },
  31509. // "path": "{project}/global/backendServices/{backendService}",
  31510. // "response": {
  31511. // "$ref": "Operation"
  31512. // },
  31513. // "scopes": [
  31514. // "https://www.googleapis.com/auth/cloud-platform",
  31515. // "https://www.googleapis.com/auth/compute"
  31516. // ]
  31517. // }
  31518. }
  31519. // method id "compute.backendServices.deleteSignedUrlKey":
  31520. type BackendServicesDeleteSignedUrlKeyCall struct {
  31521. s *Service
  31522. project string
  31523. backendService string
  31524. urlParams_ gensupport.URLParams
  31525. ctx_ context.Context
  31526. header_ http.Header
  31527. }
  31528. // DeleteSignedUrlKey: Deletes the given Signed URL Key from the
  31529. // specified backend service.
  31530. func (r *BackendServicesService) DeleteSignedUrlKey(project string, backendService string, keyName string) *BackendServicesDeleteSignedUrlKeyCall {
  31531. c := &BackendServicesDeleteSignedUrlKeyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  31532. c.project = project
  31533. c.backendService = backendService
  31534. c.urlParams_.Set("keyName", keyName)
  31535. return c
  31536. }
  31537. // RequestId sets the optional parameter "requestId": An optional
  31538. // request ID to identify requests. Specify a unique request ID so that
  31539. // if you must retry your request, the server will know to ignore the
  31540. // request if it has already been completed.
  31541. //
  31542. // For example, consider a situation where you make an initial request
  31543. // and the request times out. If you make the request again with the
  31544. // same request ID, the server can check if original operation with the
  31545. // same request ID was received, and if so, will ignore the second
  31546. // request. This prevents clients from accidentally creating duplicate
  31547. // commitments.
  31548. //
  31549. // The request ID must be a valid UUID with the exception that zero UUID
  31550. // is not supported (00000000-0000-0000-0000-000000000000).
  31551. func (c *BackendServicesDeleteSignedUrlKeyCall) RequestId(requestId string) *BackendServicesDeleteSignedUrlKeyCall {
  31552. c.urlParams_.Set("requestId", requestId)
  31553. return c
  31554. }
  31555. // Fields allows partial responses to be retrieved. See
  31556. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  31557. // for more information.
  31558. func (c *BackendServicesDeleteSignedUrlKeyCall) Fields(s ...googleapi.Field) *BackendServicesDeleteSignedUrlKeyCall {
  31559. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  31560. return c
  31561. }
  31562. // Context sets the context to be used in this call's Do method. Any
  31563. // pending HTTP request will be aborted if the provided context is
  31564. // canceled.
  31565. func (c *BackendServicesDeleteSignedUrlKeyCall) Context(ctx context.Context) *BackendServicesDeleteSignedUrlKeyCall {
  31566. c.ctx_ = ctx
  31567. return c
  31568. }
  31569. // Header returns an http.Header that can be modified by the caller to
  31570. // add HTTP headers to the request.
  31571. func (c *BackendServicesDeleteSignedUrlKeyCall) Header() http.Header {
  31572. if c.header_ == nil {
  31573. c.header_ = make(http.Header)
  31574. }
  31575. return c.header_
  31576. }
  31577. func (c *BackendServicesDeleteSignedUrlKeyCall) doRequest(alt string) (*http.Response, error) {
  31578. reqHeaders := make(http.Header)
  31579. for k, v := range c.header_ {
  31580. reqHeaders[k] = v
  31581. }
  31582. reqHeaders.Set("User-Agent", c.s.userAgent())
  31583. var body io.Reader = nil
  31584. c.urlParams_.Set("alt", alt)
  31585. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/backendServices/{backendService}/deleteSignedUrlKey")
  31586. urls += "?" + c.urlParams_.Encode()
  31587. req, _ := http.NewRequest("POST", urls, body)
  31588. req.Header = reqHeaders
  31589. googleapi.Expand(req.URL, map[string]string{
  31590. "project": c.project,
  31591. "backendService": c.backendService,
  31592. })
  31593. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  31594. }
  31595. // Do executes the "compute.backendServices.deleteSignedUrlKey" call.
  31596. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  31597. // status code is an error. Response headers are in either
  31598. // *Operation.ServerResponse.Header or (if a response was returned at
  31599. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  31600. // to check whether the returned error was because
  31601. // http.StatusNotModified was returned.
  31602. func (c *BackendServicesDeleteSignedUrlKeyCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  31603. gensupport.SetOptions(c.urlParams_, opts...)
  31604. res, err := c.doRequest("json")
  31605. if res != nil && res.StatusCode == http.StatusNotModified {
  31606. if res.Body != nil {
  31607. res.Body.Close()
  31608. }
  31609. return nil, &googleapi.Error{
  31610. Code: res.StatusCode,
  31611. Header: res.Header,
  31612. }
  31613. }
  31614. if err != nil {
  31615. return nil, err
  31616. }
  31617. defer googleapi.CloseBody(res)
  31618. if err := googleapi.CheckResponse(res); err != nil {
  31619. return nil, err
  31620. }
  31621. ret := &Operation{
  31622. ServerResponse: googleapi.ServerResponse{
  31623. Header: res.Header,
  31624. HTTPStatusCode: res.StatusCode,
  31625. },
  31626. }
  31627. target := &ret
  31628. if err := gensupport.DecodeResponse(target, res); err != nil {
  31629. return nil, err
  31630. }
  31631. return ret, nil
  31632. // {
  31633. // "description": "Deletes the given Signed URL Key from the specified backend service.",
  31634. // "httpMethod": "POST",
  31635. // "id": "compute.backendServices.deleteSignedUrlKey",
  31636. // "parameterOrder": [
  31637. // "project",
  31638. // "backendService",
  31639. // "keyName"
  31640. // ],
  31641. // "parameters": {
  31642. // "backendService": {
  31643. // "description": "Name of the BackendService resource to which the Signed URL Key should be added. The name should conform to RFC1035.",
  31644. // "location": "path",
  31645. // "required": true,
  31646. // "type": "string"
  31647. // },
  31648. // "keyName": {
  31649. // "description": "The name of the Signed URL Key to delete.",
  31650. // "location": "query",
  31651. // "required": true,
  31652. // "type": "string"
  31653. // },
  31654. // "project": {
  31655. // "description": "Project ID for this request.",
  31656. // "location": "path",
  31657. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  31658. // "required": true,
  31659. // "type": "string"
  31660. // },
  31661. // "requestId": {
  31662. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  31663. // "location": "query",
  31664. // "type": "string"
  31665. // }
  31666. // },
  31667. // "path": "{project}/global/backendServices/{backendService}/deleteSignedUrlKey",
  31668. // "response": {
  31669. // "$ref": "Operation"
  31670. // },
  31671. // "scopes": [
  31672. // "https://www.googleapis.com/auth/cloud-platform",
  31673. // "https://www.googleapis.com/auth/compute"
  31674. // ]
  31675. // }
  31676. }
  31677. // method id "compute.backendServices.get":
  31678. type BackendServicesGetCall struct {
  31679. s *Service
  31680. project string
  31681. backendService string
  31682. urlParams_ gensupport.URLParams
  31683. ifNoneMatch_ string
  31684. ctx_ context.Context
  31685. header_ http.Header
  31686. }
  31687. // Get: Returns the specified BackendService resource. Gets a list of
  31688. // available backend services by making a list() request.
  31689. // For details, see https://cloud.google.com/compute/docs/reference/latest/backendServices/get
  31690. func (r *BackendServicesService) Get(project string, backendService string) *BackendServicesGetCall {
  31691. c := &BackendServicesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  31692. c.project = project
  31693. c.backendService = backendService
  31694. return c
  31695. }
  31696. // Fields allows partial responses to be retrieved. See
  31697. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  31698. // for more information.
  31699. func (c *BackendServicesGetCall) Fields(s ...googleapi.Field) *BackendServicesGetCall {
  31700. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  31701. return c
  31702. }
  31703. // IfNoneMatch sets the optional parameter which makes the operation
  31704. // fail if the object's ETag matches the given value. This is useful for
  31705. // getting updates only after the object has changed since the last
  31706. // request. Use googleapi.IsNotModified to check whether the response
  31707. // error from Do is the result of In-None-Match.
  31708. func (c *BackendServicesGetCall) IfNoneMatch(entityTag string) *BackendServicesGetCall {
  31709. c.ifNoneMatch_ = entityTag
  31710. return c
  31711. }
  31712. // Context sets the context to be used in this call's Do method. Any
  31713. // pending HTTP request will be aborted if the provided context is
  31714. // canceled.
  31715. func (c *BackendServicesGetCall) Context(ctx context.Context) *BackendServicesGetCall {
  31716. c.ctx_ = ctx
  31717. return c
  31718. }
  31719. // Header returns an http.Header that can be modified by the caller to
  31720. // add HTTP headers to the request.
  31721. func (c *BackendServicesGetCall) Header() http.Header {
  31722. if c.header_ == nil {
  31723. c.header_ = make(http.Header)
  31724. }
  31725. return c.header_
  31726. }
  31727. func (c *BackendServicesGetCall) doRequest(alt string) (*http.Response, error) {
  31728. reqHeaders := make(http.Header)
  31729. for k, v := range c.header_ {
  31730. reqHeaders[k] = v
  31731. }
  31732. reqHeaders.Set("User-Agent", c.s.userAgent())
  31733. if c.ifNoneMatch_ != "" {
  31734. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  31735. }
  31736. var body io.Reader = nil
  31737. c.urlParams_.Set("alt", alt)
  31738. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/backendServices/{backendService}")
  31739. urls += "?" + c.urlParams_.Encode()
  31740. req, _ := http.NewRequest("GET", urls, body)
  31741. req.Header = reqHeaders
  31742. googleapi.Expand(req.URL, map[string]string{
  31743. "project": c.project,
  31744. "backendService": c.backendService,
  31745. })
  31746. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  31747. }
  31748. // Do executes the "compute.backendServices.get" call.
  31749. // Exactly one of *BackendService or error will be non-nil. Any non-2xx
  31750. // status code is an error. Response headers are in either
  31751. // *BackendService.ServerResponse.Header or (if a response was returned
  31752. // at all) in error.(*googleapi.Error).Header. Use
  31753. // googleapi.IsNotModified to check whether the returned error was
  31754. // because http.StatusNotModified was returned.
  31755. func (c *BackendServicesGetCall) Do(opts ...googleapi.CallOption) (*BackendService, error) {
  31756. gensupport.SetOptions(c.urlParams_, opts...)
  31757. res, err := c.doRequest("json")
  31758. if res != nil && res.StatusCode == http.StatusNotModified {
  31759. if res.Body != nil {
  31760. res.Body.Close()
  31761. }
  31762. return nil, &googleapi.Error{
  31763. Code: res.StatusCode,
  31764. Header: res.Header,
  31765. }
  31766. }
  31767. if err != nil {
  31768. return nil, err
  31769. }
  31770. defer googleapi.CloseBody(res)
  31771. if err := googleapi.CheckResponse(res); err != nil {
  31772. return nil, err
  31773. }
  31774. ret := &BackendService{
  31775. ServerResponse: googleapi.ServerResponse{
  31776. Header: res.Header,
  31777. HTTPStatusCode: res.StatusCode,
  31778. },
  31779. }
  31780. target := &ret
  31781. if err := gensupport.DecodeResponse(target, res); err != nil {
  31782. return nil, err
  31783. }
  31784. return ret, nil
  31785. // {
  31786. // "description": "Returns the specified BackendService resource. Gets a list of available backend services by making a list() request.",
  31787. // "httpMethod": "GET",
  31788. // "id": "compute.backendServices.get",
  31789. // "parameterOrder": [
  31790. // "project",
  31791. // "backendService"
  31792. // ],
  31793. // "parameters": {
  31794. // "backendService": {
  31795. // "description": "Name of the BackendService resource to return.",
  31796. // "location": "path",
  31797. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  31798. // "required": true,
  31799. // "type": "string"
  31800. // },
  31801. // "project": {
  31802. // "description": "Project ID for this request.",
  31803. // "location": "path",
  31804. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  31805. // "required": true,
  31806. // "type": "string"
  31807. // }
  31808. // },
  31809. // "path": "{project}/global/backendServices/{backendService}",
  31810. // "response": {
  31811. // "$ref": "BackendService"
  31812. // },
  31813. // "scopes": [
  31814. // "https://www.googleapis.com/auth/cloud-platform",
  31815. // "https://www.googleapis.com/auth/compute",
  31816. // "https://www.googleapis.com/auth/compute.readonly"
  31817. // ]
  31818. // }
  31819. }
  31820. // method id "compute.backendServices.getHealth":
  31821. type BackendServicesGetHealthCall struct {
  31822. s *Service
  31823. project string
  31824. backendService string
  31825. resourcegroupreference *ResourceGroupReference
  31826. urlParams_ gensupport.URLParams
  31827. ctx_ context.Context
  31828. header_ http.Header
  31829. }
  31830. // GetHealth: Gets the most recent health check results for this
  31831. // BackendService.
  31832. // For details, see https://cloud.google.com/compute/docs/reference/latest/backendServices/getHealth
  31833. func (r *BackendServicesService) GetHealth(project string, backendService string, resourcegroupreference *ResourceGroupReference) *BackendServicesGetHealthCall {
  31834. c := &BackendServicesGetHealthCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  31835. c.project = project
  31836. c.backendService = backendService
  31837. c.resourcegroupreference = resourcegroupreference
  31838. return c
  31839. }
  31840. // Fields allows partial responses to be retrieved. See
  31841. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  31842. // for more information.
  31843. func (c *BackendServicesGetHealthCall) Fields(s ...googleapi.Field) *BackendServicesGetHealthCall {
  31844. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  31845. return c
  31846. }
  31847. // Context sets the context to be used in this call's Do method. Any
  31848. // pending HTTP request will be aborted if the provided context is
  31849. // canceled.
  31850. func (c *BackendServicesGetHealthCall) Context(ctx context.Context) *BackendServicesGetHealthCall {
  31851. c.ctx_ = ctx
  31852. return c
  31853. }
  31854. // Header returns an http.Header that can be modified by the caller to
  31855. // add HTTP headers to the request.
  31856. func (c *BackendServicesGetHealthCall) Header() http.Header {
  31857. if c.header_ == nil {
  31858. c.header_ = make(http.Header)
  31859. }
  31860. return c.header_
  31861. }
  31862. func (c *BackendServicesGetHealthCall) doRequest(alt string) (*http.Response, error) {
  31863. reqHeaders := make(http.Header)
  31864. for k, v := range c.header_ {
  31865. reqHeaders[k] = v
  31866. }
  31867. reqHeaders.Set("User-Agent", c.s.userAgent())
  31868. var body io.Reader = nil
  31869. body, err := googleapi.WithoutDataWrapper.JSONReader(c.resourcegroupreference)
  31870. if err != nil {
  31871. return nil, err
  31872. }
  31873. reqHeaders.Set("Content-Type", "application/json")
  31874. c.urlParams_.Set("alt", alt)
  31875. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/backendServices/{backendService}/getHealth")
  31876. urls += "?" + c.urlParams_.Encode()
  31877. req, _ := http.NewRequest("POST", urls, body)
  31878. req.Header = reqHeaders
  31879. googleapi.Expand(req.URL, map[string]string{
  31880. "project": c.project,
  31881. "backendService": c.backendService,
  31882. })
  31883. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  31884. }
  31885. // Do executes the "compute.backendServices.getHealth" call.
  31886. // Exactly one of *BackendServiceGroupHealth or error will be non-nil.
  31887. // Any non-2xx status code is an error. Response headers are in either
  31888. // *BackendServiceGroupHealth.ServerResponse.Header or (if a response
  31889. // was returned at all) in error.(*googleapi.Error).Header. Use
  31890. // googleapi.IsNotModified to check whether the returned error was
  31891. // because http.StatusNotModified was returned.
  31892. func (c *BackendServicesGetHealthCall) Do(opts ...googleapi.CallOption) (*BackendServiceGroupHealth, error) {
  31893. gensupport.SetOptions(c.urlParams_, opts...)
  31894. res, err := c.doRequest("json")
  31895. if res != nil && res.StatusCode == http.StatusNotModified {
  31896. if res.Body != nil {
  31897. res.Body.Close()
  31898. }
  31899. return nil, &googleapi.Error{
  31900. Code: res.StatusCode,
  31901. Header: res.Header,
  31902. }
  31903. }
  31904. if err != nil {
  31905. return nil, err
  31906. }
  31907. defer googleapi.CloseBody(res)
  31908. if err := googleapi.CheckResponse(res); err != nil {
  31909. return nil, err
  31910. }
  31911. ret := &BackendServiceGroupHealth{
  31912. ServerResponse: googleapi.ServerResponse{
  31913. Header: res.Header,
  31914. HTTPStatusCode: res.StatusCode,
  31915. },
  31916. }
  31917. target := &ret
  31918. if err := gensupport.DecodeResponse(target, res); err != nil {
  31919. return nil, err
  31920. }
  31921. return ret, nil
  31922. // {
  31923. // "description": "Gets the most recent health check results for this BackendService.",
  31924. // "httpMethod": "POST",
  31925. // "id": "compute.backendServices.getHealth",
  31926. // "parameterOrder": [
  31927. // "project",
  31928. // "backendService"
  31929. // ],
  31930. // "parameters": {
  31931. // "backendService": {
  31932. // "description": "Name of the BackendService resource to which the queried instance belongs.",
  31933. // "location": "path",
  31934. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  31935. // "required": true,
  31936. // "type": "string"
  31937. // },
  31938. // "project": {
  31939. // "location": "path",
  31940. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  31941. // "required": true,
  31942. // "type": "string"
  31943. // }
  31944. // },
  31945. // "path": "{project}/global/backendServices/{backendService}/getHealth",
  31946. // "request": {
  31947. // "$ref": "ResourceGroupReference"
  31948. // },
  31949. // "response": {
  31950. // "$ref": "BackendServiceGroupHealth"
  31951. // },
  31952. // "scopes": [
  31953. // "https://www.googleapis.com/auth/cloud-platform",
  31954. // "https://www.googleapis.com/auth/compute",
  31955. // "https://www.googleapis.com/auth/compute.readonly"
  31956. // ]
  31957. // }
  31958. }
  31959. // method id "compute.backendServices.insert":
  31960. type BackendServicesInsertCall struct {
  31961. s *Service
  31962. project string
  31963. backendservice *BackendService
  31964. urlParams_ gensupport.URLParams
  31965. ctx_ context.Context
  31966. header_ http.Header
  31967. }
  31968. // Insert: Creates a BackendService resource in the specified project
  31969. // using the data included in the request. There are several
  31970. // restrictions and guidelines to keep in mind when creating a backend
  31971. // service. Read Restrictions and Guidelines for more information.
  31972. // For details, see https://cloud.google.com/compute/docs/reference/latest/backendServices/insert
  31973. func (r *BackendServicesService) Insert(project string, backendservice *BackendService) *BackendServicesInsertCall {
  31974. c := &BackendServicesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  31975. c.project = project
  31976. c.backendservice = backendservice
  31977. return c
  31978. }
  31979. // RequestId sets the optional parameter "requestId": An optional
  31980. // request ID to identify requests. Specify a unique request ID so that
  31981. // if you must retry your request, the server will know to ignore the
  31982. // request if it has already been completed.
  31983. //
  31984. // For example, consider a situation where you make an initial request
  31985. // and the request times out. If you make the request again with the
  31986. // same request ID, the server can check if original operation with the
  31987. // same request ID was received, and if so, will ignore the second
  31988. // request. This prevents clients from accidentally creating duplicate
  31989. // commitments.
  31990. //
  31991. // The request ID must be a valid UUID with the exception that zero UUID
  31992. // is not supported (00000000-0000-0000-0000-000000000000).
  31993. func (c *BackendServicesInsertCall) RequestId(requestId string) *BackendServicesInsertCall {
  31994. c.urlParams_.Set("requestId", requestId)
  31995. return c
  31996. }
  31997. // Fields allows partial responses to be retrieved. See
  31998. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  31999. // for more information.
  32000. func (c *BackendServicesInsertCall) Fields(s ...googleapi.Field) *BackendServicesInsertCall {
  32001. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  32002. return c
  32003. }
  32004. // Context sets the context to be used in this call's Do method. Any
  32005. // pending HTTP request will be aborted if the provided context is
  32006. // canceled.
  32007. func (c *BackendServicesInsertCall) Context(ctx context.Context) *BackendServicesInsertCall {
  32008. c.ctx_ = ctx
  32009. return c
  32010. }
  32011. // Header returns an http.Header that can be modified by the caller to
  32012. // add HTTP headers to the request.
  32013. func (c *BackendServicesInsertCall) Header() http.Header {
  32014. if c.header_ == nil {
  32015. c.header_ = make(http.Header)
  32016. }
  32017. return c.header_
  32018. }
  32019. func (c *BackendServicesInsertCall) doRequest(alt string) (*http.Response, error) {
  32020. reqHeaders := make(http.Header)
  32021. for k, v := range c.header_ {
  32022. reqHeaders[k] = v
  32023. }
  32024. reqHeaders.Set("User-Agent", c.s.userAgent())
  32025. var body io.Reader = nil
  32026. body, err := googleapi.WithoutDataWrapper.JSONReader(c.backendservice)
  32027. if err != nil {
  32028. return nil, err
  32029. }
  32030. reqHeaders.Set("Content-Type", "application/json")
  32031. c.urlParams_.Set("alt", alt)
  32032. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/backendServices")
  32033. urls += "?" + c.urlParams_.Encode()
  32034. req, _ := http.NewRequest("POST", urls, body)
  32035. req.Header = reqHeaders
  32036. googleapi.Expand(req.URL, map[string]string{
  32037. "project": c.project,
  32038. })
  32039. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  32040. }
  32041. // Do executes the "compute.backendServices.insert" call.
  32042. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  32043. // status code is an error. Response headers are in either
  32044. // *Operation.ServerResponse.Header or (if a response was returned at
  32045. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  32046. // to check whether the returned error was because
  32047. // http.StatusNotModified was returned.
  32048. func (c *BackendServicesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  32049. gensupport.SetOptions(c.urlParams_, opts...)
  32050. res, err := c.doRequest("json")
  32051. if res != nil && res.StatusCode == http.StatusNotModified {
  32052. if res.Body != nil {
  32053. res.Body.Close()
  32054. }
  32055. return nil, &googleapi.Error{
  32056. Code: res.StatusCode,
  32057. Header: res.Header,
  32058. }
  32059. }
  32060. if err != nil {
  32061. return nil, err
  32062. }
  32063. defer googleapi.CloseBody(res)
  32064. if err := googleapi.CheckResponse(res); err != nil {
  32065. return nil, err
  32066. }
  32067. ret := &Operation{
  32068. ServerResponse: googleapi.ServerResponse{
  32069. Header: res.Header,
  32070. HTTPStatusCode: res.StatusCode,
  32071. },
  32072. }
  32073. target := &ret
  32074. if err := gensupport.DecodeResponse(target, res); err != nil {
  32075. return nil, err
  32076. }
  32077. return ret, nil
  32078. // {
  32079. // "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.",
  32080. // "httpMethod": "POST",
  32081. // "id": "compute.backendServices.insert",
  32082. // "parameterOrder": [
  32083. // "project"
  32084. // ],
  32085. // "parameters": {
  32086. // "project": {
  32087. // "description": "Project ID for this request.",
  32088. // "location": "path",
  32089. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  32090. // "required": true,
  32091. // "type": "string"
  32092. // },
  32093. // "requestId": {
  32094. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  32095. // "location": "query",
  32096. // "type": "string"
  32097. // }
  32098. // },
  32099. // "path": "{project}/global/backendServices",
  32100. // "request": {
  32101. // "$ref": "BackendService"
  32102. // },
  32103. // "response": {
  32104. // "$ref": "Operation"
  32105. // },
  32106. // "scopes": [
  32107. // "https://www.googleapis.com/auth/cloud-platform",
  32108. // "https://www.googleapis.com/auth/compute"
  32109. // ]
  32110. // }
  32111. }
  32112. // method id "compute.backendServices.list":
  32113. type BackendServicesListCall struct {
  32114. s *Service
  32115. project string
  32116. urlParams_ gensupport.URLParams
  32117. ifNoneMatch_ string
  32118. ctx_ context.Context
  32119. header_ http.Header
  32120. }
  32121. // List: Retrieves the list of BackendService resources available to the
  32122. // specified project.
  32123. // For details, see https://cloud.google.com/compute/docs/reference/latest/backendServices/list
  32124. func (r *BackendServicesService) List(project string) *BackendServicesListCall {
  32125. c := &BackendServicesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  32126. c.project = project
  32127. return c
  32128. }
  32129. // Filter sets the optional parameter "filter": A filter expression that
  32130. // filters resources listed in the response. The expression must specify
  32131. // the field name, a comparison operator, and the value that you want to
  32132. // use for filtering. The value must be a string, a number, or a
  32133. // boolean. The comparison operator must be either =, !=, >, or <.
  32134. //
  32135. // For example, if you are filtering Compute Engine instances, you can
  32136. // exclude instances named example-instance by specifying name !=
  32137. // example-instance.
  32138. //
  32139. // You can also filter nested fields. For example, you could specify
  32140. // scheduling.automaticRestart = false to include instances only if they
  32141. // are not scheduled for automatic restarts. You can use filtering on
  32142. // nested fields to filter based on resource labels.
  32143. //
  32144. // To filter on multiple expressions, provide each separate expression
  32145. // within parentheses. For example, (scheduling.automaticRestart = true)
  32146. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  32147. // AND expression. However, you can include AND and OR expressions
  32148. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  32149. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  32150. // true).
  32151. func (c *BackendServicesListCall) Filter(filter string) *BackendServicesListCall {
  32152. c.urlParams_.Set("filter", filter)
  32153. return c
  32154. }
  32155. // MaxResults sets the optional parameter "maxResults": The maximum
  32156. // number of results per page that should be returned. If the number of
  32157. // available results is larger than maxResults, Compute Engine returns a
  32158. // nextPageToken that can be used to get the next page of results in
  32159. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  32160. // (Default: 500)
  32161. func (c *BackendServicesListCall) MaxResults(maxResults int64) *BackendServicesListCall {
  32162. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  32163. return c
  32164. }
  32165. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  32166. // a certain order. By default, results are returned in alphanumerical
  32167. // order based on the resource name.
  32168. //
  32169. // You can also sort results in descending order based on the creation
  32170. // timestamp using orderBy="creationTimestamp desc". This sorts results
  32171. // based on the creationTimestamp field in reverse chronological order
  32172. // (newest result first). Use this to sort resources like operations so
  32173. // that the newest operation is returned first.
  32174. //
  32175. // Currently, only sorting by name or creationTimestamp desc is
  32176. // supported.
  32177. func (c *BackendServicesListCall) OrderBy(orderBy string) *BackendServicesListCall {
  32178. c.urlParams_.Set("orderBy", orderBy)
  32179. return c
  32180. }
  32181. // PageToken sets the optional parameter "pageToken": Specifies a page
  32182. // token to use. Set pageToken to the nextPageToken returned by a
  32183. // previous list request to get the next page of results.
  32184. func (c *BackendServicesListCall) PageToken(pageToken string) *BackendServicesListCall {
  32185. c.urlParams_.Set("pageToken", pageToken)
  32186. return c
  32187. }
  32188. // Fields allows partial responses to be retrieved. See
  32189. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  32190. // for more information.
  32191. func (c *BackendServicesListCall) Fields(s ...googleapi.Field) *BackendServicesListCall {
  32192. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  32193. return c
  32194. }
  32195. // IfNoneMatch sets the optional parameter which makes the operation
  32196. // fail if the object's ETag matches the given value. This is useful for
  32197. // getting updates only after the object has changed since the last
  32198. // request. Use googleapi.IsNotModified to check whether the response
  32199. // error from Do is the result of In-None-Match.
  32200. func (c *BackendServicesListCall) IfNoneMatch(entityTag string) *BackendServicesListCall {
  32201. c.ifNoneMatch_ = entityTag
  32202. return c
  32203. }
  32204. // Context sets the context to be used in this call's Do method. Any
  32205. // pending HTTP request will be aborted if the provided context is
  32206. // canceled.
  32207. func (c *BackendServicesListCall) Context(ctx context.Context) *BackendServicesListCall {
  32208. c.ctx_ = ctx
  32209. return c
  32210. }
  32211. // Header returns an http.Header that can be modified by the caller to
  32212. // add HTTP headers to the request.
  32213. func (c *BackendServicesListCall) Header() http.Header {
  32214. if c.header_ == nil {
  32215. c.header_ = make(http.Header)
  32216. }
  32217. return c.header_
  32218. }
  32219. func (c *BackendServicesListCall) doRequest(alt string) (*http.Response, error) {
  32220. reqHeaders := make(http.Header)
  32221. for k, v := range c.header_ {
  32222. reqHeaders[k] = v
  32223. }
  32224. reqHeaders.Set("User-Agent", c.s.userAgent())
  32225. if c.ifNoneMatch_ != "" {
  32226. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  32227. }
  32228. var body io.Reader = nil
  32229. c.urlParams_.Set("alt", alt)
  32230. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/backendServices")
  32231. urls += "?" + c.urlParams_.Encode()
  32232. req, _ := http.NewRequest("GET", urls, body)
  32233. req.Header = reqHeaders
  32234. googleapi.Expand(req.URL, map[string]string{
  32235. "project": c.project,
  32236. })
  32237. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  32238. }
  32239. // Do executes the "compute.backendServices.list" call.
  32240. // Exactly one of *BackendServiceList or error will be non-nil. Any
  32241. // non-2xx status code is an error. Response headers are in either
  32242. // *BackendServiceList.ServerResponse.Header or (if a response was
  32243. // returned at all) in error.(*googleapi.Error).Header. Use
  32244. // googleapi.IsNotModified to check whether the returned error was
  32245. // because http.StatusNotModified was returned.
  32246. func (c *BackendServicesListCall) Do(opts ...googleapi.CallOption) (*BackendServiceList, error) {
  32247. gensupport.SetOptions(c.urlParams_, opts...)
  32248. res, err := c.doRequest("json")
  32249. if res != nil && res.StatusCode == http.StatusNotModified {
  32250. if res.Body != nil {
  32251. res.Body.Close()
  32252. }
  32253. return nil, &googleapi.Error{
  32254. Code: res.StatusCode,
  32255. Header: res.Header,
  32256. }
  32257. }
  32258. if err != nil {
  32259. return nil, err
  32260. }
  32261. defer googleapi.CloseBody(res)
  32262. if err := googleapi.CheckResponse(res); err != nil {
  32263. return nil, err
  32264. }
  32265. ret := &BackendServiceList{
  32266. ServerResponse: googleapi.ServerResponse{
  32267. Header: res.Header,
  32268. HTTPStatusCode: res.StatusCode,
  32269. },
  32270. }
  32271. target := &ret
  32272. if err := gensupport.DecodeResponse(target, res); err != nil {
  32273. return nil, err
  32274. }
  32275. return ret, nil
  32276. // {
  32277. // "description": "Retrieves the list of BackendService resources available to the specified project.",
  32278. // "httpMethod": "GET",
  32279. // "id": "compute.backendServices.list",
  32280. // "parameterOrder": [
  32281. // "project"
  32282. // ],
  32283. // "parameters": {
  32284. // "filter": {
  32285. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  32286. // "location": "query",
  32287. // "type": "string"
  32288. // },
  32289. // "maxResults": {
  32290. // "default": "500",
  32291. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  32292. // "format": "uint32",
  32293. // "location": "query",
  32294. // "minimum": "0",
  32295. // "type": "integer"
  32296. // },
  32297. // "orderBy": {
  32298. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  32299. // "location": "query",
  32300. // "type": "string"
  32301. // },
  32302. // "pageToken": {
  32303. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  32304. // "location": "query",
  32305. // "type": "string"
  32306. // },
  32307. // "project": {
  32308. // "description": "Project ID for this request.",
  32309. // "location": "path",
  32310. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  32311. // "required": true,
  32312. // "type": "string"
  32313. // }
  32314. // },
  32315. // "path": "{project}/global/backendServices",
  32316. // "response": {
  32317. // "$ref": "BackendServiceList"
  32318. // },
  32319. // "scopes": [
  32320. // "https://www.googleapis.com/auth/cloud-platform",
  32321. // "https://www.googleapis.com/auth/compute",
  32322. // "https://www.googleapis.com/auth/compute.readonly"
  32323. // ]
  32324. // }
  32325. }
  32326. // Pages invokes f for each page of results.
  32327. // A non-nil error returned from f will halt the iteration.
  32328. // The provided context supersedes any context provided to the Context method.
  32329. func (c *BackendServicesListCall) Pages(ctx context.Context, f func(*BackendServiceList) error) error {
  32330. c.ctx_ = ctx
  32331. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  32332. for {
  32333. x, err := c.Do()
  32334. if err != nil {
  32335. return err
  32336. }
  32337. if err := f(x); err != nil {
  32338. return err
  32339. }
  32340. if x.NextPageToken == "" {
  32341. return nil
  32342. }
  32343. c.PageToken(x.NextPageToken)
  32344. }
  32345. }
  32346. // method id "compute.backendServices.patch":
  32347. type BackendServicesPatchCall struct {
  32348. s *Service
  32349. project string
  32350. backendService string
  32351. backendservice *BackendService
  32352. urlParams_ gensupport.URLParams
  32353. ctx_ context.Context
  32354. header_ http.Header
  32355. }
  32356. // Patch: Patches the specified BackendService resource with the data
  32357. // included in the request. There are several restrictions and
  32358. // guidelines to keep in mind when updating a backend service. Read
  32359. // Restrictions and Guidelines for more information. This method
  32360. // supports PATCH semantics and uses the JSON merge patch format and
  32361. // processing rules.
  32362. // For details, see https://cloud.google.com/compute/docs/reference/latest/backendServices/patch
  32363. func (r *BackendServicesService) Patch(project string, backendService string, backendservice *BackendService) *BackendServicesPatchCall {
  32364. c := &BackendServicesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  32365. c.project = project
  32366. c.backendService = backendService
  32367. c.backendservice = backendservice
  32368. return c
  32369. }
  32370. // RequestId sets the optional parameter "requestId": An optional
  32371. // request ID to identify requests. Specify a unique request ID so that
  32372. // if you must retry your request, the server will know to ignore the
  32373. // request if it has already been completed.
  32374. //
  32375. // For example, consider a situation where you make an initial request
  32376. // and the request times out. If you make the request again with the
  32377. // same request ID, the server can check if original operation with the
  32378. // same request ID was received, and if so, will ignore the second
  32379. // request. This prevents clients from accidentally creating duplicate
  32380. // commitments.
  32381. //
  32382. // The request ID must be a valid UUID with the exception that zero UUID
  32383. // is not supported (00000000-0000-0000-0000-000000000000).
  32384. func (c *BackendServicesPatchCall) RequestId(requestId string) *BackendServicesPatchCall {
  32385. c.urlParams_.Set("requestId", requestId)
  32386. return c
  32387. }
  32388. // Fields allows partial responses to be retrieved. See
  32389. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  32390. // for more information.
  32391. func (c *BackendServicesPatchCall) Fields(s ...googleapi.Field) *BackendServicesPatchCall {
  32392. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  32393. return c
  32394. }
  32395. // Context sets the context to be used in this call's Do method. Any
  32396. // pending HTTP request will be aborted if the provided context is
  32397. // canceled.
  32398. func (c *BackendServicesPatchCall) Context(ctx context.Context) *BackendServicesPatchCall {
  32399. c.ctx_ = ctx
  32400. return c
  32401. }
  32402. // Header returns an http.Header that can be modified by the caller to
  32403. // add HTTP headers to the request.
  32404. func (c *BackendServicesPatchCall) Header() http.Header {
  32405. if c.header_ == nil {
  32406. c.header_ = make(http.Header)
  32407. }
  32408. return c.header_
  32409. }
  32410. func (c *BackendServicesPatchCall) doRequest(alt string) (*http.Response, error) {
  32411. reqHeaders := make(http.Header)
  32412. for k, v := range c.header_ {
  32413. reqHeaders[k] = v
  32414. }
  32415. reqHeaders.Set("User-Agent", c.s.userAgent())
  32416. var body io.Reader = nil
  32417. body, err := googleapi.WithoutDataWrapper.JSONReader(c.backendservice)
  32418. if err != nil {
  32419. return nil, err
  32420. }
  32421. reqHeaders.Set("Content-Type", "application/json")
  32422. c.urlParams_.Set("alt", alt)
  32423. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/backendServices/{backendService}")
  32424. urls += "?" + c.urlParams_.Encode()
  32425. req, _ := http.NewRequest("PATCH", urls, body)
  32426. req.Header = reqHeaders
  32427. googleapi.Expand(req.URL, map[string]string{
  32428. "project": c.project,
  32429. "backendService": c.backendService,
  32430. })
  32431. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  32432. }
  32433. // Do executes the "compute.backendServices.patch" call.
  32434. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  32435. // status code is an error. Response headers are in either
  32436. // *Operation.ServerResponse.Header or (if a response was returned at
  32437. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  32438. // to check whether the returned error was because
  32439. // http.StatusNotModified was returned.
  32440. func (c *BackendServicesPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  32441. gensupport.SetOptions(c.urlParams_, opts...)
  32442. res, err := c.doRequest("json")
  32443. if res != nil && res.StatusCode == http.StatusNotModified {
  32444. if res.Body != nil {
  32445. res.Body.Close()
  32446. }
  32447. return nil, &googleapi.Error{
  32448. Code: res.StatusCode,
  32449. Header: res.Header,
  32450. }
  32451. }
  32452. if err != nil {
  32453. return nil, err
  32454. }
  32455. defer googleapi.CloseBody(res)
  32456. if err := googleapi.CheckResponse(res); err != nil {
  32457. return nil, err
  32458. }
  32459. ret := &Operation{
  32460. ServerResponse: googleapi.ServerResponse{
  32461. Header: res.Header,
  32462. HTTPStatusCode: res.StatusCode,
  32463. },
  32464. }
  32465. target := &ret
  32466. if err := gensupport.DecodeResponse(target, res); err != nil {
  32467. return nil, err
  32468. }
  32469. return ret, nil
  32470. // {
  32471. // "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.",
  32472. // "httpMethod": "PATCH",
  32473. // "id": "compute.backendServices.patch",
  32474. // "parameterOrder": [
  32475. // "project",
  32476. // "backendService"
  32477. // ],
  32478. // "parameters": {
  32479. // "backendService": {
  32480. // "description": "Name of the BackendService resource to patch.",
  32481. // "location": "path",
  32482. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  32483. // "required": true,
  32484. // "type": "string"
  32485. // },
  32486. // "project": {
  32487. // "description": "Project ID for this request.",
  32488. // "location": "path",
  32489. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  32490. // "required": true,
  32491. // "type": "string"
  32492. // },
  32493. // "requestId": {
  32494. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  32495. // "location": "query",
  32496. // "type": "string"
  32497. // }
  32498. // },
  32499. // "path": "{project}/global/backendServices/{backendService}",
  32500. // "request": {
  32501. // "$ref": "BackendService"
  32502. // },
  32503. // "response": {
  32504. // "$ref": "Operation"
  32505. // },
  32506. // "scopes": [
  32507. // "https://www.googleapis.com/auth/cloud-platform",
  32508. // "https://www.googleapis.com/auth/compute"
  32509. // ]
  32510. // }
  32511. }
  32512. // method id "compute.backendServices.setSecurityPolicy":
  32513. type BackendServicesSetSecurityPolicyCall struct {
  32514. s *Service
  32515. project string
  32516. backendService string
  32517. securitypolicyreference *SecurityPolicyReference
  32518. urlParams_ gensupport.URLParams
  32519. ctx_ context.Context
  32520. header_ http.Header
  32521. }
  32522. // SetSecurityPolicy: Sets the security policy for the specified backend
  32523. // service.
  32524. func (r *BackendServicesService) SetSecurityPolicy(project string, backendService string, securitypolicyreference *SecurityPolicyReference) *BackendServicesSetSecurityPolicyCall {
  32525. c := &BackendServicesSetSecurityPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  32526. c.project = project
  32527. c.backendService = backendService
  32528. c.securitypolicyreference = securitypolicyreference
  32529. return c
  32530. }
  32531. // RequestId sets the optional parameter "requestId": An optional
  32532. // request ID to identify requests. Specify a unique request ID so that
  32533. // if you must retry your request, the server will know to ignore the
  32534. // request if it has already been completed.
  32535. //
  32536. // For example, consider a situation where you make an initial request
  32537. // and the request times out. If you make the request again with the
  32538. // same request ID, the server can check if original operation with the
  32539. // same request ID was received, and if so, will ignore the second
  32540. // request. This prevents clients from accidentally creating duplicate
  32541. // commitments.
  32542. //
  32543. // The request ID must be a valid UUID with the exception that zero UUID
  32544. // is not supported (00000000-0000-0000-0000-000000000000).
  32545. func (c *BackendServicesSetSecurityPolicyCall) RequestId(requestId string) *BackendServicesSetSecurityPolicyCall {
  32546. c.urlParams_.Set("requestId", requestId)
  32547. return c
  32548. }
  32549. // Fields allows partial responses to be retrieved. See
  32550. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  32551. // for more information.
  32552. func (c *BackendServicesSetSecurityPolicyCall) Fields(s ...googleapi.Field) *BackendServicesSetSecurityPolicyCall {
  32553. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  32554. return c
  32555. }
  32556. // Context sets the context to be used in this call's Do method. Any
  32557. // pending HTTP request will be aborted if the provided context is
  32558. // canceled.
  32559. func (c *BackendServicesSetSecurityPolicyCall) Context(ctx context.Context) *BackendServicesSetSecurityPolicyCall {
  32560. c.ctx_ = ctx
  32561. return c
  32562. }
  32563. // Header returns an http.Header that can be modified by the caller to
  32564. // add HTTP headers to the request.
  32565. func (c *BackendServicesSetSecurityPolicyCall) Header() http.Header {
  32566. if c.header_ == nil {
  32567. c.header_ = make(http.Header)
  32568. }
  32569. return c.header_
  32570. }
  32571. func (c *BackendServicesSetSecurityPolicyCall) doRequest(alt string) (*http.Response, error) {
  32572. reqHeaders := make(http.Header)
  32573. for k, v := range c.header_ {
  32574. reqHeaders[k] = v
  32575. }
  32576. reqHeaders.Set("User-Agent", c.s.userAgent())
  32577. var body io.Reader = nil
  32578. body, err := googleapi.WithoutDataWrapper.JSONReader(c.securitypolicyreference)
  32579. if err != nil {
  32580. return nil, err
  32581. }
  32582. reqHeaders.Set("Content-Type", "application/json")
  32583. c.urlParams_.Set("alt", alt)
  32584. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/backendServices/{backendService}/setSecurityPolicy")
  32585. urls += "?" + c.urlParams_.Encode()
  32586. req, _ := http.NewRequest("POST", urls, body)
  32587. req.Header = reqHeaders
  32588. googleapi.Expand(req.URL, map[string]string{
  32589. "project": c.project,
  32590. "backendService": c.backendService,
  32591. })
  32592. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  32593. }
  32594. // Do executes the "compute.backendServices.setSecurityPolicy" call.
  32595. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  32596. // status code is an error. Response headers are in either
  32597. // *Operation.ServerResponse.Header or (if a response was returned at
  32598. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  32599. // to check whether the returned error was because
  32600. // http.StatusNotModified was returned.
  32601. func (c *BackendServicesSetSecurityPolicyCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  32602. gensupport.SetOptions(c.urlParams_, opts...)
  32603. res, err := c.doRequest("json")
  32604. if res != nil && res.StatusCode == http.StatusNotModified {
  32605. if res.Body != nil {
  32606. res.Body.Close()
  32607. }
  32608. return nil, &googleapi.Error{
  32609. Code: res.StatusCode,
  32610. Header: res.Header,
  32611. }
  32612. }
  32613. if err != nil {
  32614. return nil, err
  32615. }
  32616. defer googleapi.CloseBody(res)
  32617. if err := googleapi.CheckResponse(res); err != nil {
  32618. return nil, err
  32619. }
  32620. ret := &Operation{
  32621. ServerResponse: googleapi.ServerResponse{
  32622. Header: res.Header,
  32623. HTTPStatusCode: res.StatusCode,
  32624. },
  32625. }
  32626. target := &ret
  32627. if err := gensupport.DecodeResponse(target, res); err != nil {
  32628. return nil, err
  32629. }
  32630. return ret, nil
  32631. // {
  32632. // "description": "Sets the security policy for the specified backend service.",
  32633. // "httpMethod": "POST",
  32634. // "id": "compute.backendServices.setSecurityPolicy",
  32635. // "parameterOrder": [
  32636. // "project",
  32637. // "backendService"
  32638. // ],
  32639. // "parameters": {
  32640. // "backendService": {
  32641. // "description": "Name of the BackendService resource to which the security policy should be set. The name should conform to RFC1035.",
  32642. // "location": "path",
  32643. // "required": true,
  32644. // "type": "string"
  32645. // },
  32646. // "project": {
  32647. // "description": "Project ID for this request.",
  32648. // "location": "path",
  32649. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  32650. // "required": true,
  32651. // "type": "string"
  32652. // },
  32653. // "requestId": {
  32654. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  32655. // "location": "query",
  32656. // "type": "string"
  32657. // }
  32658. // },
  32659. // "path": "{project}/global/backendServices/{backendService}/setSecurityPolicy",
  32660. // "request": {
  32661. // "$ref": "SecurityPolicyReference"
  32662. // },
  32663. // "response": {
  32664. // "$ref": "Operation"
  32665. // },
  32666. // "scopes": [
  32667. // "https://www.googleapis.com/auth/cloud-platform",
  32668. // "https://www.googleapis.com/auth/compute"
  32669. // ]
  32670. // }
  32671. }
  32672. // method id "compute.backendServices.testIamPermissions":
  32673. type BackendServicesTestIamPermissionsCall struct {
  32674. s *Service
  32675. project string
  32676. resource string
  32677. testpermissionsrequest *TestPermissionsRequest
  32678. urlParams_ gensupport.URLParams
  32679. ctx_ context.Context
  32680. header_ http.Header
  32681. }
  32682. // TestIamPermissions: Returns permissions that a caller has on the
  32683. // specified resource.
  32684. func (r *BackendServicesService) TestIamPermissions(project string, resource string, testpermissionsrequest *TestPermissionsRequest) *BackendServicesTestIamPermissionsCall {
  32685. c := &BackendServicesTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  32686. c.project = project
  32687. c.resource = resource
  32688. c.testpermissionsrequest = testpermissionsrequest
  32689. return c
  32690. }
  32691. // Fields allows partial responses to be retrieved. See
  32692. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  32693. // for more information.
  32694. func (c *BackendServicesTestIamPermissionsCall) Fields(s ...googleapi.Field) *BackendServicesTestIamPermissionsCall {
  32695. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  32696. return c
  32697. }
  32698. // Context sets the context to be used in this call's Do method. Any
  32699. // pending HTTP request will be aborted if the provided context is
  32700. // canceled.
  32701. func (c *BackendServicesTestIamPermissionsCall) Context(ctx context.Context) *BackendServicesTestIamPermissionsCall {
  32702. c.ctx_ = ctx
  32703. return c
  32704. }
  32705. // Header returns an http.Header that can be modified by the caller to
  32706. // add HTTP headers to the request.
  32707. func (c *BackendServicesTestIamPermissionsCall) Header() http.Header {
  32708. if c.header_ == nil {
  32709. c.header_ = make(http.Header)
  32710. }
  32711. return c.header_
  32712. }
  32713. func (c *BackendServicesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  32714. reqHeaders := make(http.Header)
  32715. for k, v := range c.header_ {
  32716. reqHeaders[k] = v
  32717. }
  32718. reqHeaders.Set("User-Agent", c.s.userAgent())
  32719. var body io.Reader = nil
  32720. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  32721. if err != nil {
  32722. return nil, err
  32723. }
  32724. reqHeaders.Set("Content-Type", "application/json")
  32725. c.urlParams_.Set("alt", alt)
  32726. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/backendServices/{resource}/testIamPermissions")
  32727. urls += "?" + c.urlParams_.Encode()
  32728. req, _ := http.NewRequest("POST", urls, body)
  32729. req.Header = reqHeaders
  32730. googleapi.Expand(req.URL, map[string]string{
  32731. "project": c.project,
  32732. "resource": c.resource,
  32733. })
  32734. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  32735. }
  32736. // Do executes the "compute.backendServices.testIamPermissions" call.
  32737. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  32738. // non-2xx status code is an error. Response headers are in either
  32739. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  32740. // returned at all) in error.(*googleapi.Error).Header. Use
  32741. // googleapi.IsNotModified to check whether the returned error was
  32742. // because http.StatusNotModified was returned.
  32743. func (c *BackendServicesTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  32744. gensupport.SetOptions(c.urlParams_, opts...)
  32745. res, err := c.doRequest("json")
  32746. if res != nil && res.StatusCode == http.StatusNotModified {
  32747. if res.Body != nil {
  32748. res.Body.Close()
  32749. }
  32750. return nil, &googleapi.Error{
  32751. Code: res.StatusCode,
  32752. Header: res.Header,
  32753. }
  32754. }
  32755. if err != nil {
  32756. return nil, err
  32757. }
  32758. defer googleapi.CloseBody(res)
  32759. if err := googleapi.CheckResponse(res); err != nil {
  32760. return nil, err
  32761. }
  32762. ret := &TestPermissionsResponse{
  32763. ServerResponse: googleapi.ServerResponse{
  32764. Header: res.Header,
  32765. HTTPStatusCode: res.StatusCode,
  32766. },
  32767. }
  32768. target := &ret
  32769. if err := gensupport.DecodeResponse(target, res); err != nil {
  32770. return nil, err
  32771. }
  32772. return ret, nil
  32773. // {
  32774. // "description": "Returns permissions that a caller has on the specified resource.",
  32775. // "httpMethod": "POST",
  32776. // "id": "compute.backendServices.testIamPermissions",
  32777. // "parameterOrder": [
  32778. // "project",
  32779. // "resource"
  32780. // ],
  32781. // "parameters": {
  32782. // "project": {
  32783. // "description": "Project ID for this request.",
  32784. // "location": "path",
  32785. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  32786. // "required": true,
  32787. // "type": "string"
  32788. // },
  32789. // "resource": {
  32790. // "description": "Name of the resource for this request.",
  32791. // "location": "path",
  32792. // "pattern": "(?:[-a-z0-9_]{0,62}[a-z0-9])?",
  32793. // "required": true,
  32794. // "type": "string"
  32795. // }
  32796. // },
  32797. // "path": "{project}/global/backendServices/{resource}/testIamPermissions",
  32798. // "request": {
  32799. // "$ref": "TestPermissionsRequest"
  32800. // },
  32801. // "response": {
  32802. // "$ref": "TestPermissionsResponse"
  32803. // },
  32804. // "scopes": [
  32805. // "https://www.googleapis.com/auth/cloud-platform",
  32806. // "https://www.googleapis.com/auth/compute",
  32807. // "https://www.googleapis.com/auth/compute.readonly"
  32808. // ]
  32809. // }
  32810. }
  32811. // method id "compute.backendServices.update":
  32812. type BackendServicesUpdateCall struct {
  32813. s *Service
  32814. project string
  32815. backendService string
  32816. backendservice *BackendService
  32817. urlParams_ gensupport.URLParams
  32818. ctx_ context.Context
  32819. header_ http.Header
  32820. }
  32821. // Update: Updates the specified BackendService resource with the data
  32822. // included in the request. There are several restrictions and
  32823. // guidelines to keep in mind when updating a backend service. Read
  32824. // Restrictions and Guidelines for more information.
  32825. // For details, see https://cloud.google.com/compute/docs/reference/latest/backendServices/update
  32826. func (r *BackendServicesService) Update(project string, backendService string, backendservice *BackendService) *BackendServicesUpdateCall {
  32827. c := &BackendServicesUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  32828. c.project = project
  32829. c.backendService = backendService
  32830. c.backendservice = backendservice
  32831. return c
  32832. }
  32833. // RequestId sets the optional parameter "requestId": An optional
  32834. // request ID to identify requests. Specify a unique request ID so that
  32835. // if you must retry your request, the server will know to ignore the
  32836. // request if it has already been completed.
  32837. //
  32838. // For example, consider a situation where you make an initial request
  32839. // and the request times out. If you make the request again with the
  32840. // same request ID, the server can check if original operation with the
  32841. // same request ID was received, and if so, will ignore the second
  32842. // request. This prevents clients from accidentally creating duplicate
  32843. // commitments.
  32844. //
  32845. // The request ID must be a valid UUID with the exception that zero UUID
  32846. // is not supported (00000000-0000-0000-0000-000000000000).
  32847. func (c *BackendServicesUpdateCall) RequestId(requestId string) *BackendServicesUpdateCall {
  32848. c.urlParams_.Set("requestId", requestId)
  32849. return c
  32850. }
  32851. // Fields allows partial responses to be retrieved. See
  32852. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  32853. // for more information.
  32854. func (c *BackendServicesUpdateCall) Fields(s ...googleapi.Field) *BackendServicesUpdateCall {
  32855. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  32856. return c
  32857. }
  32858. // Context sets the context to be used in this call's Do method. Any
  32859. // pending HTTP request will be aborted if the provided context is
  32860. // canceled.
  32861. func (c *BackendServicesUpdateCall) Context(ctx context.Context) *BackendServicesUpdateCall {
  32862. c.ctx_ = ctx
  32863. return c
  32864. }
  32865. // Header returns an http.Header that can be modified by the caller to
  32866. // add HTTP headers to the request.
  32867. func (c *BackendServicesUpdateCall) Header() http.Header {
  32868. if c.header_ == nil {
  32869. c.header_ = make(http.Header)
  32870. }
  32871. return c.header_
  32872. }
  32873. func (c *BackendServicesUpdateCall) doRequest(alt string) (*http.Response, error) {
  32874. reqHeaders := make(http.Header)
  32875. for k, v := range c.header_ {
  32876. reqHeaders[k] = v
  32877. }
  32878. reqHeaders.Set("User-Agent", c.s.userAgent())
  32879. var body io.Reader = nil
  32880. body, err := googleapi.WithoutDataWrapper.JSONReader(c.backendservice)
  32881. if err != nil {
  32882. return nil, err
  32883. }
  32884. reqHeaders.Set("Content-Type", "application/json")
  32885. c.urlParams_.Set("alt", alt)
  32886. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/backendServices/{backendService}")
  32887. urls += "?" + c.urlParams_.Encode()
  32888. req, _ := http.NewRequest("PUT", urls, body)
  32889. req.Header = reqHeaders
  32890. googleapi.Expand(req.URL, map[string]string{
  32891. "project": c.project,
  32892. "backendService": c.backendService,
  32893. })
  32894. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  32895. }
  32896. // Do executes the "compute.backendServices.update" call.
  32897. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  32898. // status code is an error. Response headers are in either
  32899. // *Operation.ServerResponse.Header or (if a response was returned at
  32900. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  32901. // to check whether the returned error was because
  32902. // http.StatusNotModified was returned.
  32903. func (c *BackendServicesUpdateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  32904. gensupport.SetOptions(c.urlParams_, opts...)
  32905. res, err := c.doRequest("json")
  32906. if res != nil && res.StatusCode == http.StatusNotModified {
  32907. if res.Body != nil {
  32908. res.Body.Close()
  32909. }
  32910. return nil, &googleapi.Error{
  32911. Code: res.StatusCode,
  32912. Header: res.Header,
  32913. }
  32914. }
  32915. if err != nil {
  32916. return nil, err
  32917. }
  32918. defer googleapi.CloseBody(res)
  32919. if err := googleapi.CheckResponse(res); err != nil {
  32920. return nil, err
  32921. }
  32922. ret := &Operation{
  32923. ServerResponse: googleapi.ServerResponse{
  32924. Header: res.Header,
  32925. HTTPStatusCode: res.StatusCode,
  32926. },
  32927. }
  32928. target := &ret
  32929. if err := gensupport.DecodeResponse(target, res); err != nil {
  32930. return nil, err
  32931. }
  32932. return ret, nil
  32933. // {
  32934. // "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.",
  32935. // "httpMethod": "PUT",
  32936. // "id": "compute.backendServices.update",
  32937. // "parameterOrder": [
  32938. // "project",
  32939. // "backendService"
  32940. // ],
  32941. // "parameters": {
  32942. // "backendService": {
  32943. // "description": "Name of the BackendService resource to update.",
  32944. // "location": "path",
  32945. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  32946. // "required": true,
  32947. // "type": "string"
  32948. // },
  32949. // "project": {
  32950. // "description": "Project ID for this request.",
  32951. // "location": "path",
  32952. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  32953. // "required": true,
  32954. // "type": "string"
  32955. // },
  32956. // "requestId": {
  32957. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  32958. // "location": "query",
  32959. // "type": "string"
  32960. // }
  32961. // },
  32962. // "path": "{project}/global/backendServices/{backendService}",
  32963. // "request": {
  32964. // "$ref": "BackendService"
  32965. // },
  32966. // "response": {
  32967. // "$ref": "Operation"
  32968. // },
  32969. // "scopes": [
  32970. // "https://www.googleapis.com/auth/cloud-platform",
  32971. // "https://www.googleapis.com/auth/compute"
  32972. // ]
  32973. // }
  32974. }
  32975. // method id "compute.diskTypes.aggregatedList":
  32976. type DiskTypesAggregatedListCall struct {
  32977. s *Service
  32978. project string
  32979. urlParams_ gensupport.URLParams
  32980. ifNoneMatch_ string
  32981. ctx_ context.Context
  32982. header_ http.Header
  32983. }
  32984. // AggregatedList: Retrieves an aggregated list of disk types.
  32985. // For details, see https://cloud.google.com/compute/docs/reference/latest/diskTypes/aggregatedList
  32986. func (r *DiskTypesService) AggregatedList(project string) *DiskTypesAggregatedListCall {
  32987. c := &DiskTypesAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  32988. c.project = project
  32989. return c
  32990. }
  32991. // Filter sets the optional parameter "filter": A filter expression that
  32992. // filters resources listed in the response. The expression must specify
  32993. // the field name, a comparison operator, and the value that you want to
  32994. // use for filtering. The value must be a string, a number, or a
  32995. // boolean. The comparison operator must be either =, !=, >, or <.
  32996. //
  32997. // For example, if you are filtering Compute Engine instances, you can
  32998. // exclude instances named example-instance by specifying name !=
  32999. // example-instance.
  33000. //
  33001. // You can also filter nested fields. For example, you could specify
  33002. // scheduling.automaticRestart = false to include instances only if they
  33003. // are not scheduled for automatic restarts. You can use filtering on
  33004. // nested fields to filter based on resource labels.
  33005. //
  33006. // To filter on multiple expressions, provide each separate expression
  33007. // within parentheses. For example, (scheduling.automaticRestart = true)
  33008. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  33009. // AND expression. However, you can include AND and OR expressions
  33010. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  33011. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  33012. // true).
  33013. func (c *DiskTypesAggregatedListCall) Filter(filter string) *DiskTypesAggregatedListCall {
  33014. c.urlParams_.Set("filter", filter)
  33015. return c
  33016. }
  33017. // MaxResults sets the optional parameter "maxResults": The maximum
  33018. // number of results per page that should be returned. If the number of
  33019. // available results is larger than maxResults, Compute Engine returns a
  33020. // nextPageToken that can be used to get the next page of results in
  33021. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  33022. // (Default: 500)
  33023. func (c *DiskTypesAggregatedListCall) MaxResults(maxResults int64) *DiskTypesAggregatedListCall {
  33024. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  33025. return c
  33026. }
  33027. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  33028. // a certain order. By default, results are returned in alphanumerical
  33029. // order based on the resource name.
  33030. //
  33031. // You can also sort results in descending order based on the creation
  33032. // timestamp using orderBy="creationTimestamp desc". This sorts results
  33033. // based on the creationTimestamp field in reverse chronological order
  33034. // (newest result first). Use this to sort resources like operations so
  33035. // that the newest operation is returned first.
  33036. //
  33037. // Currently, only sorting by name or creationTimestamp desc is
  33038. // supported.
  33039. func (c *DiskTypesAggregatedListCall) OrderBy(orderBy string) *DiskTypesAggregatedListCall {
  33040. c.urlParams_.Set("orderBy", orderBy)
  33041. return c
  33042. }
  33043. // PageToken sets the optional parameter "pageToken": Specifies a page
  33044. // token to use. Set pageToken to the nextPageToken returned by a
  33045. // previous list request to get the next page of results.
  33046. func (c *DiskTypesAggregatedListCall) PageToken(pageToken string) *DiskTypesAggregatedListCall {
  33047. c.urlParams_.Set("pageToken", pageToken)
  33048. return c
  33049. }
  33050. // Fields allows partial responses to be retrieved. See
  33051. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  33052. // for more information.
  33053. func (c *DiskTypesAggregatedListCall) Fields(s ...googleapi.Field) *DiskTypesAggregatedListCall {
  33054. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  33055. return c
  33056. }
  33057. // IfNoneMatch sets the optional parameter which makes the operation
  33058. // fail if the object's ETag matches the given value. This is useful for
  33059. // getting updates only after the object has changed since the last
  33060. // request. Use googleapi.IsNotModified to check whether the response
  33061. // error from Do is the result of In-None-Match.
  33062. func (c *DiskTypesAggregatedListCall) IfNoneMatch(entityTag string) *DiskTypesAggregatedListCall {
  33063. c.ifNoneMatch_ = entityTag
  33064. return c
  33065. }
  33066. // Context sets the context to be used in this call's Do method. Any
  33067. // pending HTTP request will be aborted if the provided context is
  33068. // canceled.
  33069. func (c *DiskTypesAggregatedListCall) Context(ctx context.Context) *DiskTypesAggregatedListCall {
  33070. c.ctx_ = ctx
  33071. return c
  33072. }
  33073. // Header returns an http.Header that can be modified by the caller to
  33074. // add HTTP headers to the request.
  33075. func (c *DiskTypesAggregatedListCall) Header() http.Header {
  33076. if c.header_ == nil {
  33077. c.header_ = make(http.Header)
  33078. }
  33079. return c.header_
  33080. }
  33081. func (c *DiskTypesAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  33082. reqHeaders := make(http.Header)
  33083. for k, v := range c.header_ {
  33084. reqHeaders[k] = v
  33085. }
  33086. reqHeaders.Set("User-Agent", c.s.userAgent())
  33087. if c.ifNoneMatch_ != "" {
  33088. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  33089. }
  33090. var body io.Reader = nil
  33091. c.urlParams_.Set("alt", alt)
  33092. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/diskTypes")
  33093. urls += "?" + c.urlParams_.Encode()
  33094. req, _ := http.NewRequest("GET", urls, body)
  33095. req.Header = reqHeaders
  33096. googleapi.Expand(req.URL, map[string]string{
  33097. "project": c.project,
  33098. })
  33099. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  33100. }
  33101. // Do executes the "compute.diskTypes.aggregatedList" call.
  33102. // Exactly one of *DiskTypeAggregatedList or error will be non-nil. Any
  33103. // non-2xx status code is an error. Response headers are in either
  33104. // *DiskTypeAggregatedList.ServerResponse.Header or (if a response was
  33105. // returned at all) in error.(*googleapi.Error).Header. Use
  33106. // googleapi.IsNotModified to check whether the returned error was
  33107. // because http.StatusNotModified was returned.
  33108. func (c *DiskTypesAggregatedListCall) Do(opts ...googleapi.CallOption) (*DiskTypeAggregatedList, error) {
  33109. gensupport.SetOptions(c.urlParams_, opts...)
  33110. res, err := c.doRequest("json")
  33111. if res != nil && res.StatusCode == http.StatusNotModified {
  33112. if res.Body != nil {
  33113. res.Body.Close()
  33114. }
  33115. return nil, &googleapi.Error{
  33116. Code: res.StatusCode,
  33117. Header: res.Header,
  33118. }
  33119. }
  33120. if err != nil {
  33121. return nil, err
  33122. }
  33123. defer googleapi.CloseBody(res)
  33124. if err := googleapi.CheckResponse(res); err != nil {
  33125. return nil, err
  33126. }
  33127. ret := &DiskTypeAggregatedList{
  33128. ServerResponse: googleapi.ServerResponse{
  33129. Header: res.Header,
  33130. HTTPStatusCode: res.StatusCode,
  33131. },
  33132. }
  33133. target := &ret
  33134. if err := gensupport.DecodeResponse(target, res); err != nil {
  33135. return nil, err
  33136. }
  33137. return ret, nil
  33138. // {
  33139. // "description": "Retrieves an aggregated list of disk types.",
  33140. // "httpMethod": "GET",
  33141. // "id": "compute.diskTypes.aggregatedList",
  33142. // "parameterOrder": [
  33143. // "project"
  33144. // ],
  33145. // "parameters": {
  33146. // "filter": {
  33147. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  33148. // "location": "query",
  33149. // "type": "string"
  33150. // },
  33151. // "maxResults": {
  33152. // "default": "500",
  33153. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  33154. // "format": "uint32",
  33155. // "location": "query",
  33156. // "minimum": "0",
  33157. // "type": "integer"
  33158. // },
  33159. // "orderBy": {
  33160. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  33161. // "location": "query",
  33162. // "type": "string"
  33163. // },
  33164. // "pageToken": {
  33165. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  33166. // "location": "query",
  33167. // "type": "string"
  33168. // },
  33169. // "project": {
  33170. // "description": "Project ID for this request.",
  33171. // "location": "path",
  33172. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  33173. // "required": true,
  33174. // "type": "string"
  33175. // }
  33176. // },
  33177. // "path": "{project}/aggregated/diskTypes",
  33178. // "response": {
  33179. // "$ref": "DiskTypeAggregatedList"
  33180. // },
  33181. // "scopes": [
  33182. // "https://www.googleapis.com/auth/cloud-platform",
  33183. // "https://www.googleapis.com/auth/compute",
  33184. // "https://www.googleapis.com/auth/compute.readonly"
  33185. // ]
  33186. // }
  33187. }
  33188. // Pages invokes f for each page of results.
  33189. // A non-nil error returned from f will halt the iteration.
  33190. // The provided context supersedes any context provided to the Context method.
  33191. func (c *DiskTypesAggregatedListCall) Pages(ctx context.Context, f func(*DiskTypeAggregatedList) error) error {
  33192. c.ctx_ = ctx
  33193. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  33194. for {
  33195. x, err := c.Do()
  33196. if err != nil {
  33197. return err
  33198. }
  33199. if err := f(x); err != nil {
  33200. return err
  33201. }
  33202. if x.NextPageToken == "" {
  33203. return nil
  33204. }
  33205. c.PageToken(x.NextPageToken)
  33206. }
  33207. }
  33208. // method id "compute.diskTypes.get":
  33209. type DiskTypesGetCall struct {
  33210. s *Service
  33211. project string
  33212. zone string
  33213. diskType string
  33214. urlParams_ gensupport.URLParams
  33215. ifNoneMatch_ string
  33216. ctx_ context.Context
  33217. header_ http.Header
  33218. }
  33219. // Get: Returns the specified disk type. Gets a list of available disk
  33220. // types by making a list() request.
  33221. // For details, see https://cloud.google.com/compute/docs/reference/latest/diskTypes/get
  33222. func (r *DiskTypesService) Get(project string, zone string, diskType string) *DiskTypesGetCall {
  33223. c := &DiskTypesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  33224. c.project = project
  33225. c.zone = zone
  33226. c.diskType = diskType
  33227. return c
  33228. }
  33229. // Fields allows partial responses to be retrieved. See
  33230. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  33231. // for more information.
  33232. func (c *DiskTypesGetCall) Fields(s ...googleapi.Field) *DiskTypesGetCall {
  33233. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  33234. return c
  33235. }
  33236. // IfNoneMatch sets the optional parameter which makes the operation
  33237. // fail if the object's ETag matches the given value. This is useful for
  33238. // getting updates only after the object has changed since the last
  33239. // request. Use googleapi.IsNotModified to check whether the response
  33240. // error from Do is the result of In-None-Match.
  33241. func (c *DiskTypesGetCall) IfNoneMatch(entityTag string) *DiskTypesGetCall {
  33242. c.ifNoneMatch_ = entityTag
  33243. return c
  33244. }
  33245. // Context sets the context to be used in this call's Do method. Any
  33246. // pending HTTP request will be aborted if the provided context is
  33247. // canceled.
  33248. func (c *DiskTypesGetCall) Context(ctx context.Context) *DiskTypesGetCall {
  33249. c.ctx_ = ctx
  33250. return c
  33251. }
  33252. // Header returns an http.Header that can be modified by the caller to
  33253. // add HTTP headers to the request.
  33254. func (c *DiskTypesGetCall) Header() http.Header {
  33255. if c.header_ == nil {
  33256. c.header_ = make(http.Header)
  33257. }
  33258. return c.header_
  33259. }
  33260. func (c *DiskTypesGetCall) doRequest(alt string) (*http.Response, error) {
  33261. reqHeaders := make(http.Header)
  33262. for k, v := range c.header_ {
  33263. reqHeaders[k] = v
  33264. }
  33265. reqHeaders.Set("User-Agent", c.s.userAgent())
  33266. if c.ifNoneMatch_ != "" {
  33267. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  33268. }
  33269. var body io.Reader = nil
  33270. c.urlParams_.Set("alt", alt)
  33271. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/diskTypes/{diskType}")
  33272. urls += "?" + c.urlParams_.Encode()
  33273. req, _ := http.NewRequest("GET", urls, body)
  33274. req.Header = reqHeaders
  33275. googleapi.Expand(req.URL, map[string]string{
  33276. "project": c.project,
  33277. "zone": c.zone,
  33278. "diskType": c.diskType,
  33279. })
  33280. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  33281. }
  33282. // Do executes the "compute.diskTypes.get" call.
  33283. // Exactly one of *DiskType or error will be non-nil. Any non-2xx status
  33284. // code is an error. Response headers are in either
  33285. // *DiskType.ServerResponse.Header or (if a response was returned at
  33286. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  33287. // to check whether the returned error was because
  33288. // http.StatusNotModified was returned.
  33289. func (c *DiskTypesGetCall) Do(opts ...googleapi.CallOption) (*DiskType, error) {
  33290. gensupport.SetOptions(c.urlParams_, opts...)
  33291. res, err := c.doRequest("json")
  33292. if res != nil && res.StatusCode == http.StatusNotModified {
  33293. if res.Body != nil {
  33294. res.Body.Close()
  33295. }
  33296. return nil, &googleapi.Error{
  33297. Code: res.StatusCode,
  33298. Header: res.Header,
  33299. }
  33300. }
  33301. if err != nil {
  33302. return nil, err
  33303. }
  33304. defer googleapi.CloseBody(res)
  33305. if err := googleapi.CheckResponse(res); err != nil {
  33306. return nil, err
  33307. }
  33308. ret := &DiskType{
  33309. ServerResponse: googleapi.ServerResponse{
  33310. Header: res.Header,
  33311. HTTPStatusCode: res.StatusCode,
  33312. },
  33313. }
  33314. target := &ret
  33315. if err := gensupport.DecodeResponse(target, res); err != nil {
  33316. return nil, err
  33317. }
  33318. return ret, nil
  33319. // {
  33320. // "description": "Returns the specified disk type. Gets a list of available disk types by making a list() request.",
  33321. // "httpMethod": "GET",
  33322. // "id": "compute.diskTypes.get",
  33323. // "parameterOrder": [
  33324. // "project",
  33325. // "zone",
  33326. // "diskType"
  33327. // ],
  33328. // "parameters": {
  33329. // "diskType": {
  33330. // "description": "Name of the disk type to return.",
  33331. // "location": "path",
  33332. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  33333. // "required": true,
  33334. // "type": "string"
  33335. // },
  33336. // "project": {
  33337. // "description": "Project ID for this request.",
  33338. // "location": "path",
  33339. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  33340. // "required": true,
  33341. // "type": "string"
  33342. // },
  33343. // "zone": {
  33344. // "description": "The name of the zone for this request.",
  33345. // "location": "path",
  33346. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  33347. // "required": true,
  33348. // "type": "string"
  33349. // }
  33350. // },
  33351. // "path": "{project}/zones/{zone}/diskTypes/{diskType}",
  33352. // "response": {
  33353. // "$ref": "DiskType"
  33354. // },
  33355. // "scopes": [
  33356. // "https://www.googleapis.com/auth/cloud-platform",
  33357. // "https://www.googleapis.com/auth/compute",
  33358. // "https://www.googleapis.com/auth/compute.readonly"
  33359. // ]
  33360. // }
  33361. }
  33362. // method id "compute.diskTypes.list":
  33363. type DiskTypesListCall struct {
  33364. s *Service
  33365. project string
  33366. zone string
  33367. urlParams_ gensupport.URLParams
  33368. ifNoneMatch_ string
  33369. ctx_ context.Context
  33370. header_ http.Header
  33371. }
  33372. // List: Retrieves a list of disk types available to the specified
  33373. // project.
  33374. // For details, see https://cloud.google.com/compute/docs/reference/latest/diskTypes/list
  33375. func (r *DiskTypesService) List(project string, zone string) *DiskTypesListCall {
  33376. c := &DiskTypesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  33377. c.project = project
  33378. c.zone = zone
  33379. return c
  33380. }
  33381. // Filter sets the optional parameter "filter": A filter expression that
  33382. // filters resources listed in the response. The expression must specify
  33383. // the field name, a comparison operator, and the value that you want to
  33384. // use for filtering. The value must be a string, a number, or a
  33385. // boolean. The comparison operator must be either =, !=, >, or <.
  33386. //
  33387. // For example, if you are filtering Compute Engine instances, you can
  33388. // exclude instances named example-instance by specifying name !=
  33389. // example-instance.
  33390. //
  33391. // You can also filter nested fields. For example, you could specify
  33392. // scheduling.automaticRestart = false to include instances only if they
  33393. // are not scheduled for automatic restarts. You can use filtering on
  33394. // nested fields to filter based on resource labels.
  33395. //
  33396. // To filter on multiple expressions, provide each separate expression
  33397. // within parentheses. For example, (scheduling.automaticRestart = true)
  33398. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  33399. // AND expression. However, you can include AND and OR expressions
  33400. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  33401. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  33402. // true).
  33403. func (c *DiskTypesListCall) Filter(filter string) *DiskTypesListCall {
  33404. c.urlParams_.Set("filter", filter)
  33405. return c
  33406. }
  33407. // MaxResults sets the optional parameter "maxResults": The maximum
  33408. // number of results per page that should be returned. If the number of
  33409. // available results is larger than maxResults, Compute Engine returns a
  33410. // nextPageToken that can be used to get the next page of results in
  33411. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  33412. // (Default: 500)
  33413. func (c *DiskTypesListCall) MaxResults(maxResults int64) *DiskTypesListCall {
  33414. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  33415. return c
  33416. }
  33417. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  33418. // a certain order. By default, results are returned in alphanumerical
  33419. // order based on the resource name.
  33420. //
  33421. // You can also sort results in descending order based on the creation
  33422. // timestamp using orderBy="creationTimestamp desc". This sorts results
  33423. // based on the creationTimestamp field in reverse chronological order
  33424. // (newest result first). Use this to sort resources like operations so
  33425. // that the newest operation is returned first.
  33426. //
  33427. // Currently, only sorting by name or creationTimestamp desc is
  33428. // supported.
  33429. func (c *DiskTypesListCall) OrderBy(orderBy string) *DiskTypesListCall {
  33430. c.urlParams_.Set("orderBy", orderBy)
  33431. return c
  33432. }
  33433. // PageToken sets the optional parameter "pageToken": Specifies a page
  33434. // token to use. Set pageToken to the nextPageToken returned by a
  33435. // previous list request to get the next page of results.
  33436. func (c *DiskTypesListCall) PageToken(pageToken string) *DiskTypesListCall {
  33437. c.urlParams_.Set("pageToken", pageToken)
  33438. return c
  33439. }
  33440. // Fields allows partial responses to be retrieved. See
  33441. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  33442. // for more information.
  33443. func (c *DiskTypesListCall) Fields(s ...googleapi.Field) *DiskTypesListCall {
  33444. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  33445. return c
  33446. }
  33447. // IfNoneMatch sets the optional parameter which makes the operation
  33448. // fail if the object's ETag matches the given value. This is useful for
  33449. // getting updates only after the object has changed since the last
  33450. // request. Use googleapi.IsNotModified to check whether the response
  33451. // error from Do is the result of In-None-Match.
  33452. func (c *DiskTypesListCall) IfNoneMatch(entityTag string) *DiskTypesListCall {
  33453. c.ifNoneMatch_ = entityTag
  33454. return c
  33455. }
  33456. // Context sets the context to be used in this call's Do method. Any
  33457. // pending HTTP request will be aborted if the provided context is
  33458. // canceled.
  33459. func (c *DiskTypesListCall) Context(ctx context.Context) *DiskTypesListCall {
  33460. c.ctx_ = ctx
  33461. return c
  33462. }
  33463. // Header returns an http.Header that can be modified by the caller to
  33464. // add HTTP headers to the request.
  33465. func (c *DiskTypesListCall) Header() http.Header {
  33466. if c.header_ == nil {
  33467. c.header_ = make(http.Header)
  33468. }
  33469. return c.header_
  33470. }
  33471. func (c *DiskTypesListCall) doRequest(alt string) (*http.Response, error) {
  33472. reqHeaders := make(http.Header)
  33473. for k, v := range c.header_ {
  33474. reqHeaders[k] = v
  33475. }
  33476. reqHeaders.Set("User-Agent", c.s.userAgent())
  33477. if c.ifNoneMatch_ != "" {
  33478. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  33479. }
  33480. var body io.Reader = nil
  33481. c.urlParams_.Set("alt", alt)
  33482. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/diskTypes")
  33483. urls += "?" + c.urlParams_.Encode()
  33484. req, _ := http.NewRequest("GET", urls, body)
  33485. req.Header = reqHeaders
  33486. googleapi.Expand(req.URL, map[string]string{
  33487. "project": c.project,
  33488. "zone": c.zone,
  33489. })
  33490. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  33491. }
  33492. // Do executes the "compute.diskTypes.list" call.
  33493. // Exactly one of *DiskTypeList or error will be non-nil. Any non-2xx
  33494. // status code is an error. Response headers are in either
  33495. // *DiskTypeList.ServerResponse.Header or (if a response was returned at
  33496. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  33497. // to check whether the returned error was because
  33498. // http.StatusNotModified was returned.
  33499. func (c *DiskTypesListCall) Do(opts ...googleapi.CallOption) (*DiskTypeList, error) {
  33500. gensupport.SetOptions(c.urlParams_, opts...)
  33501. res, err := c.doRequest("json")
  33502. if res != nil && res.StatusCode == http.StatusNotModified {
  33503. if res.Body != nil {
  33504. res.Body.Close()
  33505. }
  33506. return nil, &googleapi.Error{
  33507. Code: res.StatusCode,
  33508. Header: res.Header,
  33509. }
  33510. }
  33511. if err != nil {
  33512. return nil, err
  33513. }
  33514. defer googleapi.CloseBody(res)
  33515. if err := googleapi.CheckResponse(res); err != nil {
  33516. return nil, err
  33517. }
  33518. ret := &DiskTypeList{
  33519. ServerResponse: googleapi.ServerResponse{
  33520. Header: res.Header,
  33521. HTTPStatusCode: res.StatusCode,
  33522. },
  33523. }
  33524. target := &ret
  33525. if err := gensupport.DecodeResponse(target, res); err != nil {
  33526. return nil, err
  33527. }
  33528. return ret, nil
  33529. // {
  33530. // "description": "Retrieves a list of disk types available to the specified project.",
  33531. // "httpMethod": "GET",
  33532. // "id": "compute.diskTypes.list",
  33533. // "parameterOrder": [
  33534. // "project",
  33535. // "zone"
  33536. // ],
  33537. // "parameters": {
  33538. // "filter": {
  33539. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  33540. // "location": "query",
  33541. // "type": "string"
  33542. // },
  33543. // "maxResults": {
  33544. // "default": "500",
  33545. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  33546. // "format": "uint32",
  33547. // "location": "query",
  33548. // "minimum": "0",
  33549. // "type": "integer"
  33550. // },
  33551. // "orderBy": {
  33552. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  33553. // "location": "query",
  33554. // "type": "string"
  33555. // },
  33556. // "pageToken": {
  33557. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  33558. // "location": "query",
  33559. // "type": "string"
  33560. // },
  33561. // "project": {
  33562. // "description": "Project ID for this request.",
  33563. // "location": "path",
  33564. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  33565. // "required": true,
  33566. // "type": "string"
  33567. // },
  33568. // "zone": {
  33569. // "description": "The name of the zone for this request.",
  33570. // "location": "path",
  33571. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  33572. // "required": true,
  33573. // "type": "string"
  33574. // }
  33575. // },
  33576. // "path": "{project}/zones/{zone}/diskTypes",
  33577. // "response": {
  33578. // "$ref": "DiskTypeList"
  33579. // },
  33580. // "scopes": [
  33581. // "https://www.googleapis.com/auth/cloud-platform",
  33582. // "https://www.googleapis.com/auth/compute",
  33583. // "https://www.googleapis.com/auth/compute.readonly"
  33584. // ]
  33585. // }
  33586. }
  33587. // Pages invokes f for each page of results.
  33588. // A non-nil error returned from f will halt the iteration.
  33589. // The provided context supersedes any context provided to the Context method.
  33590. func (c *DiskTypesListCall) Pages(ctx context.Context, f func(*DiskTypeList) error) error {
  33591. c.ctx_ = ctx
  33592. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  33593. for {
  33594. x, err := c.Do()
  33595. if err != nil {
  33596. return err
  33597. }
  33598. if err := f(x); err != nil {
  33599. return err
  33600. }
  33601. if x.NextPageToken == "" {
  33602. return nil
  33603. }
  33604. c.PageToken(x.NextPageToken)
  33605. }
  33606. }
  33607. // method id "compute.disks.aggregatedList":
  33608. type DisksAggregatedListCall struct {
  33609. s *Service
  33610. project string
  33611. urlParams_ gensupport.URLParams
  33612. ifNoneMatch_ string
  33613. ctx_ context.Context
  33614. header_ http.Header
  33615. }
  33616. // AggregatedList: Retrieves an aggregated list of persistent disks.
  33617. // For details, see https://cloud.google.com/compute/docs/reference/latest/disks/aggregatedList
  33618. func (r *DisksService) AggregatedList(project string) *DisksAggregatedListCall {
  33619. c := &DisksAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  33620. c.project = project
  33621. return c
  33622. }
  33623. // Filter sets the optional parameter "filter": A filter expression that
  33624. // filters resources listed in the response. The expression must specify
  33625. // the field name, a comparison operator, and the value that you want to
  33626. // use for filtering. The value must be a string, a number, or a
  33627. // boolean. The comparison operator must be either =, !=, >, or <.
  33628. //
  33629. // For example, if you are filtering Compute Engine instances, you can
  33630. // exclude instances named example-instance by specifying name !=
  33631. // example-instance.
  33632. //
  33633. // You can also filter nested fields. For example, you could specify
  33634. // scheduling.automaticRestart = false to include instances only if they
  33635. // are not scheduled for automatic restarts. You can use filtering on
  33636. // nested fields to filter based on resource labels.
  33637. //
  33638. // To filter on multiple expressions, provide each separate expression
  33639. // within parentheses. For example, (scheduling.automaticRestart = true)
  33640. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  33641. // AND expression. However, you can include AND and OR expressions
  33642. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  33643. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  33644. // true).
  33645. func (c *DisksAggregatedListCall) Filter(filter string) *DisksAggregatedListCall {
  33646. c.urlParams_.Set("filter", filter)
  33647. return c
  33648. }
  33649. // MaxResults sets the optional parameter "maxResults": The maximum
  33650. // number of results per page that should be returned. If the number of
  33651. // available results is larger than maxResults, Compute Engine returns a
  33652. // nextPageToken that can be used to get the next page of results in
  33653. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  33654. // (Default: 500)
  33655. func (c *DisksAggregatedListCall) MaxResults(maxResults int64) *DisksAggregatedListCall {
  33656. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  33657. return c
  33658. }
  33659. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  33660. // a certain order. By default, results are returned in alphanumerical
  33661. // order based on the resource name.
  33662. //
  33663. // You can also sort results in descending order based on the creation
  33664. // timestamp using orderBy="creationTimestamp desc". This sorts results
  33665. // based on the creationTimestamp field in reverse chronological order
  33666. // (newest result first). Use this to sort resources like operations so
  33667. // that the newest operation is returned first.
  33668. //
  33669. // Currently, only sorting by name or creationTimestamp desc is
  33670. // supported.
  33671. func (c *DisksAggregatedListCall) OrderBy(orderBy string) *DisksAggregatedListCall {
  33672. c.urlParams_.Set("orderBy", orderBy)
  33673. return c
  33674. }
  33675. // PageToken sets the optional parameter "pageToken": Specifies a page
  33676. // token to use. Set pageToken to the nextPageToken returned by a
  33677. // previous list request to get the next page of results.
  33678. func (c *DisksAggregatedListCall) PageToken(pageToken string) *DisksAggregatedListCall {
  33679. c.urlParams_.Set("pageToken", pageToken)
  33680. return c
  33681. }
  33682. // Fields allows partial responses to be retrieved. See
  33683. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  33684. // for more information.
  33685. func (c *DisksAggregatedListCall) Fields(s ...googleapi.Field) *DisksAggregatedListCall {
  33686. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  33687. return c
  33688. }
  33689. // IfNoneMatch sets the optional parameter which makes the operation
  33690. // fail if the object's ETag matches the given value. This is useful for
  33691. // getting updates only after the object has changed since the last
  33692. // request. Use googleapi.IsNotModified to check whether the response
  33693. // error from Do is the result of In-None-Match.
  33694. func (c *DisksAggregatedListCall) IfNoneMatch(entityTag string) *DisksAggregatedListCall {
  33695. c.ifNoneMatch_ = entityTag
  33696. return c
  33697. }
  33698. // Context sets the context to be used in this call's Do method. Any
  33699. // pending HTTP request will be aborted if the provided context is
  33700. // canceled.
  33701. func (c *DisksAggregatedListCall) Context(ctx context.Context) *DisksAggregatedListCall {
  33702. c.ctx_ = ctx
  33703. return c
  33704. }
  33705. // Header returns an http.Header that can be modified by the caller to
  33706. // add HTTP headers to the request.
  33707. func (c *DisksAggregatedListCall) Header() http.Header {
  33708. if c.header_ == nil {
  33709. c.header_ = make(http.Header)
  33710. }
  33711. return c.header_
  33712. }
  33713. func (c *DisksAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  33714. reqHeaders := make(http.Header)
  33715. for k, v := range c.header_ {
  33716. reqHeaders[k] = v
  33717. }
  33718. reqHeaders.Set("User-Agent", c.s.userAgent())
  33719. if c.ifNoneMatch_ != "" {
  33720. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  33721. }
  33722. var body io.Reader = nil
  33723. c.urlParams_.Set("alt", alt)
  33724. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/disks")
  33725. urls += "?" + c.urlParams_.Encode()
  33726. req, _ := http.NewRequest("GET", urls, body)
  33727. req.Header = reqHeaders
  33728. googleapi.Expand(req.URL, map[string]string{
  33729. "project": c.project,
  33730. })
  33731. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  33732. }
  33733. // Do executes the "compute.disks.aggregatedList" call.
  33734. // Exactly one of *DiskAggregatedList or error will be non-nil. Any
  33735. // non-2xx status code is an error. Response headers are in either
  33736. // *DiskAggregatedList.ServerResponse.Header or (if a response was
  33737. // returned at all) in error.(*googleapi.Error).Header. Use
  33738. // googleapi.IsNotModified to check whether the returned error was
  33739. // because http.StatusNotModified was returned.
  33740. func (c *DisksAggregatedListCall) Do(opts ...googleapi.CallOption) (*DiskAggregatedList, error) {
  33741. gensupport.SetOptions(c.urlParams_, opts...)
  33742. res, err := c.doRequest("json")
  33743. if res != nil && res.StatusCode == http.StatusNotModified {
  33744. if res.Body != nil {
  33745. res.Body.Close()
  33746. }
  33747. return nil, &googleapi.Error{
  33748. Code: res.StatusCode,
  33749. Header: res.Header,
  33750. }
  33751. }
  33752. if err != nil {
  33753. return nil, err
  33754. }
  33755. defer googleapi.CloseBody(res)
  33756. if err := googleapi.CheckResponse(res); err != nil {
  33757. return nil, err
  33758. }
  33759. ret := &DiskAggregatedList{
  33760. ServerResponse: googleapi.ServerResponse{
  33761. Header: res.Header,
  33762. HTTPStatusCode: res.StatusCode,
  33763. },
  33764. }
  33765. target := &ret
  33766. if err := gensupport.DecodeResponse(target, res); err != nil {
  33767. return nil, err
  33768. }
  33769. return ret, nil
  33770. // {
  33771. // "description": "Retrieves an aggregated list of persistent disks.",
  33772. // "httpMethod": "GET",
  33773. // "id": "compute.disks.aggregatedList",
  33774. // "parameterOrder": [
  33775. // "project"
  33776. // ],
  33777. // "parameters": {
  33778. // "filter": {
  33779. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  33780. // "location": "query",
  33781. // "type": "string"
  33782. // },
  33783. // "maxResults": {
  33784. // "default": "500",
  33785. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  33786. // "format": "uint32",
  33787. // "location": "query",
  33788. // "minimum": "0",
  33789. // "type": "integer"
  33790. // },
  33791. // "orderBy": {
  33792. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  33793. // "location": "query",
  33794. // "type": "string"
  33795. // },
  33796. // "pageToken": {
  33797. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  33798. // "location": "query",
  33799. // "type": "string"
  33800. // },
  33801. // "project": {
  33802. // "description": "Project ID for this request.",
  33803. // "location": "path",
  33804. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  33805. // "required": true,
  33806. // "type": "string"
  33807. // }
  33808. // },
  33809. // "path": "{project}/aggregated/disks",
  33810. // "response": {
  33811. // "$ref": "DiskAggregatedList"
  33812. // },
  33813. // "scopes": [
  33814. // "https://www.googleapis.com/auth/cloud-platform",
  33815. // "https://www.googleapis.com/auth/compute",
  33816. // "https://www.googleapis.com/auth/compute.readonly"
  33817. // ]
  33818. // }
  33819. }
  33820. // Pages invokes f for each page of results.
  33821. // A non-nil error returned from f will halt the iteration.
  33822. // The provided context supersedes any context provided to the Context method.
  33823. func (c *DisksAggregatedListCall) Pages(ctx context.Context, f func(*DiskAggregatedList) error) error {
  33824. c.ctx_ = ctx
  33825. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  33826. for {
  33827. x, err := c.Do()
  33828. if err != nil {
  33829. return err
  33830. }
  33831. if err := f(x); err != nil {
  33832. return err
  33833. }
  33834. if x.NextPageToken == "" {
  33835. return nil
  33836. }
  33837. c.PageToken(x.NextPageToken)
  33838. }
  33839. }
  33840. // method id "compute.disks.createSnapshot":
  33841. type DisksCreateSnapshotCall struct {
  33842. s *Service
  33843. project string
  33844. zone string
  33845. disk string
  33846. snapshot *Snapshot
  33847. urlParams_ gensupport.URLParams
  33848. ctx_ context.Context
  33849. header_ http.Header
  33850. }
  33851. // CreateSnapshot: Creates a snapshot of a specified persistent disk.
  33852. // For details, see https://cloud.google.com/compute/docs/reference/latest/disks/createSnapshot
  33853. func (r *DisksService) CreateSnapshot(project string, zone string, disk string, snapshot *Snapshot) *DisksCreateSnapshotCall {
  33854. c := &DisksCreateSnapshotCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  33855. c.project = project
  33856. c.zone = zone
  33857. c.disk = disk
  33858. c.snapshot = snapshot
  33859. return c
  33860. }
  33861. // GuestFlush sets the optional parameter "guestFlush":
  33862. func (c *DisksCreateSnapshotCall) GuestFlush(guestFlush bool) *DisksCreateSnapshotCall {
  33863. c.urlParams_.Set("guestFlush", fmt.Sprint(guestFlush))
  33864. return c
  33865. }
  33866. // RequestId sets the optional parameter "requestId": An optional
  33867. // request ID to identify requests. Specify a unique request ID so that
  33868. // if you must retry your request, the server will know to ignore the
  33869. // request if it has already been completed.
  33870. //
  33871. // For example, consider a situation where you make an initial request
  33872. // and the request times out. If you make the request again with the
  33873. // same request ID, the server can check if original operation with the
  33874. // same request ID was received, and if so, will ignore the second
  33875. // request. This prevents clients from accidentally creating duplicate
  33876. // commitments.
  33877. //
  33878. // The request ID must be a valid UUID with the exception that zero UUID
  33879. // is not supported (00000000-0000-0000-0000-000000000000).
  33880. func (c *DisksCreateSnapshotCall) RequestId(requestId string) *DisksCreateSnapshotCall {
  33881. c.urlParams_.Set("requestId", requestId)
  33882. return c
  33883. }
  33884. // Fields allows partial responses to be retrieved. See
  33885. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  33886. // for more information.
  33887. func (c *DisksCreateSnapshotCall) Fields(s ...googleapi.Field) *DisksCreateSnapshotCall {
  33888. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  33889. return c
  33890. }
  33891. // Context sets the context to be used in this call's Do method. Any
  33892. // pending HTTP request will be aborted if the provided context is
  33893. // canceled.
  33894. func (c *DisksCreateSnapshotCall) Context(ctx context.Context) *DisksCreateSnapshotCall {
  33895. c.ctx_ = ctx
  33896. return c
  33897. }
  33898. // Header returns an http.Header that can be modified by the caller to
  33899. // add HTTP headers to the request.
  33900. func (c *DisksCreateSnapshotCall) Header() http.Header {
  33901. if c.header_ == nil {
  33902. c.header_ = make(http.Header)
  33903. }
  33904. return c.header_
  33905. }
  33906. func (c *DisksCreateSnapshotCall) doRequest(alt string) (*http.Response, error) {
  33907. reqHeaders := make(http.Header)
  33908. for k, v := range c.header_ {
  33909. reqHeaders[k] = v
  33910. }
  33911. reqHeaders.Set("User-Agent", c.s.userAgent())
  33912. var body io.Reader = nil
  33913. body, err := googleapi.WithoutDataWrapper.JSONReader(c.snapshot)
  33914. if err != nil {
  33915. return nil, err
  33916. }
  33917. reqHeaders.Set("Content-Type", "application/json")
  33918. c.urlParams_.Set("alt", alt)
  33919. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/disks/{disk}/createSnapshot")
  33920. urls += "?" + c.urlParams_.Encode()
  33921. req, _ := http.NewRequest("POST", urls, body)
  33922. req.Header = reqHeaders
  33923. googleapi.Expand(req.URL, map[string]string{
  33924. "project": c.project,
  33925. "zone": c.zone,
  33926. "disk": c.disk,
  33927. })
  33928. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  33929. }
  33930. // Do executes the "compute.disks.createSnapshot" call.
  33931. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  33932. // status code is an error. Response headers are in either
  33933. // *Operation.ServerResponse.Header or (if a response was returned at
  33934. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  33935. // to check whether the returned error was because
  33936. // http.StatusNotModified was returned.
  33937. func (c *DisksCreateSnapshotCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  33938. gensupport.SetOptions(c.urlParams_, opts...)
  33939. res, err := c.doRequest("json")
  33940. if res != nil && res.StatusCode == http.StatusNotModified {
  33941. if res.Body != nil {
  33942. res.Body.Close()
  33943. }
  33944. return nil, &googleapi.Error{
  33945. Code: res.StatusCode,
  33946. Header: res.Header,
  33947. }
  33948. }
  33949. if err != nil {
  33950. return nil, err
  33951. }
  33952. defer googleapi.CloseBody(res)
  33953. if err := googleapi.CheckResponse(res); err != nil {
  33954. return nil, err
  33955. }
  33956. ret := &Operation{
  33957. ServerResponse: googleapi.ServerResponse{
  33958. Header: res.Header,
  33959. HTTPStatusCode: res.StatusCode,
  33960. },
  33961. }
  33962. target := &ret
  33963. if err := gensupport.DecodeResponse(target, res); err != nil {
  33964. return nil, err
  33965. }
  33966. return ret, nil
  33967. // {
  33968. // "description": "Creates a snapshot of a specified persistent disk.",
  33969. // "httpMethod": "POST",
  33970. // "id": "compute.disks.createSnapshot",
  33971. // "parameterOrder": [
  33972. // "project",
  33973. // "zone",
  33974. // "disk"
  33975. // ],
  33976. // "parameters": {
  33977. // "disk": {
  33978. // "description": "Name of the persistent disk to snapshot.",
  33979. // "location": "path",
  33980. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  33981. // "required": true,
  33982. // "type": "string"
  33983. // },
  33984. // "guestFlush": {
  33985. // "location": "query",
  33986. // "type": "boolean"
  33987. // },
  33988. // "project": {
  33989. // "description": "Project ID for this request.",
  33990. // "location": "path",
  33991. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  33992. // "required": true,
  33993. // "type": "string"
  33994. // },
  33995. // "requestId": {
  33996. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  33997. // "location": "query",
  33998. // "type": "string"
  33999. // },
  34000. // "zone": {
  34001. // "description": "The name of the zone for this request.",
  34002. // "location": "path",
  34003. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  34004. // "required": true,
  34005. // "type": "string"
  34006. // }
  34007. // },
  34008. // "path": "{project}/zones/{zone}/disks/{disk}/createSnapshot",
  34009. // "request": {
  34010. // "$ref": "Snapshot"
  34011. // },
  34012. // "response": {
  34013. // "$ref": "Operation"
  34014. // },
  34015. // "scopes": [
  34016. // "https://www.googleapis.com/auth/cloud-platform",
  34017. // "https://www.googleapis.com/auth/compute"
  34018. // ]
  34019. // }
  34020. }
  34021. // method id "compute.disks.delete":
  34022. type DisksDeleteCall struct {
  34023. s *Service
  34024. project string
  34025. zone string
  34026. disk string
  34027. urlParams_ gensupport.URLParams
  34028. ctx_ context.Context
  34029. header_ http.Header
  34030. }
  34031. // Delete: Deletes the specified persistent disk. Deleting a disk
  34032. // removes its data permanently and is irreversible. However, deleting a
  34033. // disk does not delete any snapshots previously made from the disk. You
  34034. // must separately delete snapshots.
  34035. // For details, see https://cloud.google.com/compute/docs/reference/latest/disks/delete
  34036. func (r *DisksService) Delete(project string, zone string, disk string) *DisksDeleteCall {
  34037. c := &DisksDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  34038. c.project = project
  34039. c.zone = zone
  34040. c.disk = disk
  34041. return c
  34042. }
  34043. // RequestId sets the optional parameter "requestId": An optional
  34044. // request ID to identify requests. Specify a unique request ID so that
  34045. // if you must retry your request, the server will know to ignore the
  34046. // request if it has already been completed.
  34047. //
  34048. // For example, consider a situation where you make an initial request
  34049. // and the request times out. If you make the request again with the
  34050. // same request ID, the server can check if original operation with the
  34051. // same request ID was received, and if so, will ignore the second
  34052. // request. This prevents clients from accidentally creating duplicate
  34053. // commitments.
  34054. //
  34055. // The request ID must be a valid UUID with the exception that zero UUID
  34056. // is not supported (00000000-0000-0000-0000-000000000000).
  34057. func (c *DisksDeleteCall) RequestId(requestId string) *DisksDeleteCall {
  34058. c.urlParams_.Set("requestId", requestId)
  34059. return c
  34060. }
  34061. // Fields allows partial responses to be retrieved. See
  34062. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  34063. // for more information.
  34064. func (c *DisksDeleteCall) Fields(s ...googleapi.Field) *DisksDeleteCall {
  34065. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  34066. return c
  34067. }
  34068. // Context sets the context to be used in this call's Do method. Any
  34069. // pending HTTP request will be aborted if the provided context is
  34070. // canceled.
  34071. func (c *DisksDeleteCall) Context(ctx context.Context) *DisksDeleteCall {
  34072. c.ctx_ = ctx
  34073. return c
  34074. }
  34075. // Header returns an http.Header that can be modified by the caller to
  34076. // add HTTP headers to the request.
  34077. func (c *DisksDeleteCall) Header() http.Header {
  34078. if c.header_ == nil {
  34079. c.header_ = make(http.Header)
  34080. }
  34081. return c.header_
  34082. }
  34083. func (c *DisksDeleteCall) doRequest(alt string) (*http.Response, error) {
  34084. reqHeaders := make(http.Header)
  34085. for k, v := range c.header_ {
  34086. reqHeaders[k] = v
  34087. }
  34088. reqHeaders.Set("User-Agent", c.s.userAgent())
  34089. var body io.Reader = nil
  34090. c.urlParams_.Set("alt", alt)
  34091. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/disks/{disk}")
  34092. urls += "?" + c.urlParams_.Encode()
  34093. req, _ := http.NewRequest("DELETE", urls, body)
  34094. req.Header = reqHeaders
  34095. googleapi.Expand(req.URL, map[string]string{
  34096. "project": c.project,
  34097. "zone": c.zone,
  34098. "disk": c.disk,
  34099. })
  34100. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  34101. }
  34102. // Do executes the "compute.disks.delete" call.
  34103. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  34104. // status code is an error. Response headers are in either
  34105. // *Operation.ServerResponse.Header or (if a response was returned at
  34106. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  34107. // to check whether the returned error was because
  34108. // http.StatusNotModified was returned.
  34109. func (c *DisksDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  34110. gensupport.SetOptions(c.urlParams_, opts...)
  34111. res, err := c.doRequest("json")
  34112. if res != nil && res.StatusCode == http.StatusNotModified {
  34113. if res.Body != nil {
  34114. res.Body.Close()
  34115. }
  34116. return nil, &googleapi.Error{
  34117. Code: res.StatusCode,
  34118. Header: res.Header,
  34119. }
  34120. }
  34121. if err != nil {
  34122. return nil, err
  34123. }
  34124. defer googleapi.CloseBody(res)
  34125. if err := googleapi.CheckResponse(res); err != nil {
  34126. return nil, err
  34127. }
  34128. ret := &Operation{
  34129. ServerResponse: googleapi.ServerResponse{
  34130. Header: res.Header,
  34131. HTTPStatusCode: res.StatusCode,
  34132. },
  34133. }
  34134. target := &ret
  34135. if err := gensupport.DecodeResponse(target, res); err != nil {
  34136. return nil, err
  34137. }
  34138. return ret, nil
  34139. // {
  34140. // "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.",
  34141. // "httpMethod": "DELETE",
  34142. // "id": "compute.disks.delete",
  34143. // "parameterOrder": [
  34144. // "project",
  34145. // "zone",
  34146. // "disk"
  34147. // ],
  34148. // "parameters": {
  34149. // "disk": {
  34150. // "description": "Name of the persistent disk to delete.",
  34151. // "location": "path",
  34152. // "required": true,
  34153. // "type": "string"
  34154. // },
  34155. // "project": {
  34156. // "description": "Project ID for this request.",
  34157. // "location": "path",
  34158. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  34159. // "required": true,
  34160. // "type": "string"
  34161. // },
  34162. // "requestId": {
  34163. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  34164. // "location": "query",
  34165. // "type": "string"
  34166. // },
  34167. // "zone": {
  34168. // "description": "The name of the zone for this request.",
  34169. // "location": "path",
  34170. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  34171. // "required": true,
  34172. // "type": "string"
  34173. // }
  34174. // },
  34175. // "path": "{project}/zones/{zone}/disks/{disk}",
  34176. // "response": {
  34177. // "$ref": "Operation"
  34178. // },
  34179. // "scopes": [
  34180. // "https://www.googleapis.com/auth/cloud-platform",
  34181. // "https://www.googleapis.com/auth/compute"
  34182. // ]
  34183. // }
  34184. }
  34185. // method id "compute.disks.get":
  34186. type DisksGetCall struct {
  34187. s *Service
  34188. project string
  34189. zone string
  34190. disk string
  34191. urlParams_ gensupport.URLParams
  34192. ifNoneMatch_ string
  34193. ctx_ context.Context
  34194. header_ http.Header
  34195. }
  34196. // Get: Returns a specified persistent disk. Gets a list of available
  34197. // persistent disks by making a list() request.
  34198. // For details, see https://cloud.google.com/compute/docs/reference/latest/disks/get
  34199. func (r *DisksService) Get(project string, zone string, disk string) *DisksGetCall {
  34200. c := &DisksGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  34201. c.project = project
  34202. c.zone = zone
  34203. c.disk = disk
  34204. return c
  34205. }
  34206. // Fields allows partial responses to be retrieved. See
  34207. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  34208. // for more information.
  34209. func (c *DisksGetCall) Fields(s ...googleapi.Field) *DisksGetCall {
  34210. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  34211. return c
  34212. }
  34213. // IfNoneMatch sets the optional parameter which makes the operation
  34214. // fail if the object's ETag matches the given value. This is useful for
  34215. // getting updates only after the object has changed since the last
  34216. // request. Use googleapi.IsNotModified to check whether the response
  34217. // error from Do is the result of In-None-Match.
  34218. func (c *DisksGetCall) IfNoneMatch(entityTag string) *DisksGetCall {
  34219. c.ifNoneMatch_ = entityTag
  34220. return c
  34221. }
  34222. // Context sets the context to be used in this call's Do method. Any
  34223. // pending HTTP request will be aborted if the provided context is
  34224. // canceled.
  34225. func (c *DisksGetCall) Context(ctx context.Context) *DisksGetCall {
  34226. c.ctx_ = ctx
  34227. return c
  34228. }
  34229. // Header returns an http.Header that can be modified by the caller to
  34230. // add HTTP headers to the request.
  34231. func (c *DisksGetCall) Header() http.Header {
  34232. if c.header_ == nil {
  34233. c.header_ = make(http.Header)
  34234. }
  34235. return c.header_
  34236. }
  34237. func (c *DisksGetCall) doRequest(alt string) (*http.Response, error) {
  34238. reqHeaders := make(http.Header)
  34239. for k, v := range c.header_ {
  34240. reqHeaders[k] = v
  34241. }
  34242. reqHeaders.Set("User-Agent", c.s.userAgent())
  34243. if c.ifNoneMatch_ != "" {
  34244. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  34245. }
  34246. var body io.Reader = nil
  34247. c.urlParams_.Set("alt", alt)
  34248. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/disks/{disk}")
  34249. urls += "?" + c.urlParams_.Encode()
  34250. req, _ := http.NewRequest("GET", urls, body)
  34251. req.Header = reqHeaders
  34252. googleapi.Expand(req.URL, map[string]string{
  34253. "project": c.project,
  34254. "zone": c.zone,
  34255. "disk": c.disk,
  34256. })
  34257. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  34258. }
  34259. // Do executes the "compute.disks.get" call.
  34260. // Exactly one of *Disk or error will be non-nil. Any non-2xx status
  34261. // code is an error. Response headers are in either
  34262. // *Disk.ServerResponse.Header or (if a response was returned at all) in
  34263. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  34264. // whether the returned error was because http.StatusNotModified was
  34265. // returned.
  34266. func (c *DisksGetCall) Do(opts ...googleapi.CallOption) (*Disk, error) {
  34267. gensupport.SetOptions(c.urlParams_, opts...)
  34268. res, err := c.doRequest("json")
  34269. if res != nil && res.StatusCode == http.StatusNotModified {
  34270. if res.Body != nil {
  34271. res.Body.Close()
  34272. }
  34273. return nil, &googleapi.Error{
  34274. Code: res.StatusCode,
  34275. Header: res.Header,
  34276. }
  34277. }
  34278. if err != nil {
  34279. return nil, err
  34280. }
  34281. defer googleapi.CloseBody(res)
  34282. if err := googleapi.CheckResponse(res); err != nil {
  34283. return nil, err
  34284. }
  34285. ret := &Disk{
  34286. ServerResponse: googleapi.ServerResponse{
  34287. Header: res.Header,
  34288. HTTPStatusCode: res.StatusCode,
  34289. },
  34290. }
  34291. target := &ret
  34292. if err := gensupport.DecodeResponse(target, res); err != nil {
  34293. return nil, err
  34294. }
  34295. return ret, nil
  34296. // {
  34297. // "description": "Returns a specified persistent disk. Gets a list of available persistent disks by making a list() request.",
  34298. // "httpMethod": "GET",
  34299. // "id": "compute.disks.get",
  34300. // "parameterOrder": [
  34301. // "project",
  34302. // "zone",
  34303. // "disk"
  34304. // ],
  34305. // "parameters": {
  34306. // "disk": {
  34307. // "description": "Name of the persistent disk to return.",
  34308. // "location": "path",
  34309. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  34310. // "required": true,
  34311. // "type": "string"
  34312. // },
  34313. // "project": {
  34314. // "description": "Project ID for this request.",
  34315. // "location": "path",
  34316. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  34317. // "required": true,
  34318. // "type": "string"
  34319. // },
  34320. // "zone": {
  34321. // "description": "The name of the zone for this request.",
  34322. // "location": "path",
  34323. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  34324. // "required": true,
  34325. // "type": "string"
  34326. // }
  34327. // },
  34328. // "path": "{project}/zones/{zone}/disks/{disk}",
  34329. // "response": {
  34330. // "$ref": "Disk"
  34331. // },
  34332. // "scopes": [
  34333. // "https://www.googleapis.com/auth/cloud-platform",
  34334. // "https://www.googleapis.com/auth/compute",
  34335. // "https://www.googleapis.com/auth/compute.readonly"
  34336. // ]
  34337. // }
  34338. }
  34339. // method id "compute.disks.insert":
  34340. type DisksInsertCall struct {
  34341. s *Service
  34342. project string
  34343. zone string
  34344. disk *Disk
  34345. urlParams_ gensupport.URLParams
  34346. ctx_ context.Context
  34347. header_ http.Header
  34348. }
  34349. // Insert: Creates a persistent disk in the specified project using the
  34350. // data in the request. You can create a disk with a sourceImage, a
  34351. // sourceSnapshot, or create an empty 500 GB data disk by omitting all
  34352. // properties. You can also create a disk that is larger than the
  34353. // default size by specifying the sizeGb property.
  34354. // For details, see https://cloud.google.com/compute/docs/reference/latest/disks/insert
  34355. func (r *DisksService) Insert(project string, zone string, disk *Disk) *DisksInsertCall {
  34356. c := &DisksInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  34357. c.project = project
  34358. c.zone = zone
  34359. c.disk = disk
  34360. return c
  34361. }
  34362. // RequestId sets the optional parameter "requestId": An optional
  34363. // request ID to identify requests. Specify a unique request ID so that
  34364. // if you must retry your request, the server will know to ignore the
  34365. // request if it has already been completed.
  34366. //
  34367. // For example, consider a situation where you make an initial request
  34368. // and the request times out. If you make the request again with the
  34369. // same request ID, the server can check if original operation with the
  34370. // same request ID was received, and if so, will ignore the second
  34371. // request. This prevents clients from accidentally creating duplicate
  34372. // commitments.
  34373. //
  34374. // The request ID must be a valid UUID with the exception that zero UUID
  34375. // is not supported (00000000-0000-0000-0000-000000000000).
  34376. func (c *DisksInsertCall) RequestId(requestId string) *DisksInsertCall {
  34377. c.urlParams_.Set("requestId", requestId)
  34378. return c
  34379. }
  34380. // SourceImage sets the optional parameter "sourceImage": Source image
  34381. // to restore onto a disk.
  34382. func (c *DisksInsertCall) SourceImage(sourceImage string) *DisksInsertCall {
  34383. c.urlParams_.Set("sourceImage", sourceImage)
  34384. return c
  34385. }
  34386. // Fields allows partial responses to be retrieved. See
  34387. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  34388. // for more information.
  34389. func (c *DisksInsertCall) Fields(s ...googleapi.Field) *DisksInsertCall {
  34390. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  34391. return c
  34392. }
  34393. // Context sets the context to be used in this call's Do method. Any
  34394. // pending HTTP request will be aborted if the provided context is
  34395. // canceled.
  34396. func (c *DisksInsertCall) Context(ctx context.Context) *DisksInsertCall {
  34397. c.ctx_ = ctx
  34398. return c
  34399. }
  34400. // Header returns an http.Header that can be modified by the caller to
  34401. // add HTTP headers to the request.
  34402. func (c *DisksInsertCall) Header() http.Header {
  34403. if c.header_ == nil {
  34404. c.header_ = make(http.Header)
  34405. }
  34406. return c.header_
  34407. }
  34408. func (c *DisksInsertCall) doRequest(alt string) (*http.Response, error) {
  34409. reqHeaders := make(http.Header)
  34410. for k, v := range c.header_ {
  34411. reqHeaders[k] = v
  34412. }
  34413. reqHeaders.Set("User-Agent", c.s.userAgent())
  34414. var body io.Reader = nil
  34415. body, err := googleapi.WithoutDataWrapper.JSONReader(c.disk)
  34416. if err != nil {
  34417. return nil, err
  34418. }
  34419. reqHeaders.Set("Content-Type", "application/json")
  34420. c.urlParams_.Set("alt", alt)
  34421. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/disks")
  34422. urls += "?" + c.urlParams_.Encode()
  34423. req, _ := http.NewRequest("POST", urls, body)
  34424. req.Header = reqHeaders
  34425. googleapi.Expand(req.URL, map[string]string{
  34426. "project": c.project,
  34427. "zone": c.zone,
  34428. })
  34429. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  34430. }
  34431. // Do executes the "compute.disks.insert" call.
  34432. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  34433. // status code is an error. Response headers are in either
  34434. // *Operation.ServerResponse.Header or (if a response was returned at
  34435. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  34436. // to check whether the returned error was because
  34437. // http.StatusNotModified was returned.
  34438. func (c *DisksInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  34439. gensupport.SetOptions(c.urlParams_, opts...)
  34440. res, err := c.doRequest("json")
  34441. if res != nil && res.StatusCode == http.StatusNotModified {
  34442. if res.Body != nil {
  34443. res.Body.Close()
  34444. }
  34445. return nil, &googleapi.Error{
  34446. Code: res.StatusCode,
  34447. Header: res.Header,
  34448. }
  34449. }
  34450. if err != nil {
  34451. return nil, err
  34452. }
  34453. defer googleapi.CloseBody(res)
  34454. if err := googleapi.CheckResponse(res); err != nil {
  34455. return nil, err
  34456. }
  34457. ret := &Operation{
  34458. ServerResponse: googleapi.ServerResponse{
  34459. Header: res.Header,
  34460. HTTPStatusCode: res.StatusCode,
  34461. },
  34462. }
  34463. target := &ret
  34464. if err := gensupport.DecodeResponse(target, res); err != nil {
  34465. return nil, err
  34466. }
  34467. return ret, nil
  34468. // {
  34469. // "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.",
  34470. // "httpMethod": "POST",
  34471. // "id": "compute.disks.insert",
  34472. // "parameterOrder": [
  34473. // "project",
  34474. // "zone"
  34475. // ],
  34476. // "parameters": {
  34477. // "project": {
  34478. // "description": "Project ID for this request.",
  34479. // "location": "path",
  34480. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  34481. // "required": true,
  34482. // "type": "string"
  34483. // },
  34484. // "requestId": {
  34485. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  34486. // "location": "query",
  34487. // "type": "string"
  34488. // },
  34489. // "sourceImage": {
  34490. // "description": "Optional. Source image to restore onto a disk.",
  34491. // "location": "query",
  34492. // "type": "string"
  34493. // },
  34494. // "zone": {
  34495. // "description": "The name of the zone for this request.",
  34496. // "location": "path",
  34497. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  34498. // "required": true,
  34499. // "type": "string"
  34500. // }
  34501. // },
  34502. // "path": "{project}/zones/{zone}/disks",
  34503. // "request": {
  34504. // "$ref": "Disk"
  34505. // },
  34506. // "response": {
  34507. // "$ref": "Operation"
  34508. // },
  34509. // "scopes": [
  34510. // "https://www.googleapis.com/auth/cloud-platform",
  34511. // "https://www.googleapis.com/auth/compute"
  34512. // ]
  34513. // }
  34514. }
  34515. // method id "compute.disks.list":
  34516. type DisksListCall struct {
  34517. s *Service
  34518. project string
  34519. zone string
  34520. urlParams_ gensupport.URLParams
  34521. ifNoneMatch_ string
  34522. ctx_ context.Context
  34523. header_ http.Header
  34524. }
  34525. // List: Retrieves a list of persistent disks contained within the
  34526. // specified zone.
  34527. // For details, see https://cloud.google.com/compute/docs/reference/latest/disks/list
  34528. func (r *DisksService) List(project string, zone string) *DisksListCall {
  34529. c := &DisksListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  34530. c.project = project
  34531. c.zone = zone
  34532. return c
  34533. }
  34534. // Filter sets the optional parameter "filter": A filter expression that
  34535. // filters resources listed in the response. The expression must specify
  34536. // the field name, a comparison operator, and the value that you want to
  34537. // use for filtering. The value must be a string, a number, or a
  34538. // boolean. The comparison operator must be either =, !=, >, or <.
  34539. //
  34540. // For example, if you are filtering Compute Engine instances, you can
  34541. // exclude instances named example-instance by specifying name !=
  34542. // example-instance.
  34543. //
  34544. // You can also filter nested fields. For example, you could specify
  34545. // scheduling.automaticRestart = false to include instances only if they
  34546. // are not scheduled for automatic restarts. You can use filtering on
  34547. // nested fields to filter based on resource labels.
  34548. //
  34549. // To filter on multiple expressions, provide each separate expression
  34550. // within parentheses. For example, (scheduling.automaticRestart = true)
  34551. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  34552. // AND expression. However, you can include AND and OR expressions
  34553. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  34554. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  34555. // true).
  34556. func (c *DisksListCall) Filter(filter string) *DisksListCall {
  34557. c.urlParams_.Set("filter", filter)
  34558. return c
  34559. }
  34560. // MaxResults sets the optional parameter "maxResults": The maximum
  34561. // number of results per page that should be returned. If the number of
  34562. // available results is larger than maxResults, Compute Engine returns a
  34563. // nextPageToken that can be used to get the next page of results in
  34564. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  34565. // (Default: 500)
  34566. func (c *DisksListCall) MaxResults(maxResults int64) *DisksListCall {
  34567. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  34568. return c
  34569. }
  34570. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  34571. // a certain order. By default, results are returned in alphanumerical
  34572. // order based on the resource name.
  34573. //
  34574. // You can also sort results in descending order based on the creation
  34575. // timestamp using orderBy="creationTimestamp desc". This sorts results
  34576. // based on the creationTimestamp field in reverse chronological order
  34577. // (newest result first). Use this to sort resources like operations so
  34578. // that the newest operation is returned first.
  34579. //
  34580. // Currently, only sorting by name or creationTimestamp desc is
  34581. // supported.
  34582. func (c *DisksListCall) OrderBy(orderBy string) *DisksListCall {
  34583. c.urlParams_.Set("orderBy", orderBy)
  34584. return c
  34585. }
  34586. // PageToken sets the optional parameter "pageToken": Specifies a page
  34587. // token to use. Set pageToken to the nextPageToken returned by a
  34588. // previous list request to get the next page of results.
  34589. func (c *DisksListCall) PageToken(pageToken string) *DisksListCall {
  34590. c.urlParams_.Set("pageToken", pageToken)
  34591. return c
  34592. }
  34593. // Fields allows partial responses to be retrieved. See
  34594. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  34595. // for more information.
  34596. func (c *DisksListCall) Fields(s ...googleapi.Field) *DisksListCall {
  34597. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  34598. return c
  34599. }
  34600. // IfNoneMatch sets the optional parameter which makes the operation
  34601. // fail if the object's ETag matches the given value. This is useful for
  34602. // getting updates only after the object has changed since the last
  34603. // request. Use googleapi.IsNotModified to check whether the response
  34604. // error from Do is the result of In-None-Match.
  34605. func (c *DisksListCall) IfNoneMatch(entityTag string) *DisksListCall {
  34606. c.ifNoneMatch_ = entityTag
  34607. return c
  34608. }
  34609. // Context sets the context to be used in this call's Do method. Any
  34610. // pending HTTP request will be aborted if the provided context is
  34611. // canceled.
  34612. func (c *DisksListCall) Context(ctx context.Context) *DisksListCall {
  34613. c.ctx_ = ctx
  34614. return c
  34615. }
  34616. // Header returns an http.Header that can be modified by the caller to
  34617. // add HTTP headers to the request.
  34618. func (c *DisksListCall) Header() http.Header {
  34619. if c.header_ == nil {
  34620. c.header_ = make(http.Header)
  34621. }
  34622. return c.header_
  34623. }
  34624. func (c *DisksListCall) doRequest(alt string) (*http.Response, error) {
  34625. reqHeaders := make(http.Header)
  34626. for k, v := range c.header_ {
  34627. reqHeaders[k] = v
  34628. }
  34629. reqHeaders.Set("User-Agent", c.s.userAgent())
  34630. if c.ifNoneMatch_ != "" {
  34631. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  34632. }
  34633. var body io.Reader = nil
  34634. c.urlParams_.Set("alt", alt)
  34635. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/disks")
  34636. urls += "?" + c.urlParams_.Encode()
  34637. req, _ := http.NewRequest("GET", urls, body)
  34638. req.Header = reqHeaders
  34639. googleapi.Expand(req.URL, map[string]string{
  34640. "project": c.project,
  34641. "zone": c.zone,
  34642. })
  34643. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  34644. }
  34645. // Do executes the "compute.disks.list" call.
  34646. // Exactly one of *DiskList or error will be non-nil. Any non-2xx status
  34647. // code is an error. Response headers are in either
  34648. // *DiskList.ServerResponse.Header or (if a response was returned at
  34649. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  34650. // to check whether the returned error was because
  34651. // http.StatusNotModified was returned.
  34652. func (c *DisksListCall) Do(opts ...googleapi.CallOption) (*DiskList, error) {
  34653. gensupport.SetOptions(c.urlParams_, opts...)
  34654. res, err := c.doRequest("json")
  34655. if res != nil && res.StatusCode == http.StatusNotModified {
  34656. if res.Body != nil {
  34657. res.Body.Close()
  34658. }
  34659. return nil, &googleapi.Error{
  34660. Code: res.StatusCode,
  34661. Header: res.Header,
  34662. }
  34663. }
  34664. if err != nil {
  34665. return nil, err
  34666. }
  34667. defer googleapi.CloseBody(res)
  34668. if err := googleapi.CheckResponse(res); err != nil {
  34669. return nil, err
  34670. }
  34671. ret := &DiskList{
  34672. ServerResponse: googleapi.ServerResponse{
  34673. Header: res.Header,
  34674. HTTPStatusCode: res.StatusCode,
  34675. },
  34676. }
  34677. target := &ret
  34678. if err := gensupport.DecodeResponse(target, res); err != nil {
  34679. return nil, err
  34680. }
  34681. return ret, nil
  34682. // {
  34683. // "description": "Retrieves a list of persistent disks contained within the specified zone.",
  34684. // "httpMethod": "GET",
  34685. // "id": "compute.disks.list",
  34686. // "parameterOrder": [
  34687. // "project",
  34688. // "zone"
  34689. // ],
  34690. // "parameters": {
  34691. // "filter": {
  34692. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  34693. // "location": "query",
  34694. // "type": "string"
  34695. // },
  34696. // "maxResults": {
  34697. // "default": "500",
  34698. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  34699. // "format": "uint32",
  34700. // "location": "query",
  34701. // "minimum": "0",
  34702. // "type": "integer"
  34703. // },
  34704. // "orderBy": {
  34705. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  34706. // "location": "query",
  34707. // "type": "string"
  34708. // },
  34709. // "pageToken": {
  34710. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  34711. // "location": "query",
  34712. // "type": "string"
  34713. // },
  34714. // "project": {
  34715. // "description": "Project ID for this request.",
  34716. // "location": "path",
  34717. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  34718. // "required": true,
  34719. // "type": "string"
  34720. // },
  34721. // "zone": {
  34722. // "description": "The name of the zone for this request.",
  34723. // "location": "path",
  34724. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  34725. // "required": true,
  34726. // "type": "string"
  34727. // }
  34728. // },
  34729. // "path": "{project}/zones/{zone}/disks",
  34730. // "response": {
  34731. // "$ref": "DiskList"
  34732. // },
  34733. // "scopes": [
  34734. // "https://www.googleapis.com/auth/cloud-platform",
  34735. // "https://www.googleapis.com/auth/compute",
  34736. // "https://www.googleapis.com/auth/compute.readonly"
  34737. // ]
  34738. // }
  34739. }
  34740. // Pages invokes f for each page of results.
  34741. // A non-nil error returned from f will halt the iteration.
  34742. // The provided context supersedes any context provided to the Context method.
  34743. func (c *DisksListCall) Pages(ctx context.Context, f func(*DiskList) error) error {
  34744. c.ctx_ = ctx
  34745. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  34746. for {
  34747. x, err := c.Do()
  34748. if err != nil {
  34749. return err
  34750. }
  34751. if err := f(x); err != nil {
  34752. return err
  34753. }
  34754. if x.NextPageToken == "" {
  34755. return nil
  34756. }
  34757. c.PageToken(x.NextPageToken)
  34758. }
  34759. }
  34760. // method id "compute.disks.resize":
  34761. type DisksResizeCall struct {
  34762. s *Service
  34763. project string
  34764. zone string
  34765. disk string
  34766. disksresizerequest *DisksResizeRequest
  34767. urlParams_ gensupport.URLParams
  34768. ctx_ context.Context
  34769. header_ http.Header
  34770. }
  34771. // Resize: Resizes the specified persistent disk. You can only increase
  34772. // the size of the disk.
  34773. func (r *DisksService) Resize(project string, zone string, disk string, disksresizerequest *DisksResizeRequest) *DisksResizeCall {
  34774. c := &DisksResizeCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  34775. c.project = project
  34776. c.zone = zone
  34777. c.disk = disk
  34778. c.disksresizerequest = disksresizerequest
  34779. return c
  34780. }
  34781. // RequestId sets the optional parameter "requestId": An optional
  34782. // request ID to identify requests. Specify a unique request ID so that
  34783. // if you must retry your request, the server will know to ignore the
  34784. // request if it has already been completed.
  34785. //
  34786. // For example, consider a situation where you make an initial request
  34787. // and the request times out. If you make the request again with the
  34788. // same request ID, the server can check if original operation with the
  34789. // same request ID was received, and if so, will ignore the second
  34790. // request. This prevents clients from accidentally creating duplicate
  34791. // commitments.
  34792. //
  34793. // The request ID must be a valid UUID with the exception that zero UUID
  34794. // is not supported (00000000-0000-0000-0000-000000000000).
  34795. func (c *DisksResizeCall) RequestId(requestId string) *DisksResizeCall {
  34796. c.urlParams_.Set("requestId", requestId)
  34797. return c
  34798. }
  34799. // Fields allows partial responses to be retrieved. See
  34800. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  34801. // for more information.
  34802. func (c *DisksResizeCall) Fields(s ...googleapi.Field) *DisksResizeCall {
  34803. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  34804. return c
  34805. }
  34806. // Context sets the context to be used in this call's Do method. Any
  34807. // pending HTTP request will be aborted if the provided context is
  34808. // canceled.
  34809. func (c *DisksResizeCall) Context(ctx context.Context) *DisksResizeCall {
  34810. c.ctx_ = ctx
  34811. return c
  34812. }
  34813. // Header returns an http.Header that can be modified by the caller to
  34814. // add HTTP headers to the request.
  34815. func (c *DisksResizeCall) Header() http.Header {
  34816. if c.header_ == nil {
  34817. c.header_ = make(http.Header)
  34818. }
  34819. return c.header_
  34820. }
  34821. func (c *DisksResizeCall) doRequest(alt string) (*http.Response, error) {
  34822. reqHeaders := make(http.Header)
  34823. for k, v := range c.header_ {
  34824. reqHeaders[k] = v
  34825. }
  34826. reqHeaders.Set("User-Agent", c.s.userAgent())
  34827. var body io.Reader = nil
  34828. body, err := googleapi.WithoutDataWrapper.JSONReader(c.disksresizerequest)
  34829. if err != nil {
  34830. return nil, err
  34831. }
  34832. reqHeaders.Set("Content-Type", "application/json")
  34833. c.urlParams_.Set("alt", alt)
  34834. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/disks/{disk}/resize")
  34835. urls += "?" + c.urlParams_.Encode()
  34836. req, _ := http.NewRequest("POST", urls, body)
  34837. req.Header = reqHeaders
  34838. googleapi.Expand(req.URL, map[string]string{
  34839. "project": c.project,
  34840. "zone": c.zone,
  34841. "disk": c.disk,
  34842. })
  34843. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  34844. }
  34845. // Do executes the "compute.disks.resize" call.
  34846. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  34847. // status code is an error. Response headers are in either
  34848. // *Operation.ServerResponse.Header or (if a response was returned at
  34849. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  34850. // to check whether the returned error was because
  34851. // http.StatusNotModified was returned.
  34852. func (c *DisksResizeCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  34853. gensupport.SetOptions(c.urlParams_, opts...)
  34854. res, err := c.doRequest("json")
  34855. if res != nil && res.StatusCode == http.StatusNotModified {
  34856. if res.Body != nil {
  34857. res.Body.Close()
  34858. }
  34859. return nil, &googleapi.Error{
  34860. Code: res.StatusCode,
  34861. Header: res.Header,
  34862. }
  34863. }
  34864. if err != nil {
  34865. return nil, err
  34866. }
  34867. defer googleapi.CloseBody(res)
  34868. if err := googleapi.CheckResponse(res); err != nil {
  34869. return nil, err
  34870. }
  34871. ret := &Operation{
  34872. ServerResponse: googleapi.ServerResponse{
  34873. Header: res.Header,
  34874. HTTPStatusCode: res.StatusCode,
  34875. },
  34876. }
  34877. target := &ret
  34878. if err := gensupport.DecodeResponse(target, res); err != nil {
  34879. return nil, err
  34880. }
  34881. return ret, nil
  34882. // {
  34883. // "description": "Resizes the specified persistent disk. You can only increase the size of the disk.",
  34884. // "httpMethod": "POST",
  34885. // "id": "compute.disks.resize",
  34886. // "parameterOrder": [
  34887. // "project",
  34888. // "zone",
  34889. // "disk"
  34890. // ],
  34891. // "parameters": {
  34892. // "disk": {
  34893. // "description": "The name of the persistent disk.",
  34894. // "location": "path",
  34895. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  34896. // "required": true,
  34897. // "type": "string"
  34898. // },
  34899. // "project": {
  34900. // "description": "Project ID for this request.",
  34901. // "location": "path",
  34902. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  34903. // "required": true,
  34904. // "type": "string"
  34905. // },
  34906. // "requestId": {
  34907. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  34908. // "location": "query",
  34909. // "type": "string"
  34910. // },
  34911. // "zone": {
  34912. // "description": "The name of the zone for this request.",
  34913. // "location": "path",
  34914. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  34915. // "required": true,
  34916. // "type": "string"
  34917. // }
  34918. // },
  34919. // "path": "{project}/zones/{zone}/disks/{disk}/resize",
  34920. // "request": {
  34921. // "$ref": "DisksResizeRequest"
  34922. // },
  34923. // "response": {
  34924. // "$ref": "Operation"
  34925. // },
  34926. // "scopes": [
  34927. // "https://www.googleapis.com/auth/cloud-platform",
  34928. // "https://www.googleapis.com/auth/compute"
  34929. // ]
  34930. // }
  34931. }
  34932. // method id "compute.disks.setLabels":
  34933. type DisksSetLabelsCall struct {
  34934. s *Service
  34935. project string
  34936. zone string
  34937. resource string
  34938. zonesetlabelsrequest *ZoneSetLabelsRequest
  34939. urlParams_ gensupport.URLParams
  34940. ctx_ context.Context
  34941. header_ http.Header
  34942. }
  34943. // SetLabels: Sets the labels on a disk. To learn more about labels,
  34944. // read the Labeling Resources documentation.
  34945. func (r *DisksService) SetLabels(project string, zone string, resource string, zonesetlabelsrequest *ZoneSetLabelsRequest) *DisksSetLabelsCall {
  34946. c := &DisksSetLabelsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  34947. c.project = project
  34948. c.zone = zone
  34949. c.resource = resource
  34950. c.zonesetlabelsrequest = zonesetlabelsrequest
  34951. return c
  34952. }
  34953. // RequestId sets the optional parameter "requestId": An optional
  34954. // request ID to identify requests. Specify a unique request ID so that
  34955. // if you must retry your request, the server will know to ignore the
  34956. // request if it has already been completed.
  34957. //
  34958. // For example, consider a situation where you make an initial request
  34959. // and the request times out. If you make the request again with the
  34960. // same request ID, the server can check if original operation with the
  34961. // same request ID was received, and if so, will ignore the second
  34962. // request. This prevents clients from accidentally creating duplicate
  34963. // commitments.
  34964. //
  34965. // The request ID must be a valid UUID with the exception that zero UUID
  34966. // is not supported (00000000-0000-0000-0000-000000000000).
  34967. func (c *DisksSetLabelsCall) RequestId(requestId string) *DisksSetLabelsCall {
  34968. c.urlParams_.Set("requestId", requestId)
  34969. return c
  34970. }
  34971. // Fields allows partial responses to be retrieved. See
  34972. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  34973. // for more information.
  34974. func (c *DisksSetLabelsCall) Fields(s ...googleapi.Field) *DisksSetLabelsCall {
  34975. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  34976. return c
  34977. }
  34978. // Context sets the context to be used in this call's Do method. Any
  34979. // pending HTTP request will be aborted if the provided context is
  34980. // canceled.
  34981. func (c *DisksSetLabelsCall) Context(ctx context.Context) *DisksSetLabelsCall {
  34982. c.ctx_ = ctx
  34983. return c
  34984. }
  34985. // Header returns an http.Header that can be modified by the caller to
  34986. // add HTTP headers to the request.
  34987. func (c *DisksSetLabelsCall) Header() http.Header {
  34988. if c.header_ == nil {
  34989. c.header_ = make(http.Header)
  34990. }
  34991. return c.header_
  34992. }
  34993. func (c *DisksSetLabelsCall) doRequest(alt string) (*http.Response, error) {
  34994. reqHeaders := make(http.Header)
  34995. for k, v := range c.header_ {
  34996. reqHeaders[k] = v
  34997. }
  34998. reqHeaders.Set("User-Agent", c.s.userAgent())
  34999. var body io.Reader = nil
  35000. body, err := googleapi.WithoutDataWrapper.JSONReader(c.zonesetlabelsrequest)
  35001. if err != nil {
  35002. return nil, err
  35003. }
  35004. reqHeaders.Set("Content-Type", "application/json")
  35005. c.urlParams_.Set("alt", alt)
  35006. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/disks/{resource}/setLabels")
  35007. urls += "?" + c.urlParams_.Encode()
  35008. req, _ := http.NewRequest("POST", urls, body)
  35009. req.Header = reqHeaders
  35010. googleapi.Expand(req.URL, map[string]string{
  35011. "project": c.project,
  35012. "zone": c.zone,
  35013. "resource": c.resource,
  35014. })
  35015. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  35016. }
  35017. // Do executes the "compute.disks.setLabels" call.
  35018. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  35019. // status code is an error. Response headers are in either
  35020. // *Operation.ServerResponse.Header or (if a response was returned at
  35021. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  35022. // to check whether the returned error was because
  35023. // http.StatusNotModified was returned.
  35024. func (c *DisksSetLabelsCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  35025. gensupport.SetOptions(c.urlParams_, opts...)
  35026. res, err := c.doRequest("json")
  35027. if res != nil && res.StatusCode == http.StatusNotModified {
  35028. if res.Body != nil {
  35029. res.Body.Close()
  35030. }
  35031. return nil, &googleapi.Error{
  35032. Code: res.StatusCode,
  35033. Header: res.Header,
  35034. }
  35035. }
  35036. if err != nil {
  35037. return nil, err
  35038. }
  35039. defer googleapi.CloseBody(res)
  35040. if err := googleapi.CheckResponse(res); err != nil {
  35041. return nil, err
  35042. }
  35043. ret := &Operation{
  35044. ServerResponse: googleapi.ServerResponse{
  35045. Header: res.Header,
  35046. HTTPStatusCode: res.StatusCode,
  35047. },
  35048. }
  35049. target := &ret
  35050. if err := gensupport.DecodeResponse(target, res); err != nil {
  35051. return nil, err
  35052. }
  35053. return ret, nil
  35054. // {
  35055. // "description": "Sets the labels on a disk. To learn more about labels, read the Labeling Resources documentation.",
  35056. // "httpMethod": "POST",
  35057. // "id": "compute.disks.setLabels",
  35058. // "parameterOrder": [
  35059. // "project",
  35060. // "zone",
  35061. // "resource"
  35062. // ],
  35063. // "parameters": {
  35064. // "project": {
  35065. // "description": "Project ID for this request.",
  35066. // "location": "path",
  35067. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  35068. // "required": true,
  35069. // "type": "string"
  35070. // },
  35071. // "requestId": {
  35072. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  35073. // "location": "query",
  35074. // "type": "string"
  35075. // },
  35076. // "resource": {
  35077. // "description": "Name of the resource for this request.",
  35078. // "location": "path",
  35079. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  35080. // "required": true,
  35081. // "type": "string"
  35082. // },
  35083. // "zone": {
  35084. // "description": "The name of the zone for this request.",
  35085. // "location": "path",
  35086. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  35087. // "required": true,
  35088. // "type": "string"
  35089. // }
  35090. // },
  35091. // "path": "{project}/zones/{zone}/disks/{resource}/setLabels",
  35092. // "request": {
  35093. // "$ref": "ZoneSetLabelsRequest"
  35094. // },
  35095. // "response": {
  35096. // "$ref": "Operation"
  35097. // },
  35098. // "scopes": [
  35099. // "https://www.googleapis.com/auth/cloud-platform",
  35100. // "https://www.googleapis.com/auth/compute"
  35101. // ]
  35102. // }
  35103. }
  35104. // method id "compute.disks.testIamPermissions":
  35105. type DisksTestIamPermissionsCall struct {
  35106. s *Service
  35107. project string
  35108. zone string
  35109. resource string
  35110. testpermissionsrequest *TestPermissionsRequest
  35111. urlParams_ gensupport.URLParams
  35112. ctx_ context.Context
  35113. header_ http.Header
  35114. }
  35115. // TestIamPermissions: Returns permissions that a caller has on the
  35116. // specified resource.
  35117. func (r *DisksService) TestIamPermissions(project string, zone string, resource string, testpermissionsrequest *TestPermissionsRequest) *DisksTestIamPermissionsCall {
  35118. c := &DisksTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  35119. c.project = project
  35120. c.zone = zone
  35121. c.resource = resource
  35122. c.testpermissionsrequest = testpermissionsrequest
  35123. return c
  35124. }
  35125. // Fields allows partial responses to be retrieved. See
  35126. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  35127. // for more information.
  35128. func (c *DisksTestIamPermissionsCall) Fields(s ...googleapi.Field) *DisksTestIamPermissionsCall {
  35129. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  35130. return c
  35131. }
  35132. // Context sets the context to be used in this call's Do method. Any
  35133. // pending HTTP request will be aborted if the provided context is
  35134. // canceled.
  35135. func (c *DisksTestIamPermissionsCall) Context(ctx context.Context) *DisksTestIamPermissionsCall {
  35136. c.ctx_ = ctx
  35137. return c
  35138. }
  35139. // Header returns an http.Header that can be modified by the caller to
  35140. // add HTTP headers to the request.
  35141. func (c *DisksTestIamPermissionsCall) Header() http.Header {
  35142. if c.header_ == nil {
  35143. c.header_ = make(http.Header)
  35144. }
  35145. return c.header_
  35146. }
  35147. func (c *DisksTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  35148. reqHeaders := make(http.Header)
  35149. for k, v := range c.header_ {
  35150. reqHeaders[k] = v
  35151. }
  35152. reqHeaders.Set("User-Agent", c.s.userAgent())
  35153. var body io.Reader = nil
  35154. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  35155. if err != nil {
  35156. return nil, err
  35157. }
  35158. reqHeaders.Set("Content-Type", "application/json")
  35159. c.urlParams_.Set("alt", alt)
  35160. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/disks/{resource}/testIamPermissions")
  35161. urls += "?" + c.urlParams_.Encode()
  35162. req, _ := http.NewRequest("POST", urls, body)
  35163. req.Header = reqHeaders
  35164. googleapi.Expand(req.URL, map[string]string{
  35165. "project": c.project,
  35166. "zone": c.zone,
  35167. "resource": c.resource,
  35168. })
  35169. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  35170. }
  35171. // Do executes the "compute.disks.testIamPermissions" call.
  35172. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  35173. // non-2xx status code is an error. Response headers are in either
  35174. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  35175. // returned at all) in error.(*googleapi.Error).Header. Use
  35176. // googleapi.IsNotModified to check whether the returned error was
  35177. // because http.StatusNotModified was returned.
  35178. func (c *DisksTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  35179. gensupport.SetOptions(c.urlParams_, opts...)
  35180. res, err := c.doRequest("json")
  35181. if res != nil && res.StatusCode == http.StatusNotModified {
  35182. if res.Body != nil {
  35183. res.Body.Close()
  35184. }
  35185. return nil, &googleapi.Error{
  35186. Code: res.StatusCode,
  35187. Header: res.Header,
  35188. }
  35189. }
  35190. if err != nil {
  35191. return nil, err
  35192. }
  35193. defer googleapi.CloseBody(res)
  35194. if err := googleapi.CheckResponse(res); err != nil {
  35195. return nil, err
  35196. }
  35197. ret := &TestPermissionsResponse{
  35198. ServerResponse: googleapi.ServerResponse{
  35199. Header: res.Header,
  35200. HTTPStatusCode: res.StatusCode,
  35201. },
  35202. }
  35203. target := &ret
  35204. if err := gensupport.DecodeResponse(target, res); err != nil {
  35205. return nil, err
  35206. }
  35207. return ret, nil
  35208. // {
  35209. // "description": "Returns permissions that a caller has on the specified resource.",
  35210. // "httpMethod": "POST",
  35211. // "id": "compute.disks.testIamPermissions",
  35212. // "parameterOrder": [
  35213. // "project",
  35214. // "zone",
  35215. // "resource"
  35216. // ],
  35217. // "parameters": {
  35218. // "project": {
  35219. // "description": "Project ID for this request.",
  35220. // "location": "path",
  35221. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  35222. // "required": true,
  35223. // "type": "string"
  35224. // },
  35225. // "resource": {
  35226. // "description": "Name of the resource for this request.",
  35227. // "location": "path",
  35228. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  35229. // "required": true,
  35230. // "type": "string"
  35231. // },
  35232. // "zone": {
  35233. // "description": "The name of the zone for this request.",
  35234. // "location": "path",
  35235. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  35236. // "required": true,
  35237. // "type": "string"
  35238. // }
  35239. // },
  35240. // "path": "{project}/zones/{zone}/disks/{resource}/testIamPermissions",
  35241. // "request": {
  35242. // "$ref": "TestPermissionsRequest"
  35243. // },
  35244. // "response": {
  35245. // "$ref": "TestPermissionsResponse"
  35246. // },
  35247. // "scopes": [
  35248. // "https://www.googleapis.com/auth/cloud-platform",
  35249. // "https://www.googleapis.com/auth/compute",
  35250. // "https://www.googleapis.com/auth/compute.readonly"
  35251. // ]
  35252. // }
  35253. }
  35254. // method id "compute.firewalls.delete":
  35255. type FirewallsDeleteCall struct {
  35256. s *Service
  35257. project string
  35258. firewall string
  35259. urlParams_ gensupport.URLParams
  35260. ctx_ context.Context
  35261. header_ http.Header
  35262. }
  35263. // Delete: Deletes the specified firewall.
  35264. // For details, see https://cloud.google.com/compute/docs/reference/latest/firewalls/delete
  35265. func (r *FirewallsService) Delete(project string, firewall string) *FirewallsDeleteCall {
  35266. c := &FirewallsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  35267. c.project = project
  35268. c.firewall = firewall
  35269. return c
  35270. }
  35271. // RequestId sets the optional parameter "requestId": An optional
  35272. // request ID to identify requests. Specify a unique request ID so that
  35273. // if you must retry your request, the server will know to ignore the
  35274. // request if it has already been completed.
  35275. //
  35276. // For example, consider a situation where you make an initial request
  35277. // and the request times out. If you make the request again with the
  35278. // same request ID, the server can check if original operation with the
  35279. // same request ID was received, and if so, will ignore the second
  35280. // request. This prevents clients from accidentally creating duplicate
  35281. // commitments.
  35282. //
  35283. // The request ID must be a valid UUID with the exception that zero UUID
  35284. // is not supported (00000000-0000-0000-0000-000000000000).
  35285. func (c *FirewallsDeleteCall) RequestId(requestId string) *FirewallsDeleteCall {
  35286. c.urlParams_.Set("requestId", requestId)
  35287. return c
  35288. }
  35289. // Fields allows partial responses to be retrieved. See
  35290. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  35291. // for more information.
  35292. func (c *FirewallsDeleteCall) Fields(s ...googleapi.Field) *FirewallsDeleteCall {
  35293. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  35294. return c
  35295. }
  35296. // Context sets the context to be used in this call's Do method. Any
  35297. // pending HTTP request will be aborted if the provided context is
  35298. // canceled.
  35299. func (c *FirewallsDeleteCall) Context(ctx context.Context) *FirewallsDeleteCall {
  35300. c.ctx_ = ctx
  35301. return c
  35302. }
  35303. // Header returns an http.Header that can be modified by the caller to
  35304. // add HTTP headers to the request.
  35305. func (c *FirewallsDeleteCall) Header() http.Header {
  35306. if c.header_ == nil {
  35307. c.header_ = make(http.Header)
  35308. }
  35309. return c.header_
  35310. }
  35311. func (c *FirewallsDeleteCall) doRequest(alt string) (*http.Response, error) {
  35312. reqHeaders := make(http.Header)
  35313. for k, v := range c.header_ {
  35314. reqHeaders[k] = v
  35315. }
  35316. reqHeaders.Set("User-Agent", c.s.userAgent())
  35317. var body io.Reader = nil
  35318. c.urlParams_.Set("alt", alt)
  35319. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/firewalls/{firewall}")
  35320. urls += "?" + c.urlParams_.Encode()
  35321. req, _ := http.NewRequest("DELETE", urls, body)
  35322. req.Header = reqHeaders
  35323. googleapi.Expand(req.URL, map[string]string{
  35324. "project": c.project,
  35325. "firewall": c.firewall,
  35326. })
  35327. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  35328. }
  35329. // Do executes the "compute.firewalls.delete" call.
  35330. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  35331. // status code is an error. Response headers are in either
  35332. // *Operation.ServerResponse.Header or (if a response was returned at
  35333. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  35334. // to check whether the returned error was because
  35335. // http.StatusNotModified was returned.
  35336. func (c *FirewallsDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  35337. gensupport.SetOptions(c.urlParams_, opts...)
  35338. res, err := c.doRequest("json")
  35339. if res != nil && res.StatusCode == http.StatusNotModified {
  35340. if res.Body != nil {
  35341. res.Body.Close()
  35342. }
  35343. return nil, &googleapi.Error{
  35344. Code: res.StatusCode,
  35345. Header: res.Header,
  35346. }
  35347. }
  35348. if err != nil {
  35349. return nil, err
  35350. }
  35351. defer googleapi.CloseBody(res)
  35352. if err := googleapi.CheckResponse(res); err != nil {
  35353. return nil, err
  35354. }
  35355. ret := &Operation{
  35356. ServerResponse: googleapi.ServerResponse{
  35357. Header: res.Header,
  35358. HTTPStatusCode: res.StatusCode,
  35359. },
  35360. }
  35361. target := &ret
  35362. if err := gensupport.DecodeResponse(target, res); err != nil {
  35363. return nil, err
  35364. }
  35365. return ret, nil
  35366. // {
  35367. // "description": "Deletes the specified firewall.",
  35368. // "httpMethod": "DELETE",
  35369. // "id": "compute.firewalls.delete",
  35370. // "parameterOrder": [
  35371. // "project",
  35372. // "firewall"
  35373. // ],
  35374. // "parameters": {
  35375. // "firewall": {
  35376. // "description": "Name of the firewall rule to delete.",
  35377. // "location": "path",
  35378. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  35379. // "required": true,
  35380. // "type": "string"
  35381. // },
  35382. // "project": {
  35383. // "description": "Project ID for this request.",
  35384. // "location": "path",
  35385. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  35386. // "required": true,
  35387. // "type": "string"
  35388. // },
  35389. // "requestId": {
  35390. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  35391. // "location": "query",
  35392. // "type": "string"
  35393. // }
  35394. // },
  35395. // "path": "{project}/global/firewalls/{firewall}",
  35396. // "response": {
  35397. // "$ref": "Operation"
  35398. // },
  35399. // "scopes": [
  35400. // "https://www.googleapis.com/auth/cloud-platform",
  35401. // "https://www.googleapis.com/auth/compute"
  35402. // ]
  35403. // }
  35404. }
  35405. // method id "compute.firewalls.get":
  35406. type FirewallsGetCall struct {
  35407. s *Service
  35408. project string
  35409. firewall string
  35410. urlParams_ gensupport.URLParams
  35411. ifNoneMatch_ string
  35412. ctx_ context.Context
  35413. header_ http.Header
  35414. }
  35415. // Get: Returns the specified firewall.
  35416. // For details, see https://cloud.google.com/compute/docs/reference/latest/firewalls/get
  35417. func (r *FirewallsService) Get(project string, firewall string) *FirewallsGetCall {
  35418. c := &FirewallsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  35419. c.project = project
  35420. c.firewall = firewall
  35421. return c
  35422. }
  35423. // Fields allows partial responses to be retrieved. See
  35424. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  35425. // for more information.
  35426. func (c *FirewallsGetCall) Fields(s ...googleapi.Field) *FirewallsGetCall {
  35427. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  35428. return c
  35429. }
  35430. // IfNoneMatch sets the optional parameter which makes the operation
  35431. // fail if the object's ETag matches the given value. This is useful for
  35432. // getting updates only after the object has changed since the last
  35433. // request. Use googleapi.IsNotModified to check whether the response
  35434. // error from Do is the result of In-None-Match.
  35435. func (c *FirewallsGetCall) IfNoneMatch(entityTag string) *FirewallsGetCall {
  35436. c.ifNoneMatch_ = entityTag
  35437. return c
  35438. }
  35439. // Context sets the context to be used in this call's Do method. Any
  35440. // pending HTTP request will be aborted if the provided context is
  35441. // canceled.
  35442. func (c *FirewallsGetCall) Context(ctx context.Context) *FirewallsGetCall {
  35443. c.ctx_ = ctx
  35444. return c
  35445. }
  35446. // Header returns an http.Header that can be modified by the caller to
  35447. // add HTTP headers to the request.
  35448. func (c *FirewallsGetCall) Header() http.Header {
  35449. if c.header_ == nil {
  35450. c.header_ = make(http.Header)
  35451. }
  35452. return c.header_
  35453. }
  35454. func (c *FirewallsGetCall) doRequest(alt string) (*http.Response, error) {
  35455. reqHeaders := make(http.Header)
  35456. for k, v := range c.header_ {
  35457. reqHeaders[k] = v
  35458. }
  35459. reqHeaders.Set("User-Agent", c.s.userAgent())
  35460. if c.ifNoneMatch_ != "" {
  35461. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  35462. }
  35463. var body io.Reader = nil
  35464. c.urlParams_.Set("alt", alt)
  35465. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/firewalls/{firewall}")
  35466. urls += "?" + c.urlParams_.Encode()
  35467. req, _ := http.NewRequest("GET", urls, body)
  35468. req.Header = reqHeaders
  35469. googleapi.Expand(req.URL, map[string]string{
  35470. "project": c.project,
  35471. "firewall": c.firewall,
  35472. })
  35473. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  35474. }
  35475. // Do executes the "compute.firewalls.get" call.
  35476. // Exactly one of *Firewall or error will be non-nil. Any non-2xx status
  35477. // code is an error. Response headers are in either
  35478. // *Firewall.ServerResponse.Header or (if a response was returned at
  35479. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  35480. // to check whether the returned error was because
  35481. // http.StatusNotModified was returned.
  35482. func (c *FirewallsGetCall) Do(opts ...googleapi.CallOption) (*Firewall, error) {
  35483. gensupport.SetOptions(c.urlParams_, opts...)
  35484. res, err := c.doRequest("json")
  35485. if res != nil && res.StatusCode == http.StatusNotModified {
  35486. if res.Body != nil {
  35487. res.Body.Close()
  35488. }
  35489. return nil, &googleapi.Error{
  35490. Code: res.StatusCode,
  35491. Header: res.Header,
  35492. }
  35493. }
  35494. if err != nil {
  35495. return nil, err
  35496. }
  35497. defer googleapi.CloseBody(res)
  35498. if err := googleapi.CheckResponse(res); err != nil {
  35499. return nil, err
  35500. }
  35501. ret := &Firewall{
  35502. ServerResponse: googleapi.ServerResponse{
  35503. Header: res.Header,
  35504. HTTPStatusCode: res.StatusCode,
  35505. },
  35506. }
  35507. target := &ret
  35508. if err := gensupport.DecodeResponse(target, res); err != nil {
  35509. return nil, err
  35510. }
  35511. return ret, nil
  35512. // {
  35513. // "description": "Returns the specified firewall.",
  35514. // "httpMethod": "GET",
  35515. // "id": "compute.firewalls.get",
  35516. // "parameterOrder": [
  35517. // "project",
  35518. // "firewall"
  35519. // ],
  35520. // "parameters": {
  35521. // "firewall": {
  35522. // "description": "Name of the firewall rule to return.",
  35523. // "location": "path",
  35524. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  35525. // "required": true,
  35526. // "type": "string"
  35527. // },
  35528. // "project": {
  35529. // "description": "Project ID for this request.",
  35530. // "location": "path",
  35531. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  35532. // "required": true,
  35533. // "type": "string"
  35534. // }
  35535. // },
  35536. // "path": "{project}/global/firewalls/{firewall}",
  35537. // "response": {
  35538. // "$ref": "Firewall"
  35539. // },
  35540. // "scopes": [
  35541. // "https://www.googleapis.com/auth/cloud-platform",
  35542. // "https://www.googleapis.com/auth/compute",
  35543. // "https://www.googleapis.com/auth/compute.readonly"
  35544. // ]
  35545. // }
  35546. }
  35547. // method id "compute.firewalls.insert":
  35548. type FirewallsInsertCall struct {
  35549. s *Service
  35550. project string
  35551. firewall *Firewall
  35552. urlParams_ gensupport.URLParams
  35553. ctx_ context.Context
  35554. header_ http.Header
  35555. }
  35556. // Insert: Creates a firewall rule in the specified project using the
  35557. // data included in the request.
  35558. // For details, see https://cloud.google.com/compute/docs/reference/latest/firewalls/insert
  35559. func (r *FirewallsService) Insert(project string, firewall *Firewall) *FirewallsInsertCall {
  35560. c := &FirewallsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  35561. c.project = project
  35562. c.firewall = firewall
  35563. return c
  35564. }
  35565. // RequestId sets the optional parameter "requestId": An optional
  35566. // request ID to identify requests. Specify a unique request ID so that
  35567. // if you must retry your request, the server will know to ignore the
  35568. // request if it has already been completed.
  35569. //
  35570. // For example, consider a situation where you make an initial request
  35571. // and the request times out. If you make the request again with the
  35572. // same request ID, the server can check if original operation with the
  35573. // same request ID was received, and if so, will ignore the second
  35574. // request. This prevents clients from accidentally creating duplicate
  35575. // commitments.
  35576. //
  35577. // The request ID must be a valid UUID with the exception that zero UUID
  35578. // is not supported (00000000-0000-0000-0000-000000000000).
  35579. func (c *FirewallsInsertCall) RequestId(requestId string) *FirewallsInsertCall {
  35580. c.urlParams_.Set("requestId", requestId)
  35581. return c
  35582. }
  35583. // Fields allows partial responses to be retrieved. See
  35584. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  35585. // for more information.
  35586. func (c *FirewallsInsertCall) Fields(s ...googleapi.Field) *FirewallsInsertCall {
  35587. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  35588. return c
  35589. }
  35590. // Context sets the context to be used in this call's Do method. Any
  35591. // pending HTTP request will be aborted if the provided context is
  35592. // canceled.
  35593. func (c *FirewallsInsertCall) Context(ctx context.Context) *FirewallsInsertCall {
  35594. c.ctx_ = ctx
  35595. return c
  35596. }
  35597. // Header returns an http.Header that can be modified by the caller to
  35598. // add HTTP headers to the request.
  35599. func (c *FirewallsInsertCall) Header() http.Header {
  35600. if c.header_ == nil {
  35601. c.header_ = make(http.Header)
  35602. }
  35603. return c.header_
  35604. }
  35605. func (c *FirewallsInsertCall) doRequest(alt string) (*http.Response, error) {
  35606. reqHeaders := make(http.Header)
  35607. for k, v := range c.header_ {
  35608. reqHeaders[k] = v
  35609. }
  35610. reqHeaders.Set("User-Agent", c.s.userAgent())
  35611. var body io.Reader = nil
  35612. body, err := googleapi.WithoutDataWrapper.JSONReader(c.firewall)
  35613. if err != nil {
  35614. return nil, err
  35615. }
  35616. reqHeaders.Set("Content-Type", "application/json")
  35617. c.urlParams_.Set("alt", alt)
  35618. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/firewalls")
  35619. urls += "?" + c.urlParams_.Encode()
  35620. req, _ := http.NewRequest("POST", urls, body)
  35621. req.Header = reqHeaders
  35622. googleapi.Expand(req.URL, map[string]string{
  35623. "project": c.project,
  35624. })
  35625. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  35626. }
  35627. // Do executes the "compute.firewalls.insert" call.
  35628. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  35629. // status code is an error. Response headers are in either
  35630. // *Operation.ServerResponse.Header or (if a response was returned at
  35631. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  35632. // to check whether the returned error was because
  35633. // http.StatusNotModified was returned.
  35634. func (c *FirewallsInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  35635. gensupport.SetOptions(c.urlParams_, opts...)
  35636. res, err := c.doRequest("json")
  35637. if res != nil && res.StatusCode == http.StatusNotModified {
  35638. if res.Body != nil {
  35639. res.Body.Close()
  35640. }
  35641. return nil, &googleapi.Error{
  35642. Code: res.StatusCode,
  35643. Header: res.Header,
  35644. }
  35645. }
  35646. if err != nil {
  35647. return nil, err
  35648. }
  35649. defer googleapi.CloseBody(res)
  35650. if err := googleapi.CheckResponse(res); err != nil {
  35651. return nil, err
  35652. }
  35653. ret := &Operation{
  35654. ServerResponse: googleapi.ServerResponse{
  35655. Header: res.Header,
  35656. HTTPStatusCode: res.StatusCode,
  35657. },
  35658. }
  35659. target := &ret
  35660. if err := gensupport.DecodeResponse(target, res); err != nil {
  35661. return nil, err
  35662. }
  35663. return ret, nil
  35664. // {
  35665. // "description": "Creates a firewall rule in the specified project using the data included in the request.",
  35666. // "httpMethod": "POST",
  35667. // "id": "compute.firewalls.insert",
  35668. // "parameterOrder": [
  35669. // "project"
  35670. // ],
  35671. // "parameters": {
  35672. // "project": {
  35673. // "description": "Project ID for this request.",
  35674. // "location": "path",
  35675. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  35676. // "required": true,
  35677. // "type": "string"
  35678. // },
  35679. // "requestId": {
  35680. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  35681. // "location": "query",
  35682. // "type": "string"
  35683. // }
  35684. // },
  35685. // "path": "{project}/global/firewalls",
  35686. // "request": {
  35687. // "$ref": "Firewall"
  35688. // },
  35689. // "response": {
  35690. // "$ref": "Operation"
  35691. // },
  35692. // "scopes": [
  35693. // "https://www.googleapis.com/auth/cloud-platform",
  35694. // "https://www.googleapis.com/auth/compute"
  35695. // ]
  35696. // }
  35697. }
  35698. // method id "compute.firewalls.list":
  35699. type FirewallsListCall struct {
  35700. s *Service
  35701. project string
  35702. urlParams_ gensupport.URLParams
  35703. ifNoneMatch_ string
  35704. ctx_ context.Context
  35705. header_ http.Header
  35706. }
  35707. // List: Retrieves the list of firewall rules available to the specified
  35708. // project.
  35709. // For details, see https://cloud.google.com/compute/docs/reference/latest/firewalls/list
  35710. func (r *FirewallsService) List(project string) *FirewallsListCall {
  35711. c := &FirewallsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  35712. c.project = project
  35713. return c
  35714. }
  35715. // Filter sets the optional parameter "filter": A filter expression that
  35716. // filters resources listed in the response. The expression must specify
  35717. // the field name, a comparison operator, and the value that you want to
  35718. // use for filtering. The value must be a string, a number, or a
  35719. // boolean. The comparison operator must be either =, !=, >, or <.
  35720. //
  35721. // For example, if you are filtering Compute Engine instances, you can
  35722. // exclude instances named example-instance by specifying name !=
  35723. // example-instance.
  35724. //
  35725. // You can also filter nested fields. For example, you could specify
  35726. // scheduling.automaticRestart = false to include instances only if they
  35727. // are not scheduled for automatic restarts. You can use filtering on
  35728. // nested fields to filter based on resource labels.
  35729. //
  35730. // To filter on multiple expressions, provide each separate expression
  35731. // within parentheses. For example, (scheduling.automaticRestart = true)
  35732. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  35733. // AND expression. However, you can include AND and OR expressions
  35734. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  35735. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  35736. // true).
  35737. func (c *FirewallsListCall) Filter(filter string) *FirewallsListCall {
  35738. c.urlParams_.Set("filter", filter)
  35739. return c
  35740. }
  35741. // MaxResults sets the optional parameter "maxResults": The maximum
  35742. // number of results per page that should be returned. If the number of
  35743. // available results is larger than maxResults, Compute Engine returns a
  35744. // nextPageToken that can be used to get the next page of results in
  35745. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  35746. // (Default: 500)
  35747. func (c *FirewallsListCall) MaxResults(maxResults int64) *FirewallsListCall {
  35748. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  35749. return c
  35750. }
  35751. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  35752. // a certain order. By default, results are returned in alphanumerical
  35753. // order based on the resource name.
  35754. //
  35755. // You can also sort results in descending order based on the creation
  35756. // timestamp using orderBy="creationTimestamp desc". This sorts results
  35757. // based on the creationTimestamp field in reverse chronological order
  35758. // (newest result first). Use this to sort resources like operations so
  35759. // that the newest operation is returned first.
  35760. //
  35761. // Currently, only sorting by name or creationTimestamp desc is
  35762. // supported.
  35763. func (c *FirewallsListCall) OrderBy(orderBy string) *FirewallsListCall {
  35764. c.urlParams_.Set("orderBy", orderBy)
  35765. return c
  35766. }
  35767. // PageToken sets the optional parameter "pageToken": Specifies a page
  35768. // token to use. Set pageToken to the nextPageToken returned by a
  35769. // previous list request to get the next page of results.
  35770. func (c *FirewallsListCall) PageToken(pageToken string) *FirewallsListCall {
  35771. c.urlParams_.Set("pageToken", pageToken)
  35772. return c
  35773. }
  35774. // Fields allows partial responses to be retrieved. See
  35775. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  35776. // for more information.
  35777. func (c *FirewallsListCall) Fields(s ...googleapi.Field) *FirewallsListCall {
  35778. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  35779. return c
  35780. }
  35781. // IfNoneMatch sets the optional parameter which makes the operation
  35782. // fail if the object's ETag matches the given value. This is useful for
  35783. // getting updates only after the object has changed since the last
  35784. // request. Use googleapi.IsNotModified to check whether the response
  35785. // error from Do is the result of In-None-Match.
  35786. func (c *FirewallsListCall) IfNoneMatch(entityTag string) *FirewallsListCall {
  35787. c.ifNoneMatch_ = entityTag
  35788. return c
  35789. }
  35790. // Context sets the context to be used in this call's Do method. Any
  35791. // pending HTTP request will be aborted if the provided context is
  35792. // canceled.
  35793. func (c *FirewallsListCall) Context(ctx context.Context) *FirewallsListCall {
  35794. c.ctx_ = ctx
  35795. return c
  35796. }
  35797. // Header returns an http.Header that can be modified by the caller to
  35798. // add HTTP headers to the request.
  35799. func (c *FirewallsListCall) Header() http.Header {
  35800. if c.header_ == nil {
  35801. c.header_ = make(http.Header)
  35802. }
  35803. return c.header_
  35804. }
  35805. func (c *FirewallsListCall) doRequest(alt string) (*http.Response, error) {
  35806. reqHeaders := make(http.Header)
  35807. for k, v := range c.header_ {
  35808. reqHeaders[k] = v
  35809. }
  35810. reqHeaders.Set("User-Agent", c.s.userAgent())
  35811. if c.ifNoneMatch_ != "" {
  35812. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  35813. }
  35814. var body io.Reader = nil
  35815. c.urlParams_.Set("alt", alt)
  35816. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/firewalls")
  35817. urls += "?" + c.urlParams_.Encode()
  35818. req, _ := http.NewRequest("GET", urls, body)
  35819. req.Header = reqHeaders
  35820. googleapi.Expand(req.URL, map[string]string{
  35821. "project": c.project,
  35822. })
  35823. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  35824. }
  35825. // Do executes the "compute.firewalls.list" call.
  35826. // Exactly one of *FirewallList or error will be non-nil. Any non-2xx
  35827. // status code is an error. Response headers are in either
  35828. // *FirewallList.ServerResponse.Header or (if a response was returned at
  35829. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  35830. // to check whether the returned error was because
  35831. // http.StatusNotModified was returned.
  35832. func (c *FirewallsListCall) Do(opts ...googleapi.CallOption) (*FirewallList, error) {
  35833. gensupport.SetOptions(c.urlParams_, opts...)
  35834. res, err := c.doRequest("json")
  35835. if res != nil && res.StatusCode == http.StatusNotModified {
  35836. if res.Body != nil {
  35837. res.Body.Close()
  35838. }
  35839. return nil, &googleapi.Error{
  35840. Code: res.StatusCode,
  35841. Header: res.Header,
  35842. }
  35843. }
  35844. if err != nil {
  35845. return nil, err
  35846. }
  35847. defer googleapi.CloseBody(res)
  35848. if err := googleapi.CheckResponse(res); err != nil {
  35849. return nil, err
  35850. }
  35851. ret := &FirewallList{
  35852. ServerResponse: googleapi.ServerResponse{
  35853. Header: res.Header,
  35854. HTTPStatusCode: res.StatusCode,
  35855. },
  35856. }
  35857. target := &ret
  35858. if err := gensupport.DecodeResponse(target, res); err != nil {
  35859. return nil, err
  35860. }
  35861. return ret, nil
  35862. // {
  35863. // "description": "Retrieves the list of firewall rules available to the specified project.",
  35864. // "httpMethod": "GET",
  35865. // "id": "compute.firewalls.list",
  35866. // "parameterOrder": [
  35867. // "project"
  35868. // ],
  35869. // "parameters": {
  35870. // "filter": {
  35871. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  35872. // "location": "query",
  35873. // "type": "string"
  35874. // },
  35875. // "maxResults": {
  35876. // "default": "500",
  35877. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  35878. // "format": "uint32",
  35879. // "location": "query",
  35880. // "minimum": "0",
  35881. // "type": "integer"
  35882. // },
  35883. // "orderBy": {
  35884. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  35885. // "location": "query",
  35886. // "type": "string"
  35887. // },
  35888. // "pageToken": {
  35889. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  35890. // "location": "query",
  35891. // "type": "string"
  35892. // },
  35893. // "project": {
  35894. // "description": "Project ID for this request.",
  35895. // "location": "path",
  35896. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  35897. // "required": true,
  35898. // "type": "string"
  35899. // }
  35900. // },
  35901. // "path": "{project}/global/firewalls",
  35902. // "response": {
  35903. // "$ref": "FirewallList"
  35904. // },
  35905. // "scopes": [
  35906. // "https://www.googleapis.com/auth/cloud-platform",
  35907. // "https://www.googleapis.com/auth/compute",
  35908. // "https://www.googleapis.com/auth/compute.readonly"
  35909. // ]
  35910. // }
  35911. }
  35912. // Pages invokes f for each page of results.
  35913. // A non-nil error returned from f will halt the iteration.
  35914. // The provided context supersedes any context provided to the Context method.
  35915. func (c *FirewallsListCall) Pages(ctx context.Context, f func(*FirewallList) error) error {
  35916. c.ctx_ = ctx
  35917. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  35918. for {
  35919. x, err := c.Do()
  35920. if err != nil {
  35921. return err
  35922. }
  35923. if err := f(x); err != nil {
  35924. return err
  35925. }
  35926. if x.NextPageToken == "" {
  35927. return nil
  35928. }
  35929. c.PageToken(x.NextPageToken)
  35930. }
  35931. }
  35932. // method id "compute.firewalls.patch":
  35933. type FirewallsPatchCall struct {
  35934. s *Service
  35935. project string
  35936. firewall string
  35937. firewall2 *Firewall
  35938. urlParams_ gensupport.URLParams
  35939. ctx_ context.Context
  35940. header_ http.Header
  35941. }
  35942. // Patch: Updates the specified firewall rule with the data included in
  35943. // the request. This method supports PATCH semantics and uses the JSON
  35944. // merge patch format and processing rules.
  35945. // For details, see https://cloud.google.com/compute/docs/reference/latest/firewalls/patch
  35946. func (r *FirewallsService) Patch(project string, firewall string, firewall2 *Firewall) *FirewallsPatchCall {
  35947. c := &FirewallsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  35948. c.project = project
  35949. c.firewall = firewall
  35950. c.firewall2 = firewall2
  35951. return c
  35952. }
  35953. // RequestId sets the optional parameter "requestId": An optional
  35954. // request ID to identify requests. Specify a unique request ID so that
  35955. // if you must retry your request, the server will know to ignore the
  35956. // request if it has already been completed.
  35957. //
  35958. // For example, consider a situation where you make an initial request
  35959. // and the request times out. If you make the request again with the
  35960. // same request ID, the server can check if original operation with the
  35961. // same request ID was received, and if so, will ignore the second
  35962. // request. This prevents clients from accidentally creating duplicate
  35963. // commitments.
  35964. //
  35965. // The request ID must be a valid UUID with the exception that zero UUID
  35966. // is not supported (00000000-0000-0000-0000-000000000000).
  35967. func (c *FirewallsPatchCall) RequestId(requestId string) *FirewallsPatchCall {
  35968. c.urlParams_.Set("requestId", requestId)
  35969. return c
  35970. }
  35971. // Fields allows partial responses to be retrieved. See
  35972. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  35973. // for more information.
  35974. func (c *FirewallsPatchCall) Fields(s ...googleapi.Field) *FirewallsPatchCall {
  35975. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  35976. return c
  35977. }
  35978. // Context sets the context to be used in this call's Do method. Any
  35979. // pending HTTP request will be aborted if the provided context is
  35980. // canceled.
  35981. func (c *FirewallsPatchCall) Context(ctx context.Context) *FirewallsPatchCall {
  35982. c.ctx_ = ctx
  35983. return c
  35984. }
  35985. // Header returns an http.Header that can be modified by the caller to
  35986. // add HTTP headers to the request.
  35987. func (c *FirewallsPatchCall) Header() http.Header {
  35988. if c.header_ == nil {
  35989. c.header_ = make(http.Header)
  35990. }
  35991. return c.header_
  35992. }
  35993. func (c *FirewallsPatchCall) doRequest(alt string) (*http.Response, error) {
  35994. reqHeaders := make(http.Header)
  35995. for k, v := range c.header_ {
  35996. reqHeaders[k] = v
  35997. }
  35998. reqHeaders.Set("User-Agent", c.s.userAgent())
  35999. var body io.Reader = nil
  36000. body, err := googleapi.WithoutDataWrapper.JSONReader(c.firewall2)
  36001. if err != nil {
  36002. return nil, err
  36003. }
  36004. reqHeaders.Set("Content-Type", "application/json")
  36005. c.urlParams_.Set("alt", alt)
  36006. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/firewalls/{firewall}")
  36007. urls += "?" + c.urlParams_.Encode()
  36008. req, _ := http.NewRequest("PATCH", urls, body)
  36009. req.Header = reqHeaders
  36010. googleapi.Expand(req.URL, map[string]string{
  36011. "project": c.project,
  36012. "firewall": c.firewall,
  36013. })
  36014. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  36015. }
  36016. // Do executes the "compute.firewalls.patch" call.
  36017. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  36018. // status code is an error. Response headers are in either
  36019. // *Operation.ServerResponse.Header or (if a response was returned at
  36020. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  36021. // to check whether the returned error was because
  36022. // http.StatusNotModified was returned.
  36023. func (c *FirewallsPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  36024. gensupport.SetOptions(c.urlParams_, opts...)
  36025. res, err := c.doRequest("json")
  36026. if res != nil && res.StatusCode == http.StatusNotModified {
  36027. if res.Body != nil {
  36028. res.Body.Close()
  36029. }
  36030. return nil, &googleapi.Error{
  36031. Code: res.StatusCode,
  36032. Header: res.Header,
  36033. }
  36034. }
  36035. if err != nil {
  36036. return nil, err
  36037. }
  36038. defer googleapi.CloseBody(res)
  36039. if err := googleapi.CheckResponse(res); err != nil {
  36040. return nil, err
  36041. }
  36042. ret := &Operation{
  36043. ServerResponse: googleapi.ServerResponse{
  36044. Header: res.Header,
  36045. HTTPStatusCode: res.StatusCode,
  36046. },
  36047. }
  36048. target := &ret
  36049. if err := gensupport.DecodeResponse(target, res); err != nil {
  36050. return nil, err
  36051. }
  36052. return ret, nil
  36053. // {
  36054. // "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.",
  36055. // "httpMethod": "PATCH",
  36056. // "id": "compute.firewalls.patch",
  36057. // "parameterOrder": [
  36058. // "project",
  36059. // "firewall"
  36060. // ],
  36061. // "parameters": {
  36062. // "firewall": {
  36063. // "description": "Name of the firewall rule to patch.",
  36064. // "location": "path",
  36065. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  36066. // "required": true,
  36067. // "type": "string"
  36068. // },
  36069. // "project": {
  36070. // "description": "Project ID for this request.",
  36071. // "location": "path",
  36072. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  36073. // "required": true,
  36074. // "type": "string"
  36075. // },
  36076. // "requestId": {
  36077. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  36078. // "location": "query",
  36079. // "type": "string"
  36080. // }
  36081. // },
  36082. // "path": "{project}/global/firewalls/{firewall}",
  36083. // "request": {
  36084. // "$ref": "Firewall"
  36085. // },
  36086. // "response": {
  36087. // "$ref": "Operation"
  36088. // },
  36089. // "scopes": [
  36090. // "https://www.googleapis.com/auth/cloud-platform",
  36091. // "https://www.googleapis.com/auth/compute"
  36092. // ]
  36093. // }
  36094. }
  36095. // method id "compute.firewalls.testIamPermissions":
  36096. type FirewallsTestIamPermissionsCall struct {
  36097. s *Service
  36098. project string
  36099. resource string
  36100. testpermissionsrequest *TestPermissionsRequest
  36101. urlParams_ gensupport.URLParams
  36102. ctx_ context.Context
  36103. header_ http.Header
  36104. }
  36105. // TestIamPermissions: Returns permissions that a caller has on the
  36106. // specified resource.
  36107. func (r *FirewallsService) TestIamPermissions(project string, resource string, testpermissionsrequest *TestPermissionsRequest) *FirewallsTestIamPermissionsCall {
  36108. c := &FirewallsTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  36109. c.project = project
  36110. c.resource = resource
  36111. c.testpermissionsrequest = testpermissionsrequest
  36112. return c
  36113. }
  36114. // Fields allows partial responses to be retrieved. See
  36115. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  36116. // for more information.
  36117. func (c *FirewallsTestIamPermissionsCall) Fields(s ...googleapi.Field) *FirewallsTestIamPermissionsCall {
  36118. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  36119. return c
  36120. }
  36121. // Context sets the context to be used in this call's Do method. Any
  36122. // pending HTTP request will be aborted if the provided context is
  36123. // canceled.
  36124. func (c *FirewallsTestIamPermissionsCall) Context(ctx context.Context) *FirewallsTestIamPermissionsCall {
  36125. c.ctx_ = ctx
  36126. return c
  36127. }
  36128. // Header returns an http.Header that can be modified by the caller to
  36129. // add HTTP headers to the request.
  36130. func (c *FirewallsTestIamPermissionsCall) Header() http.Header {
  36131. if c.header_ == nil {
  36132. c.header_ = make(http.Header)
  36133. }
  36134. return c.header_
  36135. }
  36136. func (c *FirewallsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  36137. reqHeaders := make(http.Header)
  36138. for k, v := range c.header_ {
  36139. reqHeaders[k] = v
  36140. }
  36141. reqHeaders.Set("User-Agent", c.s.userAgent())
  36142. var body io.Reader = nil
  36143. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  36144. if err != nil {
  36145. return nil, err
  36146. }
  36147. reqHeaders.Set("Content-Type", "application/json")
  36148. c.urlParams_.Set("alt", alt)
  36149. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/firewalls/{resource}/testIamPermissions")
  36150. urls += "?" + c.urlParams_.Encode()
  36151. req, _ := http.NewRequest("POST", urls, body)
  36152. req.Header = reqHeaders
  36153. googleapi.Expand(req.URL, map[string]string{
  36154. "project": c.project,
  36155. "resource": c.resource,
  36156. })
  36157. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  36158. }
  36159. // Do executes the "compute.firewalls.testIamPermissions" call.
  36160. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  36161. // non-2xx status code is an error. Response headers are in either
  36162. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  36163. // returned at all) in error.(*googleapi.Error).Header. Use
  36164. // googleapi.IsNotModified to check whether the returned error was
  36165. // because http.StatusNotModified was returned.
  36166. func (c *FirewallsTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  36167. gensupport.SetOptions(c.urlParams_, opts...)
  36168. res, err := c.doRequest("json")
  36169. if res != nil && res.StatusCode == http.StatusNotModified {
  36170. if res.Body != nil {
  36171. res.Body.Close()
  36172. }
  36173. return nil, &googleapi.Error{
  36174. Code: res.StatusCode,
  36175. Header: res.Header,
  36176. }
  36177. }
  36178. if err != nil {
  36179. return nil, err
  36180. }
  36181. defer googleapi.CloseBody(res)
  36182. if err := googleapi.CheckResponse(res); err != nil {
  36183. return nil, err
  36184. }
  36185. ret := &TestPermissionsResponse{
  36186. ServerResponse: googleapi.ServerResponse{
  36187. Header: res.Header,
  36188. HTTPStatusCode: res.StatusCode,
  36189. },
  36190. }
  36191. target := &ret
  36192. if err := gensupport.DecodeResponse(target, res); err != nil {
  36193. return nil, err
  36194. }
  36195. return ret, nil
  36196. // {
  36197. // "description": "Returns permissions that a caller has on the specified resource.",
  36198. // "httpMethod": "POST",
  36199. // "id": "compute.firewalls.testIamPermissions",
  36200. // "parameterOrder": [
  36201. // "project",
  36202. // "resource"
  36203. // ],
  36204. // "parameters": {
  36205. // "project": {
  36206. // "description": "Project ID for this request.",
  36207. // "location": "path",
  36208. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  36209. // "required": true,
  36210. // "type": "string"
  36211. // },
  36212. // "resource": {
  36213. // "description": "Name of the resource for this request.",
  36214. // "location": "path",
  36215. // "pattern": "(?:[-a-z0-9_]{0,62}[a-z0-9])?",
  36216. // "required": true,
  36217. // "type": "string"
  36218. // }
  36219. // },
  36220. // "path": "{project}/global/firewalls/{resource}/testIamPermissions",
  36221. // "request": {
  36222. // "$ref": "TestPermissionsRequest"
  36223. // },
  36224. // "response": {
  36225. // "$ref": "TestPermissionsResponse"
  36226. // },
  36227. // "scopes": [
  36228. // "https://www.googleapis.com/auth/cloud-platform",
  36229. // "https://www.googleapis.com/auth/compute",
  36230. // "https://www.googleapis.com/auth/compute.readonly"
  36231. // ]
  36232. // }
  36233. }
  36234. // method id "compute.firewalls.update":
  36235. type FirewallsUpdateCall struct {
  36236. s *Service
  36237. project string
  36238. firewall string
  36239. firewall2 *Firewall
  36240. urlParams_ gensupport.URLParams
  36241. ctx_ context.Context
  36242. header_ http.Header
  36243. }
  36244. // Update: Updates the specified firewall rule with the data included in
  36245. // the request. The PUT method can only update the following fields of
  36246. // firewall rule: allowed, description, sourceRanges, sourceTags,
  36247. // targetTags.
  36248. // For details, see https://cloud.google.com/compute/docs/reference/latest/firewalls/update
  36249. func (r *FirewallsService) Update(project string, firewall string, firewall2 *Firewall) *FirewallsUpdateCall {
  36250. c := &FirewallsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  36251. c.project = project
  36252. c.firewall = firewall
  36253. c.firewall2 = firewall2
  36254. return c
  36255. }
  36256. // RequestId sets the optional parameter "requestId": An optional
  36257. // request ID to identify requests. Specify a unique request ID so that
  36258. // if you must retry your request, the server will know to ignore the
  36259. // request if it has already been completed.
  36260. //
  36261. // For example, consider a situation where you make an initial request
  36262. // and the request times out. If you make the request again with the
  36263. // same request ID, the server can check if original operation with the
  36264. // same request ID was received, and if so, will ignore the second
  36265. // request. This prevents clients from accidentally creating duplicate
  36266. // commitments.
  36267. //
  36268. // The request ID must be a valid UUID with the exception that zero UUID
  36269. // is not supported (00000000-0000-0000-0000-000000000000).
  36270. func (c *FirewallsUpdateCall) RequestId(requestId string) *FirewallsUpdateCall {
  36271. c.urlParams_.Set("requestId", requestId)
  36272. return c
  36273. }
  36274. // Fields allows partial responses to be retrieved. See
  36275. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  36276. // for more information.
  36277. func (c *FirewallsUpdateCall) Fields(s ...googleapi.Field) *FirewallsUpdateCall {
  36278. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  36279. return c
  36280. }
  36281. // Context sets the context to be used in this call's Do method. Any
  36282. // pending HTTP request will be aborted if the provided context is
  36283. // canceled.
  36284. func (c *FirewallsUpdateCall) Context(ctx context.Context) *FirewallsUpdateCall {
  36285. c.ctx_ = ctx
  36286. return c
  36287. }
  36288. // Header returns an http.Header that can be modified by the caller to
  36289. // add HTTP headers to the request.
  36290. func (c *FirewallsUpdateCall) Header() http.Header {
  36291. if c.header_ == nil {
  36292. c.header_ = make(http.Header)
  36293. }
  36294. return c.header_
  36295. }
  36296. func (c *FirewallsUpdateCall) doRequest(alt string) (*http.Response, error) {
  36297. reqHeaders := make(http.Header)
  36298. for k, v := range c.header_ {
  36299. reqHeaders[k] = v
  36300. }
  36301. reqHeaders.Set("User-Agent", c.s.userAgent())
  36302. var body io.Reader = nil
  36303. body, err := googleapi.WithoutDataWrapper.JSONReader(c.firewall2)
  36304. if err != nil {
  36305. return nil, err
  36306. }
  36307. reqHeaders.Set("Content-Type", "application/json")
  36308. c.urlParams_.Set("alt", alt)
  36309. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/firewalls/{firewall}")
  36310. urls += "?" + c.urlParams_.Encode()
  36311. req, _ := http.NewRequest("PUT", urls, body)
  36312. req.Header = reqHeaders
  36313. googleapi.Expand(req.URL, map[string]string{
  36314. "project": c.project,
  36315. "firewall": c.firewall,
  36316. })
  36317. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  36318. }
  36319. // Do executes the "compute.firewalls.update" call.
  36320. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  36321. // status code is an error. Response headers are in either
  36322. // *Operation.ServerResponse.Header or (if a response was returned at
  36323. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  36324. // to check whether the returned error was because
  36325. // http.StatusNotModified was returned.
  36326. func (c *FirewallsUpdateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  36327. gensupport.SetOptions(c.urlParams_, opts...)
  36328. res, err := c.doRequest("json")
  36329. if res != nil && res.StatusCode == http.StatusNotModified {
  36330. if res.Body != nil {
  36331. res.Body.Close()
  36332. }
  36333. return nil, &googleapi.Error{
  36334. Code: res.StatusCode,
  36335. Header: res.Header,
  36336. }
  36337. }
  36338. if err != nil {
  36339. return nil, err
  36340. }
  36341. defer googleapi.CloseBody(res)
  36342. if err := googleapi.CheckResponse(res); err != nil {
  36343. return nil, err
  36344. }
  36345. ret := &Operation{
  36346. ServerResponse: googleapi.ServerResponse{
  36347. Header: res.Header,
  36348. HTTPStatusCode: res.StatusCode,
  36349. },
  36350. }
  36351. target := &ret
  36352. if err := gensupport.DecodeResponse(target, res); err != nil {
  36353. return nil, err
  36354. }
  36355. return ret, nil
  36356. // {
  36357. // "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.",
  36358. // "httpMethod": "PUT",
  36359. // "id": "compute.firewalls.update",
  36360. // "parameterOrder": [
  36361. // "project",
  36362. // "firewall"
  36363. // ],
  36364. // "parameters": {
  36365. // "firewall": {
  36366. // "description": "Name of the firewall rule to update.",
  36367. // "location": "path",
  36368. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  36369. // "required": true,
  36370. // "type": "string"
  36371. // },
  36372. // "project": {
  36373. // "description": "Project ID for this request.",
  36374. // "location": "path",
  36375. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  36376. // "required": true,
  36377. // "type": "string"
  36378. // },
  36379. // "requestId": {
  36380. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  36381. // "location": "query",
  36382. // "type": "string"
  36383. // }
  36384. // },
  36385. // "path": "{project}/global/firewalls/{firewall}",
  36386. // "request": {
  36387. // "$ref": "Firewall"
  36388. // },
  36389. // "response": {
  36390. // "$ref": "Operation"
  36391. // },
  36392. // "scopes": [
  36393. // "https://www.googleapis.com/auth/cloud-platform",
  36394. // "https://www.googleapis.com/auth/compute"
  36395. // ]
  36396. // }
  36397. }
  36398. // method id "compute.forwardingRules.aggregatedList":
  36399. type ForwardingRulesAggregatedListCall struct {
  36400. s *Service
  36401. project string
  36402. urlParams_ gensupport.URLParams
  36403. ifNoneMatch_ string
  36404. ctx_ context.Context
  36405. header_ http.Header
  36406. }
  36407. // AggregatedList: Retrieves an aggregated list of forwarding rules.
  36408. // For details, see https://cloud.google.com/compute/docs/reference/latest/forwardingRules/aggregatedList
  36409. func (r *ForwardingRulesService) AggregatedList(project string) *ForwardingRulesAggregatedListCall {
  36410. c := &ForwardingRulesAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  36411. c.project = project
  36412. return c
  36413. }
  36414. // Filter sets the optional parameter "filter": A filter expression that
  36415. // filters resources listed in the response. The expression must specify
  36416. // the field name, a comparison operator, and the value that you want to
  36417. // use for filtering. The value must be a string, a number, or a
  36418. // boolean. The comparison operator must be either =, !=, >, or <.
  36419. //
  36420. // For example, if you are filtering Compute Engine instances, you can
  36421. // exclude instances named example-instance by specifying name !=
  36422. // example-instance.
  36423. //
  36424. // You can also filter nested fields. For example, you could specify
  36425. // scheduling.automaticRestart = false to include instances only if they
  36426. // are not scheduled for automatic restarts. You can use filtering on
  36427. // nested fields to filter based on resource labels.
  36428. //
  36429. // To filter on multiple expressions, provide each separate expression
  36430. // within parentheses. For example, (scheduling.automaticRestart = true)
  36431. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  36432. // AND expression. However, you can include AND and OR expressions
  36433. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  36434. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  36435. // true).
  36436. func (c *ForwardingRulesAggregatedListCall) Filter(filter string) *ForwardingRulesAggregatedListCall {
  36437. c.urlParams_.Set("filter", filter)
  36438. return c
  36439. }
  36440. // MaxResults sets the optional parameter "maxResults": The maximum
  36441. // number of results per page that should be returned. If the number of
  36442. // available results is larger than maxResults, Compute Engine returns a
  36443. // nextPageToken that can be used to get the next page of results in
  36444. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  36445. // (Default: 500)
  36446. func (c *ForwardingRulesAggregatedListCall) MaxResults(maxResults int64) *ForwardingRulesAggregatedListCall {
  36447. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  36448. return c
  36449. }
  36450. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  36451. // a certain order. By default, results are returned in alphanumerical
  36452. // order based on the resource name.
  36453. //
  36454. // You can also sort results in descending order based on the creation
  36455. // timestamp using orderBy="creationTimestamp desc". This sorts results
  36456. // based on the creationTimestamp field in reverse chronological order
  36457. // (newest result first). Use this to sort resources like operations so
  36458. // that the newest operation is returned first.
  36459. //
  36460. // Currently, only sorting by name or creationTimestamp desc is
  36461. // supported.
  36462. func (c *ForwardingRulesAggregatedListCall) OrderBy(orderBy string) *ForwardingRulesAggregatedListCall {
  36463. c.urlParams_.Set("orderBy", orderBy)
  36464. return c
  36465. }
  36466. // PageToken sets the optional parameter "pageToken": Specifies a page
  36467. // token to use. Set pageToken to the nextPageToken returned by a
  36468. // previous list request to get the next page of results.
  36469. func (c *ForwardingRulesAggregatedListCall) PageToken(pageToken string) *ForwardingRulesAggregatedListCall {
  36470. c.urlParams_.Set("pageToken", pageToken)
  36471. return c
  36472. }
  36473. // Fields allows partial responses to be retrieved. See
  36474. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  36475. // for more information.
  36476. func (c *ForwardingRulesAggregatedListCall) Fields(s ...googleapi.Field) *ForwardingRulesAggregatedListCall {
  36477. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  36478. return c
  36479. }
  36480. // IfNoneMatch sets the optional parameter which makes the operation
  36481. // fail if the object's ETag matches the given value. This is useful for
  36482. // getting updates only after the object has changed since the last
  36483. // request. Use googleapi.IsNotModified to check whether the response
  36484. // error from Do is the result of In-None-Match.
  36485. func (c *ForwardingRulesAggregatedListCall) IfNoneMatch(entityTag string) *ForwardingRulesAggregatedListCall {
  36486. c.ifNoneMatch_ = entityTag
  36487. return c
  36488. }
  36489. // Context sets the context to be used in this call's Do method. Any
  36490. // pending HTTP request will be aborted if the provided context is
  36491. // canceled.
  36492. func (c *ForwardingRulesAggregatedListCall) Context(ctx context.Context) *ForwardingRulesAggregatedListCall {
  36493. c.ctx_ = ctx
  36494. return c
  36495. }
  36496. // Header returns an http.Header that can be modified by the caller to
  36497. // add HTTP headers to the request.
  36498. func (c *ForwardingRulesAggregatedListCall) Header() http.Header {
  36499. if c.header_ == nil {
  36500. c.header_ = make(http.Header)
  36501. }
  36502. return c.header_
  36503. }
  36504. func (c *ForwardingRulesAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  36505. reqHeaders := make(http.Header)
  36506. for k, v := range c.header_ {
  36507. reqHeaders[k] = v
  36508. }
  36509. reqHeaders.Set("User-Agent", c.s.userAgent())
  36510. if c.ifNoneMatch_ != "" {
  36511. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  36512. }
  36513. var body io.Reader = nil
  36514. c.urlParams_.Set("alt", alt)
  36515. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/forwardingRules")
  36516. urls += "?" + c.urlParams_.Encode()
  36517. req, _ := http.NewRequest("GET", urls, body)
  36518. req.Header = reqHeaders
  36519. googleapi.Expand(req.URL, map[string]string{
  36520. "project": c.project,
  36521. })
  36522. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  36523. }
  36524. // Do executes the "compute.forwardingRules.aggregatedList" call.
  36525. // Exactly one of *ForwardingRuleAggregatedList or error will be
  36526. // non-nil. Any non-2xx status code is an error. Response headers are in
  36527. // either *ForwardingRuleAggregatedList.ServerResponse.Header or (if a
  36528. // response was returned at all) in error.(*googleapi.Error).Header. Use
  36529. // googleapi.IsNotModified to check whether the returned error was
  36530. // because http.StatusNotModified was returned.
  36531. func (c *ForwardingRulesAggregatedListCall) Do(opts ...googleapi.CallOption) (*ForwardingRuleAggregatedList, error) {
  36532. gensupport.SetOptions(c.urlParams_, opts...)
  36533. res, err := c.doRequest("json")
  36534. if res != nil && res.StatusCode == http.StatusNotModified {
  36535. if res.Body != nil {
  36536. res.Body.Close()
  36537. }
  36538. return nil, &googleapi.Error{
  36539. Code: res.StatusCode,
  36540. Header: res.Header,
  36541. }
  36542. }
  36543. if err != nil {
  36544. return nil, err
  36545. }
  36546. defer googleapi.CloseBody(res)
  36547. if err := googleapi.CheckResponse(res); err != nil {
  36548. return nil, err
  36549. }
  36550. ret := &ForwardingRuleAggregatedList{
  36551. ServerResponse: googleapi.ServerResponse{
  36552. Header: res.Header,
  36553. HTTPStatusCode: res.StatusCode,
  36554. },
  36555. }
  36556. target := &ret
  36557. if err := gensupport.DecodeResponse(target, res); err != nil {
  36558. return nil, err
  36559. }
  36560. return ret, nil
  36561. // {
  36562. // "description": "Retrieves an aggregated list of forwarding rules.",
  36563. // "httpMethod": "GET",
  36564. // "id": "compute.forwardingRules.aggregatedList",
  36565. // "parameterOrder": [
  36566. // "project"
  36567. // ],
  36568. // "parameters": {
  36569. // "filter": {
  36570. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  36571. // "location": "query",
  36572. // "type": "string"
  36573. // },
  36574. // "maxResults": {
  36575. // "default": "500",
  36576. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  36577. // "format": "uint32",
  36578. // "location": "query",
  36579. // "minimum": "0",
  36580. // "type": "integer"
  36581. // },
  36582. // "orderBy": {
  36583. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  36584. // "location": "query",
  36585. // "type": "string"
  36586. // },
  36587. // "pageToken": {
  36588. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  36589. // "location": "query",
  36590. // "type": "string"
  36591. // },
  36592. // "project": {
  36593. // "description": "Project ID for this request.",
  36594. // "location": "path",
  36595. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  36596. // "required": true,
  36597. // "type": "string"
  36598. // }
  36599. // },
  36600. // "path": "{project}/aggregated/forwardingRules",
  36601. // "response": {
  36602. // "$ref": "ForwardingRuleAggregatedList"
  36603. // },
  36604. // "scopes": [
  36605. // "https://www.googleapis.com/auth/cloud-platform",
  36606. // "https://www.googleapis.com/auth/compute",
  36607. // "https://www.googleapis.com/auth/compute.readonly"
  36608. // ]
  36609. // }
  36610. }
  36611. // Pages invokes f for each page of results.
  36612. // A non-nil error returned from f will halt the iteration.
  36613. // The provided context supersedes any context provided to the Context method.
  36614. func (c *ForwardingRulesAggregatedListCall) Pages(ctx context.Context, f func(*ForwardingRuleAggregatedList) error) error {
  36615. c.ctx_ = ctx
  36616. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  36617. for {
  36618. x, err := c.Do()
  36619. if err != nil {
  36620. return err
  36621. }
  36622. if err := f(x); err != nil {
  36623. return err
  36624. }
  36625. if x.NextPageToken == "" {
  36626. return nil
  36627. }
  36628. c.PageToken(x.NextPageToken)
  36629. }
  36630. }
  36631. // method id "compute.forwardingRules.delete":
  36632. type ForwardingRulesDeleteCall struct {
  36633. s *Service
  36634. project string
  36635. region string
  36636. forwardingRule string
  36637. urlParams_ gensupport.URLParams
  36638. ctx_ context.Context
  36639. header_ http.Header
  36640. }
  36641. // Delete: Deletes the specified ForwardingRule resource.
  36642. // For details, see https://cloud.google.com/compute/docs/reference/latest/forwardingRules/delete
  36643. func (r *ForwardingRulesService) Delete(project string, region string, forwardingRule string) *ForwardingRulesDeleteCall {
  36644. c := &ForwardingRulesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  36645. c.project = project
  36646. c.region = region
  36647. c.forwardingRule = forwardingRule
  36648. return c
  36649. }
  36650. // RequestId sets the optional parameter "requestId": An optional
  36651. // request ID to identify requests. Specify a unique request ID so that
  36652. // if you must retry your request, the server will know to ignore the
  36653. // request if it has already been completed.
  36654. //
  36655. // For example, consider a situation where you make an initial request
  36656. // and the request times out. If you make the request again with the
  36657. // same request ID, the server can check if original operation with the
  36658. // same request ID was received, and if so, will ignore the second
  36659. // request. This prevents clients from accidentally creating duplicate
  36660. // commitments.
  36661. //
  36662. // The request ID must be a valid UUID with the exception that zero UUID
  36663. // is not supported (00000000-0000-0000-0000-000000000000).
  36664. func (c *ForwardingRulesDeleteCall) RequestId(requestId string) *ForwardingRulesDeleteCall {
  36665. c.urlParams_.Set("requestId", requestId)
  36666. return c
  36667. }
  36668. // Fields allows partial responses to be retrieved. See
  36669. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  36670. // for more information.
  36671. func (c *ForwardingRulesDeleteCall) Fields(s ...googleapi.Field) *ForwardingRulesDeleteCall {
  36672. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  36673. return c
  36674. }
  36675. // Context sets the context to be used in this call's Do method. Any
  36676. // pending HTTP request will be aborted if the provided context is
  36677. // canceled.
  36678. func (c *ForwardingRulesDeleteCall) Context(ctx context.Context) *ForwardingRulesDeleteCall {
  36679. c.ctx_ = ctx
  36680. return c
  36681. }
  36682. // Header returns an http.Header that can be modified by the caller to
  36683. // add HTTP headers to the request.
  36684. func (c *ForwardingRulesDeleteCall) Header() http.Header {
  36685. if c.header_ == nil {
  36686. c.header_ = make(http.Header)
  36687. }
  36688. return c.header_
  36689. }
  36690. func (c *ForwardingRulesDeleteCall) doRequest(alt string) (*http.Response, error) {
  36691. reqHeaders := make(http.Header)
  36692. for k, v := range c.header_ {
  36693. reqHeaders[k] = v
  36694. }
  36695. reqHeaders.Set("User-Agent", c.s.userAgent())
  36696. var body io.Reader = nil
  36697. c.urlParams_.Set("alt", alt)
  36698. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/forwardingRules/{forwardingRule}")
  36699. urls += "?" + c.urlParams_.Encode()
  36700. req, _ := http.NewRequest("DELETE", urls, body)
  36701. req.Header = reqHeaders
  36702. googleapi.Expand(req.URL, map[string]string{
  36703. "project": c.project,
  36704. "region": c.region,
  36705. "forwardingRule": c.forwardingRule,
  36706. })
  36707. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  36708. }
  36709. // Do executes the "compute.forwardingRules.delete" call.
  36710. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  36711. // status code is an error. Response headers are in either
  36712. // *Operation.ServerResponse.Header or (if a response was returned at
  36713. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  36714. // to check whether the returned error was because
  36715. // http.StatusNotModified was returned.
  36716. func (c *ForwardingRulesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  36717. gensupport.SetOptions(c.urlParams_, opts...)
  36718. res, err := c.doRequest("json")
  36719. if res != nil && res.StatusCode == http.StatusNotModified {
  36720. if res.Body != nil {
  36721. res.Body.Close()
  36722. }
  36723. return nil, &googleapi.Error{
  36724. Code: res.StatusCode,
  36725. Header: res.Header,
  36726. }
  36727. }
  36728. if err != nil {
  36729. return nil, err
  36730. }
  36731. defer googleapi.CloseBody(res)
  36732. if err := googleapi.CheckResponse(res); err != nil {
  36733. return nil, err
  36734. }
  36735. ret := &Operation{
  36736. ServerResponse: googleapi.ServerResponse{
  36737. Header: res.Header,
  36738. HTTPStatusCode: res.StatusCode,
  36739. },
  36740. }
  36741. target := &ret
  36742. if err := gensupport.DecodeResponse(target, res); err != nil {
  36743. return nil, err
  36744. }
  36745. return ret, nil
  36746. // {
  36747. // "description": "Deletes the specified ForwardingRule resource.",
  36748. // "httpMethod": "DELETE",
  36749. // "id": "compute.forwardingRules.delete",
  36750. // "parameterOrder": [
  36751. // "project",
  36752. // "region",
  36753. // "forwardingRule"
  36754. // ],
  36755. // "parameters": {
  36756. // "forwardingRule": {
  36757. // "description": "Name of the ForwardingRule resource to delete.",
  36758. // "location": "path",
  36759. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  36760. // "required": true,
  36761. // "type": "string"
  36762. // },
  36763. // "project": {
  36764. // "description": "Project ID for this request.",
  36765. // "location": "path",
  36766. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  36767. // "required": true,
  36768. // "type": "string"
  36769. // },
  36770. // "region": {
  36771. // "description": "Name of the region scoping this request.",
  36772. // "location": "path",
  36773. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  36774. // "required": true,
  36775. // "type": "string"
  36776. // },
  36777. // "requestId": {
  36778. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  36779. // "location": "query",
  36780. // "type": "string"
  36781. // }
  36782. // },
  36783. // "path": "{project}/regions/{region}/forwardingRules/{forwardingRule}",
  36784. // "response": {
  36785. // "$ref": "Operation"
  36786. // },
  36787. // "scopes": [
  36788. // "https://www.googleapis.com/auth/cloud-platform",
  36789. // "https://www.googleapis.com/auth/compute"
  36790. // ]
  36791. // }
  36792. }
  36793. // method id "compute.forwardingRules.get":
  36794. type ForwardingRulesGetCall struct {
  36795. s *Service
  36796. project string
  36797. region string
  36798. forwardingRule string
  36799. urlParams_ gensupport.URLParams
  36800. ifNoneMatch_ string
  36801. ctx_ context.Context
  36802. header_ http.Header
  36803. }
  36804. // Get: Returns the specified ForwardingRule resource.
  36805. // For details, see https://cloud.google.com/compute/docs/reference/latest/forwardingRules/get
  36806. func (r *ForwardingRulesService) Get(project string, region string, forwardingRule string) *ForwardingRulesGetCall {
  36807. c := &ForwardingRulesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  36808. c.project = project
  36809. c.region = region
  36810. c.forwardingRule = forwardingRule
  36811. return c
  36812. }
  36813. // Fields allows partial responses to be retrieved. See
  36814. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  36815. // for more information.
  36816. func (c *ForwardingRulesGetCall) Fields(s ...googleapi.Field) *ForwardingRulesGetCall {
  36817. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  36818. return c
  36819. }
  36820. // IfNoneMatch sets the optional parameter which makes the operation
  36821. // fail if the object's ETag matches the given value. This is useful for
  36822. // getting updates only after the object has changed since the last
  36823. // request. Use googleapi.IsNotModified to check whether the response
  36824. // error from Do is the result of In-None-Match.
  36825. func (c *ForwardingRulesGetCall) IfNoneMatch(entityTag string) *ForwardingRulesGetCall {
  36826. c.ifNoneMatch_ = entityTag
  36827. return c
  36828. }
  36829. // Context sets the context to be used in this call's Do method. Any
  36830. // pending HTTP request will be aborted if the provided context is
  36831. // canceled.
  36832. func (c *ForwardingRulesGetCall) Context(ctx context.Context) *ForwardingRulesGetCall {
  36833. c.ctx_ = ctx
  36834. return c
  36835. }
  36836. // Header returns an http.Header that can be modified by the caller to
  36837. // add HTTP headers to the request.
  36838. func (c *ForwardingRulesGetCall) Header() http.Header {
  36839. if c.header_ == nil {
  36840. c.header_ = make(http.Header)
  36841. }
  36842. return c.header_
  36843. }
  36844. func (c *ForwardingRulesGetCall) doRequest(alt string) (*http.Response, error) {
  36845. reqHeaders := make(http.Header)
  36846. for k, v := range c.header_ {
  36847. reqHeaders[k] = v
  36848. }
  36849. reqHeaders.Set("User-Agent", c.s.userAgent())
  36850. if c.ifNoneMatch_ != "" {
  36851. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  36852. }
  36853. var body io.Reader = nil
  36854. c.urlParams_.Set("alt", alt)
  36855. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/forwardingRules/{forwardingRule}")
  36856. urls += "?" + c.urlParams_.Encode()
  36857. req, _ := http.NewRequest("GET", urls, body)
  36858. req.Header = reqHeaders
  36859. googleapi.Expand(req.URL, map[string]string{
  36860. "project": c.project,
  36861. "region": c.region,
  36862. "forwardingRule": c.forwardingRule,
  36863. })
  36864. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  36865. }
  36866. // Do executes the "compute.forwardingRules.get" call.
  36867. // Exactly one of *ForwardingRule or error will be non-nil. Any non-2xx
  36868. // status code is an error. Response headers are in either
  36869. // *ForwardingRule.ServerResponse.Header or (if a response was returned
  36870. // at all) in error.(*googleapi.Error).Header. Use
  36871. // googleapi.IsNotModified to check whether the returned error was
  36872. // because http.StatusNotModified was returned.
  36873. func (c *ForwardingRulesGetCall) Do(opts ...googleapi.CallOption) (*ForwardingRule, error) {
  36874. gensupport.SetOptions(c.urlParams_, opts...)
  36875. res, err := c.doRequest("json")
  36876. if res != nil && res.StatusCode == http.StatusNotModified {
  36877. if res.Body != nil {
  36878. res.Body.Close()
  36879. }
  36880. return nil, &googleapi.Error{
  36881. Code: res.StatusCode,
  36882. Header: res.Header,
  36883. }
  36884. }
  36885. if err != nil {
  36886. return nil, err
  36887. }
  36888. defer googleapi.CloseBody(res)
  36889. if err := googleapi.CheckResponse(res); err != nil {
  36890. return nil, err
  36891. }
  36892. ret := &ForwardingRule{
  36893. ServerResponse: googleapi.ServerResponse{
  36894. Header: res.Header,
  36895. HTTPStatusCode: res.StatusCode,
  36896. },
  36897. }
  36898. target := &ret
  36899. if err := gensupport.DecodeResponse(target, res); err != nil {
  36900. return nil, err
  36901. }
  36902. return ret, nil
  36903. // {
  36904. // "description": "Returns the specified ForwardingRule resource.",
  36905. // "httpMethod": "GET",
  36906. // "id": "compute.forwardingRules.get",
  36907. // "parameterOrder": [
  36908. // "project",
  36909. // "region",
  36910. // "forwardingRule"
  36911. // ],
  36912. // "parameters": {
  36913. // "forwardingRule": {
  36914. // "description": "Name of the ForwardingRule resource to return.",
  36915. // "location": "path",
  36916. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  36917. // "required": true,
  36918. // "type": "string"
  36919. // },
  36920. // "project": {
  36921. // "description": "Project ID for this request.",
  36922. // "location": "path",
  36923. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  36924. // "required": true,
  36925. // "type": "string"
  36926. // },
  36927. // "region": {
  36928. // "description": "Name of the region scoping this request.",
  36929. // "location": "path",
  36930. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  36931. // "required": true,
  36932. // "type": "string"
  36933. // }
  36934. // },
  36935. // "path": "{project}/regions/{region}/forwardingRules/{forwardingRule}",
  36936. // "response": {
  36937. // "$ref": "ForwardingRule"
  36938. // },
  36939. // "scopes": [
  36940. // "https://www.googleapis.com/auth/cloud-platform",
  36941. // "https://www.googleapis.com/auth/compute",
  36942. // "https://www.googleapis.com/auth/compute.readonly"
  36943. // ]
  36944. // }
  36945. }
  36946. // method id "compute.forwardingRules.insert":
  36947. type ForwardingRulesInsertCall struct {
  36948. s *Service
  36949. project string
  36950. region string
  36951. forwardingrule *ForwardingRule
  36952. urlParams_ gensupport.URLParams
  36953. ctx_ context.Context
  36954. header_ http.Header
  36955. }
  36956. // Insert: Creates a ForwardingRule resource in the specified project
  36957. // and region using the data included in the request.
  36958. // For details, see https://cloud.google.com/compute/docs/reference/latest/forwardingRules/insert
  36959. func (r *ForwardingRulesService) Insert(project string, region string, forwardingrule *ForwardingRule) *ForwardingRulesInsertCall {
  36960. c := &ForwardingRulesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  36961. c.project = project
  36962. c.region = region
  36963. c.forwardingrule = forwardingrule
  36964. return c
  36965. }
  36966. // RequestId sets the optional parameter "requestId": An optional
  36967. // request ID to identify requests. Specify a unique request ID so that
  36968. // if you must retry your request, the server will know to ignore the
  36969. // request if it has already been completed.
  36970. //
  36971. // For example, consider a situation where you make an initial request
  36972. // and the request times out. If you make the request again with the
  36973. // same request ID, the server can check if original operation with the
  36974. // same request ID was received, and if so, will ignore the second
  36975. // request. This prevents clients from accidentally creating duplicate
  36976. // commitments.
  36977. //
  36978. // The request ID must be a valid UUID with the exception that zero UUID
  36979. // is not supported (00000000-0000-0000-0000-000000000000).
  36980. func (c *ForwardingRulesInsertCall) RequestId(requestId string) *ForwardingRulesInsertCall {
  36981. c.urlParams_.Set("requestId", requestId)
  36982. return c
  36983. }
  36984. // Fields allows partial responses to be retrieved. See
  36985. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  36986. // for more information.
  36987. func (c *ForwardingRulesInsertCall) Fields(s ...googleapi.Field) *ForwardingRulesInsertCall {
  36988. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  36989. return c
  36990. }
  36991. // Context sets the context to be used in this call's Do method. Any
  36992. // pending HTTP request will be aborted if the provided context is
  36993. // canceled.
  36994. func (c *ForwardingRulesInsertCall) Context(ctx context.Context) *ForwardingRulesInsertCall {
  36995. c.ctx_ = ctx
  36996. return c
  36997. }
  36998. // Header returns an http.Header that can be modified by the caller to
  36999. // add HTTP headers to the request.
  37000. func (c *ForwardingRulesInsertCall) Header() http.Header {
  37001. if c.header_ == nil {
  37002. c.header_ = make(http.Header)
  37003. }
  37004. return c.header_
  37005. }
  37006. func (c *ForwardingRulesInsertCall) doRequest(alt string) (*http.Response, error) {
  37007. reqHeaders := make(http.Header)
  37008. for k, v := range c.header_ {
  37009. reqHeaders[k] = v
  37010. }
  37011. reqHeaders.Set("User-Agent", c.s.userAgent())
  37012. var body io.Reader = nil
  37013. body, err := googleapi.WithoutDataWrapper.JSONReader(c.forwardingrule)
  37014. if err != nil {
  37015. return nil, err
  37016. }
  37017. reqHeaders.Set("Content-Type", "application/json")
  37018. c.urlParams_.Set("alt", alt)
  37019. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/forwardingRules")
  37020. urls += "?" + c.urlParams_.Encode()
  37021. req, _ := http.NewRequest("POST", urls, body)
  37022. req.Header = reqHeaders
  37023. googleapi.Expand(req.URL, map[string]string{
  37024. "project": c.project,
  37025. "region": c.region,
  37026. })
  37027. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  37028. }
  37029. // Do executes the "compute.forwardingRules.insert" call.
  37030. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  37031. // status code is an error. Response headers are in either
  37032. // *Operation.ServerResponse.Header or (if a response was returned at
  37033. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  37034. // to check whether the returned error was because
  37035. // http.StatusNotModified was returned.
  37036. func (c *ForwardingRulesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  37037. gensupport.SetOptions(c.urlParams_, opts...)
  37038. res, err := c.doRequest("json")
  37039. if res != nil && res.StatusCode == http.StatusNotModified {
  37040. if res.Body != nil {
  37041. res.Body.Close()
  37042. }
  37043. return nil, &googleapi.Error{
  37044. Code: res.StatusCode,
  37045. Header: res.Header,
  37046. }
  37047. }
  37048. if err != nil {
  37049. return nil, err
  37050. }
  37051. defer googleapi.CloseBody(res)
  37052. if err := googleapi.CheckResponse(res); err != nil {
  37053. return nil, err
  37054. }
  37055. ret := &Operation{
  37056. ServerResponse: googleapi.ServerResponse{
  37057. Header: res.Header,
  37058. HTTPStatusCode: res.StatusCode,
  37059. },
  37060. }
  37061. target := &ret
  37062. if err := gensupport.DecodeResponse(target, res); err != nil {
  37063. return nil, err
  37064. }
  37065. return ret, nil
  37066. // {
  37067. // "description": "Creates a ForwardingRule resource in the specified project and region using the data included in the request.",
  37068. // "httpMethod": "POST",
  37069. // "id": "compute.forwardingRules.insert",
  37070. // "parameterOrder": [
  37071. // "project",
  37072. // "region"
  37073. // ],
  37074. // "parameters": {
  37075. // "project": {
  37076. // "description": "Project ID for this request.",
  37077. // "location": "path",
  37078. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  37079. // "required": true,
  37080. // "type": "string"
  37081. // },
  37082. // "region": {
  37083. // "description": "Name of the region scoping this request.",
  37084. // "location": "path",
  37085. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  37086. // "required": true,
  37087. // "type": "string"
  37088. // },
  37089. // "requestId": {
  37090. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  37091. // "location": "query",
  37092. // "type": "string"
  37093. // }
  37094. // },
  37095. // "path": "{project}/regions/{region}/forwardingRules",
  37096. // "request": {
  37097. // "$ref": "ForwardingRule"
  37098. // },
  37099. // "response": {
  37100. // "$ref": "Operation"
  37101. // },
  37102. // "scopes": [
  37103. // "https://www.googleapis.com/auth/cloud-platform",
  37104. // "https://www.googleapis.com/auth/compute"
  37105. // ]
  37106. // }
  37107. }
  37108. // method id "compute.forwardingRules.list":
  37109. type ForwardingRulesListCall struct {
  37110. s *Service
  37111. project string
  37112. region string
  37113. urlParams_ gensupport.URLParams
  37114. ifNoneMatch_ string
  37115. ctx_ context.Context
  37116. header_ http.Header
  37117. }
  37118. // List: Retrieves a list of ForwardingRule resources available to the
  37119. // specified project and region.
  37120. // For details, see https://cloud.google.com/compute/docs/reference/latest/forwardingRules/list
  37121. func (r *ForwardingRulesService) List(project string, region string) *ForwardingRulesListCall {
  37122. c := &ForwardingRulesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  37123. c.project = project
  37124. c.region = region
  37125. return c
  37126. }
  37127. // Filter sets the optional parameter "filter": A filter expression that
  37128. // filters resources listed in the response. The expression must specify
  37129. // the field name, a comparison operator, and the value that you want to
  37130. // use for filtering. The value must be a string, a number, or a
  37131. // boolean. The comparison operator must be either =, !=, >, or <.
  37132. //
  37133. // For example, if you are filtering Compute Engine instances, you can
  37134. // exclude instances named example-instance by specifying name !=
  37135. // example-instance.
  37136. //
  37137. // You can also filter nested fields. For example, you could specify
  37138. // scheduling.automaticRestart = false to include instances only if they
  37139. // are not scheduled for automatic restarts. You can use filtering on
  37140. // nested fields to filter based on resource labels.
  37141. //
  37142. // To filter on multiple expressions, provide each separate expression
  37143. // within parentheses. For example, (scheduling.automaticRestart = true)
  37144. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  37145. // AND expression. However, you can include AND and OR expressions
  37146. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  37147. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  37148. // true).
  37149. func (c *ForwardingRulesListCall) Filter(filter string) *ForwardingRulesListCall {
  37150. c.urlParams_.Set("filter", filter)
  37151. return c
  37152. }
  37153. // MaxResults sets the optional parameter "maxResults": The maximum
  37154. // number of results per page that should be returned. If the number of
  37155. // available results is larger than maxResults, Compute Engine returns a
  37156. // nextPageToken that can be used to get the next page of results in
  37157. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  37158. // (Default: 500)
  37159. func (c *ForwardingRulesListCall) MaxResults(maxResults int64) *ForwardingRulesListCall {
  37160. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  37161. return c
  37162. }
  37163. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  37164. // a certain order. By default, results are returned in alphanumerical
  37165. // order based on the resource name.
  37166. //
  37167. // You can also sort results in descending order based on the creation
  37168. // timestamp using orderBy="creationTimestamp desc". This sorts results
  37169. // based on the creationTimestamp field in reverse chronological order
  37170. // (newest result first). Use this to sort resources like operations so
  37171. // that the newest operation is returned first.
  37172. //
  37173. // Currently, only sorting by name or creationTimestamp desc is
  37174. // supported.
  37175. func (c *ForwardingRulesListCall) OrderBy(orderBy string) *ForwardingRulesListCall {
  37176. c.urlParams_.Set("orderBy", orderBy)
  37177. return c
  37178. }
  37179. // PageToken sets the optional parameter "pageToken": Specifies a page
  37180. // token to use. Set pageToken to the nextPageToken returned by a
  37181. // previous list request to get the next page of results.
  37182. func (c *ForwardingRulesListCall) PageToken(pageToken string) *ForwardingRulesListCall {
  37183. c.urlParams_.Set("pageToken", pageToken)
  37184. return c
  37185. }
  37186. // Fields allows partial responses to be retrieved. See
  37187. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  37188. // for more information.
  37189. func (c *ForwardingRulesListCall) Fields(s ...googleapi.Field) *ForwardingRulesListCall {
  37190. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  37191. return c
  37192. }
  37193. // IfNoneMatch sets the optional parameter which makes the operation
  37194. // fail if the object's ETag matches the given value. This is useful for
  37195. // getting updates only after the object has changed since the last
  37196. // request. Use googleapi.IsNotModified to check whether the response
  37197. // error from Do is the result of In-None-Match.
  37198. func (c *ForwardingRulesListCall) IfNoneMatch(entityTag string) *ForwardingRulesListCall {
  37199. c.ifNoneMatch_ = entityTag
  37200. return c
  37201. }
  37202. // Context sets the context to be used in this call's Do method. Any
  37203. // pending HTTP request will be aborted if the provided context is
  37204. // canceled.
  37205. func (c *ForwardingRulesListCall) Context(ctx context.Context) *ForwardingRulesListCall {
  37206. c.ctx_ = ctx
  37207. return c
  37208. }
  37209. // Header returns an http.Header that can be modified by the caller to
  37210. // add HTTP headers to the request.
  37211. func (c *ForwardingRulesListCall) Header() http.Header {
  37212. if c.header_ == nil {
  37213. c.header_ = make(http.Header)
  37214. }
  37215. return c.header_
  37216. }
  37217. func (c *ForwardingRulesListCall) doRequest(alt string) (*http.Response, error) {
  37218. reqHeaders := make(http.Header)
  37219. for k, v := range c.header_ {
  37220. reqHeaders[k] = v
  37221. }
  37222. reqHeaders.Set("User-Agent", c.s.userAgent())
  37223. if c.ifNoneMatch_ != "" {
  37224. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  37225. }
  37226. var body io.Reader = nil
  37227. c.urlParams_.Set("alt", alt)
  37228. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/forwardingRules")
  37229. urls += "?" + c.urlParams_.Encode()
  37230. req, _ := http.NewRequest("GET", urls, body)
  37231. req.Header = reqHeaders
  37232. googleapi.Expand(req.URL, map[string]string{
  37233. "project": c.project,
  37234. "region": c.region,
  37235. })
  37236. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  37237. }
  37238. // Do executes the "compute.forwardingRules.list" call.
  37239. // Exactly one of *ForwardingRuleList or error will be non-nil. Any
  37240. // non-2xx status code is an error. Response headers are in either
  37241. // *ForwardingRuleList.ServerResponse.Header or (if a response was
  37242. // returned at all) in error.(*googleapi.Error).Header. Use
  37243. // googleapi.IsNotModified to check whether the returned error was
  37244. // because http.StatusNotModified was returned.
  37245. func (c *ForwardingRulesListCall) Do(opts ...googleapi.CallOption) (*ForwardingRuleList, error) {
  37246. gensupport.SetOptions(c.urlParams_, opts...)
  37247. res, err := c.doRequest("json")
  37248. if res != nil && res.StatusCode == http.StatusNotModified {
  37249. if res.Body != nil {
  37250. res.Body.Close()
  37251. }
  37252. return nil, &googleapi.Error{
  37253. Code: res.StatusCode,
  37254. Header: res.Header,
  37255. }
  37256. }
  37257. if err != nil {
  37258. return nil, err
  37259. }
  37260. defer googleapi.CloseBody(res)
  37261. if err := googleapi.CheckResponse(res); err != nil {
  37262. return nil, err
  37263. }
  37264. ret := &ForwardingRuleList{
  37265. ServerResponse: googleapi.ServerResponse{
  37266. Header: res.Header,
  37267. HTTPStatusCode: res.StatusCode,
  37268. },
  37269. }
  37270. target := &ret
  37271. if err := gensupport.DecodeResponse(target, res); err != nil {
  37272. return nil, err
  37273. }
  37274. return ret, nil
  37275. // {
  37276. // "description": "Retrieves a list of ForwardingRule resources available to the specified project and region.",
  37277. // "httpMethod": "GET",
  37278. // "id": "compute.forwardingRules.list",
  37279. // "parameterOrder": [
  37280. // "project",
  37281. // "region"
  37282. // ],
  37283. // "parameters": {
  37284. // "filter": {
  37285. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  37286. // "location": "query",
  37287. // "type": "string"
  37288. // },
  37289. // "maxResults": {
  37290. // "default": "500",
  37291. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  37292. // "format": "uint32",
  37293. // "location": "query",
  37294. // "minimum": "0",
  37295. // "type": "integer"
  37296. // },
  37297. // "orderBy": {
  37298. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  37299. // "location": "query",
  37300. // "type": "string"
  37301. // },
  37302. // "pageToken": {
  37303. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  37304. // "location": "query",
  37305. // "type": "string"
  37306. // },
  37307. // "project": {
  37308. // "description": "Project ID for this request.",
  37309. // "location": "path",
  37310. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  37311. // "required": true,
  37312. // "type": "string"
  37313. // },
  37314. // "region": {
  37315. // "description": "Name of the region scoping this request.",
  37316. // "location": "path",
  37317. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  37318. // "required": true,
  37319. // "type": "string"
  37320. // }
  37321. // },
  37322. // "path": "{project}/regions/{region}/forwardingRules",
  37323. // "response": {
  37324. // "$ref": "ForwardingRuleList"
  37325. // },
  37326. // "scopes": [
  37327. // "https://www.googleapis.com/auth/cloud-platform",
  37328. // "https://www.googleapis.com/auth/compute",
  37329. // "https://www.googleapis.com/auth/compute.readonly"
  37330. // ]
  37331. // }
  37332. }
  37333. // Pages invokes f for each page of results.
  37334. // A non-nil error returned from f will halt the iteration.
  37335. // The provided context supersedes any context provided to the Context method.
  37336. func (c *ForwardingRulesListCall) Pages(ctx context.Context, f func(*ForwardingRuleList) error) error {
  37337. c.ctx_ = ctx
  37338. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  37339. for {
  37340. x, err := c.Do()
  37341. if err != nil {
  37342. return err
  37343. }
  37344. if err := f(x); err != nil {
  37345. return err
  37346. }
  37347. if x.NextPageToken == "" {
  37348. return nil
  37349. }
  37350. c.PageToken(x.NextPageToken)
  37351. }
  37352. }
  37353. // method id "compute.forwardingRules.setLabels":
  37354. type ForwardingRulesSetLabelsCall struct {
  37355. s *Service
  37356. project string
  37357. region string
  37358. resource string
  37359. regionsetlabelsrequest *RegionSetLabelsRequest
  37360. urlParams_ gensupport.URLParams
  37361. ctx_ context.Context
  37362. header_ http.Header
  37363. }
  37364. // SetLabels: Sets the labels on the specified resource. To learn more
  37365. // about labels, read the Labeling Resources documentation.
  37366. func (r *ForwardingRulesService) SetLabels(project string, region string, resource string, regionsetlabelsrequest *RegionSetLabelsRequest) *ForwardingRulesSetLabelsCall {
  37367. c := &ForwardingRulesSetLabelsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  37368. c.project = project
  37369. c.region = region
  37370. c.resource = resource
  37371. c.regionsetlabelsrequest = regionsetlabelsrequest
  37372. return c
  37373. }
  37374. // RequestId sets the optional parameter "requestId": An optional
  37375. // request ID to identify requests. Specify a unique request ID so that
  37376. // if you must retry your request, the server will know to ignore the
  37377. // request if it has already been completed.
  37378. //
  37379. // For example, consider a situation where you make an initial request
  37380. // and the request times out. If you make the request again with the
  37381. // same request ID, the server can check if original operation with the
  37382. // same request ID was received, and if so, will ignore the second
  37383. // request. This prevents clients from accidentally creating duplicate
  37384. // commitments.
  37385. //
  37386. // The request ID must be a valid UUID with the exception that zero UUID
  37387. // is not supported (00000000-0000-0000-0000-000000000000).
  37388. func (c *ForwardingRulesSetLabelsCall) RequestId(requestId string) *ForwardingRulesSetLabelsCall {
  37389. c.urlParams_.Set("requestId", requestId)
  37390. return c
  37391. }
  37392. // Fields allows partial responses to be retrieved. See
  37393. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  37394. // for more information.
  37395. func (c *ForwardingRulesSetLabelsCall) Fields(s ...googleapi.Field) *ForwardingRulesSetLabelsCall {
  37396. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  37397. return c
  37398. }
  37399. // Context sets the context to be used in this call's Do method. Any
  37400. // pending HTTP request will be aborted if the provided context is
  37401. // canceled.
  37402. func (c *ForwardingRulesSetLabelsCall) Context(ctx context.Context) *ForwardingRulesSetLabelsCall {
  37403. c.ctx_ = ctx
  37404. return c
  37405. }
  37406. // Header returns an http.Header that can be modified by the caller to
  37407. // add HTTP headers to the request.
  37408. func (c *ForwardingRulesSetLabelsCall) Header() http.Header {
  37409. if c.header_ == nil {
  37410. c.header_ = make(http.Header)
  37411. }
  37412. return c.header_
  37413. }
  37414. func (c *ForwardingRulesSetLabelsCall) doRequest(alt string) (*http.Response, error) {
  37415. reqHeaders := make(http.Header)
  37416. for k, v := range c.header_ {
  37417. reqHeaders[k] = v
  37418. }
  37419. reqHeaders.Set("User-Agent", c.s.userAgent())
  37420. var body io.Reader = nil
  37421. body, err := googleapi.WithoutDataWrapper.JSONReader(c.regionsetlabelsrequest)
  37422. if err != nil {
  37423. return nil, err
  37424. }
  37425. reqHeaders.Set("Content-Type", "application/json")
  37426. c.urlParams_.Set("alt", alt)
  37427. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/forwardingRules/{resource}/setLabels")
  37428. urls += "?" + c.urlParams_.Encode()
  37429. req, _ := http.NewRequest("POST", urls, body)
  37430. req.Header = reqHeaders
  37431. googleapi.Expand(req.URL, map[string]string{
  37432. "project": c.project,
  37433. "region": c.region,
  37434. "resource": c.resource,
  37435. })
  37436. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  37437. }
  37438. // Do executes the "compute.forwardingRules.setLabels" call.
  37439. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  37440. // status code is an error. Response headers are in either
  37441. // *Operation.ServerResponse.Header or (if a response was returned at
  37442. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  37443. // to check whether the returned error was because
  37444. // http.StatusNotModified was returned.
  37445. func (c *ForwardingRulesSetLabelsCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  37446. gensupport.SetOptions(c.urlParams_, opts...)
  37447. res, err := c.doRequest("json")
  37448. if res != nil && res.StatusCode == http.StatusNotModified {
  37449. if res.Body != nil {
  37450. res.Body.Close()
  37451. }
  37452. return nil, &googleapi.Error{
  37453. Code: res.StatusCode,
  37454. Header: res.Header,
  37455. }
  37456. }
  37457. if err != nil {
  37458. return nil, err
  37459. }
  37460. defer googleapi.CloseBody(res)
  37461. if err := googleapi.CheckResponse(res); err != nil {
  37462. return nil, err
  37463. }
  37464. ret := &Operation{
  37465. ServerResponse: googleapi.ServerResponse{
  37466. Header: res.Header,
  37467. HTTPStatusCode: res.StatusCode,
  37468. },
  37469. }
  37470. target := &ret
  37471. if err := gensupport.DecodeResponse(target, res); err != nil {
  37472. return nil, err
  37473. }
  37474. return ret, nil
  37475. // {
  37476. // "description": "Sets the labels on the specified resource. To learn more about labels, read the Labeling Resources documentation.",
  37477. // "httpMethod": "POST",
  37478. // "id": "compute.forwardingRules.setLabels",
  37479. // "parameterOrder": [
  37480. // "project",
  37481. // "region",
  37482. // "resource"
  37483. // ],
  37484. // "parameters": {
  37485. // "project": {
  37486. // "description": "Project ID for this request.",
  37487. // "location": "path",
  37488. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  37489. // "required": true,
  37490. // "type": "string"
  37491. // },
  37492. // "region": {
  37493. // "description": "The region for this request.",
  37494. // "location": "path",
  37495. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  37496. // "required": true,
  37497. // "type": "string"
  37498. // },
  37499. // "requestId": {
  37500. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  37501. // "location": "query",
  37502. // "type": "string"
  37503. // },
  37504. // "resource": {
  37505. // "description": "Name of the resource for this request.",
  37506. // "location": "path",
  37507. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  37508. // "required": true,
  37509. // "type": "string"
  37510. // }
  37511. // },
  37512. // "path": "{project}/regions/{region}/forwardingRules/{resource}/setLabels",
  37513. // "request": {
  37514. // "$ref": "RegionSetLabelsRequest"
  37515. // },
  37516. // "response": {
  37517. // "$ref": "Operation"
  37518. // },
  37519. // "scopes": [
  37520. // "https://www.googleapis.com/auth/cloud-platform",
  37521. // "https://www.googleapis.com/auth/compute"
  37522. // ]
  37523. // }
  37524. }
  37525. // method id "compute.forwardingRules.setTarget":
  37526. type ForwardingRulesSetTargetCall struct {
  37527. s *Service
  37528. project string
  37529. region string
  37530. forwardingRule string
  37531. targetreference *TargetReference
  37532. urlParams_ gensupport.URLParams
  37533. ctx_ context.Context
  37534. header_ http.Header
  37535. }
  37536. // SetTarget: Changes target URL for forwarding rule. The new target
  37537. // should be of the same type as the old target.
  37538. // For details, see https://cloud.google.com/compute/docs/reference/latest/forwardingRules/setTarget
  37539. func (r *ForwardingRulesService) SetTarget(project string, region string, forwardingRule string, targetreference *TargetReference) *ForwardingRulesSetTargetCall {
  37540. c := &ForwardingRulesSetTargetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  37541. c.project = project
  37542. c.region = region
  37543. c.forwardingRule = forwardingRule
  37544. c.targetreference = targetreference
  37545. return c
  37546. }
  37547. // RequestId sets the optional parameter "requestId": An optional
  37548. // request ID to identify requests. Specify a unique request ID so that
  37549. // if you must retry your request, the server will know to ignore the
  37550. // request if it has already been completed.
  37551. //
  37552. // For example, consider a situation where you make an initial request
  37553. // and the request times out. If you make the request again with the
  37554. // same request ID, the server can check if original operation with the
  37555. // same request ID was received, and if so, will ignore the second
  37556. // request. This prevents clients from accidentally creating duplicate
  37557. // commitments.
  37558. //
  37559. // The request ID must be a valid UUID with the exception that zero UUID
  37560. // is not supported (00000000-0000-0000-0000-000000000000).
  37561. func (c *ForwardingRulesSetTargetCall) RequestId(requestId string) *ForwardingRulesSetTargetCall {
  37562. c.urlParams_.Set("requestId", requestId)
  37563. return c
  37564. }
  37565. // Fields allows partial responses to be retrieved. See
  37566. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  37567. // for more information.
  37568. func (c *ForwardingRulesSetTargetCall) Fields(s ...googleapi.Field) *ForwardingRulesSetTargetCall {
  37569. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  37570. return c
  37571. }
  37572. // Context sets the context to be used in this call's Do method. Any
  37573. // pending HTTP request will be aborted if the provided context is
  37574. // canceled.
  37575. func (c *ForwardingRulesSetTargetCall) Context(ctx context.Context) *ForwardingRulesSetTargetCall {
  37576. c.ctx_ = ctx
  37577. return c
  37578. }
  37579. // Header returns an http.Header that can be modified by the caller to
  37580. // add HTTP headers to the request.
  37581. func (c *ForwardingRulesSetTargetCall) Header() http.Header {
  37582. if c.header_ == nil {
  37583. c.header_ = make(http.Header)
  37584. }
  37585. return c.header_
  37586. }
  37587. func (c *ForwardingRulesSetTargetCall) doRequest(alt string) (*http.Response, error) {
  37588. reqHeaders := make(http.Header)
  37589. for k, v := range c.header_ {
  37590. reqHeaders[k] = v
  37591. }
  37592. reqHeaders.Set("User-Agent", c.s.userAgent())
  37593. var body io.Reader = nil
  37594. body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetreference)
  37595. if err != nil {
  37596. return nil, err
  37597. }
  37598. reqHeaders.Set("Content-Type", "application/json")
  37599. c.urlParams_.Set("alt", alt)
  37600. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/forwardingRules/{forwardingRule}/setTarget")
  37601. urls += "?" + c.urlParams_.Encode()
  37602. req, _ := http.NewRequest("POST", urls, body)
  37603. req.Header = reqHeaders
  37604. googleapi.Expand(req.URL, map[string]string{
  37605. "project": c.project,
  37606. "region": c.region,
  37607. "forwardingRule": c.forwardingRule,
  37608. })
  37609. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  37610. }
  37611. // Do executes the "compute.forwardingRules.setTarget" call.
  37612. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  37613. // status code is an error. Response headers are in either
  37614. // *Operation.ServerResponse.Header or (if a response was returned at
  37615. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  37616. // to check whether the returned error was because
  37617. // http.StatusNotModified was returned.
  37618. func (c *ForwardingRulesSetTargetCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  37619. gensupport.SetOptions(c.urlParams_, opts...)
  37620. res, err := c.doRequest("json")
  37621. if res != nil && res.StatusCode == http.StatusNotModified {
  37622. if res.Body != nil {
  37623. res.Body.Close()
  37624. }
  37625. return nil, &googleapi.Error{
  37626. Code: res.StatusCode,
  37627. Header: res.Header,
  37628. }
  37629. }
  37630. if err != nil {
  37631. return nil, err
  37632. }
  37633. defer googleapi.CloseBody(res)
  37634. if err := googleapi.CheckResponse(res); err != nil {
  37635. return nil, err
  37636. }
  37637. ret := &Operation{
  37638. ServerResponse: googleapi.ServerResponse{
  37639. Header: res.Header,
  37640. HTTPStatusCode: res.StatusCode,
  37641. },
  37642. }
  37643. target := &ret
  37644. if err := gensupport.DecodeResponse(target, res); err != nil {
  37645. return nil, err
  37646. }
  37647. return ret, nil
  37648. // {
  37649. // "description": "Changes target URL for forwarding rule. The new target should be of the same type as the old target.",
  37650. // "httpMethod": "POST",
  37651. // "id": "compute.forwardingRules.setTarget",
  37652. // "parameterOrder": [
  37653. // "project",
  37654. // "region",
  37655. // "forwardingRule"
  37656. // ],
  37657. // "parameters": {
  37658. // "forwardingRule": {
  37659. // "description": "Name of the ForwardingRule resource in which target is to be set.",
  37660. // "location": "path",
  37661. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  37662. // "required": true,
  37663. // "type": "string"
  37664. // },
  37665. // "project": {
  37666. // "description": "Project ID for this request.",
  37667. // "location": "path",
  37668. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  37669. // "required": true,
  37670. // "type": "string"
  37671. // },
  37672. // "region": {
  37673. // "description": "Name of the region scoping this request.",
  37674. // "location": "path",
  37675. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  37676. // "required": true,
  37677. // "type": "string"
  37678. // },
  37679. // "requestId": {
  37680. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  37681. // "location": "query",
  37682. // "type": "string"
  37683. // }
  37684. // },
  37685. // "path": "{project}/regions/{region}/forwardingRules/{forwardingRule}/setTarget",
  37686. // "request": {
  37687. // "$ref": "TargetReference"
  37688. // },
  37689. // "response": {
  37690. // "$ref": "Operation"
  37691. // },
  37692. // "scopes": [
  37693. // "https://www.googleapis.com/auth/cloud-platform",
  37694. // "https://www.googleapis.com/auth/compute"
  37695. // ]
  37696. // }
  37697. }
  37698. // method id "compute.forwardingRules.testIamPermissions":
  37699. type ForwardingRulesTestIamPermissionsCall struct {
  37700. s *Service
  37701. project string
  37702. region string
  37703. resource string
  37704. testpermissionsrequest *TestPermissionsRequest
  37705. urlParams_ gensupport.URLParams
  37706. ctx_ context.Context
  37707. header_ http.Header
  37708. }
  37709. // TestIamPermissions: Returns permissions that a caller has on the
  37710. // specified resource.
  37711. func (r *ForwardingRulesService) TestIamPermissions(project string, region string, resource string, testpermissionsrequest *TestPermissionsRequest) *ForwardingRulesTestIamPermissionsCall {
  37712. c := &ForwardingRulesTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  37713. c.project = project
  37714. c.region = region
  37715. c.resource = resource
  37716. c.testpermissionsrequest = testpermissionsrequest
  37717. return c
  37718. }
  37719. // Fields allows partial responses to be retrieved. See
  37720. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  37721. // for more information.
  37722. func (c *ForwardingRulesTestIamPermissionsCall) Fields(s ...googleapi.Field) *ForwardingRulesTestIamPermissionsCall {
  37723. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  37724. return c
  37725. }
  37726. // Context sets the context to be used in this call's Do method. Any
  37727. // pending HTTP request will be aborted if the provided context is
  37728. // canceled.
  37729. func (c *ForwardingRulesTestIamPermissionsCall) Context(ctx context.Context) *ForwardingRulesTestIamPermissionsCall {
  37730. c.ctx_ = ctx
  37731. return c
  37732. }
  37733. // Header returns an http.Header that can be modified by the caller to
  37734. // add HTTP headers to the request.
  37735. func (c *ForwardingRulesTestIamPermissionsCall) Header() http.Header {
  37736. if c.header_ == nil {
  37737. c.header_ = make(http.Header)
  37738. }
  37739. return c.header_
  37740. }
  37741. func (c *ForwardingRulesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  37742. reqHeaders := make(http.Header)
  37743. for k, v := range c.header_ {
  37744. reqHeaders[k] = v
  37745. }
  37746. reqHeaders.Set("User-Agent", c.s.userAgent())
  37747. var body io.Reader = nil
  37748. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  37749. if err != nil {
  37750. return nil, err
  37751. }
  37752. reqHeaders.Set("Content-Type", "application/json")
  37753. c.urlParams_.Set("alt", alt)
  37754. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/forwardingRules/{resource}/testIamPermissions")
  37755. urls += "?" + c.urlParams_.Encode()
  37756. req, _ := http.NewRequest("POST", urls, body)
  37757. req.Header = reqHeaders
  37758. googleapi.Expand(req.URL, map[string]string{
  37759. "project": c.project,
  37760. "region": c.region,
  37761. "resource": c.resource,
  37762. })
  37763. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  37764. }
  37765. // Do executes the "compute.forwardingRules.testIamPermissions" call.
  37766. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  37767. // non-2xx status code is an error. Response headers are in either
  37768. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  37769. // returned at all) in error.(*googleapi.Error).Header. Use
  37770. // googleapi.IsNotModified to check whether the returned error was
  37771. // because http.StatusNotModified was returned.
  37772. func (c *ForwardingRulesTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  37773. gensupport.SetOptions(c.urlParams_, opts...)
  37774. res, err := c.doRequest("json")
  37775. if res != nil && res.StatusCode == http.StatusNotModified {
  37776. if res.Body != nil {
  37777. res.Body.Close()
  37778. }
  37779. return nil, &googleapi.Error{
  37780. Code: res.StatusCode,
  37781. Header: res.Header,
  37782. }
  37783. }
  37784. if err != nil {
  37785. return nil, err
  37786. }
  37787. defer googleapi.CloseBody(res)
  37788. if err := googleapi.CheckResponse(res); err != nil {
  37789. return nil, err
  37790. }
  37791. ret := &TestPermissionsResponse{
  37792. ServerResponse: googleapi.ServerResponse{
  37793. Header: res.Header,
  37794. HTTPStatusCode: res.StatusCode,
  37795. },
  37796. }
  37797. target := &ret
  37798. if err := gensupport.DecodeResponse(target, res); err != nil {
  37799. return nil, err
  37800. }
  37801. return ret, nil
  37802. // {
  37803. // "description": "Returns permissions that a caller has on the specified resource.",
  37804. // "httpMethod": "POST",
  37805. // "id": "compute.forwardingRules.testIamPermissions",
  37806. // "parameterOrder": [
  37807. // "project",
  37808. // "region",
  37809. // "resource"
  37810. // ],
  37811. // "parameters": {
  37812. // "project": {
  37813. // "description": "Project ID for this request.",
  37814. // "location": "path",
  37815. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  37816. // "required": true,
  37817. // "type": "string"
  37818. // },
  37819. // "region": {
  37820. // "description": "The name of the region for this request.",
  37821. // "location": "path",
  37822. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  37823. // "required": true,
  37824. // "type": "string"
  37825. // },
  37826. // "resource": {
  37827. // "description": "Name of the resource for this request.",
  37828. // "location": "path",
  37829. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  37830. // "required": true,
  37831. // "type": "string"
  37832. // }
  37833. // },
  37834. // "path": "{project}/regions/{region}/forwardingRules/{resource}/testIamPermissions",
  37835. // "request": {
  37836. // "$ref": "TestPermissionsRequest"
  37837. // },
  37838. // "response": {
  37839. // "$ref": "TestPermissionsResponse"
  37840. // },
  37841. // "scopes": [
  37842. // "https://www.googleapis.com/auth/cloud-platform",
  37843. // "https://www.googleapis.com/auth/compute",
  37844. // "https://www.googleapis.com/auth/compute.readonly"
  37845. // ]
  37846. // }
  37847. }
  37848. // method id "compute.globalAddresses.delete":
  37849. type GlobalAddressesDeleteCall struct {
  37850. s *Service
  37851. project string
  37852. address string
  37853. urlParams_ gensupport.URLParams
  37854. ctx_ context.Context
  37855. header_ http.Header
  37856. }
  37857. // Delete: Deletes the specified address resource.
  37858. // For details, see https://cloud.google.com/compute/docs/reference/latest/globalAddresses/delete
  37859. func (r *GlobalAddressesService) Delete(project string, address string) *GlobalAddressesDeleteCall {
  37860. c := &GlobalAddressesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  37861. c.project = project
  37862. c.address = address
  37863. return c
  37864. }
  37865. // RequestId sets the optional parameter "requestId": An optional
  37866. // request ID to identify requests. Specify a unique request ID so that
  37867. // if you must retry your request, the server will know to ignore the
  37868. // request if it has already been completed.
  37869. //
  37870. // For example, consider a situation where you make an initial request
  37871. // and the request times out. If you make the request again with the
  37872. // same request ID, the server can check if original operation with the
  37873. // same request ID was received, and if so, will ignore the second
  37874. // request. This prevents clients from accidentally creating duplicate
  37875. // commitments.
  37876. //
  37877. // The request ID must be a valid UUID with the exception that zero UUID
  37878. // is not supported (00000000-0000-0000-0000-000000000000).
  37879. func (c *GlobalAddressesDeleteCall) RequestId(requestId string) *GlobalAddressesDeleteCall {
  37880. c.urlParams_.Set("requestId", requestId)
  37881. return c
  37882. }
  37883. // Fields allows partial responses to be retrieved. See
  37884. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  37885. // for more information.
  37886. func (c *GlobalAddressesDeleteCall) Fields(s ...googleapi.Field) *GlobalAddressesDeleteCall {
  37887. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  37888. return c
  37889. }
  37890. // Context sets the context to be used in this call's Do method. Any
  37891. // pending HTTP request will be aborted if the provided context is
  37892. // canceled.
  37893. func (c *GlobalAddressesDeleteCall) Context(ctx context.Context) *GlobalAddressesDeleteCall {
  37894. c.ctx_ = ctx
  37895. return c
  37896. }
  37897. // Header returns an http.Header that can be modified by the caller to
  37898. // add HTTP headers to the request.
  37899. func (c *GlobalAddressesDeleteCall) Header() http.Header {
  37900. if c.header_ == nil {
  37901. c.header_ = make(http.Header)
  37902. }
  37903. return c.header_
  37904. }
  37905. func (c *GlobalAddressesDeleteCall) doRequest(alt string) (*http.Response, error) {
  37906. reqHeaders := make(http.Header)
  37907. for k, v := range c.header_ {
  37908. reqHeaders[k] = v
  37909. }
  37910. reqHeaders.Set("User-Agent", c.s.userAgent())
  37911. var body io.Reader = nil
  37912. c.urlParams_.Set("alt", alt)
  37913. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/addresses/{address}")
  37914. urls += "?" + c.urlParams_.Encode()
  37915. req, _ := http.NewRequest("DELETE", urls, body)
  37916. req.Header = reqHeaders
  37917. googleapi.Expand(req.URL, map[string]string{
  37918. "project": c.project,
  37919. "address": c.address,
  37920. })
  37921. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  37922. }
  37923. // Do executes the "compute.globalAddresses.delete" call.
  37924. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  37925. // status code is an error. Response headers are in either
  37926. // *Operation.ServerResponse.Header or (if a response was returned at
  37927. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  37928. // to check whether the returned error was because
  37929. // http.StatusNotModified was returned.
  37930. func (c *GlobalAddressesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  37931. gensupport.SetOptions(c.urlParams_, opts...)
  37932. res, err := c.doRequest("json")
  37933. if res != nil && res.StatusCode == http.StatusNotModified {
  37934. if res.Body != nil {
  37935. res.Body.Close()
  37936. }
  37937. return nil, &googleapi.Error{
  37938. Code: res.StatusCode,
  37939. Header: res.Header,
  37940. }
  37941. }
  37942. if err != nil {
  37943. return nil, err
  37944. }
  37945. defer googleapi.CloseBody(res)
  37946. if err := googleapi.CheckResponse(res); err != nil {
  37947. return nil, err
  37948. }
  37949. ret := &Operation{
  37950. ServerResponse: googleapi.ServerResponse{
  37951. Header: res.Header,
  37952. HTTPStatusCode: res.StatusCode,
  37953. },
  37954. }
  37955. target := &ret
  37956. if err := gensupport.DecodeResponse(target, res); err != nil {
  37957. return nil, err
  37958. }
  37959. return ret, nil
  37960. // {
  37961. // "description": "Deletes the specified address resource.",
  37962. // "httpMethod": "DELETE",
  37963. // "id": "compute.globalAddresses.delete",
  37964. // "parameterOrder": [
  37965. // "project",
  37966. // "address"
  37967. // ],
  37968. // "parameters": {
  37969. // "address": {
  37970. // "description": "Name of the address resource to delete.",
  37971. // "location": "path",
  37972. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  37973. // "required": true,
  37974. // "type": "string"
  37975. // },
  37976. // "project": {
  37977. // "description": "Project ID for this request.",
  37978. // "location": "path",
  37979. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  37980. // "required": true,
  37981. // "type": "string"
  37982. // },
  37983. // "requestId": {
  37984. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  37985. // "location": "query",
  37986. // "type": "string"
  37987. // }
  37988. // },
  37989. // "path": "{project}/global/addresses/{address}",
  37990. // "response": {
  37991. // "$ref": "Operation"
  37992. // },
  37993. // "scopes": [
  37994. // "https://www.googleapis.com/auth/cloud-platform",
  37995. // "https://www.googleapis.com/auth/compute"
  37996. // ]
  37997. // }
  37998. }
  37999. // method id "compute.globalAddresses.get":
  38000. type GlobalAddressesGetCall struct {
  38001. s *Service
  38002. project string
  38003. address string
  38004. urlParams_ gensupport.URLParams
  38005. ifNoneMatch_ string
  38006. ctx_ context.Context
  38007. header_ http.Header
  38008. }
  38009. // Get: Returns the specified address resource. Gets a list of available
  38010. // addresses by making a list() request.
  38011. // For details, see https://cloud.google.com/compute/docs/reference/latest/globalAddresses/get
  38012. func (r *GlobalAddressesService) Get(project string, address string) *GlobalAddressesGetCall {
  38013. c := &GlobalAddressesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  38014. c.project = project
  38015. c.address = address
  38016. return c
  38017. }
  38018. // Fields allows partial responses to be retrieved. See
  38019. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  38020. // for more information.
  38021. func (c *GlobalAddressesGetCall) Fields(s ...googleapi.Field) *GlobalAddressesGetCall {
  38022. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  38023. return c
  38024. }
  38025. // IfNoneMatch sets the optional parameter which makes the operation
  38026. // fail if the object's ETag matches the given value. This is useful for
  38027. // getting updates only after the object has changed since the last
  38028. // request. Use googleapi.IsNotModified to check whether the response
  38029. // error from Do is the result of In-None-Match.
  38030. func (c *GlobalAddressesGetCall) IfNoneMatch(entityTag string) *GlobalAddressesGetCall {
  38031. c.ifNoneMatch_ = entityTag
  38032. return c
  38033. }
  38034. // Context sets the context to be used in this call's Do method. Any
  38035. // pending HTTP request will be aborted if the provided context is
  38036. // canceled.
  38037. func (c *GlobalAddressesGetCall) Context(ctx context.Context) *GlobalAddressesGetCall {
  38038. c.ctx_ = ctx
  38039. return c
  38040. }
  38041. // Header returns an http.Header that can be modified by the caller to
  38042. // add HTTP headers to the request.
  38043. func (c *GlobalAddressesGetCall) Header() http.Header {
  38044. if c.header_ == nil {
  38045. c.header_ = make(http.Header)
  38046. }
  38047. return c.header_
  38048. }
  38049. func (c *GlobalAddressesGetCall) doRequest(alt string) (*http.Response, error) {
  38050. reqHeaders := make(http.Header)
  38051. for k, v := range c.header_ {
  38052. reqHeaders[k] = v
  38053. }
  38054. reqHeaders.Set("User-Agent", c.s.userAgent())
  38055. if c.ifNoneMatch_ != "" {
  38056. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  38057. }
  38058. var body io.Reader = nil
  38059. c.urlParams_.Set("alt", alt)
  38060. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/addresses/{address}")
  38061. urls += "?" + c.urlParams_.Encode()
  38062. req, _ := http.NewRequest("GET", urls, body)
  38063. req.Header = reqHeaders
  38064. googleapi.Expand(req.URL, map[string]string{
  38065. "project": c.project,
  38066. "address": c.address,
  38067. })
  38068. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  38069. }
  38070. // Do executes the "compute.globalAddresses.get" call.
  38071. // Exactly one of *Address or error will be non-nil. Any non-2xx status
  38072. // code is an error. Response headers are in either
  38073. // *Address.ServerResponse.Header or (if a response was returned at all)
  38074. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  38075. // check whether the returned error was because http.StatusNotModified
  38076. // was returned.
  38077. func (c *GlobalAddressesGetCall) Do(opts ...googleapi.CallOption) (*Address, error) {
  38078. gensupport.SetOptions(c.urlParams_, opts...)
  38079. res, err := c.doRequest("json")
  38080. if res != nil && res.StatusCode == http.StatusNotModified {
  38081. if res.Body != nil {
  38082. res.Body.Close()
  38083. }
  38084. return nil, &googleapi.Error{
  38085. Code: res.StatusCode,
  38086. Header: res.Header,
  38087. }
  38088. }
  38089. if err != nil {
  38090. return nil, err
  38091. }
  38092. defer googleapi.CloseBody(res)
  38093. if err := googleapi.CheckResponse(res); err != nil {
  38094. return nil, err
  38095. }
  38096. ret := &Address{
  38097. ServerResponse: googleapi.ServerResponse{
  38098. Header: res.Header,
  38099. HTTPStatusCode: res.StatusCode,
  38100. },
  38101. }
  38102. target := &ret
  38103. if err := gensupport.DecodeResponse(target, res); err != nil {
  38104. return nil, err
  38105. }
  38106. return ret, nil
  38107. // {
  38108. // "description": "Returns the specified address resource. Gets a list of available addresses by making a list() request.",
  38109. // "httpMethod": "GET",
  38110. // "id": "compute.globalAddresses.get",
  38111. // "parameterOrder": [
  38112. // "project",
  38113. // "address"
  38114. // ],
  38115. // "parameters": {
  38116. // "address": {
  38117. // "description": "Name of the address resource to return.",
  38118. // "location": "path",
  38119. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  38120. // "required": true,
  38121. // "type": "string"
  38122. // },
  38123. // "project": {
  38124. // "description": "Project ID for this request.",
  38125. // "location": "path",
  38126. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  38127. // "required": true,
  38128. // "type": "string"
  38129. // }
  38130. // },
  38131. // "path": "{project}/global/addresses/{address}",
  38132. // "response": {
  38133. // "$ref": "Address"
  38134. // },
  38135. // "scopes": [
  38136. // "https://www.googleapis.com/auth/cloud-platform",
  38137. // "https://www.googleapis.com/auth/compute",
  38138. // "https://www.googleapis.com/auth/compute.readonly"
  38139. // ]
  38140. // }
  38141. }
  38142. // method id "compute.globalAddresses.insert":
  38143. type GlobalAddressesInsertCall struct {
  38144. s *Service
  38145. project string
  38146. address *Address
  38147. urlParams_ gensupport.URLParams
  38148. ctx_ context.Context
  38149. header_ http.Header
  38150. }
  38151. // Insert: Creates an address resource in the specified project using
  38152. // the data included in the request.
  38153. // For details, see https://cloud.google.com/compute/docs/reference/latest/globalAddresses/insert
  38154. func (r *GlobalAddressesService) Insert(project string, address *Address) *GlobalAddressesInsertCall {
  38155. c := &GlobalAddressesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  38156. c.project = project
  38157. c.address = address
  38158. return c
  38159. }
  38160. // RequestId sets the optional parameter "requestId": An optional
  38161. // request ID to identify requests. Specify a unique request ID so that
  38162. // if you must retry your request, the server will know to ignore the
  38163. // request if it has already been completed.
  38164. //
  38165. // For example, consider a situation where you make an initial request
  38166. // and the request times out. If you make the request again with the
  38167. // same request ID, the server can check if original operation with the
  38168. // same request ID was received, and if so, will ignore the second
  38169. // request. This prevents clients from accidentally creating duplicate
  38170. // commitments.
  38171. //
  38172. // The request ID must be a valid UUID with the exception that zero UUID
  38173. // is not supported (00000000-0000-0000-0000-000000000000).
  38174. func (c *GlobalAddressesInsertCall) RequestId(requestId string) *GlobalAddressesInsertCall {
  38175. c.urlParams_.Set("requestId", requestId)
  38176. return c
  38177. }
  38178. // Fields allows partial responses to be retrieved. See
  38179. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  38180. // for more information.
  38181. func (c *GlobalAddressesInsertCall) Fields(s ...googleapi.Field) *GlobalAddressesInsertCall {
  38182. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  38183. return c
  38184. }
  38185. // Context sets the context to be used in this call's Do method. Any
  38186. // pending HTTP request will be aborted if the provided context is
  38187. // canceled.
  38188. func (c *GlobalAddressesInsertCall) Context(ctx context.Context) *GlobalAddressesInsertCall {
  38189. c.ctx_ = ctx
  38190. return c
  38191. }
  38192. // Header returns an http.Header that can be modified by the caller to
  38193. // add HTTP headers to the request.
  38194. func (c *GlobalAddressesInsertCall) Header() http.Header {
  38195. if c.header_ == nil {
  38196. c.header_ = make(http.Header)
  38197. }
  38198. return c.header_
  38199. }
  38200. func (c *GlobalAddressesInsertCall) doRequest(alt string) (*http.Response, error) {
  38201. reqHeaders := make(http.Header)
  38202. for k, v := range c.header_ {
  38203. reqHeaders[k] = v
  38204. }
  38205. reqHeaders.Set("User-Agent", c.s.userAgent())
  38206. var body io.Reader = nil
  38207. body, err := googleapi.WithoutDataWrapper.JSONReader(c.address)
  38208. if err != nil {
  38209. return nil, err
  38210. }
  38211. reqHeaders.Set("Content-Type", "application/json")
  38212. c.urlParams_.Set("alt", alt)
  38213. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/addresses")
  38214. urls += "?" + c.urlParams_.Encode()
  38215. req, _ := http.NewRequest("POST", urls, body)
  38216. req.Header = reqHeaders
  38217. googleapi.Expand(req.URL, map[string]string{
  38218. "project": c.project,
  38219. })
  38220. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  38221. }
  38222. // Do executes the "compute.globalAddresses.insert" call.
  38223. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  38224. // status code is an error. Response headers are in either
  38225. // *Operation.ServerResponse.Header or (if a response was returned at
  38226. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  38227. // to check whether the returned error was because
  38228. // http.StatusNotModified was returned.
  38229. func (c *GlobalAddressesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  38230. gensupport.SetOptions(c.urlParams_, opts...)
  38231. res, err := c.doRequest("json")
  38232. if res != nil && res.StatusCode == http.StatusNotModified {
  38233. if res.Body != nil {
  38234. res.Body.Close()
  38235. }
  38236. return nil, &googleapi.Error{
  38237. Code: res.StatusCode,
  38238. Header: res.Header,
  38239. }
  38240. }
  38241. if err != nil {
  38242. return nil, err
  38243. }
  38244. defer googleapi.CloseBody(res)
  38245. if err := googleapi.CheckResponse(res); err != nil {
  38246. return nil, err
  38247. }
  38248. ret := &Operation{
  38249. ServerResponse: googleapi.ServerResponse{
  38250. Header: res.Header,
  38251. HTTPStatusCode: res.StatusCode,
  38252. },
  38253. }
  38254. target := &ret
  38255. if err := gensupport.DecodeResponse(target, res); err != nil {
  38256. return nil, err
  38257. }
  38258. return ret, nil
  38259. // {
  38260. // "description": "Creates an address resource in the specified project using the data included in the request.",
  38261. // "httpMethod": "POST",
  38262. // "id": "compute.globalAddresses.insert",
  38263. // "parameterOrder": [
  38264. // "project"
  38265. // ],
  38266. // "parameters": {
  38267. // "project": {
  38268. // "description": "Project ID for this request.",
  38269. // "location": "path",
  38270. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  38271. // "required": true,
  38272. // "type": "string"
  38273. // },
  38274. // "requestId": {
  38275. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  38276. // "location": "query",
  38277. // "type": "string"
  38278. // }
  38279. // },
  38280. // "path": "{project}/global/addresses",
  38281. // "request": {
  38282. // "$ref": "Address"
  38283. // },
  38284. // "response": {
  38285. // "$ref": "Operation"
  38286. // },
  38287. // "scopes": [
  38288. // "https://www.googleapis.com/auth/cloud-platform",
  38289. // "https://www.googleapis.com/auth/compute"
  38290. // ]
  38291. // }
  38292. }
  38293. // method id "compute.globalAddresses.list":
  38294. type GlobalAddressesListCall struct {
  38295. s *Service
  38296. project string
  38297. urlParams_ gensupport.URLParams
  38298. ifNoneMatch_ string
  38299. ctx_ context.Context
  38300. header_ http.Header
  38301. }
  38302. // List: Retrieves a list of global addresses.
  38303. // For details, see https://cloud.google.com/compute/docs/reference/latest/globalAddresses/list
  38304. func (r *GlobalAddressesService) List(project string) *GlobalAddressesListCall {
  38305. c := &GlobalAddressesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  38306. c.project = project
  38307. return c
  38308. }
  38309. // Filter sets the optional parameter "filter": A filter expression that
  38310. // filters resources listed in the response. The expression must specify
  38311. // the field name, a comparison operator, and the value that you want to
  38312. // use for filtering. The value must be a string, a number, or a
  38313. // boolean. The comparison operator must be either =, !=, >, or <.
  38314. //
  38315. // For example, if you are filtering Compute Engine instances, you can
  38316. // exclude instances named example-instance by specifying name !=
  38317. // example-instance.
  38318. //
  38319. // You can also filter nested fields. For example, you could specify
  38320. // scheduling.automaticRestart = false to include instances only if they
  38321. // are not scheduled for automatic restarts. You can use filtering on
  38322. // nested fields to filter based on resource labels.
  38323. //
  38324. // To filter on multiple expressions, provide each separate expression
  38325. // within parentheses. For example, (scheduling.automaticRestart = true)
  38326. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  38327. // AND expression. However, you can include AND and OR expressions
  38328. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  38329. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  38330. // true).
  38331. func (c *GlobalAddressesListCall) Filter(filter string) *GlobalAddressesListCall {
  38332. c.urlParams_.Set("filter", filter)
  38333. return c
  38334. }
  38335. // MaxResults sets the optional parameter "maxResults": The maximum
  38336. // number of results per page that should be returned. If the number of
  38337. // available results is larger than maxResults, Compute Engine returns a
  38338. // nextPageToken that can be used to get the next page of results in
  38339. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  38340. // (Default: 500)
  38341. func (c *GlobalAddressesListCall) MaxResults(maxResults int64) *GlobalAddressesListCall {
  38342. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  38343. return c
  38344. }
  38345. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  38346. // a certain order. By default, results are returned in alphanumerical
  38347. // order based on the resource name.
  38348. //
  38349. // You can also sort results in descending order based on the creation
  38350. // timestamp using orderBy="creationTimestamp desc". This sorts results
  38351. // based on the creationTimestamp field in reverse chronological order
  38352. // (newest result first). Use this to sort resources like operations so
  38353. // that the newest operation is returned first.
  38354. //
  38355. // Currently, only sorting by name or creationTimestamp desc is
  38356. // supported.
  38357. func (c *GlobalAddressesListCall) OrderBy(orderBy string) *GlobalAddressesListCall {
  38358. c.urlParams_.Set("orderBy", orderBy)
  38359. return c
  38360. }
  38361. // PageToken sets the optional parameter "pageToken": Specifies a page
  38362. // token to use. Set pageToken to the nextPageToken returned by a
  38363. // previous list request to get the next page of results.
  38364. func (c *GlobalAddressesListCall) PageToken(pageToken string) *GlobalAddressesListCall {
  38365. c.urlParams_.Set("pageToken", pageToken)
  38366. return c
  38367. }
  38368. // Fields allows partial responses to be retrieved. See
  38369. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  38370. // for more information.
  38371. func (c *GlobalAddressesListCall) Fields(s ...googleapi.Field) *GlobalAddressesListCall {
  38372. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  38373. return c
  38374. }
  38375. // IfNoneMatch sets the optional parameter which makes the operation
  38376. // fail if the object's ETag matches the given value. This is useful for
  38377. // getting updates only after the object has changed since the last
  38378. // request. Use googleapi.IsNotModified to check whether the response
  38379. // error from Do is the result of In-None-Match.
  38380. func (c *GlobalAddressesListCall) IfNoneMatch(entityTag string) *GlobalAddressesListCall {
  38381. c.ifNoneMatch_ = entityTag
  38382. return c
  38383. }
  38384. // Context sets the context to be used in this call's Do method. Any
  38385. // pending HTTP request will be aborted if the provided context is
  38386. // canceled.
  38387. func (c *GlobalAddressesListCall) Context(ctx context.Context) *GlobalAddressesListCall {
  38388. c.ctx_ = ctx
  38389. return c
  38390. }
  38391. // Header returns an http.Header that can be modified by the caller to
  38392. // add HTTP headers to the request.
  38393. func (c *GlobalAddressesListCall) Header() http.Header {
  38394. if c.header_ == nil {
  38395. c.header_ = make(http.Header)
  38396. }
  38397. return c.header_
  38398. }
  38399. func (c *GlobalAddressesListCall) doRequest(alt string) (*http.Response, error) {
  38400. reqHeaders := make(http.Header)
  38401. for k, v := range c.header_ {
  38402. reqHeaders[k] = v
  38403. }
  38404. reqHeaders.Set("User-Agent", c.s.userAgent())
  38405. if c.ifNoneMatch_ != "" {
  38406. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  38407. }
  38408. var body io.Reader = nil
  38409. c.urlParams_.Set("alt", alt)
  38410. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/addresses")
  38411. urls += "?" + c.urlParams_.Encode()
  38412. req, _ := http.NewRequest("GET", urls, body)
  38413. req.Header = reqHeaders
  38414. googleapi.Expand(req.URL, map[string]string{
  38415. "project": c.project,
  38416. })
  38417. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  38418. }
  38419. // Do executes the "compute.globalAddresses.list" call.
  38420. // Exactly one of *AddressList or error will be non-nil. Any non-2xx
  38421. // status code is an error. Response headers are in either
  38422. // *AddressList.ServerResponse.Header or (if a response was returned at
  38423. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  38424. // to check whether the returned error was because
  38425. // http.StatusNotModified was returned.
  38426. func (c *GlobalAddressesListCall) Do(opts ...googleapi.CallOption) (*AddressList, error) {
  38427. gensupport.SetOptions(c.urlParams_, opts...)
  38428. res, err := c.doRequest("json")
  38429. if res != nil && res.StatusCode == http.StatusNotModified {
  38430. if res.Body != nil {
  38431. res.Body.Close()
  38432. }
  38433. return nil, &googleapi.Error{
  38434. Code: res.StatusCode,
  38435. Header: res.Header,
  38436. }
  38437. }
  38438. if err != nil {
  38439. return nil, err
  38440. }
  38441. defer googleapi.CloseBody(res)
  38442. if err := googleapi.CheckResponse(res); err != nil {
  38443. return nil, err
  38444. }
  38445. ret := &AddressList{
  38446. ServerResponse: googleapi.ServerResponse{
  38447. Header: res.Header,
  38448. HTTPStatusCode: res.StatusCode,
  38449. },
  38450. }
  38451. target := &ret
  38452. if err := gensupport.DecodeResponse(target, res); err != nil {
  38453. return nil, err
  38454. }
  38455. return ret, nil
  38456. // {
  38457. // "description": "Retrieves a list of global addresses.",
  38458. // "httpMethod": "GET",
  38459. // "id": "compute.globalAddresses.list",
  38460. // "parameterOrder": [
  38461. // "project"
  38462. // ],
  38463. // "parameters": {
  38464. // "filter": {
  38465. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  38466. // "location": "query",
  38467. // "type": "string"
  38468. // },
  38469. // "maxResults": {
  38470. // "default": "500",
  38471. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  38472. // "format": "uint32",
  38473. // "location": "query",
  38474. // "minimum": "0",
  38475. // "type": "integer"
  38476. // },
  38477. // "orderBy": {
  38478. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  38479. // "location": "query",
  38480. // "type": "string"
  38481. // },
  38482. // "pageToken": {
  38483. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  38484. // "location": "query",
  38485. // "type": "string"
  38486. // },
  38487. // "project": {
  38488. // "description": "Project ID for this request.",
  38489. // "location": "path",
  38490. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  38491. // "required": true,
  38492. // "type": "string"
  38493. // }
  38494. // },
  38495. // "path": "{project}/global/addresses",
  38496. // "response": {
  38497. // "$ref": "AddressList"
  38498. // },
  38499. // "scopes": [
  38500. // "https://www.googleapis.com/auth/cloud-platform",
  38501. // "https://www.googleapis.com/auth/compute",
  38502. // "https://www.googleapis.com/auth/compute.readonly"
  38503. // ]
  38504. // }
  38505. }
  38506. // Pages invokes f for each page of results.
  38507. // A non-nil error returned from f will halt the iteration.
  38508. // The provided context supersedes any context provided to the Context method.
  38509. func (c *GlobalAddressesListCall) Pages(ctx context.Context, f func(*AddressList) error) error {
  38510. c.ctx_ = ctx
  38511. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  38512. for {
  38513. x, err := c.Do()
  38514. if err != nil {
  38515. return err
  38516. }
  38517. if err := f(x); err != nil {
  38518. return err
  38519. }
  38520. if x.NextPageToken == "" {
  38521. return nil
  38522. }
  38523. c.PageToken(x.NextPageToken)
  38524. }
  38525. }
  38526. // method id "compute.globalAddresses.setLabels":
  38527. type GlobalAddressesSetLabelsCall struct {
  38528. s *Service
  38529. project string
  38530. resource string
  38531. globalsetlabelsrequest *GlobalSetLabelsRequest
  38532. urlParams_ gensupport.URLParams
  38533. ctx_ context.Context
  38534. header_ http.Header
  38535. }
  38536. // SetLabels: Sets the labels on a GlobalAddress. To learn more about
  38537. // labels, read the Labeling Resources documentation.
  38538. func (r *GlobalAddressesService) SetLabels(project string, resource string, globalsetlabelsrequest *GlobalSetLabelsRequest) *GlobalAddressesSetLabelsCall {
  38539. c := &GlobalAddressesSetLabelsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  38540. c.project = project
  38541. c.resource = resource
  38542. c.globalsetlabelsrequest = globalsetlabelsrequest
  38543. return c
  38544. }
  38545. // Fields allows partial responses to be retrieved. See
  38546. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  38547. // for more information.
  38548. func (c *GlobalAddressesSetLabelsCall) Fields(s ...googleapi.Field) *GlobalAddressesSetLabelsCall {
  38549. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  38550. return c
  38551. }
  38552. // Context sets the context to be used in this call's Do method. Any
  38553. // pending HTTP request will be aborted if the provided context is
  38554. // canceled.
  38555. func (c *GlobalAddressesSetLabelsCall) Context(ctx context.Context) *GlobalAddressesSetLabelsCall {
  38556. c.ctx_ = ctx
  38557. return c
  38558. }
  38559. // Header returns an http.Header that can be modified by the caller to
  38560. // add HTTP headers to the request.
  38561. func (c *GlobalAddressesSetLabelsCall) Header() http.Header {
  38562. if c.header_ == nil {
  38563. c.header_ = make(http.Header)
  38564. }
  38565. return c.header_
  38566. }
  38567. func (c *GlobalAddressesSetLabelsCall) doRequest(alt string) (*http.Response, error) {
  38568. reqHeaders := make(http.Header)
  38569. for k, v := range c.header_ {
  38570. reqHeaders[k] = v
  38571. }
  38572. reqHeaders.Set("User-Agent", c.s.userAgent())
  38573. var body io.Reader = nil
  38574. body, err := googleapi.WithoutDataWrapper.JSONReader(c.globalsetlabelsrequest)
  38575. if err != nil {
  38576. return nil, err
  38577. }
  38578. reqHeaders.Set("Content-Type", "application/json")
  38579. c.urlParams_.Set("alt", alt)
  38580. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/addresses/{resource}/setLabels")
  38581. urls += "?" + c.urlParams_.Encode()
  38582. req, _ := http.NewRequest("POST", urls, body)
  38583. req.Header = reqHeaders
  38584. googleapi.Expand(req.URL, map[string]string{
  38585. "project": c.project,
  38586. "resource": c.resource,
  38587. })
  38588. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  38589. }
  38590. // Do executes the "compute.globalAddresses.setLabels" call.
  38591. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  38592. // status code is an error. Response headers are in either
  38593. // *Operation.ServerResponse.Header or (if a response was returned at
  38594. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  38595. // to check whether the returned error was because
  38596. // http.StatusNotModified was returned.
  38597. func (c *GlobalAddressesSetLabelsCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  38598. gensupport.SetOptions(c.urlParams_, opts...)
  38599. res, err := c.doRequest("json")
  38600. if res != nil && res.StatusCode == http.StatusNotModified {
  38601. if res.Body != nil {
  38602. res.Body.Close()
  38603. }
  38604. return nil, &googleapi.Error{
  38605. Code: res.StatusCode,
  38606. Header: res.Header,
  38607. }
  38608. }
  38609. if err != nil {
  38610. return nil, err
  38611. }
  38612. defer googleapi.CloseBody(res)
  38613. if err := googleapi.CheckResponse(res); err != nil {
  38614. return nil, err
  38615. }
  38616. ret := &Operation{
  38617. ServerResponse: googleapi.ServerResponse{
  38618. Header: res.Header,
  38619. HTTPStatusCode: res.StatusCode,
  38620. },
  38621. }
  38622. target := &ret
  38623. if err := gensupport.DecodeResponse(target, res); err != nil {
  38624. return nil, err
  38625. }
  38626. return ret, nil
  38627. // {
  38628. // "description": "Sets the labels on a GlobalAddress. To learn more about labels, read the Labeling Resources documentation.",
  38629. // "httpMethod": "POST",
  38630. // "id": "compute.globalAddresses.setLabels",
  38631. // "parameterOrder": [
  38632. // "project",
  38633. // "resource"
  38634. // ],
  38635. // "parameters": {
  38636. // "project": {
  38637. // "description": "Project ID for this request.",
  38638. // "location": "path",
  38639. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  38640. // "required": true,
  38641. // "type": "string"
  38642. // },
  38643. // "resource": {
  38644. // "description": "Name of the resource for this request.",
  38645. // "location": "path",
  38646. // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?",
  38647. // "required": true,
  38648. // "type": "string"
  38649. // }
  38650. // },
  38651. // "path": "{project}/global/addresses/{resource}/setLabels",
  38652. // "request": {
  38653. // "$ref": "GlobalSetLabelsRequest"
  38654. // },
  38655. // "response": {
  38656. // "$ref": "Operation"
  38657. // },
  38658. // "scopes": [
  38659. // "https://www.googleapis.com/auth/cloud-platform",
  38660. // "https://www.googleapis.com/auth/compute"
  38661. // ]
  38662. // }
  38663. }
  38664. // method id "compute.globalAddresses.testIamPermissions":
  38665. type GlobalAddressesTestIamPermissionsCall struct {
  38666. s *Service
  38667. project string
  38668. resource string
  38669. testpermissionsrequest *TestPermissionsRequest
  38670. urlParams_ gensupport.URLParams
  38671. ctx_ context.Context
  38672. header_ http.Header
  38673. }
  38674. // TestIamPermissions: Returns permissions that a caller has on the
  38675. // specified resource.
  38676. func (r *GlobalAddressesService) TestIamPermissions(project string, resource string, testpermissionsrequest *TestPermissionsRequest) *GlobalAddressesTestIamPermissionsCall {
  38677. c := &GlobalAddressesTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  38678. c.project = project
  38679. c.resource = resource
  38680. c.testpermissionsrequest = testpermissionsrequest
  38681. return c
  38682. }
  38683. // Fields allows partial responses to be retrieved. See
  38684. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  38685. // for more information.
  38686. func (c *GlobalAddressesTestIamPermissionsCall) Fields(s ...googleapi.Field) *GlobalAddressesTestIamPermissionsCall {
  38687. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  38688. return c
  38689. }
  38690. // Context sets the context to be used in this call's Do method. Any
  38691. // pending HTTP request will be aborted if the provided context is
  38692. // canceled.
  38693. func (c *GlobalAddressesTestIamPermissionsCall) Context(ctx context.Context) *GlobalAddressesTestIamPermissionsCall {
  38694. c.ctx_ = ctx
  38695. return c
  38696. }
  38697. // Header returns an http.Header that can be modified by the caller to
  38698. // add HTTP headers to the request.
  38699. func (c *GlobalAddressesTestIamPermissionsCall) Header() http.Header {
  38700. if c.header_ == nil {
  38701. c.header_ = make(http.Header)
  38702. }
  38703. return c.header_
  38704. }
  38705. func (c *GlobalAddressesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  38706. reqHeaders := make(http.Header)
  38707. for k, v := range c.header_ {
  38708. reqHeaders[k] = v
  38709. }
  38710. reqHeaders.Set("User-Agent", c.s.userAgent())
  38711. var body io.Reader = nil
  38712. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  38713. if err != nil {
  38714. return nil, err
  38715. }
  38716. reqHeaders.Set("Content-Type", "application/json")
  38717. c.urlParams_.Set("alt", alt)
  38718. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/addresses/{resource}/testIamPermissions")
  38719. urls += "?" + c.urlParams_.Encode()
  38720. req, _ := http.NewRequest("POST", urls, body)
  38721. req.Header = reqHeaders
  38722. googleapi.Expand(req.URL, map[string]string{
  38723. "project": c.project,
  38724. "resource": c.resource,
  38725. })
  38726. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  38727. }
  38728. // Do executes the "compute.globalAddresses.testIamPermissions" call.
  38729. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  38730. // non-2xx status code is an error. Response headers are in either
  38731. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  38732. // returned at all) in error.(*googleapi.Error).Header. Use
  38733. // googleapi.IsNotModified to check whether the returned error was
  38734. // because http.StatusNotModified was returned.
  38735. func (c *GlobalAddressesTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  38736. gensupport.SetOptions(c.urlParams_, opts...)
  38737. res, err := c.doRequest("json")
  38738. if res != nil && res.StatusCode == http.StatusNotModified {
  38739. if res.Body != nil {
  38740. res.Body.Close()
  38741. }
  38742. return nil, &googleapi.Error{
  38743. Code: res.StatusCode,
  38744. Header: res.Header,
  38745. }
  38746. }
  38747. if err != nil {
  38748. return nil, err
  38749. }
  38750. defer googleapi.CloseBody(res)
  38751. if err := googleapi.CheckResponse(res); err != nil {
  38752. return nil, err
  38753. }
  38754. ret := &TestPermissionsResponse{
  38755. ServerResponse: googleapi.ServerResponse{
  38756. Header: res.Header,
  38757. HTTPStatusCode: res.StatusCode,
  38758. },
  38759. }
  38760. target := &ret
  38761. if err := gensupport.DecodeResponse(target, res); err != nil {
  38762. return nil, err
  38763. }
  38764. return ret, nil
  38765. // {
  38766. // "description": "Returns permissions that a caller has on the specified resource.",
  38767. // "httpMethod": "POST",
  38768. // "id": "compute.globalAddresses.testIamPermissions",
  38769. // "parameterOrder": [
  38770. // "project",
  38771. // "resource"
  38772. // ],
  38773. // "parameters": {
  38774. // "project": {
  38775. // "description": "Project ID for this request.",
  38776. // "location": "path",
  38777. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  38778. // "required": true,
  38779. // "type": "string"
  38780. // },
  38781. // "resource": {
  38782. // "description": "Name of the resource for this request.",
  38783. // "location": "path",
  38784. // "pattern": "(?:[-a-z0-9_]{0,62}[a-z0-9])?",
  38785. // "required": true,
  38786. // "type": "string"
  38787. // }
  38788. // },
  38789. // "path": "{project}/global/addresses/{resource}/testIamPermissions",
  38790. // "request": {
  38791. // "$ref": "TestPermissionsRequest"
  38792. // },
  38793. // "response": {
  38794. // "$ref": "TestPermissionsResponse"
  38795. // },
  38796. // "scopes": [
  38797. // "https://www.googleapis.com/auth/cloud-platform",
  38798. // "https://www.googleapis.com/auth/compute",
  38799. // "https://www.googleapis.com/auth/compute.readonly"
  38800. // ]
  38801. // }
  38802. }
  38803. // method id "compute.globalForwardingRules.delete":
  38804. type GlobalForwardingRulesDeleteCall struct {
  38805. s *Service
  38806. project string
  38807. forwardingRule string
  38808. urlParams_ gensupport.URLParams
  38809. ctx_ context.Context
  38810. header_ http.Header
  38811. }
  38812. // Delete: Deletes the specified GlobalForwardingRule resource.
  38813. // For details, see https://cloud.google.com/compute/docs/reference/latest/globalForwardingRules/delete
  38814. func (r *GlobalForwardingRulesService) Delete(project string, forwardingRule string) *GlobalForwardingRulesDeleteCall {
  38815. c := &GlobalForwardingRulesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  38816. c.project = project
  38817. c.forwardingRule = forwardingRule
  38818. return c
  38819. }
  38820. // RequestId sets the optional parameter "requestId": An optional
  38821. // request ID to identify requests. Specify a unique request ID so that
  38822. // if you must retry your request, the server will know to ignore the
  38823. // request if it has already been completed.
  38824. //
  38825. // For example, consider a situation where you make an initial request
  38826. // and the request times out. If you make the request again with the
  38827. // same request ID, the server can check if original operation with the
  38828. // same request ID was received, and if so, will ignore the second
  38829. // request. This prevents clients from accidentally creating duplicate
  38830. // commitments.
  38831. //
  38832. // The request ID must be a valid UUID with the exception that zero UUID
  38833. // is not supported (00000000-0000-0000-0000-000000000000).
  38834. func (c *GlobalForwardingRulesDeleteCall) RequestId(requestId string) *GlobalForwardingRulesDeleteCall {
  38835. c.urlParams_.Set("requestId", requestId)
  38836. return c
  38837. }
  38838. // Fields allows partial responses to be retrieved. See
  38839. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  38840. // for more information.
  38841. func (c *GlobalForwardingRulesDeleteCall) Fields(s ...googleapi.Field) *GlobalForwardingRulesDeleteCall {
  38842. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  38843. return c
  38844. }
  38845. // Context sets the context to be used in this call's Do method. Any
  38846. // pending HTTP request will be aborted if the provided context is
  38847. // canceled.
  38848. func (c *GlobalForwardingRulesDeleteCall) Context(ctx context.Context) *GlobalForwardingRulesDeleteCall {
  38849. c.ctx_ = ctx
  38850. return c
  38851. }
  38852. // Header returns an http.Header that can be modified by the caller to
  38853. // add HTTP headers to the request.
  38854. func (c *GlobalForwardingRulesDeleteCall) Header() http.Header {
  38855. if c.header_ == nil {
  38856. c.header_ = make(http.Header)
  38857. }
  38858. return c.header_
  38859. }
  38860. func (c *GlobalForwardingRulesDeleteCall) doRequest(alt string) (*http.Response, error) {
  38861. reqHeaders := make(http.Header)
  38862. for k, v := range c.header_ {
  38863. reqHeaders[k] = v
  38864. }
  38865. reqHeaders.Set("User-Agent", c.s.userAgent())
  38866. var body io.Reader = nil
  38867. c.urlParams_.Set("alt", alt)
  38868. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/forwardingRules/{forwardingRule}")
  38869. urls += "?" + c.urlParams_.Encode()
  38870. req, _ := http.NewRequest("DELETE", urls, body)
  38871. req.Header = reqHeaders
  38872. googleapi.Expand(req.URL, map[string]string{
  38873. "project": c.project,
  38874. "forwardingRule": c.forwardingRule,
  38875. })
  38876. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  38877. }
  38878. // Do executes the "compute.globalForwardingRules.delete" call.
  38879. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  38880. // status code is an error. Response headers are in either
  38881. // *Operation.ServerResponse.Header or (if a response was returned at
  38882. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  38883. // to check whether the returned error was because
  38884. // http.StatusNotModified was returned.
  38885. func (c *GlobalForwardingRulesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  38886. gensupport.SetOptions(c.urlParams_, opts...)
  38887. res, err := c.doRequest("json")
  38888. if res != nil && res.StatusCode == http.StatusNotModified {
  38889. if res.Body != nil {
  38890. res.Body.Close()
  38891. }
  38892. return nil, &googleapi.Error{
  38893. Code: res.StatusCode,
  38894. Header: res.Header,
  38895. }
  38896. }
  38897. if err != nil {
  38898. return nil, err
  38899. }
  38900. defer googleapi.CloseBody(res)
  38901. if err := googleapi.CheckResponse(res); err != nil {
  38902. return nil, err
  38903. }
  38904. ret := &Operation{
  38905. ServerResponse: googleapi.ServerResponse{
  38906. Header: res.Header,
  38907. HTTPStatusCode: res.StatusCode,
  38908. },
  38909. }
  38910. target := &ret
  38911. if err := gensupport.DecodeResponse(target, res); err != nil {
  38912. return nil, err
  38913. }
  38914. return ret, nil
  38915. // {
  38916. // "description": "Deletes the specified GlobalForwardingRule resource.",
  38917. // "httpMethod": "DELETE",
  38918. // "id": "compute.globalForwardingRules.delete",
  38919. // "parameterOrder": [
  38920. // "project",
  38921. // "forwardingRule"
  38922. // ],
  38923. // "parameters": {
  38924. // "forwardingRule": {
  38925. // "description": "Name of the ForwardingRule resource to delete.",
  38926. // "location": "path",
  38927. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  38928. // "required": true,
  38929. // "type": "string"
  38930. // },
  38931. // "project": {
  38932. // "description": "Project ID for this request.",
  38933. // "location": "path",
  38934. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  38935. // "required": true,
  38936. // "type": "string"
  38937. // },
  38938. // "requestId": {
  38939. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  38940. // "location": "query",
  38941. // "type": "string"
  38942. // }
  38943. // },
  38944. // "path": "{project}/global/forwardingRules/{forwardingRule}",
  38945. // "response": {
  38946. // "$ref": "Operation"
  38947. // },
  38948. // "scopes": [
  38949. // "https://www.googleapis.com/auth/cloud-platform",
  38950. // "https://www.googleapis.com/auth/compute"
  38951. // ]
  38952. // }
  38953. }
  38954. // method id "compute.globalForwardingRules.get":
  38955. type GlobalForwardingRulesGetCall struct {
  38956. s *Service
  38957. project string
  38958. forwardingRule string
  38959. urlParams_ gensupport.URLParams
  38960. ifNoneMatch_ string
  38961. ctx_ context.Context
  38962. header_ http.Header
  38963. }
  38964. // Get: Returns the specified GlobalForwardingRule resource. Gets a list
  38965. // of available forwarding rules by making a list() request.
  38966. // For details, see https://cloud.google.com/compute/docs/reference/latest/globalForwardingRules/get
  38967. func (r *GlobalForwardingRulesService) Get(project string, forwardingRule string) *GlobalForwardingRulesGetCall {
  38968. c := &GlobalForwardingRulesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  38969. c.project = project
  38970. c.forwardingRule = forwardingRule
  38971. return c
  38972. }
  38973. // Fields allows partial responses to be retrieved. See
  38974. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  38975. // for more information.
  38976. func (c *GlobalForwardingRulesGetCall) Fields(s ...googleapi.Field) *GlobalForwardingRulesGetCall {
  38977. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  38978. return c
  38979. }
  38980. // IfNoneMatch sets the optional parameter which makes the operation
  38981. // fail if the object's ETag matches the given value. This is useful for
  38982. // getting updates only after the object has changed since the last
  38983. // request. Use googleapi.IsNotModified to check whether the response
  38984. // error from Do is the result of In-None-Match.
  38985. func (c *GlobalForwardingRulesGetCall) IfNoneMatch(entityTag string) *GlobalForwardingRulesGetCall {
  38986. c.ifNoneMatch_ = entityTag
  38987. return c
  38988. }
  38989. // Context sets the context to be used in this call's Do method. Any
  38990. // pending HTTP request will be aborted if the provided context is
  38991. // canceled.
  38992. func (c *GlobalForwardingRulesGetCall) Context(ctx context.Context) *GlobalForwardingRulesGetCall {
  38993. c.ctx_ = ctx
  38994. return c
  38995. }
  38996. // Header returns an http.Header that can be modified by the caller to
  38997. // add HTTP headers to the request.
  38998. func (c *GlobalForwardingRulesGetCall) Header() http.Header {
  38999. if c.header_ == nil {
  39000. c.header_ = make(http.Header)
  39001. }
  39002. return c.header_
  39003. }
  39004. func (c *GlobalForwardingRulesGetCall) doRequest(alt string) (*http.Response, error) {
  39005. reqHeaders := make(http.Header)
  39006. for k, v := range c.header_ {
  39007. reqHeaders[k] = v
  39008. }
  39009. reqHeaders.Set("User-Agent", c.s.userAgent())
  39010. if c.ifNoneMatch_ != "" {
  39011. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  39012. }
  39013. var body io.Reader = nil
  39014. c.urlParams_.Set("alt", alt)
  39015. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/forwardingRules/{forwardingRule}")
  39016. urls += "?" + c.urlParams_.Encode()
  39017. req, _ := http.NewRequest("GET", urls, body)
  39018. req.Header = reqHeaders
  39019. googleapi.Expand(req.URL, map[string]string{
  39020. "project": c.project,
  39021. "forwardingRule": c.forwardingRule,
  39022. })
  39023. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  39024. }
  39025. // Do executes the "compute.globalForwardingRules.get" call.
  39026. // Exactly one of *ForwardingRule or error will be non-nil. Any non-2xx
  39027. // status code is an error. Response headers are in either
  39028. // *ForwardingRule.ServerResponse.Header or (if a response was returned
  39029. // at all) in error.(*googleapi.Error).Header. Use
  39030. // googleapi.IsNotModified to check whether the returned error was
  39031. // because http.StatusNotModified was returned.
  39032. func (c *GlobalForwardingRulesGetCall) Do(opts ...googleapi.CallOption) (*ForwardingRule, error) {
  39033. gensupport.SetOptions(c.urlParams_, opts...)
  39034. res, err := c.doRequest("json")
  39035. if res != nil && res.StatusCode == http.StatusNotModified {
  39036. if res.Body != nil {
  39037. res.Body.Close()
  39038. }
  39039. return nil, &googleapi.Error{
  39040. Code: res.StatusCode,
  39041. Header: res.Header,
  39042. }
  39043. }
  39044. if err != nil {
  39045. return nil, err
  39046. }
  39047. defer googleapi.CloseBody(res)
  39048. if err := googleapi.CheckResponse(res); err != nil {
  39049. return nil, err
  39050. }
  39051. ret := &ForwardingRule{
  39052. ServerResponse: googleapi.ServerResponse{
  39053. Header: res.Header,
  39054. HTTPStatusCode: res.StatusCode,
  39055. },
  39056. }
  39057. target := &ret
  39058. if err := gensupport.DecodeResponse(target, res); err != nil {
  39059. return nil, err
  39060. }
  39061. return ret, nil
  39062. // {
  39063. // "description": "Returns the specified GlobalForwardingRule resource. Gets a list of available forwarding rules by making a list() request.",
  39064. // "httpMethod": "GET",
  39065. // "id": "compute.globalForwardingRules.get",
  39066. // "parameterOrder": [
  39067. // "project",
  39068. // "forwardingRule"
  39069. // ],
  39070. // "parameters": {
  39071. // "forwardingRule": {
  39072. // "description": "Name of the ForwardingRule resource to return.",
  39073. // "location": "path",
  39074. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  39075. // "required": true,
  39076. // "type": "string"
  39077. // },
  39078. // "project": {
  39079. // "description": "Project ID for this request.",
  39080. // "location": "path",
  39081. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  39082. // "required": true,
  39083. // "type": "string"
  39084. // }
  39085. // },
  39086. // "path": "{project}/global/forwardingRules/{forwardingRule}",
  39087. // "response": {
  39088. // "$ref": "ForwardingRule"
  39089. // },
  39090. // "scopes": [
  39091. // "https://www.googleapis.com/auth/cloud-platform",
  39092. // "https://www.googleapis.com/auth/compute",
  39093. // "https://www.googleapis.com/auth/compute.readonly"
  39094. // ]
  39095. // }
  39096. }
  39097. // method id "compute.globalForwardingRules.insert":
  39098. type GlobalForwardingRulesInsertCall struct {
  39099. s *Service
  39100. project string
  39101. forwardingrule *ForwardingRule
  39102. urlParams_ gensupport.URLParams
  39103. ctx_ context.Context
  39104. header_ http.Header
  39105. }
  39106. // Insert: Creates a GlobalForwardingRule resource in the specified
  39107. // project using the data included in the request.
  39108. // For details, see https://cloud.google.com/compute/docs/reference/latest/globalForwardingRules/insert
  39109. func (r *GlobalForwardingRulesService) Insert(project string, forwardingrule *ForwardingRule) *GlobalForwardingRulesInsertCall {
  39110. c := &GlobalForwardingRulesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  39111. c.project = project
  39112. c.forwardingrule = forwardingrule
  39113. return c
  39114. }
  39115. // RequestId sets the optional parameter "requestId": An optional
  39116. // request ID to identify requests. Specify a unique request ID so that
  39117. // if you must retry your request, the server will know to ignore the
  39118. // request if it has already been completed.
  39119. //
  39120. // For example, consider a situation where you make an initial request
  39121. // and the request times out. If you make the request again with the
  39122. // same request ID, the server can check if original operation with the
  39123. // same request ID was received, and if so, will ignore the second
  39124. // request. This prevents clients from accidentally creating duplicate
  39125. // commitments.
  39126. //
  39127. // The request ID must be a valid UUID with the exception that zero UUID
  39128. // is not supported (00000000-0000-0000-0000-000000000000).
  39129. func (c *GlobalForwardingRulesInsertCall) RequestId(requestId string) *GlobalForwardingRulesInsertCall {
  39130. c.urlParams_.Set("requestId", requestId)
  39131. return c
  39132. }
  39133. // Fields allows partial responses to be retrieved. See
  39134. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  39135. // for more information.
  39136. func (c *GlobalForwardingRulesInsertCall) Fields(s ...googleapi.Field) *GlobalForwardingRulesInsertCall {
  39137. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  39138. return c
  39139. }
  39140. // Context sets the context to be used in this call's Do method. Any
  39141. // pending HTTP request will be aborted if the provided context is
  39142. // canceled.
  39143. func (c *GlobalForwardingRulesInsertCall) Context(ctx context.Context) *GlobalForwardingRulesInsertCall {
  39144. c.ctx_ = ctx
  39145. return c
  39146. }
  39147. // Header returns an http.Header that can be modified by the caller to
  39148. // add HTTP headers to the request.
  39149. func (c *GlobalForwardingRulesInsertCall) Header() http.Header {
  39150. if c.header_ == nil {
  39151. c.header_ = make(http.Header)
  39152. }
  39153. return c.header_
  39154. }
  39155. func (c *GlobalForwardingRulesInsertCall) doRequest(alt string) (*http.Response, error) {
  39156. reqHeaders := make(http.Header)
  39157. for k, v := range c.header_ {
  39158. reqHeaders[k] = v
  39159. }
  39160. reqHeaders.Set("User-Agent", c.s.userAgent())
  39161. var body io.Reader = nil
  39162. body, err := googleapi.WithoutDataWrapper.JSONReader(c.forwardingrule)
  39163. if err != nil {
  39164. return nil, err
  39165. }
  39166. reqHeaders.Set("Content-Type", "application/json")
  39167. c.urlParams_.Set("alt", alt)
  39168. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/forwardingRules")
  39169. urls += "?" + c.urlParams_.Encode()
  39170. req, _ := http.NewRequest("POST", urls, body)
  39171. req.Header = reqHeaders
  39172. googleapi.Expand(req.URL, map[string]string{
  39173. "project": c.project,
  39174. })
  39175. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  39176. }
  39177. // Do executes the "compute.globalForwardingRules.insert" call.
  39178. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  39179. // status code is an error. Response headers are in either
  39180. // *Operation.ServerResponse.Header or (if a response was returned at
  39181. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  39182. // to check whether the returned error was because
  39183. // http.StatusNotModified was returned.
  39184. func (c *GlobalForwardingRulesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  39185. gensupport.SetOptions(c.urlParams_, opts...)
  39186. res, err := c.doRequest("json")
  39187. if res != nil && res.StatusCode == http.StatusNotModified {
  39188. if res.Body != nil {
  39189. res.Body.Close()
  39190. }
  39191. return nil, &googleapi.Error{
  39192. Code: res.StatusCode,
  39193. Header: res.Header,
  39194. }
  39195. }
  39196. if err != nil {
  39197. return nil, err
  39198. }
  39199. defer googleapi.CloseBody(res)
  39200. if err := googleapi.CheckResponse(res); err != nil {
  39201. return nil, err
  39202. }
  39203. ret := &Operation{
  39204. ServerResponse: googleapi.ServerResponse{
  39205. Header: res.Header,
  39206. HTTPStatusCode: res.StatusCode,
  39207. },
  39208. }
  39209. target := &ret
  39210. if err := gensupport.DecodeResponse(target, res); err != nil {
  39211. return nil, err
  39212. }
  39213. return ret, nil
  39214. // {
  39215. // "description": "Creates a GlobalForwardingRule resource in the specified project using the data included in the request.",
  39216. // "httpMethod": "POST",
  39217. // "id": "compute.globalForwardingRules.insert",
  39218. // "parameterOrder": [
  39219. // "project"
  39220. // ],
  39221. // "parameters": {
  39222. // "project": {
  39223. // "description": "Project ID for this request.",
  39224. // "location": "path",
  39225. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  39226. // "required": true,
  39227. // "type": "string"
  39228. // },
  39229. // "requestId": {
  39230. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  39231. // "location": "query",
  39232. // "type": "string"
  39233. // }
  39234. // },
  39235. // "path": "{project}/global/forwardingRules",
  39236. // "request": {
  39237. // "$ref": "ForwardingRule"
  39238. // },
  39239. // "response": {
  39240. // "$ref": "Operation"
  39241. // },
  39242. // "scopes": [
  39243. // "https://www.googleapis.com/auth/cloud-platform",
  39244. // "https://www.googleapis.com/auth/compute"
  39245. // ]
  39246. // }
  39247. }
  39248. // method id "compute.globalForwardingRules.list":
  39249. type GlobalForwardingRulesListCall struct {
  39250. s *Service
  39251. project string
  39252. urlParams_ gensupport.URLParams
  39253. ifNoneMatch_ string
  39254. ctx_ context.Context
  39255. header_ http.Header
  39256. }
  39257. // List: Retrieves a list of GlobalForwardingRule resources available to
  39258. // the specified project.
  39259. // For details, see https://cloud.google.com/compute/docs/reference/latest/globalForwardingRules/list
  39260. func (r *GlobalForwardingRulesService) List(project string) *GlobalForwardingRulesListCall {
  39261. c := &GlobalForwardingRulesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  39262. c.project = project
  39263. return c
  39264. }
  39265. // Filter sets the optional parameter "filter": A filter expression that
  39266. // filters resources listed in the response. The expression must specify
  39267. // the field name, a comparison operator, and the value that you want to
  39268. // use for filtering. The value must be a string, a number, or a
  39269. // boolean. The comparison operator must be either =, !=, >, or <.
  39270. //
  39271. // For example, if you are filtering Compute Engine instances, you can
  39272. // exclude instances named example-instance by specifying name !=
  39273. // example-instance.
  39274. //
  39275. // You can also filter nested fields. For example, you could specify
  39276. // scheduling.automaticRestart = false to include instances only if they
  39277. // are not scheduled for automatic restarts. You can use filtering on
  39278. // nested fields to filter based on resource labels.
  39279. //
  39280. // To filter on multiple expressions, provide each separate expression
  39281. // within parentheses. For example, (scheduling.automaticRestart = true)
  39282. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  39283. // AND expression. However, you can include AND and OR expressions
  39284. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  39285. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  39286. // true).
  39287. func (c *GlobalForwardingRulesListCall) Filter(filter string) *GlobalForwardingRulesListCall {
  39288. c.urlParams_.Set("filter", filter)
  39289. return c
  39290. }
  39291. // MaxResults sets the optional parameter "maxResults": The maximum
  39292. // number of results per page that should be returned. If the number of
  39293. // available results is larger than maxResults, Compute Engine returns a
  39294. // nextPageToken that can be used to get the next page of results in
  39295. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  39296. // (Default: 500)
  39297. func (c *GlobalForwardingRulesListCall) MaxResults(maxResults int64) *GlobalForwardingRulesListCall {
  39298. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  39299. return c
  39300. }
  39301. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  39302. // a certain order. By default, results are returned in alphanumerical
  39303. // order based on the resource name.
  39304. //
  39305. // You can also sort results in descending order based on the creation
  39306. // timestamp using orderBy="creationTimestamp desc". This sorts results
  39307. // based on the creationTimestamp field in reverse chronological order
  39308. // (newest result first). Use this to sort resources like operations so
  39309. // that the newest operation is returned first.
  39310. //
  39311. // Currently, only sorting by name or creationTimestamp desc is
  39312. // supported.
  39313. func (c *GlobalForwardingRulesListCall) OrderBy(orderBy string) *GlobalForwardingRulesListCall {
  39314. c.urlParams_.Set("orderBy", orderBy)
  39315. return c
  39316. }
  39317. // PageToken sets the optional parameter "pageToken": Specifies a page
  39318. // token to use. Set pageToken to the nextPageToken returned by a
  39319. // previous list request to get the next page of results.
  39320. func (c *GlobalForwardingRulesListCall) PageToken(pageToken string) *GlobalForwardingRulesListCall {
  39321. c.urlParams_.Set("pageToken", pageToken)
  39322. return c
  39323. }
  39324. // Fields allows partial responses to be retrieved. See
  39325. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  39326. // for more information.
  39327. func (c *GlobalForwardingRulesListCall) Fields(s ...googleapi.Field) *GlobalForwardingRulesListCall {
  39328. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  39329. return c
  39330. }
  39331. // IfNoneMatch sets the optional parameter which makes the operation
  39332. // fail if the object's ETag matches the given value. This is useful for
  39333. // getting updates only after the object has changed since the last
  39334. // request. Use googleapi.IsNotModified to check whether the response
  39335. // error from Do is the result of In-None-Match.
  39336. func (c *GlobalForwardingRulesListCall) IfNoneMatch(entityTag string) *GlobalForwardingRulesListCall {
  39337. c.ifNoneMatch_ = entityTag
  39338. return c
  39339. }
  39340. // Context sets the context to be used in this call's Do method. Any
  39341. // pending HTTP request will be aborted if the provided context is
  39342. // canceled.
  39343. func (c *GlobalForwardingRulesListCall) Context(ctx context.Context) *GlobalForwardingRulesListCall {
  39344. c.ctx_ = ctx
  39345. return c
  39346. }
  39347. // Header returns an http.Header that can be modified by the caller to
  39348. // add HTTP headers to the request.
  39349. func (c *GlobalForwardingRulesListCall) Header() http.Header {
  39350. if c.header_ == nil {
  39351. c.header_ = make(http.Header)
  39352. }
  39353. return c.header_
  39354. }
  39355. func (c *GlobalForwardingRulesListCall) doRequest(alt string) (*http.Response, error) {
  39356. reqHeaders := make(http.Header)
  39357. for k, v := range c.header_ {
  39358. reqHeaders[k] = v
  39359. }
  39360. reqHeaders.Set("User-Agent", c.s.userAgent())
  39361. if c.ifNoneMatch_ != "" {
  39362. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  39363. }
  39364. var body io.Reader = nil
  39365. c.urlParams_.Set("alt", alt)
  39366. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/forwardingRules")
  39367. urls += "?" + c.urlParams_.Encode()
  39368. req, _ := http.NewRequest("GET", urls, body)
  39369. req.Header = reqHeaders
  39370. googleapi.Expand(req.URL, map[string]string{
  39371. "project": c.project,
  39372. })
  39373. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  39374. }
  39375. // Do executes the "compute.globalForwardingRules.list" call.
  39376. // Exactly one of *ForwardingRuleList or error will be non-nil. Any
  39377. // non-2xx status code is an error. Response headers are in either
  39378. // *ForwardingRuleList.ServerResponse.Header or (if a response was
  39379. // returned at all) in error.(*googleapi.Error).Header. Use
  39380. // googleapi.IsNotModified to check whether the returned error was
  39381. // because http.StatusNotModified was returned.
  39382. func (c *GlobalForwardingRulesListCall) Do(opts ...googleapi.CallOption) (*ForwardingRuleList, error) {
  39383. gensupport.SetOptions(c.urlParams_, opts...)
  39384. res, err := c.doRequest("json")
  39385. if res != nil && res.StatusCode == http.StatusNotModified {
  39386. if res.Body != nil {
  39387. res.Body.Close()
  39388. }
  39389. return nil, &googleapi.Error{
  39390. Code: res.StatusCode,
  39391. Header: res.Header,
  39392. }
  39393. }
  39394. if err != nil {
  39395. return nil, err
  39396. }
  39397. defer googleapi.CloseBody(res)
  39398. if err := googleapi.CheckResponse(res); err != nil {
  39399. return nil, err
  39400. }
  39401. ret := &ForwardingRuleList{
  39402. ServerResponse: googleapi.ServerResponse{
  39403. Header: res.Header,
  39404. HTTPStatusCode: res.StatusCode,
  39405. },
  39406. }
  39407. target := &ret
  39408. if err := gensupport.DecodeResponse(target, res); err != nil {
  39409. return nil, err
  39410. }
  39411. return ret, nil
  39412. // {
  39413. // "description": "Retrieves a list of GlobalForwardingRule resources available to the specified project.",
  39414. // "httpMethod": "GET",
  39415. // "id": "compute.globalForwardingRules.list",
  39416. // "parameterOrder": [
  39417. // "project"
  39418. // ],
  39419. // "parameters": {
  39420. // "filter": {
  39421. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  39422. // "location": "query",
  39423. // "type": "string"
  39424. // },
  39425. // "maxResults": {
  39426. // "default": "500",
  39427. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  39428. // "format": "uint32",
  39429. // "location": "query",
  39430. // "minimum": "0",
  39431. // "type": "integer"
  39432. // },
  39433. // "orderBy": {
  39434. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  39435. // "location": "query",
  39436. // "type": "string"
  39437. // },
  39438. // "pageToken": {
  39439. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  39440. // "location": "query",
  39441. // "type": "string"
  39442. // },
  39443. // "project": {
  39444. // "description": "Project ID for this request.",
  39445. // "location": "path",
  39446. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  39447. // "required": true,
  39448. // "type": "string"
  39449. // }
  39450. // },
  39451. // "path": "{project}/global/forwardingRules",
  39452. // "response": {
  39453. // "$ref": "ForwardingRuleList"
  39454. // },
  39455. // "scopes": [
  39456. // "https://www.googleapis.com/auth/cloud-platform",
  39457. // "https://www.googleapis.com/auth/compute",
  39458. // "https://www.googleapis.com/auth/compute.readonly"
  39459. // ]
  39460. // }
  39461. }
  39462. // Pages invokes f for each page of results.
  39463. // A non-nil error returned from f will halt the iteration.
  39464. // The provided context supersedes any context provided to the Context method.
  39465. func (c *GlobalForwardingRulesListCall) Pages(ctx context.Context, f func(*ForwardingRuleList) error) error {
  39466. c.ctx_ = ctx
  39467. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  39468. for {
  39469. x, err := c.Do()
  39470. if err != nil {
  39471. return err
  39472. }
  39473. if err := f(x); err != nil {
  39474. return err
  39475. }
  39476. if x.NextPageToken == "" {
  39477. return nil
  39478. }
  39479. c.PageToken(x.NextPageToken)
  39480. }
  39481. }
  39482. // method id "compute.globalForwardingRules.setLabels":
  39483. type GlobalForwardingRulesSetLabelsCall struct {
  39484. s *Service
  39485. project string
  39486. resource string
  39487. globalsetlabelsrequest *GlobalSetLabelsRequest
  39488. urlParams_ gensupport.URLParams
  39489. ctx_ context.Context
  39490. header_ http.Header
  39491. }
  39492. // SetLabels: Sets the labels on the specified resource. To learn more
  39493. // about labels, read the Labeling Resources documentation.
  39494. func (r *GlobalForwardingRulesService) SetLabels(project string, resource string, globalsetlabelsrequest *GlobalSetLabelsRequest) *GlobalForwardingRulesSetLabelsCall {
  39495. c := &GlobalForwardingRulesSetLabelsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  39496. c.project = project
  39497. c.resource = resource
  39498. c.globalsetlabelsrequest = globalsetlabelsrequest
  39499. return c
  39500. }
  39501. // Fields allows partial responses to be retrieved. See
  39502. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  39503. // for more information.
  39504. func (c *GlobalForwardingRulesSetLabelsCall) Fields(s ...googleapi.Field) *GlobalForwardingRulesSetLabelsCall {
  39505. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  39506. return c
  39507. }
  39508. // Context sets the context to be used in this call's Do method. Any
  39509. // pending HTTP request will be aborted if the provided context is
  39510. // canceled.
  39511. func (c *GlobalForwardingRulesSetLabelsCall) Context(ctx context.Context) *GlobalForwardingRulesSetLabelsCall {
  39512. c.ctx_ = ctx
  39513. return c
  39514. }
  39515. // Header returns an http.Header that can be modified by the caller to
  39516. // add HTTP headers to the request.
  39517. func (c *GlobalForwardingRulesSetLabelsCall) Header() http.Header {
  39518. if c.header_ == nil {
  39519. c.header_ = make(http.Header)
  39520. }
  39521. return c.header_
  39522. }
  39523. func (c *GlobalForwardingRulesSetLabelsCall) doRequest(alt string) (*http.Response, error) {
  39524. reqHeaders := make(http.Header)
  39525. for k, v := range c.header_ {
  39526. reqHeaders[k] = v
  39527. }
  39528. reqHeaders.Set("User-Agent", c.s.userAgent())
  39529. var body io.Reader = nil
  39530. body, err := googleapi.WithoutDataWrapper.JSONReader(c.globalsetlabelsrequest)
  39531. if err != nil {
  39532. return nil, err
  39533. }
  39534. reqHeaders.Set("Content-Type", "application/json")
  39535. c.urlParams_.Set("alt", alt)
  39536. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/forwardingRules/{resource}/setLabels")
  39537. urls += "?" + c.urlParams_.Encode()
  39538. req, _ := http.NewRequest("POST", urls, body)
  39539. req.Header = reqHeaders
  39540. googleapi.Expand(req.URL, map[string]string{
  39541. "project": c.project,
  39542. "resource": c.resource,
  39543. })
  39544. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  39545. }
  39546. // Do executes the "compute.globalForwardingRules.setLabels" call.
  39547. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  39548. // status code is an error. Response headers are in either
  39549. // *Operation.ServerResponse.Header or (if a response was returned at
  39550. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  39551. // to check whether the returned error was because
  39552. // http.StatusNotModified was returned.
  39553. func (c *GlobalForwardingRulesSetLabelsCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  39554. gensupport.SetOptions(c.urlParams_, opts...)
  39555. res, err := c.doRequest("json")
  39556. if res != nil && res.StatusCode == http.StatusNotModified {
  39557. if res.Body != nil {
  39558. res.Body.Close()
  39559. }
  39560. return nil, &googleapi.Error{
  39561. Code: res.StatusCode,
  39562. Header: res.Header,
  39563. }
  39564. }
  39565. if err != nil {
  39566. return nil, err
  39567. }
  39568. defer googleapi.CloseBody(res)
  39569. if err := googleapi.CheckResponse(res); err != nil {
  39570. return nil, err
  39571. }
  39572. ret := &Operation{
  39573. ServerResponse: googleapi.ServerResponse{
  39574. Header: res.Header,
  39575. HTTPStatusCode: res.StatusCode,
  39576. },
  39577. }
  39578. target := &ret
  39579. if err := gensupport.DecodeResponse(target, res); err != nil {
  39580. return nil, err
  39581. }
  39582. return ret, nil
  39583. // {
  39584. // "description": "Sets the labels on the specified resource. To learn more about labels, read the Labeling Resources documentation.",
  39585. // "httpMethod": "POST",
  39586. // "id": "compute.globalForwardingRules.setLabels",
  39587. // "parameterOrder": [
  39588. // "project",
  39589. // "resource"
  39590. // ],
  39591. // "parameters": {
  39592. // "project": {
  39593. // "description": "Project ID for this request.",
  39594. // "location": "path",
  39595. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  39596. // "required": true,
  39597. // "type": "string"
  39598. // },
  39599. // "resource": {
  39600. // "description": "Name of the resource for this request.",
  39601. // "location": "path",
  39602. // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?",
  39603. // "required": true,
  39604. // "type": "string"
  39605. // }
  39606. // },
  39607. // "path": "{project}/global/forwardingRules/{resource}/setLabels",
  39608. // "request": {
  39609. // "$ref": "GlobalSetLabelsRequest"
  39610. // },
  39611. // "response": {
  39612. // "$ref": "Operation"
  39613. // },
  39614. // "scopes": [
  39615. // "https://www.googleapis.com/auth/cloud-platform",
  39616. // "https://www.googleapis.com/auth/compute"
  39617. // ]
  39618. // }
  39619. }
  39620. // method id "compute.globalForwardingRules.setTarget":
  39621. type GlobalForwardingRulesSetTargetCall struct {
  39622. s *Service
  39623. project string
  39624. forwardingRule string
  39625. targetreference *TargetReference
  39626. urlParams_ gensupport.URLParams
  39627. ctx_ context.Context
  39628. header_ http.Header
  39629. }
  39630. // SetTarget: Changes target URL for the GlobalForwardingRule resource.
  39631. // The new target should be of the same type as the old target.
  39632. // For details, see https://cloud.google.com/compute/docs/reference/latest/globalForwardingRules/setTarget
  39633. func (r *GlobalForwardingRulesService) SetTarget(project string, forwardingRule string, targetreference *TargetReference) *GlobalForwardingRulesSetTargetCall {
  39634. c := &GlobalForwardingRulesSetTargetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  39635. c.project = project
  39636. c.forwardingRule = forwardingRule
  39637. c.targetreference = targetreference
  39638. return c
  39639. }
  39640. // RequestId sets the optional parameter "requestId": An optional
  39641. // request ID to identify requests. Specify a unique request ID so that
  39642. // if you must retry your request, the server will know to ignore the
  39643. // request if it has already been completed.
  39644. //
  39645. // For example, consider a situation where you make an initial request
  39646. // and the request times out. If you make the request again with the
  39647. // same request ID, the server can check if original operation with the
  39648. // same request ID was received, and if so, will ignore the second
  39649. // request. This prevents clients from accidentally creating duplicate
  39650. // commitments.
  39651. //
  39652. // The request ID must be a valid UUID with the exception that zero UUID
  39653. // is not supported (00000000-0000-0000-0000-000000000000).
  39654. func (c *GlobalForwardingRulesSetTargetCall) RequestId(requestId string) *GlobalForwardingRulesSetTargetCall {
  39655. c.urlParams_.Set("requestId", requestId)
  39656. return c
  39657. }
  39658. // Fields allows partial responses to be retrieved. See
  39659. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  39660. // for more information.
  39661. func (c *GlobalForwardingRulesSetTargetCall) Fields(s ...googleapi.Field) *GlobalForwardingRulesSetTargetCall {
  39662. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  39663. return c
  39664. }
  39665. // Context sets the context to be used in this call's Do method. Any
  39666. // pending HTTP request will be aborted if the provided context is
  39667. // canceled.
  39668. func (c *GlobalForwardingRulesSetTargetCall) Context(ctx context.Context) *GlobalForwardingRulesSetTargetCall {
  39669. c.ctx_ = ctx
  39670. return c
  39671. }
  39672. // Header returns an http.Header that can be modified by the caller to
  39673. // add HTTP headers to the request.
  39674. func (c *GlobalForwardingRulesSetTargetCall) Header() http.Header {
  39675. if c.header_ == nil {
  39676. c.header_ = make(http.Header)
  39677. }
  39678. return c.header_
  39679. }
  39680. func (c *GlobalForwardingRulesSetTargetCall) doRequest(alt string) (*http.Response, error) {
  39681. reqHeaders := make(http.Header)
  39682. for k, v := range c.header_ {
  39683. reqHeaders[k] = v
  39684. }
  39685. reqHeaders.Set("User-Agent", c.s.userAgent())
  39686. var body io.Reader = nil
  39687. body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetreference)
  39688. if err != nil {
  39689. return nil, err
  39690. }
  39691. reqHeaders.Set("Content-Type", "application/json")
  39692. c.urlParams_.Set("alt", alt)
  39693. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/forwardingRules/{forwardingRule}/setTarget")
  39694. urls += "?" + c.urlParams_.Encode()
  39695. req, _ := http.NewRequest("POST", urls, body)
  39696. req.Header = reqHeaders
  39697. googleapi.Expand(req.URL, map[string]string{
  39698. "project": c.project,
  39699. "forwardingRule": c.forwardingRule,
  39700. })
  39701. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  39702. }
  39703. // Do executes the "compute.globalForwardingRules.setTarget" call.
  39704. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  39705. // status code is an error. Response headers are in either
  39706. // *Operation.ServerResponse.Header or (if a response was returned at
  39707. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  39708. // to check whether the returned error was because
  39709. // http.StatusNotModified was returned.
  39710. func (c *GlobalForwardingRulesSetTargetCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  39711. gensupport.SetOptions(c.urlParams_, opts...)
  39712. res, err := c.doRequest("json")
  39713. if res != nil && res.StatusCode == http.StatusNotModified {
  39714. if res.Body != nil {
  39715. res.Body.Close()
  39716. }
  39717. return nil, &googleapi.Error{
  39718. Code: res.StatusCode,
  39719. Header: res.Header,
  39720. }
  39721. }
  39722. if err != nil {
  39723. return nil, err
  39724. }
  39725. defer googleapi.CloseBody(res)
  39726. if err := googleapi.CheckResponse(res); err != nil {
  39727. return nil, err
  39728. }
  39729. ret := &Operation{
  39730. ServerResponse: googleapi.ServerResponse{
  39731. Header: res.Header,
  39732. HTTPStatusCode: res.StatusCode,
  39733. },
  39734. }
  39735. target := &ret
  39736. if err := gensupport.DecodeResponse(target, res); err != nil {
  39737. return nil, err
  39738. }
  39739. return ret, nil
  39740. // {
  39741. // "description": "Changes target URL for the GlobalForwardingRule resource. The new target should be of the same type as the old target.",
  39742. // "httpMethod": "POST",
  39743. // "id": "compute.globalForwardingRules.setTarget",
  39744. // "parameterOrder": [
  39745. // "project",
  39746. // "forwardingRule"
  39747. // ],
  39748. // "parameters": {
  39749. // "forwardingRule": {
  39750. // "description": "Name of the ForwardingRule resource in which target is to be set.",
  39751. // "location": "path",
  39752. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  39753. // "required": true,
  39754. // "type": "string"
  39755. // },
  39756. // "project": {
  39757. // "description": "Project ID for this request.",
  39758. // "location": "path",
  39759. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  39760. // "required": true,
  39761. // "type": "string"
  39762. // },
  39763. // "requestId": {
  39764. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  39765. // "location": "query",
  39766. // "type": "string"
  39767. // }
  39768. // },
  39769. // "path": "{project}/global/forwardingRules/{forwardingRule}/setTarget",
  39770. // "request": {
  39771. // "$ref": "TargetReference"
  39772. // },
  39773. // "response": {
  39774. // "$ref": "Operation"
  39775. // },
  39776. // "scopes": [
  39777. // "https://www.googleapis.com/auth/cloud-platform",
  39778. // "https://www.googleapis.com/auth/compute"
  39779. // ]
  39780. // }
  39781. }
  39782. // method id "compute.globalForwardingRules.testIamPermissions":
  39783. type GlobalForwardingRulesTestIamPermissionsCall struct {
  39784. s *Service
  39785. project string
  39786. resource string
  39787. testpermissionsrequest *TestPermissionsRequest
  39788. urlParams_ gensupport.URLParams
  39789. ctx_ context.Context
  39790. header_ http.Header
  39791. }
  39792. // TestIamPermissions: Returns permissions that a caller has on the
  39793. // specified resource.
  39794. func (r *GlobalForwardingRulesService) TestIamPermissions(project string, resource string, testpermissionsrequest *TestPermissionsRequest) *GlobalForwardingRulesTestIamPermissionsCall {
  39795. c := &GlobalForwardingRulesTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  39796. c.project = project
  39797. c.resource = resource
  39798. c.testpermissionsrequest = testpermissionsrequest
  39799. return c
  39800. }
  39801. // Fields allows partial responses to be retrieved. See
  39802. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  39803. // for more information.
  39804. func (c *GlobalForwardingRulesTestIamPermissionsCall) Fields(s ...googleapi.Field) *GlobalForwardingRulesTestIamPermissionsCall {
  39805. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  39806. return c
  39807. }
  39808. // Context sets the context to be used in this call's Do method. Any
  39809. // pending HTTP request will be aborted if the provided context is
  39810. // canceled.
  39811. func (c *GlobalForwardingRulesTestIamPermissionsCall) Context(ctx context.Context) *GlobalForwardingRulesTestIamPermissionsCall {
  39812. c.ctx_ = ctx
  39813. return c
  39814. }
  39815. // Header returns an http.Header that can be modified by the caller to
  39816. // add HTTP headers to the request.
  39817. func (c *GlobalForwardingRulesTestIamPermissionsCall) Header() http.Header {
  39818. if c.header_ == nil {
  39819. c.header_ = make(http.Header)
  39820. }
  39821. return c.header_
  39822. }
  39823. func (c *GlobalForwardingRulesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  39824. reqHeaders := make(http.Header)
  39825. for k, v := range c.header_ {
  39826. reqHeaders[k] = v
  39827. }
  39828. reqHeaders.Set("User-Agent", c.s.userAgent())
  39829. var body io.Reader = nil
  39830. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  39831. if err != nil {
  39832. return nil, err
  39833. }
  39834. reqHeaders.Set("Content-Type", "application/json")
  39835. c.urlParams_.Set("alt", alt)
  39836. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/forwardingRules/{resource}/testIamPermissions")
  39837. urls += "?" + c.urlParams_.Encode()
  39838. req, _ := http.NewRequest("POST", urls, body)
  39839. req.Header = reqHeaders
  39840. googleapi.Expand(req.URL, map[string]string{
  39841. "project": c.project,
  39842. "resource": c.resource,
  39843. })
  39844. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  39845. }
  39846. // Do executes the "compute.globalForwardingRules.testIamPermissions" call.
  39847. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  39848. // non-2xx status code is an error. Response headers are in either
  39849. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  39850. // returned at all) in error.(*googleapi.Error).Header. Use
  39851. // googleapi.IsNotModified to check whether the returned error was
  39852. // because http.StatusNotModified was returned.
  39853. func (c *GlobalForwardingRulesTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  39854. gensupport.SetOptions(c.urlParams_, opts...)
  39855. res, err := c.doRequest("json")
  39856. if res != nil && res.StatusCode == http.StatusNotModified {
  39857. if res.Body != nil {
  39858. res.Body.Close()
  39859. }
  39860. return nil, &googleapi.Error{
  39861. Code: res.StatusCode,
  39862. Header: res.Header,
  39863. }
  39864. }
  39865. if err != nil {
  39866. return nil, err
  39867. }
  39868. defer googleapi.CloseBody(res)
  39869. if err := googleapi.CheckResponse(res); err != nil {
  39870. return nil, err
  39871. }
  39872. ret := &TestPermissionsResponse{
  39873. ServerResponse: googleapi.ServerResponse{
  39874. Header: res.Header,
  39875. HTTPStatusCode: res.StatusCode,
  39876. },
  39877. }
  39878. target := &ret
  39879. if err := gensupport.DecodeResponse(target, res); err != nil {
  39880. return nil, err
  39881. }
  39882. return ret, nil
  39883. // {
  39884. // "description": "Returns permissions that a caller has on the specified resource.",
  39885. // "httpMethod": "POST",
  39886. // "id": "compute.globalForwardingRules.testIamPermissions",
  39887. // "parameterOrder": [
  39888. // "project",
  39889. // "resource"
  39890. // ],
  39891. // "parameters": {
  39892. // "project": {
  39893. // "description": "Project ID for this request.",
  39894. // "location": "path",
  39895. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  39896. // "required": true,
  39897. // "type": "string"
  39898. // },
  39899. // "resource": {
  39900. // "description": "Name of the resource for this request.",
  39901. // "location": "path",
  39902. // "pattern": "(?:[-a-z0-9_]{0,62}[a-z0-9])?",
  39903. // "required": true,
  39904. // "type": "string"
  39905. // }
  39906. // },
  39907. // "path": "{project}/global/forwardingRules/{resource}/testIamPermissions",
  39908. // "request": {
  39909. // "$ref": "TestPermissionsRequest"
  39910. // },
  39911. // "response": {
  39912. // "$ref": "TestPermissionsResponse"
  39913. // },
  39914. // "scopes": [
  39915. // "https://www.googleapis.com/auth/cloud-platform",
  39916. // "https://www.googleapis.com/auth/compute",
  39917. // "https://www.googleapis.com/auth/compute.readonly"
  39918. // ]
  39919. // }
  39920. }
  39921. // method id "compute.globalOperations.aggregatedList":
  39922. type GlobalOperationsAggregatedListCall struct {
  39923. s *Service
  39924. project string
  39925. urlParams_ gensupport.URLParams
  39926. ifNoneMatch_ string
  39927. ctx_ context.Context
  39928. header_ http.Header
  39929. }
  39930. // AggregatedList: Retrieves an aggregated list of all operations.
  39931. // For details, see https://cloud.google.com/compute/docs/reference/latest/globalOperations/aggregatedList
  39932. func (r *GlobalOperationsService) AggregatedList(project string) *GlobalOperationsAggregatedListCall {
  39933. c := &GlobalOperationsAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  39934. c.project = project
  39935. return c
  39936. }
  39937. // Filter sets the optional parameter "filter": A filter expression that
  39938. // filters resources listed in the response. The expression must specify
  39939. // the field name, a comparison operator, and the value that you want to
  39940. // use for filtering. The value must be a string, a number, or a
  39941. // boolean. The comparison operator must be either =, !=, >, or <.
  39942. //
  39943. // For example, if you are filtering Compute Engine instances, you can
  39944. // exclude instances named example-instance by specifying name !=
  39945. // example-instance.
  39946. //
  39947. // You can also filter nested fields. For example, you could specify
  39948. // scheduling.automaticRestart = false to include instances only if they
  39949. // are not scheduled for automatic restarts. You can use filtering on
  39950. // nested fields to filter based on resource labels.
  39951. //
  39952. // To filter on multiple expressions, provide each separate expression
  39953. // within parentheses. For example, (scheduling.automaticRestart = true)
  39954. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  39955. // AND expression. However, you can include AND and OR expressions
  39956. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  39957. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  39958. // true).
  39959. func (c *GlobalOperationsAggregatedListCall) Filter(filter string) *GlobalOperationsAggregatedListCall {
  39960. c.urlParams_.Set("filter", filter)
  39961. return c
  39962. }
  39963. // MaxResults sets the optional parameter "maxResults": The maximum
  39964. // number of results per page that should be returned. If the number of
  39965. // available results is larger than maxResults, Compute Engine returns a
  39966. // nextPageToken that can be used to get the next page of results in
  39967. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  39968. // (Default: 500)
  39969. func (c *GlobalOperationsAggregatedListCall) MaxResults(maxResults int64) *GlobalOperationsAggregatedListCall {
  39970. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  39971. return c
  39972. }
  39973. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  39974. // a certain order. By default, results are returned in alphanumerical
  39975. // order based on the resource name.
  39976. //
  39977. // You can also sort results in descending order based on the creation
  39978. // timestamp using orderBy="creationTimestamp desc". This sorts results
  39979. // based on the creationTimestamp field in reverse chronological order
  39980. // (newest result first). Use this to sort resources like operations so
  39981. // that the newest operation is returned first.
  39982. //
  39983. // Currently, only sorting by name or creationTimestamp desc is
  39984. // supported.
  39985. func (c *GlobalOperationsAggregatedListCall) OrderBy(orderBy string) *GlobalOperationsAggregatedListCall {
  39986. c.urlParams_.Set("orderBy", orderBy)
  39987. return c
  39988. }
  39989. // PageToken sets the optional parameter "pageToken": Specifies a page
  39990. // token to use. Set pageToken to the nextPageToken returned by a
  39991. // previous list request to get the next page of results.
  39992. func (c *GlobalOperationsAggregatedListCall) PageToken(pageToken string) *GlobalOperationsAggregatedListCall {
  39993. c.urlParams_.Set("pageToken", pageToken)
  39994. return c
  39995. }
  39996. // Fields allows partial responses to be retrieved. See
  39997. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  39998. // for more information.
  39999. func (c *GlobalOperationsAggregatedListCall) Fields(s ...googleapi.Field) *GlobalOperationsAggregatedListCall {
  40000. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  40001. return c
  40002. }
  40003. // IfNoneMatch sets the optional parameter which makes the operation
  40004. // fail if the object's ETag matches the given value. This is useful for
  40005. // getting updates only after the object has changed since the last
  40006. // request. Use googleapi.IsNotModified to check whether the response
  40007. // error from Do is the result of In-None-Match.
  40008. func (c *GlobalOperationsAggregatedListCall) IfNoneMatch(entityTag string) *GlobalOperationsAggregatedListCall {
  40009. c.ifNoneMatch_ = entityTag
  40010. return c
  40011. }
  40012. // Context sets the context to be used in this call's Do method. Any
  40013. // pending HTTP request will be aborted if the provided context is
  40014. // canceled.
  40015. func (c *GlobalOperationsAggregatedListCall) Context(ctx context.Context) *GlobalOperationsAggregatedListCall {
  40016. c.ctx_ = ctx
  40017. return c
  40018. }
  40019. // Header returns an http.Header that can be modified by the caller to
  40020. // add HTTP headers to the request.
  40021. func (c *GlobalOperationsAggregatedListCall) Header() http.Header {
  40022. if c.header_ == nil {
  40023. c.header_ = make(http.Header)
  40024. }
  40025. return c.header_
  40026. }
  40027. func (c *GlobalOperationsAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  40028. reqHeaders := make(http.Header)
  40029. for k, v := range c.header_ {
  40030. reqHeaders[k] = v
  40031. }
  40032. reqHeaders.Set("User-Agent", c.s.userAgent())
  40033. if c.ifNoneMatch_ != "" {
  40034. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  40035. }
  40036. var body io.Reader = nil
  40037. c.urlParams_.Set("alt", alt)
  40038. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/operations")
  40039. urls += "?" + c.urlParams_.Encode()
  40040. req, _ := http.NewRequest("GET", urls, body)
  40041. req.Header = reqHeaders
  40042. googleapi.Expand(req.URL, map[string]string{
  40043. "project": c.project,
  40044. })
  40045. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  40046. }
  40047. // Do executes the "compute.globalOperations.aggregatedList" call.
  40048. // Exactly one of *OperationAggregatedList or error will be non-nil. Any
  40049. // non-2xx status code is an error. Response headers are in either
  40050. // *OperationAggregatedList.ServerResponse.Header or (if a response was
  40051. // returned at all) in error.(*googleapi.Error).Header. Use
  40052. // googleapi.IsNotModified to check whether the returned error was
  40053. // because http.StatusNotModified was returned.
  40054. func (c *GlobalOperationsAggregatedListCall) Do(opts ...googleapi.CallOption) (*OperationAggregatedList, error) {
  40055. gensupport.SetOptions(c.urlParams_, opts...)
  40056. res, err := c.doRequest("json")
  40057. if res != nil && res.StatusCode == http.StatusNotModified {
  40058. if res.Body != nil {
  40059. res.Body.Close()
  40060. }
  40061. return nil, &googleapi.Error{
  40062. Code: res.StatusCode,
  40063. Header: res.Header,
  40064. }
  40065. }
  40066. if err != nil {
  40067. return nil, err
  40068. }
  40069. defer googleapi.CloseBody(res)
  40070. if err := googleapi.CheckResponse(res); err != nil {
  40071. return nil, err
  40072. }
  40073. ret := &OperationAggregatedList{
  40074. ServerResponse: googleapi.ServerResponse{
  40075. Header: res.Header,
  40076. HTTPStatusCode: res.StatusCode,
  40077. },
  40078. }
  40079. target := &ret
  40080. if err := gensupport.DecodeResponse(target, res); err != nil {
  40081. return nil, err
  40082. }
  40083. return ret, nil
  40084. // {
  40085. // "description": "Retrieves an aggregated list of all operations.",
  40086. // "httpMethod": "GET",
  40087. // "id": "compute.globalOperations.aggregatedList",
  40088. // "parameterOrder": [
  40089. // "project"
  40090. // ],
  40091. // "parameters": {
  40092. // "filter": {
  40093. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  40094. // "location": "query",
  40095. // "type": "string"
  40096. // },
  40097. // "maxResults": {
  40098. // "default": "500",
  40099. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  40100. // "format": "uint32",
  40101. // "location": "query",
  40102. // "minimum": "0",
  40103. // "type": "integer"
  40104. // },
  40105. // "orderBy": {
  40106. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  40107. // "location": "query",
  40108. // "type": "string"
  40109. // },
  40110. // "pageToken": {
  40111. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  40112. // "location": "query",
  40113. // "type": "string"
  40114. // },
  40115. // "project": {
  40116. // "description": "Project ID for this request.",
  40117. // "location": "path",
  40118. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  40119. // "required": true,
  40120. // "type": "string"
  40121. // }
  40122. // },
  40123. // "path": "{project}/aggregated/operations",
  40124. // "response": {
  40125. // "$ref": "OperationAggregatedList"
  40126. // },
  40127. // "scopes": [
  40128. // "https://www.googleapis.com/auth/cloud-platform",
  40129. // "https://www.googleapis.com/auth/compute",
  40130. // "https://www.googleapis.com/auth/compute.readonly"
  40131. // ]
  40132. // }
  40133. }
  40134. // Pages invokes f for each page of results.
  40135. // A non-nil error returned from f will halt the iteration.
  40136. // The provided context supersedes any context provided to the Context method.
  40137. func (c *GlobalOperationsAggregatedListCall) Pages(ctx context.Context, f func(*OperationAggregatedList) error) error {
  40138. c.ctx_ = ctx
  40139. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  40140. for {
  40141. x, err := c.Do()
  40142. if err != nil {
  40143. return err
  40144. }
  40145. if err := f(x); err != nil {
  40146. return err
  40147. }
  40148. if x.NextPageToken == "" {
  40149. return nil
  40150. }
  40151. c.PageToken(x.NextPageToken)
  40152. }
  40153. }
  40154. // method id "compute.globalOperations.delete":
  40155. type GlobalOperationsDeleteCall struct {
  40156. s *Service
  40157. project string
  40158. operation string
  40159. urlParams_ gensupport.URLParams
  40160. ctx_ context.Context
  40161. header_ http.Header
  40162. }
  40163. // Delete: Deletes the specified Operations resource.
  40164. // For details, see https://cloud.google.com/compute/docs/reference/latest/globalOperations/delete
  40165. func (r *GlobalOperationsService) Delete(project string, operation string) *GlobalOperationsDeleteCall {
  40166. c := &GlobalOperationsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  40167. c.project = project
  40168. c.operation = operation
  40169. return c
  40170. }
  40171. // Fields allows partial responses to be retrieved. See
  40172. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  40173. // for more information.
  40174. func (c *GlobalOperationsDeleteCall) Fields(s ...googleapi.Field) *GlobalOperationsDeleteCall {
  40175. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  40176. return c
  40177. }
  40178. // Context sets the context to be used in this call's Do method. Any
  40179. // pending HTTP request will be aborted if the provided context is
  40180. // canceled.
  40181. func (c *GlobalOperationsDeleteCall) Context(ctx context.Context) *GlobalOperationsDeleteCall {
  40182. c.ctx_ = ctx
  40183. return c
  40184. }
  40185. // Header returns an http.Header that can be modified by the caller to
  40186. // add HTTP headers to the request.
  40187. func (c *GlobalOperationsDeleteCall) Header() http.Header {
  40188. if c.header_ == nil {
  40189. c.header_ = make(http.Header)
  40190. }
  40191. return c.header_
  40192. }
  40193. func (c *GlobalOperationsDeleteCall) doRequest(alt string) (*http.Response, error) {
  40194. reqHeaders := make(http.Header)
  40195. for k, v := range c.header_ {
  40196. reqHeaders[k] = v
  40197. }
  40198. reqHeaders.Set("User-Agent", c.s.userAgent())
  40199. var body io.Reader = nil
  40200. c.urlParams_.Set("alt", alt)
  40201. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/operations/{operation}")
  40202. urls += "?" + c.urlParams_.Encode()
  40203. req, _ := http.NewRequest("DELETE", urls, body)
  40204. req.Header = reqHeaders
  40205. googleapi.Expand(req.URL, map[string]string{
  40206. "project": c.project,
  40207. "operation": c.operation,
  40208. })
  40209. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  40210. }
  40211. // Do executes the "compute.globalOperations.delete" call.
  40212. func (c *GlobalOperationsDeleteCall) Do(opts ...googleapi.CallOption) error {
  40213. gensupport.SetOptions(c.urlParams_, opts...)
  40214. res, err := c.doRequest("json")
  40215. if err != nil {
  40216. return err
  40217. }
  40218. defer googleapi.CloseBody(res)
  40219. if err := googleapi.CheckResponse(res); err != nil {
  40220. return err
  40221. }
  40222. return nil
  40223. // {
  40224. // "description": "Deletes the specified Operations resource.",
  40225. // "httpMethod": "DELETE",
  40226. // "id": "compute.globalOperations.delete",
  40227. // "parameterOrder": [
  40228. // "project",
  40229. // "operation"
  40230. // ],
  40231. // "parameters": {
  40232. // "operation": {
  40233. // "description": "Name of the Operations resource to delete.",
  40234. // "location": "path",
  40235. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  40236. // "required": true,
  40237. // "type": "string"
  40238. // },
  40239. // "project": {
  40240. // "description": "Project ID for this request.",
  40241. // "location": "path",
  40242. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  40243. // "required": true,
  40244. // "type": "string"
  40245. // }
  40246. // },
  40247. // "path": "{project}/global/operations/{operation}",
  40248. // "scopes": [
  40249. // "https://www.googleapis.com/auth/cloud-platform",
  40250. // "https://www.googleapis.com/auth/compute"
  40251. // ]
  40252. // }
  40253. }
  40254. // method id "compute.globalOperations.get":
  40255. type GlobalOperationsGetCall struct {
  40256. s *Service
  40257. project string
  40258. operation string
  40259. urlParams_ gensupport.URLParams
  40260. ifNoneMatch_ string
  40261. ctx_ context.Context
  40262. header_ http.Header
  40263. }
  40264. // Get: Retrieves the specified Operations resource. Gets a list of
  40265. // operations by making a list() request.
  40266. // For details, see https://cloud.google.com/compute/docs/reference/latest/globalOperations/get
  40267. func (r *GlobalOperationsService) Get(project string, operation string) *GlobalOperationsGetCall {
  40268. c := &GlobalOperationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  40269. c.project = project
  40270. c.operation = operation
  40271. return c
  40272. }
  40273. // Fields allows partial responses to be retrieved. See
  40274. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  40275. // for more information.
  40276. func (c *GlobalOperationsGetCall) Fields(s ...googleapi.Field) *GlobalOperationsGetCall {
  40277. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  40278. return c
  40279. }
  40280. // IfNoneMatch sets the optional parameter which makes the operation
  40281. // fail if the object's ETag matches the given value. This is useful for
  40282. // getting updates only after the object has changed since the last
  40283. // request. Use googleapi.IsNotModified to check whether the response
  40284. // error from Do is the result of In-None-Match.
  40285. func (c *GlobalOperationsGetCall) IfNoneMatch(entityTag string) *GlobalOperationsGetCall {
  40286. c.ifNoneMatch_ = entityTag
  40287. return c
  40288. }
  40289. // Context sets the context to be used in this call's Do method. Any
  40290. // pending HTTP request will be aborted if the provided context is
  40291. // canceled.
  40292. func (c *GlobalOperationsGetCall) Context(ctx context.Context) *GlobalOperationsGetCall {
  40293. c.ctx_ = ctx
  40294. return c
  40295. }
  40296. // Header returns an http.Header that can be modified by the caller to
  40297. // add HTTP headers to the request.
  40298. func (c *GlobalOperationsGetCall) Header() http.Header {
  40299. if c.header_ == nil {
  40300. c.header_ = make(http.Header)
  40301. }
  40302. return c.header_
  40303. }
  40304. func (c *GlobalOperationsGetCall) doRequest(alt string) (*http.Response, error) {
  40305. reqHeaders := make(http.Header)
  40306. for k, v := range c.header_ {
  40307. reqHeaders[k] = v
  40308. }
  40309. reqHeaders.Set("User-Agent", c.s.userAgent())
  40310. if c.ifNoneMatch_ != "" {
  40311. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  40312. }
  40313. var body io.Reader = nil
  40314. c.urlParams_.Set("alt", alt)
  40315. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/operations/{operation}")
  40316. urls += "?" + c.urlParams_.Encode()
  40317. req, _ := http.NewRequest("GET", urls, body)
  40318. req.Header = reqHeaders
  40319. googleapi.Expand(req.URL, map[string]string{
  40320. "project": c.project,
  40321. "operation": c.operation,
  40322. })
  40323. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  40324. }
  40325. // Do executes the "compute.globalOperations.get" call.
  40326. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  40327. // status code is an error. Response headers are in either
  40328. // *Operation.ServerResponse.Header or (if a response was returned at
  40329. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  40330. // to check whether the returned error was because
  40331. // http.StatusNotModified was returned.
  40332. func (c *GlobalOperationsGetCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  40333. gensupport.SetOptions(c.urlParams_, opts...)
  40334. res, err := c.doRequest("json")
  40335. if res != nil && res.StatusCode == http.StatusNotModified {
  40336. if res.Body != nil {
  40337. res.Body.Close()
  40338. }
  40339. return nil, &googleapi.Error{
  40340. Code: res.StatusCode,
  40341. Header: res.Header,
  40342. }
  40343. }
  40344. if err != nil {
  40345. return nil, err
  40346. }
  40347. defer googleapi.CloseBody(res)
  40348. if err := googleapi.CheckResponse(res); err != nil {
  40349. return nil, err
  40350. }
  40351. ret := &Operation{
  40352. ServerResponse: googleapi.ServerResponse{
  40353. Header: res.Header,
  40354. HTTPStatusCode: res.StatusCode,
  40355. },
  40356. }
  40357. target := &ret
  40358. if err := gensupport.DecodeResponse(target, res); err != nil {
  40359. return nil, err
  40360. }
  40361. return ret, nil
  40362. // {
  40363. // "description": "Retrieves the specified Operations resource. Gets a list of operations by making a list() request.",
  40364. // "httpMethod": "GET",
  40365. // "id": "compute.globalOperations.get",
  40366. // "parameterOrder": [
  40367. // "project",
  40368. // "operation"
  40369. // ],
  40370. // "parameters": {
  40371. // "operation": {
  40372. // "description": "Name of the Operations resource to return.",
  40373. // "location": "path",
  40374. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  40375. // "required": true,
  40376. // "type": "string"
  40377. // },
  40378. // "project": {
  40379. // "description": "Project ID for this request.",
  40380. // "location": "path",
  40381. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  40382. // "required": true,
  40383. // "type": "string"
  40384. // }
  40385. // },
  40386. // "path": "{project}/global/operations/{operation}",
  40387. // "response": {
  40388. // "$ref": "Operation"
  40389. // },
  40390. // "scopes": [
  40391. // "https://www.googleapis.com/auth/cloud-platform",
  40392. // "https://www.googleapis.com/auth/compute",
  40393. // "https://www.googleapis.com/auth/compute.readonly"
  40394. // ]
  40395. // }
  40396. }
  40397. // method id "compute.globalOperations.list":
  40398. type GlobalOperationsListCall struct {
  40399. s *Service
  40400. project string
  40401. urlParams_ gensupport.URLParams
  40402. ifNoneMatch_ string
  40403. ctx_ context.Context
  40404. header_ http.Header
  40405. }
  40406. // List: Retrieves a list of Operation resources contained within the
  40407. // specified project.
  40408. // For details, see https://cloud.google.com/compute/docs/reference/latest/globalOperations/list
  40409. func (r *GlobalOperationsService) List(project string) *GlobalOperationsListCall {
  40410. c := &GlobalOperationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  40411. c.project = project
  40412. return c
  40413. }
  40414. // Filter sets the optional parameter "filter": A filter expression that
  40415. // filters resources listed in the response. The expression must specify
  40416. // the field name, a comparison operator, and the value that you want to
  40417. // use for filtering. The value must be a string, a number, or a
  40418. // boolean. The comparison operator must be either =, !=, >, or <.
  40419. //
  40420. // For example, if you are filtering Compute Engine instances, you can
  40421. // exclude instances named example-instance by specifying name !=
  40422. // example-instance.
  40423. //
  40424. // You can also filter nested fields. For example, you could specify
  40425. // scheduling.automaticRestart = false to include instances only if they
  40426. // are not scheduled for automatic restarts. You can use filtering on
  40427. // nested fields to filter based on resource labels.
  40428. //
  40429. // To filter on multiple expressions, provide each separate expression
  40430. // within parentheses. For example, (scheduling.automaticRestart = true)
  40431. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  40432. // AND expression. However, you can include AND and OR expressions
  40433. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  40434. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  40435. // true).
  40436. func (c *GlobalOperationsListCall) Filter(filter string) *GlobalOperationsListCall {
  40437. c.urlParams_.Set("filter", filter)
  40438. return c
  40439. }
  40440. // MaxResults sets the optional parameter "maxResults": The maximum
  40441. // number of results per page that should be returned. If the number of
  40442. // available results is larger than maxResults, Compute Engine returns a
  40443. // nextPageToken that can be used to get the next page of results in
  40444. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  40445. // (Default: 500)
  40446. func (c *GlobalOperationsListCall) MaxResults(maxResults int64) *GlobalOperationsListCall {
  40447. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  40448. return c
  40449. }
  40450. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  40451. // a certain order. By default, results are returned in alphanumerical
  40452. // order based on the resource name.
  40453. //
  40454. // You can also sort results in descending order based on the creation
  40455. // timestamp using orderBy="creationTimestamp desc". This sorts results
  40456. // based on the creationTimestamp field in reverse chronological order
  40457. // (newest result first). Use this to sort resources like operations so
  40458. // that the newest operation is returned first.
  40459. //
  40460. // Currently, only sorting by name or creationTimestamp desc is
  40461. // supported.
  40462. func (c *GlobalOperationsListCall) OrderBy(orderBy string) *GlobalOperationsListCall {
  40463. c.urlParams_.Set("orderBy", orderBy)
  40464. return c
  40465. }
  40466. // PageToken sets the optional parameter "pageToken": Specifies a page
  40467. // token to use. Set pageToken to the nextPageToken returned by a
  40468. // previous list request to get the next page of results.
  40469. func (c *GlobalOperationsListCall) PageToken(pageToken string) *GlobalOperationsListCall {
  40470. c.urlParams_.Set("pageToken", pageToken)
  40471. return c
  40472. }
  40473. // Fields allows partial responses to be retrieved. See
  40474. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  40475. // for more information.
  40476. func (c *GlobalOperationsListCall) Fields(s ...googleapi.Field) *GlobalOperationsListCall {
  40477. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  40478. return c
  40479. }
  40480. // IfNoneMatch sets the optional parameter which makes the operation
  40481. // fail if the object's ETag matches the given value. This is useful for
  40482. // getting updates only after the object has changed since the last
  40483. // request. Use googleapi.IsNotModified to check whether the response
  40484. // error from Do is the result of In-None-Match.
  40485. func (c *GlobalOperationsListCall) IfNoneMatch(entityTag string) *GlobalOperationsListCall {
  40486. c.ifNoneMatch_ = entityTag
  40487. return c
  40488. }
  40489. // Context sets the context to be used in this call's Do method. Any
  40490. // pending HTTP request will be aborted if the provided context is
  40491. // canceled.
  40492. func (c *GlobalOperationsListCall) Context(ctx context.Context) *GlobalOperationsListCall {
  40493. c.ctx_ = ctx
  40494. return c
  40495. }
  40496. // Header returns an http.Header that can be modified by the caller to
  40497. // add HTTP headers to the request.
  40498. func (c *GlobalOperationsListCall) Header() http.Header {
  40499. if c.header_ == nil {
  40500. c.header_ = make(http.Header)
  40501. }
  40502. return c.header_
  40503. }
  40504. func (c *GlobalOperationsListCall) doRequest(alt string) (*http.Response, error) {
  40505. reqHeaders := make(http.Header)
  40506. for k, v := range c.header_ {
  40507. reqHeaders[k] = v
  40508. }
  40509. reqHeaders.Set("User-Agent", c.s.userAgent())
  40510. if c.ifNoneMatch_ != "" {
  40511. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  40512. }
  40513. var body io.Reader = nil
  40514. c.urlParams_.Set("alt", alt)
  40515. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/operations")
  40516. urls += "?" + c.urlParams_.Encode()
  40517. req, _ := http.NewRequest("GET", urls, body)
  40518. req.Header = reqHeaders
  40519. googleapi.Expand(req.URL, map[string]string{
  40520. "project": c.project,
  40521. })
  40522. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  40523. }
  40524. // Do executes the "compute.globalOperations.list" call.
  40525. // Exactly one of *OperationList or error will be non-nil. Any non-2xx
  40526. // status code is an error. Response headers are in either
  40527. // *OperationList.ServerResponse.Header or (if a response was returned
  40528. // at all) in error.(*googleapi.Error).Header. Use
  40529. // googleapi.IsNotModified to check whether the returned error was
  40530. // because http.StatusNotModified was returned.
  40531. func (c *GlobalOperationsListCall) Do(opts ...googleapi.CallOption) (*OperationList, error) {
  40532. gensupport.SetOptions(c.urlParams_, opts...)
  40533. res, err := c.doRequest("json")
  40534. if res != nil && res.StatusCode == http.StatusNotModified {
  40535. if res.Body != nil {
  40536. res.Body.Close()
  40537. }
  40538. return nil, &googleapi.Error{
  40539. Code: res.StatusCode,
  40540. Header: res.Header,
  40541. }
  40542. }
  40543. if err != nil {
  40544. return nil, err
  40545. }
  40546. defer googleapi.CloseBody(res)
  40547. if err := googleapi.CheckResponse(res); err != nil {
  40548. return nil, err
  40549. }
  40550. ret := &OperationList{
  40551. ServerResponse: googleapi.ServerResponse{
  40552. Header: res.Header,
  40553. HTTPStatusCode: res.StatusCode,
  40554. },
  40555. }
  40556. target := &ret
  40557. if err := gensupport.DecodeResponse(target, res); err != nil {
  40558. return nil, err
  40559. }
  40560. return ret, nil
  40561. // {
  40562. // "description": "Retrieves a list of Operation resources contained within the specified project.",
  40563. // "httpMethod": "GET",
  40564. // "id": "compute.globalOperations.list",
  40565. // "parameterOrder": [
  40566. // "project"
  40567. // ],
  40568. // "parameters": {
  40569. // "filter": {
  40570. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  40571. // "location": "query",
  40572. // "type": "string"
  40573. // },
  40574. // "maxResults": {
  40575. // "default": "500",
  40576. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  40577. // "format": "uint32",
  40578. // "location": "query",
  40579. // "minimum": "0",
  40580. // "type": "integer"
  40581. // },
  40582. // "orderBy": {
  40583. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  40584. // "location": "query",
  40585. // "type": "string"
  40586. // },
  40587. // "pageToken": {
  40588. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  40589. // "location": "query",
  40590. // "type": "string"
  40591. // },
  40592. // "project": {
  40593. // "description": "Project ID for this request.",
  40594. // "location": "path",
  40595. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  40596. // "required": true,
  40597. // "type": "string"
  40598. // }
  40599. // },
  40600. // "path": "{project}/global/operations",
  40601. // "response": {
  40602. // "$ref": "OperationList"
  40603. // },
  40604. // "scopes": [
  40605. // "https://www.googleapis.com/auth/cloud-platform",
  40606. // "https://www.googleapis.com/auth/compute",
  40607. // "https://www.googleapis.com/auth/compute.readonly"
  40608. // ]
  40609. // }
  40610. }
  40611. // Pages invokes f for each page of results.
  40612. // A non-nil error returned from f will halt the iteration.
  40613. // The provided context supersedes any context provided to the Context method.
  40614. func (c *GlobalOperationsListCall) Pages(ctx context.Context, f func(*OperationList) error) error {
  40615. c.ctx_ = ctx
  40616. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  40617. for {
  40618. x, err := c.Do()
  40619. if err != nil {
  40620. return err
  40621. }
  40622. if err := f(x); err != nil {
  40623. return err
  40624. }
  40625. if x.NextPageToken == "" {
  40626. return nil
  40627. }
  40628. c.PageToken(x.NextPageToken)
  40629. }
  40630. }
  40631. // method id "compute.healthChecks.delete":
  40632. type HealthChecksDeleteCall struct {
  40633. s *Service
  40634. project string
  40635. healthCheck string
  40636. urlParams_ gensupport.URLParams
  40637. ctx_ context.Context
  40638. header_ http.Header
  40639. }
  40640. // Delete: Deletes the specified HealthCheck resource.
  40641. func (r *HealthChecksService) Delete(project string, healthCheck string) *HealthChecksDeleteCall {
  40642. c := &HealthChecksDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  40643. c.project = project
  40644. c.healthCheck = healthCheck
  40645. return c
  40646. }
  40647. // RequestId sets the optional parameter "requestId": An optional
  40648. // request ID to identify requests. Specify a unique request ID so that
  40649. // if you must retry your request, the server will know to ignore the
  40650. // request if it has already been completed.
  40651. //
  40652. // For example, consider a situation where you make an initial request
  40653. // and the request times out. If you make the request again with the
  40654. // same request ID, the server can check if original operation with the
  40655. // same request ID was received, and if so, will ignore the second
  40656. // request. This prevents clients from accidentally creating duplicate
  40657. // commitments.
  40658. //
  40659. // The request ID must be a valid UUID with the exception that zero UUID
  40660. // is not supported (00000000-0000-0000-0000-000000000000).
  40661. func (c *HealthChecksDeleteCall) RequestId(requestId string) *HealthChecksDeleteCall {
  40662. c.urlParams_.Set("requestId", requestId)
  40663. return c
  40664. }
  40665. // Fields allows partial responses to be retrieved. See
  40666. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  40667. // for more information.
  40668. func (c *HealthChecksDeleteCall) Fields(s ...googleapi.Field) *HealthChecksDeleteCall {
  40669. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  40670. return c
  40671. }
  40672. // Context sets the context to be used in this call's Do method. Any
  40673. // pending HTTP request will be aborted if the provided context is
  40674. // canceled.
  40675. func (c *HealthChecksDeleteCall) Context(ctx context.Context) *HealthChecksDeleteCall {
  40676. c.ctx_ = ctx
  40677. return c
  40678. }
  40679. // Header returns an http.Header that can be modified by the caller to
  40680. // add HTTP headers to the request.
  40681. func (c *HealthChecksDeleteCall) Header() http.Header {
  40682. if c.header_ == nil {
  40683. c.header_ = make(http.Header)
  40684. }
  40685. return c.header_
  40686. }
  40687. func (c *HealthChecksDeleteCall) doRequest(alt string) (*http.Response, error) {
  40688. reqHeaders := make(http.Header)
  40689. for k, v := range c.header_ {
  40690. reqHeaders[k] = v
  40691. }
  40692. reqHeaders.Set("User-Agent", c.s.userAgent())
  40693. var body io.Reader = nil
  40694. c.urlParams_.Set("alt", alt)
  40695. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/healthChecks/{healthCheck}")
  40696. urls += "?" + c.urlParams_.Encode()
  40697. req, _ := http.NewRequest("DELETE", urls, body)
  40698. req.Header = reqHeaders
  40699. googleapi.Expand(req.URL, map[string]string{
  40700. "project": c.project,
  40701. "healthCheck": c.healthCheck,
  40702. })
  40703. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  40704. }
  40705. // Do executes the "compute.healthChecks.delete" call.
  40706. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  40707. // status code is an error. Response headers are in either
  40708. // *Operation.ServerResponse.Header or (if a response was returned at
  40709. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  40710. // to check whether the returned error was because
  40711. // http.StatusNotModified was returned.
  40712. func (c *HealthChecksDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  40713. gensupport.SetOptions(c.urlParams_, opts...)
  40714. res, err := c.doRequest("json")
  40715. if res != nil && res.StatusCode == http.StatusNotModified {
  40716. if res.Body != nil {
  40717. res.Body.Close()
  40718. }
  40719. return nil, &googleapi.Error{
  40720. Code: res.StatusCode,
  40721. Header: res.Header,
  40722. }
  40723. }
  40724. if err != nil {
  40725. return nil, err
  40726. }
  40727. defer googleapi.CloseBody(res)
  40728. if err := googleapi.CheckResponse(res); err != nil {
  40729. return nil, err
  40730. }
  40731. ret := &Operation{
  40732. ServerResponse: googleapi.ServerResponse{
  40733. Header: res.Header,
  40734. HTTPStatusCode: res.StatusCode,
  40735. },
  40736. }
  40737. target := &ret
  40738. if err := gensupport.DecodeResponse(target, res); err != nil {
  40739. return nil, err
  40740. }
  40741. return ret, nil
  40742. // {
  40743. // "description": "Deletes the specified HealthCheck resource.",
  40744. // "httpMethod": "DELETE",
  40745. // "id": "compute.healthChecks.delete",
  40746. // "parameterOrder": [
  40747. // "project",
  40748. // "healthCheck"
  40749. // ],
  40750. // "parameters": {
  40751. // "healthCheck": {
  40752. // "description": "Name of the HealthCheck resource to delete.",
  40753. // "location": "path",
  40754. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  40755. // "required": true,
  40756. // "type": "string"
  40757. // },
  40758. // "project": {
  40759. // "description": "Project ID for this request.",
  40760. // "location": "path",
  40761. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  40762. // "required": true,
  40763. // "type": "string"
  40764. // },
  40765. // "requestId": {
  40766. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  40767. // "location": "query",
  40768. // "type": "string"
  40769. // }
  40770. // },
  40771. // "path": "{project}/global/healthChecks/{healthCheck}",
  40772. // "response": {
  40773. // "$ref": "Operation"
  40774. // },
  40775. // "scopes": [
  40776. // "https://www.googleapis.com/auth/cloud-platform",
  40777. // "https://www.googleapis.com/auth/compute"
  40778. // ]
  40779. // }
  40780. }
  40781. // method id "compute.healthChecks.get":
  40782. type HealthChecksGetCall struct {
  40783. s *Service
  40784. project string
  40785. healthCheck string
  40786. urlParams_ gensupport.URLParams
  40787. ifNoneMatch_ string
  40788. ctx_ context.Context
  40789. header_ http.Header
  40790. }
  40791. // Get: Returns the specified HealthCheck resource. Gets a list of
  40792. // available health checks by making a list() request.
  40793. func (r *HealthChecksService) Get(project string, healthCheck string) *HealthChecksGetCall {
  40794. c := &HealthChecksGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  40795. c.project = project
  40796. c.healthCheck = healthCheck
  40797. return c
  40798. }
  40799. // Fields allows partial responses to be retrieved. See
  40800. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  40801. // for more information.
  40802. func (c *HealthChecksGetCall) Fields(s ...googleapi.Field) *HealthChecksGetCall {
  40803. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  40804. return c
  40805. }
  40806. // IfNoneMatch sets the optional parameter which makes the operation
  40807. // fail if the object's ETag matches the given value. This is useful for
  40808. // getting updates only after the object has changed since the last
  40809. // request. Use googleapi.IsNotModified to check whether the response
  40810. // error from Do is the result of In-None-Match.
  40811. func (c *HealthChecksGetCall) IfNoneMatch(entityTag string) *HealthChecksGetCall {
  40812. c.ifNoneMatch_ = entityTag
  40813. return c
  40814. }
  40815. // Context sets the context to be used in this call's Do method. Any
  40816. // pending HTTP request will be aborted if the provided context is
  40817. // canceled.
  40818. func (c *HealthChecksGetCall) Context(ctx context.Context) *HealthChecksGetCall {
  40819. c.ctx_ = ctx
  40820. return c
  40821. }
  40822. // Header returns an http.Header that can be modified by the caller to
  40823. // add HTTP headers to the request.
  40824. func (c *HealthChecksGetCall) Header() http.Header {
  40825. if c.header_ == nil {
  40826. c.header_ = make(http.Header)
  40827. }
  40828. return c.header_
  40829. }
  40830. func (c *HealthChecksGetCall) doRequest(alt string) (*http.Response, error) {
  40831. reqHeaders := make(http.Header)
  40832. for k, v := range c.header_ {
  40833. reqHeaders[k] = v
  40834. }
  40835. reqHeaders.Set("User-Agent", c.s.userAgent())
  40836. if c.ifNoneMatch_ != "" {
  40837. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  40838. }
  40839. var body io.Reader = nil
  40840. c.urlParams_.Set("alt", alt)
  40841. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/healthChecks/{healthCheck}")
  40842. urls += "?" + c.urlParams_.Encode()
  40843. req, _ := http.NewRequest("GET", urls, body)
  40844. req.Header = reqHeaders
  40845. googleapi.Expand(req.URL, map[string]string{
  40846. "project": c.project,
  40847. "healthCheck": c.healthCheck,
  40848. })
  40849. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  40850. }
  40851. // Do executes the "compute.healthChecks.get" call.
  40852. // Exactly one of *HealthCheck or error will be non-nil. Any non-2xx
  40853. // status code is an error. Response headers are in either
  40854. // *HealthCheck.ServerResponse.Header or (if a response was returned at
  40855. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  40856. // to check whether the returned error was because
  40857. // http.StatusNotModified was returned.
  40858. func (c *HealthChecksGetCall) Do(opts ...googleapi.CallOption) (*HealthCheck, error) {
  40859. gensupport.SetOptions(c.urlParams_, opts...)
  40860. res, err := c.doRequest("json")
  40861. if res != nil && res.StatusCode == http.StatusNotModified {
  40862. if res.Body != nil {
  40863. res.Body.Close()
  40864. }
  40865. return nil, &googleapi.Error{
  40866. Code: res.StatusCode,
  40867. Header: res.Header,
  40868. }
  40869. }
  40870. if err != nil {
  40871. return nil, err
  40872. }
  40873. defer googleapi.CloseBody(res)
  40874. if err := googleapi.CheckResponse(res); err != nil {
  40875. return nil, err
  40876. }
  40877. ret := &HealthCheck{
  40878. ServerResponse: googleapi.ServerResponse{
  40879. Header: res.Header,
  40880. HTTPStatusCode: res.StatusCode,
  40881. },
  40882. }
  40883. target := &ret
  40884. if err := gensupport.DecodeResponse(target, res); err != nil {
  40885. return nil, err
  40886. }
  40887. return ret, nil
  40888. // {
  40889. // "description": "Returns the specified HealthCheck resource. Gets a list of available health checks by making a list() request.",
  40890. // "httpMethod": "GET",
  40891. // "id": "compute.healthChecks.get",
  40892. // "parameterOrder": [
  40893. // "project",
  40894. // "healthCheck"
  40895. // ],
  40896. // "parameters": {
  40897. // "healthCheck": {
  40898. // "description": "Name of the HealthCheck resource to return.",
  40899. // "location": "path",
  40900. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  40901. // "required": true,
  40902. // "type": "string"
  40903. // },
  40904. // "project": {
  40905. // "description": "Project ID for this request.",
  40906. // "location": "path",
  40907. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  40908. // "required": true,
  40909. // "type": "string"
  40910. // }
  40911. // },
  40912. // "path": "{project}/global/healthChecks/{healthCheck}",
  40913. // "response": {
  40914. // "$ref": "HealthCheck"
  40915. // },
  40916. // "scopes": [
  40917. // "https://www.googleapis.com/auth/cloud-platform",
  40918. // "https://www.googleapis.com/auth/compute",
  40919. // "https://www.googleapis.com/auth/compute.readonly"
  40920. // ]
  40921. // }
  40922. }
  40923. // method id "compute.healthChecks.insert":
  40924. type HealthChecksInsertCall struct {
  40925. s *Service
  40926. project string
  40927. healthcheck *HealthCheck
  40928. urlParams_ gensupport.URLParams
  40929. ctx_ context.Context
  40930. header_ http.Header
  40931. }
  40932. // Insert: Creates a HealthCheck resource in the specified project using
  40933. // the data included in the request.
  40934. func (r *HealthChecksService) Insert(project string, healthcheck *HealthCheck) *HealthChecksInsertCall {
  40935. c := &HealthChecksInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  40936. c.project = project
  40937. c.healthcheck = healthcheck
  40938. return c
  40939. }
  40940. // RequestId sets the optional parameter "requestId": An optional
  40941. // request ID to identify requests. Specify a unique request ID so that
  40942. // if you must retry your request, the server will know to ignore the
  40943. // request if it has already been completed.
  40944. //
  40945. // For example, consider a situation where you make an initial request
  40946. // and the request times out. If you make the request again with the
  40947. // same request ID, the server can check if original operation with the
  40948. // same request ID was received, and if so, will ignore the second
  40949. // request. This prevents clients from accidentally creating duplicate
  40950. // commitments.
  40951. //
  40952. // The request ID must be a valid UUID with the exception that zero UUID
  40953. // is not supported (00000000-0000-0000-0000-000000000000).
  40954. func (c *HealthChecksInsertCall) RequestId(requestId string) *HealthChecksInsertCall {
  40955. c.urlParams_.Set("requestId", requestId)
  40956. return c
  40957. }
  40958. // Fields allows partial responses to be retrieved. See
  40959. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  40960. // for more information.
  40961. func (c *HealthChecksInsertCall) Fields(s ...googleapi.Field) *HealthChecksInsertCall {
  40962. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  40963. return c
  40964. }
  40965. // Context sets the context to be used in this call's Do method. Any
  40966. // pending HTTP request will be aborted if the provided context is
  40967. // canceled.
  40968. func (c *HealthChecksInsertCall) Context(ctx context.Context) *HealthChecksInsertCall {
  40969. c.ctx_ = ctx
  40970. return c
  40971. }
  40972. // Header returns an http.Header that can be modified by the caller to
  40973. // add HTTP headers to the request.
  40974. func (c *HealthChecksInsertCall) Header() http.Header {
  40975. if c.header_ == nil {
  40976. c.header_ = make(http.Header)
  40977. }
  40978. return c.header_
  40979. }
  40980. func (c *HealthChecksInsertCall) doRequest(alt string) (*http.Response, error) {
  40981. reqHeaders := make(http.Header)
  40982. for k, v := range c.header_ {
  40983. reqHeaders[k] = v
  40984. }
  40985. reqHeaders.Set("User-Agent", c.s.userAgent())
  40986. var body io.Reader = nil
  40987. body, err := googleapi.WithoutDataWrapper.JSONReader(c.healthcheck)
  40988. if err != nil {
  40989. return nil, err
  40990. }
  40991. reqHeaders.Set("Content-Type", "application/json")
  40992. c.urlParams_.Set("alt", alt)
  40993. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/healthChecks")
  40994. urls += "?" + c.urlParams_.Encode()
  40995. req, _ := http.NewRequest("POST", urls, body)
  40996. req.Header = reqHeaders
  40997. googleapi.Expand(req.URL, map[string]string{
  40998. "project": c.project,
  40999. })
  41000. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  41001. }
  41002. // Do executes the "compute.healthChecks.insert" call.
  41003. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  41004. // status code is an error. Response headers are in either
  41005. // *Operation.ServerResponse.Header or (if a response was returned at
  41006. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  41007. // to check whether the returned error was because
  41008. // http.StatusNotModified was returned.
  41009. func (c *HealthChecksInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  41010. gensupport.SetOptions(c.urlParams_, opts...)
  41011. res, err := c.doRequest("json")
  41012. if res != nil && res.StatusCode == http.StatusNotModified {
  41013. if res.Body != nil {
  41014. res.Body.Close()
  41015. }
  41016. return nil, &googleapi.Error{
  41017. Code: res.StatusCode,
  41018. Header: res.Header,
  41019. }
  41020. }
  41021. if err != nil {
  41022. return nil, err
  41023. }
  41024. defer googleapi.CloseBody(res)
  41025. if err := googleapi.CheckResponse(res); err != nil {
  41026. return nil, err
  41027. }
  41028. ret := &Operation{
  41029. ServerResponse: googleapi.ServerResponse{
  41030. Header: res.Header,
  41031. HTTPStatusCode: res.StatusCode,
  41032. },
  41033. }
  41034. target := &ret
  41035. if err := gensupport.DecodeResponse(target, res); err != nil {
  41036. return nil, err
  41037. }
  41038. return ret, nil
  41039. // {
  41040. // "description": "Creates a HealthCheck resource in the specified project using the data included in the request.",
  41041. // "httpMethod": "POST",
  41042. // "id": "compute.healthChecks.insert",
  41043. // "parameterOrder": [
  41044. // "project"
  41045. // ],
  41046. // "parameters": {
  41047. // "project": {
  41048. // "description": "Project ID for this request.",
  41049. // "location": "path",
  41050. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  41051. // "required": true,
  41052. // "type": "string"
  41053. // },
  41054. // "requestId": {
  41055. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  41056. // "location": "query",
  41057. // "type": "string"
  41058. // }
  41059. // },
  41060. // "path": "{project}/global/healthChecks",
  41061. // "request": {
  41062. // "$ref": "HealthCheck"
  41063. // },
  41064. // "response": {
  41065. // "$ref": "Operation"
  41066. // },
  41067. // "scopes": [
  41068. // "https://www.googleapis.com/auth/cloud-platform",
  41069. // "https://www.googleapis.com/auth/compute"
  41070. // ]
  41071. // }
  41072. }
  41073. // method id "compute.healthChecks.list":
  41074. type HealthChecksListCall struct {
  41075. s *Service
  41076. project string
  41077. urlParams_ gensupport.URLParams
  41078. ifNoneMatch_ string
  41079. ctx_ context.Context
  41080. header_ http.Header
  41081. }
  41082. // List: Retrieves the list of HealthCheck resources available to the
  41083. // specified project.
  41084. func (r *HealthChecksService) List(project string) *HealthChecksListCall {
  41085. c := &HealthChecksListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  41086. c.project = project
  41087. return c
  41088. }
  41089. // Filter sets the optional parameter "filter": A filter expression that
  41090. // filters resources listed in the response. The expression must specify
  41091. // the field name, a comparison operator, and the value that you want to
  41092. // use for filtering. The value must be a string, a number, or a
  41093. // boolean. The comparison operator must be either =, !=, >, or <.
  41094. //
  41095. // For example, if you are filtering Compute Engine instances, you can
  41096. // exclude instances named example-instance by specifying name !=
  41097. // example-instance.
  41098. //
  41099. // You can also filter nested fields. For example, you could specify
  41100. // scheduling.automaticRestart = false to include instances only if they
  41101. // are not scheduled for automatic restarts. You can use filtering on
  41102. // nested fields to filter based on resource labels.
  41103. //
  41104. // To filter on multiple expressions, provide each separate expression
  41105. // within parentheses. For example, (scheduling.automaticRestart = true)
  41106. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  41107. // AND expression. However, you can include AND and OR expressions
  41108. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  41109. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  41110. // true).
  41111. func (c *HealthChecksListCall) Filter(filter string) *HealthChecksListCall {
  41112. c.urlParams_.Set("filter", filter)
  41113. return c
  41114. }
  41115. // MaxResults sets the optional parameter "maxResults": The maximum
  41116. // number of results per page that should be returned. If the number of
  41117. // available results is larger than maxResults, Compute Engine returns a
  41118. // nextPageToken that can be used to get the next page of results in
  41119. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  41120. // (Default: 500)
  41121. func (c *HealthChecksListCall) MaxResults(maxResults int64) *HealthChecksListCall {
  41122. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  41123. return c
  41124. }
  41125. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  41126. // a certain order. By default, results are returned in alphanumerical
  41127. // order based on the resource name.
  41128. //
  41129. // You can also sort results in descending order based on the creation
  41130. // timestamp using orderBy="creationTimestamp desc". This sorts results
  41131. // based on the creationTimestamp field in reverse chronological order
  41132. // (newest result first). Use this to sort resources like operations so
  41133. // that the newest operation is returned first.
  41134. //
  41135. // Currently, only sorting by name or creationTimestamp desc is
  41136. // supported.
  41137. func (c *HealthChecksListCall) OrderBy(orderBy string) *HealthChecksListCall {
  41138. c.urlParams_.Set("orderBy", orderBy)
  41139. return c
  41140. }
  41141. // PageToken sets the optional parameter "pageToken": Specifies a page
  41142. // token to use. Set pageToken to the nextPageToken returned by a
  41143. // previous list request to get the next page of results.
  41144. func (c *HealthChecksListCall) PageToken(pageToken string) *HealthChecksListCall {
  41145. c.urlParams_.Set("pageToken", pageToken)
  41146. return c
  41147. }
  41148. // Fields allows partial responses to be retrieved. See
  41149. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  41150. // for more information.
  41151. func (c *HealthChecksListCall) Fields(s ...googleapi.Field) *HealthChecksListCall {
  41152. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  41153. return c
  41154. }
  41155. // IfNoneMatch sets the optional parameter which makes the operation
  41156. // fail if the object's ETag matches the given value. This is useful for
  41157. // getting updates only after the object has changed since the last
  41158. // request. Use googleapi.IsNotModified to check whether the response
  41159. // error from Do is the result of In-None-Match.
  41160. func (c *HealthChecksListCall) IfNoneMatch(entityTag string) *HealthChecksListCall {
  41161. c.ifNoneMatch_ = entityTag
  41162. return c
  41163. }
  41164. // Context sets the context to be used in this call's Do method. Any
  41165. // pending HTTP request will be aborted if the provided context is
  41166. // canceled.
  41167. func (c *HealthChecksListCall) Context(ctx context.Context) *HealthChecksListCall {
  41168. c.ctx_ = ctx
  41169. return c
  41170. }
  41171. // Header returns an http.Header that can be modified by the caller to
  41172. // add HTTP headers to the request.
  41173. func (c *HealthChecksListCall) Header() http.Header {
  41174. if c.header_ == nil {
  41175. c.header_ = make(http.Header)
  41176. }
  41177. return c.header_
  41178. }
  41179. func (c *HealthChecksListCall) doRequest(alt string) (*http.Response, error) {
  41180. reqHeaders := make(http.Header)
  41181. for k, v := range c.header_ {
  41182. reqHeaders[k] = v
  41183. }
  41184. reqHeaders.Set("User-Agent", c.s.userAgent())
  41185. if c.ifNoneMatch_ != "" {
  41186. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  41187. }
  41188. var body io.Reader = nil
  41189. c.urlParams_.Set("alt", alt)
  41190. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/healthChecks")
  41191. urls += "?" + c.urlParams_.Encode()
  41192. req, _ := http.NewRequest("GET", urls, body)
  41193. req.Header = reqHeaders
  41194. googleapi.Expand(req.URL, map[string]string{
  41195. "project": c.project,
  41196. })
  41197. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  41198. }
  41199. // Do executes the "compute.healthChecks.list" call.
  41200. // Exactly one of *HealthCheckList or error will be non-nil. Any non-2xx
  41201. // status code is an error. Response headers are in either
  41202. // *HealthCheckList.ServerResponse.Header or (if a response was returned
  41203. // at all) in error.(*googleapi.Error).Header. Use
  41204. // googleapi.IsNotModified to check whether the returned error was
  41205. // because http.StatusNotModified was returned.
  41206. func (c *HealthChecksListCall) Do(opts ...googleapi.CallOption) (*HealthCheckList, 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 := &HealthCheckList{
  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": "Retrieves the list of HealthCheck resources available to the specified project.",
  41238. // "httpMethod": "GET",
  41239. // "id": "compute.healthChecks.list",
  41240. // "parameterOrder": [
  41241. // "project"
  41242. // ],
  41243. // "parameters": {
  41244. // "filter": {
  41245. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  41246. // "location": "query",
  41247. // "type": "string"
  41248. // },
  41249. // "maxResults": {
  41250. // "default": "500",
  41251. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  41252. // "format": "uint32",
  41253. // "location": "query",
  41254. // "minimum": "0",
  41255. // "type": "integer"
  41256. // },
  41257. // "orderBy": {
  41258. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  41259. // "location": "query",
  41260. // "type": "string"
  41261. // },
  41262. // "pageToken": {
  41263. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  41264. // "location": "query",
  41265. // "type": "string"
  41266. // },
  41267. // "project": {
  41268. // "description": "Project ID for this request.",
  41269. // "location": "path",
  41270. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  41271. // "required": true,
  41272. // "type": "string"
  41273. // }
  41274. // },
  41275. // "path": "{project}/global/healthChecks",
  41276. // "response": {
  41277. // "$ref": "HealthCheckList"
  41278. // },
  41279. // "scopes": [
  41280. // "https://www.googleapis.com/auth/cloud-platform",
  41281. // "https://www.googleapis.com/auth/compute",
  41282. // "https://www.googleapis.com/auth/compute.readonly"
  41283. // ]
  41284. // }
  41285. }
  41286. // Pages invokes f for each page of results.
  41287. // A non-nil error returned from f will halt the iteration.
  41288. // The provided context supersedes any context provided to the Context method.
  41289. func (c *HealthChecksListCall) Pages(ctx context.Context, f func(*HealthCheckList) error) error {
  41290. c.ctx_ = ctx
  41291. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  41292. for {
  41293. x, err := c.Do()
  41294. if err != nil {
  41295. return err
  41296. }
  41297. if err := f(x); err != nil {
  41298. return err
  41299. }
  41300. if x.NextPageToken == "" {
  41301. return nil
  41302. }
  41303. c.PageToken(x.NextPageToken)
  41304. }
  41305. }
  41306. // method id "compute.healthChecks.patch":
  41307. type HealthChecksPatchCall struct {
  41308. s *Service
  41309. project string
  41310. healthCheck string
  41311. healthcheck *HealthCheck
  41312. urlParams_ gensupport.URLParams
  41313. ctx_ context.Context
  41314. header_ http.Header
  41315. }
  41316. // Patch: Updates a HealthCheck resource in the specified project using
  41317. // the data included in the request. This method supports PATCH
  41318. // semantics and uses the JSON merge patch format and processing rules.
  41319. func (r *HealthChecksService) Patch(project string, healthCheck string, healthcheck *HealthCheck) *HealthChecksPatchCall {
  41320. c := &HealthChecksPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  41321. c.project = project
  41322. c.healthCheck = healthCheck
  41323. c.healthcheck = healthcheck
  41324. return c
  41325. }
  41326. // RequestId sets the optional parameter "requestId": An optional
  41327. // request ID to identify requests. Specify a unique request ID so that
  41328. // if you must retry your request, the server will know to ignore the
  41329. // request if it has already been completed.
  41330. //
  41331. // For example, consider a situation where you make an initial request
  41332. // and the request times out. If you make the request again with the
  41333. // same request ID, the server can check if original operation with the
  41334. // same request ID was received, and if so, will ignore the second
  41335. // request. This prevents clients from accidentally creating duplicate
  41336. // commitments.
  41337. //
  41338. // The request ID must be a valid UUID with the exception that zero UUID
  41339. // is not supported (00000000-0000-0000-0000-000000000000).
  41340. func (c *HealthChecksPatchCall) RequestId(requestId string) *HealthChecksPatchCall {
  41341. c.urlParams_.Set("requestId", requestId)
  41342. return c
  41343. }
  41344. // Fields allows partial responses to be retrieved. See
  41345. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  41346. // for more information.
  41347. func (c *HealthChecksPatchCall) Fields(s ...googleapi.Field) *HealthChecksPatchCall {
  41348. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  41349. return c
  41350. }
  41351. // Context sets the context to be used in this call's Do method. Any
  41352. // pending HTTP request will be aborted if the provided context is
  41353. // canceled.
  41354. func (c *HealthChecksPatchCall) Context(ctx context.Context) *HealthChecksPatchCall {
  41355. c.ctx_ = ctx
  41356. return c
  41357. }
  41358. // Header returns an http.Header that can be modified by the caller to
  41359. // add HTTP headers to the request.
  41360. func (c *HealthChecksPatchCall) Header() http.Header {
  41361. if c.header_ == nil {
  41362. c.header_ = make(http.Header)
  41363. }
  41364. return c.header_
  41365. }
  41366. func (c *HealthChecksPatchCall) doRequest(alt string) (*http.Response, error) {
  41367. reqHeaders := make(http.Header)
  41368. for k, v := range c.header_ {
  41369. reqHeaders[k] = v
  41370. }
  41371. reqHeaders.Set("User-Agent", c.s.userAgent())
  41372. var body io.Reader = nil
  41373. body, err := googleapi.WithoutDataWrapper.JSONReader(c.healthcheck)
  41374. if err != nil {
  41375. return nil, err
  41376. }
  41377. reqHeaders.Set("Content-Type", "application/json")
  41378. c.urlParams_.Set("alt", alt)
  41379. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/healthChecks/{healthCheck}")
  41380. urls += "?" + c.urlParams_.Encode()
  41381. req, _ := http.NewRequest("PATCH", urls, body)
  41382. req.Header = reqHeaders
  41383. googleapi.Expand(req.URL, map[string]string{
  41384. "project": c.project,
  41385. "healthCheck": c.healthCheck,
  41386. })
  41387. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  41388. }
  41389. // Do executes the "compute.healthChecks.patch" call.
  41390. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  41391. // status code is an error. Response headers are in either
  41392. // *Operation.ServerResponse.Header or (if a response was returned at
  41393. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  41394. // to check whether the returned error was because
  41395. // http.StatusNotModified was returned.
  41396. func (c *HealthChecksPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  41397. gensupport.SetOptions(c.urlParams_, opts...)
  41398. res, err := c.doRequest("json")
  41399. if res != nil && res.StatusCode == http.StatusNotModified {
  41400. if res.Body != nil {
  41401. res.Body.Close()
  41402. }
  41403. return nil, &googleapi.Error{
  41404. Code: res.StatusCode,
  41405. Header: res.Header,
  41406. }
  41407. }
  41408. if err != nil {
  41409. return nil, err
  41410. }
  41411. defer googleapi.CloseBody(res)
  41412. if err := googleapi.CheckResponse(res); err != nil {
  41413. return nil, err
  41414. }
  41415. ret := &Operation{
  41416. ServerResponse: googleapi.ServerResponse{
  41417. Header: res.Header,
  41418. HTTPStatusCode: res.StatusCode,
  41419. },
  41420. }
  41421. target := &ret
  41422. if err := gensupport.DecodeResponse(target, res); err != nil {
  41423. return nil, err
  41424. }
  41425. return ret, nil
  41426. // {
  41427. // "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.",
  41428. // "httpMethod": "PATCH",
  41429. // "id": "compute.healthChecks.patch",
  41430. // "parameterOrder": [
  41431. // "project",
  41432. // "healthCheck"
  41433. // ],
  41434. // "parameters": {
  41435. // "healthCheck": {
  41436. // "description": "Name of the HealthCheck resource to patch.",
  41437. // "location": "path",
  41438. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  41439. // "required": true,
  41440. // "type": "string"
  41441. // },
  41442. // "project": {
  41443. // "description": "Project ID for this request.",
  41444. // "location": "path",
  41445. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  41446. // "required": true,
  41447. // "type": "string"
  41448. // },
  41449. // "requestId": {
  41450. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  41451. // "location": "query",
  41452. // "type": "string"
  41453. // }
  41454. // },
  41455. // "path": "{project}/global/healthChecks/{healthCheck}",
  41456. // "request": {
  41457. // "$ref": "HealthCheck"
  41458. // },
  41459. // "response": {
  41460. // "$ref": "Operation"
  41461. // },
  41462. // "scopes": [
  41463. // "https://www.googleapis.com/auth/cloud-platform",
  41464. // "https://www.googleapis.com/auth/compute"
  41465. // ]
  41466. // }
  41467. }
  41468. // method id "compute.healthChecks.testIamPermissions":
  41469. type HealthChecksTestIamPermissionsCall struct {
  41470. s *Service
  41471. project string
  41472. resource string
  41473. testpermissionsrequest *TestPermissionsRequest
  41474. urlParams_ gensupport.URLParams
  41475. ctx_ context.Context
  41476. header_ http.Header
  41477. }
  41478. // TestIamPermissions: Returns permissions that a caller has on the
  41479. // specified resource.
  41480. func (r *HealthChecksService) TestIamPermissions(project string, resource string, testpermissionsrequest *TestPermissionsRequest) *HealthChecksTestIamPermissionsCall {
  41481. c := &HealthChecksTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  41482. c.project = project
  41483. c.resource = resource
  41484. c.testpermissionsrequest = testpermissionsrequest
  41485. return c
  41486. }
  41487. // Fields allows partial responses to be retrieved. See
  41488. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  41489. // for more information.
  41490. func (c *HealthChecksTestIamPermissionsCall) Fields(s ...googleapi.Field) *HealthChecksTestIamPermissionsCall {
  41491. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  41492. return c
  41493. }
  41494. // Context sets the context to be used in this call's Do method. Any
  41495. // pending HTTP request will be aborted if the provided context is
  41496. // canceled.
  41497. func (c *HealthChecksTestIamPermissionsCall) Context(ctx context.Context) *HealthChecksTestIamPermissionsCall {
  41498. c.ctx_ = ctx
  41499. return c
  41500. }
  41501. // Header returns an http.Header that can be modified by the caller to
  41502. // add HTTP headers to the request.
  41503. func (c *HealthChecksTestIamPermissionsCall) Header() http.Header {
  41504. if c.header_ == nil {
  41505. c.header_ = make(http.Header)
  41506. }
  41507. return c.header_
  41508. }
  41509. func (c *HealthChecksTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  41510. reqHeaders := make(http.Header)
  41511. for k, v := range c.header_ {
  41512. reqHeaders[k] = v
  41513. }
  41514. reqHeaders.Set("User-Agent", c.s.userAgent())
  41515. var body io.Reader = nil
  41516. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  41517. if err != nil {
  41518. return nil, err
  41519. }
  41520. reqHeaders.Set("Content-Type", "application/json")
  41521. c.urlParams_.Set("alt", alt)
  41522. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/healthChecks/{resource}/testIamPermissions")
  41523. urls += "?" + c.urlParams_.Encode()
  41524. req, _ := http.NewRequest("POST", urls, body)
  41525. req.Header = reqHeaders
  41526. googleapi.Expand(req.URL, map[string]string{
  41527. "project": c.project,
  41528. "resource": c.resource,
  41529. })
  41530. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  41531. }
  41532. // Do executes the "compute.healthChecks.testIamPermissions" call.
  41533. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  41534. // non-2xx status code is an error. Response headers are in either
  41535. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  41536. // returned at all) in error.(*googleapi.Error).Header. Use
  41537. // googleapi.IsNotModified to check whether the returned error was
  41538. // because http.StatusNotModified was returned.
  41539. func (c *HealthChecksTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  41540. gensupport.SetOptions(c.urlParams_, opts...)
  41541. res, err := c.doRequest("json")
  41542. if res != nil && res.StatusCode == http.StatusNotModified {
  41543. if res.Body != nil {
  41544. res.Body.Close()
  41545. }
  41546. return nil, &googleapi.Error{
  41547. Code: res.StatusCode,
  41548. Header: res.Header,
  41549. }
  41550. }
  41551. if err != nil {
  41552. return nil, err
  41553. }
  41554. defer googleapi.CloseBody(res)
  41555. if err := googleapi.CheckResponse(res); err != nil {
  41556. return nil, err
  41557. }
  41558. ret := &TestPermissionsResponse{
  41559. ServerResponse: googleapi.ServerResponse{
  41560. Header: res.Header,
  41561. HTTPStatusCode: res.StatusCode,
  41562. },
  41563. }
  41564. target := &ret
  41565. if err := gensupport.DecodeResponse(target, res); err != nil {
  41566. return nil, err
  41567. }
  41568. return ret, nil
  41569. // {
  41570. // "description": "Returns permissions that a caller has on the specified resource.",
  41571. // "httpMethod": "POST",
  41572. // "id": "compute.healthChecks.testIamPermissions",
  41573. // "parameterOrder": [
  41574. // "project",
  41575. // "resource"
  41576. // ],
  41577. // "parameters": {
  41578. // "project": {
  41579. // "description": "Project ID for this request.",
  41580. // "location": "path",
  41581. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  41582. // "required": true,
  41583. // "type": "string"
  41584. // },
  41585. // "resource": {
  41586. // "description": "Name of the resource for this request.",
  41587. // "location": "path",
  41588. // "pattern": "(?:[-a-z0-9_]{0,62}[a-z0-9])?",
  41589. // "required": true,
  41590. // "type": "string"
  41591. // }
  41592. // },
  41593. // "path": "{project}/global/healthChecks/{resource}/testIamPermissions",
  41594. // "request": {
  41595. // "$ref": "TestPermissionsRequest"
  41596. // },
  41597. // "response": {
  41598. // "$ref": "TestPermissionsResponse"
  41599. // },
  41600. // "scopes": [
  41601. // "https://www.googleapis.com/auth/cloud-platform",
  41602. // "https://www.googleapis.com/auth/compute",
  41603. // "https://www.googleapis.com/auth/compute.readonly"
  41604. // ]
  41605. // }
  41606. }
  41607. // method id "compute.healthChecks.update":
  41608. type HealthChecksUpdateCall struct {
  41609. s *Service
  41610. project string
  41611. healthCheck string
  41612. healthcheck *HealthCheck
  41613. urlParams_ gensupport.URLParams
  41614. ctx_ context.Context
  41615. header_ http.Header
  41616. }
  41617. // Update: Updates a HealthCheck resource in the specified project using
  41618. // the data included in the request.
  41619. func (r *HealthChecksService) Update(project string, healthCheck string, healthcheck *HealthCheck) *HealthChecksUpdateCall {
  41620. c := &HealthChecksUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  41621. c.project = project
  41622. c.healthCheck = healthCheck
  41623. c.healthcheck = healthcheck
  41624. return c
  41625. }
  41626. // RequestId sets the optional parameter "requestId": An optional
  41627. // request ID to identify requests. Specify a unique request ID so that
  41628. // if you must retry your request, the server will know to ignore the
  41629. // request if it has already been completed.
  41630. //
  41631. // For example, consider a situation where you make an initial request
  41632. // and the request times out. If you make the request again with the
  41633. // same request ID, the server can check if original operation with the
  41634. // same request ID was received, and if so, will ignore the second
  41635. // request. This prevents clients from accidentally creating duplicate
  41636. // commitments.
  41637. //
  41638. // The request ID must be a valid UUID with the exception that zero UUID
  41639. // is not supported (00000000-0000-0000-0000-000000000000).
  41640. func (c *HealthChecksUpdateCall) RequestId(requestId string) *HealthChecksUpdateCall {
  41641. c.urlParams_.Set("requestId", requestId)
  41642. return c
  41643. }
  41644. // Fields allows partial responses to be retrieved. See
  41645. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  41646. // for more information.
  41647. func (c *HealthChecksUpdateCall) Fields(s ...googleapi.Field) *HealthChecksUpdateCall {
  41648. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  41649. return c
  41650. }
  41651. // Context sets the context to be used in this call's Do method. Any
  41652. // pending HTTP request will be aborted if the provided context is
  41653. // canceled.
  41654. func (c *HealthChecksUpdateCall) Context(ctx context.Context) *HealthChecksUpdateCall {
  41655. c.ctx_ = ctx
  41656. return c
  41657. }
  41658. // Header returns an http.Header that can be modified by the caller to
  41659. // add HTTP headers to the request.
  41660. func (c *HealthChecksUpdateCall) Header() http.Header {
  41661. if c.header_ == nil {
  41662. c.header_ = make(http.Header)
  41663. }
  41664. return c.header_
  41665. }
  41666. func (c *HealthChecksUpdateCall) doRequest(alt string) (*http.Response, error) {
  41667. reqHeaders := make(http.Header)
  41668. for k, v := range c.header_ {
  41669. reqHeaders[k] = v
  41670. }
  41671. reqHeaders.Set("User-Agent", c.s.userAgent())
  41672. var body io.Reader = nil
  41673. body, err := googleapi.WithoutDataWrapper.JSONReader(c.healthcheck)
  41674. if err != nil {
  41675. return nil, err
  41676. }
  41677. reqHeaders.Set("Content-Type", "application/json")
  41678. c.urlParams_.Set("alt", alt)
  41679. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/healthChecks/{healthCheck}")
  41680. urls += "?" + c.urlParams_.Encode()
  41681. req, _ := http.NewRequest("PUT", urls, body)
  41682. req.Header = reqHeaders
  41683. googleapi.Expand(req.URL, map[string]string{
  41684. "project": c.project,
  41685. "healthCheck": c.healthCheck,
  41686. })
  41687. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  41688. }
  41689. // Do executes the "compute.healthChecks.update" call.
  41690. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  41691. // status code is an error. Response headers are in either
  41692. // *Operation.ServerResponse.Header or (if a response was returned at
  41693. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  41694. // to check whether the returned error was because
  41695. // http.StatusNotModified was returned.
  41696. func (c *HealthChecksUpdateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  41697. gensupport.SetOptions(c.urlParams_, opts...)
  41698. res, err := c.doRequest("json")
  41699. if res != nil && res.StatusCode == http.StatusNotModified {
  41700. if res.Body != nil {
  41701. res.Body.Close()
  41702. }
  41703. return nil, &googleapi.Error{
  41704. Code: res.StatusCode,
  41705. Header: res.Header,
  41706. }
  41707. }
  41708. if err != nil {
  41709. return nil, err
  41710. }
  41711. defer googleapi.CloseBody(res)
  41712. if err := googleapi.CheckResponse(res); err != nil {
  41713. return nil, err
  41714. }
  41715. ret := &Operation{
  41716. ServerResponse: googleapi.ServerResponse{
  41717. Header: res.Header,
  41718. HTTPStatusCode: res.StatusCode,
  41719. },
  41720. }
  41721. target := &ret
  41722. if err := gensupport.DecodeResponse(target, res); err != nil {
  41723. return nil, err
  41724. }
  41725. return ret, nil
  41726. // {
  41727. // "description": "Updates a HealthCheck resource in the specified project using the data included in the request.",
  41728. // "httpMethod": "PUT",
  41729. // "id": "compute.healthChecks.update",
  41730. // "parameterOrder": [
  41731. // "project",
  41732. // "healthCheck"
  41733. // ],
  41734. // "parameters": {
  41735. // "healthCheck": {
  41736. // "description": "Name of the HealthCheck resource to update.",
  41737. // "location": "path",
  41738. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  41739. // "required": true,
  41740. // "type": "string"
  41741. // },
  41742. // "project": {
  41743. // "description": "Project ID for this request.",
  41744. // "location": "path",
  41745. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  41746. // "required": true,
  41747. // "type": "string"
  41748. // },
  41749. // "requestId": {
  41750. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  41751. // "location": "query",
  41752. // "type": "string"
  41753. // }
  41754. // },
  41755. // "path": "{project}/global/healthChecks/{healthCheck}",
  41756. // "request": {
  41757. // "$ref": "HealthCheck"
  41758. // },
  41759. // "response": {
  41760. // "$ref": "Operation"
  41761. // },
  41762. // "scopes": [
  41763. // "https://www.googleapis.com/auth/cloud-platform",
  41764. // "https://www.googleapis.com/auth/compute"
  41765. // ]
  41766. // }
  41767. }
  41768. // method id "compute.httpHealthChecks.delete":
  41769. type HttpHealthChecksDeleteCall struct {
  41770. s *Service
  41771. project string
  41772. httpHealthCheck string
  41773. urlParams_ gensupport.URLParams
  41774. ctx_ context.Context
  41775. header_ http.Header
  41776. }
  41777. // Delete: Deletes the specified HttpHealthCheck resource.
  41778. // For details, see https://cloud.google.com/compute/docs/reference/latest/httpHealthChecks/delete
  41779. func (r *HttpHealthChecksService) Delete(project string, httpHealthCheck string) *HttpHealthChecksDeleteCall {
  41780. c := &HttpHealthChecksDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  41781. c.project = project
  41782. c.httpHealthCheck = httpHealthCheck
  41783. return c
  41784. }
  41785. // RequestId sets the optional parameter "requestId": An optional
  41786. // request ID to identify requests. Specify a unique request ID so that
  41787. // if you must retry your request, the server will know to ignore the
  41788. // request if it has already been completed.
  41789. //
  41790. // For example, consider a situation where you make an initial request
  41791. // and the request times out. If you make the request again with the
  41792. // same request ID, the server can check if original operation with the
  41793. // same request ID was received, and if so, will ignore the second
  41794. // request. This prevents clients from accidentally creating duplicate
  41795. // commitments.
  41796. //
  41797. // The request ID must be a valid UUID with the exception that zero UUID
  41798. // is not supported (00000000-0000-0000-0000-000000000000).
  41799. func (c *HttpHealthChecksDeleteCall) RequestId(requestId string) *HttpHealthChecksDeleteCall {
  41800. c.urlParams_.Set("requestId", requestId)
  41801. return c
  41802. }
  41803. // Fields allows partial responses to be retrieved. See
  41804. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  41805. // for more information.
  41806. func (c *HttpHealthChecksDeleteCall) Fields(s ...googleapi.Field) *HttpHealthChecksDeleteCall {
  41807. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  41808. return c
  41809. }
  41810. // Context sets the context to be used in this call's Do method. Any
  41811. // pending HTTP request will be aborted if the provided context is
  41812. // canceled.
  41813. func (c *HttpHealthChecksDeleteCall) Context(ctx context.Context) *HttpHealthChecksDeleteCall {
  41814. c.ctx_ = ctx
  41815. return c
  41816. }
  41817. // Header returns an http.Header that can be modified by the caller to
  41818. // add HTTP headers to the request.
  41819. func (c *HttpHealthChecksDeleteCall) Header() http.Header {
  41820. if c.header_ == nil {
  41821. c.header_ = make(http.Header)
  41822. }
  41823. return c.header_
  41824. }
  41825. func (c *HttpHealthChecksDeleteCall) doRequest(alt string) (*http.Response, error) {
  41826. reqHeaders := make(http.Header)
  41827. for k, v := range c.header_ {
  41828. reqHeaders[k] = v
  41829. }
  41830. reqHeaders.Set("User-Agent", c.s.userAgent())
  41831. var body io.Reader = nil
  41832. c.urlParams_.Set("alt", alt)
  41833. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/httpHealthChecks/{httpHealthCheck}")
  41834. urls += "?" + c.urlParams_.Encode()
  41835. req, _ := http.NewRequest("DELETE", urls, body)
  41836. req.Header = reqHeaders
  41837. googleapi.Expand(req.URL, map[string]string{
  41838. "project": c.project,
  41839. "httpHealthCheck": c.httpHealthCheck,
  41840. })
  41841. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  41842. }
  41843. // Do executes the "compute.httpHealthChecks.delete" call.
  41844. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  41845. // status code is an error. Response headers are in either
  41846. // *Operation.ServerResponse.Header or (if a response was returned at
  41847. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  41848. // to check whether the returned error was because
  41849. // http.StatusNotModified was returned.
  41850. func (c *HttpHealthChecksDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  41851. gensupport.SetOptions(c.urlParams_, opts...)
  41852. res, err := c.doRequest("json")
  41853. if res != nil && res.StatusCode == http.StatusNotModified {
  41854. if res.Body != nil {
  41855. res.Body.Close()
  41856. }
  41857. return nil, &googleapi.Error{
  41858. Code: res.StatusCode,
  41859. Header: res.Header,
  41860. }
  41861. }
  41862. if err != nil {
  41863. return nil, err
  41864. }
  41865. defer googleapi.CloseBody(res)
  41866. if err := googleapi.CheckResponse(res); err != nil {
  41867. return nil, err
  41868. }
  41869. ret := &Operation{
  41870. ServerResponse: googleapi.ServerResponse{
  41871. Header: res.Header,
  41872. HTTPStatusCode: res.StatusCode,
  41873. },
  41874. }
  41875. target := &ret
  41876. if err := gensupport.DecodeResponse(target, res); err != nil {
  41877. return nil, err
  41878. }
  41879. return ret, nil
  41880. // {
  41881. // "description": "Deletes the specified HttpHealthCheck resource.",
  41882. // "httpMethod": "DELETE",
  41883. // "id": "compute.httpHealthChecks.delete",
  41884. // "parameterOrder": [
  41885. // "project",
  41886. // "httpHealthCheck"
  41887. // ],
  41888. // "parameters": {
  41889. // "httpHealthCheck": {
  41890. // "description": "Name of the HttpHealthCheck resource to delete.",
  41891. // "location": "path",
  41892. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  41893. // "required": true,
  41894. // "type": "string"
  41895. // },
  41896. // "project": {
  41897. // "description": "Project ID for this request.",
  41898. // "location": "path",
  41899. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  41900. // "required": true,
  41901. // "type": "string"
  41902. // },
  41903. // "requestId": {
  41904. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  41905. // "location": "query",
  41906. // "type": "string"
  41907. // }
  41908. // },
  41909. // "path": "{project}/global/httpHealthChecks/{httpHealthCheck}",
  41910. // "response": {
  41911. // "$ref": "Operation"
  41912. // },
  41913. // "scopes": [
  41914. // "https://www.googleapis.com/auth/cloud-platform",
  41915. // "https://www.googleapis.com/auth/compute"
  41916. // ]
  41917. // }
  41918. }
  41919. // method id "compute.httpHealthChecks.get":
  41920. type HttpHealthChecksGetCall struct {
  41921. s *Service
  41922. project string
  41923. httpHealthCheck string
  41924. urlParams_ gensupport.URLParams
  41925. ifNoneMatch_ string
  41926. ctx_ context.Context
  41927. header_ http.Header
  41928. }
  41929. // Get: Returns the specified HttpHealthCheck resource. Gets a list of
  41930. // available HTTP health checks by making a list() request.
  41931. // For details, see https://cloud.google.com/compute/docs/reference/latest/httpHealthChecks/get
  41932. func (r *HttpHealthChecksService) Get(project string, httpHealthCheck string) *HttpHealthChecksGetCall {
  41933. c := &HttpHealthChecksGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  41934. c.project = project
  41935. c.httpHealthCheck = httpHealthCheck
  41936. return c
  41937. }
  41938. // Fields allows partial responses to be retrieved. See
  41939. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  41940. // for more information.
  41941. func (c *HttpHealthChecksGetCall) Fields(s ...googleapi.Field) *HttpHealthChecksGetCall {
  41942. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  41943. return c
  41944. }
  41945. // IfNoneMatch sets the optional parameter which makes the operation
  41946. // fail if the object's ETag matches the given value. This is useful for
  41947. // getting updates only after the object has changed since the last
  41948. // request. Use googleapi.IsNotModified to check whether the response
  41949. // error from Do is the result of In-None-Match.
  41950. func (c *HttpHealthChecksGetCall) IfNoneMatch(entityTag string) *HttpHealthChecksGetCall {
  41951. c.ifNoneMatch_ = entityTag
  41952. return c
  41953. }
  41954. // Context sets the context to be used in this call's Do method. Any
  41955. // pending HTTP request will be aborted if the provided context is
  41956. // canceled.
  41957. func (c *HttpHealthChecksGetCall) Context(ctx context.Context) *HttpHealthChecksGetCall {
  41958. c.ctx_ = ctx
  41959. return c
  41960. }
  41961. // Header returns an http.Header that can be modified by the caller to
  41962. // add HTTP headers to the request.
  41963. func (c *HttpHealthChecksGetCall) Header() http.Header {
  41964. if c.header_ == nil {
  41965. c.header_ = make(http.Header)
  41966. }
  41967. return c.header_
  41968. }
  41969. func (c *HttpHealthChecksGetCall) doRequest(alt string) (*http.Response, error) {
  41970. reqHeaders := make(http.Header)
  41971. for k, v := range c.header_ {
  41972. reqHeaders[k] = v
  41973. }
  41974. reqHeaders.Set("User-Agent", c.s.userAgent())
  41975. if c.ifNoneMatch_ != "" {
  41976. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  41977. }
  41978. var body io.Reader = nil
  41979. c.urlParams_.Set("alt", alt)
  41980. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/httpHealthChecks/{httpHealthCheck}")
  41981. urls += "?" + c.urlParams_.Encode()
  41982. req, _ := http.NewRequest("GET", urls, body)
  41983. req.Header = reqHeaders
  41984. googleapi.Expand(req.URL, map[string]string{
  41985. "project": c.project,
  41986. "httpHealthCheck": c.httpHealthCheck,
  41987. })
  41988. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  41989. }
  41990. // Do executes the "compute.httpHealthChecks.get" call.
  41991. // Exactly one of *HttpHealthCheck or error will be non-nil. Any non-2xx
  41992. // status code is an error. Response headers are in either
  41993. // *HttpHealthCheck.ServerResponse.Header or (if a response was returned
  41994. // at all) in error.(*googleapi.Error).Header. Use
  41995. // googleapi.IsNotModified to check whether the returned error was
  41996. // because http.StatusNotModified was returned.
  41997. func (c *HttpHealthChecksGetCall) Do(opts ...googleapi.CallOption) (*HttpHealthCheck, error) {
  41998. gensupport.SetOptions(c.urlParams_, opts...)
  41999. res, err := c.doRequest("json")
  42000. if res != nil && res.StatusCode == http.StatusNotModified {
  42001. if res.Body != nil {
  42002. res.Body.Close()
  42003. }
  42004. return nil, &googleapi.Error{
  42005. Code: res.StatusCode,
  42006. Header: res.Header,
  42007. }
  42008. }
  42009. if err != nil {
  42010. return nil, err
  42011. }
  42012. defer googleapi.CloseBody(res)
  42013. if err := googleapi.CheckResponse(res); err != nil {
  42014. return nil, err
  42015. }
  42016. ret := &HttpHealthCheck{
  42017. ServerResponse: googleapi.ServerResponse{
  42018. Header: res.Header,
  42019. HTTPStatusCode: res.StatusCode,
  42020. },
  42021. }
  42022. target := &ret
  42023. if err := gensupport.DecodeResponse(target, res); err != nil {
  42024. return nil, err
  42025. }
  42026. return ret, nil
  42027. // {
  42028. // "description": "Returns the specified HttpHealthCheck resource. Gets a list of available HTTP health checks by making a list() request.",
  42029. // "httpMethod": "GET",
  42030. // "id": "compute.httpHealthChecks.get",
  42031. // "parameterOrder": [
  42032. // "project",
  42033. // "httpHealthCheck"
  42034. // ],
  42035. // "parameters": {
  42036. // "httpHealthCheck": {
  42037. // "description": "Name of the HttpHealthCheck resource to return.",
  42038. // "location": "path",
  42039. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  42040. // "required": true,
  42041. // "type": "string"
  42042. // },
  42043. // "project": {
  42044. // "description": "Project ID for this request.",
  42045. // "location": "path",
  42046. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  42047. // "required": true,
  42048. // "type": "string"
  42049. // }
  42050. // },
  42051. // "path": "{project}/global/httpHealthChecks/{httpHealthCheck}",
  42052. // "response": {
  42053. // "$ref": "HttpHealthCheck"
  42054. // },
  42055. // "scopes": [
  42056. // "https://www.googleapis.com/auth/cloud-platform",
  42057. // "https://www.googleapis.com/auth/compute",
  42058. // "https://www.googleapis.com/auth/compute.readonly"
  42059. // ]
  42060. // }
  42061. }
  42062. // method id "compute.httpHealthChecks.insert":
  42063. type HttpHealthChecksInsertCall struct {
  42064. s *Service
  42065. project string
  42066. httphealthcheck *HttpHealthCheck
  42067. urlParams_ gensupport.URLParams
  42068. ctx_ context.Context
  42069. header_ http.Header
  42070. }
  42071. // Insert: Creates a HttpHealthCheck resource in the specified project
  42072. // using the data included in the request.
  42073. // For details, see https://cloud.google.com/compute/docs/reference/latest/httpHealthChecks/insert
  42074. func (r *HttpHealthChecksService) Insert(project string, httphealthcheck *HttpHealthCheck) *HttpHealthChecksInsertCall {
  42075. c := &HttpHealthChecksInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  42076. c.project = project
  42077. c.httphealthcheck = httphealthcheck
  42078. return c
  42079. }
  42080. // RequestId sets the optional parameter "requestId": An optional
  42081. // request ID to identify requests. Specify a unique request ID so that
  42082. // if you must retry your request, the server will know to ignore the
  42083. // request if it has already been completed.
  42084. //
  42085. // For example, consider a situation where you make an initial request
  42086. // and the request times out. If you make the request again with the
  42087. // same request ID, the server can check if original operation with the
  42088. // same request ID was received, and if so, will ignore the second
  42089. // request. This prevents clients from accidentally creating duplicate
  42090. // commitments.
  42091. //
  42092. // The request ID must be a valid UUID with the exception that zero UUID
  42093. // is not supported (00000000-0000-0000-0000-000000000000).
  42094. func (c *HttpHealthChecksInsertCall) RequestId(requestId string) *HttpHealthChecksInsertCall {
  42095. c.urlParams_.Set("requestId", requestId)
  42096. return c
  42097. }
  42098. // Fields allows partial responses to be retrieved. See
  42099. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  42100. // for more information.
  42101. func (c *HttpHealthChecksInsertCall) Fields(s ...googleapi.Field) *HttpHealthChecksInsertCall {
  42102. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  42103. return c
  42104. }
  42105. // Context sets the context to be used in this call's Do method. Any
  42106. // pending HTTP request will be aborted if the provided context is
  42107. // canceled.
  42108. func (c *HttpHealthChecksInsertCall) Context(ctx context.Context) *HttpHealthChecksInsertCall {
  42109. c.ctx_ = ctx
  42110. return c
  42111. }
  42112. // Header returns an http.Header that can be modified by the caller to
  42113. // add HTTP headers to the request.
  42114. func (c *HttpHealthChecksInsertCall) Header() http.Header {
  42115. if c.header_ == nil {
  42116. c.header_ = make(http.Header)
  42117. }
  42118. return c.header_
  42119. }
  42120. func (c *HttpHealthChecksInsertCall) doRequest(alt string) (*http.Response, error) {
  42121. reqHeaders := make(http.Header)
  42122. for k, v := range c.header_ {
  42123. reqHeaders[k] = v
  42124. }
  42125. reqHeaders.Set("User-Agent", c.s.userAgent())
  42126. var body io.Reader = nil
  42127. body, err := googleapi.WithoutDataWrapper.JSONReader(c.httphealthcheck)
  42128. if err != nil {
  42129. return nil, err
  42130. }
  42131. reqHeaders.Set("Content-Type", "application/json")
  42132. c.urlParams_.Set("alt", alt)
  42133. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/httpHealthChecks")
  42134. urls += "?" + c.urlParams_.Encode()
  42135. req, _ := http.NewRequest("POST", urls, body)
  42136. req.Header = reqHeaders
  42137. googleapi.Expand(req.URL, map[string]string{
  42138. "project": c.project,
  42139. })
  42140. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  42141. }
  42142. // Do executes the "compute.httpHealthChecks.insert" call.
  42143. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  42144. // status code is an error. Response headers are in either
  42145. // *Operation.ServerResponse.Header or (if a response was returned at
  42146. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  42147. // to check whether the returned error was because
  42148. // http.StatusNotModified was returned.
  42149. func (c *HttpHealthChecksInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  42150. gensupport.SetOptions(c.urlParams_, opts...)
  42151. res, err := c.doRequest("json")
  42152. if res != nil && res.StatusCode == http.StatusNotModified {
  42153. if res.Body != nil {
  42154. res.Body.Close()
  42155. }
  42156. return nil, &googleapi.Error{
  42157. Code: res.StatusCode,
  42158. Header: res.Header,
  42159. }
  42160. }
  42161. if err != nil {
  42162. return nil, err
  42163. }
  42164. defer googleapi.CloseBody(res)
  42165. if err := googleapi.CheckResponse(res); err != nil {
  42166. return nil, err
  42167. }
  42168. ret := &Operation{
  42169. ServerResponse: googleapi.ServerResponse{
  42170. Header: res.Header,
  42171. HTTPStatusCode: res.StatusCode,
  42172. },
  42173. }
  42174. target := &ret
  42175. if err := gensupport.DecodeResponse(target, res); err != nil {
  42176. return nil, err
  42177. }
  42178. return ret, nil
  42179. // {
  42180. // "description": "Creates a HttpHealthCheck resource in the specified project using the data included in the request.",
  42181. // "httpMethod": "POST",
  42182. // "id": "compute.httpHealthChecks.insert",
  42183. // "parameterOrder": [
  42184. // "project"
  42185. // ],
  42186. // "parameters": {
  42187. // "project": {
  42188. // "description": "Project ID for this request.",
  42189. // "location": "path",
  42190. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  42191. // "required": true,
  42192. // "type": "string"
  42193. // },
  42194. // "requestId": {
  42195. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  42196. // "location": "query",
  42197. // "type": "string"
  42198. // }
  42199. // },
  42200. // "path": "{project}/global/httpHealthChecks",
  42201. // "request": {
  42202. // "$ref": "HttpHealthCheck"
  42203. // },
  42204. // "response": {
  42205. // "$ref": "Operation"
  42206. // },
  42207. // "scopes": [
  42208. // "https://www.googleapis.com/auth/cloud-platform",
  42209. // "https://www.googleapis.com/auth/compute"
  42210. // ]
  42211. // }
  42212. }
  42213. // method id "compute.httpHealthChecks.list":
  42214. type HttpHealthChecksListCall struct {
  42215. s *Service
  42216. project string
  42217. urlParams_ gensupport.URLParams
  42218. ifNoneMatch_ string
  42219. ctx_ context.Context
  42220. header_ http.Header
  42221. }
  42222. // List: Retrieves the list of HttpHealthCheck resources available to
  42223. // the specified project.
  42224. // For details, see https://cloud.google.com/compute/docs/reference/latest/httpHealthChecks/list
  42225. func (r *HttpHealthChecksService) List(project string) *HttpHealthChecksListCall {
  42226. c := &HttpHealthChecksListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  42227. c.project = project
  42228. return c
  42229. }
  42230. // Filter sets the optional parameter "filter": A filter expression that
  42231. // filters resources listed in the response. The expression must specify
  42232. // the field name, a comparison operator, and the value that you want to
  42233. // use for filtering. The value must be a string, a number, or a
  42234. // boolean. The comparison operator must be either =, !=, >, or <.
  42235. //
  42236. // For example, if you are filtering Compute Engine instances, you can
  42237. // exclude instances named example-instance by specifying name !=
  42238. // example-instance.
  42239. //
  42240. // You can also filter nested fields. For example, you could specify
  42241. // scheduling.automaticRestart = false to include instances only if they
  42242. // are not scheduled for automatic restarts. You can use filtering on
  42243. // nested fields to filter based on resource labels.
  42244. //
  42245. // To filter on multiple expressions, provide each separate expression
  42246. // within parentheses. For example, (scheduling.automaticRestart = true)
  42247. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  42248. // AND expression. However, you can include AND and OR expressions
  42249. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  42250. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  42251. // true).
  42252. func (c *HttpHealthChecksListCall) Filter(filter string) *HttpHealthChecksListCall {
  42253. c.urlParams_.Set("filter", filter)
  42254. return c
  42255. }
  42256. // MaxResults sets the optional parameter "maxResults": The maximum
  42257. // number of results per page that should be returned. If the number of
  42258. // available results is larger than maxResults, Compute Engine returns a
  42259. // nextPageToken that can be used to get the next page of results in
  42260. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  42261. // (Default: 500)
  42262. func (c *HttpHealthChecksListCall) MaxResults(maxResults int64) *HttpHealthChecksListCall {
  42263. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  42264. return c
  42265. }
  42266. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  42267. // a certain order. By default, results are returned in alphanumerical
  42268. // order based on the resource name.
  42269. //
  42270. // You can also sort results in descending order based on the creation
  42271. // timestamp using orderBy="creationTimestamp desc". This sorts results
  42272. // based on the creationTimestamp field in reverse chronological order
  42273. // (newest result first). Use this to sort resources like operations so
  42274. // that the newest operation is returned first.
  42275. //
  42276. // Currently, only sorting by name or creationTimestamp desc is
  42277. // supported.
  42278. func (c *HttpHealthChecksListCall) OrderBy(orderBy string) *HttpHealthChecksListCall {
  42279. c.urlParams_.Set("orderBy", orderBy)
  42280. return c
  42281. }
  42282. // PageToken sets the optional parameter "pageToken": Specifies a page
  42283. // token to use. Set pageToken to the nextPageToken returned by a
  42284. // previous list request to get the next page of results.
  42285. func (c *HttpHealthChecksListCall) PageToken(pageToken string) *HttpHealthChecksListCall {
  42286. c.urlParams_.Set("pageToken", pageToken)
  42287. return c
  42288. }
  42289. // Fields allows partial responses to be retrieved. See
  42290. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  42291. // for more information.
  42292. func (c *HttpHealthChecksListCall) Fields(s ...googleapi.Field) *HttpHealthChecksListCall {
  42293. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  42294. return c
  42295. }
  42296. // IfNoneMatch sets the optional parameter which makes the operation
  42297. // fail if the object's ETag matches the given value. This is useful for
  42298. // getting updates only after the object has changed since the last
  42299. // request. Use googleapi.IsNotModified to check whether the response
  42300. // error from Do is the result of In-None-Match.
  42301. func (c *HttpHealthChecksListCall) IfNoneMatch(entityTag string) *HttpHealthChecksListCall {
  42302. c.ifNoneMatch_ = entityTag
  42303. return c
  42304. }
  42305. // Context sets the context to be used in this call's Do method. Any
  42306. // pending HTTP request will be aborted if the provided context is
  42307. // canceled.
  42308. func (c *HttpHealthChecksListCall) Context(ctx context.Context) *HttpHealthChecksListCall {
  42309. c.ctx_ = ctx
  42310. return c
  42311. }
  42312. // Header returns an http.Header that can be modified by the caller to
  42313. // add HTTP headers to the request.
  42314. func (c *HttpHealthChecksListCall) Header() http.Header {
  42315. if c.header_ == nil {
  42316. c.header_ = make(http.Header)
  42317. }
  42318. return c.header_
  42319. }
  42320. func (c *HttpHealthChecksListCall) doRequest(alt string) (*http.Response, error) {
  42321. reqHeaders := make(http.Header)
  42322. for k, v := range c.header_ {
  42323. reqHeaders[k] = v
  42324. }
  42325. reqHeaders.Set("User-Agent", c.s.userAgent())
  42326. if c.ifNoneMatch_ != "" {
  42327. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  42328. }
  42329. var body io.Reader = nil
  42330. c.urlParams_.Set("alt", alt)
  42331. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/httpHealthChecks")
  42332. urls += "?" + c.urlParams_.Encode()
  42333. req, _ := http.NewRequest("GET", urls, body)
  42334. req.Header = reqHeaders
  42335. googleapi.Expand(req.URL, map[string]string{
  42336. "project": c.project,
  42337. })
  42338. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  42339. }
  42340. // Do executes the "compute.httpHealthChecks.list" call.
  42341. // Exactly one of *HttpHealthCheckList or error will be non-nil. Any
  42342. // non-2xx status code is an error. Response headers are in either
  42343. // *HttpHealthCheckList.ServerResponse.Header or (if a response was
  42344. // returned at all) in error.(*googleapi.Error).Header. Use
  42345. // googleapi.IsNotModified to check whether the returned error was
  42346. // because http.StatusNotModified was returned.
  42347. func (c *HttpHealthChecksListCall) Do(opts ...googleapi.CallOption) (*HttpHealthCheckList, error) {
  42348. gensupport.SetOptions(c.urlParams_, opts...)
  42349. res, err := c.doRequest("json")
  42350. if res != nil && res.StatusCode == http.StatusNotModified {
  42351. if res.Body != nil {
  42352. res.Body.Close()
  42353. }
  42354. return nil, &googleapi.Error{
  42355. Code: res.StatusCode,
  42356. Header: res.Header,
  42357. }
  42358. }
  42359. if err != nil {
  42360. return nil, err
  42361. }
  42362. defer googleapi.CloseBody(res)
  42363. if err := googleapi.CheckResponse(res); err != nil {
  42364. return nil, err
  42365. }
  42366. ret := &HttpHealthCheckList{
  42367. ServerResponse: googleapi.ServerResponse{
  42368. Header: res.Header,
  42369. HTTPStatusCode: res.StatusCode,
  42370. },
  42371. }
  42372. target := &ret
  42373. if err := gensupport.DecodeResponse(target, res); err != nil {
  42374. return nil, err
  42375. }
  42376. return ret, nil
  42377. // {
  42378. // "description": "Retrieves the list of HttpHealthCheck resources available to the specified project.",
  42379. // "httpMethod": "GET",
  42380. // "id": "compute.httpHealthChecks.list",
  42381. // "parameterOrder": [
  42382. // "project"
  42383. // ],
  42384. // "parameters": {
  42385. // "filter": {
  42386. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  42387. // "location": "query",
  42388. // "type": "string"
  42389. // },
  42390. // "maxResults": {
  42391. // "default": "500",
  42392. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  42393. // "format": "uint32",
  42394. // "location": "query",
  42395. // "minimum": "0",
  42396. // "type": "integer"
  42397. // },
  42398. // "orderBy": {
  42399. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  42400. // "location": "query",
  42401. // "type": "string"
  42402. // },
  42403. // "pageToken": {
  42404. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  42405. // "location": "query",
  42406. // "type": "string"
  42407. // },
  42408. // "project": {
  42409. // "description": "Project ID for this request.",
  42410. // "location": "path",
  42411. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  42412. // "required": true,
  42413. // "type": "string"
  42414. // }
  42415. // },
  42416. // "path": "{project}/global/httpHealthChecks",
  42417. // "response": {
  42418. // "$ref": "HttpHealthCheckList"
  42419. // },
  42420. // "scopes": [
  42421. // "https://www.googleapis.com/auth/cloud-platform",
  42422. // "https://www.googleapis.com/auth/compute",
  42423. // "https://www.googleapis.com/auth/compute.readonly"
  42424. // ]
  42425. // }
  42426. }
  42427. // Pages invokes f for each page of results.
  42428. // A non-nil error returned from f will halt the iteration.
  42429. // The provided context supersedes any context provided to the Context method.
  42430. func (c *HttpHealthChecksListCall) Pages(ctx context.Context, f func(*HttpHealthCheckList) error) error {
  42431. c.ctx_ = ctx
  42432. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  42433. for {
  42434. x, err := c.Do()
  42435. if err != nil {
  42436. return err
  42437. }
  42438. if err := f(x); err != nil {
  42439. return err
  42440. }
  42441. if x.NextPageToken == "" {
  42442. return nil
  42443. }
  42444. c.PageToken(x.NextPageToken)
  42445. }
  42446. }
  42447. // method id "compute.httpHealthChecks.patch":
  42448. type HttpHealthChecksPatchCall struct {
  42449. s *Service
  42450. project string
  42451. httpHealthCheck string
  42452. httphealthcheck *HttpHealthCheck
  42453. urlParams_ gensupport.URLParams
  42454. ctx_ context.Context
  42455. header_ http.Header
  42456. }
  42457. // Patch: Updates a HttpHealthCheck resource in the specified project
  42458. // using the data included in the request. This method supports PATCH
  42459. // semantics and uses the JSON merge patch format and processing rules.
  42460. // For details, see https://cloud.google.com/compute/docs/reference/latest/httpHealthChecks/patch
  42461. func (r *HttpHealthChecksService) Patch(project string, httpHealthCheck string, httphealthcheck *HttpHealthCheck) *HttpHealthChecksPatchCall {
  42462. c := &HttpHealthChecksPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  42463. c.project = project
  42464. c.httpHealthCheck = httpHealthCheck
  42465. c.httphealthcheck = httphealthcheck
  42466. return c
  42467. }
  42468. // RequestId sets the optional parameter "requestId": An optional
  42469. // request ID to identify requests. Specify a unique request ID so that
  42470. // if you must retry your request, the server will know to ignore the
  42471. // request if it has already been completed.
  42472. //
  42473. // For example, consider a situation where you make an initial request
  42474. // and the request times out. If you make the request again with the
  42475. // same request ID, the server can check if original operation with the
  42476. // same request ID was received, and if so, will ignore the second
  42477. // request. This prevents clients from accidentally creating duplicate
  42478. // commitments.
  42479. //
  42480. // The request ID must be a valid UUID with the exception that zero UUID
  42481. // is not supported (00000000-0000-0000-0000-000000000000).
  42482. func (c *HttpHealthChecksPatchCall) RequestId(requestId string) *HttpHealthChecksPatchCall {
  42483. c.urlParams_.Set("requestId", requestId)
  42484. return c
  42485. }
  42486. // Fields allows partial responses to be retrieved. See
  42487. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  42488. // for more information.
  42489. func (c *HttpHealthChecksPatchCall) Fields(s ...googleapi.Field) *HttpHealthChecksPatchCall {
  42490. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  42491. return c
  42492. }
  42493. // Context sets the context to be used in this call's Do method. Any
  42494. // pending HTTP request will be aborted if the provided context is
  42495. // canceled.
  42496. func (c *HttpHealthChecksPatchCall) Context(ctx context.Context) *HttpHealthChecksPatchCall {
  42497. c.ctx_ = ctx
  42498. return c
  42499. }
  42500. // Header returns an http.Header that can be modified by the caller to
  42501. // add HTTP headers to the request.
  42502. func (c *HttpHealthChecksPatchCall) Header() http.Header {
  42503. if c.header_ == nil {
  42504. c.header_ = make(http.Header)
  42505. }
  42506. return c.header_
  42507. }
  42508. func (c *HttpHealthChecksPatchCall) doRequest(alt string) (*http.Response, error) {
  42509. reqHeaders := make(http.Header)
  42510. for k, v := range c.header_ {
  42511. reqHeaders[k] = v
  42512. }
  42513. reqHeaders.Set("User-Agent", c.s.userAgent())
  42514. var body io.Reader = nil
  42515. body, err := googleapi.WithoutDataWrapper.JSONReader(c.httphealthcheck)
  42516. if err != nil {
  42517. return nil, err
  42518. }
  42519. reqHeaders.Set("Content-Type", "application/json")
  42520. c.urlParams_.Set("alt", alt)
  42521. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/httpHealthChecks/{httpHealthCheck}")
  42522. urls += "?" + c.urlParams_.Encode()
  42523. req, _ := http.NewRequest("PATCH", urls, body)
  42524. req.Header = reqHeaders
  42525. googleapi.Expand(req.URL, map[string]string{
  42526. "project": c.project,
  42527. "httpHealthCheck": c.httpHealthCheck,
  42528. })
  42529. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  42530. }
  42531. // Do executes the "compute.httpHealthChecks.patch" call.
  42532. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  42533. // status code is an error. Response headers are in either
  42534. // *Operation.ServerResponse.Header or (if a response was returned at
  42535. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  42536. // to check whether the returned error was because
  42537. // http.StatusNotModified was returned.
  42538. func (c *HttpHealthChecksPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  42539. gensupport.SetOptions(c.urlParams_, opts...)
  42540. res, err := c.doRequest("json")
  42541. if res != nil && res.StatusCode == http.StatusNotModified {
  42542. if res.Body != nil {
  42543. res.Body.Close()
  42544. }
  42545. return nil, &googleapi.Error{
  42546. Code: res.StatusCode,
  42547. Header: res.Header,
  42548. }
  42549. }
  42550. if err != nil {
  42551. return nil, err
  42552. }
  42553. defer googleapi.CloseBody(res)
  42554. if err := googleapi.CheckResponse(res); err != nil {
  42555. return nil, err
  42556. }
  42557. ret := &Operation{
  42558. ServerResponse: googleapi.ServerResponse{
  42559. Header: res.Header,
  42560. HTTPStatusCode: res.StatusCode,
  42561. },
  42562. }
  42563. target := &ret
  42564. if err := gensupport.DecodeResponse(target, res); err != nil {
  42565. return nil, err
  42566. }
  42567. return ret, nil
  42568. // {
  42569. // "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.",
  42570. // "httpMethod": "PATCH",
  42571. // "id": "compute.httpHealthChecks.patch",
  42572. // "parameterOrder": [
  42573. // "project",
  42574. // "httpHealthCheck"
  42575. // ],
  42576. // "parameters": {
  42577. // "httpHealthCheck": {
  42578. // "description": "Name of the HttpHealthCheck resource to patch.",
  42579. // "location": "path",
  42580. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  42581. // "required": true,
  42582. // "type": "string"
  42583. // },
  42584. // "project": {
  42585. // "description": "Project ID for this request.",
  42586. // "location": "path",
  42587. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  42588. // "required": true,
  42589. // "type": "string"
  42590. // },
  42591. // "requestId": {
  42592. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  42593. // "location": "query",
  42594. // "type": "string"
  42595. // }
  42596. // },
  42597. // "path": "{project}/global/httpHealthChecks/{httpHealthCheck}",
  42598. // "request": {
  42599. // "$ref": "HttpHealthCheck"
  42600. // },
  42601. // "response": {
  42602. // "$ref": "Operation"
  42603. // },
  42604. // "scopes": [
  42605. // "https://www.googleapis.com/auth/cloud-platform",
  42606. // "https://www.googleapis.com/auth/compute"
  42607. // ]
  42608. // }
  42609. }
  42610. // method id "compute.httpHealthChecks.testIamPermissions":
  42611. type HttpHealthChecksTestIamPermissionsCall struct {
  42612. s *Service
  42613. project string
  42614. resource string
  42615. testpermissionsrequest *TestPermissionsRequest
  42616. urlParams_ gensupport.URLParams
  42617. ctx_ context.Context
  42618. header_ http.Header
  42619. }
  42620. // TestIamPermissions: Returns permissions that a caller has on the
  42621. // specified resource.
  42622. func (r *HttpHealthChecksService) TestIamPermissions(project string, resource string, testpermissionsrequest *TestPermissionsRequest) *HttpHealthChecksTestIamPermissionsCall {
  42623. c := &HttpHealthChecksTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  42624. c.project = project
  42625. c.resource = resource
  42626. c.testpermissionsrequest = testpermissionsrequest
  42627. return c
  42628. }
  42629. // Fields allows partial responses to be retrieved. See
  42630. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  42631. // for more information.
  42632. func (c *HttpHealthChecksTestIamPermissionsCall) Fields(s ...googleapi.Field) *HttpHealthChecksTestIamPermissionsCall {
  42633. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  42634. return c
  42635. }
  42636. // Context sets the context to be used in this call's Do method. Any
  42637. // pending HTTP request will be aborted if the provided context is
  42638. // canceled.
  42639. func (c *HttpHealthChecksTestIamPermissionsCall) Context(ctx context.Context) *HttpHealthChecksTestIamPermissionsCall {
  42640. c.ctx_ = ctx
  42641. return c
  42642. }
  42643. // Header returns an http.Header that can be modified by the caller to
  42644. // add HTTP headers to the request.
  42645. func (c *HttpHealthChecksTestIamPermissionsCall) Header() http.Header {
  42646. if c.header_ == nil {
  42647. c.header_ = make(http.Header)
  42648. }
  42649. return c.header_
  42650. }
  42651. func (c *HttpHealthChecksTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  42652. reqHeaders := make(http.Header)
  42653. for k, v := range c.header_ {
  42654. reqHeaders[k] = v
  42655. }
  42656. reqHeaders.Set("User-Agent", c.s.userAgent())
  42657. var body io.Reader = nil
  42658. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  42659. if err != nil {
  42660. return nil, err
  42661. }
  42662. reqHeaders.Set("Content-Type", "application/json")
  42663. c.urlParams_.Set("alt", alt)
  42664. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/httpHealthChecks/{resource}/testIamPermissions")
  42665. urls += "?" + c.urlParams_.Encode()
  42666. req, _ := http.NewRequest("POST", urls, body)
  42667. req.Header = reqHeaders
  42668. googleapi.Expand(req.URL, map[string]string{
  42669. "project": c.project,
  42670. "resource": c.resource,
  42671. })
  42672. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  42673. }
  42674. // Do executes the "compute.httpHealthChecks.testIamPermissions" call.
  42675. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  42676. // non-2xx status code is an error. Response headers are in either
  42677. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  42678. // returned at all) in error.(*googleapi.Error).Header. Use
  42679. // googleapi.IsNotModified to check whether the returned error was
  42680. // because http.StatusNotModified was returned.
  42681. func (c *HttpHealthChecksTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  42682. gensupport.SetOptions(c.urlParams_, opts...)
  42683. res, err := c.doRequest("json")
  42684. if res != nil && res.StatusCode == http.StatusNotModified {
  42685. if res.Body != nil {
  42686. res.Body.Close()
  42687. }
  42688. return nil, &googleapi.Error{
  42689. Code: res.StatusCode,
  42690. Header: res.Header,
  42691. }
  42692. }
  42693. if err != nil {
  42694. return nil, err
  42695. }
  42696. defer googleapi.CloseBody(res)
  42697. if err := googleapi.CheckResponse(res); err != nil {
  42698. return nil, err
  42699. }
  42700. ret := &TestPermissionsResponse{
  42701. ServerResponse: googleapi.ServerResponse{
  42702. Header: res.Header,
  42703. HTTPStatusCode: res.StatusCode,
  42704. },
  42705. }
  42706. target := &ret
  42707. if err := gensupport.DecodeResponse(target, res); err != nil {
  42708. return nil, err
  42709. }
  42710. return ret, nil
  42711. // {
  42712. // "description": "Returns permissions that a caller has on the specified resource.",
  42713. // "httpMethod": "POST",
  42714. // "id": "compute.httpHealthChecks.testIamPermissions",
  42715. // "parameterOrder": [
  42716. // "project",
  42717. // "resource"
  42718. // ],
  42719. // "parameters": {
  42720. // "project": {
  42721. // "description": "Project ID for this request.",
  42722. // "location": "path",
  42723. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  42724. // "required": true,
  42725. // "type": "string"
  42726. // },
  42727. // "resource": {
  42728. // "description": "Name of the resource for this request.",
  42729. // "location": "path",
  42730. // "pattern": "(?:[-a-z0-9_]{0,62}[a-z0-9])?",
  42731. // "required": true,
  42732. // "type": "string"
  42733. // }
  42734. // },
  42735. // "path": "{project}/global/httpHealthChecks/{resource}/testIamPermissions",
  42736. // "request": {
  42737. // "$ref": "TestPermissionsRequest"
  42738. // },
  42739. // "response": {
  42740. // "$ref": "TestPermissionsResponse"
  42741. // },
  42742. // "scopes": [
  42743. // "https://www.googleapis.com/auth/cloud-platform",
  42744. // "https://www.googleapis.com/auth/compute",
  42745. // "https://www.googleapis.com/auth/compute.readonly"
  42746. // ]
  42747. // }
  42748. }
  42749. // method id "compute.httpHealthChecks.update":
  42750. type HttpHealthChecksUpdateCall struct {
  42751. s *Service
  42752. project string
  42753. httpHealthCheck string
  42754. httphealthcheck *HttpHealthCheck
  42755. urlParams_ gensupport.URLParams
  42756. ctx_ context.Context
  42757. header_ http.Header
  42758. }
  42759. // Update: Updates a HttpHealthCheck resource in the specified project
  42760. // using the data included in the request.
  42761. // For details, see https://cloud.google.com/compute/docs/reference/latest/httpHealthChecks/update
  42762. func (r *HttpHealthChecksService) Update(project string, httpHealthCheck string, httphealthcheck *HttpHealthCheck) *HttpHealthChecksUpdateCall {
  42763. c := &HttpHealthChecksUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  42764. c.project = project
  42765. c.httpHealthCheck = httpHealthCheck
  42766. c.httphealthcheck = httphealthcheck
  42767. return c
  42768. }
  42769. // RequestId sets the optional parameter "requestId": An optional
  42770. // request ID to identify requests. Specify a unique request ID so that
  42771. // if you must retry your request, the server will know to ignore the
  42772. // request if it has already been completed.
  42773. //
  42774. // For example, consider a situation where you make an initial request
  42775. // and the request times out. If you make the request again with the
  42776. // same request ID, the server can check if original operation with the
  42777. // same request ID was received, and if so, will ignore the second
  42778. // request. This prevents clients from accidentally creating duplicate
  42779. // commitments.
  42780. //
  42781. // The request ID must be a valid UUID with the exception that zero UUID
  42782. // is not supported (00000000-0000-0000-0000-000000000000).
  42783. func (c *HttpHealthChecksUpdateCall) RequestId(requestId string) *HttpHealthChecksUpdateCall {
  42784. c.urlParams_.Set("requestId", requestId)
  42785. return c
  42786. }
  42787. // Fields allows partial responses to be retrieved. See
  42788. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  42789. // for more information.
  42790. func (c *HttpHealthChecksUpdateCall) Fields(s ...googleapi.Field) *HttpHealthChecksUpdateCall {
  42791. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  42792. return c
  42793. }
  42794. // Context sets the context to be used in this call's Do method. Any
  42795. // pending HTTP request will be aborted if the provided context is
  42796. // canceled.
  42797. func (c *HttpHealthChecksUpdateCall) Context(ctx context.Context) *HttpHealthChecksUpdateCall {
  42798. c.ctx_ = ctx
  42799. return c
  42800. }
  42801. // Header returns an http.Header that can be modified by the caller to
  42802. // add HTTP headers to the request.
  42803. func (c *HttpHealthChecksUpdateCall) Header() http.Header {
  42804. if c.header_ == nil {
  42805. c.header_ = make(http.Header)
  42806. }
  42807. return c.header_
  42808. }
  42809. func (c *HttpHealthChecksUpdateCall) doRequest(alt string) (*http.Response, error) {
  42810. reqHeaders := make(http.Header)
  42811. for k, v := range c.header_ {
  42812. reqHeaders[k] = v
  42813. }
  42814. reqHeaders.Set("User-Agent", c.s.userAgent())
  42815. var body io.Reader = nil
  42816. body, err := googleapi.WithoutDataWrapper.JSONReader(c.httphealthcheck)
  42817. if err != nil {
  42818. return nil, err
  42819. }
  42820. reqHeaders.Set("Content-Type", "application/json")
  42821. c.urlParams_.Set("alt", alt)
  42822. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/httpHealthChecks/{httpHealthCheck}")
  42823. urls += "?" + c.urlParams_.Encode()
  42824. req, _ := http.NewRequest("PUT", urls, body)
  42825. req.Header = reqHeaders
  42826. googleapi.Expand(req.URL, map[string]string{
  42827. "project": c.project,
  42828. "httpHealthCheck": c.httpHealthCheck,
  42829. })
  42830. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  42831. }
  42832. // Do executes the "compute.httpHealthChecks.update" call.
  42833. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  42834. // status code is an error. Response headers are in either
  42835. // *Operation.ServerResponse.Header or (if a response was returned at
  42836. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  42837. // to check whether the returned error was because
  42838. // http.StatusNotModified was returned.
  42839. func (c *HttpHealthChecksUpdateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  42840. gensupport.SetOptions(c.urlParams_, opts...)
  42841. res, err := c.doRequest("json")
  42842. if res != nil && res.StatusCode == http.StatusNotModified {
  42843. if res.Body != nil {
  42844. res.Body.Close()
  42845. }
  42846. return nil, &googleapi.Error{
  42847. Code: res.StatusCode,
  42848. Header: res.Header,
  42849. }
  42850. }
  42851. if err != nil {
  42852. return nil, err
  42853. }
  42854. defer googleapi.CloseBody(res)
  42855. if err := googleapi.CheckResponse(res); err != nil {
  42856. return nil, err
  42857. }
  42858. ret := &Operation{
  42859. ServerResponse: googleapi.ServerResponse{
  42860. Header: res.Header,
  42861. HTTPStatusCode: res.StatusCode,
  42862. },
  42863. }
  42864. target := &ret
  42865. if err := gensupport.DecodeResponse(target, res); err != nil {
  42866. return nil, err
  42867. }
  42868. return ret, nil
  42869. // {
  42870. // "description": "Updates a HttpHealthCheck resource in the specified project using the data included in the request.",
  42871. // "httpMethod": "PUT",
  42872. // "id": "compute.httpHealthChecks.update",
  42873. // "parameterOrder": [
  42874. // "project",
  42875. // "httpHealthCheck"
  42876. // ],
  42877. // "parameters": {
  42878. // "httpHealthCheck": {
  42879. // "description": "Name of the HttpHealthCheck resource to update.",
  42880. // "location": "path",
  42881. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  42882. // "required": true,
  42883. // "type": "string"
  42884. // },
  42885. // "project": {
  42886. // "description": "Project ID for this request.",
  42887. // "location": "path",
  42888. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  42889. // "required": true,
  42890. // "type": "string"
  42891. // },
  42892. // "requestId": {
  42893. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  42894. // "location": "query",
  42895. // "type": "string"
  42896. // }
  42897. // },
  42898. // "path": "{project}/global/httpHealthChecks/{httpHealthCheck}",
  42899. // "request": {
  42900. // "$ref": "HttpHealthCheck"
  42901. // },
  42902. // "response": {
  42903. // "$ref": "Operation"
  42904. // },
  42905. // "scopes": [
  42906. // "https://www.googleapis.com/auth/cloud-platform",
  42907. // "https://www.googleapis.com/auth/compute"
  42908. // ]
  42909. // }
  42910. }
  42911. // method id "compute.httpsHealthChecks.delete":
  42912. type HttpsHealthChecksDeleteCall struct {
  42913. s *Service
  42914. project string
  42915. httpsHealthCheck string
  42916. urlParams_ gensupport.URLParams
  42917. ctx_ context.Context
  42918. header_ http.Header
  42919. }
  42920. // Delete: Deletes the specified HttpsHealthCheck resource.
  42921. func (r *HttpsHealthChecksService) Delete(project string, httpsHealthCheck string) *HttpsHealthChecksDeleteCall {
  42922. c := &HttpsHealthChecksDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  42923. c.project = project
  42924. c.httpsHealthCheck = httpsHealthCheck
  42925. return c
  42926. }
  42927. // RequestId sets the optional parameter "requestId": An optional
  42928. // request ID to identify requests. Specify a unique request ID so that
  42929. // if you must retry your request, the server will know to ignore the
  42930. // request if it has already been completed.
  42931. //
  42932. // For example, consider a situation where you make an initial request
  42933. // and the request times out. If you make the request again with the
  42934. // same request ID, the server can check if original operation with the
  42935. // same request ID was received, and if so, will ignore the second
  42936. // request. This prevents clients from accidentally creating duplicate
  42937. // commitments.
  42938. //
  42939. // The request ID must be a valid UUID with the exception that zero UUID
  42940. // is not supported (00000000-0000-0000-0000-000000000000).
  42941. func (c *HttpsHealthChecksDeleteCall) RequestId(requestId string) *HttpsHealthChecksDeleteCall {
  42942. c.urlParams_.Set("requestId", requestId)
  42943. return c
  42944. }
  42945. // Fields allows partial responses to be retrieved. See
  42946. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  42947. // for more information.
  42948. func (c *HttpsHealthChecksDeleteCall) Fields(s ...googleapi.Field) *HttpsHealthChecksDeleteCall {
  42949. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  42950. return c
  42951. }
  42952. // Context sets the context to be used in this call's Do method. Any
  42953. // pending HTTP request will be aborted if the provided context is
  42954. // canceled.
  42955. func (c *HttpsHealthChecksDeleteCall) Context(ctx context.Context) *HttpsHealthChecksDeleteCall {
  42956. c.ctx_ = ctx
  42957. return c
  42958. }
  42959. // Header returns an http.Header that can be modified by the caller to
  42960. // add HTTP headers to the request.
  42961. func (c *HttpsHealthChecksDeleteCall) Header() http.Header {
  42962. if c.header_ == nil {
  42963. c.header_ = make(http.Header)
  42964. }
  42965. return c.header_
  42966. }
  42967. func (c *HttpsHealthChecksDeleteCall) doRequest(alt string) (*http.Response, error) {
  42968. reqHeaders := make(http.Header)
  42969. for k, v := range c.header_ {
  42970. reqHeaders[k] = v
  42971. }
  42972. reqHeaders.Set("User-Agent", c.s.userAgent())
  42973. var body io.Reader = nil
  42974. c.urlParams_.Set("alt", alt)
  42975. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/httpsHealthChecks/{httpsHealthCheck}")
  42976. urls += "?" + c.urlParams_.Encode()
  42977. req, _ := http.NewRequest("DELETE", urls, body)
  42978. req.Header = reqHeaders
  42979. googleapi.Expand(req.URL, map[string]string{
  42980. "project": c.project,
  42981. "httpsHealthCheck": c.httpsHealthCheck,
  42982. })
  42983. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  42984. }
  42985. // Do executes the "compute.httpsHealthChecks.delete" call.
  42986. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  42987. // status code is an error. Response headers are in either
  42988. // *Operation.ServerResponse.Header or (if a response was returned at
  42989. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  42990. // to check whether the returned error was because
  42991. // http.StatusNotModified was returned.
  42992. func (c *HttpsHealthChecksDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  42993. gensupport.SetOptions(c.urlParams_, opts...)
  42994. res, err := c.doRequest("json")
  42995. if res != nil && res.StatusCode == http.StatusNotModified {
  42996. if res.Body != nil {
  42997. res.Body.Close()
  42998. }
  42999. return nil, &googleapi.Error{
  43000. Code: res.StatusCode,
  43001. Header: res.Header,
  43002. }
  43003. }
  43004. if err != nil {
  43005. return nil, err
  43006. }
  43007. defer googleapi.CloseBody(res)
  43008. if err := googleapi.CheckResponse(res); err != nil {
  43009. return nil, err
  43010. }
  43011. ret := &Operation{
  43012. ServerResponse: googleapi.ServerResponse{
  43013. Header: res.Header,
  43014. HTTPStatusCode: res.StatusCode,
  43015. },
  43016. }
  43017. target := &ret
  43018. if err := gensupport.DecodeResponse(target, res); err != nil {
  43019. return nil, err
  43020. }
  43021. return ret, nil
  43022. // {
  43023. // "description": "Deletes the specified HttpsHealthCheck resource.",
  43024. // "httpMethod": "DELETE",
  43025. // "id": "compute.httpsHealthChecks.delete",
  43026. // "parameterOrder": [
  43027. // "project",
  43028. // "httpsHealthCheck"
  43029. // ],
  43030. // "parameters": {
  43031. // "httpsHealthCheck": {
  43032. // "description": "Name of the HttpsHealthCheck resource to delete.",
  43033. // "location": "path",
  43034. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  43035. // "required": true,
  43036. // "type": "string"
  43037. // },
  43038. // "project": {
  43039. // "description": "Project ID for this request.",
  43040. // "location": "path",
  43041. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  43042. // "required": true,
  43043. // "type": "string"
  43044. // },
  43045. // "requestId": {
  43046. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  43047. // "location": "query",
  43048. // "type": "string"
  43049. // }
  43050. // },
  43051. // "path": "{project}/global/httpsHealthChecks/{httpsHealthCheck}",
  43052. // "response": {
  43053. // "$ref": "Operation"
  43054. // },
  43055. // "scopes": [
  43056. // "https://www.googleapis.com/auth/cloud-platform",
  43057. // "https://www.googleapis.com/auth/compute"
  43058. // ]
  43059. // }
  43060. }
  43061. // method id "compute.httpsHealthChecks.get":
  43062. type HttpsHealthChecksGetCall struct {
  43063. s *Service
  43064. project string
  43065. httpsHealthCheck string
  43066. urlParams_ gensupport.URLParams
  43067. ifNoneMatch_ string
  43068. ctx_ context.Context
  43069. header_ http.Header
  43070. }
  43071. // Get: Returns the specified HttpsHealthCheck resource. Gets a list of
  43072. // available HTTPS health checks by making a list() request.
  43073. func (r *HttpsHealthChecksService) Get(project string, httpsHealthCheck string) *HttpsHealthChecksGetCall {
  43074. c := &HttpsHealthChecksGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  43075. c.project = project
  43076. c.httpsHealthCheck = httpsHealthCheck
  43077. return c
  43078. }
  43079. // Fields allows partial responses to be retrieved. See
  43080. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  43081. // for more information.
  43082. func (c *HttpsHealthChecksGetCall) Fields(s ...googleapi.Field) *HttpsHealthChecksGetCall {
  43083. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  43084. return c
  43085. }
  43086. // IfNoneMatch sets the optional parameter which makes the operation
  43087. // fail if the object's ETag matches the given value. This is useful for
  43088. // getting updates only after the object has changed since the last
  43089. // request. Use googleapi.IsNotModified to check whether the response
  43090. // error from Do is the result of In-None-Match.
  43091. func (c *HttpsHealthChecksGetCall) IfNoneMatch(entityTag string) *HttpsHealthChecksGetCall {
  43092. c.ifNoneMatch_ = entityTag
  43093. return c
  43094. }
  43095. // Context sets the context to be used in this call's Do method. Any
  43096. // pending HTTP request will be aborted if the provided context is
  43097. // canceled.
  43098. func (c *HttpsHealthChecksGetCall) Context(ctx context.Context) *HttpsHealthChecksGetCall {
  43099. c.ctx_ = ctx
  43100. return c
  43101. }
  43102. // Header returns an http.Header that can be modified by the caller to
  43103. // add HTTP headers to the request.
  43104. func (c *HttpsHealthChecksGetCall) Header() http.Header {
  43105. if c.header_ == nil {
  43106. c.header_ = make(http.Header)
  43107. }
  43108. return c.header_
  43109. }
  43110. func (c *HttpsHealthChecksGetCall) doRequest(alt string) (*http.Response, error) {
  43111. reqHeaders := make(http.Header)
  43112. for k, v := range c.header_ {
  43113. reqHeaders[k] = v
  43114. }
  43115. reqHeaders.Set("User-Agent", c.s.userAgent())
  43116. if c.ifNoneMatch_ != "" {
  43117. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  43118. }
  43119. var body io.Reader = nil
  43120. c.urlParams_.Set("alt", alt)
  43121. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/httpsHealthChecks/{httpsHealthCheck}")
  43122. urls += "?" + c.urlParams_.Encode()
  43123. req, _ := http.NewRequest("GET", urls, body)
  43124. req.Header = reqHeaders
  43125. googleapi.Expand(req.URL, map[string]string{
  43126. "project": c.project,
  43127. "httpsHealthCheck": c.httpsHealthCheck,
  43128. })
  43129. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  43130. }
  43131. // Do executes the "compute.httpsHealthChecks.get" call.
  43132. // Exactly one of *HttpsHealthCheck or error will be non-nil. Any
  43133. // non-2xx status code is an error. Response headers are in either
  43134. // *HttpsHealthCheck.ServerResponse.Header or (if a response was
  43135. // returned at all) in error.(*googleapi.Error).Header. Use
  43136. // googleapi.IsNotModified to check whether the returned error was
  43137. // because http.StatusNotModified was returned.
  43138. func (c *HttpsHealthChecksGetCall) Do(opts ...googleapi.CallOption) (*HttpsHealthCheck, error) {
  43139. gensupport.SetOptions(c.urlParams_, opts...)
  43140. res, err := c.doRequest("json")
  43141. if res != nil && res.StatusCode == http.StatusNotModified {
  43142. if res.Body != nil {
  43143. res.Body.Close()
  43144. }
  43145. return nil, &googleapi.Error{
  43146. Code: res.StatusCode,
  43147. Header: res.Header,
  43148. }
  43149. }
  43150. if err != nil {
  43151. return nil, err
  43152. }
  43153. defer googleapi.CloseBody(res)
  43154. if err := googleapi.CheckResponse(res); err != nil {
  43155. return nil, err
  43156. }
  43157. ret := &HttpsHealthCheck{
  43158. ServerResponse: googleapi.ServerResponse{
  43159. Header: res.Header,
  43160. HTTPStatusCode: res.StatusCode,
  43161. },
  43162. }
  43163. target := &ret
  43164. if err := gensupport.DecodeResponse(target, res); err != nil {
  43165. return nil, err
  43166. }
  43167. return ret, nil
  43168. // {
  43169. // "description": "Returns the specified HttpsHealthCheck resource. Gets a list of available HTTPS health checks by making a list() request.",
  43170. // "httpMethod": "GET",
  43171. // "id": "compute.httpsHealthChecks.get",
  43172. // "parameterOrder": [
  43173. // "project",
  43174. // "httpsHealthCheck"
  43175. // ],
  43176. // "parameters": {
  43177. // "httpsHealthCheck": {
  43178. // "description": "Name of the HttpsHealthCheck resource to return.",
  43179. // "location": "path",
  43180. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  43181. // "required": true,
  43182. // "type": "string"
  43183. // },
  43184. // "project": {
  43185. // "description": "Project ID for this request.",
  43186. // "location": "path",
  43187. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  43188. // "required": true,
  43189. // "type": "string"
  43190. // }
  43191. // },
  43192. // "path": "{project}/global/httpsHealthChecks/{httpsHealthCheck}",
  43193. // "response": {
  43194. // "$ref": "HttpsHealthCheck"
  43195. // },
  43196. // "scopes": [
  43197. // "https://www.googleapis.com/auth/cloud-platform",
  43198. // "https://www.googleapis.com/auth/compute",
  43199. // "https://www.googleapis.com/auth/compute.readonly"
  43200. // ]
  43201. // }
  43202. }
  43203. // method id "compute.httpsHealthChecks.insert":
  43204. type HttpsHealthChecksInsertCall struct {
  43205. s *Service
  43206. project string
  43207. httpshealthcheck *HttpsHealthCheck
  43208. urlParams_ gensupport.URLParams
  43209. ctx_ context.Context
  43210. header_ http.Header
  43211. }
  43212. // Insert: Creates a HttpsHealthCheck resource in the specified project
  43213. // using the data included in the request.
  43214. func (r *HttpsHealthChecksService) Insert(project string, httpshealthcheck *HttpsHealthCheck) *HttpsHealthChecksInsertCall {
  43215. c := &HttpsHealthChecksInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  43216. c.project = project
  43217. c.httpshealthcheck = httpshealthcheck
  43218. return c
  43219. }
  43220. // RequestId sets the optional parameter "requestId": An optional
  43221. // request ID to identify requests. Specify a unique request ID so that
  43222. // if you must retry your request, the server will know to ignore the
  43223. // request if it has already been completed.
  43224. //
  43225. // For example, consider a situation where you make an initial request
  43226. // and the request times out. If you make the request again with the
  43227. // same request ID, the server can check if original operation with the
  43228. // same request ID was received, and if so, will ignore the second
  43229. // request. This prevents clients from accidentally creating duplicate
  43230. // commitments.
  43231. //
  43232. // The request ID must be a valid UUID with the exception that zero UUID
  43233. // is not supported (00000000-0000-0000-0000-000000000000).
  43234. func (c *HttpsHealthChecksInsertCall) RequestId(requestId string) *HttpsHealthChecksInsertCall {
  43235. c.urlParams_.Set("requestId", requestId)
  43236. return c
  43237. }
  43238. // Fields allows partial responses to be retrieved. See
  43239. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  43240. // for more information.
  43241. func (c *HttpsHealthChecksInsertCall) Fields(s ...googleapi.Field) *HttpsHealthChecksInsertCall {
  43242. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  43243. return c
  43244. }
  43245. // Context sets the context to be used in this call's Do method. Any
  43246. // pending HTTP request will be aborted if the provided context is
  43247. // canceled.
  43248. func (c *HttpsHealthChecksInsertCall) Context(ctx context.Context) *HttpsHealthChecksInsertCall {
  43249. c.ctx_ = ctx
  43250. return c
  43251. }
  43252. // Header returns an http.Header that can be modified by the caller to
  43253. // add HTTP headers to the request.
  43254. func (c *HttpsHealthChecksInsertCall) Header() http.Header {
  43255. if c.header_ == nil {
  43256. c.header_ = make(http.Header)
  43257. }
  43258. return c.header_
  43259. }
  43260. func (c *HttpsHealthChecksInsertCall) doRequest(alt string) (*http.Response, error) {
  43261. reqHeaders := make(http.Header)
  43262. for k, v := range c.header_ {
  43263. reqHeaders[k] = v
  43264. }
  43265. reqHeaders.Set("User-Agent", c.s.userAgent())
  43266. var body io.Reader = nil
  43267. body, err := googleapi.WithoutDataWrapper.JSONReader(c.httpshealthcheck)
  43268. if err != nil {
  43269. return nil, err
  43270. }
  43271. reqHeaders.Set("Content-Type", "application/json")
  43272. c.urlParams_.Set("alt", alt)
  43273. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/httpsHealthChecks")
  43274. urls += "?" + c.urlParams_.Encode()
  43275. req, _ := http.NewRequest("POST", urls, body)
  43276. req.Header = reqHeaders
  43277. googleapi.Expand(req.URL, map[string]string{
  43278. "project": c.project,
  43279. })
  43280. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  43281. }
  43282. // Do executes the "compute.httpsHealthChecks.insert" call.
  43283. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  43284. // status code is an error. Response headers are in either
  43285. // *Operation.ServerResponse.Header or (if a response was returned at
  43286. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  43287. // to check whether the returned error was because
  43288. // http.StatusNotModified was returned.
  43289. func (c *HttpsHealthChecksInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  43290. gensupport.SetOptions(c.urlParams_, opts...)
  43291. res, err := c.doRequest("json")
  43292. if res != nil && res.StatusCode == http.StatusNotModified {
  43293. if res.Body != nil {
  43294. res.Body.Close()
  43295. }
  43296. return nil, &googleapi.Error{
  43297. Code: res.StatusCode,
  43298. Header: res.Header,
  43299. }
  43300. }
  43301. if err != nil {
  43302. return nil, err
  43303. }
  43304. defer googleapi.CloseBody(res)
  43305. if err := googleapi.CheckResponse(res); err != nil {
  43306. return nil, err
  43307. }
  43308. ret := &Operation{
  43309. ServerResponse: googleapi.ServerResponse{
  43310. Header: res.Header,
  43311. HTTPStatusCode: res.StatusCode,
  43312. },
  43313. }
  43314. target := &ret
  43315. if err := gensupport.DecodeResponse(target, res); err != nil {
  43316. return nil, err
  43317. }
  43318. return ret, nil
  43319. // {
  43320. // "description": "Creates a HttpsHealthCheck resource in the specified project using the data included in the request.",
  43321. // "httpMethod": "POST",
  43322. // "id": "compute.httpsHealthChecks.insert",
  43323. // "parameterOrder": [
  43324. // "project"
  43325. // ],
  43326. // "parameters": {
  43327. // "project": {
  43328. // "description": "Project ID for this request.",
  43329. // "location": "path",
  43330. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  43331. // "required": true,
  43332. // "type": "string"
  43333. // },
  43334. // "requestId": {
  43335. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  43336. // "location": "query",
  43337. // "type": "string"
  43338. // }
  43339. // },
  43340. // "path": "{project}/global/httpsHealthChecks",
  43341. // "request": {
  43342. // "$ref": "HttpsHealthCheck"
  43343. // },
  43344. // "response": {
  43345. // "$ref": "Operation"
  43346. // },
  43347. // "scopes": [
  43348. // "https://www.googleapis.com/auth/cloud-platform",
  43349. // "https://www.googleapis.com/auth/compute"
  43350. // ]
  43351. // }
  43352. }
  43353. // method id "compute.httpsHealthChecks.list":
  43354. type HttpsHealthChecksListCall struct {
  43355. s *Service
  43356. project string
  43357. urlParams_ gensupport.URLParams
  43358. ifNoneMatch_ string
  43359. ctx_ context.Context
  43360. header_ http.Header
  43361. }
  43362. // List: Retrieves the list of HttpsHealthCheck resources available to
  43363. // the specified project.
  43364. func (r *HttpsHealthChecksService) List(project string) *HttpsHealthChecksListCall {
  43365. c := &HttpsHealthChecksListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  43366. c.project = project
  43367. return c
  43368. }
  43369. // Filter sets the optional parameter "filter": A filter expression that
  43370. // filters resources listed in the response. The expression must specify
  43371. // the field name, a comparison operator, and the value that you want to
  43372. // use for filtering. The value must be a string, a number, or a
  43373. // boolean. The comparison operator must be either =, !=, >, or <.
  43374. //
  43375. // For example, if you are filtering Compute Engine instances, you can
  43376. // exclude instances named example-instance by specifying name !=
  43377. // example-instance.
  43378. //
  43379. // You can also filter nested fields. For example, you could specify
  43380. // scheduling.automaticRestart = false to include instances only if they
  43381. // are not scheduled for automatic restarts. You can use filtering on
  43382. // nested fields to filter based on resource labels.
  43383. //
  43384. // To filter on multiple expressions, provide each separate expression
  43385. // within parentheses. For example, (scheduling.automaticRestart = true)
  43386. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  43387. // AND expression. However, you can include AND and OR expressions
  43388. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  43389. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  43390. // true).
  43391. func (c *HttpsHealthChecksListCall) Filter(filter string) *HttpsHealthChecksListCall {
  43392. c.urlParams_.Set("filter", filter)
  43393. return c
  43394. }
  43395. // MaxResults sets the optional parameter "maxResults": The maximum
  43396. // number of results per page that should be returned. If the number of
  43397. // available results is larger than maxResults, Compute Engine returns a
  43398. // nextPageToken that can be used to get the next page of results in
  43399. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  43400. // (Default: 500)
  43401. func (c *HttpsHealthChecksListCall) MaxResults(maxResults int64) *HttpsHealthChecksListCall {
  43402. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  43403. return c
  43404. }
  43405. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  43406. // a certain order. By default, results are returned in alphanumerical
  43407. // order based on the resource name.
  43408. //
  43409. // You can also sort results in descending order based on the creation
  43410. // timestamp using orderBy="creationTimestamp desc". This sorts results
  43411. // based on the creationTimestamp field in reverse chronological order
  43412. // (newest result first). Use this to sort resources like operations so
  43413. // that the newest operation is returned first.
  43414. //
  43415. // Currently, only sorting by name or creationTimestamp desc is
  43416. // supported.
  43417. func (c *HttpsHealthChecksListCall) OrderBy(orderBy string) *HttpsHealthChecksListCall {
  43418. c.urlParams_.Set("orderBy", orderBy)
  43419. return c
  43420. }
  43421. // PageToken sets the optional parameter "pageToken": Specifies a page
  43422. // token to use. Set pageToken to the nextPageToken returned by a
  43423. // previous list request to get the next page of results.
  43424. func (c *HttpsHealthChecksListCall) PageToken(pageToken string) *HttpsHealthChecksListCall {
  43425. c.urlParams_.Set("pageToken", pageToken)
  43426. return c
  43427. }
  43428. // Fields allows partial responses to be retrieved. See
  43429. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  43430. // for more information.
  43431. func (c *HttpsHealthChecksListCall) Fields(s ...googleapi.Field) *HttpsHealthChecksListCall {
  43432. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  43433. return c
  43434. }
  43435. // IfNoneMatch sets the optional parameter which makes the operation
  43436. // fail if the object's ETag matches the given value. This is useful for
  43437. // getting updates only after the object has changed since the last
  43438. // request. Use googleapi.IsNotModified to check whether the response
  43439. // error from Do is the result of In-None-Match.
  43440. func (c *HttpsHealthChecksListCall) IfNoneMatch(entityTag string) *HttpsHealthChecksListCall {
  43441. c.ifNoneMatch_ = entityTag
  43442. return c
  43443. }
  43444. // Context sets the context to be used in this call's Do method. Any
  43445. // pending HTTP request will be aborted if the provided context is
  43446. // canceled.
  43447. func (c *HttpsHealthChecksListCall) Context(ctx context.Context) *HttpsHealthChecksListCall {
  43448. c.ctx_ = ctx
  43449. return c
  43450. }
  43451. // Header returns an http.Header that can be modified by the caller to
  43452. // add HTTP headers to the request.
  43453. func (c *HttpsHealthChecksListCall) Header() http.Header {
  43454. if c.header_ == nil {
  43455. c.header_ = make(http.Header)
  43456. }
  43457. return c.header_
  43458. }
  43459. func (c *HttpsHealthChecksListCall) doRequest(alt string) (*http.Response, error) {
  43460. reqHeaders := make(http.Header)
  43461. for k, v := range c.header_ {
  43462. reqHeaders[k] = v
  43463. }
  43464. reqHeaders.Set("User-Agent", c.s.userAgent())
  43465. if c.ifNoneMatch_ != "" {
  43466. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  43467. }
  43468. var body io.Reader = nil
  43469. c.urlParams_.Set("alt", alt)
  43470. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/httpsHealthChecks")
  43471. urls += "?" + c.urlParams_.Encode()
  43472. req, _ := http.NewRequest("GET", urls, body)
  43473. req.Header = reqHeaders
  43474. googleapi.Expand(req.URL, map[string]string{
  43475. "project": c.project,
  43476. })
  43477. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  43478. }
  43479. // Do executes the "compute.httpsHealthChecks.list" call.
  43480. // Exactly one of *HttpsHealthCheckList or error will be non-nil. Any
  43481. // non-2xx status code is an error. Response headers are in either
  43482. // *HttpsHealthCheckList.ServerResponse.Header or (if a response was
  43483. // returned at all) in error.(*googleapi.Error).Header. Use
  43484. // googleapi.IsNotModified to check whether the returned error was
  43485. // because http.StatusNotModified was returned.
  43486. func (c *HttpsHealthChecksListCall) Do(opts ...googleapi.CallOption) (*HttpsHealthCheckList, error) {
  43487. gensupport.SetOptions(c.urlParams_, opts...)
  43488. res, err := c.doRequest("json")
  43489. if res != nil && res.StatusCode == http.StatusNotModified {
  43490. if res.Body != nil {
  43491. res.Body.Close()
  43492. }
  43493. return nil, &googleapi.Error{
  43494. Code: res.StatusCode,
  43495. Header: res.Header,
  43496. }
  43497. }
  43498. if err != nil {
  43499. return nil, err
  43500. }
  43501. defer googleapi.CloseBody(res)
  43502. if err := googleapi.CheckResponse(res); err != nil {
  43503. return nil, err
  43504. }
  43505. ret := &HttpsHealthCheckList{
  43506. ServerResponse: googleapi.ServerResponse{
  43507. Header: res.Header,
  43508. HTTPStatusCode: res.StatusCode,
  43509. },
  43510. }
  43511. target := &ret
  43512. if err := gensupport.DecodeResponse(target, res); err != nil {
  43513. return nil, err
  43514. }
  43515. return ret, nil
  43516. // {
  43517. // "description": "Retrieves the list of HttpsHealthCheck resources available to the specified project.",
  43518. // "httpMethod": "GET",
  43519. // "id": "compute.httpsHealthChecks.list",
  43520. // "parameterOrder": [
  43521. // "project"
  43522. // ],
  43523. // "parameters": {
  43524. // "filter": {
  43525. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  43526. // "location": "query",
  43527. // "type": "string"
  43528. // },
  43529. // "maxResults": {
  43530. // "default": "500",
  43531. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  43532. // "format": "uint32",
  43533. // "location": "query",
  43534. // "minimum": "0",
  43535. // "type": "integer"
  43536. // },
  43537. // "orderBy": {
  43538. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  43539. // "location": "query",
  43540. // "type": "string"
  43541. // },
  43542. // "pageToken": {
  43543. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  43544. // "location": "query",
  43545. // "type": "string"
  43546. // },
  43547. // "project": {
  43548. // "description": "Project ID for this request.",
  43549. // "location": "path",
  43550. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  43551. // "required": true,
  43552. // "type": "string"
  43553. // }
  43554. // },
  43555. // "path": "{project}/global/httpsHealthChecks",
  43556. // "response": {
  43557. // "$ref": "HttpsHealthCheckList"
  43558. // },
  43559. // "scopes": [
  43560. // "https://www.googleapis.com/auth/cloud-platform",
  43561. // "https://www.googleapis.com/auth/compute",
  43562. // "https://www.googleapis.com/auth/compute.readonly"
  43563. // ]
  43564. // }
  43565. }
  43566. // Pages invokes f for each page of results.
  43567. // A non-nil error returned from f will halt the iteration.
  43568. // The provided context supersedes any context provided to the Context method.
  43569. func (c *HttpsHealthChecksListCall) Pages(ctx context.Context, f func(*HttpsHealthCheckList) error) error {
  43570. c.ctx_ = ctx
  43571. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  43572. for {
  43573. x, err := c.Do()
  43574. if err != nil {
  43575. return err
  43576. }
  43577. if err := f(x); err != nil {
  43578. return err
  43579. }
  43580. if x.NextPageToken == "" {
  43581. return nil
  43582. }
  43583. c.PageToken(x.NextPageToken)
  43584. }
  43585. }
  43586. // method id "compute.httpsHealthChecks.patch":
  43587. type HttpsHealthChecksPatchCall struct {
  43588. s *Service
  43589. project string
  43590. httpsHealthCheck string
  43591. httpshealthcheck *HttpsHealthCheck
  43592. urlParams_ gensupport.URLParams
  43593. ctx_ context.Context
  43594. header_ http.Header
  43595. }
  43596. // Patch: Updates a HttpsHealthCheck resource in the specified project
  43597. // using the data included in the request. This method supports PATCH
  43598. // semantics and uses the JSON merge patch format and processing rules.
  43599. func (r *HttpsHealthChecksService) Patch(project string, httpsHealthCheck string, httpshealthcheck *HttpsHealthCheck) *HttpsHealthChecksPatchCall {
  43600. c := &HttpsHealthChecksPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  43601. c.project = project
  43602. c.httpsHealthCheck = httpsHealthCheck
  43603. c.httpshealthcheck = httpshealthcheck
  43604. return c
  43605. }
  43606. // RequestId sets the optional parameter "requestId": An optional
  43607. // request ID to identify requests. Specify a unique request ID so that
  43608. // if you must retry your request, the server will know to ignore the
  43609. // request if it has already been completed.
  43610. //
  43611. // For example, consider a situation where you make an initial request
  43612. // and the request times out. If you make the request again with the
  43613. // same request ID, the server can check if original operation with the
  43614. // same request ID was received, and if so, will ignore the second
  43615. // request. This prevents clients from accidentally creating duplicate
  43616. // commitments.
  43617. //
  43618. // The request ID must be a valid UUID with the exception that zero UUID
  43619. // is not supported (00000000-0000-0000-0000-000000000000).
  43620. func (c *HttpsHealthChecksPatchCall) RequestId(requestId string) *HttpsHealthChecksPatchCall {
  43621. c.urlParams_.Set("requestId", requestId)
  43622. return c
  43623. }
  43624. // Fields allows partial responses to be retrieved. See
  43625. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  43626. // for more information.
  43627. func (c *HttpsHealthChecksPatchCall) Fields(s ...googleapi.Field) *HttpsHealthChecksPatchCall {
  43628. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  43629. return c
  43630. }
  43631. // Context sets the context to be used in this call's Do method. Any
  43632. // pending HTTP request will be aborted if the provided context is
  43633. // canceled.
  43634. func (c *HttpsHealthChecksPatchCall) Context(ctx context.Context) *HttpsHealthChecksPatchCall {
  43635. c.ctx_ = ctx
  43636. return c
  43637. }
  43638. // Header returns an http.Header that can be modified by the caller to
  43639. // add HTTP headers to the request.
  43640. func (c *HttpsHealthChecksPatchCall) Header() http.Header {
  43641. if c.header_ == nil {
  43642. c.header_ = make(http.Header)
  43643. }
  43644. return c.header_
  43645. }
  43646. func (c *HttpsHealthChecksPatchCall) doRequest(alt string) (*http.Response, error) {
  43647. reqHeaders := make(http.Header)
  43648. for k, v := range c.header_ {
  43649. reqHeaders[k] = v
  43650. }
  43651. reqHeaders.Set("User-Agent", c.s.userAgent())
  43652. var body io.Reader = nil
  43653. body, err := googleapi.WithoutDataWrapper.JSONReader(c.httpshealthcheck)
  43654. if err != nil {
  43655. return nil, err
  43656. }
  43657. reqHeaders.Set("Content-Type", "application/json")
  43658. c.urlParams_.Set("alt", alt)
  43659. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/httpsHealthChecks/{httpsHealthCheck}")
  43660. urls += "?" + c.urlParams_.Encode()
  43661. req, _ := http.NewRequest("PATCH", urls, body)
  43662. req.Header = reqHeaders
  43663. googleapi.Expand(req.URL, map[string]string{
  43664. "project": c.project,
  43665. "httpsHealthCheck": c.httpsHealthCheck,
  43666. })
  43667. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  43668. }
  43669. // Do executes the "compute.httpsHealthChecks.patch" call.
  43670. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  43671. // status code is an error. Response headers are in either
  43672. // *Operation.ServerResponse.Header or (if a response was returned at
  43673. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  43674. // to check whether the returned error was because
  43675. // http.StatusNotModified was returned.
  43676. func (c *HttpsHealthChecksPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  43677. gensupport.SetOptions(c.urlParams_, opts...)
  43678. res, err := c.doRequest("json")
  43679. if res != nil && res.StatusCode == http.StatusNotModified {
  43680. if res.Body != nil {
  43681. res.Body.Close()
  43682. }
  43683. return nil, &googleapi.Error{
  43684. Code: res.StatusCode,
  43685. Header: res.Header,
  43686. }
  43687. }
  43688. if err != nil {
  43689. return nil, err
  43690. }
  43691. defer googleapi.CloseBody(res)
  43692. if err := googleapi.CheckResponse(res); err != nil {
  43693. return nil, err
  43694. }
  43695. ret := &Operation{
  43696. ServerResponse: googleapi.ServerResponse{
  43697. Header: res.Header,
  43698. HTTPStatusCode: res.StatusCode,
  43699. },
  43700. }
  43701. target := &ret
  43702. if err := gensupport.DecodeResponse(target, res); err != nil {
  43703. return nil, err
  43704. }
  43705. return ret, nil
  43706. // {
  43707. // "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.",
  43708. // "httpMethod": "PATCH",
  43709. // "id": "compute.httpsHealthChecks.patch",
  43710. // "parameterOrder": [
  43711. // "project",
  43712. // "httpsHealthCheck"
  43713. // ],
  43714. // "parameters": {
  43715. // "httpsHealthCheck": {
  43716. // "description": "Name of the HttpsHealthCheck resource to patch.",
  43717. // "location": "path",
  43718. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  43719. // "required": true,
  43720. // "type": "string"
  43721. // },
  43722. // "project": {
  43723. // "description": "Project ID for this request.",
  43724. // "location": "path",
  43725. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  43726. // "required": true,
  43727. // "type": "string"
  43728. // },
  43729. // "requestId": {
  43730. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  43731. // "location": "query",
  43732. // "type": "string"
  43733. // }
  43734. // },
  43735. // "path": "{project}/global/httpsHealthChecks/{httpsHealthCheck}",
  43736. // "request": {
  43737. // "$ref": "HttpsHealthCheck"
  43738. // },
  43739. // "response": {
  43740. // "$ref": "Operation"
  43741. // },
  43742. // "scopes": [
  43743. // "https://www.googleapis.com/auth/cloud-platform",
  43744. // "https://www.googleapis.com/auth/compute"
  43745. // ]
  43746. // }
  43747. }
  43748. // method id "compute.httpsHealthChecks.testIamPermissions":
  43749. type HttpsHealthChecksTestIamPermissionsCall struct {
  43750. s *Service
  43751. project string
  43752. resource string
  43753. testpermissionsrequest *TestPermissionsRequest
  43754. urlParams_ gensupport.URLParams
  43755. ctx_ context.Context
  43756. header_ http.Header
  43757. }
  43758. // TestIamPermissions: Returns permissions that a caller has on the
  43759. // specified resource.
  43760. func (r *HttpsHealthChecksService) TestIamPermissions(project string, resource string, testpermissionsrequest *TestPermissionsRequest) *HttpsHealthChecksTestIamPermissionsCall {
  43761. c := &HttpsHealthChecksTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  43762. c.project = project
  43763. c.resource = resource
  43764. c.testpermissionsrequest = testpermissionsrequest
  43765. return c
  43766. }
  43767. // Fields allows partial responses to be retrieved. See
  43768. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  43769. // for more information.
  43770. func (c *HttpsHealthChecksTestIamPermissionsCall) Fields(s ...googleapi.Field) *HttpsHealthChecksTestIamPermissionsCall {
  43771. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  43772. return c
  43773. }
  43774. // Context sets the context to be used in this call's Do method. Any
  43775. // pending HTTP request will be aborted if the provided context is
  43776. // canceled.
  43777. func (c *HttpsHealthChecksTestIamPermissionsCall) Context(ctx context.Context) *HttpsHealthChecksTestIamPermissionsCall {
  43778. c.ctx_ = ctx
  43779. return c
  43780. }
  43781. // Header returns an http.Header that can be modified by the caller to
  43782. // add HTTP headers to the request.
  43783. func (c *HttpsHealthChecksTestIamPermissionsCall) Header() http.Header {
  43784. if c.header_ == nil {
  43785. c.header_ = make(http.Header)
  43786. }
  43787. return c.header_
  43788. }
  43789. func (c *HttpsHealthChecksTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  43790. reqHeaders := make(http.Header)
  43791. for k, v := range c.header_ {
  43792. reqHeaders[k] = v
  43793. }
  43794. reqHeaders.Set("User-Agent", c.s.userAgent())
  43795. var body io.Reader = nil
  43796. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  43797. if err != nil {
  43798. return nil, err
  43799. }
  43800. reqHeaders.Set("Content-Type", "application/json")
  43801. c.urlParams_.Set("alt", alt)
  43802. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/httpsHealthChecks/{resource}/testIamPermissions")
  43803. urls += "?" + c.urlParams_.Encode()
  43804. req, _ := http.NewRequest("POST", urls, body)
  43805. req.Header = reqHeaders
  43806. googleapi.Expand(req.URL, map[string]string{
  43807. "project": c.project,
  43808. "resource": c.resource,
  43809. })
  43810. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  43811. }
  43812. // Do executes the "compute.httpsHealthChecks.testIamPermissions" call.
  43813. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  43814. // non-2xx status code is an error. Response headers are in either
  43815. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  43816. // returned at all) in error.(*googleapi.Error).Header. Use
  43817. // googleapi.IsNotModified to check whether the returned error was
  43818. // because http.StatusNotModified was returned.
  43819. func (c *HttpsHealthChecksTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  43820. gensupport.SetOptions(c.urlParams_, opts...)
  43821. res, err := c.doRequest("json")
  43822. if res != nil && res.StatusCode == http.StatusNotModified {
  43823. if res.Body != nil {
  43824. res.Body.Close()
  43825. }
  43826. return nil, &googleapi.Error{
  43827. Code: res.StatusCode,
  43828. Header: res.Header,
  43829. }
  43830. }
  43831. if err != nil {
  43832. return nil, err
  43833. }
  43834. defer googleapi.CloseBody(res)
  43835. if err := googleapi.CheckResponse(res); err != nil {
  43836. return nil, err
  43837. }
  43838. ret := &TestPermissionsResponse{
  43839. ServerResponse: googleapi.ServerResponse{
  43840. Header: res.Header,
  43841. HTTPStatusCode: res.StatusCode,
  43842. },
  43843. }
  43844. target := &ret
  43845. if err := gensupport.DecodeResponse(target, res); err != nil {
  43846. return nil, err
  43847. }
  43848. return ret, nil
  43849. // {
  43850. // "description": "Returns permissions that a caller has on the specified resource.",
  43851. // "httpMethod": "POST",
  43852. // "id": "compute.httpsHealthChecks.testIamPermissions",
  43853. // "parameterOrder": [
  43854. // "project",
  43855. // "resource"
  43856. // ],
  43857. // "parameters": {
  43858. // "project": {
  43859. // "description": "Project ID for this request.",
  43860. // "location": "path",
  43861. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  43862. // "required": true,
  43863. // "type": "string"
  43864. // },
  43865. // "resource": {
  43866. // "description": "Name of the resource for this request.",
  43867. // "location": "path",
  43868. // "pattern": "(?:[-a-z0-9_]{0,62}[a-z0-9])?",
  43869. // "required": true,
  43870. // "type": "string"
  43871. // }
  43872. // },
  43873. // "path": "{project}/global/httpsHealthChecks/{resource}/testIamPermissions",
  43874. // "request": {
  43875. // "$ref": "TestPermissionsRequest"
  43876. // },
  43877. // "response": {
  43878. // "$ref": "TestPermissionsResponse"
  43879. // },
  43880. // "scopes": [
  43881. // "https://www.googleapis.com/auth/cloud-platform",
  43882. // "https://www.googleapis.com/auth/compute",
  43883. // "https://www.googleapis.com/auth/compute.readonly"
  43884. // ]
  43885. // }
  43886. }
  43887. // method id "compute.httpsHealthChecks.update":
  43888. type HttpsHealthChecksUpdateCall struct {
  43889. s *Service
  43890. project string
  43891. httpsHealthCheck string
  43892. httpshealthcheck *HttpsHealthCheck
  43893. urlParams_ gensupport.URLParams
  43894. ctx_ context.Context
  43895. header_ http.Header
  43896. }
  43897. // Update: Updates a HttpsHealthCheck resource in the specified project
  43898. // using the data included in the request.
  43899. func (r *HttpsHealthChecksService) Update(project string, httpsHealthCheck string, httpshealthcheck *HttpsHealthCheck) *HttpsHealthChecksUpdateCall {
  43900. c := &HttpsHealthChecksUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  43901. c.project = project
  43902. c.httpsHealthCheck = httpsHealthCheck
  43903. c.httpshealthcheck = httpshealthcheck
  43904. return c
  43905. }
  43906. // RequestId sets the optional parameter "requestId": An optional
  43907. // request ID to identify requests. Specify a unique request ID so that
  43908. // if you must retry your request, the server will know to ignore the
  43909. // request if it has already been completed.
  43910. //
  43911. // For example, consider a situation where you make an initial request
  43912. // and the request times out. If you make the request again with the
  43913. // same request ID, the server can check if original operation with the
  43914. // same request ID was received, and if so, will ignore the second
  43915. // request. This prevents clients from accidentally creating duplicate
  43916. // commitments.
  43917. //
  43918. // The request ID must be a valid UUID with the exception that zero UUID
  43919. // is not supported (00000000-0000-0000-0000-000000000000).
  43920. func (c *HttpsHealthChecksUpdateCall) RequestId(requestId string) *HttpsHealthChecksUpdateCall {
  43921. c.urlParams_.Set("requestId", requestId)
  43922. return c
  43923. }
  43924. // Fields allows partial responses to be retrieved. See
  43925. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  43926. // for more information.
  43927. func (c *HttpsHealthChecksUpdateCall) Fields(s ...googleapi.Field) *HttpsHealthChecksUpdateCall {
  43928. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  43929. return c
  43930. }
  43931. // Context sets the context to be used in this call's Do method. Any
  43932. // pending HTTP request will be aborted if the provided context is
  43933. // canceled.
  43934. func (c *HttpsHealthChecksUpdateCall) Context(ctx context.Context) *HttpsHealthChecksUpdateCall {
  43935. c.ctx_ = ctx
  43936. return c
  43937. }
  43938. // Header returns an http.Header that can be modified by the caller to
  43939. // add HTTP headers to the request.
  43940. func (c *HttpsHealthChecksUpdateCall) Header() http.Header {
  43941. if c.header_ == nil {
  43942. c.header_ = make(http.Header)
  43943. }
  43944. return c.header_
  43945. }
  43946. func (c *HttpsHealthChecksUpdateCall) doRequest(alt string) (*http.Response, error) {
  43947. reqHeaders := make(http.Header)
  43948. for k, v := range c.header_ {
  43949. reqHeaders[k] = v
  43950. }
  43951. reqHeaders.Set("User-Agent", c.s.userAgent())
  43952. var body io.Reader = nil
  43953. body, err := googleapi.WithoutDataWrapper.JSONReader(c.httpshealthcheck)
  43954. if err != nil {
  43955. return nil, err
  43956. }
  43957. reqHeaders.Set("Content-Type", "application/json")
  43958. c.urlParams_.Set("alt", alt)
  43959. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/httpsHealthChecks/{httpsHealthCheck}")
  43960. urls += "?" + c.urlParams_.Encode()
  43961. req, _ := http.NewRequest("PUT", urls, body)
  43962. req.Header = reqHeaders
  43963. googleapi.Expand(req.URL, map[string]string{
  43964. "project": c.project,
  43965. "httpsHealthCheck": c.httpsHealthCheck,
  43966. })
  43967. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  43968. }
  43969. // Do executes the "compute.httpsHealthChecks.update" call.
  43970. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  43971. // status code is an error. Response headers are in either
  43972. // *Operation.ServerResponse.Header or (if a response was returned at
  43973. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  43974. // to check whether the returned error was because
  43975. // http.StatusNotModified was returned.
  43976. func (c *HttpsHealthChecksUpdateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  43977. gensupport.SetOptions(c.urlParams_, opts...)
  43978. res, err := c.doRequest("json")
  43979. if res != nil && res.StatusCode == http.StatusNotModified {
  43980. if res.Body != nil {
  43981. res.Body.Close()
  43982. }
  43983. return nil, &googleapi.Error{
  43984. Code: res.StatusCode,
  43985. Header: res.Header,
  43986. }
  43987. }
  43988. if err != nil {
  43989. return nil, err
  43990. }
  43991. defer googleapi.CloseBody(res)
  43992. if err := googleapi.CheckResponse(res); err != nil {
  43993. return nil, err
  43994. }
  43995. ret := &Operation{
  43996. ServerResponse: googleapi.ServerResponse{
  43997. Header: res.Header,
  43998. HTTPStatusCode: res.StatusCode,
  43999. },
  44000. }
  44001. target := &ret
  44002. if err := gensupport.DecodeResponse(target, res); err != nil {
  44003. return nil, err
  44004. }
  44005. return ret, nil
  44006. // {
  44007. // "description": "Updates a HttpsHealthCheck resource in the specified project using the data included in the request.",
  44008. // "httpMethod": "PUT",
  44009. // "id": "compute.httpsHealthChecks.update",
  44010. // "parameterOrder": [
  44011. // "project",
  44012. // "httpsHealthCheck"
  44013. // ],
  44014. // "parameters": {
  44015. // "httpsHealthCheck": {
  44016. // "description": "Name of the HttpsHealthCheck resource to update.",
  44017. // "location": "path",
  44018. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  44019. // "required": true,
  44020. // "type": "string"
  44021. // },
  44022. // "project": {
  44023. // "description": "Project ID for this request.",
  44024. // "location": "path",
  44025. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  44026. // "required": true,
  44027. // "type": "string"
  44028. // },
  44029. // "requestId": {
  44030. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  44031. // "location": "query",
  44032. // "type": "string"
  44033. // }
  44034. // },
  44035. // "path": "{project}/global/httpsHealthChecks/{httpsHealthCheck}",
  44036. // "request": {
  44037. // "$ref": "HttpsHealthCheck"
  44038. // },
  44039. // "response": {
  44040. // "$ref": "Operation"
  44041. // },
  44042. // "scopes": [
  44043. // "https://www.googleapis.com/auth/cloud-platform",
  44044. // "https://www.googleapis.com/auth/compute"
  44045. // ]
  44046. // }
  44047. }
  44048. // method id "compute.images.delete":
  44049. type ImagesDeleteCall struct {
  44050. s *Service
  44051. project string
  44052. image string
  44053. urlParams_ gensupport.URLParams
  44054. ctx_ context.Context
  44055. header_ http.Header
  44056. }
  44057. // Delete: Deletes the specified image.
  44058. // For details, see https://cloud.google.com/compute/docs/reference/latest/images/delete
  44059. func (r *ImagesService) Delete(project string, image string) *ImagesDeleteCall {
  44060. c := &ImagesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  44061. c.project = project
  44062. c.image = image
  44063. return c
  44064. }
  44065. // RequestId sets the optional parameter "requestId": An optional
  44066. // request ID to identify requests. Specify a unique request ID so that
  44067. // if you must retry your request, the server will know to ignore the
  44068. // request if it has already been completed.
  44069. //
  44070. // For example, consider a situation where you make an initial request
  44071. // and the request times out. If you make the request again with the
  44072. // same request ID, the server can check if original operation with the
  44073. // same request ID was received, and if so, will ignore the second
  44074. // request. This prevents clients from accidentally creating duplicate
  44075. // commitments.
  44076. //
  44077. // The request ID must be a valid UUID with the exception that zero UUID
  44078. // is not supported (00000000-0000-0000-0000-000000000000).
  44079. func (c *ImagesDeleteCall) RequestId(requestId string) *ImagesDeleteCall {
  44080. c.urlParams_.Set("requestId", requestId)
  44081. return c
  44082. }
  44083. // Fields allows partial responses to be retrieved. See
  44084. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  44085. // for more information.
  44086. func (c *ImagesDeleteCall) Fields(s ...googleapi.Field) *ImagesDeleteCall {
  44087. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  44088. return c
  44089. }
  44090. // Context sets the context to be used in this call's Do method. Any
  44091. // pending HTTP request will be aborted if the provided context is
  44092. // canceled.
  44093. func (c *ImagesDeleteCall) Context(ctx context.Context) *ImagesDeleteCall {
  44094. c.ctx_ = ctx
  44095. return c
  44096. }
  44097. // Header returns an http.Header that can be modified by the caller to
  44098. // add HTTP headers to the request.
  44099. func (c *ImagesDeleteCall) Header() http.Header {
  44100. if c.header_ == nil {
  44101. c.header_ = make(http.Header)
  44102. }
  44103. return c.header_
  44104. }
  44105. func (c *ImagesDeleteCall) doRequest(alt string) (*http.Response, error) {
  44106. reqHeaders := make(http.Header)
  44107. for k, v := range c.header_ {
  44108. reqHeaders[k] = v
  44109. }
  44110. reqHeaders.Set("User-Agent", c.s.userAgent())
  44111. var body io.Reader = nil
  44112. c.urlParams_.Set("alt", alt)
  44113. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/images/{image}")
  44114. urls += "?" + c.urlParams_.Encode()
  44115. req, _ := http.NewRequest("DELETE", urls, body)
  44116. req.Header = reqHeaders
  44117. googleapi.Expand(req.URL, map[string]string{
  44118. "project": c.project,
  44119. "image": c.image,
  44120. })
  44121. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  44122. }
  44123. // Do executes the "compute.images.delete" call.
  44124. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  44125. // status code is an error. Response headers are in either
  44126. // *Operation.ServerResponse.Header or (if a response was returned at
  44127. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  44128. // to check whether the returned error was because
  44129. // http.StatusNotModified was returned.
  44130. func (c *ImagesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  44131. gensupport.SetOptions(c.urlParams_, opts...)
  44132. res, err := c.doRequest("json")
  44133. if res != nil && res.StatusCode == http.StatusNotModified {
  44134. if res.Body != nil {
  44135. res.Body.Close()
  44136. }
  44137. return nil, &googleapi.Error{
  44138. Code: res.StatusCode,
  44139. Header: res.Header,
  44140. }
  44141. }
  44142. if err != nil {
  44143. return nil, err
  44144. }
  44145. defer googleapi.CloseBody(res)
  44146. if err := googleapi.CheckResponse(res); err != nil {
  44147. return nil, err
  44148. }
  44149. ret := &Operation{
  44150. ServerResponse: googleapi.ServerResponse{
  44151. Header: res.Header,
  44152. HTTPStatusCode: res.StatusCode,
  44153. },
  44154. }
  44155. target := &ret
  44156. if err := gensupport.DecodeResponse(target, res); err != nil {
  44157. return nil, err
  44158. }
  44159. return ret, nil
  44160. // {
  44161. // "description": "Deletes the specified image.",
  44162. // "httpMethod": "DELETE",
  44163. // "id": "compute.images.delete",
  44164. // "parameterOrder": [
  44165. // "project",
  44166. // "image"
  44167. // ],
  44168. // "parameters": {
  44169. // "image": {
  44170. // "description": "Name of the image resource to delete.",
  44171. // "location": "path",
  44172. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  44173. // "required": true,
  44174. // "type": "string"
  44175. // },
  44176. // "project": {
  44177. // "description": "Project ID for this request.",
  44178. // "location": "path",
  44179. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  44180. // "required": true,
  44181. // "type": "string"
  44182. // },
  44183. // "requestId": {
  44184. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  44185. // "location": "query",
  44186. // "type": "string"
  44187. // }
  44188. // },
  44189. // "path": "{project}/global/images/{image}",
  44190. // "response": {
  44191. // "$ref": "Operation"
  44192. // },
  44193. // "scopes": [
  44194. // "https://www.googleapis.com/auth/cloud-platform",
  44195. // "https://www.googleapis.com/auth/compute"
  44196. // ]
  44197. // }
  44198. }
  44199. // method id "compute.images.deprecate":
  44200. type ImagesDeprecateCall struct {
  44201. s *Service
  44202. project string
  44203. image string
  44204. deprecationstatus *DeprecationStatus
  44205. urlParams_ gensupport.URLParams
  44206. ctx_ context.Context
  44207. header_ http.Header
  44208. }
  44209. // Deprecate: Sets the deprecation status of an image.
  44210. //
  44211. // If an empty request body is given, clears the deprecation status
  44212. // instead.
  44213. // For details, see https://cloud.google.com/compute/docs/reference/latest/images/deprecate
  44214. func (r *ImagesService) Deprecate(project string, image string, deprecationstatus *DeprecationStatus) *ImagesDeprecateCall {
  44215. c := &ImagesDeprecateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  44216. c.project = project
  44217. c.image = image
  44218. c.deprecationstatus = deprecationstatus
  44219. return c
  44220. }
  44221. // RequestId sets the optional parameter "requestId": An optional
  44222. // request ID to identify requests. Specify a unique request ID so that
  44223. // if you must retry your request, the server will know to ignore the
  44224. // request if it has already been completed.
  44225. //
  44226. // For example, consider a situation where you make an initial request
  44227. // and the request times out. If you make the request again with the
  44228. // same request ID, the server can check if original operation with the
  44229. // same request ID was received, and if so, will ignore the second
  44230. // request. This prevents clients from accidentally creating duplicate
  44231. // commitments.
  44232. //
  44233. // The request ID must be a valid UUID with the exception that zero UUID
  44234. // is not supported (00000000-0000-0000-0000-000000000000).
  44235. func (c *ImagesDeprecateCall) RequestId(requestId string) *ImagesDeprecateCall {
  44236. c.urlParams_.Set("requestId", requestId)
  44237. return c
  44238. }
  44239. // Fields allows partial responses to be retrieved. See
  44240. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  44241. // for more information.
  44242. func (c *ImagesDeprecateCall) Fields(s ...googleapi.Field) *ImagesDeprecateCall {
  44243. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  44244. return c
  44245. }
  44246. // Context sets the context to be used in this call's Do method. Any
  44247. // pending HTTP request will be aborted if the provided context is
  44248. // canceled.
  44249. func (c *ImagesDeprecateCall) Context(ctx context.Context) *ImagesDeprecateCall {
  44250. c.ctx_ = ctx
  44251. return c
  44252. }
  44253. // Header returns an http.Header that can be modified by the caller to
  44254. // add HTTP headers to the request.
  44255. func (c *ImagesDeprecateCall) Header() http.Header {
  44256. if c.header_ == nil {
  44257. c.header_ = make(http.Header)
  44258. }
  44259. return c.header_
  44260. }
  44261. func (c *ImagesDeprecateCall) doRequest(alt string) (*http.Response, error) {
  44262. reqHeaders := make(http.Header)
  44263. for k, v := range c.header_ {
  44264. reqHeaders[k] = v
  44265. }
  44266. reqHeaders.Set("User-Agent", c.s.userAgent())
  44267. var body io.Reader = nil
  44268. body, err := googleapi.WithoutDataWrapper.JSONReader(c.deprecationstatus)
  44269. if err != nil {
  44270. return nil, err
  44271. }
  44272. reqHeaders.Set("Content-Type", "application/json")
  44273. c.urlParams_.Set("alt", alt)
  44274. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/images/{image}/deprecate")
  44275. urls += "?" + c.urlParams_.Encode()
  44276. req, _ := http.NewRequest("POST", urls, body)
  44277. req.Header = reqHeaders
  44278. googleapi.Expand(req.URL, map[string]string{
  44279. "project": c.project,
  44280. "image": c.image,
  44281. })
  44282. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  44283. }
  44284. // Do executes the "compute.images.deprecate" call.
  44285. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  44286. // status code is an error. Response headers are in either
  44287. // *Operation.ServerResponse.Header or (if a response was returned at
  44288. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  44289. // to check whether the returned error was because
  44290. // http.StatusNotModified was returned.
  44291. func (c *ImagesDeprecateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  44292. gensupport.SetOptions(c.urlParams_, opts...)
  44293. res, err := c.doRequest("json")
  44294. if res != nil && res.StatusCode == http.StatusNotModified {
  44295. if res.Body != nil {
  44296. res.Body.Close()
  44297. }
  44298. return nil, &googleapi.Error{
  44299. Code: res.StatusCode,
  44300. Header: res.Header,
  44301. }
  44302. }
  44303. if err != nil {
  44304. return nil, err
  44305. }
  44306. defer googleapi.CloseBody(res)
  44307. if err := googleapi.CheckResponse(res); err != nil {
  44308. return nil, err
  44309. }
  44310. ret := &Operation{
  44311. ServerResponse: googleapi.ServerResponse{
  44312. Header: res.Header,
  44313. HTTPStatusCode: res.StatusCode,
  44314. },
  44315. }
  44316. target := &ret
  44317. if err := gensupport.DecodeResponse(target, res); err != nil {
  44318. return nil, err
  44319. }
  44320. return ret, nil
  44321. // {
  44322. // "description": "Sets the deprecation status of an image.\n\nIf an empty request body is given, clears the deprecation status instead.",
  44323. // "httpMethod": "POST",
  44324. // "id": "compute.images.deprecate",
  44325. // "parameterOrder": [
  44326. // "project",
  44327. // "image"
  44328. // ],
  44329. // "parameters": {
  44330. // "image": {
  44331. // "description": "Image name.",
  44332. // "location": "path",
  44333. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  44334. // "required": true,
  44335. // "type": "string"
  44336. // },
  44337. // "project": {
  44338. // "description": "Project ID for this request.",
  44339. // "location": "path",
  44340. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  44341. // "required": true,
  44342. // "type": "string"
  44343. // },
  44344. // "requestId": {
  44345. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  44346. // "location": "query",
  44347. // "type": "string"
  44348. // }
  44349. // },
  44350. // "path": "{project}/global/images/{image}/deprecate",
  44351. // "request": {
  44352. // "$ref": "DeprecationStatus"
  44353. // },
  44354. // "response": {
  44355. // "$ref": "Operation"
  44356. // },
  44357. // "scopes": [
  44358. // "https://www.googleapis.com/auth/cloud-platform",
  44359. // "https://www.googleapis.com/auth/compute"
  44360. // ]
  44361. // }
  44362. }
  44363. // method id "compute.images.get":
  44364. type ImagesGetCall struct {
  44365. s *Service
  44366. project string
  44367. image string
  44368. urlParams_ gensupport.URLParams
  44369. ifNoneMatch_ string
  44370. ctx_ context.Context
  44371. header_ http.Header
  44372. }
  44373. // Get: Returns the specified image. Gets a list of available images by
  44374. // making a list() request.
  44375. // For details, see https://cloud.google.com/compute/docs/reference/latest/images/get
  44376. func (r *ImagesService) Get(project string, image string) *ImagesGetCall {
  44377. c := &ImagesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  44378. c.project = project
  44379. c.image = image
  44380. return c
  44381. }
  44382. // Fields allows partial responses to be retrieved. See
  44383. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  44384. // for more information.
  44385. func (c *ImagesGetCall) Fields(s ...googleapi.Field) *ImagesGetCall {
  44386. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  44387. return c
  44388. }
  44389. // IfNoneMatch sets the optional parameter which makes the operation
  44390. // fail if the object's ETag matches the given value. This is useful for
  44391. // getting updates only after the object has changed since the last
  44392. // request. Use googleapi.IsNotModified to check whether the response
  44393. // error from Do is the result of In-None-Match.
  44394. func (c *ImagesGetCall) IfNoneMatch(entityTag string) *ImagesGetCall {
  44395. c.ifNoneMatch_ = entityTag
  44396. return c
  44397. }
  44398. // Context sets the context to be used in this call's Do method. Any
  44399. // pending HTTP request will be aborted if the provided context is
  44400. // canceled.
  44401. func (c *ImagesGetCall) Context(ctx context.Context) *ImagesGetCall {
  44402. c.ctx_ = ctx
  44403. return c
  44404. }
  44405. // Header returns an http.Header that can be modified by the caller to
  44406. // add HTTP headers to the request.
  44407. func (c *ImagesGetCall) Header() http.Header {
  44408. if c.header_ == nil {
  44409. c.header_ = make(http.Header)
  44410. }
  44411. return c.header_
  44412. }
  44413. func (c *ImagesGetCall) doRequest(alt string) (*http.Response, error) {
  44414. reqHeaders := make(http.Header)
  44415. for k, v := range c.header_ {
  44416. reqHeaders[k] = v
  44417. }
  44418. reqHeaders.Set("User-Agent", c.s.userAgent())
  44419. if c.ifNoneMatch_ != "" {
  44420. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  44421. }
  44422. var body io.Reader = nil
  44423. c.urlParams_.Set("alt", alt)
  44424. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/images/{image}")
  44425. urls += "?" + c.urlParams_.Encode()
  44426. req, _ := http.NewRequest("GET", urls, body)
  44427. req.Header = reqHeaders
  44428. googleapi.Expand(req.URL, map[string]string{
  44429. "project": c.project,
  44430. "image": c.image,
  44431. })
  44432. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  44433. }
  44434. // Do executes the "compute.images.get" call.
  44435. // Exactly one of *Image or error will be non-nil. Any non-2xx status
  44436. // code is an error. Response headers are in either
  44437. // *Image.ServerResponse.Header or (if a response was returned at all)
  44438. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  44439. // check whether the returned error was because http.StatusNotModified
  44440. // was returned.
  44441. func (c *ImagesGetCall) Do(opts ...googleapi.CallOption) (*Image, error) {
  44442. gensupport.SetOptions(c.urlParams_, opts...)
  44443. res, err := c.doRequest("json")
  44444. if res != nil && res.StatusCode == http.StatusNotModified {
  44445. if res.Body != nil {
  44446. res.Body.Close()
  44447. }
  44448. return nil, &googleapi.Error{
  44449. Code: res.StatusCode,
  44450. Header: res.Header,
  44451. }
  44452. }
  44453. if err != nil {
  44454. return nil, err
  44455. }
  44456. defer googleapi.CloseBody(res)
  44457. if err := googleapi.CheckResponse(res); err != nil {
  44458. return nil, err
  44459. }
  44460. ret := &Image{
  44461. ServerResponse: googleapi.ServerResponse{
  44462. Header: res.Header,
  44463. HTTPStatusCode: res.StatusCode,
  44464. },
  44465. }
  44466. target := &ret
  44467. if err := gensupport.DecodeResponse(target, res); err != nil {
  44468. return nil, err
  44469. }
  44470. return ret, nil
  44471. // {
  44472. // "description": "Returns the specified image. Gets a list of available images by making a list() request.",
  44473. // "httpMethod": "GET",
  44474. // "id": "compute.images.get",
  44475. // "parameterOrder": [
  44476. // "project",
  44477. // "image"
  44478. // ],
  44479. // "parameters": {
  44480. // "image": {
  44481. // "description": "Name of the image resource to return.",
  44482. // "location": "path",
  44483. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  44484. // "required": true,
  44485. // "type": "string"
  44486. // },
  44487. // "project": {
  44488. // "description": "Project ID for this request.",
  44489. // "location": "path",
  44490. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  44491. // "required": true,
  44492. // "type": "string"
  44493. // }
  44494. // },
  44495. // "path": "{project}/global/images/{image}",
  44496. // "response": {
  44497. // "$ref": "Image"
  44498. // },
  44499. // "scopes": [
  44500. // "https://www.googleapis.com/auth/cloud-platform",
  44501. // "https://www.googleapis.com/auth/compute",
  44502. // "https://www.googleapis.com/auth/compute.readonly"
  44503. // ]
  44504. // }
  44505. }
  44506. // method id "compute.images.getFromFamily":
  44507. type ImagesGetFromFamilyCall struct {
  44508. s *Service
  44509. project string
  44510. family string
  44511. urlParams_ gensupport.URLParams
  44512. ifNoneMatch_ string
  44513. ctx_ context.Context
  44514. header_ http.Header
  44515. }
  44516. // GetFromFamily: Returns the latest image that is part of an image
  44517. // family and is not deprecated.
  44518. func (r *ImagesService) GetFromFamily(project string, family string) *ImagesGetFromFamilyCall {
  44519. c := &ImagesGetFromFamilyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  44520. c.project = project
  44521. c.family = family
  44522. return c
  44523. }
  44524. // Fields allows partial responses to be retrieved. See
  44525. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  44526. // for more information.
  44527. func (c *ImagesGetFromFamilyCall) Fields(s ...googleapi.Field) *ImagesGetFromFamilyCall {
  44528. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  44529. return c
  44530. }
  44531. // IfNoneMatch sets the optional parameter which makes the operation
  44532. // fail if the object's ETag matches the given value. This is useful for
  44533. // getting updates only after the object has changed since the last
  44534. // request. Use googleapi.IsNotModified to check whether the response
  44535. // error from Do is the result of In-None-Match.
  44536. func (c *ImagesGetFromFamilyCall) IfNoneMatch(entityTag string) *ImagesGetFromFamilyCall {
  44537. c.ifNoneMatch_ = entityTag
  44538. return c
  44539. }
  44540. // Context sets the context to be used in this call's Do method. Any
  44541. // pending HTTP request will be aborted if the provided context is
  44542. // canceled.
  44543. func (c *ImagesGetFromFamilyCall) Context(ctx context.Context) *ImagesGetFromFamilyCall {
  44544. c.ctx_ = ctx
  44545. return c
  44546. }
  44547. // Header returns an http.Header that can be modified by the caller to
  44548. // add HTTP headers to the request.
  44549. func (c *ImagesGetFromFamilyCall) Header() http.Header {
  44550. if c.header_ == nil {
  44551. c.header_ = make(http.Header)
  44552. }
  44553. return c.header_
  44554. }
  44555. func (c *ImagesGetFromFamilyCall) doRequest(alt string) (*http.Response, error) {
  44556. reqHeaders := make(http.Header)
  44557. for k, v := range c.header_ {
  44558. reqHeaders[k] = v
  44559. }
  44560. reqHeaders.Set("User-Agent", c.s.userAgent())
  44561. if c.ifNoneMatch_ != "" {
  44562. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  44563. }
  44564. var body io.Reader = nil
  44565. c.urlParams_.Set("alt", alt)
  44566. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/images/family/{family}")
  44567. urls += "?" + c.urlParams_.Encode()
  44568. req, _ := http.NewRequest("GET", urls, body)
  44569. req.Header = reqHeaders
  44570. googleapi.Expand(req.URL, map[string]string{
  44571. "project": c.project,
  44572. "family": c.family,
  44573. })
  44574. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  44575. }
  44576. // Do executes the "compute.images.getFromFamily" call.
  44577. // Exactly one of *Image or error will be non-nil. Any non-2xx status
  44578. // code is an error. Response headers are in either
  44579. // *Image.ServerResponse.Header or (if a response was returned at all)
  44580. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  44581. // check whether the returned error was because http.StatusNotModified
  44582. // was returned.
  44583. func (c *ImagesGetFromFamilyCall) Do(opts ...googleapi.CallOption) (*Image, error) {
  44584. gensupport.SetOptions(c.urlParams_, opts...)
  44585. res, err := c.doRequest("json")
  44586. if res != nil && res.StatusCode == http.StatusNotModified {
  44587. if res.Body != nil {
  44588. res.Body.Close()
  44589. }
  44590. return nil, &googleapi.Error{
  44591. Code: res.StatusCode,
  44592. Header: res.Header,
  44593. }
  44594. }
  44595. if err != nil {
  44596. return nil, err
  44597. }
  44598. defer googleapi.CloseBody(res)
  44599. if err := googleapi.CheckResponse(res); err != nil {
  44600. return nil, err
  44601. }
  44602. ret := &Image{
  44603. ServerResponse: googleapi.ServerResponse{
  44604. Header: res.Header,
  44605. HTTPStatusCode: res.StatusCode,
  44606. },
  44607. }
  44608. target := &ret
  44609. if err := gensupport.DecodeResponse(target, res); err != nil {
  44610. return nil, err
  44611. }
  44612. return ret, nil
  44613. // {
  44614. // "description": "Returns the latest image that is part of an image family and is not deprecated.",
  44615. // "httpMethod": "GET",
  44616. // "id": "compute.images.getFromFamily",
  44617. // "parameterOrder": [
  44618. // "project",
  44619. // "family"
  44620. // ],
  44621. // "parameters": {
  44622. // "family": {
  44623. // "description": "Name of the image family to search for.",
  44624. // "location": "path",
  44625. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  44626. // "required": true,
  44627. // "type": "string"
  44628. // },
  44629. // "project": {
  44630. // "description": "Project ID for this request.",
  44631. // "location": "path",
  44632. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  44633. // "required": true,
  44634. // "type": "string"
  44635. // }
  44636. // },
  44637. // "path": "{project}/global/images/family/{family}",
  44638. // "response": {
  44639. // "$ref": "Image"
  44640. // },
  44641. // "scopes": [
  44642. // "https://www.googleapis.com/auth/cloud-platform",
  44643. // "https://www.googleapis.com/auth/compute",
  44644. // "https://www.googleapis.com/auth/compute.readonly"
  44645. // ]
  44646. // }
  44647. }
  44648. // method id "compute.images.insert":
  44649. type ImagesInsertCall struct {
  44650. s *Service
  44651. project string
  44652. image *Image
  44653. urlParams_ gensupport.URLParams
  44654. ctx_ context.Context
  44655. header_ http.Header
  44656. }
  44657. // Insert: Creates an image in the specified project using the data
  44658. // included in the request.
  44659. // For details, see https://cloud.google.com/compute/docs/reference/latest/images/insert
  44660. func (r *ImagesService) Insert(project string, image *Image) *ImagesInsertCall {
  44661. c := &ImagesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  44662. c.project = project
  44663. c.image = image
  44664. return c
  44665. }
  44666. // ForceCreate sets the optional parameter "forceCreate": Force image
  44667. // creation if true.
  44668. func (c *ImagesInsertCall) ForceCreate(forceCreate bool) *ImagesInsertCall {
  44669. c.urlParams_.Set("forceCreate", fmt.Sprint(forceCreate))
  44670. return c
  44671. }
  44672. // RequestId sets the optional parameter "requestId": An optional
  44673. // request ID to identify requests. Specify a unique request ID so that
  44674. // if you must retry your request, the server will know to ignore the
  44675. // request if it has already been completed.
  44676. //
  44677. // For example, consider a situation where you make an initial request
  44678. // and the request times out. If you make the request again with the
  44679. // same request ID, the server can check if original operation with the
  44680. // same request ID was received, and if so, will ignore the second
  44681. // request. This prevents clients from accidentally creating duplicate
  44682. // commitments.
  44683. //
  44684. // The request ID must be a valid UUID with the exception that zero UUID
  44685. // is not supported (00000000-0000-0000-0000-000000000000).
  44686. func (c *ImagesInsertCall) RequestId(requestId string) *ImagesInsertCall {
  44687. c.urlParams_.Set("requestId", requestId)
  44688. return c
  44689. }
  44690. // Fields allows partial responses to be retrieved. See
  44691. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  44692. // for more information.
  44693. func (c *ImagesInsertCall) Fields(s ...googleapi.Field) *ImagesInsertCall {
  44694. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  44695. return c
  44696. }
  44697. // Context sets the context to be used in this call's Do method. Any
  44698. // pending HTTP request will be aborted if the provided context is
  44699. // canceled.
  44700. func (c *ImagesInsertCall) Context(ctx context.Context) *ImagesInsertCall {
  44701. c.ctx_ = ctx
  44702. return c
  44703. }
  44704. // Header returns an http.Header that can be modified by the caller to
  44705. // add HTTP headers to the request.
  44706. func (c *ImagesInsertCall) Header() http.Header {
  44707. if c.header_ == nil {
  44708. c.header_ = make(http.Header)
  44709. }
  44710. return c.header_
  44711. }
  44712. func (c *ImagesInsertCall) doRequest(alt string) (*http.Response, error) {
  44713. reqHeaders := make(http.Header)
  44714. for k, v := range c.header_ {
  44715. reqHeaders[k] = v
  44716. }
  44717. reqHeaders.Set("User-Agent", c.s.userAgent())
  44718. var body io.Reader = nil
  44719. body, err := googleapi.WithoutDataWrapper.JSONReader(c.image)
  44720. if err != nil {
  44721. return nil, err
  44722. }
  44723. reqHeaders.Set("Content-Type", "application/json")
  44724. c.urlParams_.Set("alt", alt)
  44725. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/images")
  44726. urls += "?" + c.urlParams_.Encode()
  44727. req, _ := http.NewRequest("POST", urls, body)
  44728. req.Header = reqHeaders
  44729. googleapi.Expand(req.URL, map[string]string{
  44730. "project": c.project,
  44731. })
  44732. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  44733. }
  44734. // Do executes the "compute.images.insert" call.
  44735. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  44736. // status code is an error. Response headers are in either
  44737. // *Operation.ServerResponse.Header or (if a response was returned at
  44738. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  44739. // to check whether the returned error was because
  44740. // http.StatusNotModified was returned.
  44741. func (c *ImagesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  44742. gensupport.SetOptions(c.urlParams_, opts...)
  44743. res, err := c.doRequest("json")
  44744. if res != nil && res.StatusCode == http.StatusNotModified {
  44745. if res.Body != nil {
  44746. res.Body.Close()
  44747. }
  44748. return nil, &googleapi.Error{
  44749. Code: res.StatusCode,
  44750. Header: res.Header,
  44751. }
  44752. }
  44753. if err != nil {
  44754. return nil, err
  44755. }
  44756. defer googleapi.CloseBody(res)
  44757. if err := googleapi.CheckResponse(res); err != nil {
  44758. return nil, err
  44759. }
  44760. ret := &Operation{
  44761. ServerResponse: googleapi.ServerResponse{
  44762. Header: res.Header,
  44763. HTTPStatusCode: res.StatusCode,
  44764. },
  44765. }
  44766. target := &ret
  44767. if err := gensupport.DecodeResponse(target, res); err != nil {
  44768. return nil, err
  44769. }
  44770. return ret, nil
  44771. // {
  44772. // "description": "Creates an image in the specified project using the data included in the request.",
  44773. // "httpMethod": "POST",
  44774. // "id": "compute.images.insert",
  44775. // "parameterOrder": [
  44776. // "project"
  44777. // ],
  44778. // "parameters": {
  44779. // "forceCreate": {
  44780. // "description": "Force image creation if true.",
  44781. // "location": "query",
  44782. // "type": "boolean"
  44783. // },
  44784. // "project": {
  44785. // "description": "Project ID for this request.",
  44786. // "location": "path",
  44787. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  44788. // "required": true,
  44789. // "type": "string"
  44790. // },
  44791. // "requestId": {
  44792. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  44793. // "location": "query",
  44794. // "type": "string"
  44795. // }
  44796. // },
  44797. // "path": "{project}/global/images",
  44798. // "request": {
  44799. // "$ref": "Image"
  44800. // },
  44801. // "response": {
  44802. // "$ref": "Operation"
  44803. // },
  44804. // "scopes": [
  44805. // "https://www.googleapis.com/auth/cloud-platform",
  44806. // "https://www.googleapis.com/auth/compute",
  44807. // "https://www.googleapis.com/auth/devstorage.full_control",
  44808. // "https://www.googleapis.com/auth/devstorage.read_only",
  44809. // "https://www.googleapis.com/auth/devstorage.read_write"
  44810. // ]
  44811. // }
  44812. }
  44813. // method id "compute.images.list":
  44814. type ImagesListCall struct {
  44815. s *Service
  44816. project string
  44817. urlParams_ gensupport.URLParams
  44818. ifNoneMatch_ string
  44819. ctx_ context.Context
  44820. header_ http.Header
  44821. }
  44822. // List: Retrieves the list of custom images available to the specified
  44823. // project. Custom images are images you create that belong to your
  44824. // project. This method does not get any images that belong to other
  44825. // projects, including publicly-available images, like Debian 8. If you
  44826. // want to get a list of publicly-available images, use this method to
  44827. // make a request to the respective image project, such as debian-cloud
  44828. // or windows-cloud.
  44829. // For details, see https://cloud.google.com/compute/docs/reference/latest/images/list
  44830. func (r *ImagesService) List(project string) *ImagesListCall {
  44831. c := &ImagesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  44832. c.project = project
  44833. return c
  44834. }
  44835. // Filter sets the optional parameter "filter": A filter expression that
  44836. // filters resources listed in the response. The expression must specify
  44837. // the field name, a comparison operator, and the value that you want to
  44838. // use for filtering. The value must be a string, a number, or a
  44839. // boolean. The comparison operator must be either =, !=, >, or <.
  44840. //
  44841. // For example, if you are filtering Compute Engine instances, you can
  44842. // exclude instances named example-instance by specifying name !=
  44843. // example-instance.
  44844. //
  44845. // You can also filter nested fields. For example, you could specify
  44846. // scheduling.automaticRestart = false to include instances only if they
  44847. // are not scheduled for automatic restarts. You can use filtering on
  44848. // nested fields to filter based on resource labels.
  44849. //
  44850. // To filter on multiple expressions, provide each separate expression
  44851. // within parentheses. For example, (scheduling.automaticRestart = true)
  44852. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  44853. // AND expression. However, you can include AND and OR expressions
  44854. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  44855. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  44856. // true).
  44857. func (c *ImagesListCall) Filter(filter string) *ImagesListCall {
  44858. c.urlParams_.Set("filter", filter)
  44859. return c
  44860. }
  44861. // MaxResults sets the optional parameter "maxResults": The maximum
  44862. // number of results per page that should be returned. If the number of
  44863. // available results is larger than maxResults, Compute Engine returns a
  44864. // nextPageToken that can be used to get the next page of results in
  44865. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  44866. // (Default: 500)
  44867. func (c *ImagesListCall) MaxResults(maxResults int64) *ImagesListCall {
  44868. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  44869. return c
  44870. }
  44871. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  44872. // a certain order. By default, results are returned in alphanumerical
  44873. // order based on the resource name.
  44874. //
  44875. // You can also sort results in descending order based on the creation
  44876. // timestamp using orderBy="creationTimestamp desc". This sorts results
  44877. // based on the creationTimestamp field in reverse chronological order
  44878. // (newest result first). Use this to sort resources like operations so
  44879. // that the newest operation is returned first.
  44880. //
  44881. // Currently, only sorting by name or creationTimestamp desc is
  44882. // supported.
  44883. func (c *ImagesListCall) OrderBy(orderBy string) *ImagesListCall {
  44884. c.urlParams_.Set("orderBy", orderBy)
  44885. return c
  44886. }
  44887. // PageToken sets the optional parameter "pageToken": Specifies a page
  44888. // token to use. Set pageToken to the nextPageToken returned by a
  44889. // previous list request to get the next page of results.
  44890. func (c *ImagesListCall) PageToken(pageToken string) *ImagesListCall {
  44891. c.urlParams_.Set("pageToken", pageToken)
  44892. return c
  44893. }
  44894. // Fields allows partial responses to be retrieved. See
  44895. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  44896. // for more information.
  44897. func (c *ImagesListCall) Fields(s ...googleapi.Field) *ImagesListCall {
  44898. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  44899. return c
  44900. }
  44901. // IfNoneMatch sets the optional parameter which makes the operation
  44902. // fail if the object's ETag matches the given value. This is useful for
  44903. // getting updates only after the object has changed since the last
  44904. // request. Use googleapi.IsNotModified to check whether the response
  44905. // error from Do is the result of In-None-Match.
  44906. func (c *ImagesListCall) IfNoneMatch(entityTag string) *ImagesListCall {
  44907. c.ifNoneMatch_ = entityTag
  44908. return c
  44909. }
  44910. // Context sets the context to be used in this call's Do method. Any
  44911. // pending HTTP request will be aborted if the provided context is
  44912. // canceled.
  44913. func (c *ImagesListCall) Context(ctx context.Context) *ImagesListCall {
  44914. c.ctx_ = ctx
  44915. return c
  44916. }
  44917. // Header returns an http.Header that can be modified by the caller to
  44918. // add HTTP headers to the request.
  44919. func (c *ImagesListCall) Header() http.Header {
  44920. if c.header_ == nil {
  44921. c.header_ = make(http.Header)
  44922. }
  44923. return c.header_
  44924. }
  44925. func (c *ImagesListCall) doRequest(alt string) (*http.Response, error) {
  44926. reqHeaders := make(http.Header)
  44927. for k, v := range c.header_ {
  44928. reqHeaders[k] = v
  44929. }
  44930. reqHeaders.Set("User-Agent", c.s.userAgent())
  44931. if c.ifNoneMatch_ != "" {
  44932. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  44933. }
  44934. var body io.Reader = nil
  44935. c.urlParams_.Set("alt", alt)
  44936. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/images")
  44937. urls += "?" + c.urlParams_.Encode()
  44938. req, _ := http.NewRequest("GET", urls, body)
  44939. req.Header = reqHeaders
  44940. googleapi.Expand(req.URL, map[string]string{
  44941. "project": c.project,
  44942. })
  44943. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  44944. }
  44945. // Do executes the "compute.images.list" call.
  44946. // Exactly one of *ImageList or error will be non-nil. Any non-2xx
  44947. // status code is an error. Response headers are in either
  44948. // *ImageList.ServerResponse.Header or (if a response was returned at
  44949. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  44950. // to check whether the returned error was because
  44951. // http.StatusNotModified was returned.
  44952. func (c *ImagesListCall) Do(opts ...googleapi.CallOption) (*ImageList, error) {
  44953. gensupport.SetOptions(c.urlParams_, opts...)
  44954. res, err := c.doRequest("json")
  44955. if res != nil && res.StatusCode == http.StatusNotModified {
  44956. if res.Body != nil {
  44957. res.Body.Close()
  44958. }
  44959. return nil, &googleapi.Error{
  44960. Code: res.StatusCode,
  44961. Header: res.Header,
  44962. }
  44963. }
  44964. if err != nil {
  44965. return nil, err
  44966. }
  44967. defer googleapi.CloseBody(res)
  44968. if err := googleapi.CheckResponse(res); err != nil {
  44969. return nil, err
  44970. }
  44971. ret := &ImageList{
  44972. ServerResponse: googleapi.ServerResponse{
  44973. Header: res.Header,
  44974. HTTPStatusCode: res.StatusCode,
  44975. },
  44976. }
  44977. target := &ret
  44978. if err := gensupport.DecodeResponse(target, res); err != nil {
  44979. return nil, err
  44980. }
  44981. return ret, nil
  44982. // {
  44983. // "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.",
  44984. // "httpMethod": "GET",
  44985. // "id": "compute.images.list",
  44986. // "parameterOrder": [
  44987. // "project"
  44988. // ],
  44989. // "parameters": {
  44990. // "filter": {
  44991. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  44992. // "location": "query",
  44993. // "type": "string"
  44994. // },
  44995. // "maxResults": {
  44996. // "default": "500",
  44997. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  44998. // "format": "uint32",
  44999. // "location": "query",
  45000. // "minimum": "0",
  45001. // "type": "integer"
  45002. // },
  45003. // "orderBy": {
  45004. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  45005. // "location": "query",
  45006. // "type": "string"
  45007. // },
  45008. // "pageToken": {
  45009. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  45010. // "location": "query",
  45011. // "type": "string"
  45012. // },
  45013. // "project": {
  45014. // "description": "Project ID for this request.",
  45015. // "location": "path",
  45016. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  45017. // "required": true,
  45018. // "type": "string"
  45019. // }
  45020. // },
  45021. // "path": "{project}/global/images",
  45022. // "response": {
  45023. // "$ref": "ImageList"
  45024. // },
  45025. // "scopes": [
  45026. // "https://www.googleapis.com/auth/cloud-platform",
  45027. // "https://www.googleapis.com/auth/compute",
  45028. // "https://www.googleapis.com/auth/compute.readonly"
  45029. // ]
  45030. // }
  45031. }
  45032. // Pages invokes f for each page of results.
  45033. // A non-nil error returned from f will halt the iteration.
  45034. // The provided context supersedes any context provided to the Context method.
  45035. func (c *ImagesListCall) Pages(ctx context.Context, f func(*ImageList) error) error {
  45036. c.ctx_ = ctx
  45037. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  45038. for {
  45039. x, err := c.Do()
  45040. if err != nil {
  45041. return err
  45042. }
  45043. if err := f(x); err != nil {
  45044. return err
  45045. }
  45046. if x.NextPageToken == "" {
  45047. return nil
  45048. }
  45049. c.PageToken(x.NextPageToken)
  45050. }
  45051. }
  45052. // method id "compute.images.setLabels":
  45053. type ImagesSetLabelsCall struct {
  45054. s *Service
  45055. project string
  45056. resource string
  45057. globalsetlabelsrequest *GlobalSetLabelsRequest
  45058. urlParams_ gensupport.URLParams
  45059. ctx_ context.Context
  45060. header_ http.Header
  45061. }
  45062. // SetLabels: Sets the labels on an image. To learn more about labels,
  45063. // read the Labeling Resources documentation.
  45064. func (r *ImagesService) SetLabels(project string, resource string, globalsetlabelsrequest *GlobalSetLabelsRequest) *ImagesSetLabelsCall {
  45065. c := &ImagesSetLabelsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  45066. c.project = project
  45067. c.resource = resource
  45068. c.globalsetlabelsrequest = globalsetlabelsrequest
  45069. return c
  45070. }
  45071. // Fields allows partial responses to be retrieved. See
  45072. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  45073. // for more information.
  45074. func (c *ImagesSetLabelsCall) Fields(s ...googleapi.Field) *ImagesSetLabelsCall {
  45075. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  45076. return c
  45077. }
  45078. // Context sets the context to be used in this call's Do method. Any
  45079. // pending HTTP request will be aborted if the provided context is
  45080. // canceled.
  45081. func (c *ImagesSetLabelsCall) Context(ctx context.Context) *ImagesSetLabelsCall {
  45082. c.ctx_ = ctx
  45083. return c
  45084. }
  45085. // Header returns an http.Header that can be modified by the caller to
  45086. // add HTTP headers to the request.
  45087. func (c *ImagesSetLabelsCall) Header() http.Header {
  45088. if c.header_ == nil {
  45089. c.header_ = make(http.Header)
  45090. }
  45091. return c.header_
  45092. }
  45093. func (c *ImagesSetLabelsCall) doRequest(alt string) (*http.Response, error) {
  45094. reqHeaders := make(http.Header)
  45095. for k, v := range c.header_ {
  45096. reqHeaders[k] = v
  45097. }
  45098. reqHeaders.Set("User-Agent", c.s.userAgent())
  45099. var body io.Reader = nil
  45100. body, err := googleapi.WithoutDataWrapper.JSONReader(c.globalsetlabelsrequest)
  45101. if err != nil {
  45102. return nil, err
  45103. }
  45104. reqHeaders.Set("Content-Type", "application/json")
  45105. c.urlParams_.Set("alt", alt)
  45106. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/images/{resource}/setLabels")
  45107. urls += "?" + c.urlParams_.Encode()
  45108. req, _ := http.NewRequest("POST", urls, body)
  45109. req.Header = reqHeaders
  45110. googleapi.Expand(req.URL, map[string]string{
  45111. "project": c.project,
  45112. "resource": c.resource,
  45113. })
  45114. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  45115. }
  45116. // Do executes the "compute.images.setLabels" call.
  45117. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  45118. // status code is an error. Response headers are in either
  45119. // *Operation.ServerResponse.Header or (if a response was returned at
  45120. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  45121. // to check whether the returned error was because
  45122. // http.StatusNotModified was returned.
  45123. func (c *ImagesSetLabelsCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  45124. gensupport.SetOptions(c.urlParams_, opts...)
  45125. res, err := c.doRequest("json")
  45126. if res != nil && res.StatusCode == http.StatusNotModified {
  45127. if res.Body != nil {
  45128. res.Body.Close()
  45129. }
  45130. return nil, &googleapi.Error{
  45131. Code: res.StatusCode,
  45132. Header: res.Header,
  45133. }
  45134. }
  45135. if err != nil {
  45136. return nil, err
  45137. }
  45138. defer googleapi.CloseBody(res)
  45139. if err := googleapi.CheckResponse(res); err != nil {
  45140. return nil, err
  45141. }
  45142. ret := &Operation{
  45143. ServerResponse: googleapi.ServerResponse{
  45144. Header: res.Header,
  45145. HTTPStatusCode: res.StatusCode,
  45146. },
  45147. }
  45148. target := &ret
  45149. if err := gensupport.DecodeResponse(target, res); err != nil {
  45150. return nil, err
  45151. }
  45152. return ret, nil
  45153. // {
  45154. // "description": "Sets the labels on an image. To learn more about labels, read the Labeling Resources documentation.",
  45155. // "httpMethod": "POST",
  45156. // "id": "compute.images.setLabels",
  45157. // "parameterOrder": [
  45158. // "project",
  45159. // "resource"
  45160. // ],
  45161. // "parameters": {
  45162. // "project": {
  45163. // "description": "Project ID for this request.",
  45164. // "location": "path",
  45165. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  45166. // "required": true,
  45167. // "type": "string"
  45168. // },
  45169. // "resource": {
  45170. // "description": "Name of the resource for this request.",
  45171. // "location": "path",
  45172. // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?",
  45173. // "required": true,
  45174. // "type": "string"
  45175. // }
  45176. // },
  45177. // "path": "{project}/global/images/{resource}/setLabels",
  45178. // "request": {
  45179. // "$ref": "GlobalSetLabelsRequest"
  45180. // },
  45181. // "response": {
  45182. // "$ref": "Operation"
  45183. // },
  45184. // "scopes": [
  45185. // "https://www.googleapis.com/auth/cloud-platform",
  45186. // "https://www.googleapis.com/auth/compute"
  45187. // ]
  45188. // }
  45189. }
  45190. // method id "compute.images.testIamPermissions":
  45191. type ImagesTestIamPermissionsCall struct {
  45192. s *Service
  45193. project string
  45194. resource string
  45195. testpermissionsrequest *TestPermissionsRequest
  45196. urlParams_ gensupport.URLParams
  45197. ctx_ context.Context
  45198. header_ http.Header
  45199. }
  45200. // TestIamPermissions: Returns permissions that a caller has on the
  45201. // specified resource.
  45202. func (r *ImagesService) TestIamPermissions(project string, resource string, testpermissionsrequest *TestPermissionsRequest) *ImagesTestIamPermissionsCall {
  45203. c := &ImagesTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  45204. c.project = project
  45205. c.resource = resource
  45206. c.testpermissionsrequest = testpermissionsrequest
  45207. return c
  45208. }
  45209. // Fields allows partial responses to be retrieved. See
  45210. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  45211. // for more information.
  45212. func (c *ImagesTestIamPermissionsCall) Fields(s ...googleapi.Field) *ImagesTestIamPermissionsCall {
  45213. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  45214. return c
  45215. }
  45216. // Context sets the context to be used in this call's Do method. Any
  45217. // pending HTTP request will be aborted if the provided context is
  45218. // canceled.
  45219. func (c *ImagesTestIamPermissionsCall) Context(ctx context.Context) *ImagesTestIamPermissionsCall {
  45220. c.ctx_ = ctx
  45221. return c
  45222. }
  45223. // Header returns an http.Header that can be modified by the caller to
  45224. // add HTTP headers to the request.
  45225. func (c *ImagesTestIamPermissionsCall) Header() http.Header {
  45226. if c.header_ == nil {
  45227. c.header_ = make(http.Header)
  45228. }
  45229. return c.header_
  45230. }
  45231. func (c *ImagesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  45232. reqHeaders := make(http.Header)
  45233. for k, v := range c.header_ {
  45234. reqHeaders[k] = v
  45235. }
  45236. reqHeaders.Set("User-Agent", c.s.userAgent())
  45237. var body io.Reader = nil
  45238. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  45239. if err != nil {
  45240. return nil, err
  45241. }
  45242. reqHeaders.Set("Content-Type", "application/json")
  45243. c.urlParams_.Set("alt", alt)
  45244. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/images/{resource}/testIamPermissions")
  45245. urls += "?" + c.urlParams_.Encode()
  45246. req, _ := http.NewRequest("POST", urls, body)
  45247. req.Header = reqHeaders
  45248. googleapi.Expand(req.URL, map[string]string{
  45249. "project": c.project,
  45250. "resource": c.resource,
  45251. })
  45252. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  45253. }
  45254. // Do executes the "compute.images.testIamPermissions" call.
  45255. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  45256. // non-2xx status code is an error. Response headers are in either
  45257. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  45258. // returned at all) in error.(*googleapi.Error).Header. Use
  45259. // googleapi.IsNotModified to check whether the returned error was
  45260. // because http.StatusNotModified was returned.
  45261. func (c *ImagesTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  45262. gensupport.SetOptions(c.urlParams_, opts...)
  45263. res, err := c.doRequest("json")
  45264. if res != nil && res.StatusCode == http.StatusNotModified {
  45265. if res.Body != nil {
  45266. res.Body.Close()
  45267. }
  45268. return nil, &googleapi.Error{
  45269. Code: res.StatusCode,
  45270. Header: res.Header,
  45271. }
  45272. }
  45273. if err != nil {
  45274. return nil, err
  45275. }
  45276. defer googleapi.CloseBody(res)
  45277. if err := googleapi.CheckResponse(res); err != nil {
  45278. return nil, err
  45279. }
  45280. ret := &TestPermissionsResponse{
  45281. ServerResponse: googleapi.ServerResponse{
  45282. Header: res.Header,
  45283. HTTPStatusCode: res.StatusCode,
  45284. },
  45285. }
  45286. target := &ret
  45287. if err := gensupport.DecodeResponse(target, res); err != nil {
  45288. return nil, err
  45289. }
  45290. return ret, nil
  45291. // {
  45292. // "description": "Returns permissions that a caller has on the specified resource.",
  45293. // "httpMethod": "POST",
  45294. // "id": "compute.images.testIamPermissions",
  45295. // "parameterOrder": [
  45296. // "project",
  45297. // "resource"
  45298. // ],
  45299. // "parameters": {
  45300. // "project": {
  45301. // "description": "Project ID for this request.",
  45302. // "location": "path",
  45303. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  45304. // "required": true,
  45305. // "type": "string"
  45306. // },
  45307. // "resource": {
  45308. // "description": "Name of the resource for this request.",
  45309. // "location": "path",
  45310. // "pattern": "(?:[-a-z0-9_]{0,62}[a-z0-9])?",
  45311. // "required": true,
  45312. // "type": "string"
  45313. // }
  45314. // },
  45315. // "path": "{project}/global/images/{resource}/testIamPermissions",
  45316. // "request": {
  45317. // "$ref": "TestPermissionsRequest"
  45318. // },
  45319. // "response": {
  45320. // "$ref": "TestPermissionsResponse"
  45321. // },
  45322. // "scopes": [
  45323. // "https://www.googleapis.com/auth/cloud-platform",
  45324. // "https://www.googleapis.com/auth/compute",
  45325. // "https://www.googleapis.com/auth/compute.readonly"
  45326. // ]
  45327. // }
  45328. }
  45329. // method id "compute.instanceGroupManagers.abandonInstances":
  45330. type InstanceGroupManagersAbandonInstancesCall struct {
  45331. s *Service
  45332. project string
  45333. zone string
  45334. instanceGroupManager string
  45335. instancegroupmanagersabandoninstancesrequest *InstanceGroupManagersAbandonInstancesRequest
  45336. urlParams_ gensupport.URLParams
  45337. ctx_ context.Context
  45338. header_ http.Header
  45339. }
  45340. // AbandonInstances: Schedules a group action to remove the specified
  45341. // instances from the managed instance group. Abandoning an instance
  45342. // does not delete the instance, but it does remove the instance from
  45343. // any target pools that are applied by the managed instance group. This
  45344. // method reduces the targetSize of the managed instance group by the
  45345. // number of instances that you abandon. This operation is marked as
  45346. // DONE when the action is scheduled even if the instances have not yet
  45347. // been removed from the group. You must separately verify the status of
  45348. // the abandoning action with the listmanagedinstances method.
  45349. //
  45350. // If the group is part of a backend service that has enabled connection
  45351. // draining, it can take up to 60 seconds after the connection draining
  45352. // duration has elapsed before the VM instance is removed or
  45353. // deleted.
  45354. //
  45355. // You can specify a maximum of 1000 instances with this method per
  45356. // request.
  45357. func (r *InstanceGroupManagersService) AbandonInstances(project string, zone string, instanceGroupManager string, instancegroupmanagersabandoninstancesrequest *InstanceGroupManagersAbandonInstancesRequest) *InstanceGroupManagersAbandonInstancesCall {
  45358. c := &InstanceGroupManagersAbandonInstancesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  45359. c.project = project
  45360. c.zone = zone
  45361. c.instanceGroupManager = instanceGroupManager
  45362. c.instancegroupmanagersabandoninstancesrequest = instancegroupmanagersabandoninstancesrequest
  45363. return c
  45364. }
  45365. // RequestId sets the optional parameter "requestId": An optional
  45366. // request ID to identify requests. Specify a unique request ID so that
  45367. // if you must retry your request, the server will know to ignore the
  45368. // request if it has already been completed.
  45369. //
  45370. // For example, consider a situation where you make an initial request
  45371. // and the request times out. If you make the request again with the
  45372. // same request ID, the server can check if original operation with the
  45373. // same request ID was received, and if so, will ignore the second
  45374. // request. This prevents clients from accidentally creating duplicate
  45375. // commitments.
  45376. //
  45377. // The request ID must be a valid UUID with the exception that zero UUID
  45378. // is not supported (00000000-0000-0000-0000-000000000000).
  45379. func (c *InstanceGroupManagersAbandonInstancesCall) RequestId(requestId string) *InstanceGroupManagersAbandonInstancesCall {
  45380. c.urlParams_.Set("requestId", requestId)
  45381. return c
  45382. }
  45383. // Fields allows partial responses to be retrieved. See
  45384. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  45385. // for more information.
  45386. func (c *InstanceGroupManagersAbandonInstancesCall) Fields(s ...googleapi.Field) *InstanceGroupManagersAbandonInstancesCall {
  45387. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  45388. return c
  45389. }
  45390. // Context sets the context to be used in this call's Do method. Any
  45391. // pending HTTP request will be aborted if the provided context is
  45392. // canceled.
  45393. func (c *InstanceGroupManagersAbandonInstancesCall) Context(ctx context.Context) *InstanceGroupManagersAbandonInstancesCall {
  45394. c.ctx_ = ctx
  45395. return c
  45396. }
  45397. // Header returns an http.Header that can be modified by the caller to
  45398. // add HTTP headers to the request.
  45399. func (c *InstanceGroupManagersAbandonInstancesCall) Header() http.Header {
  45400. if c.header_ == nil {
  45401. c.header_ = make(http.Header)
  45402. }
  45403. return c.header_
  45404. }
  45405. func (c *InstanceGroupManagersAbandonInstancesCall) doRequest(alt string) (*http.Response, error) {
  45406. reqHeaders := make(http.Header)
  45407. for k, v := range c.header_ {
  45408. reqHeaders[k] = v
  45409. }
  45410. reqHeaders.Set("User-Agent", c.s.userAgent())
  45411. var body io.Reader = nil
  45412. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupmanagersabandoninstancesrequest)
  45413. if err != nil {
  45414. return nil, err
  45415. }
  45416. reqHeaders.Set("Content-Type", "application/json")
  45417. c.urlParams_.Set("alt", alt)
  45418. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/abandonInstances")
  45419. urls += "?" + c.urlParams_.Encode()
  45420. req, _ := http.NewRequest("POST", urls, body)
  45421. req.Header = reqHeaders
  45422. googleapi.Expand(req.URL, map[string]string{
  45423. "project": c.project,
  45424. "zone": c.zone,
  45425. "instanceGroupManager": c.instanceGroupManager,
  45426. })
  45427. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  45428. }
  45429. // Do executes the "compute.instanceGroupManagers.abandonInstances" call.
  45430. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  45431. // status code is an error. Response headers are in either
  45432. // *Operation.ServerResponse.Header or (if a response was returned at
  45433. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  45434. // to check whether the returned error was because
  45435. // http.StatusNotModified was returned.
  45436. func (c *InstanceGroupManagersAbandonInstancesCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  45437. gensupport.SetOptions(c.urlParams_, opts...)
  45438. res, err := c.doRequest("json")
  45439. if res != nil && res.StatusCode == http.StatusNotModified {
  45440. if res.Body != nil {
  45441. res.Body.Close()
  45442. }
  45443. return nil, &googleapi.Error{
  45444. Code: res.StatusCode,
  45445. Header: res.Header,
  45446. }
  45447. }
  45448. if err != nil {
  45449. return nil, err
  45450. }
  45451. defer googleapi.CloseBody(res)
  45452. if err := googleapi.CheckResponse(res); err != nil {
  45453. return nil, err
  45454. }
  45455. ret := &Operation{
  45456. ServerResponse: googleapi.ServerResponse{
  45457. Header: res.Header,
  45458. HTTPStatusCode: res.StatusCode,
  45459. },
  45460. }
  45461. target := &ret
  45462. if err := gensupport.DecodeResponse(target, res); err != nil {
  45463. return nil, err
  45464. }
  45465. return ret, nil
  45466. // {
  45467. // "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.",
  45468. // "httpMethod": "POST",
  45469. // "id": "compute.instanceGroupManagers.abandonInstances",
  45470. // "parameterOrder": [
  45471. // "project",
  45472. // "zone",
  45473. // "instanceGroupManager"
  45474. // ],
  45475. // "parameters": {
  45476. // "instanceGroupManager": {
  45477. // "description": "The name of the managed instance group.",
  45478. // "location": "path",
  45479. // "required": true,
  45480. // "type": "string"
  45481. // },
  45482. // "project": {
  45483. // "description": "Project ID for this request.",
  45484. // "location": "path",
  45485. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  45486. // "required": true,
  45487. // "type": "string"
  45488. // },
  45489. // "requestId": {
  45490. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  45491. // "location": "query",
  45492. // "type": "string"
  45493. // },
  45494. // "zone": {
  45495. // "description": "The name of the zone where the managed instance group is located.",
  45496. // "location": "path",
  45497. // "required": true,
  45498. // "type": "string"
  45499. // }
  45500. // },
  45501. // "path": "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/abandonInstances",
  45502. // "request": {
  45503. // "$ref": "InstanceGroupManagersAbandonInstancesRequest"
  45504. // },
  45505. // "response": {
  45506. // "$ref": "Operation"
  45507. // },
  45508. // "scopes": [
  45509. // "https://www.googleapis.com/auth/cloud-platform",
  45510. // "https://www.googleapis.com/auth/compute"
  45511. // ]
  45512. // }
  45513. }
  45514. // method id "compute.instanceGroupManagers.aggregatedList":
  45515. type InstanceGroupManagersAggregatedListCall struct {
  45516. s *Service
  45517. project string
  45518. urlParams_ gensupport.URLParams
  45519. ifNoneMatch_ string
  45520. ctx_ context.Context
  45521. header_ http.Header
  45522. }
  45523. // AggregatedList: Retrieves the list of managed instance groups and
  45524. // groups them by zone.
  45525. func (r *InstanceGroupManagersService) AggregatedList(project string) *InstanceGroupManagersAggregatedListCall {
  45526. c := &InstanceGroupManagersAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  45527. c.project = project
  45528. return c
  45529. }
  45530. // Filter sets the optional parameter "filter": A filter expression that
  45531. // filters resources listed in the response. The expression must specify
  45532. // the field name, a comparison operator, and the value that you want to
  45533. // use for filtering. The value must be a string, a number, or a
  45534. // boolean. The comparison operator must be either =, !=, >, or <.
  45535. //
  45536. // For example, if you are filtering Compute Engine instances, you can
  45537. // exclude instances named example-instance by specifying name !=
  45538. // example-instance.
  45539. //
  45540. // You can also filter nested fields. For example, you could specify
  45541. // scheduling.automaticRestart = false to include instances only if they
  45542. // are not scheduled for automatic restarts. You can use filtering on
  45543. // nested fields to filter based on resource labels.
  45544. //
  45545. // To filter on multiple expressions, provide each separate expression
  45546. // within parentheses. For example, (scheduling.automaticRestart = true)
  45547. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  45548. // AND expression. However, you can include AND and OR expressions
  45549. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  45550. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  45551. // true).
  45552. func (c *InstanceGroupManagersAggregatedListCall) Filter(filter string) *InstanceGroupManagersAggregatedListCall {
  45553. c.urlParams_.Set("filter", filter)
  45554. return c
  45555. }
  45556. // MaxResults sets the optional parameter "maxResults": The maximum
  45557. // number of results per page that should be returned. If the number of
  45558. // available results is larger than maxResults, Compute Engine returns a
  45559. // nextPageToken that can be used to get the next page of results in
  45560. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  45561. // (Default: 500)
  45562. func (c *InstanceGroupManagersAggregatedListCall) MaxResults(maxResults int64) *InstanceGroupManagersAggregatedListCall {
  45563. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  45564. return c
  45565. }
  45566. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  45567. // a certain order. By default, results are returned in alphanumerical
  45568. // order based on the resource name.
  45569. //
  45570. // You can also sort results in descending order based on the creation
  45571. // timestamp using orderBy="creationTimestamp desc". This sorts results
  45572. // based on the creationTimestamp field in reverse chronological order
  45573. // (newest result first). Use this to sort resources like operations so
  45574. // that the newest operation is returned first.
  45575. //
  45576. // Currently, only sorting by name or creationTimestamp desc is
  45577. // supported.
  45578. func (c *InstanceGroupManagersAggregatedListCall) OrderBy(orderBy string) *InstanceGroupManagersAggregatedListCall {
  45579. c.urlParams_.Set("orderBy", orderBy)
  45580. return c
  45581. }
  45582. // PageToken sets the optional parameter "pageToken": Specifies a page
  45583. // token to use. Set pageToken to the nextPageToken returned by a
  45584. // previous list request to get the next page of results.
  45585. func (c *InstanceGroupManagersAggregatedListCall) PageToken(pageToken string) *InstanceGroupManagersAggregatedListCall {
  45586. c.urlParams_.Set("pageToken", pageToken)
  45587. return c
  45588. }
  45589. // Fields allows partial responses to be retrieved. See
  45590. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  45591. // for more information.
  45592. func (c *InstanceGroupManagersAggregatedListCall) Fields(s ...googleapi.Field) *InstanceGroupManagersAggregatedListCall {
  45593. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  45594. return c
  45595. }
  45596. // IfNoneMatch sets the optional parameter which makes the operation
  45597. // fail if the object's ETag matches the given value. This is useful for
  45598. // getting updates only after the object has changed since the last
  45599. // request. Use googleapi.IsNotModified to check whether the response
  45600. // error from Do is the result of In-None-Match.
  45601. func (c *InstanceGroupManagersAggregatedListCall) IfNoneMatch(entityTag string) *InstanceGroupManagersAggregatedListCall {
  45602. c.ifNoneMatch_ = entityTag
  45603. return c
  45604. }
  45605. // Context sets the context to be used in this call's Do method. Any
  45606. // pending HTTP request will be aborted if the provided context is
  45607. // canceled.
  45608. func (c *InstanceGroupManagersAggregatedListCall) Context(ctx context.Context) *InstanceGroupManagersAggregatedListCall {
  45609. c.ctx_ = ctx
  45610. return c
  45611. }
  45612. // Header returns an http.Header that can be modified by the caller to
  45613. // add HTTP headers to the request.
  45614. func (c *InstanceGroupManagersAggregatedListCall) Header() http.Header {
  45615. if c.header_ == nil {
  45616. c.header_ = make(http.Header)
  45617. }
  45618. return c.header_
  45619. }
  45620. func (c *InstanceGroupManagersAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  45621. reqHeaders := make(http.Header)
  45622. for k, v := range c.header_ {
  45623. reqHeaders[k] = v
  45624. }
  45625. reqHeaders.Set("User-Agent", c.s.userAgent())
  45626. if c.ifNoneMatch_ != "" {
  45627. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  45628. }
  45629. var body io.Reader = nil
  45630. c.urlParams_.Set("alt", alt)
  45631. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/instanceGroupManagers")
  45632. urls += "?" + c.urlParams_.Encode()
  45633. req, _ := http.NewRequest("GET", urls, body)
  45634. req.Header = reqHeaders
  45635. googleapi.Expand(req.URL, map[string]string{
  45636. "project": c.project,
  45637. })
  45638. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  45639. }
  45640. // Do executes the "compute.instanceGroupManagers.aggregatedList" call.
  45641. // Exactly one of *InstanceGroupManagerAggregatedList or error will be
  45642. // non-nil. Any non-2xx status code is an error. Response headers are in
  45643. // either *InstanceGroupManagerAggregatedList.ServerResponse.Header or
  45644. // (if a response was returned at all) in
  45645. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  45646. // whether the returned error was because http.StatusNotModified was
  45647. // returned.
  45648. func (c *InstanceGroupManagersAggregatedListCall) Do(opts ...googleapi.CallOption) (*InstanceGroupManagerAggregatedList, error) {
  45649. gensupport.SetOptions(c.urlParams_, opts...)
  45650. res, err := c.doRequest("json")
  45651. if res != nil && res.StatusCode == http.StatusNotModified {
  45652. if res.Body != nil {
  45653. res.Body.Close()
  45654. }
  45655. return nil, &googleapi.Error{
  45656. Code: res.StatusCode,
  45657. Header: res.Header,
  45658. }
  45659. }
  45660. if err != nil {
  45661. return nil, err
  45662. }
  45663. defer googleapi.CloseBody(res)
  45664. if err := googleapi.CheckResponse(res); err != nil {
  45665. return nil, err
  45666. }
  45667. ret := &InstanceGroupManagerAggregatedList{
  45668. ServerResponse: googleapi.ServerResponse{
  45669. Header: res.Header,
  45670. HTTPStatusCode: res.StatusCode,
  45671. },
  45672. }
  45673. target := &ret
  45674. if err := gensupport.DecodeResponse(target, res); err != nil {
  45675. return nil, err
  45676. }
  45677. return ret, nil
  45678. // {
  45679. // "description": "Retrieves the list of managed instance groups and groups them by zone.",
  45680. // "httpMethod": "GET",
  45681. // "id": "compute.instanceGroupManagers.aggregatedList",
  45682. // "parameterOrder": [
  45683. // "project"
  45684. // ],
  45685. // "parameters": {
  45686. // "filter": {
  45687. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  45688. // "location": "query",
  45689. // "type": "string"
  45690. // },
  45691. // "maxResults": {
  45692. // "default": "500",
  45693. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  45694. // "format": "uint32",
  45695. // "location": "query",
  45696. // "minimum": "0",
  45697. // "type": "integer"
  45698. // },
  45699. // "orderBy": {
  45700. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  45701. // "location": "query",
  45702. // "type": "string"
  45703. // },
  45704. // "pageToken": {
  45705. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  45706. // "location": "query",
  45707. // "type": "string"
  45708. // },
  45709. // "project": {
  45710. // "description": "Project ID for this request.",
  45711. // "location": "path",
  45712. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  45713. // "required": true,
  45714. // "type": "string"
  45715. // }
  45716. // },
  45717. // "path": "{project}/aggregated/instanceGroupManagers",
  45718. // "response": {
  45719. // "$ref": "InstanceGroupManagerAggregatedList"
  45720. // },
  45721. // "scopes": [
  45722. // "https://www.googleapis.com/auth/cloud-platform",
  45723. // "https://www.googleapis.com/auth/compute",
  45724. // "https://www.googleapis.com/auth/compute.readonly"
  45725. // ]
  45726. // }
  45727. }
  45728. // Pages invokes f for each page of results.
  45729. // A non-nil error returned from f will halt the iteration.
  45730. // The provided context supersedes any context provided to the Context method.
  45731. func (c *InstanceGroupManagersAggregatedListCall) Pages(ctx context.Context, f func(*InstanceGroupManagerAggregatedList) error) error {
  45732. c.ctx_ = ctx
  45733. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  45734. for {
  45735. x, err := c.Do()
  45736. if err != nil {
  45737. return err
  45738. }
  45739. if err := f(x); err != nil {
  45740. return err
  45741. }
  45742. if x.NextPageToken == "" {
  45743. return nil
  45744. }
  45745. c.PageToken(x.NextPageToken)
  45746. }
  45747. }
  45748. // method id "compute.instanceGroupManagers.delete":
  45749. type InstanceGroupManagersDeleteCall struct {
  45750. s *Service
  45751. project string
  45752. zone string
  45753. instanceGroupManager string
  45754. urlParams_ gensupport.URLParams
  45755. ctx_ context.Context
  45756. header_ http.Header
  45757. }
  45758. // Delete: Deletes the specified managed instance group and all of the
  45759. // instances in that group. Note that the instance group must not belong
  45760. // to a backend service. Read Deleting an instance group for more
  45761. // information.
  45762. func (r *InstanceGroupManagersService) Delete(project string, zone string, instanceGroupManager string) *InstanceGroupManagersDeleteCall {
  45763. c := &InstanceGroupManagersDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  45764. c.project = project
  45765. c.zone = zone
  45766. c.instanceGroupManager = instanceGroupManager
  45767. return c
  45768. }
  45769. // RequestId sets the optional parameter "requestId": An optional
  45770. // request ID to identify requests. Specify a unique request ID so that
  45771. // if you must retry your request, the server will know to ignore the
  45772. // request if it has already been completed.
  45773. //
  45774. // For example, consider a situation where you make an initial request
  45775. // and the request times out. If you make the request again with the
  45776. // same request ID, the server can check if original operation with the
  45777. // same request ID was received, and if so, will ignore the second
  45778. // request. This prevents clients from accidentally creating duplicate
  45779. // commitments.
  45780. //
  45781. // The request ID must be a valid UUID with the exception that zero UUID
  45782. // is not supported (00000000-0000-0000-0000-000000000000).
  45783. func (c *InstanceGroupManagersDeleteCall) RequestId(requestId string) *InstanceGroupManagersDeleteCall {
  45784. c.urlParams_.Set("requestId", requestId)
  45785. return c
  45786. }
  45787. // Fields allows partial responses to be retrieved. See
  45788. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  45789. // for more information.
  45790. func (c *InstanceGroupManagersDeleteCall) Fields(s ...googleapi.Field) *InstanceGroupManagersDeleteCall {
  45791. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  45792. return c
  45793. }
  45794. // Context sets the context to be used in this call's Do method. Any
  45795. // pending HTTP request will be aborted if the provided context is
  45796. // canceled.
  45797. func (c *InstanceGroupManagersDeleteCall) Context(ctx context.Context) *InstanceGroupManagersDeleteCall {
  45798. c.ctx_ = ctx
  45799. return c
  45800. }
  45801. // Header returns an http.Header that can be modified by the caller to
  45802. // add HTTP headers to the request.
  45803. func (c *InstanceGroupManagersDeleteCall) Header() http.Header {
  45804. if c.header_ == nil {
  45805. c.header_ = make(http.Header)
  45806. }
  45807. return c.header_
  45808. }
  45809. func (c *InstanceGroupManagersDeleteCall) doRequest(alt string) (*http.Response, error) {
  45810. reqHeaders := make(http.Header)
  45811. for k, v := range c.header_ {
  45812. reqHeaders[k] = v
  45813. }
  45814. reqHeaders.Set("User-Agent", c.s.userAgent())
  45815. var body io.Reader = nil
  45816. c.urlParams_.Set("alt", alt)
  45817. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}")
  45818. urls += "?" + c.urlParams_.Encode()
  45819. req, _ := http.NewRequest("DELETE", urls, body)
  45820. req.Header = reqHeaders
  45821. googleapi.Expand(req.URL, map[string]string{
  45822. "project": c.project,
  45823. "zone": c.zone,
  45824. "instanceGroupManager": c.instanceGroupManager,
  45825. })
  45826. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  45827. }
  45828. // Do executes the "compute.instanceGroupManagers.delete" call.
  45829. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  45830. // status code is an error. Response headers are in either
  45831. // *Operation.ServerResponse.Header or (if a response was returned at
  45832. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  45833. // to check whether the returned error was because
  45834. // http.StatusNotModified was returned.
  45835. func (c *InstanceGroupManagersDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  45836. gensupport.SetOptions(c.urlParams_, opts...)
  45837. res, err := c.doRequest("json")
  45838. if res != nil && res.StatusCode == http.StatusNotModified {
  45839. if res.Body != nil {
  45840. res.Body.Close()
  45841. }
  45842. return nil, &googleapi.Error{
  45843. Code: res.StatusCode,
  45844. Header: res.Header,
  45845. }
  45846. }
  45847. if err != nil {
  45848. return nil, err
  45849. }
  45850. defer googleapi.CloseBody(res)
  45851. if err := googleapi.CheckResponse(res); err != nil {
  45852. return nil, err
  45853. }
  45854. ret := &Operation{
  45855. ServerResponse: googleapi.ServerResponse{
  45856. Header: res.Header,
  45857. HTTPStatusCode: res.StatusCode,
  45858. },
  45859. }
  45860. target := &ret
  45861. if err := gensupport.DecodeResponse(target, res); err != nil {
  45862. return nil, err
  45863. }
  45864. return ret, nil
  45865. // {
  45866. // "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.",
  45867. // "httpMethod": "DELETE",
  45868. // "id": "compute.instanceGroupManagers.delete",
  45869. // "parameterOrder": [
  45870. // "project",
  45871. // "zone",
  45872. // "instanceGroupManager"
  45873. // ],
  45874. // "parameters": {
  45875. // "instanceGroupManager": {
  45876. // "description": "The name of the managed instance group to delete.",
  45877. // "location": "path",
  45878. // "required": true,
  45879. // "type": "string"
  45880. // },
  45881. // "project": {
  45882. // "description": "Project ID for this request.",
  45883. // "location": "path",
  45884. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  45885. // "required": true,
  45886. // "type": "string"
  45887. // },
  45888. // "requestId": {
  45889. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  45890. // "location": "query",
  45891. // "type": "string"
  45892. // },
  45893. // "zone": {
  45894. // "description": "The name of the zone where the managed instance group is located.",
  45895. // "location": "path",
  45896. // "required": true,
  45897. // "type": "string"
  45898. // }
  45899. // },
  45900. // "path": "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}",
  45901. // "response": {
  45902. // "$ref": "Operation"
  45903. // },
  45904. // "scopes": [
  45905. // "https://www.googleapis.com/auth/cloud-platform",
  45906. // "https://www.googleapis.com/auth/compute"
  45907. // ]
  45908. // }
  45909. }
  45910. // method id "compute.instanceGroupManagers.deleteInstances":
  45911. type InstanceGroupManagersDeleteInstancesCall struct {
  45912. s *Service
  45913. project string
  45914. zone string
  45915. instanceGroupManager string
  45916. instancegroupmanagersdeleteinstancesrequest *InstanceGroupManagersDeleteInstancesRequest
  45917. urlParams_ gensupport.URLParams
  45918. ctx_ context.Context
  45919. header_ http.Header
  45920. }
  45921. // DeleteInstances: Schedules a group action to delete the specified
  45922. // instances in the managed instance group. The instances are also
  45923. // removed from any target pools of which they were a member. This
  45924. // method reduces the targetSize of the managed instance group by the
  45925. // number of instances that you delete. This operation is marked as DONE
  45926. // when the action is scheduled even if the instances are still being
  45927. // deleted. You must separately verify the status of the deleting action
  45928. // with the listmanagedinstances method.
  45929. //
  45930. // If the group is part of a backend service that has enabled connection
  45931. // draining, it can take up to 60 seconds after the connection draining
  45932. // duration has elapsed before the VM instance is removed or
  45933. // deleted.
  45934. //
  45935. // You can specify a maximum of 1000 instances with this method per
  45936. // request.
  45937. func (r *InstanceGroupManagersService) DeleteInstances(project string, zone string, instanceGroupManager string, instancegroupmanagersdeleteinstancesrequest *InstanceGroupManagersDeleteInstancesRequest) *InstanceGroupManagersDeleteInstancesCall {
  45938. c := &InstanceGroupManagersDeleteInstancesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  45939. c.project = project
  45940. c.zone = zone
  45941. c.instanceGroupManager = instanceGroupManager
  45942. c.instancegroupmanagersdeleteinstancesrequest = instancegroupmanagersdeleteinstancesrequest
  45943. return c
  45944. }
  45945. // RequestId sets the optional parameter "requestId": An optional
  45946. // request ID to identify requests. Specify a unique request ID so that
  45947. // if you must retry your request, the server will know to ignore the
  45948. // request if it has already been completed.
  45949. //
  45950. // For example, consider a situation where you make an initial request
  45951. // and the request times out. If you make the request again with the
  45952. // same request ID, the server can check if original operation with the
  45953. // same request ID was received, and if so, will ignore the second
  45954. // request. This prevents clients from accidentally creating duplicate
  45955. // commitments.
  45956. //
  45957. // The request ID must be a valid UUID with the exception that zero UUID
  45958. // is not supported (00000000-0000-0000-0000-000000000000).
  45959. func (c *InstanceGroupManagersDeleteInstancesCall) RequestId(requestId string) *InstanceGroupManagersDeleteInstancesCall {
  45960. c.urlParams_.Set("requestId", requestId)
  45961. return c
  45962. }
  45963. // Fields allows partial responses to be retrieved. See
  45964. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  45965. // for more information.
  45966. func (c *InstanceGroupManagersDeleteInstancesCall) Fields(s ...googleapi.Field) *InstanceGroupManagersDeleteInstancesCall {
  45967. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  45968. return c
  45969. }
  45970. // Context sets the context to be used in this call's Do method. Any
  45971. // pending HTTP request will be aborted if the provided context is
  45972. // canceled.
  45973. func (c *InstanceGroupManagersDeleteInstancesCall) Context(ctx context.Context) *InstanceGroupManagersDeleteInstancesCall {
  45974. c.ctx_ = ctx
  45975. return c
  45976. }
  45977. // Header returns an http.Header that can be modified by the caller to
  45978. // add HTTP headers to the request.
  45979. func (c *InstanceGroupManagersDeleteInstancesCall) Header() http.Header {
  45980. if c.header_ == nil {
  45981. c.header_ = make(http.Header)
  45982. }
  45983. return c.header_
  45984. }
  45985. func (c *InstanceGroupManagersDeleteInstancesCall) doRequest(alt string) (*http.Response, error) {
  45986. reqHeaders := make(http.Header)
  45987. for k, v := range c.header_ {
  45988. reqHeaders[k] = v
  45989. }
  45990. reqHeaders.Set("User-Agent", c.s.userAgent())
  45991. var body io.Reader = nil
  45992. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupmanagersdeleteinstancesrequest)
  45993. if err != nil {
  45994. return nil, err
  45995. }
  45996. reqHeaders.Set("Content-Type", "application/json")
  45997. c.urlParams_.Set("alt", alt)
  45998. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/deleteInstances")
  45999. urls += "?" + c.urlParams_.Encode()
  46000. req, _ := http.NewRequest("POST", urls, body)
  46001. req.Header = reqHeaders
  46002. googleapi.Expand(req.URL, map[string]string{
  46003. "project": c.project,
  46004. "zone": c.zone,
  46005. "instanceGroupManager": c.instanceGroupManager,
  46006. })
  46007. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  46008. }
  46009. // Do executes the "compute.instanceGroupManagers.deleteInstances" call.
  46010. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  46011. // status code is an error. Response headers are in either
  46012. // *Operation.ServerResponse.Header or (if a response was returned at
  46013. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  46014. // to check whether the returned error was because
  46015. // http.StatusNotModified was returned.
  46016. func (c *InstanceGroupManagersDeleteInstancesCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  46017. gensupport.SetOptions(c.urlParams_, opts...)
  46018. res, err := c.doRequest("json")
  46019. if res != nil && res.StatusCode == http.StatusNotModified {
  46020. if res.Body != nil {
  46021. res.Body.Close()
  46022. }
  46023. return nil, &googleapi.Error{
  46024. Code: res.StatusCode,
  46025. Header: res.Header,
  46026. }
  46027. }
  46028. if err != nil {
  46029. return nil, err
  46030. }
  46031. defer googleapi.CloseBody(res)
  46032. if err := googleapi.CheckResponse(res); err != nil {
  46033. return nil, err
  46034. }
  46035. ret := &Operation{
  46036. ServerResponse: googleapi.ServerResponse{
  46037. Header: res.Header,
  46038. HTTPStatusCode: res.StatusCode,
  46039. },
  46040. }
  46041. target := &ret
  46042. if err := gensupport.DecodeResponse(target, res); err != nil {
  46043. return nil, err
  46044. }
  46045. return ret, nil
  46046. // {
  46047. // "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.",
  46048. // "httpMethod": "POST",
  46049. // "id": "compute.instanceGroupManagers.deleteInstances",
  46050. // "parameterOrder": [
  46051. // "project",
  46052. // "zone",
  46053. // "instanceGroupManager"
  46054. // ],
  46055. // "parameters": {
  46056. // "instanceGroupManager": {
  46057. // "description": "The name of the managed instance group.",
  46058. // "location": "path",
  46059. // "required": true,
  46060. // "type": "string"
  46061. // },
  46062. // "project": {
  46063. // "description": "Project ID for this request.",
  46064. // "location": "path",
  46065. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  46066. // "required": true,
  46067. // "type": "string"
  46068. // },
  46069. // "requestId": {
  46070. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  46071. // "location": "query",
  46072. // "type": "string"
  46073. // },
  46074. // "zone": {
  46075. // "description": "The name of the zone where the managed instance group is located.",
  46076. // "location": "path",
  46077. // "required": true,
  46078. // "type": "string"
  46079. // }
  46080. // },
  46081. // "path": "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/deleteInstances",
  46082. // "request": {
  46083. // "$ref": "InstanceGroupManagersDeleteInstancesRequest"
  46084. // },
  46085. // "response": {
  46086. // "$ref": "Operation"
  46087. // },
  46088. // "scopes": [
  46089. // "https://www.googleapis.com/auth/cloud-platform",
  46090. // "https://www.googleapis.com/auth/compute"
  46091. // ]
  46092. // }
  46093. }
  46094. // method id "compute.instanceGroupManagers.get":
  46095. type InstanceGroupManagersGetCall struct {
  46096. s *Service
  46097. project string
  46098. zone string
  46099. instanceGroupManager string
  46100. urlParams_ gensupport.URLParams
  46101. ifNoneMatch_ string
  46102. ctx_ context.Context
  46103. header_ http.Header
  46104. }
  46105. // Get: Returns all of the details about the specified managed instance
  46106. // group. Gets a list of available managed instance groups by making a
  46107. // list() request.
  46108. func (r *InstanceGroupManagersService) Get(project string, zone string, instanceGroupManager string) *InstanceGroupManagersGetCall {
  46109. c := &InstanceGroupManagersGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  46110. c.project = project
  46111. c.zone = zone
  46112. c.instanceGroupManager = instanceGroupManager
  46113. return c
  46114. }
  46115. // Fields allows partial responses to be retrieved. See
  46116. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  46117. // for more information.
  46118. func (c *InstanceGroupManagersGetCall) Fields(s ...googleapi.Field) *InstanceGroupManagersGetCall {
  46119. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  46120. return c
  46121. }
  46122. // IfNoneMatch sets the optional parameter which makes the operation
  46123. // fail if the object's ETag matches the given value. This is useful for
  46124. // getting updates only after the object has changed since the last
  46125. // request. Use googleapi.IsNotModified to check whether the response
  46126. // error from Do is the result of In-None-Match.
  46127. func (c *InstanceGroupManagersGetCall) IfNoneMatch(entityTag string) *InstanceGroupManagersGetCall {
  46128. c.ifNoneMatch_ = entityTag
  46129. return c
  46130. }
  46131. // Context sets the context to be used in this call's Do method. Any
  46132. // pending HTTP request will be aborted if the provided context is
  46133. // canceled.
  46134. func (c *InstanceGroupManagersGetCall) Context(ctx context.Context) *InstanceGroupManagersGetCall {
  46135. c.ctx_ = ctx
  46136. return c
  46137. }
  46138. // Header returns an http.Header that can be modified by the caller to
  46139. // add HTTP headers to the request.
  46140. func (c *InstanceGroupManagersGetCall) Header() http.Header {
  46141. if c.header_ == nil {
  46142. c.header_ = make(http.Header)
  46143. }
  46144. return c.header_
  46145. }
  46146. func (c *InstanceGroupManagersGetCall) doRequest(alt string) (*http.Response, error) {
  46147. reqHeaders := make(http.Header)
  46148. for k, v := range c.header_ {
  46149. reqHeaders[k] = v
  46150. }
  46151. reqHeaders.Set("User-Agent", c.s.userAgent())
  46152. if c.ifNoneMatch_ != "" {
  46153. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  46154. }
  46155. var body io.Reader = nil
  46156. c.urlParams_.Set("alt", alt)
  46157. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}")
  46158. urls += "?" + c.urlParams_.Encode()
  46159. req, _ := http.NewRequest("GET", urls, body)
  46160. req.Header = reqHeaders
  46161. googleapi.Expand(req.URL, map[string]string{
  46162. "project": c.project,
  46163. "zone": c.zone,
  46164. "instanceGroupManager": c.instanceGroupManager,
  46165. })
  46166. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  46167. }
  46168. // Do executes the "compute.instanceGroupManagers.get" call.
  46169. // Exactly one of *InstanceGroupManager or error will be non-nil. Any
  46170. // non-2xx status code is an error. Response headers are in either
  46171. // *InstanceGroupManager.ServerResponse.Header or (if a response was
  46172. // returned at all) in error.(*googleapi.Error).Header. Use
  46173. // googleapi.IsNotModified to check whether the returned error was
  46174. // because http.StatusNotModified was returned.
  46175. func (c *InstanceGroupManagersGetCall) Do(opts ...googleapi.CallOption) (*InstanceGroupManager, error) {
  46176. gensupport.SetOptions(c.urlParams_, opts...)
  46177. res, err := c.doRequest("json")
  46178. if res != nil && res.StatusCode == http.StatusNotModified {
  46179. if res.Body != nil {
  46180. res.Body.Close()
  46181. }
  46182. return nil, &googleapi.Error{
  46183. Code: res.StatusCode,
  46184. Header: res.Header,
  46185. }
  46186. }
  46187. if err != nil {
  46188. return nil, err
  46189. }
  46190. defer googleapi.CloseBody(res)
  46191. if err := googleapi.CheckResponse(res); err != nil {
  46192. return nil, err
  46193. }
  46194. ret := &InstanceGroupManager{
  46195. ServerResponse: googleapi.ServerResponse{
  46196. Header: res.Header,
  46197. HTTPStatusCode: res.StatusCode,
  46198. },
  46199. }
  46200. target := &ret
  46201. if err := gensupport.DecodeResponse(target, res); err != nil {
  46202. return nil, err
  46203. }
  46204. return ret, nil
  46205. // {
  46206. // "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.",
  46207. // "httpMethod": "GET",
  46208. // "id": "compute.instanceGroupManagers.get",
  46209. // "parameterOrder": [
  46210. // "project",
  46211. // "zone",
  46212. // "instanceGroupManager"
  46213. // ],
  46214. // "parameters": {
  46215. // "instanceGroupManager": {
  46216. // "description": "The name of the managed instance group.",
  46217. // "location": "path",
  46218. // "required": true,
  46219. // "type": "string"
  46220. // },
  46221. // "project": {
  46222. // "description": "Project ID for this request.",
  46223. // "location": "path",
  46224. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  46225. // "required": true,
  46226. // "type": "string"
  46227. // },
  46228. // "zone": {
  46229. // "description": "The name of the zone where the managed instance group is located.",
  46230. // "location": "path",
  46231. // "required": true,
  46232. // "type": "string"
  46233. // }
  46234. // },
  46235. // "path": "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}",
  46236. // "response": {
  46237. // "$ref": "InstanceGroupManager"
  46238. // },
  46239. // "scopes": [
  46240. // "https://www.googleapis.com/auth/cloud-platform",
  46241. // "https://www.googleapis.com/auth/compute",
  46242. // "https://www.googleapis.com/auth/compute.readonly"
  46243. // ]
  46244. // }
  46245. }
  46246. // method id "compute.instanceGroupManagers.insert":
  46247. type InstanceGroupManagersInsertCall struct {
  46248. s *Service
  46249. project string
  46250. zone string
  46251. instancegroupmanager *InstanceGroupManager
  46252. urlParams_ gensupport.URLParams
  46253. ctx_ context.Context
  46254. header_ http.Header
  46255. }
  46256. // Insert: Creates a managed instance group using the information that
  46257. // you specify in the request. After the group is created, it schedules
  46258. // an action to create instances in the group using the specified
  46259. // instance template. This operation is marked as DONE when the group is
  46260. // created even if the instances in the group have not yet been created.
  46261. // You must separately verify the status of the individual instances
  46262. // with the listmanagedinstances method.
  46263. //
  46264. // A managed instance group can have up to 1000 VM instances per group.
  46265. // Please contact Cloud Support if you need an increase in this limit.
  46266. func (r *InstanceGroupManagersService) Insert(project string, zone string, instancegroupmanager *InstanceGroupManager) *InstanceGroupManagersInsertCall {
  46267. c := &InstanceGroupManagersInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  46268. c.project = project
  46269. c.zone = zone
  46270. c.instancegroupmanager = instancegroupmanager
  46271. return c
  46272. }
  46273. // RequestId sets the optional parameter "requestId": An optional
  46274. // request ID to identify requests. Specify a unique request ID so that
  46275. // if you must retry your request, the server will know to ignore the
  46276. // request if it has already been completed.
  46277. //
  46278. // For example, consider a situation where you make an initial request
  46279. // and the request times out. If you make the request again with the
  46280. // same request ID, the server can check if original operation with the
  46281. // same request ID was received, and if so, will ignore the second
  46282. // request. This prevents clients from accidentally creating duplicate
  46283. // commitments.
  46284. //
  46285. // The request ID must be a valid UUID with the exception that zero UUID
  46286. // is not supported (00000000-0000-0000-0000-000000000000).
  46287. func (c *InstanceGroupManagersInsertCall) RequestId(requestId string) *InstanceGroupManagersInsertCall {
  46288. c.urlParams_.Set("requestId", requestId)
  46289. return c
  46290. }
  46291. // Fields allows partial responses to be retrieved. See
  46292. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  46293. // for more information.
  46294. func (c *InstanceGroupManagersInsertCall) Fields(s ...googleapi.Field) *InstanceGroupManagersInsertCall {
  46295. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  46296. return c
  46297. }
  46298. // Context sets the context to be used in this call's Do method. Any
  46299. // pending HTTP request will be aborted if the provided context is
  46300. // canceled.
  46301. func (c *InstanceGroupManagersInsertCall) Context(ctx context.Context) *InstanceGroupManagersInsertCall {
  46302. c.ctx_ = ctx
  46303. return c
  46304. }
  46305. // Header returns an http.Header that can be modified by the caller to
  46306. // add HTTP headers to the request.
  46307. func (c *InstanceGroupManagersInsertCall) Header() http.Header {
  46308. if c.header_ == nil {
  46309. c.header_ = make(http.Header)
  46310. }
  46311. return c.header_
  46312. }
  46313. func (c *InstanceGroupManagersInsertCall) doRequest(alt string) (*http.Response, error) {
  46314. reqHeaders := make(http.Header)
  46315. for k, v := range c.header_ {
  46316. reqHeaders[k] = v
  46317. }
  46318. reqHeaders.Set("User-Agent", c.s.userAgent())
  46319. var body io.Reader = nil
  46320. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupmanager)
  46321. if err != nil {
  46322. return nil, err
  46323. }
  46324. reqHeaders.Set("Content-Type", "application/json")
  46325. c.urlParams_.Set("alt", alt)
  46326. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroupManagers")
  46327. urls += "?" + c.urlParams_.Encode()
  46328. req, _ := http.NewRequest("POST", urls, body)
  46329. req.Header = reqHeaders
  46330. googleapi.Expand(req.URL, map[string]string{
  46331. "project": c.project,
  46332. "zone": c.zone,
  46333. })
  46334. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  46335. }
  46336. // Do executes the "compute.instanceGroupManagers.insert" call.
  46337. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  46338. // status code is an error. Response headers are in either
  46339. // *Operation.ServerResponse.Header or (if a response was returned at
  46340. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  46341. // to check whether the returned error was because
  46342. // http.StatusNotModified was returned.
  46343. func (c *InstanceGroupManagersInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  46344. gensupport.SetOptions(c.urlParams_, opts...)
  46345. res, err := c.doRequest("json")
  46346. if res != nil && res.StatusCode == http.StatusNotModified {
  46347. if res.Body != nil {
  46348. res.Body.Close()
  46349. }
  46350. return nil, &googleapi.Error{
  46351. Code: res.StatusCode,
  46352. Header: res.Header,
  46353. }
  46354. }
  46355. if err != nil {
  46356. return nil, err
  46357. }
  46358. defer googleapi.CloseBody(res)
  46359. if err := googleapi.CheckResponse(res); err != nil {
  46360. return nil, err
  46361. }
  46362. ret := &Operation{
  46363. ServerResponse: googleapi.ServerResponse{
  46364. Header: res.Header,
  46365. HTTPStatusCode: res.StatusCode,
  46366. },
  46367. }
  46368. target := &ret
  46369. if err := gensupport.DecodeResponse(target, res); err != nil {
  46370. return nil, err
  46371. }
  46372. return ret, nil
  46373. // {
  46374. // "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.",
  46375. // "httpMethod": "POST",
  46376. // "id": "compute.instanceGroupManagers.insert",
  46377. // "parameterOrder": [
  46378. // "project",
  46379. // "zone"
  46380. // ],
  46381. // "parameters": {
  46382. // "project": {
  46383. // "description": "Project ID for this request.",
  46384. // "location": "path",
  46385. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  46386. // "required": true,
  46387. // "type": "string"
  46388. // },
  46389. // "requestId": {
  46390. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  46391. // "location": "query",
  46392. // "type": "string"
  46393. // },
  46394. // "zone": {
  46395. // "description": "The name of the zone where you want to create the managed instance group.",
  46396. // "location": "path",
  46397. // "required": true,
  46398. // "type": "string"
  46399. // }
  46400. // },
  46401. // "path": "{project}/zones/{zone}/instanceGroupManagers",
  46402. // "request": {
  46403. // "$ref": "InstanceGroupManager"
  46404. // },
  46405. // "response": {
  46406. // "$ref": "Operation"
  46407. // },
  46408. // "scopes": [
  46409. // "https://www.googleapis.com/auth/cloud-platform",
  46410. // "https://www.googleapis.com/auth/compute"
  46411. // ]
  46412. // }
  46413. }
  46414. // method id "compute.instanceGroupManagers.list":
  46415. type InstanceGroupManagersListCall struct {
  46416. s *Service
  46417. project string
  46418. zone string
  46419. urlParams_ gensupport.URLParams
  46420. ifNoneMatch_ string
  46421. ctx_ context.Context
  46422. header_ http.Header
  46423. }
  46424. // List: Retrieves a list of managed instance groups that are contained
  46425. // within the specified project and zone.
  46426. func (r *InstanceGroupManagersService) List(project string, zone string) *InstanceGroupManagersListCall {
  46427. c := &InstanceGroupManagersListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  46428. c.project = project
  46429. c.zone = zone
  46430. return c
  46431. }
  46432. // Filter sets the optional parameter "filter": A filter expression that
  46433. // filters resources listed in the response. The expression must specify
  46434. // the field name, a comparison operator, and the value that you want to
  46435. // use for filtering. The value must be a string, a number, or a
  46436. // boolean. The comparison operator must be either =, !=, >, or <.
  46437. //
  46438. // For example, if you are filtering Compute Engine instances, you can
  46439. // exclude instances named example-instance by specifying name !=
  46440. // example-instance.
  46441. //
  46442. // You can also filter nested fields. For example, you could specify
  46443. // scheduling.automaticRestart = false to include instances only if they
  46444. // are not scheduled for automatic restarts. You can use filtering on
  46445. // nested fields to filter based on resource labels.
  46446. //
  46447. // To filter on multiple expressions, provide each separate expression
  46448. // within parentheses. For example, (scheduling.automaticRestart = true)
  46449. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  46450. // AND expression. However, you can include AND and OR expressions
  46451. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  46452. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  46453. // true).
  46454. func (c *InstanceGroupManagersListCall) Filter(filter string) *InstanceGroupManagersListCall {
  46455. c.urlParams_.Set("filter", filter)
  46456. return c
  46457. }
  46458. // MaxResults sets the optional parameter "maxResults": The maximum
  46459. // number of results per page that should be returned. If the number of
  46460. // available results is larger than maxResults, Compute Engine returns a
  46461. // nextPageToken that can be used to get the next page of results in
  46462. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  46463. // (Default: 500)
  46464. func (c *InstanceGroupManagersListCall) MaxResults(maxResults int64) *InstanceGroupManagersListCall {
  46465. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  46466. return c
  46467. }
  46468. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  46469. // a certain order. By default, results are returned in alphanumerical
  46470. // order based on the resource name.
  46471. //
  46472. // You can also sort results in descending order based on the creation
  46473. // timestamp using orderBy="creationTimestamp desc". This sorts results
  46474. // based on the creationTimestamp field in reverse chronological order
  46475. // (newest result first). Use this to sort resources like operations so
  46476. // that the newest operation is returned first.
  46477. //
  46478. // Currently, only sorting by name or creationTimestamp desc is
  46479. // supported.
  46480. func (c *InstanceGroupManagersListCall) OrderBy(orderBy string) *InstanceGroupManagersListCall {
  46481. c.urlParams_.Set("orderBy", orderBy)
  46482. return c
  46483. }
  46484. // PageToken sets the optional parameter "pageToken": Specifies a page
  46485. // token to use. Set pageToken to the nextPageToken returned by a
  46486. // previous list request to get the next page of results.
  46487. func (c *InstanceGroupManagersListCall) PageToken(pageToken string) *InstanceGroupManagersListCall {
  46488. c.urlParams_.Set("pageToken", pageToken)
  46489. return c
  46490. }
  46491. // Fields allows partial responses to be retrieved. See
  46492. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  46493. // for more information.
  46494. func (c *InstanceGroupManagersListCall) Fields(s ...googleapi.Field) *InstanceGroupManagersListCall {
  46495. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  46496. return c
  46497. }
  46498. // IfNoneMatch sets the optional parameter which makes the operation
  46499. // fail if the object's ETag matches the given value. This is useful for
  46500. // getting updates only after the object has changed since the last
  46501. // request. Use googleapi.IsNotModified to check whether the response
  46502. // error from Do is the result of In-None-Match.
  46503. func (c *InstanceGroupManagersListCall) IfNoneMatch(entityTag string) *InstanceGroupManagersListCall {
  46504. c.ifNoneMatch_ = entityTag
  46505. return c
  46506. }
  46507. // Context sets the context to be used in this call's Do method. Any
  46508. // pending HTTP request will be aborted if the provided context is
  46509. // canceled.
  46510. func (c *InstanceGroupManagersListCall) Context(ctx context.Context) *InstanceGroupManagersListCall {
  46511. c.ctx_ = ctx
  46512. return c
  46513. }
  46514. // Header returns an http.Header that can be modified by the caller to
  46515. // add HTTP headers to the request.
  46516. func (c *InstanceGroupManagersListCall) Header() http.Header {
  46517. if c.header_ == nil {
  46518. c.header_ = make(http.Header)
  46519. }
  46520. return c.header_
  46521. }
  46522. func (c *InstanceGroupManagersListCall) doRequest(alt string) (*http.Response, error) {
  46523. reqHeaders := make(http.Header)
  46524. for k, v := range c.header_ {
  46525. reqHeaders[k] = v
  46526. }
  46527. reqHeaders.Set("User-Agent", c.s.userAgent())
  46528. if c.ifNoneMatch_ != "" {
  46529. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  46530. }
  46531. var body io.Reader = nil
  46532. c.urlParams_.Set("alt", alt)
  46533. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroupManagers")
  46534. urls += "?" + c.urlParams_.Encode()
  46535. req, _ := http.NewRequest("GET", urls, body)
  46536. req.Header = reqHeaders
  46537. googleapi.Expand(req.URL, map[string]string{
  46538. "project": c.project,
  46539. "zone": c.zone,
  46540. })
  46541. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  46542. }
  46543. // Do executes the "compute.instanceGroupManagers.list" call.
  46544. // Exactly one of *InstanceGroupManagerList or error will be non-nil.
  46545. // Any non-2xx status code is an error. Response headers are in either
  46546. // *InstanceGroupManagerList.ServerResponse.Header or (if a response was
  46547. // returned at all) in error.(*googleapi.Error).Header. Use
  46548. // googleapi.IsNotModified to check whether the returned error was
  46549. // because http.StatusNotModified was returned.
  46550. func (c *InstanceGroupManagersListCall) Do(opts ...googleapi.CallOption) (*InstanceGroupManagerList, error) {
  46551. gensupport.SetOptions(c.urlParams_, opts...)
  46552. res, err := c.doRequest("json")
  46553. if res != nil && res.StatusCode == http.StatusNotModified {
  46554. if res.Body != nil {
  46555. res.Body.Close()
  46556. }
  46557. return nil, &googleapi.Error{
  46558. Code: res.StatusCode,
  46559. Header: res.Header,
  46560. }
  46561. }
  46562. if err != nil {
  46563. return nil, err
  46564. }
  46565. defer googleapi.CloseBody(res)
  46566. if err := googleapi.CheckResponse(res); err != nil {
  46567. return nil, err
  46568. }
  46569. ret := &InstanceGroupManagerList{
  46570. ServerResponse: googleapi.ServerResponse{
  46571. Header: res.Header,
  46572. HTTPStatusCode: res.StatusCode,
  46573. },
  46574. }
  46575. target := &ret
  46576. if err := gensupport.DecodeResponse(target, res); err != nil {
  46577. return nil, err
  46578. }
  46579. return ret, nil
  46580. // {
  46581. // "description": "Retrieves a list of managed instance groups that are contained within the specified project and zone.",
  46582. // "httpMethod": "GET",
  46583. // "id": "compute.instanceGroupManagers.list",
  46584. // "parameterOrder": [
  46585. // "project",
  46586. // "zone"
  46587. // ],
  46588. // "parameters": {
  46589. // "filter": {
  46590. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  46591. // "location": "query",
  46592. // "type": "string"
  46593. // },
  46594. // "maxResults": {
  46595. // "default": "500",
  46596. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  46597. // "format": "uint32",
  46598. // "location": "query",
  46599. // "minimum": "0",
  46600. // "type": "integer"
  46601. // },
  46602. // "orderBy": {
  46603. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  46604. // "location": "query",
  46605. // "type": "string"
  46606. // },
  46607. // "pageToken": {
  46608. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  46609. // "location": "query",
  46610. // "type": "string"
  46611. // },
  46612. // "project": {
  46613. // "description": "Project ID for this request.",
  46614. // "location": "path",
  46615. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  46616. // "required": true,
  46617. // "type": "string"
  46618. // },
  46619. // "zone": {
  46620. // "description": "The name of the zone where the managed instance group is located.",
  46621. // "location": "path",
  46622. // "required": true,
  46623. // "type": "string"
  46624. // }
  46625. // },
  46626. // "path": "{project}/zones/{zone}/instanceGroupManagers",
  46627. // "response": {
  46628. // "$ref": "InstanceGroupManagerList"
  46629. // },
  46630. // "scopes": [
  46631. // "https://www.googleapis.com/auth/cloud-platform",
  46632. // "https://www.googleapis.com/auth/compute",
  46633. // "https://www.googleapis.com/auth/compute.readonly"
  46634. // ]
  46635. // }
  46636. }
  46637. // Pages invokes f for each page of results.
  46638. // A non-nil error returned from f will halt the iteration.
  46639. // The provided context supersedes any context provided to the Context method.
  46640. func (c *InstanceGroupManagersListCall) Pages(ctx context.Context, f func(*InstanceGroupManagerList) error) error {
  46641. c.ctx_ = ctx
  46642. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  46643. for {
  46644. x, err := c.Do()
  46645. if err != nil {
  46646. return err
  46647. }
  46648. if err := f(x); err != nil {
  46649. return err
  46650. }
  46651. if x.NextPageToken == "" {
  46652. return nil
  46653. }
  46654. c.PageToken(x.NextPageToken)
  46655. }
  46656. }
  46657. // method id "compute.instanceGroupManagers.listManagedInstances":
  46658. type InstanceGroupManagersListManagedInstancesCall struct {
  46659. s *Service
  46660. project string
  46661. zone string
  46662. instanceGroupManager string
  46663. urlParams_ gensupport.URLParams
  46664. ctx_ context.Context
  46665. header_ http.Header
  46666. }
  46667. // ListManagedInstances: Lists all of the instances in the managed
  46668. // instance group. Each instance in the list has a currentAction, which
  46669. // indicates the action that the managed instance group is performing on
  46670. // the instance. For example, if the group is still creating an
  46671. // instance, the currentAction is CREATING. If a previous action failed,
  46672. // the list displays the errors for that failed action.
  46673. func (r *InstanceGroupManagersService) ListManagedInstances(project string, zone string, instanceGroupManager string) *InstanceGroupManagersListManagedInstancesCall {
  46674. c := &InstanceGroupManagersListManagedInstancesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  46675. c.project = project
  46676. c.zone = zone
  46677. c.instanceGroupManager = instanceGroupManager
  46678. return c
  46679. }
  46680. // Filter sets the optional parameter "filter":
  46681. func (c *InstanceGroupManagersListManagedInstancesCall) Filter(filter string) *InstanceGroupManagersListManagedInstancesCall {
  46682. c.urlParams_.Set("filter", filter)
  46683. return c
  46684. }
  46685. // MaxResults sets the optional parameter "maxResults":
  46686. func (c *InstanceGroupManagersListManagedInstancesCall) MaxResults(maxResults int64) *InstanceGroupManagersListManagedInstancesCall {
  46687. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  46688. return c
  46689. }
  46690. // OrderBy sets the optional parameter "order_by":
  46691. func (c *InstanceGroupManagersListManagedInstancesCall) OrderBy(orderBy string) *InstanceGroupManagersListManagedInstancesCall {
  46692. c.urlParams_.Set("order_by", orderBy)
  46693. return c
  46694. }
  46695. // PageToken sets the optional parameter "pageToken":
  46696. func (c *InstanceGroupManagersListManagedInstancesCall) PageToken(pageToken string) *InstanceGroupManagersListManagedInstancesCall {
  46697. c.urlParams_.Set("pageToken", pageToken)
  46698. return c
  46699. }
  46700. // Fields allows partial responses to be retrieved. See
  46701. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  46702. // for more information.
  46703. func (c *InstanceGroupManagersListManagedInstancesCall) Fields(s ...googleapi.Field) *InstanceGroupManagersListManagedInstancesCall {
  46704. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  46705. return c
  46706. }
  46707. // Context sets the context to be used in this call's Do method. Any
  46708. // pending HTTP request will be aborted if the provided context is
  46709. // canceled.
  46710. func (c *InstanceGroupManagersListManagedInstancesCall) Context(ctx context.Context) *InstanceGroupManagersListManagedInstancesCall {
  46711. c.ctx_ = ctx
  46712. return c
  46713. }
  46714. // Header returns an http.Header that can be modified by the caller to
  46715. // add HTTP headers to the request.
  46716. func (c *InstanceGroupManagersListManagedInstancesCall) Header() http.Header {
  46717. if c.header_ == nil {
  46718. c.header_ = make(http.Header)
  46719. }
  46720. return c.header_
  46721. }
  46722. func (c *InstanceGroupManagersListManagedInstancesCall) doRequest(alt string) (*http.Response, error) {
  46723. reqHeaders := make(http.Header)
  46724. for k, v := range c.header_ {
  46725. reqHeaders[k] = v
  46726. }
  46727. reqHeaders.Set("User-Agent", c.s.userAgent())
  46728. var body io.Reader = nil
  46729. c.urlParams_.Set("alt", alt)
  46730. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/listManagedInstances")
  46731. urls += "?" + c.urlParams_.Encode()
  46732. req, _ := http.NewRequest("POST", urls, body)
  46733. req.Header = reqHeaders
  46734. googleapi.Expand(req.URL, map[string]string{
  46735. "project": c.project,
  46736. "zone": c.zone,
  46737. "instanceGroupManager": c.instanceGroupManager,
  46738. })
  46739. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  46740. }
  46741. // Do executes the "compute.instanceGroupManagers.listManagedInstances" call.
  46742. // Exactly one of *InstanceGroupManagersListManagedInstancesResponse or
  46743. // error will be non-nil. Any non-2xx status code is an error. Response
  46744. // headers are in either
  46745. // *InstanceGroupManagersListManagedInstancesResponse.ServerResponse.Head
  46746. // er or (if a response was returned at all) in
  46747. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  46748. // whether the returned error was because http.StatusNotModified was
  46749. // returned.
  46750. func (c *InstanceGroupManagersListManagedInstancesCall) Do(opts ...googleapi.CallOption) (*InstanceGroupManagersListManagedInstancesResponse, error) {
  46751. gensupport.SetOptions(c.urlParams_, opts...)
  46752. res, err := c.doRequest("json")
  46753. if res != nil && res.StatusCode == http.StatusNotModified {
  46754. if res.Body != nil {
  46755. res.Body.Close()
  46756. }
  46757. return nil, &googleapi.Error{
  46758. Code: res.StatusCode,
  46759. Header: res.Header,
  46760. }
  46761. }
  46762. if err != nil {
  46763. return nil, err
  46764. }
  46765. defer googleapi.CloseBody(res)
  46766. if err := googleapi.CheckResponse(res); err != nil {
  46767. return nil, err
  46768. }
  46769. ret := &InstanceGroupManagersListManagedInstancesResponse{
  46770. ServerResponse: googleapi.ServerResponse{
  46771. Header: res.Header,
  46772. HTTPStatusCode: res.StatusCode,
  46773. },
  46774. }
  46775. target := &ret
  46776. if err := gensupport.DecodeResponse(target, res); err != nil {
  46777. return nil, err
  46778. }
  46779. return ret, nil
  46780. // {
  46781. // "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.",
  46782. // "httpMethod": "POST",
  46783. // "id": "compute.instanceGroupManagers.listManagedInstances",
  46784. // "parameterOrder": [
  46785. // "project",
  46786. // "zone",
  46787. // "instanceGroupManager"
  46788. // ],
  46789. // "parameters": {
  46790. // "filter": {
  46791. // "location": "query",
  46792. // "type": "string"
  46793. // },
  46794. // "instanceGroupManager": {
  46795. // "description": "The name of the managed instance group.",
  46796. // "location": "path",
  46797. // "required": true,
  46798. // "type": "string"
  46799. // },
  46800. // "maxResults": {
  46801. // "default": "500",
  46802. // "format": "uint32",
  46803. // "location": "query",
  46804. // "minimum": "0",
  46805. // "type": "integer"
  46806. // },
  46807. // "order_by": {
  46808. // "location": "query",
  46809. // "type": "string"
  46810. // },
  46811. // "pageToken": {
  46812. // "location": "query",
  46813. // "type": "string"
  46814. // },
  46815. // "project": {
  46816. // "description": "Project ID for this request.",
  46817. // "location": "path",
  46818. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  46819. // "required": true,
  46820. // "type": "string"
  46821. // },
  46822. // "zone": {
  46823. // "description": "The name of the zone where the managed instance group is located.",
  46824. // "location": "path",
  46825. // "required": true,
  46826. // "type": "string"
  46827. // }
  46828. // },
  46829. // "path": "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/listManagedInstances",
  46830. // "response": {
  46831. // "$ref": "InstanceGroupManagersListManagedInstancesResponse"
  46832. // },
  46833. // "scopes": [
  46834. // "https://www.googleapis.com/auth/cloud-platform",
  46835. // "https://www.googleapis.com/auth/compute",
  46836. // "https://www.googleapis.com/auth/compute.readonly"
  46837. // ]
  46838. // }
  46839. }
  46840. // Pages invokes f for each page of results.
  46841. // A non-nil error returned from f will halt the iteration.
  46842. // The provided context supersedes any context provided to the Context method.
  46843. func (c *InstanceGroupManagersListManagedInstancesCall) Pages(ctx context.Context, f func(*InstanceGroupManagersListManagedInstancesResponse) error) error {
  46844. c.ctx_ = ctx
  46845. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  46846. for {
  46847. x, err := c.Do()
  46848. if err != nil {
  46849. return err
  46850. }
  46851. if err := f(x); err != nil {
  46852. return err
  46853. }
  46854. if x.NextPageToken == "" {
  46855. return nil
  46856. }
  46857. c.PageToken(x.NextPageToken)
  46858. }
  46859. }
  46860. // method id "compute.instanceGroupManagers.patch":
  46861. type InstanceGroupManagersPatchCall struct {
  46862. s *Service
  46863. project string
  46864. zone string
  46865. instanceGroupManager string
  46866. instancegroupmanager *InstanceGroupManager
  46867. urlParams_ gensupport.URLParams
  46868. ctx_ context.Context
  46869. header_ http.Header
  46870. }
  46871. // Patch: Updates a managed instance group using the information that
  46872. // you specify in the request. This operation is marked as DONE when the
  46873. // group is patched even if the instances in the group are still in the
  46874. // process of being patched. You must separately verify the status of
  46875. // the individual instances with the listManagedInstances method. This
  46876. // method supports PATCH semantics and uses the JSON merge patch format
  46877. // and processing rules.
  46878. func (r *InstanceGroupManagersService) Patch(project string, zone string, instanceGroupManager string, instancegroupmanager *InstanceGroupManager) *InstanceGroupManagersPatchCall {
  46879. c := &InstanceGroupManagersPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  46880. c.project = project
  46881. c.zone = zone
  46882. c.instanceGroupManager = instanceGroupManager
  46883. c.instancegroupmanager = instancegroupmanager
  46884. return c
  46885. }
  46886. // RequestId sets the optional parameter "requestId": An optional
  46887. // request ID to identify requests. Specify a unique request ID so that
  46888. // if you must retry your request, the server will know to ignore the
  46889. // request if it has already been completed.
  46890. //
  46891. // For example, consider a situation where you make an initial request
  46892. // and the request times out. If you make the request again with the
  46893. // same request ID, the server can check if original operation with the
  46894. // same request ID was received, and if so, will ignore the second
  46895. // request. This prevents clients from accidentally creating duplicate
  46896. // commitments.
  46897. //
  46898. // The request ID must be a valid UUID with the exception that zero UUID
  46899. // is not supported (00000000-0000-0000-0000-000000000000).
  46900. func (c *InstanceGroupManagersPatchCall) RequestId(requestId string) *InstanceGroupManagersPatchCall {
  46901. c.urlParams_.Set("requestId", requestId)
  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 *InstanceGroupManagersPatchCall) Fields(s ...googleapi.Field) *InstanceGroupManagersPatchCall {
  46908. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  46909. return c
  46910. }
  46911. // Context sets the context to be used in this call's Do method. Any
  46912. // pending HTTP request will be aborted if the provided context is
  46913. // canceled.
  46914. func (c *InstanceGroupManagersPatchCall) Context(ctx context.Context) *InstanceGroupManagersPatchCall {
  46915. c.ctx_ = ctx
  46916. return c
  46917. }
  46918. // Header returns an http.Header that can be modified by the caller to
  46919. // add HTTP headers to the request.
  46920. func (c *InstanceGroupManagersPatchCall) Header() http.Header {
  46921. if c.header_ == nil {
  46922. c.header_ = make(http.Header)
  46923. }
  46924. return c.header_
  46925. }
  46926. func (c *InstanceGroupManagersPatchCall) doRequest(alt string) (*http.Response, error) {
  46927. reqHeaders := make(http.Header)
  46928. for k, v := range c.header_ {
  46929. reqHeaders[k] = v
  46930. }
  46931. reqHeaders.Set("User-Agent", c.s.userAgent())
  46932. var body io.Reader = nil
  46933. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupmanager)
  46934. if err != nil {
  46935. return nil, err
  46936. }
  46937. reqHeaders.Set("Content-Type", "application/json")
  46938. c.urlParams_.Set("alt", alt)
  46939. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}")
  46940. urls += "?" + c.urlParams_.Encode()
  46941. req, _ := http.NewRequest("PATCH", urls, body)
  46942. req.Header = reqHeaders
  46943. googleapi.Expand(req.URL, map[string]string{
  46944. "project": c.project,
  46945. "zone": c.zone,
  46946. "instanceGroupManager": c.instanceGroupManager,
  46947. })
  46948. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  46949. }
  46950. // Do executes the "compute.instanceGroupManagers.patch" call.
  46951. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  46952. // status code is an error. Response headers are in either
  46953. // *Operation.ServerResponse.Header or (if a response was returned at
  46954. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  46955. // to check whether the returned error was because
  46956. // http.StatusNotModified was returned.
  46957. func (c *InstanceGroupManagersPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  46958. gensupport.SetOptions(c.urlParams_, opts...)
  46959. res, err := c.doRequest("json")
  46960. if res != nil && res.StatusCode == http.StatusNotModified {
  46961. if res.Body != nil {
  46962. res.Body.Close()
  46963. }
  46964. return nil, &googleapi.Error{
  46965. Code: res.StatusCode,
  46966. Header: res.Header,
  46967. }
  46968. }
  46969. if err != nil {
  46970. return nil, err
  46971. }
  46972. defer googleapi.CloseBody(res)
  46973. if err := googleapi.CheckResponse(res); err != nil {
  46974. return nil, err
  46975. }
  46976. ret := &Operation{
  46977. ServerResponse: googleapi.ServerResponse{
  46978. Header: res.Header,
  46979. HTTPStatusCode: res.StatusCode,
  46980. },
  46981. }
  46982. target := &ret
  46983. if err := gensupport.DecodeResponse(target, res); err != nil {
  46984. return nil, err
  46985. }
  46986. return ret, nil
  46987. // {
  46988. // "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.",
  46989. // "httpMethod": "PATCH",
  46990. // "id": "compute.instanceGroupManagers.patch",
  46991. // "parameterOrder": [
  46992. // "project",
  46993. // "zone",
  46994. // "instanceGroupManager"
  46995. // ],
  46996. // "parameters": {
  46997. // "instanceGroupManager": {
  46998. // "description": "The name of the instance group manager.",
  46999. // "location": "path",
  47000. // "required": true,
  47001. // "type": "string"
  47002. // },
  47003. // "project": {
  47004. // "description": "Project ID for this request.",
  47005. // "location": "path",
  47006. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  47007. // "required": true,
  47008. // "type": "string"
  47009. // },
  47010. // "requestId": {
  47011. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  47012. // "location": "query",
  47013. // "type": "string"
  47014. // },
  47015. // "zone": {
  47016. // "description": "The name of the zone where you want to create the managed instance group.",
  47017. // "location": "path",
  47018. // "required": true,
  47019. // "type": "string"
  47020. // }
  47021. // },
  47022. // "path": "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}",
  47023. // "request": {
  47024. // "$ref": "InstanceGroupManager"
  47025. // },
  47026. // "response": {
  47027. // "$ref": "Operation"
  47028. // },
  47029. // "scopes": [
  47030. // "https://www.googleapis.com/auth/cloud-platform",
  47031. // "https://www.googleapis.com/auth/compute"
  47032. // ]
  47033. // }
  47034. }
  47035. // method id "compute.instanceGroupManagers.recreateInstances":
  47036. type InstanceGroupManagersRecreateInstancesCall struct {
  47037. s *Service
  47038. project string
  47039. zone string
  47040. instanceGroupManager string
  47041. instancegroupmanagersrecreateinstancesrequest *InstanceGroupManagersRecreateInstancesRequest
  47042. urlParams_ gensupport.URLParams
  47043. ctx_ context.Context
  47044. header_ http.Header
  47045. }
  47046. // RecreateInstances: Schedules a group action to recreate the specified
  47047. // instances in the managed instance group. The instances are deleted
  47048. // and recreated using the current instance template for the managed
  47049. // instance group. This operation is marked as DONE when the action is
  47050. // scheduled even if the instances have not yet been recreated. You must
  47051. // separately verify the status of the recreating action with the
  47052. // listmanagedinstances method.
  47053. //
  47054. // If the group is part of a backend service that has enabled connection
  47055. // draining, it can take up to 60 seconds after the connection draining
  47056. // duration has elapsed before the VM instance is removed or
  47057. // deleted.
  47058. //
  47059. // You can specify a maximum of 1000 instances with this method per
  47060. // request.
  47061. func (r *InstanceGroupManagersService) RecreateInstances(project string, zone string, instanceGroupManager string, instancegroupmanagersrecreateinstancesrequest *InstanceGroupManagersRecreateInstancesRequest) *InstanceGroupManagersRecreateInstancesCall {
  47062. c := &InstanceGroupManagersRecreateInstancesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  47063. c.project = project
  47064. c.zone = zone
  47065. c.instanceGroupManager = instanceGroupManager
  47066. c.instancegroupmanagersrecreateinstancesrequest = instancegroupmanagersrecreateinstancesrequest
  47067. return c
  47068. }
  47069. // RequestId sets the optional parameter "requestId": An optional
  47070. // request ID to identify requests. Specify a unique request ID so that
  47071. // if you must retry your request, the server will know to ignore the
  47072. // request if it has already been completed.
  47073. //
  47074. // For example, consider a situation where you make an initial request
  47075. // and the request times out. If you make the request again with the
  47076. // same request ID, the server can check if original operation with the
  47077. // same request ID was received, and if so, will ignore the second
  47078. // request. This prevents clients from accidentally creating duplicate
  47079. // commitments.
  47080. //
  47081. // The request ID must be a valid UUID with the exception that zero UUID
  47082. // is not supported (00000000-0000-0000-0000-000000000000).
  47083. func (c *InstanceGroupManagersRecreateInstancesCall) RequestId(requestId string) *InstanceGroupManagersRecreateInstancesCall {
  47084. c.urlParams_.Set("requestId", requestId)
  47085. return c
  47086. }
  47087. // Fields allows partial responses to be retrieved. See
  47088. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  47089. // for more information.
  47090. func (c *InstanceGroupManagersRecreateInstancesCall) Fields(s ...googleapi.Field) *InstanceGroupManagersRecreateInstancesCall {
  47091. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  47092. return c
  47093. }
  47094. // Context sets the context to be used in this call's Do method. Any
  47095. // pending HTTP request will be aborted if the provided context is
  47096. // canceled.
  47097. func (c *InstanceGroupManagersRecreateInstancesCall) Context(ctx context.Context) *InstanceGroupManagersRecreateInstancesCall {
  47098. c.ctx_ = ctx
  47099. return c
  47100. }
  47101. // Header returns an http.Header that can be modified by the caller to
  47102. // add HTTP headers to the request.
  47103. func (c *InstanceGroupManagersRecreateInstancesCall) Header() http.Header {
  47104. if c.header_ == nil {
  47105. c.header_ = make(http.Header)
  47106. }
  47107. return c.header_
  47108. }
  47109. func (c *InstanceGroupManagersRecreateInstancesCall) doRequest(alt string) (*http.Response, error) {
  47110. reqHeaders := make(http.Header)
  47111. for k, v := range c.header_ {
  47112. reqHeaders[k] = v
  47113. }
  47114. reqHeaders.Set("User-Agent", c.s.userAgent())
  47115. var body io.Reader = nil
  47116. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupmanagersrecreateinstancesrequest)
  47117. if err != nil {
  47118. return nil, err
  47119. }
  47120. reqHeaders.Set("Content-Type", "application/json")
  47121. c.urlParams_.Set("alt", alt)
  47122. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/recreateInstances")
  47123. urls += "?" + c.urlParams_.Encode()
  47124. req, _ := http.NewRequest("POST", urls, body)
  47125. req.Header = reqHeaders
  47126. googleapi.Expand(req.URL, map[string]string{
  47127. "project": c.project,
  47128. "zone": c.zone,
  47129. "instanceGroupManager": c.instanceGroupManager,
  47130. })
  47131. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  47132. }
  47133. // Do executes the "compute.instanceGroupManagers.recreateInstances" call.
  47134. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  47135. // status code is an error. Response headers are in either
  47136. // *Operation.ServerResponse.Header or (if a response was returned at
  47137. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  47138. // to check whether the returned error was because
  47139. // http.StatusNotModified was returned.
  47140. func (c *InstanceGroupManagersRecreateInstancesCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  47141. gensupport.SetOptions(c.urlParams_, opts...)
  47142. res, err := c.doRequest("json")
  47143. if res != nil && res.StatusCode == http.StatusNotModified {
  47144. if res.Body != nil {
  47145. res.Body.Close()
  47146. }
  47147. return nil, &googleapi.Error{
  47148. Code: res.StatusCode,
  47149. Header: res.Header,
  47150. }
  47151. }
  47152. if err != nil {
  47153. return nil, err
  47154. }
  47155. defer googleapi.CloseBody(res)
  47156. if err := googleapi.CheckResponse(res); err != nil {
  47157. return nil, err
  47158. }
  47159. ret := &Operation{
  47160. ServerResponse: googleapi.ServerResponse{
  47161. Header: res.Header,
  47162. HTTPStatusCode: res.StatusCode,
  47163. },
  47164. }
  47165. target := &ret
  47166. if err := gensupport.DecodeResponse(target, res); err != nil {
  47167. return nil, err
  47168. }
  47169. return ret, nil
  47170. // {
  47171. // "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.",
  47172. // "httpMethod": "POST",
  47173. // "id": "compute.instanceGroupManagers.recreateInstances",
  47174. // "parameterOrder": [
  47175. // "project",
  47176. // "zone",
  47177. // "instanceGroupManager"
  47178. // ],
  47179. // "parameters": {
  47180. // "instanceGroupManager": {
  47181. // "description": "The name of the managed instance group.",
  47182. // "location": "path",
  47183. // "required": true,
  47184. // "type": "string"
  47185. // },
  47186. // "project": {
  47187. // "description": "Project ID for this request.",
  47188. // "location": "path",
  47189. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  47190. // "required": true,
  47191. // "type": "string"
  47192. // },
  47193. // "requestId": {
  47194. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  47195. // "location": "query",
  47196. // "type": "string"
  47197. // },
  47198. // "zone": {
  47199. // "description": "The name of the zone where the managed instance group is located.",
  47200. // "location": "path",
  47201. // "required": true,
  47202. // "type": "string"
  47203. // }
  47204. // },
  47205. // "path": "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/recreateInstances",
  47206. // "request": {
  47207. // "$ref": "InstanceGroupManagersRecreateInstancesRequest"
  47208. // },
  47209. // "response": {
  47210. // "$ref": "Operation"
  47211. // },
  47212. // "scopes": [
  47213. // "https://www.googleapis.com/auth/cloud-platform",
  47214. // "https://www.googleapis.com/auth/compute"
  47215. // ]
  47216. // }
  47217. }
  47218. // method id "compute.instanceGroupManagers.resize":
  47219. type InstanceGroupManagersResizeCall struct {
  47220. s *Service
  47221. project string
  47222. zone string
  47223. instanceGroupManager string
  47224. urlParams_ gensupport.URLParams
  47225. ctx_ context.Context
  47226. header_ http.Header
  47227. }
  47228. // Resize: Resizes the managed instance group. If you increase the size,
  47229. // the group creates new instances using the current instance template.
  47230. // If you decrease the size, the group deletes instances. The resize
  47231. // operation is marked DONE when the resize actions are scheduled even
  47232. // if the group has not yet added or deleted any instances. You must
  47233. // separately verify the status of the creating or deleting actions with
  47234. // the listmanagedinstances method.
  47235. //
  47236. // If the group is part of a backend service that has enabled connection
  47237. // draining, it can take up to 60 seconds after the connection draining
  47238. // duration has elapsed before the VM instance is removed or deleted.
  47239. func (r *InstanceGroupManagersService) Resize(project string, zone string, instanceGroupManager string, size int64) *InstanceGroupManagersResizeCall {
  47240. c := &InstanceGroupManagersResizeCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  47241. c.project = project
  47242. c.zone = zone
  47243. c.instanceGroupManager = instanceGroupManager
  47244. c.urlParams_.Set("size", fmt.Sprint(size))
  47245. return c
  47246. }
  47247. // RequestId sets the optional parameter "requestId": An optional
  47248. // request ID to identify requests. Specify a unique request ID so that
  47249. // if you must retry your request, the server will know to ignore the
  47250. // request if it has already been completed.
  47251. //
  47252. // For example, consider a situation where you make an initial request
  47253. // and the request times out. If you make the request again with the
  47254. // same request ID, the server can check if original operation with the
  47255. // same request ID was received, and if so, will ignore the second
  47256. // request. This prevents clients from accidentally creating duplicate
  47257. // commitments.
  47258. //
  47259. // The request ID must be a valid UUID with the exception that zero UUID
  47260. // is not supported (00000000-0000-0000-0000-000000000000).
  47261. func (c *InstanceGroupManagersResizeCall) RequestId(requestId string) *InstanceGroupManagersResizeCall {
  47262. c.urlParams_.Set("requestId", requestId)
  47263. return c
  47264. }
  47265. // Fields allows partial responses to be retrieved. See
  47266. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  47267. // for more information.
  47268. func (c *InstanceGroupManagersResizeCall) Fields(s ...googleapi.Field) *InstanceGroupManagersResizeCall {
  47269. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  47270. return c
  47271. }
  47272. // Context sets the context to be used in this call's Do method. Any
  47273. // pending HTTP request will be aborted if the provided context is
  47274. // canceled.
  47275. func (c *InstanceGroupManagersResizeCall) Context(ctx context.Context) *InstanceGroupManagersResizeCall {
  47276. c.ctx_ = ctx
  47277. return c
  47278. }
  47279. // Header returns an http.Header that can be modified by the caller to
  47280. // add HTTP headers to the request.
  47281. func (c *InstanceGroupManagersResizeCall) Header() http.Header {
  47282. if c.header_ == nil {
  47283. c.header_ = make(http.Header)
  47284. }
  47285. return c.header_
  47286. }
  47287. func (c *InstanceGroupManagersResizeCall) doRequest(alt string) (*http.Response, error) {
  47288. reqHeaders := make(http.Header)
  47289. for k, v := range c.header_ {
  47290. reqHeaders[k] = v
  47291. }
  47292. reqHeaders.Set("User-Agent", c.s.userAgent())
  47293. var body io.Reader = nil
  47294. c.urlParams_.Set("alt", alt)
  47295. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/resize")
  47296. urls += "?" + c.urlParams_.Encode()
  47297. req, _ := http.NewRequest("POST", urls, body)
  47298. req.Header = reqHeaders
  47299. googleapi.Expand(req.URL, map[string]string{
  47300. "project": c.project,
  47301. "zone": c.zone,
  47302. "instanceGroupManager": c.instanceGroupManager,
  47303. })
  47304. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  47305. }
  47306. // Do executes the "compute.instanceGroupManagers.resize" call.
  47307. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  47308. // status code is an error. Response headers are in either
  47309. // *Operation.ServerResponse.Header or (if a response was returned at
  47310. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  47311. // to check whether the returned error was because
  47312. // http.StatusNotModified was returned.
  47313. func (c *InstanceGroupManagersResizeCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  47314. gensupport.SetOptions(c.urlParams_, opts...)
  47315. res, err := c.doRequest("json")
  47316. if res != nil && res.StatusCode == http.StatusNotModified {
  47317. if res.Body != nil {
  47318. res.Body.Close()
  47319. }
  47320. return nil, &googleapi.Error{
  47321. Code: res.StatusCode,
  47322. Header: res.Header,
  47323. }
  47324. }
  47325. if err != nil {
  47326. return nil, err
  47327. }
  47328. defer googleapi.CloseBody(res)
  47329. if err := googleapi.CheckResponse(res); err != nil {
  47330. return nil, err
  47331. }
  47332. ret := &Operation{
  47333. ServerResponse: googleapi.ServerResponse{
  47334. Header: res.Header,
  47335. HTTPStatusCode: res.StatusCode,
  47336. },
  47337. }
  47338. target := &ret
  47339. if err := gensupport.DecodeResponse(target, res); err != nil {
  47340. return nil, err
  47341. }
  47342. return ret, nil
  47343. // {
  47344. // "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.",
  47345. // "httpMethod": "POST",
  47346. // "id": "compute.instanceGroupManagers.resize",
  47347. // "parameterOrder": [
  47348. // "project",
  47349. // "zone",
  47350. // "instanceGroupManager",
  47351. // "size"
  47352. // ],
  47353. // "parameters": {
  47354. // "instanceGroupManager": {
  47355. // "description": "The name of the managed instance group.",
  47356. // "location": "path",
  47357. // "required": true,
  47358. // "type": "string"
  47359. // },
  47360. // "project": {
  47361. // "description": "Project ID for this request.",
  47362. // "location": "path",
  47363. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  47364. // "required": true,
  47365. // "type": "string"
  47366. // },
  47367. // "requestId": {
  47368. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  47369. // "location": "query",
  47370. // "type": "string"
  47371. // },
  47372. // "size": {
  47373. // "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.",
  47374. // "format": "int32",
  47375. // "location": "query",
  47376. // "required": true,
  47377. // "type": "integer"
  47378. // },
  47379. // "zone": {
  47380. // "description": "The name of the zone where the managed instance group is located.",
  47381. // "location": "path",
  47382. // "required": true,
  47383. // "type": "string"
  47384. // }
  47385. // },
  47386. // "path": "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/resize",
  47387. // "response": {
  47388. // "$ref": "Operation"
  47389. // },
  47390. // "scopes": [
  47391. // "https://www.googleapis.com/auth/cloud-platform",
  47392. // "https://www.googleapis.com/auth/compute"
  47393. // ]
  47394. // }
  47395. }
  47396. // method id "compute.instanceGroupManagers.resizeAdvanced":
  47397. type InstanceGroupManagersResizeAdvancedCall struct {
  47398. s *Service
  47399. project string
  47400. zone string
  47401. instanceGroupManager string
  47402. instancegroupmanagersresizeadvancedrequest *InstanceGroupManagersResizeAdvancedRequest
  47403. urlParams_ gensupport.URLParams
  47404. ctx_ context.Context
  47405. header_ http.Header
  47406. }
  47407. // ResizeAdvanced: Resizes the managed instance group with advanced
  47408. // configuration options like disabling creation retries. This is an
  47409. // extended version of the resize method.
  47410. //
  47411. // If you increase the size of the instance group, the group creates new
  47412. // instances using the current instance template. If you decrease the
  47413. // size, the group deletes instances. The resize operation is marked
  47414. // DONE when the resize actions are scheduled even if the group has not
  47415. // yet added or deleted any instances. You must separately verify the
  47416. // status of the creating, creatingWithoutRetries, or deleting actions
  47417. // with the get or listmanagedinstances method.
  47418. //
  47419. // If the group is part of a backend service that has enabled connection
  47420. // draining, it can take up to 60 seconds after the connection draining
  47421. // duration has elapsed before the VM instance is removed or deleted.
  47422. func (r *InstanceGroupManagersService) ResizeAdvanced(project string, zone string, instanceGroupManager string, instancegroupmanagersresizeadvancedrequest *InstanceGroupManagersResizeAdvancedRequest) *InstanceGroupManagersResizeAdvancedCall {
  47423. c := &InstanceGroupManagersResizeAdvancedCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  47424. c.project = project
  47425. c.zone = zone
  47426. c.instanceGroupManager = instanceGroupManager
  47427. c.instancegroupmanagersresizeadvancedrequest = instancegroupmanagersresizeadvancedrequest
  47428. return c
  47429. }
  47430. // RequestId sets the optional parameter "requestId": An optional
  47431. // request ID to identify requests. Specify a unique request ID so that
  47432. // if you must retry your request, the server will know to ignore the
  47433. // request if it has already been completed.
  47434. //
  47435. // For example, consider a situation where you make an initial request
  47436. // and the request times out. If you make the request again with the
  47437. // same request ID, the server can check if original operation with the
  47438. // same request ID was received, and if so, will ignore the second
  47439. // request. This prevents clients from accidentally creating duplicate
  47440. // commitments.
  47441. //
  47442. // The request ID must be a valid UUID with the exception that zero UUID
  47443. // is not supported (00000000-0000-0000-0000-000000000000).
  47444. func (c *InstanceGroupManagersResizeAdvancedCall) RequestId(requestId string) *InstanceGroupManagersResizeAdvancedCall {
  47445. c.urlParams_.Set("requestId", requestId)
  47446. return c
  47447. }
  47448. // Fields allows partial responses to be retrieved. See
  47449. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  47450. // for more information.
  47451. func (c *InstanceGroupManagersResizeAdvancedCall) Fields(s ...googleapi.Field) *InstanceGroupManagersResizeAdvancedCall {
  47452. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  47453. return c
  47454. }
  47455. // Context sets the context to be used in this call's Do method. Any
  47456. // pending HTTP request will be aborted if the provided context is
  47457. // canceled.
  47458. func (c *InstanceGroupManagersResizeAdvancedCall) Context(ctx context.Context) *InstanceGroupManagersResizeAdvancedCall {
  47459. c.ctx_ = ctx
  47460. return c
  47461. }
  47462. // Header returns an http.Header that can be modified by the caller to
  47463. // add HTTP headers to the request.
  47464. func (c *InstanceGroupManagersResizeAdvancedCall) Header() http.Header {
  47465. if c.header_ == nil {
  47466. c.header_ = make(http.Header)
  47467. }
  47468. return c.header_
  47469. }
  47470. func (c *InstanceGroupManagersResizeAdvancedCall) doRequest(alt string) (*http.Response, error) {
  47471. reqHeaders := make(http.Header)
  47472. for k, v := range c.header_ {
  47473. reqHeaders[k] = v
  47474. }
  47475. reqHeaders.Set("User-Agent", c.s.userAgent())
  47476. var body io.Reader = nil
  47477. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupmanagersresizeadvancedrequest)
  47478. if err != nil {
  47479. return nil, err
  47480. }
  47481. reqHeaders.Set("Content-Type", "application/json")
  47482. c.urlParams_.Set("alt", alt)
  47483. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/resizeAdvanced")
  47484. urls += "?" + c.urlParams_.Encode()
  47485. req, _ := http.NewRequest("POST", urls, body)
  47486. req.Header = reqHeaders
  47487. googleapi.Expand(req.URL, map[string]string{
  47488. "project": c.project,
  47489. "zone": c.zone,
  47490. "instanceGroupManager": c.instanceGroupManager,
  47491. })
  47492. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  47493. }
  47494. // Do executes the "compute.instanceGroupManagers.resizeAdvanced" call.
  47495. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  47496. // status code is an error. Response headers are in either
  47497. // *Operation.ServerResponse.Header or (if a response was returned at
  47498. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  47499. // to check whether the returned error was because
  47500. // http.StatusNotModified was returned.
  47501. func (c *InstanceGroupManagersResizeAdvancedCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  47502. gensupport.SetOptions(c.urlParams_, opts...)
  47503. res, err := c.doRequest("json")
  47504. if res != nil && res.StatusCode == http.StatusNotModified {
  47505. if res.Body != nil {
  47506. res.Body.Close()
  47507. }
  47508. return nil, &googleapi.Error{
  47509. Code: res.StatusCode,
  47510. Header: res.Header,
  47511. }
  47512. }
  47513. if err != nil {
  47514. return nil, err
  47515. }
  47516. defer googleapi.CloseBody(res)
  47517. if err := googleapi.CheckResponse(res); err != nil {
  47518. return nil, err
  47519. }
  47520. ret := &Operation{
  47521. ServerResponse: googleapi.ServerResponse{
  47522. Header: res.Header,
  47523. HTTPStatusCode: res.StatusCode,
  47524. },
  47525. }
  47526. target := &ret
  47527. if err := gensupport.DecodeResponse(target, res); err != nil {
  47528. return nil, err
  47529. }
  47530. return ret, nil
  47531. // {
  47532. // "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.",
  47533. // "httpMethod": "POST",
  47534. // "id": "compute.instanceGroupManagers.resizeAdvanced",
  47535. // "parameterOrder": [
  47536. // "project",
  47537. // "zone",
  47538. // "instanceGroupManager"
  47539. // ],
  47540. // "parameters": {
  47541. // "instanceGroupManager": {
  47542. // "description": "The name of the managed instance group.",
  47543. // "location": "path",
  47544. // "required": true,
  47545. // "type": "string"
  47546. // },
  47547. // "project": {
  47548. // "description": "Project ID for this request.",
  47549. // "location": "path",
  47550. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  47551. // "required": true,
  47552. // "type": "string"
  47553. // },
  47554. // "requestId": {
  47555. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  47556. // "location": "query",
  47557. // "type": "string"
  47558. // },
  47559. // "zone": {
  47560. // "description": "The name of the zone where the managed instance group is located.",
  47561. // "location": "path",
  47562. // "required": true,
  47563. // "type": "string"
  47564. // }
  47565. // },
  47566. // "path": "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/resizeAdvanced",
  47567. // "request": {
  47568. // "$ref": "InstanceGroupManagersResizeAdvancedRequest"
  47569. // },
  47570. // "response": {
  47571. // "$ref": "Operation"
  47572. // },
  47573. // "scopes": [
  47574. // "https://www.googleapis.com/auth/cloud-platform",
  47575. // "https://www.googleapis.com/auth/compute"
  47576. // ]
  47577. // }
  47578. }
  47579. // method id "compute.instanceGroupManagers.setAutoHealingPolicies":
  47580. type InstanceGroupManagersSetAutoHealingPoliciesCall struct {
  47581. s *Service
  47582. project string
  47583. zone string
  47584. instanceGroupManager string
  47585. instancegroupmanagerssetautohealingrequest *InstanceGroupManagersSetAutoHealingRequest
  47586. urlParams_ gensupport.URLParams
  47587. ctx_ context.Context
  47588. header_ http.Header
  47589. }
  47590. // SetAutoHealingPolicies: Modifies the autohealing policies.
  47591. func (r *InstanceGroupManagersService) SetAutoHealingPolicies(project string, zone string, instanceGroupManager string, instancegroupmanagerssetautohealingrequest *InstanceGroupManagersSetAutoHealingRequest) *InstanceGroupManagersSetAutoHealingPoliciesCall {
  47592. c := &InstanceGroupManagersSetAutoHealingPoliciesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  47593. c.project = project
  47594. c.zone = zone
  47595. c.instanceGroupManager = instanceGroupManager
  47596. c.instancegroupmanagerssetautohealingrequest = instancegroupmanagerssetautohealingrequest
  47597. return c
  47598. }
  47599. // RequestId sets the optional parameter "requestId": An optional
  47600. // request ID to identify requests. Specify a unique request ID so that
  47601. // if you must retry your request, the server will know to ignore the
  47602. // request if it has already been completed.
  47603. //
  47604. // For example, consider a situation where you make an initial request
  47605. // and the request times out. If you make the request again with the
  47606. // same request ID, the server can check if original operation with the
  47607. // same request ID was received, and if so, will ignore the second
  47608. // request. This prevents clients from accidentally creating duplicate
  47609. // commitments.
  47610. //
  47611. // The request ID must be a valid UUID with the exception that zero UUID
  47612. // is not supported (00000000-0000-0000-0000-000000000000).
  47613. func (c *InstanceGroupManagersSetAutoHealingPoliciesCall) RequestId(requestId string) *InstanceGroupManagersSetAutoHealingPoliciesCall {
  47614. c.urlParams_.Set("requestId", requestId)
  47615. return c
  47616. }
  47617. // Fields allows partial responses to be retrieved. See
  47618. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  47619. // for more information.
  47620. func (c *InstanceGroupManagersSetAutoHealingPoliciesCall) Fields(s ...googleapi.Field) *InstanceGroupManagersSetAutoHealingPoliciesCall {
  47621. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  47622. return c
  47623. }
  47624. // Context sets the context to be used in this call's Do method. Any
  47625. // pending HTTP request will be aborted if the provided context is
  47626. // canceled.
  47627. func (c *InstanceGroupManagersSetAutoHealingPoliciesCall) Context(ctx context.Context) *InstanceGroupManagersSetAutoHealingPoliciesCall {
  47628. c.ctx_ = ctx
  47629. return c
  47630. }
  47631. // Header returns an http.Header that can be modified by the caller to
  47632. // add HTTP headers to the request.
  47633. func (c *InstanceGroupManagersSetAutoHealingPoliciesCall) Header() http.Header {
  47634. if c.header_ == nil {
  47635. c.header_ = make(http.Header)
  47636. }
  47637. return c.header_
  47638. }
  47639. func (c *InstanceGroupManagersSetAutoHealingPoliciesCall) doRequest(alt string) (*http.Response, error) {
  47640. reqHeaders := make(http.Header)
  47641. for k, v := range c.header_ {
  47642. reqHeaders[k] = v
  47643. }
  47644. reqHeaders.Set("User-Agent", c.s.userAgent())
  47645. var body io.Reader = nil
  47646. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupmanagerssetautohealingrequest)
  47647. if err != nil {
  47648. return nil, err
  47649. }
  47650. reqHeaders.Set("Content-Type", "application/json")
  47651. c.urlParams_.Set("alt", alt)
  47652. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/setAutoHealingPolicies")
  47653. urls += "?" + c.urlParams_.Encode()
  47654. req, _ := http.NewRequest("POST", urls, body)
  47655. req.Header = reqHeaders
  47656. googleapi.Expand(req.URL, map[string]string{
  47657. "project": c.project,
  47658. "zone": c.zone,
  47659. "instanceGroupManager": c.instanceGroupManager,
  47660. })
  47661. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  47662. }
  47663. // Do executes the "compute.instanceGroupManagers.setAutoHealingPolicies" call.
  47664. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  47665. // status code is an error. Response headers are in either
  47666. // *Operation.ServerResponse.Header or (if a response was returned at
  47667. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  47668. // to check whether the returned error was because
  47669. // http.StatusNotModified was returned.
  47670. func (c *InstanceGroupManagersSetAutoHealingPoliciesCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  47671. gensupport.SetOptions(c.urlParams_, opts...)
  47672. res, err := c.doRequest("json")
  47673. if res != nil && res.StatusCode == http.StatusNotModified {
  47674. if res.Body != nil {
  47675. res.Body.Close()
  47676. }
  47677. return nil, &googleapi.Error{
  47678. Code: res.StatusCode,
  47679. Header: res.Header,
  47680. }
  47681. }
  47682. if err != nil {
  47683. return nil, err
  47684. }
  47685. defer googleapi.CloseBody(res)
  47686. if err := googleapi.CheckResponse(res); err != nil {
  47687. return nil, err
  47688. }
  47689. ret := &Operation{
  47690. ServerResponse: googleapi.ServerResponse{
  47691. Header: res.Header,
  47692. HTTPStatusCode: res.StatusCode,
  47693. },
  47694. }
  47695. target := &ret
  47696. if err := gensupport.DecodeResponse(target, res); err != nil {
  47697. return nil, err
  47698. }
  47699. return ret, nil
  47700. // {
  47701. // "description": "Modifies the autohealing policies.",
  47702. // "httpMethod": "POST",
  47703. // "id": "compute.instanceGroupManagers.setAutoHealingPolicies",
  47704. // "parameterOrder": [
  47705. // "project",
  47706. // "zone",
  47707. // "instanceGroupManager"
  47708. // ],
  47709. // "parameters": {
  47710. // "instanceGroupManager": {
  47711. // "description": "The name of the instance group manager.",
  47712. // "location": "path",
  47713. // "required": true,
  47714. // "type": "string"
  47715. // },
  47716. // "project": {
  47717. // "description": "Project ID for this request.",
  47718. // "location": "path",
  47719. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  47720. // "required": true,
  47721. // "type": "string"
  47722. // },
  47723. // "requestId": {
  47724. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  47725. // "location": "query",
  47726. // "type": "string"
  47727. // },
  47728. // "zone": {
  47729. // "description": "The name of the zone where the managed instance group is located.",
  47730. // "location": "path",
  47731. // "required": true,
  47732. // "type": "string"
  47733. // }
  47734. // },
  47735. // "path": "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/setAutoHealingPolicies",
  47736. // "request": {
  47737. // "$ref": "InstanceGroupManagersSetAutoHealingRequest"
  47738. // },
  47739. // "response": {
  47740. // "$ref": "Operation"
  47741. // },
  47742. // "scopes": [
  47743. // "https://www.googleapis.com/auth/cloud-platform",
  47744. // "https://www.googleapis.com/auth/compute"
  47745. // ]
  47746. // }
  47747. }
  47748. // method id "compute.instanceGroupManagers.setInstanceTemplate":
  47749. type InstanceGroupManagersSetInstanceTemplateCall struct {
  47750. s *Service
  47751. project string
  47752. zone string
  47753. instanceGroupManager string
  47754. instancegroupmanagerssetinstancetemplaterequest *InstanceGroupManagersSetInstanceTemplateRequest
  47755. urlParams_ gensupport.URLParams
  47756. ctx_ context.Context
  47757. header_ http.Header
  47758. }
  47759. // SetInstanceTemplate: Specifies the instance template to use when
  47760. // creating new instances in this group. The templates for existing
  47761. // instances in the group do not change unless you recreate them.
  47762. func (r *InstanceGroupManagersService) SetInstanceTemplate(project string, zone string, instanceGroupManager string, instancegroupmanagerssetinstancetemplaterequest *InstanceGroupManagersSetInstanceTemplateRequest) *InstanceGroupManagersSetInstanceTemplateCall {
  47763. c := &InstanceGroupManagersSetInstanceTemplateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  47764. c.project = project
  47765. c.zone = zone
  47766. c.instanceGroupManager = instanceGroupManager
  47767. c.instancegroupmanagerssetinstancetemplaterequest = instancegroupmanagerssetinstancetemplaterequest
  47768. return c
  47769. }
  47770. // RequestId sets the optional parameter "requestId": An optional
  47771. // request ID to identify requests. Specify a unique request ID so that
  47772. // if you must retry your request, the server will know to ignore the
  47773. // request if it has already been completed.
  47774. //
  47775. // For example, consider a situation where you make an initial request
  47776. // and the request times out. If you make the request again with the
  47777. // same request ID, the server can check if original operation with the
  47778. // same request ID was received, and if so, will ignore the second
  47779. // request. This prevents clients from accidentally creating duplicate
  47780. // commitments.
  47781. //
  47782. // The request ID must be a valid UUID with the exception that zero UUID
  47783. // is not supported (00000000-0000-0000-0000-000000000000).
  47784. func (c *InstanceGroupManagersSetInstanceTemplateCall) RequestId(requestId string) *InstanceGroupManagersSetInstanceTemplateCall {
  47785. c.urlParams_.Set("requestId", requestId)
  47786. return c
  47787. }
  47788. // Fields allows partial responses to be retrieved. See
  47789. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  47790. // for more information.
  47791. func (c *InstanceGroupManagersSetInstanceTemplateCall) Fields(s ...googleapi.Field) *InstanceGroupManagersSetInstanceTemplateCall {
  47792. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  47793. return c
  47794. }
  47795. // Context sets the context to be used in this call's Do method. Any
  47796. // pending HTTP request will be aborted if the provided context is
  47797. // canceled.
  47798. func (c *InstanceGroupManagersSetInstanceTemplateCall) Context(ctx context.Context) *InstanceGroupManagersSetInstanceTemplateCall {
  47799. c.ctx_ = ctx
  47800. return c
  47801. }
  47802. // Header returns an http.Header that can be modified by the caller to
  47803. // add HTTP headers to the request.
  47804. func (c *InstanceGroupManagersSetInstanceTemplateCall) Header() http.Header {
  47805. if c.header_ == nil {
  47806. c.header_ = make(http.Header)
  47807. }
  47808. return c.header_
  47809. }
  47810. func (c *InstanceGroupManagersSetInstanceTemplateCall) doRequest(alt string) (*http.Response, error) {
  47811. reqHeaders := make(http.Header)
  47812. for k, v := range c.header_ {
  47813. reqHeaders[k] = v
  47814. }
  47815. reqHeaders.Set("User-Agent", c.s.userAgent())
  47816. var body io.Reader = nil
  47817. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupmanagerssetinstancetemplaterequest)
  47818. if err != nil {
  47819. return nil, err
  47820. }
  47821. reqHeaders.Set("Content-Type", "application/json")
  47822. c.urlParams_.Set("alt", alt)
  47823. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/setInstanceTemplate")
  47824. urls += "?" + c.urlParams_.Encode()
  47825. req, _ := http.NewRequest("POST", urls, body)
  47826. req.Header = reqHeaders
  47827. googleapi.Expand(req.URL, map[string]string{
  47828. "project": c.project,
  47829. "zone": c.zone,
  47830. "instanceGroupManager": c.instanceGroupManager,
  47831. })
  47832. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  47833. }
  47834. // Do executes the "compute.instanceGroupManagers.setInstanceTemplate" call.
  47835. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  47836. // status code is an error. Response headers are in either
  47837. // *Operation.ServerResponse.Header or (if a response was returned at
  47838. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  47839. // to check whether the returned error was because
  47840. // http.StatusNotModified was returned.
  47841. func (c *InstanceGroupManagersSetInstanceTemplateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  47842. gensupport.SetOptions(c.urlParams_, opts...)
  47843. res, err := c.doRequest("json")
  47844. if res != nil && res.StatusCode == http.StatusNotModified {
  47845. if res.Body != nil {
  47846. res.Body.Close()
  47847. }
  47848. return nil, &googleapi.Error{
  47849. Code: res.StatusCode,
  47850. Header: res.Header,
  47851. }
  47852. }
  47853. if err != nil {
  47854. return nil, err
  47855. }
  47856. defer googleapi.CloseBody(res)
  47857. if err := googleapi.CheckResponse(res); err != nil {
  47858. return nil, err
  47859. }
  47860. ret := &Operation{
  47861. ServerResponse: googleapi.ServerResponse{
  47862. Header: res.Header,
  47863. HTTPStatusCode: res.StatusCode,
  47864. },
  47865. }
  47866. target := &ret
  47867. if err := gensupport.DecodeResponse(target, res); err != nil {
  47868. return nil, err
  47869. }
  47870. return ret, nil
  47871. // {
  47872. // "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.",
  47873. // "httpMethod": "POST",
  47874. // "id": "compute.instanceGroupManagers.setInstanceTemplate",
  47875. // "parameterOrder": [
  47876. // "project",
  47877. // "zone",
  47878. // "instanceGroupManager"
  47879. // ],
  47880. // "parameters": {
  47881. // "instanceGroupManager": {
  47882. // "description": "The name of the managed instance group.",
  47883. // "location": "path",
  47884. // "required": true,
  47885. // "type": "string"
  47886. // },
  47887. // "project": {
  47888. // "description": "Project ID for this request.",
  47889. // "location": "path",
  47890. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  47891. // "required": true,
  47892. // "type": "string"
  47893. // },
  47894. // "requestId": {
  47895. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  47896. // "location": "query",
  47897. // "type": "string"
  47898. // },
  47899. // "zone": {
  47900. // "description": "The name of the zone where the managed instance group is located.",
  47901. // "location": "path",
  47902. // "required": true,
  47903. // "type": "string"
  47904. // }
  47905. // },
  47906. // "path": "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/setInstanceTemplate",
  47907. // "request": {
  47908. // "$ref": "InstanceGroupManagersSetInstanceTemplateRequest"
  47909. // },
  47910. // "response": {
  47911. // "$ref": "Operation"
  47912. // },
  47913. // "scopes": [
  47914. // "https://www.googleapis.com/auth/cloud-platform",
  47915. // "https://www.googleapis.com/auth/compute"
  47916. // ]
  47917. // }
  47918. }
  47919. // method id "compute.instanceGroupManagers.setTargetPools":
  47920. type InstanceGroupManagersSetTargetPoolsCall struct {
  47921. s *Service
  47922. project string
  47923. zone string
  47924. instanceGroupManager string
  47925. instancegroupmanagerssettargetpoolsrequest *InstanceGroupManagersSetTargetPoolsRequest
  47926. urlParams_ gensupport.URLParams
  47927. ctx_ context.Context
  47928. header_ http.Header
  47929. }
  47930. // SetTargetPools: Modifies the target pools to which all instances in
  47931. // this managed instance group are assigned. The target pools
  47932. // automatically apply to all of the instances in the managed instance
  47933. // group. This operation is marked DONE when you make the request even
  47934. // if the instances have not yet been added to their target pools. The
  47935. // change might take some time to apply to all of the instances in the
  47936. // group depending on the size of the group.
  47937. func (r *InstanceGroupManagersService) SetTargetPools(project string, zone string, instanceGroupManager string, instancegroupmanagerssettargetpoolsrequest *InstanceGroupManagersSetTargetPoolsRequest) *InstanceGroupManagersSetTargetPoolsCall {
  47938. c := &InstanceGroupManagersSetTargetPoolsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  47939. c.project = project
  47940. c.zone = zone
  47941. c.instanceGroupManager = instanceGroupManager
  47942. c.instancegroupmanagerssettargetpoolsrequest = instancegroupmanagerssettargetpoolsrequest
  47943. return c
  47944. }
  47945. // RequestId sets the optional parameter "requestId": An optional
  47946. // request ID to identify requests. Specify a unique request ID so that
  47947. // if you must retry your request, the server will know to ignore the
  47948. // request if it has already been completed.
  47949. //
  47950. // For example, consider a situation where you make an initial request
  47951. // and the request times out. If you make the request again with the
  47952. // same request ID, the server can check if original operation with the
  47953. // same request ID was received, and if so, will ignore the second
  47954. // request. This prevents clients from accidentally creating duplicate
  47955. // commitments.
  47956. //
  47957. // The request ID must be a valid UUID with the exception that zero UUID
  47958. // is not supported (00000000-0000-0000-0000-000000000000).
  47959. func (c *InstanceGroupManagersSetTargetPoolsCall) RequestId(requestId string) *InstanceGroupManagersSetTargetPoolsCall {
  47960. c.urlParams_.Set("requestId", requestId)
  47961. return c
  47962. }
  47963. // Fields allows partial responses to be retrieved. See
  47964. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  47965. // for more information.
  47966. func (c *InstanceGroupManagersSetTargetPoolsCall) Fields(s ...googleapi.Field) *InstanceGroupManagersSetTargetPoolsCall {
  47967. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  47968. return c
  47969. }
  47970. // Context sets the context to be used in this call's Do method. Any
  47971. // pending HTTP request will be aborted if the provided context is
  47972. // canceled.
  47973. func (c *InstanceGroupManagersSetTargetPoolsCall) Context(ctx context.Context) *InstanceGroupManagersSetTargetPoolsCall {
  47974. c.ctx_ = ctx
  47975. return c
  47976. }
  47977. // Header returns an http.Header that can be modified by the caller to
  47978. // add HTTP headers to the request.
  47979. func (c *InstanceGroupManagersSetTargetPoolsCall) Header() http.Header {
  47980. if c.header_ == nil {
  47981. c.header_ = make(http.Header)
  47982. }
  47983. return c.header_
  47984. }
  47985. func (c *InstanceGroupManagersSetTargetPoolsCall) doRequest(alt string) (*http.Response, error) {
  47986. reqHeaders := make(http.Header)
  47987. for k, v := range c.header_ {
  47988. reqHeaders[k] = v
  47989. }
  47990. reqHeaders.Set("User-Agent", c.s.userAgent())
  47991. var body io.Reader = nil
  47992. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupmanagerssettargetpoolsrequest)
  47993. if err != nil {
  47994. return nil, err
  47995. }
  47996. reqHeaders.Set("Content-Type", "application/json")
  47997. c.urlParams_.Set("alt", alt)
  47998. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/setTargetPools")
  47999. urls += "?" + c.urlParams_.Encode()
  48000. req, _ := http.NewRequest("POST", urls, body)
  48001. req.Header = reqHeaders
  48002. googleapi.Expand(req.URL, map[string]string{
  48003. "project": c.project,
  48004. "zone": c.zone,
  48005. "instanceGroupManager": c.instanceGroupManager,
  48006. })
  48007. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  48008. }
  48009. // Do executes the "compute.instanceGroupManagers.setTargetPools" call.
  48010. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  48011. // status code is an error. Response headers are in either
  48012. // *Operation.ServerResponse.Header or (if a response was returned at
  48013. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  48014. // to check whether the returned error was because
  48015. // http.StatusNotModified was returned.
  48016. func (c *InstanceGroupManagersSetTargetPoolsCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  48017. gensupport.SetOptions(c.urlParams_, opts...)
  48018. res, err := c.doRequest("json")
  48019. if res != nil && res.StatusCode == http.StatusNotModified {
  48020. if res.Body != nil {
  48021. res.Body.Close()
  48022. }
  48023. return nil, &googleapi.Error{
  48024. Code: res.StatusCode,
  48025. Header: res.Header,
  48026. }
  48027. }
  48028. if err != nil {
  48029. return nil, err
  48030. }
  48031. defer googleapi.CloseBody(res)
  48032. if err := googleapi.CheckResponse(res); err != nil {
  48033. return nil, err
  48034. }
  48035. ret := &Operation{
  48036. ServerResponse: googleapi.ServerResponse{
  48037. Header: res.Header,
  48038. HTTPStatusCode: res.StatusCode,
  48039. },
  48040. }
  48041. target := &ret
  48042. if err := gensupport.DecodeResponse(target, res); err != nil {
  48043. return nil, err
  48044. }
  48045. return ret, nil
  48046. // {
  48047. // "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.",
  48048. // "httpMethod": "POST",
  48049. // "id": "compute.instanceGroupManagers.setTargetPools",
  48050. // "parameterOrder": [
  48051. // "project",
  48052. // "zone",
  48053. // "instanceGroupManager"
  48054. // ],
  48055. // "parameters": {
  48056. // "instanceGroupManager": {
  48057. // "description": "The name of the managed instance group.",
  48058. // "location": "path",
  48059. // "required": true,
  48060. // "type": "string"
  48061. // },
  48062. // "project": {
  48063. // "description": "Project ID for this request.",
  48064. // "location": "path",
  48065. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  48066. // "required": true,
  48067. // "type": "string"
  48068. // },
  48069. // "requestId": {
  48070. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  48071. // "location": "query",
  48072. // "type": "string"
  48073. // },
  48074. // "zone": {
  48075. // "description": "The name of the zone where the managed instance group is located.",
  48076. // "location": "path",
  48077. // "required": true,
  48078. // "type": "string"
  48079. // }
  48080. // },
  48081. // "path": "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/setTargetPools",
  48082. // "request": {
  48083. // "$ref": "InstanceGroupManagersSetTargetPoolsRequest"
  48084. // },
  48085. // "response": {
  48086. // "$ref": "Operation"
  48087. // },
  48088. // "scopes": [
  48089. // "https://www.googleapis.com/auth/cloud-platform",
  48090. // "https://www.googleapis.com/auth/compute"
  48091. // ]
  48092. // }
  48093. }
  48094. // method id "compute.instanceGroupManagers.testIamPermissions":
  48095. type InstanceGroupManagersTestIamPermissionsCall struct {
  48096. s *Service
  48097. project string
  48098. zone string
  48099. resource string
  48100. testpermissionsrequest *TestPermissionsRequest
  48101. urlParams_ gensupport.URLParams
  48102. ctx_ context.Context
  48103. header_ http.Header
  48104. }
  48105. // TestIamPermissions: Returns permissions that a caller has on the
  48106. // specified resource.
  48107. func (r *InstanceGroupManagersService) TestIamPermissions(project string, zone string, resource string, testpermissionsrequest *TestPermissionsRequest) *InstanceGroupManagersTestIamPermissionsCall {
  48108. c := &InstanceGroupManagersTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  48109. c.project = project
  48110. c.zone = zone
  48111. c.resource = resource
  48112. c.testpermissionsrequest = testpermissionsrequest
  48113. return c
  48114. }
  48115. // Fields allows partial responses to be retrieved. See
  48116. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  48117. // for more information.
  48118. func (c *InstanceGroupManagersTestIamPermissionsCall) Fields(s ...googleapi.Field) *InstanceGroupManagersTestIamPermissionsCall {
  48119. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  48120. return c
  48121. }
  48122. // Context sets the context to be used in this call's Do method. Any
  48123. // pending HTTP request will be aborted if the provided context is
  48124. // canceled.
  48125. func (c *InstanceGroupManagersTestIamPermissionsCall) Context(ctx context.Context) *InstanceGroupManagersTestIamPermissionsCall {
  48126. c.ctx_ = ctx
  48127. return c
  48128. }
  48129. // Header returns an http.Header that can be modified by the caller to
  48130. // add HTTP headers to the request.
  48131. func (c *InstanceGroupManagersTestIamPermissionsCall) Header() http.Header {
  48132. if c.header_ == nil {
  48133. c.header_ = make(http.Header)
  48134. }
  48135. return c.header_
  48136. }
  48137. func (c *InstanceGroupManagersTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  48138. reqHeaders := make(http.Header)
  48139. for k, v := range c.header_ {
  48140. reqHeaders[k] = v
  48141. }
  48142. reqHeaders.Set("User-Agent", c.s.userAgent())
  48143. var body io.Reader = nil
  48144. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  48145. if err != nil {
  48146. return nil, err
  48147. }
  48148. reqHeaders.Set("Content-Type", "application/json")
  48149. c.urlParams_.Set("alt", alt)
  48150. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroupManagers/{resource}/testIamPermissions")
  48151. urls += "?" + c.urlParams_.Encode()
  48152. req, _ := http.NewRequest("POST", urls, body)
  48153. req.Header = reqHeaders
  48154. googleapi.Expand(req.URL, map[string]string{
  48155. "project": c.project,
  48156. "zone": c.zone,
  48157. "resource": c.resource,
  48158. })
  48159. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  48160. }
  48161. // Do executes the "compute.instanceGroupManagers.testIamPermissions" call.
  48162. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  48163. // non-2xx status code is an error. Response headers are in either
  48164. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  48165. // returned at all) in error.(*googleapi.Error).Header. Use
  48166. // googleapi.IsNotModified to check whether the returned error was
  48167. // because http.StatusNotModified was returned.
  48168. func (c *InstanceGroupManagersTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  48169. gensupport.SetOptions(c.urlParams_, opts...)
  48170. res, err := c.doRequest("json")
  48171. if res != nil && res.StatusCode == http.StatusNotModified {
  48172. if res.Body != nil {
  48173. res.Body.Close()
  48174. }
  48175. return nil, &googleapi.Error{
  48176. Code: res.StatusCode,
  48177. Header: res.Header,
  48178. }
  48179. }
  48180. if err != nil {
  48181. return nil, err
  48182. }
  48183. defer googleapi.CloseBody(res)
  48184. if err := googleapi.CheckResponse(res); err != nil {
  48185. return nil, err
  48186. }
  48187. ret := &TestPermissionsResponse{
  48188. ServerResponse: googleapi.ServerResponse{
  48189. Header: res.Header,
  48190. HTTPStatusCode: res.StatusCode,
  48191. },
  48192. }
  48193. target := &ret
  48194. if err := gensupport.DecodeResponse(target, res); err != nil {
  48195. return nil, err
  48196. }
  48197. return ret, nil
  48198. // {
  48199. // "description": "Returns permissions that a caller has on the specified resource.",
  48200. // "httpMethod": "POST",
  48201. // "id": "compute.instanceGroupManagers.testIamPermissions",
  48202. // "parameterOrder": [
  48203. // "project",
  48204. // "zone",
  48205. // "resource"
  48206. // ],
  48207. // "parameters": {
  48208. // "project": {
  48209. // "description": "Project ID for this request.",
  48210. // "location": "path",
  48211. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  48212. // "required": true,
  48213. // "type": "string"
  48214. // },
  48215. // "resource": {
  48216. // "description": "Name of the resource for this request.",
  48217. // "location": "path",
  48218. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  48219. // "required": true,
  48220. // "type": "string"
  48221. // },
  48222. // "zone": {
  48223. // "description": "The name of the zone for this request.",
  48224. // "location": "path",
  48225. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  48226. // "required": true,
  48227. // "type": "string"
  48228. // }
  48229. // },
  48230. // "path": "{project}/zones/{zone}/instanceGroupManagers/{resource}/testIamPermissions",
  48231. // "request": {
  48232. // "$ref": "TestPermissionsRequest"
  48233. // },
  48234. // "response": {
  48235. // "$ref": "TestPermissionsResponse"
  48236. // },
  48237. // "scopes": [
  48238. // "https://www.googleapis.com/auth/cloud-platform",
  48239. // "https://www.googleapis.com/auth/compute",
  48240. // "https://www.googleapis.com/auth/compute.readonly"
  48241. // ]
  48242. // }
  48243. }
  48244. // method id "compute.instanceGroupManagers.update":
  48245. type InstanceGroupManagersUpdateCall struct {
  48246. s *Service
  48247. project string
  48248. zone string
  48249. instanceGroupManager string
  48250. instancegroupmanager *InstanceGroupManager
  48251. urlParams_ gensupport.URLParams
  48252. ctx_ context.Context
  48253. header_ http.Header
  48254. }
  48255. // Update: Updates a managed instance group using the information that
  48256. // you specify in the request. This operation is marked as DONE when the
  48257. // group is updated even if the instances in the group have not yet been
  48258. // updated. You must separately verify the status of the individual
  48259. // instances with the listManagedInstances method.
  48260. func (r *InstanceGroupManagersService) Update(project string, zone string, instanceGroupManager string, instancegroupmanager *InstanceGroupManager) *InstanceGroupManagersUpdateCall {
  48261. c := &InstanceGroupManagersUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  48262. c.project = project
  48263. c.zone = zone
  48264. c.instanceGroupManager = instanceGroupManager
  48265. c.instancegroupmanager = instancegroupmanager
  48266. return c
  48267. }
  48268. // RequestId sets the optional parameter "requestId": An optional
  48269. // request ID to identify requests. Specify a unique request ID so that
  48270. // if you must retry your request, the server will know to ignore the
  48271. // request if it has already been completed.
  48272. //
  48273. // For example, consider a situation where you make an initial request
  48274. // and the request times out. If you make the request again with the
  48275. // same request ID, the server can check if original operation with the
  48276. // same request ID was received, and if so, will ignore the second
  48277. // request. This prevents clients from accidentally creating duplicate
  48278. // commitments.
  48279. //
  48280. // The request ID must be a valid UUID with the exception that zero UUID
  48281. // is not supported (00000000-0000-0000-0000-000000000000).
  48282. func (c *InstanceGroupManagersUpdateCall) RequestId(requestId string) *InstanceGroupManagersUpdateCall {
  48283. c.urlParams_.Set("requestId", requestId)
  48284. return c
  48285. }
  48286. // Fields allows partial responses to be retrieved. See
  48287. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  48288. // for more information.
  48289. func (c *InstanceGroupManagersUpdateCall) Fields(s ...googleapi.Field) *InstanceGroupManagersUpdateCall {
  48290. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  48291. return c
  48292. }
  48293. // Context sets the context to be used in this call's Do method. Any
  48294. // pending HTTP request will be aborted if the provided context is
  48295. // canceled.
  48296. func (c *InstanceGroupManagersUpdateCall) Context(ctx context.Context) *InstanceGroupManagersUpdateCall {
  48297. c.ctx_ = ctx
  48298. return c
  48299. }
  48300. // Header returns an http.Header that can be modified by the caller to
  48301. // add HTTP headers to the request.
  48302. func (c *InstanceGroupManagersUpdateCall) Header() http.Header {
  48303. if c.header_ == nil {
  48304. c.header_ = make(http.Header)
  48305. }
  48306. return c.header_
  48307. }
  48308. func (c *InstanceGroupManagersUpdateCall) doRequest(alt string) (*http.Response, error) {
  48309. reqHeaders := make(http.Header)
  48310. for k, v := range c.header_ {
  48311. reqHeaders[k] = v
  48312. }
  48313. reqHeaders.Set("User-Agent", c.s.userAgent())
  48314. var body io.Reader = nil
  48315. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupmanager)
  48316. if err != nil {
  48317. return nil, err
  48318. }
  48319. reqHeaders.Set("Content-Type", "application/json")
  48320. c.urlParams_.Set("alt", alt)
  48321. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}")
  48322. urls += "?" + c.urlParams_.Encode()
  48323. req, _ := http.NewRequest("PUT", urls, body)
  48324. req.Header = reqHeaders
  48325. googleapi.Expand(req.URL, map[string]string{
  48326. "project": c.project,
  48327. "zone": c.zone,
  48328. "instanceGroupManager": c.instanceGroupManager,
  48329. })
  48330. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  48331. }
  48332. // Do executes the "compute.instanceGroupManagers.update" call.
  48333. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  48334. // status code is an error. Response headers are in either
  48335. // *Operation.ServerResponse.Header or (if a response was returned at
  48336. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  48337. // to check whether the returned error was because
  48338. // http.StatusNotModified was returned.
  48339. func (c *InstanceGroupManagersUpdateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  48340. gensupport.SetOptions(c.urlParams_, opts...)
  48341. res, err := c.doRequest("json")
  48342. if res != nil && res.StatusCode == http.StatusNotModified {
  48343. if res.Body != nil {
  48344. res.Body.Close()
  48345. }
  48346. return nil, &googleapi.Error{
  48347. Code: res.StatusCode,
  48348. Header: res.Header,
  48349. }
  48350. }
  48351. if err != nil {
  48352. return nil, err
  48353. }
  48354. defer googleapi.CloseBody(res)
  48355. if err := googleapi.CheckResponse(res); err != nil {
  48356. return nil, err
  48357. }
  48358. ret := &Operation{
  48359. ServerResponse: googleapi.ServerResponse{
  48360. Header: res.Header,
  48361. HTTPStatusCode: res.StatusCode,
  48362. },
  48363. }
  48364. target := &ret
  48365. if err := gensupport.DecodeResponse(target, res); err != nil {
  48366. return nil, err
  48367. }
  48368. return ret, nil
  48369. // {
  48370. // "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.",
  48371. // "httpMethod": "PUT",
  48372. // "id": "compute.instanceGroupManagers.update",
  48373. // "parameterOrder": [
  48374. // "project",
  48375. // "zone",
  48376. // "instanceGroupManager"
  48377. // ],
  48378. // "parameters": {
  48379. // "instanceGroupManager": {
  48380. // "description": "The name of the instance group manager.",
  48381. // "location": "path",
  48382. // "required": true,
  48383. // "type": "string"
  48384. // },
  48385. // "project": {
  48386. // "description": "Project ID for this request.",
  48387. // "location": "path",
  48388. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  48389. // "required": true,
  48390. // "type": "string"
  48391. // },
  48392. // "requestId": {
  48393. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  48394. // "location": "query",
  48395. // "type": "string"
  48396. // },
  48397. // "zone": {
  48398. // "description": "The name of the zone where you want to create the managed instance group.",
  48399. // "location": "path",
  48400. // "required": true,
  48401. // "type": "string"
  48402. // }
  48403. // },
  48404. // "path": "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}",
  48405. // "request": {
  48406. // "$ref": "InstanceGroupManager"
  48407. // },
  48408. // "response": {
  48409. // "$ref": "Operation"
  48410. // },
  48411. // "scopes": [
  48412. // "https://www.googleapis.com/auth/cloud-platform",
  48413. // "https://www.googleapis.com/auth/compute"
  48414. // ]
  48415. // }
  48416. }
  48417. // method id "compute.instanceGroups.addInstances":
  48418. type InstanceGroupsAddInstancesCall struct {
  48419. s *Service
  48420. project string
  48421. zone string
  48422. instanceGroup string
  48423. instancegroupsaddinstancesrequest *InstanceGroupsAddInstancesRequest
  48424. urlParams_ gensupport.URLParams
  48425. ctx_ context.Context
  48426. header_ http.Header
  48427. }
  48428. // AddInstances: Adds a list of instances to the specified instance
  48429. // group. All of the instances in the instance group must be in the same
  48430. // network/subnetwork. Read Adding instances for more information.
  48431. func (r *InstanceGroupsService) AddInstances(project string, zone string, instanceGroup string, instancegroupsaddinstancesrequest *InstanceGroupsAddInstancesRequest) *InstanceGroupsAddInstancesCall {
  48432. c := &InstanceGroupsAddInstancesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  48433. c.project = project
  48434. c.zone = zone
  48435. c.instanceGroup = instanceGroup
  48436. c.instancegroupsaddinstancesrequest = instancegroupsaddinstancesrequest
  48437. return c
  48438. }
  48439. // RequestId sets the optional parameter "requestId": An optional
  48440. // request ID to identify requests. Specify a unique request ID so that
  48441. // if you must retry your request, the server will know to ignore the
  48442. // request if it has already been completed.
  48443. //
  48444. // For example, consider a situation where you make an initial request
  48445. // and the request times out. If you make the request again with the
  48446. // same request ID, the server can check if original operation with the
  48447. // same request ID was received, and if so, will ignore the second
  48448. // request. This prevents clients from accidentally creating duplicate
  48449. // commitments.
  48450. //
  48451. // The request ID must be a valid UUID with the exception that zero UUID
  48452. // is not supported (00000000-0000-0000-0000-000000000000).
  48453. func (c *InstanceGroupsAddInstancesCall) RequestId(requestId string) *InstanceGroupsAddInstancesCall {
  48454. c.urlParams_.Set("requestId", requestId)
  48455. return c
  48456. }
  48457. // Fields allows partial responses to be retrieved. See
  48458. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  48459. // for more information.
  48460. func (c *InstanceGroupsAddInstancesCall) Fields(s ...googleapi.Field) *InstanceGroupsAddInstancesCall {
  48461. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  48462. return c
  48463. }
  48464. // Context sets the context to be used in this call's Do method. Any
  48465. // pending HTTP request will be aborted if the provided context is
  48466. // canceled.
  48467. func (c *InstanceGroupsAddInstancesCall) Context(ctx context.Context) *InstanceGroupsAddInstancesCall {
  48468. c.ctx_ = ctx
  48469. return c
  48470. }
  48471. // Header returns an http.Header that can be modified by the caller to
  48472. // add HTTP headers to the request.
  48473. func (c *InstanceGroupsAddInstancesCall) Header() http.Header {
  48474. if c.header_ == nil {
  48475. c.header_ = make(http.Header)
  48476. }
  48477. return c.header_
  48478. }
  48479. func (c *InstanceGroupsAddInstancesCall) doRequest(alt string) (*http.Response, error) {
  48480. reqHeaders := make(http.Header)
  48481. for k, v := range c.header_ {
  48482. reqHeaders[k] = v
  48483. }
  48484. reqHeaders.Set("User-Agent", c.s.userAgent())
  48485. var body io.Reader = nil
  48486. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupsaddinstancesrequest)
  48487. if err != nil {
  48488. return nil, err
  48489. }
  48490. reqHeaders.Set("Content-Type", "application/json")
  48491. c.urlParams_.Set("alt", alt)
  48492. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroups/{instanceGroup}/addInstances")
  48493. urls += "?" + c.urlParams_.Encode()
  48494. req, _ := http.NewRequest("POST", urls, body)
  48495. req.Header = reqHeaders
  48496. googleapi.Expand(req.URL, map[string]string{
  48497. "project": c.project,
  48498. "zone": c.zone,
  48499. "instanceGroup": c.instanceGroup,
  48500. })
  48501. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  48502. }
  48503. // Do executes the "compute.instanceGroups.addInstances" call.
  48504. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  48505. // status code is an error. Response headers are in either
  48506. // *Operation.ServerResponse.Header or (if a response was returned at
  48507. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  48508. // to check whether the returned error was because
  48509. // http.StatusNotModified was returned.
  48510. func (c *InstanceGroupsAddInstancesCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  48511. gensupport.SetOptions(c.urlParams_, opts...)
  48512. res, err := c.doRequest("json")
  48513. if res != nil && res.StatusCode == http.StatusNotModified {
  48514. if res.Body != nil {
  48515. res.Body.Close()
  48516. }
  48517. return nil, &googleapi.Error{
  48518. Code: res.StatusCode,
  48519. Header: res.Header,
  48520. }
  48521. }
  48522. if err != nil {
  48523. return nil, err
  48524. }
  48525. defer googleapi.CloseBody(res)
  48526. if err := googleapi.CheckResponse(res); err != nil {
  48527. return nil, err
  48528. }
  48529. ret := &Operation{
  48530. ServerResponse: googleapi.ServerResponse{
  48531. Header: res.Header,
  48532. HTTPStatusCode: res.StatusCode,
  48533. },
  48534. }
  48535. target := &ret
  48536. if err := gensupport.DecodeResponse(target, res); err != nil {
  48537. return nil, err
  48538. }
  48539. return ret, nil
  48540. // {
  48541. // "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.",
  48542. // "httpMethod": "POST",
  48543. // "id": "compute.instanceGroups.addInstances",
  48544. // "parameterOrder": [
  48545. // "project",
  48546. // "zone",
  48547. // "instanceGroup"
  48548. // ],
  48549. // "parameters": {
  48550. // "instanceGroup": {
  48551. // "description": "The name of the instance group where you are adding instances.",
  48552. // "location": "path",
  48553. // "required": true,
  48554. // "type": "string"
  48555. // },
  48556. // "project": {
  48557. // "description": "Project ID for this request.",
  48558. // "location": "path",
  48559. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  48560. // "required": true,
  48561. // "type": "string"
  48562. // },
  48563. // "requestId": {
  48564. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  48565. // "location": "query",
  48566. // "type": "string"
  48567. // },
  48568. // "zone": {
  48569. // "description": "The name of the zone where the instance group is located.",
  48570. // "location": "path",
  48571. // "required": true,
  48572. // "type": "string"
  48573. // }
  48574. // },
  48575. // "path": "{project}/zones/{zone}/instanceGroups/{instanceGroup}/addInstances",
  48576. // "request": {
  48577. // "$ref": "InstanceGroupsAddInstancesRequest"
  48578. // },
  48579. // "response": {
  48580. // "$ref": "Operation"
  48581. // },
  48582. // "scopes": [
  48583. // "https://www.googleapis.com/auth/cloud-platform",
  48584. // "https://www.googleapis.com/auth/compute"
  48585. // ]
  48586. // }
  48587. }
  48588. // method id "compute.instanceGroups.aggregatedList":
  48589. type InstanceGroupsAggregatedListCall struct {
  48590. s *Service
  48591. project string
  48592. urlParams_ gensupport.URLParams
  48593. ifNoneMatch_ string
  48594. ctx_ context.Context
  48595. header_ http.Header
  48596. }
  48597. // AggregatedList: Retrieves the list of instance groups and sorts them
  48598. // by zone.
  48599. func (r *InstanceGroupsService) AggregatedList(project string) *InstanceGroupsAggregatedListCall {
  48600. c := &InstanceGroupsAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  48601. c.project = project
  48602. return c
  48603. }
  48604. // Filter sets the optional parameter "filter": A filter expression that
  48605. // filters resources listed in the response. The expression must specify
  48606. // the field name, a comparison operator, and the value that you want to
  48607. // use for filtering. The value must be a string, a number, or a
  48608. // boolean. The comparison operator must be either =, !=, >, or <.
  48609. //
  48610. // For example, if you are filtering Compute Engine instances, you can
  48611. // exclude instances named example-instance by specifying name !=
  48612. // example-instance.
  48613. //
  48614. // You can also filter nested fields. For example, you could specify
  48615. // scheduling.automaticRestart = false to include instances only if they
  48616. // are not scheduled for automatic restarts. You can use filtering on
  48617. // nested fields to filter based on resource labels.
  48618. //
  48619. // To filter on multiple expressions, provide each separate expression
  48620. // within parentheses. For example, (scheduling.automaticRestart = true)
  48621. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  48622. // AND expression. However, you can include AND and OR expressions
  48623. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  48624. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  48625. // true).
  48626. func (c *InstanceGroupsAggregatedListCall) Filter(filter string) *InstanceGroupsAggregatedListCall {
  48627. c.urlParams_.Set("filter", filter)
  48628. return c
  48629. }
  48630. // MaxResults sets the optional parameter "maxResults": The maximum
  48631. // number of results per page that should be returned. If the number of
  48632. // available results is larger than maxResults, Compute Engine returns a
  48633. // nextPageToken that can be used to get the next page of results in
  48634. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  48635. // (Default: 500)
  48636. func (c *InstanceGroupsAggregatedListCall) MaxResults(maxResults int64) *InstanceGroupsAggregatedListCall {
  48637. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  48638. return c
  48639. }
  48640. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  48641. // a certain order. By default, results are returned in alphanumerical
  48642. // order based on the resource name.
  48643. //
  48644. // You can also sort results in descending order based on the creation
  48645. // timestamp using orderBy="creationTimestamp desc". This sorts results
  48646. // based on the creationTimestamp field in reverse chronological order
  48647. // (newest result first). Use this to sort resources like operations so
  48648. // that the newest operation is returned first.
  48649. //
  48650. // Currently, only sorting by name or creationTimestamp desc is
  48651. // supported.
  48652. func (c *InstanceGroupsAggregatedListCall) OrderBy(orderBy string) *InstanceGroupsAggregatedListCall {
  48653. c.urlParams_.Set("orderBy", orderBy)
  48654. return c
  48655. }
  48656. // PageToken sets the optional parameter "pageToken": Specifies a page
  48657. // token to use. Set pageToken to the nextPageToken returned by a
  48658. // previous list request to get the next page of results.
  48659. func (c *InstanceGroupsAggregatedListCall) PageToken(pageToken string) *InstanceGroupsAggregatedListCall {
  48660. c.urlParams_.Set("pageToken", pageToken)
  48661. return c
  48662. }
  48663. // Fields allows partial responses to be retrieved. See
  48664. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  48665. // for more information.
  48666. func (c *InstanceGroupsAggregatedListCall) Fields(s ...googleapi.Field) *InstanceGroupsAggregatedListCall {
  48667. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  48668. return c
  48669. }
  48670. // IfNoneMatch sets the optional parameter which makes the operation
  48671. // fail if the object's ETag matches the given value. This is useful for
  48672. // getting updates only after the object has changed since the last
  48673. // request. Use googleapi.IsNotModified to check whether the response
  48674. // error from Do is the result of In-None-Match.
  48675. func (c *InstanceGroupsAggregatedListCall) IfNoneMatch(entityTag string) *InstanceGroupsAggregatedListCall {
  48676. c.ifNoneMatch_ = entityTag
  48677. return c
  48678. }
  48679. // Context sets the context to be used in this call's Do method. Any
  48680. // pending HTTP request will be aborted if the provided context is
  48681. // canceled.
  48682. func (c *InstanceGroupsAggregatedListCall) Context(ctx context.Context) *InstanceGroupsAggregatedListCall {
  48683. c.ctx_ = ctx
  48684. return c
  48685. }
  48686. // Header returns an http.Header that can be modified by the caller to
  48687. // add HTTP headers to the request.
  48688. func (c *InstanceGroupsAggregatedListCall) Header() http.Header {
  48689. if c.header_ == nil {
  48690. c.header_ = make(http.Header)
  48691. }
  48692. return c.header_
  48693. }
  48694. func (c *InstanceGroupsAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  48695. reqHeaders := make(http.Header)
  48696. for k, v := range c.header_ {
  48697. reqHeaders[k] = v
  48698. }
  48699. reqHeaders.Set("User-Agent", c.s.userAgent())
  48700. if c.ifNoneMatch_ != "" {
  48701. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  48702. }
  48703. var body io.Reader = nil
  48704. c.urlParams_.Set("alt", alt)
  48705. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/instanceGroups")
  48706. urls += "?" + c.urlParams_.Encode()
  48707. req, _ := http.NewRequest("GET", urls, body)
  48708. req.Header = reqHeaders
  48709. googleapi.Expand(req.URL, map[string]string{
  48710. "project": c.project,
  48711. })
  48712. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  48713. }
  48714. // Do executes the "compute.instanceGroups.aggregatedList" call.
  48715. // Exactly one of *InstanceGroupAggregatedList or error will be non-nil.
  48716. // Any non-2xx status code is an error. Response headers are in either
  48717. // *InstanceGroupAggregatedList.ServerResponse.Header or (if a response
  48718. // was returned at all) in error.(*googleapi.Error).Header. Use
  48719. // googleapi.IsNotModified to check whether the returned error was
  48720. // because http.StatusNotModified was returned.
  48721. func (c *InstanceGroupsAggregatedListCall) Do(opts ...googleapi.CallOption) (*InstanceGroupAggregatedList, error) {
  48722. gensupport.SetOptions(c.urlParams_, opts...)
  48723. res, err := c.doRequest("json")
  48724. if res != nil && res.StatusCode == http.StatusNotModified {
  48725. if res.Body != nil {
  48726. res.Body.Close()
  48727. }
  48728. return nil, &googleapi.Error{
  48729. Code: res.StatusCode,
  48730. Header: res.Header,
  48731. }
  48732. }
  48733. if err != nil {
  48734. return nil, err
  48735. }
  48736. defer googleapi.CloseBody(res)
  48737. if err := googleapi.CheckResponse(res); err != nil {
  48738. return nil, err
  48739. }
  48740. ret := &InstanceGroupAggregatedList{
  48741. ServerResponse: googleapi.ServerResponse{
  48742. Header: res.Header,
  48743. HTTPStatusCode: res.StatusCode,
  48744. },
  48745. }
  48746. target := &ret
  48747. if err := gensupport.DecodeResponse(target, res); err != nil {
  48748. return nil, err
  48749. }
  48750. return ret, nil
  48751. // {
  48752. // "description": "Retrieves the list of instance groups and sorts them by zone.",
  48753. // "httpMethod": "GET",
  48754. // "id": "compute.instanceGroups.aggregatedList",
  48755. // "parameterOrder": [
  48756. // "project"
  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. // },
  48790. // "path": "{project}/aggregated/instanceGroups",
  48791. // "response": {
  48792. // "$ref": "InstanceGroupAggregatedList"
  48793. // },
  48794. // "scopes": [
  48795. // "https://www.googleapis.com/auth/cloud-platform",
  48796. // "https://www.googleapis.com/auth/compute",
  48797. // "https://www.googleapis.com/auth/compute.readonly"
  48798. // ]
  48799. // }
  48800. }
  48801. // Pages invokes f for each page of results.
  48802. // A non-nil error returned from f will halt the iteration.
  48803. // The provided context supersedes any context provided to the Context method.
  48804. func (c *InstanceGroupsAggregatedListCall) Pages(ctx context.Context, f func(*InstanceGroupAggregatedList) error) error {
  48805. c.ctx_ = ctx
  48806. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  48807. for {
  48808. x, err := c.Do()
  48809. if err != nil {
  48810. return err
  48811. }
  48812. if err := f(x); err != nil {
  48813. return err
  48814. }
  48815. if x.NextPageToken == "" {
  48816. return nil
  48817. }
  48818. c.PageToken(x.NextPageToken)
  48819. }
  48820. }
  48821. // method id "compute.instanceGroups.delete":
  48822. type InstanceGroupsDeleteCall struct {
  48823. s *Service
  48824. project string
  48825. zone string
  48826. instanceGroup string
  48827. urlParams_ gensupport.URLParams
  48828. ctx_ context.Context
  48829. header_ http.Header
  48830. }
  48831. // Delete: Deletes the specified instance group. The instances in the
  48832. // group are not deleted. Note that instance group must not belong to a
  48833. // backend service. Read Deleting an instance group for more
  48834. // information.
  48835. func (r *InstanceGroupsService) Delete(project string, zone string, instanceGroup string) *InstanceGroupsDeleteCall {
  48836. c := &InstanceGroupsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  48837. c.project = project
  48838. c.zone = zone
  48839. c.instanceGroup = instanceGroup
  48840. return c
  48841. }
  48842. // RequestId sets the optional parameter "requestId": An optional
  48843. // request ID to identify requests. Specify a unique request ID so that
  48844. // if you must retry your request, the server will know to ignore the
  48845. // request if it has already been completed.
  48846. //
  48847. // For example, consider a situation where you make an initial request
  48848. // and the request times out. If you make the request again with the
  48849. // same request ID, the server can check if original operation with the
  48850. // same request ID was received, and if so, will ignore the second
  48851. // request. This prevents clients from accidentally creating duplicate
  48852. // commitments.
  48853. //
  48854. // The request ID must be a valid UUID with the exception that zero UUID
  48855. // is not supported (00000000-0000-0000-0000-000000000000).
  48856. func (c *InstanceGroupsDeleteCall) RequestId(requestId string) *InstanceGroupsDeleteCall {
  48857. c.urlParams_.Set("requestId", requestId)
  48858. return c
  48859. }
  48860. // Fields allows partial responses to be retrieved. See
  48861. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  48862. // for more information.
  48863. func (c *InstanceGroupsDeleteCall) Fields(s ...googleapi.Field) *InstanceGroupsDeleteCall {
  48864. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  48865. return c
  48866. }
  48867. // Context sets the context to be used in this call's Do method. Any
  48868. // pending HTTP request will be aborted if the provided context is
  48869. // canceled.
  48870. func (c *InstanceGroupsDeleteCall) Context(ctx context.Context) *InstanceGroupsDeleteCall {
  48871. c.ctx_ = ctx
  48872. return c
  48873. }
  48874. // Header returns an http.Header that can be modified by the caller to
  48875. // add HTTP headers to the request.
  48876. func (c *InstanceGroupsDeleteCall) Header() http.Header {
  48877. if c.header_ == nil {
  48878. c.header_ = make(http.Header)
  48879. }
  48880. return c.header_
  48881. }
  48882. func (c *InstanceGroupsDeleteCall) doRequest(alt string) (*http.Response, error) {
  48883. reqHeaders := make(http.Header)
  48884. for k, v := range c.header_ {
  48885. reqHeaders[k] = v
  48886. }
  48887. reqHeaders.Set("User-Agent", c.s.userAgent())
  48888. var body io.Reader = nil
  48889. c.urlParams_.Set("alt", alt)
  48890. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroups/{instanceGroup}")
  48891. urls += "?" + c.urlParams_.Encode()
  48892. req, _ := http.NewRequest("DELETE", urls, body)
  48893. req.Header = reqHeaders
  48894. googleapi.Expand(req.URL, map[string]string{
  48895. "project": c.project,
  48896. "zone": c.zone,
  48897. "instanceGroup": c.instanceGroup,
  48898. })
  48899. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  48900. }
  48901. // Do executes the "compute.instanceGroups.delete" call.
  48902. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  48903. // status code is an error. Response headers are in either
  48904. // *Operation.ServerResponse.Header or (if a response was returned at
  48905. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  48906. // to check whether the returned error was because
  48907. // http.StatusNotModified was returned.
  48908. func (c *InstanceGroupsDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  48909. gensupport.SetOptions(c.urlParams_, opts...)
  48910. res, err := c.doRequest("json")
  48911. if res != nil && res.StatusCode == http.StatusNotModified {
  48912. if res.Body != nil {
  48913. res.Body.Close()
  48914. }
  48915. return nil, &googleapi.Error{
  48916. Code: res.StatusCode,
  48917. Header: res.Header,
  48918. }
  48919. }
  48920. if err != nil {
  48921. return nil, err
  48922. }
  48923. defer googleapi.CloseBody(res)
  48924. if err := googleapi.CheckResponse(res); err != nil {
  48925. return nil, err
  48926. }
  48927. ret := &Operation{
  48928. ServerResponse: googleapi.ServerResponse{
  48929. Header: res.Header,
  48930. HTTPStatusCode: res.StatusCode,
  48931. },
  48932. }
  48933. target := &ret
  48934. if err := gensupport.DecodeResponse(target, res); err != nil {
  48935. return nil, err
  48936. }
  48937. return ret, nil
  48938. // {
  48939. // "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.",
  48940. // "httpMethod": "DELETE",
  48941. // "id": "compute.instanceGroups.delete",
  48942. // "parameterOrder": [
  48943. // "project",
  48944. // "zone",
  48945. // "instanceGroup"
  48946. // ],
  48947. // "parameters": {
  48948. // "instanceGroup": {
  48949. // "description": "The name of the instance group to delete.",
  48950. // "location": "path",
  48951. // "required": true,
  48952. // "type": "string"
  48953. // },
  48954. // "project": {
  48955. // "description": "Project ID for this request.",
  48956. // "location": "path",
  48957. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  48958. // "required": true,
  48959. // "type": "string"
  48960. // },
  48961. // "requestId": {
  48962. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  48963. // "location": "query",
  48964. // "type": "string"
  48965. // },
  48966. // "zone": {
  48967. // "description": "The name of the zone where the instance group is located.",
  48968. // "location": "path",
  48969. // "required": true,
  48970. // "type": "string"
  48971. // }
  48972. // },
  48973. // "path": "{project}/zones/{zone}/instanceGroups/{instanceGroup}",
  48974. // "response": {
  48975. // "$ref": "Operation"
  48976. // },
  48977. // "scopes": [
  48978. // "https://www.googleapis.com/auth/cloud-platform",
  48979. // "https://www.googleapis.com/auth/compute"
  48980. // ]
  48981. // }
  48982. }
  48983. // method id "compute.instanceGroups.get":
  48984. type InstanceGroupsGetCall struct {
  48985. s *Service
  48986. project string
  48987. zone string
  48988. instanceGroup string
  48989. urlParams_ gensupport.URLParams
  48990. ifNoneMatch_ string
  48991. ctx_ context.Context
  48992. header_ http.Header
  48993. }
  48994. // Get: Returns the specified instance group. Gets a list of available
  48995. // instance groups by making a list() request.
  48996. func (r *InstanceGroupsService) Get(project string, zone string, instanceGroup string) *InstanceGroupsGetCall {
  48997. c := &InstanceGroupsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  48998. c.project = project
  48999. c.zone = zone
  49000. c.instanceGroup = instanceGroup
  49001. return c
  49002. }
  49003. // Fields allows partial responses to be retrieved. See
  49004. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  49005. // for more information.
  49006. func (c *InstanceGroupsGetCall) Fields(s ...googleapi.Field) *InstanceGroupsGetCall {
  49007. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  49008. return c
  49009. }
  49010. // IfNoneMatch sets the optional parameter which makes the operation
  49011. // fail if the object's ETag matches the given value. This is useful for
  49012. // getting updates only after the object has changed since the last
  49013. // request. Use googleapi.IsNotModified to check whether the response
  49014. // error from Do is the result of In-None-Match.
  49015. func (c *InstanceGroupsGetCall) IfNoneMatch(entityTag string) *InstanceGroupsGetCall {
  49016. c.ifNoneMatch_ = entityTag
  49017. return c
  49018. }
  49019. // Context sets the context to be used in this call's Do method. Any
  49020. // pending HTTP request will be aborted if the provided context is
  49021. // canceled.
  49022. func (c *InstanceGroupsGetCall) Context(ctx context.Context) *InstanceGroupsGetCall {
  49023. c.ctx_ = ctx
  49024. return c
  49025. }
  49026. // Header returns an http.Header that can be modified by the caller to
  49027. // add HTTP headers to the request.
  49028. func (c *InstanceGroupsGetCall) Header() http.Header {
  49029. if c.header_ == nil {
  49030. c.header_ = make(http.Header)
  49031. }
  49032. return c.header_
  49033. }
  49034. func (c *InstanceGroupsGetCall) doRequest(alt string) (*http.Response, error) {
  49035. reqHeaders := make(http.Header)
  49036. for k, v := range c.header_ {
  49037. reqHeaders[k] = v
  49038. }
  49039. reqHeaders.Set("User-Agent", c.s.userAgent())
  49040. if c.ifNoneMatch_ != "" {
  49041. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  49042. }
  49043. var body io.Reader = nil
  49044. c.urlParams_.Set("alt", alt)
  49045. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroups/{instanceGroup}")
  49046. urls += "?" + c.urlParams_.Encode()
  49047. req, _ := http.NewRequest("GET", urls, body)
  49048. req.Header = reqHeaders
  49049. googleapi.Expand(req.URL, map[string]string{
  49050. "project": c.project,
  49051. "zone": c.zone,
  49052. "instanceGroup": c.instanceGroup,
  49053. })
  49054. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  49055. }
  49056. // Do executes the "compute.instanceGroups.get" call.
  49057. // Exactly one of *InstanceGroup or error will be non-nil. Any non-2xx
  49058. // status code is an error. Response headers are in either
  49059. // *InstanceGroup.ServerResponse.Header or (if a response was returned
  49060. // at all) in error.(*googleapi.Error).Header. Use
  49061. // googleapi.IsNotModified to check whether the returned error was
  49062. // because http.StatusNotModified was returned.
  49063. func (c *InstanceGroupsGetCall) Do(opts ...googleapi.CallOption) (*InstanceGroup, error) {
  49064. gensupport.SetOptions(c.urlParams_, opts...)
  49065. res, err := c.doRequest("json")
  49066. if res != nil && res.StatusCode == http.StatusNotModified {
  49067. if res.Body != nil {
  49068. res.Body.Close()
  49069. }
  49070. return nil, &googleapi.Error{
  49071. Code: res.StatusCode,
  49072. Header: res.Header,
  49073. }
  49074. }
  49075. if err != nil {
  49076. return nil, err
  49077. }
  49078. defer googleapi.CloseBody(res)
  49079. if err := googleapi.CheckResponse(res); err != nil {
  49080. return nil, err
  49081. }
  49082. ret := &InstanceGroup{
  49083. ServerResponse: googleapi.ServerResponse{
  49084. Header: res.Header,
  49085. HTTPStatusCode: res.StatusCode,
  49086. },
  49087. }
  49088. target := &ret
  49089. if err := gensupport.DecodeResponse(target, res); err != nil {
  49090. return nil, err
  49091. }
  49092. return ret, nil
  49093. // {
  49094. // "description": "Returns the specified instance group. Gets a list of available instance groups by making a list() request.",
  49095. // "httpMethod": "GET",
  49096. // "id": "compute.instanceGroups.get",
  49097. // "parameterOrder": [
  49098. // "project",
  49099. // "zone",
  49100. // "instanceGroup"
  49101. // ],
  49102. // "parameters": {
  49103. // "instanceGroup": {
  49104. // "description": "The name of the instance group.",
  49105. // "location": "path",
  49106. // "required": true,
  49107. // "type": "string"
  49108. // },
  49109. // "project": {
  49110. // "description": "Project ID for this request.",
  49111. // "location": "path",
  49112. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  49113. // "required": true,
  49114. // "type": "string"
  49115. // },
  49116. // "zone": {
  49117. // "description": "The name of the zone where the instance group is located.",
  49118. // "location": "path",
  49119. // "required": true,
  49120. // "type": "string"
  49121. // }
  49122. // },
  49123. // "path": "{project}/zones/{zone}/instanceGroups/{instanceGroup}",
  49124. // "response": {
  49125. // "$ref": "InstanceGroup"
  49126. // },
  49127. // "scopes": [
  49128. // "https://www.googleapis.com/auth/cloud-platform",
  49129. // "https://www.googleapis.com/auth/compute",
  49130. // "https://www.googleapis.com/auth/compute.readonly"
  49131. // ]
  49132. // }
  49133. }
  49134. // method id "compute.instanceGroups.insert":
  49135. type InstanceGroupsInsertCall struct {
  49136. s *Service
  49137. project string
  49138. zone string
  49139. instancegroup *InstanceGroup
  49140. urlParams_ gensupport.URLParams
  49141. ctx_ context.Context
  49142. header_ http.Header
  49143. }
  49144. // Insert: Creates an instance group in the specified project using the
  49145. // parameters that are included in the request.
  49146. func (r *InstanceGroupsService) Insert(project string, zone string, instancegroup *InstanceGroup) *InstanceGroupsInsertCall {
  49147. c := &InstanceGroupsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  49148. c.project = project
  49149. c.zone = zone
  49150. c.instancegroup = instancegroup
  49151. return c
  49152. }
  49153. // RequestId sets the optional parameter "requestId": An optional
  49154. // request ID to identify requests. Specify a unique request ID so that
  49155. // if you must retry your request, the server will know to ignore the
  49156. // request if it has already been completed.
  49157. //
  49158. // For example, consider a situation where you make an initial request
  49159. // and the request times out. If you make the request again with the
  49160. // same request ID, the server can check if original operation with the
  49161. // same request ID was received, and if so, will ignore the second
  49162. // request. This prevents clients from accidentally creating duplicate
  49163. // commitments.
  49164. //
  49165. // The request ID must be a valid UUID with the exception that zero UUID
  49166. // is not supported (00000000-0000-0000-0000-000000000000).
  49167. func (c *InstanceGroupsInsertCall) RequestId(requestId string) *InstanceGroupsInsertCall {
  49168. c.urlParams_.Set("requestId", requestId)
  49169. return c
  49170. }
  49171. // Fields allows partial responses to be retrieved. See
  49172. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  49173. // for more information.
  49174. func (c *InstanceGroupsInsertCall) Fields(s ...googleapi.Field) *InstanceGroupsInsertCall {
  49175. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  49176. return c
  49177. }
  49178. // Context sets the context to be used in this call's Do method. Any
  49179. // pending HTTP request will be aborted if the provided context is
  49180. // canceled.
  49181. func (c *InstanceGroupsInsertCall) Context(ctx context.Context) *InstanceGroupsInsertCall {
  49182. c.ctx_ = ctx
  49183. return c
  49184. }
  49185. // Header returns an http.Header that can be modified by the caller to
  49186. // add HTTP headers to the request.
  49187. func (c *InstanceGroupsInsertCall) Header() http.Header {
  49188. if c.header_ == nil {
  49189. c.header_ = make(http.Header)
  49190. }
  49191. return c.header_
  49192. }
  49193. func (c *InstanceGroupsInsertCall) doRequest(alt string) (*http.Response, error) {
  49194. reqHeaders := make(http.Header)
  49195. for k, v := range c.header_ {
  49196. reqHeaders[k] = v
  49197. }
  49198. reqHeaders.Set("User-Agent", c.s.userAgent())
  49199. var body io.Reader = nil
  49200. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroup)
  49201. if err != nil {
  49202. return nil, err
  49203. }
  49204. reqHeaders.Set("Content-Type", "application/json")
  49205. c.urlParams_.Set("alt", alt)
  49206. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroups")
  49207. urls += "?" + c.urlParams_.Encode()
  49208. req, _ := http.NewRequest("POST", urls, body)
  49209. req.Header = reqHeaders
  49210. googleapi.Expand(req.URL, map[string]string{
  49211. "project": c.project,
  49212. "zone": c.zone,
  49213. })
  49214. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  49215. }
  49216. // Do executes the "compute.instanceGroups.insert" call.
  49217. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  49218. // status code is an error. Response headers are in either
  49219. // *Operation.ServerResponse.Header or (if a response was returned at
  49220. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  49221. // to check whether the returned error was because
  49222. // http.StatusNotModified was returned.
  49223. func (c *InstanceGroupsInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  49224. gensupport.SetOptions(c.urlParams_, opts...)
  49225. res, err := c.doRequest("json")
  49226. if res != nil && res.StatusCode == http.StatusNotModified {
  49227. if res.Body != nil {
  49228. res.Body.Close()
  49229. }
  49230. return nil, &googleapi.Error{
  49231. Code: res.StatusCode,
  49232. Header: res.Header,
  49233. }
  49234. }
  49235. if err != nil {
  49236. return nil, err
  49237. }
  49238. defer googleapi.CloseBody(res)
  49239. if err := googleapi.CheckResponse(res); err != nil {
  49240. return nil, err
  49241. }
  49242. ret := &Operation{
  49243. ServerResponse: googleapi.ServerResponse{
  49244. Header: res.Header,
  49245. HTTPStatusCode: res.StatusCode,
  49246. },
  49247. }
  49248. target := &ret
  49249. if err := gensupport.DecodeResponse(target, res); err != nil {
  49250. return nil, err
  49251. }
  49252. return ret, nil
  49253. // {
  49254. // "description": "Creates an instance group in the specified project using the parameters that are included in the request.",
  49255. // "httpMethod": "POST",
  49256. // "id": "compute.instanceGroups.insert",
  49257. // "parameterOrder": [
  49258. // "project",
  49259. // "zone"
  49260. // ],
  49261. // "parameters": {
  49262. // "project": {
  49263. // "description": "Project ID for this request.",
  49264. // "location": "path",
  49265. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  49266. // "required": true,
  49267. // "type": "string"
  49268. // },
  49269. // "requestId": {
  49270. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  49271. // "location": "query",
  49272. // "type": "string"
  49273. // },
  49274. // "zone": {
  49275. // "description": "The name of the zone where you want to create the instance group.",
  49276. // "location": "path",
  49277. // "required": true,
  49278. // "type": "string"
  49279. // }
  49280. // },
  49281. // "path": "{project}/zones/{zone}/instanceGroups",
  49282. // "request": {
  49283. // "$ref": "InstanceGroup"
  49284. // },
  49285. // "response": {
  49286. // "$ref": "Operation"
  49287. // },
  49288. // "scopes": [
  49289. // "https://www.googleapis.com/auth/cloud-platform",
  49290. // "https://www.googleapis.com/auth/compute"
  49291. // ]
  49292. // }
  49293. }
  49294. // method id "compute.instanceGroups.list":
  49295. type InstanceGroupsListCall struct {
  49296. s *Service
  49297. project string
  49298. zone string
  49299. urlParams_ gensupport.URLParams
  49300. ifNoneMatch_ string
  49301. ctx_ context.Context
  49302. header_ http.Header
  49303. }
  49304. // List: Retrieves the list of instance groups that are located in the
  49305. // specified project and zone.
  49306. func (r *InstanceGroupsService) List(project string, zone string) *InstanceGroupsListCall {
  49307. c := &InstanceGroupsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  49308. c.project = project
  49309. c.zone = zone
  49310. return c
  49311. }
  49312. // Filter sets the optional parameter "filter": A filter expression that
  49313. // filters resources listed in the response. The expression must specify
  49314. // the field name, a comparison operator, and the value that you want to
  49315. // use for filtering. The value must be a string, a number, or a
  49316. // boolean. The comparison operator must be either =, !=, >, or <.
  49317. //
  49318. // For example, if you are filtering Compute Engine instances, you can
  49319. // exclude instances named example-instance by specifying name !=
  49320. // example-instance.
  49321. //
  49322. // You can also filter nested fields. For example, you could specify
  49323. // scheduling.automaticRestart = false to include instances only if they
  49324. // are not scheduled for automatic restarts. You can use filtering on
  49325. // nested fields to filter based on resource labels.
  49326. //
  49327. // To filter on multiple expressions, provide each separate expression
  49328. // within parentheses. For example, (scheduling.automaticRestart = true)
  49329. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  49330. // AND expression. However, you can include AND and OR expressions
  49331. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  49332. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  49333. // true).
  49334. func (c *InstanceGroupsListCall) Filter(filter string) *InstanceGroupsListCall {
  49335. c.urlParams_.Set("filter", filter)
  49336. return c
  49337. }
  49338. // MaxResults sets the optional parameter "maxResults": The maximum
  49339. // number of results per page that should be returned. If the number of
  49340. // available results is larger than maxResults, Compute Engine returns a
  49341. // nextPageToken that can be used to get the next page of results in
  49342. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  49343. // (Default: 500)
  49344. func (c *InstanceGroupsListCall) MaxResults(maxResults int64) *InstanceGroupsListCall {
  49345. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  49346. return c
  49347. }
  49348. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  49349. // a certain order. By default, results are returned in alphanumerical
  49350. // order based on the resource name.
  49351. //
  49352. // You can also sort results in descending order based on the creation
  49353. // timestamp using orderBy="creationTimestamp desc". This sorts results
  49354. // based on the creationTimestamp field in reverse chronological order
  49355. // (newest result first). Use this to sort resources like operations so
  49356. // that the newest operation is returned first.
  49357. //
  49358. // Currently, only sorting by name or creationTimestamp desc is
  49359. // supported.
  49360. func (c *InstanceGroupsListCall) OrderBy(orderBy string) *InstanceGroupsListCall {
  49361. c.urlParams_.Set("orderBy", orderBy)
  49362. return c
  49363. }
  49364. // PageToken sets the optional parameter "pageToken": Specifies a page
  49365. // token to use. Set pageToken to the nextPageToken returned by a
  49366. // previous list request to get the next page of results.
  49367. func (c *InstanceGroupsListCall) PageToken(pageToken string) *InstanceGroupsListCall {
  49368. c.urlParams_.Set("pageToken", pageToken)
  49369. return c
  49370. }
  49371. // Fields allows partial responses to be retrieved. See
  49372. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  49373. // for more information.
  49374. func (c *InstanceGroupsListCall) Fields(s ...googleapi.Field) *InstanceGroupsListCall {
  49375. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  49376. return c
  49377. }
  49378. // IfNoneMatch sets the optional parameter which makes the operation
  49379. // fail if the object's ETag matches the given value. This is useful for
  49380. // getting updates only after the object has changed since the last
  49381. // request. Use googleapi.IsNotModified to check whether the response
  49382. // error from Do is the result of In-None-Match.
  49383. func (c *InstanceGroupsListCall) IfNoneMatch(entityTag string) *InstanceGroupsListCall {
  49384. c.ifNoneMatch_ = entityTag
  49385. return c
  49386. }
  49387. // Context sets the context to be used in this call's Do method. Any
  49388. // pending HTTP request will be aborted if the provided context is
  49389. // canceled.
  49390. func (c *InstanceGroupsListCall) Context(ctx context.Context) *InstanceGroupsListCall {
  49391. c.ctx_ = ctx
  49392. return c
  49393. }
  49394. // Header returns an http.Header that can be modified by the caller to
  49395. // add HTTP headers to the request.
  49396. func (c *InstanceGroupsListCall) Header() http.Header {
  49397. if c.header_ == nil {
  49398. c.header_ = make(http.Header)
  49399. }
  49400. return c.header_
  49401. }
  49402. func (c *InstanceGroupsListCall) doRequest(alt string) (*http.Response, error) {
  49403. reqHeaders := make(http.Header)
  49404. for k, v := range c.header_ {
  49405. reqHeaders[k] = v
  49406. }
  49407. reqHeaders.Set("User-Agent", c.s.userAgent())
  49408. if c.ifNoneMatch_ != "" {
  49409. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  49410. }
  49411. var body io.Reader = nil
  49412. c.urlParams_.Set("alt", alt)
  49413. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroups")
  49414. urls += "?" + c.urlParams_.Encode()
  49415. req, _ := http.NewRequest("GET", urls, body)
  49416. req.Header = reqHeaders
  49417. googleapi.Expand(req.URL, map[string]string{
  49418. "project": c.project,
  49419. "zone": c.zone,
  49420. })
  49421. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  49422. }
  49423. // Do executes the "compute.instanceGroups.list" call.
  49424. // Exactly one of *InstanceGroupList or error will be non-nil. Any
  49425. // non-2xx status code is an error. Response headers are in either
  49426. // *InstanceGroupList.ServerResponse.Header or (if a response was
  49427. // returned at all) in error.(*googleapi.Error).Header. Use
  49428. // googleapi.IsNotModified to check whether the returned error was
  49429. // because http.StatusNotModified was returned.
  49430. func (c *InstanceGroupsListCall) Do(opts ...googleapi.CallOption) (*InstanceGroupList, error) {
  49431. gensupport.SetOptions(c.urlParams_, opts...)
  49432. res, err := c.doRequest("json")
  49433. if res != nil && res.StatusCode == http.StatusNotModified {
  49434. if res.Body != nil {
  49435. res.Body.Close()
  49436. }
  49437. return nil, &googleapi.Error{
  49438. Code: res.StatusCode,
  49439. Header: res.Header,
  49440. }
  49441. }
  49442. if err != nil {
  49443. return nil, err
  49444. }
  49445. defer googleapi.CloseBody(res)
  49446. if err := googleapi.CheckResponse(res); err != nil {
  49447. return nil, err
  49448. }
  49449. ret := &InstanceGroupList{
  49450. ServerResponse: googleapi.ServerResponse{
  49451. Header: res.Header,
  49452. HTTPStatusCode: res.StatusCode,
  49453. },
  49454. }
  49455. target := &ret
  49456. if err := gensupport.DecodeResponse(target, res); err != nil {
  49457. return nil, err
  49458. }
  49459. return ret, nil
  49460. // {
  49461. // "description": "Retrieves the list of instance groups that are located in the specified project and zone.",
  49462. // "httpMethod": "GET",
  49463. // "id": "compute.instanceGroups.list",
  49464. // "parameterOrder": [
  49465. // "project",
  49466. // "zone"
  49467. // ],
  49468. // "parameters": {
  49469. // "filter": {
  49470. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  49471. // "location": "query",
  49472. // "type": "string"
  49473. // },
  49474. // "maxResults": {
  49475. // "default": "500",
  49476. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  49477. // "format": "uint32",
  49478. // "location": "query",
  49479. // "minimum": "0",
  49480. // "type": "integer"
  49481. // },
  49482. // "orderBy": {
  49483. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  49484. // "location": "query",
  49485. // "type": "string"
  49486. // },
  49487. // "pageToken": {
  49488. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  49489. // "location": "query",
  49490. // "type": "string"
  49491. // },
  49492. // "project": {
  49493. // "description": "Project ID for this request.",
  49494. // "location": "path",
  49495. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  49496. // "required": true,
  49497. // "type": "string"
  49498. // },
  49499. // "zone": {
  49500. // "description": "The name of the zone where the instance group is located.",
  49501. // "location": "path",
  49502. // "required": true,
  49503. // "type": "string"
  49504. // }
  49505. // },
  49506. // "path": "{project}/zones/{zone}/instanceGroups",
  49507. // "response": {
  49508. // "$ref": "InstanceGroupList"
  49509. // },
  49510. // "scopes": [
  49511. // "https://www.googleapis.com/auth/cloud-platform",
  49512. // "https://www.googleapis.com/auth/compute",
  49513. // "https://www.googleapis.com/auth/compute.readonly"
  49514. // ]
  49515. // }
  49516. }
  49517. // Pages invokes f for each page of results.
  49518. // A non-nil error returned from f will halt the iteration.
  49519. // The provided context supersedes any context provided to the Context method.
  49520. func (c *InstanceGroupsListCall) Pages(ctx context.Context, f func(*InstanceGroupList) error) error {
  49521. c.ctx_ = ctx
  49522. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  49523. for {
  49524. x, err := c.Do()
  49525. if err != nil {
  49526. return err
  49527. }
  49528. if err := f(x); err != nil {
  49529. return err
  49530. }
  49531. if x.NextPageToken == "" {
  49532. return nil
  49533. }
  49534. c.PageToken(x.NextPageToken)
  49535. }
  49536. }
  49537. // method id "compute.instanceGroups.listInstances":
  49538. type InstanceGroupsListInstancesCall struct {
  49539. s *Service
  49540. project string
  49541. zone string
  49542. instanceGroup string
  49543. instancegroupslistinstancesrequest *InstanceGroupsListInstancesRequest
  49544. urlParams_ gensupport.URLParams
  49545. ctx_ context.Context
  49546. header_ http.Header
  49547. }
  49548. // ListInstances: Lists the instances in the specified instance group.
  49549. func (r *InstanceGroupsService) ListInstances(project string, zone string, instanceGroup string, instancegroupslistinstancesrequest *InstanceGroupsListInstancesRequest) *InstanceGroupsListInstancesCall {
  49550. c := &InstanceGroupsListInstancesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  49551. c.project = project
  49552. c.zone = zone
  49553. c.instanceGroup = instanceGroup
  49554. c.instancegroupslistinstancesrequest = instancegroupslistinstancesrequest
  49555. return c
  49556. }
  49557. // Filter sets the optional parameter "filter": A filter expression that
  49558. // filters resources listed in the response. The expression must specify
  49559. // the field name, a comparison operator, and the value that you want to
  49560. // use for filtering. The value must be a string, a number, or a
  49561. // boolean. The comparison operator must be either =, !=, >, or <.
  49562. //
  49563. // For example, if you are filtering Compute Engine instances, you can
  49564. // exclude instances named example-instance by specifying name !=
  49565. // example-instance.
  49566. //
  49567. // You can also filter nested fields. For example, you could specify
  49568. // scheduling.automaticRestart = false to include instances only if they
  49569. // are not scheduled for automatic restarts. You can use filtering on
  49570. // nested fields to filter based on resource labels.
  49571. //
  49572. // To filter on multiple expressions, provide each separate expression
  49573. // within parentheses. For example, (scheduling.automaticRestart = true)
  49574. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  49575. // AND expression. However, you can include AND and OR expressions
  49576. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  49577. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  49578. // true).
  49579. func (c *InstanceGroupsListInstancesCall) Filter(filter string) *InstanceGroupsListInstancesCall {
  49580. c.urlParams_.Set("filter", filter)
  49581. return c
  49582. }
  49583. // MaxResults sets the optional parameter "maxResults": The maximum
  49584. // number of results per page that should be returned. If the number of
  49585. // available results is larger than maxResults, Compute Engine returns a
  49586. // nextPageToken that can be used to get the next page of results in
  49587. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  49588. // (Default: 500)
  49589. func (c *InstanceGroupsListInstancesCall) MaxResults(maxResults int64) *InstanceGroupsListInstancesCall {
  49590. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  49591. return c
  49592. }
  49593. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  49594. // a certain order. By default, results are returned in alphanumerical
  49595. // order based on the resource name.
  49596. //
  49597. // You can also sort results in descending order based on the creation
  49598. // timestamp using orderBy="creationTimestamp desc". This sorts results
  49599. // based on the creationTimestamp field in reverse chronological order
  49600. // (newest result first). Use this to sort resources like operations so
  49601. // that the newest operation is returned first.
  49602. //
  49603. // Currently, only sorting by name or creationTimestamp desc is
  49604. // supported.
  49605. func (c *InstanceGroupsListInstancesCall) OrderBy(orderBy string) *InstanceGroupsListInstancesCall {
  49606. c.urlParams_.Set("orderBy", orderBy)
  49607. return c
  49608. }
  49609. // PageToken sets the optional parameter "pageToken": Specifies a page
  49610. // token to use. Set pageToken to the nextPageToken returned by a
  49611. // previous list request to get the next page of results.
  49612. func (c *InstanceGroupsListInstancesCall) PageToken(pageToken string) *InstanceGroupsListInstancesCall {
  49613. c.urlParams_.Set("pageToken", pageToken)
  49614. return c
  49615. }
  49616. // Fields allows partial responses to be retrieved. See
  49617. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  49618. // for more information.
  49619. func (c *InstanceGroupsListInstancesCall) Fields(s ...googleapi.Field) *InstanceGroupsListInstancesCall {
  49620. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  49621. return c
  49622. }
  49623. // Context sets the context to be used in this call's Do method. Any
  49624. // pending HTTP request will be aborted if the provided context is
  49625. // canceled.
  49626. func (c *InstanceGroupsListInstancesCall) Context(ctx context.Context) *InstanceGroupsListInstancesCall {
  49627. c.ctx_ = ctx
  49628. return c
  49629. }
  49630. // Header returns an http.Header that can be modified by the caller to
  49631. // add HTTP headers to the request.
  49632. func (c *InstanceGroupsListInstancesCall) Header() http.Header {
  49633. if c.header_ == nil {
  49634. c.header_ = make(http.Header)
  49635. }
  49636. return c.header_
  49637. }
  49638. func (c *InstanceGroupsListInstancesCall) doRequest(alt string) (*http.Response, error) {
  49639. reqHeaders := make(http.Header)
  49640. for k, v := range c.header_ {
  49641. reqHeaders[k] = v
  49642. }
  49643. reqHeaders.Set("User-Agent", c.s.userAgent())
  49644. var body io.Reader = nil
  49645. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupslistinstancesrequest)
  49646. if err != nil {
  49647. return nil, err
  49648. }
  49649. reqHeaders.Set("Content-Type", "application/json")
  49650. c.urlParams_.Set("alt", alt)
  49651. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroups/{instanceGroup}/listInstances")
  49652. urls += "?" + c.urlParams_.Encode()
  49653. req, _ := http.NewRequest("POST", urls, body)
  49654. req.Header = reqHeaders
  49655. googleapi.Expand(req.URL, map[string]string{
  49656. "project": c.project,
  49657. "zone": c.zone,
  49658. "instanceGroup": c.instanceGroup,
  49659. })
  49660. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  49661. }
  49662. // Do executes the "compute.instanceGroups.listInstances" call.
  49663. // Exactly one of *InstanceGroupsListInstances or error will be non-nil.
  49664. // Any non-2xx status code is an error. Response headers are in either
  49665. // *InstanceGroupsListInstances.ServerResponse.Header or (if a response
  49666. // was returned at all) in error.(*googleapi.Error).Header. Use
  49667. // googleapi.IsNotModified to check whether the returned error was
  49668. // because http.StatusNotModified was returned.
  49669. func (c *InstanceGroupsListInstancesCall) Do(opts ...googleapi.CallOption) (*InstanceGroupsListInstances, error) {
  49670. gensupport.SetOptions(c.urlParams_, opts...)
  49671. res, err := c.doRequest("json")
  49672. if res != nil && res.StatusCode == http.StatusNotModified {
  49673. if res.Body != nil {
  49674. res.Body.Close()
  49675. }
  49676. return nil, &googleapi.Error{
  49677. Code: res.StatusCode,
  49678. Header: res.Header,
  49679. }
  49680. }
  49681. if err != nil {
  49682. return nil, err
  49683. }
  49684. defer googleapi.CloseBody(res)
  49685. if err := googleapi.CheckResponse(res); err != nil {
  49686. return nil, err
  49687. }
  49688. ret := &InstanceGroupsListInstances{
  49689. ServerResponse: googleapi.ServerResponse{
  49690. Header: res.Header,
  49691. HTTPStatusCode: res.StatusCode,
  49692. },
  49693. }
  49694. target := &ret
  49695. if err := gensupport.DecodeResponse(target, res); err != nil {
  49696. return nil, err
  49697. }
  49698. return ret, nil
  49699. // {
  49700. // "description": "Lists the instances in the specified instance group.",
  49701. // "httpMethod": "POST",
  49702. // "id": "compute.instanceGroups.listInstances",
  49703. // "parameterOrder": [
  49704. // "project",
  49705. // "zone",
  49706. // "instanceGroup"
  49707. // ],
  49708. // "parameters": {
  49709. // "filter": {
  49710. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  49711. // "location": "query",
  49712. // "type": "string"
  49713. // },
  49714. // "instanceGroup": {
  49715. // "description": "The name of the instance group from which you want to generate a list of included instances.",
  49716. // "location": "path",
  49717. // "required": true,
  49718. // "type": "string"
  49719. // },
  49720. // "maxResults": {
  49721. // "default": "500",
  49722. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  49723. // "format": "uint32",
  49724. // "location": "query",
  49725. // "minimum": "0",
  49726. // "type": "integer"
  49727. // },
  49728. // "orderBy": {
  49729. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  49730. // "location": "query",
  49731. // "type": "string"
  49732. // },
  49733. // "pageToken": {
  49734. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  49735. // "location": "query",
  49736. // "type": "string"
  49737. // },
  49738. // "project": {
  49739. // "description": "Project ID for this request.",
  49740. // "location": "path",
  49741. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  49742. // "required": true,
  49743. // "type": "string"
  49744. // },
  49745. // "zone": {
  49746. // "description": "The name of the zone where the instance group is located.",
  49747. // "location": "path",
  49748. // "required": true,
  49749. // "type": "string"
  49750. // }
  49751. // },
  49752. // "path": "{project}/zones/{zone}/instanceGroups/{instanceGroup}/listInstances",
  49753. // "request": {
  49754. // "$ref": "InstanceGroupsListInstancesRequest"
  49755. // },
  49756. // "response": {
  49757. // "$ref": "InstanceGroupsListInstances"
  49758. // },
  49759. // "scopes": [
  49760. // "https://www.googleapis.com/auth/cloud-platform",
  49761. // "https://www.googleapis.com/auth/compute",
  49762. // "https://www.googleapis.com/auth/compute.readonly"
  49763. // ]
  49764. // }
  49765. }
  49766. // Pages invokes f for each page of results.
  49767. // A non-nil error returned from f will halt the iteration.
  49768. // The provided context supersedes any context provided to the Context method.
  49769. func (c *InstanceGroupsListInstancesCall) Pages(ctx context.Context, f func(*InstanceGroupsListInstances) error) error {
  49770. c.ctx_ = ctx
  49771. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  49772. for {
  49773. x, err := c.Do()
  49774. if err != nil {
  49775. return err
  49776. }
  49777. if err := f(x); err != nil {
  49778. return err
  49779. }
  49780. if x.NextPageToken == "" {
  49781. return nil
  49782. }
  49783. c.PageToken(x.NextPageToken)
  49784. }
  49785. }
  49786. // method id "compute.instanceGroups.removeInstances":
  49787. type InstanceGroupsRemoveInstancesCall struct {
  49788. s *Service
  49789. project string
  49790. zone string
  49791. instanceGroup string
  49792. instancegroupsremoveinstancesrequest *InstanceGroupsRemoveInstancesRequest
  49793. urlParams_ gensupport.URLParams
  49794. ctx_ context.Context
  49795. header_ http.Header
  49796. }
  49797. // RemoveInstances: Removes one or more instances from the specified
  49798. // instance group, but does not delete those instances.
  49799. //
  49800. // If the group is part of a backend service that has enabled connection
  49801. // draining, it can take up to 60 seconds after the connection draining
  49802. // duration before the VM instance is removed or deleted.
  49803. func (r *InstanceGroupsService) RemoveInstances(project string, zone string, instanceGroup string, instancegroupsremoveinstancesrequest *InstanceGroupsRemoveInstancesRequest) *InstanceGroupsRemoveInstancesCall {
  49804. c := &InstanceGroupsRemoveInstancesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  49805. c.project = project
  49806. c.zone = zone
  49807. c.instanceGroup = instanceGroup
  49808. c.instancegroupsremoveinstancesrequest = instancegroupsremoveinstancesrequest
  49809. return c
  49810. }
  49811. // RequestId sets the optional parameter "requestId": An optional
  49812. // request ID to identify requests. Specify a unique request ID so that
  49813. // if you must retry your request, the server will know to ignore the
  49814. // request if it has already been completed.
  49815. //
  49816. // For example, consider a situation where you make an initial request
  49817. // and the request times out. If you make the request again with the
  49818. // same request ID, the server can check if original operation with the
  49819. // same request ID was received, and if so, will ignore the second
  49820. // request. This prevents clients from accidentally creating duplicate
  49821. // commitments.
  49822. //
  49823. // The request ID must be a valid UUID with the exception that zero UUID
  49824. // is not supported (00000000-0000-0000-0000-000000000000).
  49825. func (c *InstanceGroupsRemoveInstancesCall) RequestId(requestId string) *InstanceGroupsRemoveInstancesCall {
  49826. c.urlParams_.Set("requestId", requestId)
  49827. return c
  49828. }
  49829. // Fields allows partial responses to be retrieved. See
  49830. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  49831. // for more information.
  49832. func (c *InstanceGroupsRemoveInstancesCall) Fields(s ...googleapi.Field) *InstanceGroupsRemoveInstancesCall {
  49833. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  49834. return c
  49835. }
  49836. // Context sets the context to be used in this call's Do method. Any
  49837. // pending HTTP request will be aborted if the provided context is
  49838. // canceled.
  49839. func (c *InstanceGroupsRemoveInstancesCall) Context(ctx context.Context) *InstanceGroupsRemoveInstancesCall {
  49840. c.ctx_ = ctx
  49841. return c
  49842. }
  49843. // Header returns an http.Header that can be modified by the caller to
  49844. // add HTTP headers to the request.
  49845. func (c *InstanceGroupsRemoveInstancesCall) Header() http.Header {
  49846. if c.header_ == nil {
  49847. c.header_ = make(http.Header)
  49848. }
  49849. return c.header_
  49850. }
  49851. func (c *InstanceGroupsRemoveInstancesCall) doRequest(alt string) (*http.Response, error) {
  49852. reqHeaders := make(http.Header)
  49853. for k, v := range c.header_ {
  49854. reqHeaders[k] = v
  49855. }
  49856. reqHeaders.Set("User-Agent", c.s.userAgent())
  49857. var body io.Reader = nil
  49858. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupsremoveinstancesrequest)
  49859. if err != nil {
  49860. return nil, err
  49861. }
  49862. reqHeaders.Set("Content-Type", "application/json")
  49863. c.urlParams_.Set("alt", alt)
  49864. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroups/{instanceGroup}/removeInstances")
  49865. urls += "?" + c.urlParams_.Encode()
  49866. req, _ := http.NewRequest("POST", urls, body)
  49867. req.Header = reqHeaders
  49868. googleapi.Expand(req.URL, map[string]string{
  49869. "project": c.project,
  49870. "zone": c.zone,
  49871. "instanceGroup": c.instanceGroup,
  49872. })
  49873. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  49874. }
  49875. // Do executes the "compute.instanceGroups.removeInstances" call.
  49876. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  49877. // status code is an error. Response headers are in either
  49878. // *Operation.ServerResponse.Header or (if a response was returned at
  49879. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  49880. // to check whether the returned error was because
  49881. // http.StatusNotModified was returned.
  49882. func (c *InstanceGroupsRemoveInstancesCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  49883. gensupport.SetOptions(c.urlParams_, opts...)
  49884. res, err := c.doRequest("json")
  49885. if res != nil && res.StatusCode == http.StatusNotModified {
  49886. if res.Body != nil {
  49887. res.Body.Close()
  49888. }
  49889. return nil, &googleapi.Error{
  49890. Code: res.StatusCode,
  49891. Header: res.Header,
  49892. }
  49893. }
  49894. if err != nil {
  49895. return nil, err
  49896. }
  49897. defer googleapi.CloseBody(res)
  49898. if err := googleapi.CheckResponse(res); err != nil {
  49899. return nil, err
  49900. }
  49901. ret := &Operation{
  49902. ServerResponse: googleapi.ServerResponse{
  49903. Header: res.Header,
  49904. HTTPStatusCode: res.StatusCode,
  49905. },
  49906. }
  49907. target := &ret
  49908. if err := gensupport.DecodeResponse(target, res); err != nil {
  49909. return nil, err
  49910. }
  49911. return ret, nil
  49912. // {
  49913. // "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.",
  49914. // "httpMethod": "POST",
  49915. // "id": "compute.instanceGroups.removeInstances",
  49916. // "parameterOrder": [
  49917. // "project",
  49918. // "zone",
  49919. // "instanceGroup"
  49920. // ],
  49921. // "parameters": {
  49922. // "instanceGroup": {
  49923. // "description": "The name of the instance group where the specified instances will be removed.",
  49924. // "location": "path",
  49925. // "required": true,
  49926. // "type": "string"
  49927. // },
  49928. // "project": {
  49929. // "description": "Project ID for this request.",
  49930. // "location": "path",
  49931. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  49932. // "required": true,
  49933. // "type": "string"
  49934. // },
  49935. // "requestId": {
  49936. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  49937. // "location": "query",
  49938. // "type": "string"
  49939. // },
  49940. // "zone": {
  49941. // "description": "The name of the zone where the instance group is located.",
  49942. // "location": "path",
  49943. // "required": true,
  49944. // "type": "string"
  49945. // }
  49946. // },
  49947. // "path": "{project}/zones/{zone}/instanceGroups/{instanceGroup}/removeInstances",
  49948. // "request": {
  49949. // "$ref": "InstanceGroupsRemoveInstancesRequest"
  49950. // },
  49951. // "response": {
  49952. // "$ref": "Operation"
  49953. // },
  49954. // "scopes": [
  49955. // "https://www.googleapis.com/auth/cloud-platform",
  49956. // "https://www.googleapis.com/auth/compute"
  49957. // ]
  49958. // }
  49959. }
  49960. // method id "compute.instanceGroups.setNamedPorts":
  49961. type InstanceGroupsSetNamedPortsCall struct {
  49962. s *Service
  49963. project string
  49964. zone string
  49965. instanceGroup string
  49966. instancegroupssetnamedportsrequest *InstanceGroupsSetNamedPortsRequest
  49967. urlParams_ gensupport.URLParams
  49968. ctx_ context.Context
  49969. header_ http.Header
  49970. }
  49971. // SetNamedPorts: Sets the named ports for the specified instance group.
  49972. func (r *InstanceGroupsService) SetNamedPorts(project string, zone string, instanceGroup string, instancegroupssetnamedportsrequest *InstanceGroupsSetNamedPortsRequest) *InstanceGroupsSetNamedPortsCall {
  49973. c := &InstanceGroupsSetNamedPortsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  49974. c.project = project
  49975. c.zone = zone
  49976. c.instanceGroup = instanceGroup
  49977. c.instancegroupssetnamedportsrequest = instancegroupssetnamedportsrequest
  49978. return c
  49979. }
  49980. // RequestId sets the optional parameter "requestId": An optional
  49981. // request ID to identify requests. Specify a unique request ID so that
  49982. // if you must retry your request, the server will know to ignore the
  49983. // request if it has already been completed.
  49984. //
  49985. // For example, consider a situation where you make an initial request
  49986. // and the request times out. If you make the request again with the
  49987. // same request ID, the server can check if original operation with the
  49988. // same request ID was received, and if so, will ignore the second
  49989. // request. This prevents clients from accidentally creating duplicate
  49990. // commitments.
  49991. //
  49992. // The request ID must be a valid UUID with the exception that zero UUID
  49993. // is not supported (00000000-0000-0000-0000-000000000000).
  49994. func (c *InstanceGroupsSetNamedPortsCall) RequestId(requestId string) *InstanceGroupsSetNamedPortsCall {
  49995. c.urlParams_.Set("requestId", requestId)
  49996. return c
  49997. }
  49998. // Fields allows partial responses to be retrieved. See
  49999. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  50000. // for more information.
  50001. func (c *InstanceGroupsSetNamedPortsCall) Fields(s ...googleapi.Field) *InstanceGroupsSetNamedPortsCall {
  50002. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  50003. return c
  50004. }
  50005. // Context sets the context to be used in this call's Do method. Any
  50006. // pending HTTP request will be aborted if the provided context is
  50007. // canceled.
  50008. func (c *InstanceGroupsSetNamedPortsCall) Context(ctx context.Context) *InstanceGroupsSetNamedPortsCall {
  50009. c.ctx_ = ctx
  50010. return c
  50011. }
  50012. // Header returns an http.Header that can be modified by the caller to
  50013. // add HTTP headers to the request.
  50014. func (c *InstanceGroupsSetNamedPortsCall) Header() http.Header {
  50015. if c.header_ == nil {
  50016. c.header_ = make(http.Header)
  50017. }
  50018. return c.header_
  50019. }
  50020. func (c *InstanceGroupsSetNamedPortsCall) doRequest(alt string) (*http.Response, error) {
  50021. reqHeaders := make(http.Header)
  50022. for k, v := range c.header_ {
  50023. reqHeaders[k] = v
  50024. }
  50025. reqHeaders.Set("User-Agent", c.s.userAgent())
  50026. var body io.Reader = nil
  50027. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupssetnamedportsrequest)
  50028. if err != nil {
  50029. return nil, err
  50030. }
  50031. reqHeaders.Set("Content-Type", "application/json")
  50032. c.urlParams_.Set("alt", alt)
  50033. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroups/{instanceGroup}/setNamedPorts")
  50034. urls += "?" + c.urlParams_.Encode()
  50035. req, _ := http.NewRequest("POST", urls, body)
  50036. req.Header = reqHeaders
  50037. googleapi.Expand(req.URL, map[string]string{
  50038. "project": c.project,
  50039. "zone": c.zone,
  50040. "instanceGroup": c.instanceGroup,
  50041. })
  50042. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  50043. }
  50044. // Do executes the "compute.instanceGroups.setNamedPorts" call.
  50045. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  50046. // status code is an error. Response headers are in either
  50047. // *Operation.ServerResponse.Header or (if a response was returned at
  50048. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  50049. // to check whether the returned error was because
  50050. // http.StatusNotModified was returned.
  50051. func (c *InstanceGroupsSetNamedPortsCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  50052. gensupport.SetOptions(c.urlParams_, opts...)
  50053. res, err := c.doRequest("json")
  50054. if res != nil && res.StatusCode == http.StatusNotModified {
  50055. if res.Body != nil {
  50056. res.Body.Close()
  50057. }
  50058. return nil, &googleapi.Error{
  50059. Code: res.StatusCode,
  50060. Header: res.Header,
  50061. }
  50062. }
  50063. if err != nil {
  50064. return nil, err
  50065. }
  50066. defer googleapi.CloseBody(res)
  50067. if err := googleapi.CheckResponse(res); err != nil {
  50068. return nil, err
  50069. }
  50070. ret := &Operation{
  50071. ServerResponse: googleapi.ServerResponse{
  50072. Header: res.Header,
  50073. HTTPStatusCode: res.StatusCode,
  50074. },
  50075. }
  50076. target := &ret
  50077. if err := gensupport.DecodeResponse(target, res); err != nil {
  50078. return nil, err
  50079. }
  50080. return ret, nil
  50081. // {
  50082. // "description": "Sets the named ports for the specified instance group.",
  50083. // "httpMethod": "POST",
  50084. // "id": "compute.instanceGroups.setNamedPorts",
  50085. // "parameterOrder": [
  50086. // "project",
  50087. // "zone",
  50088. // "instanceGroup"
  50089. // ],
  50090. // "parameters": {
  50091. // "instanceGroup": {
  50092. // "description": "The name of the instance group where the named ports are updated.",
  50093. // "location": "path",
  50094. // "required": true,
  50095. // "type": "string"
  50096. // },
  50097. // "project": {
  50098. // "description": "Project ID for this request.",
  50099. // "location": "path",
  50100. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  50101. // "required": true,
  50102. // "type": "string"
  50103. // },
  50104. // "requestId": {
  50105. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  50106. // "location": "query",
  50107. // "type": "string"
  50108. // },
  50109. // "zone": {
  50110. // "description": "The name of the zone where the instance group is located.",
  50111. // "location": "path",
  50112. // "required": true,
  50113. // "type": "string"
  50114. // }
  50115. // },
  50116. // "path": "{project}/zones/{zone}/instanceGroups/{instanceGroup}/setNamedPorts",
  50117. // "request": {
  50118. // "$ref": "InstanceGroupsSetNamedPortsRequest"
  50119. // },
  50120. // "response": {
  50121. // "$ref": "Operation"
  50122. // },
  50123. // "scopes": [
  50124. // "https://www.googleapis.com/auth/cloud-platform",
  50125. // "https://www.googleapis.com/auth/compute"
  50126. // ]
  50127. // }
  50128. }
  50129. // method id "compute.instanceGroups.testIamPermissions":
  50130. type InstanceGroupsTestIamPermissionsCall struct {
  50131. s *Service
  50132. project string
  50133. zone string
  50134. resource string
  50135. testpermissionsrequest *TestPermissionsRequest
  50136. urlParams_ gensupport.URLParams
  50137. ctx_ context.Context
  50138. header_ http.Header
  50139. }
  50140. // TestIamPermissions: Returns permissions that a caller has on the
  50141. // specified resource.
  50142. func (r *InstanceGroupsService) TestIamPermissions(project string, zone string, resource string, testpermissionsrequest *TestPermissionsRequest) *InstanceGroupsTestIamPermissionsCall {
  50143. c := &InstanceGroupsTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  50144. c.project = project
  50145. c.zone = zone
  50146. c.resource = resource
  50147. c.testpermissionsrequest = testpermissionsrequest
  50148. return c
  50149. }
  50150. // Fields allows partial responses to be retrieved. See
  50151. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  50152. // for more information.
  50153. func (c *InstanceGroupsTestIamPermissionsCall) Fields(s ...googleapi.Field) *InstanceGroupsTestIamPermissionsCall {
  50154. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  50155. return c
  50156. }
  50157. // Context sets the context to be used in this call's Do method. Any
  50158. // pending HTTP request will be aborted if the provided context is
  50159. // canceled.
  50160. func (c *InstanceGroupsTestIamPermissionsCall) Context(ctx context.Context) *InstanceGroupsTestIamPermissionsCall {
  50161. c.ctx_ = ctx
  50162. return c
  50163. }
  50164. // Header returns an http.Header that can be modified by the caller to
  50165. // add HTTP headers to the request.
  50166. func (c *InstanceGroupsTestIamPermissionsCall) Header() http.Header {
  50167. if c.header_ == nil {
  50168. c.header_ = make(http.Header)
  50169. }
  50170. return c.header_
  50171. }
  50172. func (c *InstanceGroupsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  50173. reqHeaders := make(http.Header)
  50174. for k, v := range c.header_ {
  50175. reqHeaders[k] = v
  50176. }
  50177. reqHeaders.Set("User-Agent", c.s.userAgent())
  50178. var body io.Reader = nil
  50179. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  50180. if err != nil {
  50181. return nil, err
  50182. }
  50183. reqHeaders.Set("Content-Type", "application/json")
  50184. c.urlParams_.Set("alt", alt)
  50185. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroups/{resource}/testIamPermissions")
  50186. urls += "?" + c.urlParams_.Encode()
  50187. req, _ := http.NewRequest("POST", urls, body)
  50188. req.Header = reqHeaders
  50189. googleapi.Expand(req.URL, map[string]string{
  50190. "project": c.project,
  50191. "zone": c.zone,
  50192. "resource": c.resource,
  50193. })
  50194. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  50195. }
  50196. // Do executes the "compute.instanceGroups.testIamPermissions" call.
  50197. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  50198. // non-2xx status code is an error. Response headers are in either
  50199. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  50200. // returned at all) in error.(*googleapi.Error).Header. Use
  50201. // googleapi.IsNotModified to check whether the returned error was
  50202. // because http.StatusNotModified was returned.
  50203. func (c *InstanceGroupsTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  50204. gensupport.SetOptions(c.urlParams_, opts...)
  50205. res, err := c.doRequest("json")
  50206. if res != nil && res.StatusCode == http.StatusNotModified {
  50207. if res.Body != nil {
  50208. res.Body.Close()
  50209. }
  50210. return nil, &googleapi.Error{
  50211. Code: res.StatusCode,
  50212. Header: res.Header,
  50213. }
  50214. }
  50215. if err != nil {
  50216. return nil, err
  50217. }
  50218. defer googleapi.CloseBody(res)
  50219. if err := googleapi.CheckResponse(res); err != nil {
  50220. return nil, err
  50221. }
  50222. ret := &TestPermissionsResponse{
  50223. ServerResponse: googleapi.ServerResponse{
  50224. Header: res.Header,
  50225. HTTPStatusCode: res.StatusCode,
  50226. },
  50227. }
  50228. target := &ret
  50229. if err := gensupport.DecodeResponse(target, res); err != nil {
  50230. return nil, err
  50231. }
  50232. return ret, nil
  50233. // {
  50234. // "description": "Returns permissions that a caller has on the specified resource.",
  50235. // "httpMethod": "POST",
  50236. // "id": "compute.instanceGroups.testIamPermissions",
  50237. // "parameterOrder": [
  50238. // "project",
  50239. // "zone",
  50240. // "resource"
  50241. // ],
  50242. // "parameters": {
  50243. // "project": {
  50244. // "description": "Project ID for this request.",
  50245. // "location": "path",
  50246. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  50247. // "required": true,
  50248. // "type": "string"
  50249. // },
  50250. // "resource": {
  50251. // "description": "Name of the resource for this request.",
  50252. // "location": "path",
  50253. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  50254. // "required": true,
  50255. // "type": "string"
  50256. // },
  50257. // "zone": {
  50258. // "description": "The name of the zone for this request.",
  50259. // "location": "path",
  50260. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  50261. // "required": true,
  50262. // "type": "string"
  50263. // }
  50264. // },
  50265. // "path": "{project}/zones/{zone}/instanceGroups/{resource}/testIamPermissions",
  50266. // "request": {
  50267. // "$ref": "TestPermissionsRequest"
  50268. // },
  50269. // "response": {
  50270. // "$ref": "TestPermissionsResponse"
  50271. // },
  50272. // "scopes": [
  50273. // "https://www.googleapis.com/auth/cloud-platform",
  50274. // "https://www.googleapis.com/auth/compute",
  50275. // "https://www.googleapis.com/auth/compute.readonly"
  50276. // ]
  50277. // }
  50278. }
  50279. // method id "compute.instanceTemplates.delete":
  50280. type InstanceTemplatesDeleteCall struct {
  50281. s *Service
  50282. project string
  50283. instanceTemplate string
  50284. urlParams_ gensupport.URLParams
  50285. ctx_ context.Context
  50286. header_ http.Header
  50287. }
  50288. // Delete: Deletes the specified instance template. Deleting an instance
  50289. // template is permanent and cannot be undone. It's not possible to
  50290. // delete templates which are in use by an instance group.
  50291. // For details, see https://cloud.google.com/compute/docs/reference/latest/instanceTemplates/delete
  50292. func (r *InstanceTemplatesService) Delete(project string, instanceTemplate string) *InstanceTemplatesDeleteCall {
  50293. c := &InstanceTemplatesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  50294. c.project = project
  50295. c.instanceTemplate = instanceTemplate
  50296. return c
  50297. }
  50298. // RequestId sets the optional parameter "requestId": An optional
  50299. // request ID to identify requests. Specify a unique request ID so that
  50300. // if you must retry your request, the server will know to ignore the
  50301. // request if it has already been completed.
  50302. //
  50303. // For example, consider a situation where you make an initial request
  50304. // and the request times out. If you make the request again with the
  50305. // same request ID, the server can check if original operation with the
  50306. // same request ID was received, and if so, will ignore the second
  50307. // request. This prevents clients from accidentally creating duplicate
  50308. // commitments.
  50309. //
  50310. // The request ID must be a valid UUID with the exception that zero UUID
  50311. // is not supported (00000000-0000-0000-0000-000000000000).
  50312. func (c *InstanceTemplatesDeleteCall) RequestId(requestId string) *InstanceTemplatesDeleteCall {
  50313. c.urlParams_.Set("requestId", requestId)
  50314. return c
  50315. }
  50316. // Fields allows partial responses to be retrieved. See
  50317. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  50318. // for more information.
  50319. func (c *InstanceTemplatesDeleteCall) Fields(s ...googleapi.Field) *InstanceTemplatesDeleteCall {
  50320. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  50321. return c
  50322. }
  50323. // Context sets the context to be used in this call's Do method. Any
  50324. // pending HTTP request will be aborted if the provided context is
  50325. // canceled.
  50326. func (c *InstanceTemplatesDeleteCall) Context(ctx context.Context) *InstanceTemplatesDeleteCall {
  50327. c.ctx_ = ctx
  50328. return c
  50329. }
  50330. // Header returns an http.Header that can be modified by the caller to
  50331. // add HTTP headers to the request.
  50332. func (c *InstanceTemplatesDeleteCall) Header() http.Header {
  50333. if c.header_ == nil {
  50334. c.header_ = make(http.Header)
  50335. }
  50336. return c.header_
  50337. }
  50338. func (c *InstanceTemplatesDeleteCall) doRequest(alt string) (*http.Response, error) {
  50339. reqHeaders := make(http.Header)
  50340. for k, v := range c.header_ {
  50341. reqHeaders[k] = v
  50342. }
  50343. reqHeaders.Set("User-Agent", c.s.userAgent())
  50344. var body io.Reader = nil
  50345. c.urlParams_.Set("alt", alt)
  50346. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/instanceTemplates/{instanceTemplate}")
  50347. urls += "?" + c.urlParams_.Encode()
  50348. req, _ := http.NewRequest("DELETE", urls, body)
  50349. req.Header = reqHeaders
  50350. googleapi.Expand(req.URL, map[string]string{
  50351. "project": c.project,
  50352. "instanceTemplate": c.instanceTemplate,
  50353. })
  50354. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  50355. }
  50356. // Do executes the "compute.instanceTemplates.delete" call.
  50357. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  50358. // status code is an error. Response headers are in either
  50359. // *Operation.ServerResponse.Header or (if a response was returned at
  50360. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  50361. // to check whether the returned error was because
  50362. // http.StatusNotModified was returned.
  50363. func (c *InstanceTemplatesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  50364. gensupport.SetOptions(c.urlParams_, opts...)
  50365. res, err := c.doRequest("json")
  50366. if res != nil && res.StatusCode == http.StatusNotModified {
  50367. if res.Body != nil {
  50368. res.Body.Close()
  50369. }
  50370. return nil, &googleapi.Error{
  50371. Code: res.StatusCode,
  50372. Header: res.Header,
  50373. }
  50374. }
  50375. if err != nil {
  50376. return nil, err
  50377. }
  50378. defer googleapi.CloseBody(res)
  50379. if err := googleapi.CheckResponse(res); err != nil {
  50380. return nil, err
  50381. }
  50382. ret := &Operation{
  50383. ServerResponse: googleapi.ServerResponse{
  50384. Header: res.Header,
  50385. HTTPStatusCode: res.StatusCode,
  50386. },
  50387. }
  50388. target := &ret
  50389. if err := gensupport.DecodeResponse(target, res); err != nil {
  50390. return nil, err
  50391. }
  50392. return ret, nil
  50393. // {
  50394. // "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.",
  50395. // "httpMethod": "DELETE",
  50396. // "id": "compute.instanceTemplates.delete",
  50397. // "parameterOrder": [
  50398. // "project",
  50399. // "instanceTemplate"
  50400. // ],
  50401. // "parameters": {
  50402. // "instanceTemplate": {
  50403. // "description": "The name of the instance template to delete.",
  50404. // "location": "path",
  50405. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  50406. // "required": true,
  50407. // "type": "string"
  50408. // },
  50409. // "project": {
  50410. // "description": "Project ID for this request.",
  50411. // "location": "path",
  50412. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  50413. // "required": true,
  50414. // "type": "string"
  50415. // },
  50416. // "requestId": {
  50417. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  50418. // "location": "query",
  50419. // "type": "string"
  50420. // }
  50421. // },
  50422. // "path": "{project}/global/instanceTemplates/{instanceTemplate}",
  50423. // "response": {
  50424. // "$ref": "Operation"
  50425. // },
  50426. // "scopes": [
  50427. // "https://www.googleapis.com/auth/cloud-platform",
  50428. // "https://www.googleapis.com/auth/compute"
  50429. // ]
  50430. // }
  50431. }
  50432. // method id "compute.instanceTemplates.get":
  50433. type InstanceTemplatesGetCall struct {
  50434. s *Service
  50435. project string
  50436. instanceTemplate string
  50437. urlParams_ gensupport.URLParams
  50438. ifNoneMatch_ string
  50439. ctx_ context.Context
  50440. header_ http.Header
  50441. }
  50442. // Get: Returns the specified instance template. Gets a list of
  50443. // available instance templates by making a list() request.
  50444. // For details, see https://cloud.google.com/compute/docs/reference/latest/instanceTemplates/get
  50445. func (r *InstanceTemplatesService) Get(project string, instanceTemplate string) *InstanceTemplatesGetCall {
  50446. c := &InstanceTemplatesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  50447. c.project = project
  50448. c.instanceTemplate = instanceTemplate
  50449. return c
  50450. }
  50451. // Fields allows partial responses to be retrieved. See
  50452. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  50453. // for more information.
  50454. func (c *InstanceTemplatesGetCall) Fields(s ...googleapi.Field) *InstanceTemplatesGetCall {
  50455. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  50456. return c
  50457. }
  50458. // IfNoneMatch sets the optional parameter which makes the operation
  50459. // fail if the object's ETag matches the given value. This is useful for
  50460. // getting updates only after the object has changed since the last
  50461. // request. Use googleapi.IsNotModified to check whether the response
  50462. // error from Do is the result of In-None-Match.
  50463. func (c *InstanceTemplatesGetCall) IfNoneMatch(entityTag string) *InstanceTemplatesGetCall {
  50464. c.ifNoneMatch_ = entityTag
  50465. return c
  50466. }
  50467. // Context sets the context to be used in this call's Do method. Any
  50468. // pending HTTP request will be aborted if the provided context is
  50469. // canceled.
  50470. func (c *InstanceTemplatesGetCall) Context(ctx context.Context) *InstanceTemplatesGetCall {
  50471. c.ctx_ = ctx
  50472. return c
  50473. }
  50474. // Header returns an http.Header that can be modified by the caller to
  50475. // add HTTP headers to the request.
  50476. func (c *InstanceTemplatesGetCall) Header() http.Header {
  50477. if c.header_ == nil {
  50478. c.header_ = make(http.Header)
  50479. }
  50480. return c.header_
  50481. }
  50482. func (c *InstanceTemplatesGetCall) doRequest(alt string) (*http.Response, error) {
  50483. reqHeaders := make(http.Header)
  50484. for k, v := range c.header_ {
  50485. reqHeaders[k] = v
  50486. }
  50487. reqHeaders.Set("User-Agent", c.s.userAgent())
  50488. if c.ifNoneMatch_ != "" {
  50489. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  50490. }
  50491. var body io.Reader = nil
  50492. c.urlParams_.Set("alt", alt)
  50493. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/instanceTemplates/{instanceTemplate}")
  50494. urls += "?" + c.urlParams_.Encode()
  50495. req, _ := http.NewRequest("GET", urls, body)
  50496. req.Header = reqHeaders
  50497. googleapi.Expand(req.URL, map[string]string{
  50498. "project": c.project,
  50499. "instanceTemplate": c.instanceTemplate,
  50500. })
  50501. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  50502. }
  50503. // Do executes the "compute.instanceTemplates.get" call.
  50504. // Exactly one of *InstanceTemplate or error will be non-nil. Any
  50505. // non-2xx status code is an error. Response headers are in either
  50506. // *InstanceTemplate.ServerResponse.Header or (if a response was
  50507. // returned at all) in error.(*googleapi.Error).Header. Use
  50508. // googleapi.IsNotModified to check whether the returned error was
  50509. // because http.StatusNotModified was returned.
  50510. func (c *InstanceTemplatesGetCall) Do(opts ...googleapi.CallOption) (*InstanceTemplate, error) {
  50511. gensupport.SetOptions(c.urlParams_, opts...)
  50512. res, err := c.doRequest("json")
  50513. if res != nil && res.StatusCode == http.StatusNotModified {
  50514. if res.Body != nil {
  50515. res.Body.Close()
  50516. }
  50517. return nil, &googleapi.Error{
  50518. Code: res.StatusCode,
  50519. Header: res.Header,
  50520. }
  50521. }
  50522. if err != nil {
  50523. return nil, err
  50524. }
  50525. defer googleapi.CloseBody(res)
  50526. if err := googleapi.CheckResponse(res); err != nil {
  50527. return nil, err
  50528. }
  50529. ret := &InstanceTemplate{
  50530. ServerResponse: googleapi.ServerResponse{
  50531. Header: res.Header,
  50532. HTTPStatusCode: res.StatusCode,
  50533. },
  50534. }
  50535. target := &ret
  50536. if err := gensupport.DecodeResponse(target, res); err != nil {
  50537. return nil, err
  50538. }
  50539. return ret, nil
  50540. // {
  50541. // "description": "Returns the specified instance template. Gets a list of available instance templates by making a list() request.",
  50542. // "httpMethod": "GET",
  50543. // "id": "compute.instanceTemplates.get",
  50544. // "parameterOrder": [
  50545. // "project",
  50546. // "instanceTemplate"
  50547. // ],
  50548. // "parameters": {
  50549. // "instanceTemplate": {
  50550. // "description": "The name of the instance template.",
  50551. // "location": "path",
  50552. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  50553. // "required": true,
  50554. // "type": "string"
  50555. // },
  50556. // "project": {
  50557. // "description": "Project ID for this request.",
  50558. // "location": "path",
  50559. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  50560. // "required": true,
  50561. // "type": "string"
  50562. // }
  50563. // },
  50564. // "path": "{project}/global/instanceTemplates/{instanceTemplate}",
  50565. // "response": {
  50566. // "$ref": "InstanceTemplate"
  50567. // },
  50568. // "scopes": [
  50569. // "https://www.googleapis.com/auth/cloud-platform",
  50570. // "https://www.googleapis.com/auth/compute",
  50571. // "https://www.googleapis.com/auth/compute.readonly"
  50572. // ]
  50573. // }
  50574. }
  50575. // method id "compute.instanceTemplates.insert":
  50576. type InstanceTemplatesInsertCall struct {
  50577. s *Service
  50578. project string
  50579. instancetemplate *InstanceTemplate
  50580. urlParams_ gensupport.URLParams
  50581. ctx_ context.Context
  50582. header_ http.Header
  50583. }
  50584. // Insert: Creates an instance template in the specified project using
  50585. // the data that is included in the request. If you are creating a new
  50586. // template to update an existing instance group, your new instance
  50587. // template must use the same network or, if applicable, the same
  50588. // subnetwork as the original template.
  50589. // For details, see https://cloud.google.com/compute/docs/reference/latest/instanceTemplates/insert
  50590. func (r *InstanceTemplatesService) Insert(project string, instancetemplate *InstanceTemplate) *InstanceTemplatesInsertCall {
  50591. c := &InstanceTemplatesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  50592. c.project = project
  50593. c.instancetemplate = instancetemplate
  50594. return c
  50595. }
  50596. // RequestId sets the optional parameter "requestId": An optional
  50597. // request ID to identify requests. Specify a unique request ID so that
  50598. // if you must retry your request, the server will know to ignore the
  50599. // request if it has already been completed.
  50600. //
  50601. // For example, consider a situation where you make an initial request
  50602. // and the request times out. If you make the request again with the
  50603. // same request ID, the server can check if original operation with the
  50604. // same request ID was received, and if so, will ignore the second
  50605. // request. This prevents clients from accidentally creating duplicate
  50606. // commitments.
  50607. //
  50608. // The request ID must be a valid UUID with the exception that zero UUID
  50609. // is not supported (00000000-0000-0000-0000-000000000000).
  50610. func (c *InstanceTemplatesInsertCall) RequestId(requestId string) *InstanceTemplatesInsertCall {
  50611. c.urlParams_.Set("requestId", requestId)
  50612. return c
  50613. }
  50614. // Fields allows partial responses to be retrieved. See
  50615. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  50616. // for more information.
  50617. func (c *InstanceTemplatesInsertCall) Fields(s ...googleapi.Field) *InstanceTemplatesInsertCall {
  50618. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  50619. return c
  50620. }
  50621. // Context sets the context to be used in this call's Do method. Any
  50622. // pending HTTP request will be aborted if the provided context is
  50623. // canceled.
  50624. func (c *InstanceTemplatesInsertCall) Context(ctx context.Context) *InstanceTemplatesInsertCall {
  50625. c.ctx_ = ctx
  50626. return c
  50627. }
  50628. // Header returns an http.Header that can be modified by the caller to
  50629. // add HTTP headers to the request.
  50630. func (c *InstanceTemplatesInsertCall) Header() http.Header {
  50631. if c.header_ == nil {
  50632. c.header_ = make(http.Header)
  50633. }
  50634. return c.header_
  50635. }
  50636. func (c *InstanceTemplatesInsertCall) doRequest(alt string) (*http.Response, error) {
  50637. reqHeaders := make(http.Header)
  50638. for k, v := range c.header_ {
  50639. reqHeaders[k] = v
  50640. }
  50641. reqHeaders.Set("User-Agent", c.s.userAgent())
  50642. var body io.Reader = nil
  50643. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancetemplate)
  50644. if err != nil {
  50645. return nil, err
  50646. }
  50647. reqHeaders.Set("Content-Type", "application/json")
  50648. c.urlParams_.Set("alt", alt)
  50649. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/instanceTemplates")
  50650. urls += "?" + c.urlParams_.Encode()
  50651. req, _ := http.NewRequest("POST", urls, body)
  50652. req.Header = reqHeaders
  50653. googleapi.Expand(req.URL, map[string]string{
  50654. "project": c.project,
  50655. })
  50656. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  50657. }
  50658. // Do executes the "compute.instanceTemplates.insert" call.
  50659. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  50660. // status code is an error. Response headers are in either
  50661. // *Operation.ServerResponse.Header or (if a response was returned at
  50662. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  50663. // to check whether the returned error was because
  50664. // http.StatusNotModified was returned.
  50665. func (c *InstanceTemplatesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  50666. gensupport.SetOptions(c.urlParams_, opts...)
  50667. res, err := c.doRequest("json")
  50668. if res != nil && res.StatusCode == http.StatusNotModified {
  50669. if res.Body != nil {
  50670. res.Body.Close()
  50671. }
  50672. return nil, &googleapi.Error{
  50673. Code: res.StatusCode,
  50674. Header: res.Header,
  50675. }
  50676. }
  50677. if err != nil {
  50678. return nil, err
  50679. }
  50680. defer googleapi.CloseBody(res)
  50681. if err := googleapi.CheckResponse(res); err != nil {
  50682. return nil, err
  50683. }
  50684. ret := &Operation{
  50685. ServerResponse: googleapi.ServerResponse{
  50686. Header: res.Header,
  50687. HTTPStatusCode: res.StatusCode,
  50688. },
  50689. }
  50690. target := &ret
  50691. if err := gensupport.DecodeResponse(target, res); err != nil {
  50692. return nil, err
  50693. }
  50694. return ret, nil
  50695. // {
  50696. // "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.",
  50697. // "httpMethod": "POST",
  50698. // "id": "compute.instanceTemplates.insert",
  50699. // "parameterOrder": [
  50700. // "project"
  50701. // ],
  50702. // "parameters": {
  50703. // "project": {
  50704. // "description": "Project ID for this request.",
  50705. // "location": "path",
  50706. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  50707. // "required": true,
  50708. // "type": "string"
  50709. // },
  50710. // "requestId": {
  50711. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  50712. // "location": "query",
  50713. // "type": "string"
  50714. // }
  50715. // },
  50716. // "path": "{project}/global/instanceTemplates",
  50717. // "request": {
  50718. // "$ref": "InstanceTemplate"
  50719. // },
  50720. // "response": {
  50721. // "$ref": "Operation"
  50722. // },
  50723. // "scopes": [
  50724. // "https://www.googleapis.com/auth/cloud-platform",
  50725. // "https://www.googleapis.com/auth/compute"
  50726. // ]
  50727. // }
  50728. }
  50729. // method id "compute.instanceTemplates.list":
  50730. type InstanceTemplatesListCall struct {
  50731. s *Service
  50732. project string
  50733. urlParams_ gensupport.URLParams
  50734. ifNoneMatch_ string
  50735. ctx_ context.Context
  50736. header_ http.Header
  50737. }
  50738. // List: Retrieves a list of instance templates that are contained
  50739. // within the specified project and zone.
  50740. // For details, see https://cloud.google.com/compute/docs/reference/latest/instanceTemplates/list
  50741. func (r *InstanceTemplatesService) List(project string) *InstanceTemplatesListCall {
  50742. c := &InstanceTemplatesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  50743. c.project = project
  50744. return c
  50745. }
  50746. // Filter sets the optional parameter "filter": A filter expression that
  50747. // filters resources listed in the response. The expression must specify
  50748. // the field name, a comparison operator, and the value that you want to
  50749. // use for filtering. The value must be a string, a number, or a
  50750. // boolean. The comparison operator must be either =, !=, >, or <.
  50751. //
  50752. // For example, if you are filtering Compute Engine instances, you can
  50753. // exclude instances named example-instance by specifying name !=
  50754. // example-instance.
  50755. //
  50756. // You can also filter nested fields. For example, you could specify
  50757. // scheduling.automaticRestart = false to include instances only if they
  50758. // are not scheduled for automatic restarts. You can use filtering on
  50759. // nested fields to filter based on resource labels.
  50760. //
  50761. // To filter on multiple expressions, provide each separate expression
  50762. // within parentheses. For example, (scheduling.automaticRestart = true)
  50763. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  50764. // AND expression. However, you can include AND and OR expressions
  50765. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  50766. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  50767. // true).
  50768. func (c *InstanceTemplatesListCall) Filter(filter string) *InstanceTemplatesListCall {
  50769. c.urlParams_.Set("filter", filter)
  50770. return c
  50771. }
  50772. // MaxResults sets the optional parameter "maxResults": The maximum
  50773. // number of results per page that should be returned. If the number of
  50774. // available results is larger than maxResults, Compute Engine returns a
  50775. // nextPageToken that can be used to get the next page of results in
  50776. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  50777. // (Default: 500)
  50778. func (c *InstanceTemplatesListCall) MaxResults(maxResults int64) *InstanceTemplatesListCall {
  50779. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  50780. return c
  50781. }
  50782. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  50783. // a certain order. By default, results are returned in alphanumerical
  50784. // order based on the resource name.
  50785. //
  50786. // You can also sort results in descending order based on the creation
  50787. // timestamp using orderBy="creationTimestamp desc". This sorts results
  50788. // based on the creationTimestamp field in reverse chronological order
  50789. // (newest result first). Use this to sort resources like operations so
  50790. // that the newest operation is returned first.
  50791. //
  50792. // Currently, only sorting by name or creationTimestamp desc is
  50793. // supported.
  50794. func (c *InstanceTemplatesListCall) OrderBy(orderBy string) *InstanceTemplatesListCall {
  50795. c.urlParams_.Set("orderBy", orderBy)
  50796. return c
  50797. }
  50798. // PageToken sets the optional parameter "pageToken": Specifies a page
  50799. // token to use. Set pageToken to the nextPageToken returned by a
  50800. // previous list request to get the next page of results.
  50801. func (c *InstanceTemplatesListCall) PageToken(pageToken string) *InstanceTemplatesListCall {
  50802. c.urlParams_.Set("pageToken", pageToken)
  50803. return c
  50804. }
  50805. // Fields allows partial responses to be retrieved. See
  50806. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  50807. // for more information.
  50808. func (c *InstanceTemplatesListCall) Fields(s ...googleapi.Field) *InstanceTemplatesListCall {
  50809. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  50810. return c
  50811. }
  50812. // IfNoneMatch sets the optional parameter which makes the operation
  50813. // fail if the object's ETag matches the given value. This is useful for
  50814. // getting updates only after the object has changed since the last
  50815. // request. Use googleapi.IsNotModified to check whether the response
  50816. // error from Do is the result of In-None-Match.
  50817. func (c *InstanceTemplatesListCall) IfNoneMatch(entityTag string) *InstanceTemplatesListCall {
  50818. c.ifNoneMatch_ = entityTag
  50819. return c
  50820. }
  50821. // Context sets the context to be used in this call's Do method. Any
  50822. // pending HTTP request will be aborted if the provided context is
  50823. // canceled.
  50824. func (c *InstanceTemplatesListCall) Context(ctx context.Context) *InstanceTemplatesListCall {
  50825. c.ctx_ = ctx
  50826. return c
  50827. }
  50828. // Header returns an http.Header that can be modified by the caller to
  50829. // add HTTP headers to the request.
  50830. func (c *InstanceTemplatesListCall) Header() http.Header {
  50831. if c.header_ == nil {
  50832. c.header_ = make(http.Header)
  50833. }
  50834. return c.header_
  50835. }
  50836. func (c *InstanceTemplatesListCall) doRequest(alt string) (*http.Response, error) {
  50837. reqHeaders := make(http.Header)
  50838. for k, v := range c.header_ {
  50839. reqHeaders[k] = v
  50840. }
  50841. reqHeaders.Set("User-Agent", c.s.userAgent())
  50842. if c.ifNoneMatch_ != "" {
  50843. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  50844. }
  50845. var body io.Reader = nil
  50846. c.urlParams_.Set("alt", alt)
  50847. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/instanceTemplates")
  50848. urls += "?" + c.urlParams_.Encode()
  50849. req, _ := http.NewRequest("GET", urls, body)
  50850. req.Header = reqHeaders
  50851. googleapi.Expand(req.URL, map[string]string{
  50852. "project": c.project,
  50853. })
  50854. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  50855. }
  50856. // Do executes the "compute.instanceTemplates.list" call.
  50857. // Exactly one of *InstanceTemplateList or error will be non-nil. Any
  50858. // non-2xx status code is an error. Response headers are in either
  50859. // *InstanceTemplateList.ServerResponse.Header or (if a response was
  50860. // returned at all) in error.(*googleapi.Error).Header. Use
  50861. // googleapi.IsNotModified to check whether the returned error was
  50862. // because http.StatusNotModified was returned.
  50863. func (c *InstanceTemplatesListCall) Do(opts ...googleapi.CallOption) (*InstanceTemplateList, error) {
  50864. gensupport.SetOptions(c.urlParams_, opts...)
  50865. res, err := c.doRequest("json")
  50866. if res != nil && res.StatusCode == http.StatusNotModified {
  50867. if res.Body != nil {
  50868. res.Body.Close()
  50869. }
  50870. return nil, &googleapi.Error{
  50871. Code: res.StatusCode,
  50872. Header: res.Header,
  50873. }
  50874. }
  50875. if err != nil {
  50876. return nil, err
  50877. }
  50878. defer googleapi.CloseBody(res)
  50879. if err := googleapi.CheckResponse(res); err != nil {
  50880. return nil, err
  50881. }
  50882. ret := &InstanceTemplateList{
  50883. ServerResponse: googleapi.ServerResponse{
  50884. Header: res.Header,
  50885. HTTPStatusCode: res.StatusCode,
  50886. },
  50887. }
  50888. target := &ret
  50889. if err := gensupport.DecodeResponse(target, res); err != nil {
  50890. return nil, err
  50891. }
  50892. return ret, nil
  50893. // {
  50894. // "description": "Retrieves a list of instance templates that are contained within the specified project and zone.",
  50895. // "httpMethod": "GET",
  50896. // "id": "compute.instanceTemplates.list",
  50897. // "parameterOrder": [
  50898. // "project"
  50899. // ],
  50900. // "parameters": {
  50901. // "filter": {
  50902. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  50903. // "location": "query",
  50904. // "type": "string"
  50905. // },
  50906. // "maxResults": {
  50907. // "default": "500",
  50908. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  50909. // "format": "uint32",
  50910. // "location": "query",
  50911. // "minimum": "0",
  50912. // "type": "integer"
  50913. // },
  50914. // "orderBy": {
  50915. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  50916. // "location": "query",
  50917. // "type": "string"
  50918. // },
  50919. // "pageToken": {
  50920. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  50921. // "location": "query",
  50922. // "type": "string"
  50923. // },
  50924. // "project": {
  50925. // "description": "Project ID for this request.",
  50926. // "location": "path",
  50927. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  50928. // "required": true,
  50929. // "type": "string"
  50930. // }
  50931. // },
  50932. // "path": "{project}/global/instanceTemplates",
  50933. // "response": {
  50934. // "$ref": "InstanceTemplateList"
  50935. // },
  50936. // "scopes": [
  50937. // "https://www.googleapis.com/auth/cloud-platform",
  50938. // "https://www.googleapis.com/auth/compute",
  50939. // "https://www.googleapis.com/auth/compute.readonly"
  50940. // ]
  50941. // }
  50942. }
  50943. // Pages invokes f for each page of results.
  50944. // A non-nil error returned from f will halt the iteration.
  50945. // The provided context supersedes any context provided to the Context method.
  50946. func (c *InstanceTemplatesListCall) Pages(ctx context.Context, f func(*InstanceTemplateList) error) error {
  50947. c.ctx_ = ctx
  50948. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  50949. for {
  50950. x, err := c.Do()
  50951. if err != nil {
  50952. return err
  50953. }
  50954. if err := f(x); err != nil {
  50955. return err
  50956. }
  50957. if x.NextPageToken == "" {
  50958. return nil
  50959. }
  50960. c.PageToken(x.NextPageToken)
  50961. }
  50962. }
  50963. // method id "compute.instanceTemplates.testIamPermissions":
  50964. type InstanceTemplatesTestIamPermissionsCall struct {
  50965. s *Service
  50966. project string
  50967. resource string
  50968. testpermissionsrequest *TestPermissionsRequest
  50969. urlParams_ gensupport.URLParams
  50970. ctx_ context.Context
  50971. header_ http.Header
  50972. }
  50973. // TestIamPermissions: Returns permissions that a caller has on the
  50974. // specified resource.
  50975. func (r *InstanceTemplatesService) TestIamPermissions(project string, resource string, testpermissionsrequest *TestPermissionsRequest) *InstanceTemplatesTestIamPermissionsCall {
  50976. c := &InstanceTemplatesTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  50977. c.project = project
  50978. c.resource = resource
  50979. c.testpermissionsrequest = testpermissionsrequest
  50980. return c
  50981. }
  50982. // Fields allows partial responses to be retrieved. See
  50983. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  50984. // for more information.
  50985. func (c *InstanceTemplatesTestIamPermissionsCall) Fields(s ...googleapi.Field) *InstanceTemplatesTestIamPermissionsCall {
  50986. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  50987. return c
  50988. }
  50989. // Context sets the context to be used in this call's Do method. Any
  50990. // pending HTTP request will be aborted if the provided context is
  50991. // canceled.
  50992. func (c *InstanceTemplatesTestIamPermissionsCall) Context(ctx context.Context) *InstanceTemplatesTestIamPermissionsCall {
  50993. c.ctx_ = ctx
  50994. return c
  50995. }
  50996. // Header returns an http.Header that can be modified by the caller to
  50997. // add HTTP headers to the request.
  50998. func (c *InstanceTemplatesTestIamPermissionsCall) Header() http.Header {
  50999. if c.header_ == nil {
  51000. c.header_ = make(http.Header)
  51001. }
  51002. return c.header_
  51003. }
  51004. func (c *InstanceTemplatesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  51005. reqHeaders := make(http.Header)
  51006. for k, v := range c.header_ {
  51007. reqHeaders[k] = v
  51008. }
  51009. reqHeaders.Set("User-Agent", c.s.userAgent())
  51010. var body io.Reader = nil
  51011. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  51012. if err != nil {
  51013. return nil, err
  51014. }
  51015. reqHeaders.Set("Content-Type", "application/json")
  51016. c.urlParams_.Set("alt", alt)
  51017. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/instanceTemplates/{resource}/testIamPermissions")
  51018. urls += "?" + c.urlParams_.Encode()
  51019. req, _ := http.NewRequest("POST", urls, body)
  51020. req.Header = reqHeaders
  51021. googleapi.Expand(req.URL, map[string]string{
  51022. "project": c.project,
  51023. "resource": c.resource,
  51024. })
  51025. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  51026. }
  51027. // Do executes the "compute.instanceTemplates.testIamPermissions" call.
  51028. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  51029. // non-2xx status code is an error. Response headers are in either
  51030. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  51031. // returned at all) in error.(*googleapi.Error).Header. Use
  51032. // googleapi.IsNotModified to check whether the returned error was
  51033. // because http.StatusNotModified was returned.
  51034. func (c *InstanceTemplatesTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  51035. gensupport.SetOptions(c.urlParams_, opts...)
  51036. res, err := c.doRequest("json")
  51037. if res != nil && res.StatusCode == http.StatusNotModified {
  51038. if res.Body != nil {
  51039. res.Body.Close()
  51040. }
  51041. return nil, &googleapi.Error{
  51042. Code: res.StatusCode,
  51043. Header: res.Header,
  51044. }
  51045. }
  51046. if err != nil {
  51047. return nil, err
  51048. }
  51049. defer googleapi.CloseBody(res)
  51050. if err := googleapi.CheckResponse(res); err != nil {
  51051. return nil, err
  51052. }
  51053. ret := &TestPermissionsResponse{
  51054. ServerResponse: googleapi.ServerResponse{
  51055. Header: res.Header,
  51056. HTTPStatusCode: res.StatusCode,
  51057. },
  51058. }
  51059. target := &ret
  51060. if err := gensupport.DecodeResponse(target, res); err != nil {
  51061. return nil, err
  51062. }
  51063. return ret, nil
  51064. // {
  51065. // "description": "Returns permissions that a caller has on the specified resource.",
  51066. // "httpMethod": "POST",
  51067. // "id": "compute.instanceTemplates.testIamPermissions",
  51068. // "parameterOrder": [
  51069. // "project",
  51070. // "resource"
  51071. // ],
  51072. // "parameters": {
  51073. // "project": {
  51074. // "description": "Project ID for this request.",
  51075. // "location": "path",
  51076. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  51077. // "required": true,
  51078. // "type": "string"
  51079. // },
  51080. // "resource": {
  51081. // "description": "Name of the resource for this request.",
  51082. // "location": "path",
  51083. // "pattern": "(?:[-a-z0-9_]{0,62}[a-z0-9])?",
  51084. // "required": true,
  51085. // "type": "string"
  51086. // }
  51087. // },
  51088. // "path": "{project}/global/instanceTemplates/{resource}/testIamPermissions",
  51089. // "request": {
  51090. // "$ref": "TestPermissionsRequest"
  51091. // },
  51092. // "response": {
  51093. // "$ref": "TestPermissionsResponse"
  51094. // },
  51095. // "scopes": [
  51096. // "https://www.googleapis.com/auth/cloud-platform",
  51097. // "https://www.googleapis.com/auth/compute",
  51098. // "https://www.googleapis.com/auth/compute.readonly"
  51099. // ]
  51100. // }
  51101. }
  51102. // method id "compute.instances.addAccessConfig":
  51103. type InstancesAddAccessConfigCall struct {
  51104. s *Service
  51105. project string
  51106. zone string
  51107. instance string
  51108. accessconfig *AccessConfig
  51109. urlParams_ gensupport.URLParams
  51110. ctx_ context.Context
  51111. header_ http.Header
  51112. }
  51113. // AddAccessConfig: Adds an access config to an instance's network
  51114. // interface.
  51115. // For details, see https://cloud.google.com/compute/docs/reference/latest/instances/addAccessConfig
  51116. func (r *InstancesService) AddAccessConfig(project string, zone string, instance string, networkInterface string, accessconfig *AccessConfig) *InstancesAddAccessConfigCall {
  51117. c := &InstancesAddAccessConfigCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  51118. c.project = project
  51119. c.zone = zone
  51120. c.instance = instance
  51121. c.urlParams_.Set("networkInterface", networkInterface)
  51122. c.accessconfig = accessconfig
  51123. return c
  51124. }
  51125. // RequestId sets the optional parameter "requestId": An optional
  51126. // request ID to identify requests. Specify a unique request ID so that
  51127. // if you must retry your request, the server will know to ignore the
  51128. // request if it has already been completed.
  51129. //
  51130. // For example, consider a situation where you make an initial request
  51131. // and the request times out. If you make the request again with the
  51132. // same request ID, the server can check if original operation with the
  51133. // same request ID was received, and if so, will ignore the second
  51134. // request. This prevents clients from accidentally creating duplicate
  51135. // commitments.
  51136. //
  51137. // The request ID must be a valid UUID with the exception that zero UUID
  51138. // is not supported (00000000-0000-0000-0000-000000000000).
  51139. func (c *InstancesAddAccessConfigCall) RequestId(requestId string) *InstancesAddAccessConfigCall {
  51140. c.urlParams_.Set("requestId", requestId)
  51141. return c
  51142. }
  51143. // Fields allows partial responses to be retrieved. See
  51144. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  51145. // for more information.
  51146. func (c *InstancesAddAccessConfigCall) Fields(s ...googleapi.Field) *InstancesAddAccessConfigCall {
  51147. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  51148. return c
  51149. }
  51150. // Context sets the context to be used in this call's Do method. Any
  51151. // pending HTTP request will be aborted if the provided context is
  51152. // canceled.
  51153. func (c *InstancesAddAccessConfigCall) Context(ctx context.Context) *InstancesAddAccessConfigCall {
  51154. c.ctx_ = ctx
  51155. return c
  51156. }
  51157. // Header returns an http.Header that can be modified by the caller to
  51158. // add HTTP headers to the request.
  51159. func (c *InstancesAddAccessConfigCall) Header() http.Header {
  51160. if c.header_ == nil {
  51161. c.header_ = make(http.Header)
  51162. }
  51163. return c.header_
  51164. }
  51165. func (c *InstancesAddAccessConfigCall) doRequest(alt string) (*http.Response, error) {
  51166. reqHeaders := make(http.Header)
  51167. for k, v := range c.header_ {
  51168. reqHeaders[k] = v
  51169. }
  51170. reqHeaders.Set("User-Agent", c.s.userAgent())
  51171. var body io.Reader = nil
  51172. body, err := googleapi.WithoutDataWrapper.JSONReader(c.accessconfig)
  51173. if err != nil {
  51174. return nil, err
  51175. }
  51176. reqHeaders.Set("Content-Type", "application/json")
  51177. c.urlParams_.Set("alt", alt)
  51178. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/addAccessConfig")
  51179. urls += "?" + c.urlParams_.Encode()
  51180. req, _ := http.NewRequest("POST", urls, body)
  51181. req.Header = reqHeaders
  51182. googleapi.Expand(req.URL, map[string]string{
  51183. "project": c.project,
  51184. "zone": c.zone,
  51185. "instance": c.instance,
  51186. })
  51187. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  51188. }
  51189. // Do executes the "compute.instances.addAccessConfig" call.
  51190. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  51191. // status code is an error. Response headers are in either
  51192. // *Operation.ServerResponse.Header or (if a response was returned at
  51193. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  51194. // to check whether the returned error was because
  51195. // http.StatusNotModified was returned.
  51196. func (c *InstancesAddAccessConfigCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  51197. gensupport.SetOptions(c.urlParams_, opts...)
  51198. res, err := c.doRequest("json")
  51199. if res != nil && res.StatusCode == http.StatusNotModified {
  51200. if res.Body != nil {
  51201. res.Body.Close()
  51202. }
  51203. return nil, &googleapi.Error{
  51204. Code: res.StatusCode,
  51205. Header: res.Header,
  51206. }
  51207. }
  51208. if err != nil {
  51209. return nil, err
  51210. }
  51211. defer googleapi.CloseBody(res)
  51212. if err := googleapi.CheckResponse(res); err != nil {
  51213. return nil, err
  51214. }
  51215. ret := &Operation{
  51216. ServerResponse: googleapi.ServerResponse{
  51217. Header: res.Header,
  51218. HTTPStatusCode: res.StatusCode,
  51219. },
  51220. }
  51221. target := &ret
  51222. if err := gensupport.DecodeResponse(target, res); err != nil {
  51223. return nil, err
  51224. }
  51225. return ret, nil
  51226. // {
  51227. // "description": "Adds an access config to an instance's network interface.",
  51228. // "httpMethod": "POST",
  51229. // "id": "compute.instances.addAccessConfig",
  51230. // "parameterOrder": [
  51231. // "project",
  51232. // "zone",
  51233. // "instance",
  51234. // "networkInterface"
  51235. // ],
  51236. // "parameters": {
  51237. // "instance": {
  51238. // "description": "The instance name for this request.",
  51239. // "location": "path",
  51240. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  51241. // "required": true,
  51242. // "type": "string"
  51243. // },
  51244. // "networkInterface": {
  51245. // "description": "The name of the network interface to add to this instance.",
  51246. // "location": "query",
  51247. // "required": true,
  51248. // "type": "string"
  51249. // },
  51250. // "project": {
  51251. // "description": "Project ID for this request.",
  51252. // "location": "path",
  51253. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  51254. // "required": true,
  51255. // "type": "string"
  51256. // },
  51257. // "requestId": {
  51258. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  51259. // "location": "query",
  51260. // "type": "string"
  51261. // },
  51262. // "zone": {
  51263. // "description": "The name of the zone for this request.",
  51264. // "location": "path",
  51265. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  51266. // "required": true,
  51267. // "type": "string"
  51268. // }
  51269. // },
  51270. // "path": "{project}/zones/{zone}/instances/{instance}/addAccessConfig",
  51271. // "request": {
  51272. // "$ref": "AccessConfig"
  51273. // },
  51274. // "response": {
  51275. // "$ref": "Operation"
  51276. // },
  51277. // "scopes": [
  51278. // "https://www.googleapis.com/auth/cloud-platform",
  51279. // "https://www.googleapis.com/auth/compute"
  51280. // ]
  51281. // }
  51282. }
  51283. // method id "compute.instances.aggregatedList":
  51284. type InstancesAggregatedListCall struct {
  51285. s *Service
  51286. project string
  51287. urlParams_ gensupport.URLParams
  51288. ifNoneMatch_ string
  51289. ctx_ context.Context
  51290. header_ http.Header
  51291. }
  51292. // AggregatedList: Retrieves aggregated list of instances.
  51293. // For details, see https://cloud.google.com/compute/docs/reference/latest/instances/aggregatedList
  51294. func (r *InstancesService) AggregatedList(project string) *InstancesAggregatedListCall {
  51295. c := &InstancesAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  51296. c.project = project
  51297. return c
  51298. }
  51299. // Filter sets the optional parameter "filter": A filter expression that
  51300. // filters resources listed in the response. The expression must specify
  51301. // the field name, a comparison operator, and the value that you want to
  51302. // use for filtering. The value must be a string, a number, or a
  51303. // boolean. The comparison operator must be either =, !=, >, or <.
  51304. //
  51305. // For example, if you are filtering Compute Engine instances, you can
  51306. // exclude instances named example-instance by specifying name !=
  51307. // example-instance.
  51308. //
  51309. // You can also filter nested fields. For example, you could specify
  51310. // scheduling.automaticRestart = false to include instances only if they
  51311. // are not scheduled for automatic restarts. You can use filtering on
  51312. // nested fields to filter based on resource labels.
  51313. //
  51314. // To filter on multiple expressions, provide each separate expression
  51315. // within parentheses. For example, (scheduling.automaticRestart = true)
  51316. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  51317. // AND expression. However, you can include AND and OR expressions
  51318. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  51319. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  51320. // true).
  51321. func (c *InstancesAggregatedListCall) Filter(filter string) *InstancesAggregatedListCall {
  51322. c.urlParams_.Set("filter", filter)
  51323. return c
  51324. }
  51325. // MaxResults sets the optional parameter "maxResults": The maximum
  51326. // number of results per page that should be returned. If the number of
  51327. // available results is larger than maxResults, Compute Engine returns a
  51328. // nextPageToken that can be used to get the next page of results in
  51329. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  51330. // (Default: 500)
  51331. func (c *InstancesAggregatedListCall) MaxResults(maxResults int64) *InstancesAggregatedListCall {
  51332. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  51333. return c
  51334. }
  51335. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  51336. // a certain order. By default, results are returned in alphanumerical
  51337. // order based on the resource name.
  51338. //
  51339. // You can also sort results in descending order based on the creation
  51340. // timestamp using orderBy="creationTimestamp desc". This sorts results
  51341. // based on the creationTimestamp field in reverse chronological order
  51342. // (newest result first). Use this to sort resources like operations so
  51343. // that the newest operation is returned first.
  51344. //
  51345. // Currently, only sorting by name or creationTimestamp desc is
  51346. // supported.
  51347. func (c *InstancesAggregatedListCall) OrderBy(orderBy string) *InstancesAggregatedListCall {
  51348. c.urlParams_.Set("orderBy", orderBy)
  51349. return c
  51350. }
  51351. // PageToken sets the optional parameter "pageToken": Specifies a page
  51352. // token to use. Set pageToken to the nextPageToken returned by a
  51353. // previous list request to get the next page of results.
  51354. func (c *InstancesAggregatedListCall) PageToken(pageToken string) *InstancesAggregatedListCall {
  51355. c.urlParams_.Set("pageToken", pageToken)
  51356. return c
  51357. }
  51358. // Fields allows partial responses to be retrieved. See
  51359. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  51360. // for more information.
  51361. func (c *InstancesAggregatedListCall) Fields(s ...googleapi.Field) *InstancesAggregatedListCall {
  51362. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  51363. return c
  51364. }
  51365. // IfNoneMatch sets the optional parameter which makes the operation
  51366. // fail if the object's ETag matches the given value. This is useful for
  51367. // getting updates only after the object has changed since the last
  51368. // request. Use googleapi.IsNotModified to check whether the response
  51369. // error from Do is the result of In-None-Match.
  51370. func (c *InstancesAggregatedListCall) IfNoneMatch(entityTag string) *InstancesAggregatedListCall {
  51371. c.ifNoneMatch_ = entityTag
  51372. return c
  51373. }
  51374. // Context sets the context to be used in this call's Do method. Any
  51375. // pending HTTP request will be aborted if the provided context is
  51376. // canceled.
  51377. func (c *InstancesAggregatedListCall) Context(ctx context.Context) *InstancesAggregatedListCall {
  51378. c.ctx_ = ctx
  51379. return c
  51380. }
  51381. // Header returns an http.Header that can be modified by the caller to
  51382. // add HTTP headers to the request.
  51383. func (c *InstancesAggregatedListCall) Header() http.Header {
  51384. if c.header_ == nil {
  51385. c.header_ = make(http.Header)
  51386. }
  51387. return c.header_
  51388. }
  51389. func (c *InstancesAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  51390. reqHeaders := make(http.Header)
  51391. for k, v := range c.header_ {
  51392. reqHeaders[k] = v
  51393. }
  51394. reqHeaders.Set("User-Agent", c.s.userAgent())
  51395. if c.ifNoneMatch_ != "" {
  51396. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  51397. }
  51398. var body io.Reader = nil
  51399. c.urlParams_.Set("alt", alt)
  51400. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/instances")
  51401. urls += "?" + c.urlParams_.Encode()
  51402. req, _ := http.NewRequest("GET", urls, body)
  51403. req.Header = reqHeaders
  51404. googleapi.Expand(req.URL, map[string]string{
  51405. "project": c.project,
  51406. })
  51407. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  51408. }
  51409. // Do executes the "compute.instances.aggregatedList" call.
  51410. // Exactly one of *InstanceAggregatedList or error will be non-nil. Any
  51411. // non-2xx status code is an error. Response headers are in either
  51412. // *InstanceAggregatedList.ServerResponse.Header or (if a response was
  51413. // returned at all) in error.(*googleapi.Error).Header. Use
  51414. // googleapi.IsNotModified to check whether the returned error was
  51415. // because http.StatusNotModified was returned.
  51416. func (c *InstancesAggregatedListCall) Do(opts ...googleapi.CallOption) (*InstanceAggregatedList, error) {
  51417. gensupport.SetOptions(c.urlParams_, opts...)
  51418. res, err := c.doRequest("json")
  51419. if res != nil && res.StatusCode == http.StatusNotModified {
  51420. if res.Body != nil {
  51421. res.Body.Close()
  51422. }
  51423. return nil, &googleapi.Error{
  51424. Code: res.StatusCode,
  51425. Header: res.Header,
  51426. }
  51427. }
  51428. if err != nil {
  51429. return nil, err
  51430. }
  51431. defer googleapi.CloseBody(res)
  51432. if err := googleapi.CheckResponse(res); err != nil {
  51433. return nil, err
  51434. }
  51435. ret := &InstanceAggregatedList{
  51436. ServerResponse: googleapi.ServerResponse{
  51437. Header: res.Header,
  51438. HTTPStatusCode: res.StatusCode,
  51439. },
  51440. }
  51441. target := &ret
  51442. if err := gensupport.DecodeResponse(target, res); err != nil {
  51443. return nil, err
  51444. }
  51445. return ret, nil
  51446. // {
  51447. // "description": "Retrieves aggregated list of instances.",
  51448. // "httpMethod": "GET",
  51449. // "id": "compute.instances.aggregatedList",
  51450. // "parameterOrder": [
  51451. // "project"
  51452. // ],
  51453. // "parameters": {
  51454. // "filter": {
  51455. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  51456. // "location": "query",
  51457. // "type": "string"
  51458. // },
  51459. // "maxResults": {
  51460. // "default": "500",
  51461. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  51462. // "format": "uint32",
  51463. // "location": "query",
  51464. // "minimum": "0",
  51465. // "type": "integer"
  51466. // },
  51467. // "orderBy": {
  51468. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  51469. // "location": "query",
  51470. // "type": "string"
  51471. // },
  51472. // "pageToken": {
  51473. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  51474. // "location": "query",
  51475. // "type": "string"
  51476. // },
  51477. // "project": {
  51478. // "description": "Project ID for this request.",
  51479. // "location": "path",
  51480. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  51481. // "required": true,
  51482. // "type": "string"
  51483. // }
  51484. // },
  51485. // "path": "{project}/aggregated/instances",
  51486. // "response": {
  51487. // "$ref": "InstanceAggregatedList"
  51488. // },
  51489. // "scopes": [
  51490. // "https://www.googleapis.com/auth/cloud-platform",
  51491. // "https://www.googleapis.com/auth/compute",
  51492. // "https://www.googleapis.com/auth/compute.readonly"
  51493. // ]
  51494. // }
  51495. }
  51496. // Pages invokes f for each page of results.
  51497. // A non-nil error returned from f will halt the iteration.
  51498. // The provided context supersedes any context provided to the Context method.
  51499. func (c *InstancesAggregatedListCall) Pages(ctx context.Context, f func(*InstanceAggregatedList) error) error {
  51500. c.ctx_ = ctx
  51501. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  51502. for {
  51503. x, err := c.Do()
  51504. if err != nil {
  51505. return err
  51506. }
  51507. if err := f(x); err != nil {
  51508. return err
  51509. }
  51510. if x.NextPageToken == "" {
  51511. return nil
  51512. }
  51513. c.PageToken(x.NextPageToken)
  51514. }
  51515. }
  51516. // method id "compute.instances.attachDisk":
  51517. type InstancesAttachDiskCall struct {
  51518. s *Service
  51519. project string
  51520. zone string
  51521. instance string
  51522. attacheddisk *AttachedDisk
  51523. urlParams_ gensupport.URLParams
  51524. ctx_ context.Context
  51525. header_ http.Header
  51526. }
  51527. // AttachDisk: Attaches an existing Disk resource to an instance. You
  51528. // must first create the disk before you can attach it. It is not
  51529. // possible to create and attach a disk at the same time. For more
  51530. // information, read Adding a persistent disk to your instance.
  51531. // For details, see https://cloud.google.com/compute/docs/reference/latest/instances/attachDisk
  51532. func (r *InstancesService) AttachDisk(project string, zone string, instance string, attacheddisk *AttachedDisk) *InstancesAttachDiskCall {
  51533. c := &InstancesAttachDiskCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  51534. c.project = project
  51535. c.zone = zone
  51536. c.instance = instance
  51537. c.attacheddisk = attacheddisk
  51538. return c
  51539. }
  51540. // ForceAttach sets the optional parameter "forceAttach": Whether to
  51541. // force attach the disk even if it's currently attached to another
  51542. // instance. This is only available for regional disks.
  51543. func (c *InstancesAttachDiskCall) ForceAttach(forceAttach bool) *InstancesAttachDiskCall {
  51544. c.urlParams_.Set("forceAttach", fmt.Sprint(forceAttach))
  51545. return c
  51546. }
  51547. // RequestId sets the optional parameter "requestId": An optional
  51548. // request ID to identify requests. Specify a unique request ID so that
  51549. // if you must retry your request, the server will know to ignore the
  51550. // request if it has already been completed.
  51551. //
  51552. // For example, consider a situation where you make an initial request
  51553. // and the request times out. If you make the request again with the
  51554. // same request ID, the server can check if original operation with the
  51555. // same request ID was received, and if so, will ignore the second
  51556. // request. This prevents clients from accidentally creating duplicate
  51557. // commitments.
  51558. //
  51559. // The request ID must be a valid UUID with the exception that zero UUID
  51560. // is not supported (00000000-0000-0000-0000-000000000000).
  51561. func (c *InstancesAttachDiskCall) RequestId(requestId string) *InstancesAttachDiskCall {
  51562. c.urlParams_.Set("requestId", requestId)
  51563. return c
  51564. }
  51565. // Fields allows partial responses to be retrieved. See
  51566. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  51567. // for more information.
  51568. func (c *InstancesAttachDiskCall) Fields(s ...googleapi.Field) *InstancesAttachDiskCall {
  51569. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  51570. return c
  51571. }
  51572. // Context sets the context to be used in this call's Do method. Any
  51573. // pending HTTP request will be aborted if the provided context is
  51574. // canceled.
  51575. func (c *InstancesAttachDiskCall) Context(ctx context.Context) *InstancesAttachDiskCall {
  51576. c.ctx_ = ctx
  51577. return c
  51578. }
  51579. // Header returns an http.Header that can be modified by the caller to
  51580. // add HTTP headers to the request.
  51581. func (c *InstancesAttachDiskCall) Header() http.Header {
  51582. if c.header_ == nil {
  51583. c.header_ = make(http.Header)
  51584. }
  51585. return c.header_
  51586. }
  51587. func (c *InstancesAttachDiskCall) doRequest(alt string) (*http.Response, error) {
  51588. reqHeaders := make(http.Header)
  51589. for k, v := range c.header_ {
  51590. reqHeaders[k] = v
  51591. }
  51592. reqHeaders.Set("User-Agent", c.s.userAgent())
  51593. var body io.Reader = nil
  51594. body, err := googleapi.WithoutDataWrapper.JSONReader(c.attacheddisk)
  51595. if err != nil {
  51596. return nil, err
  51597. }
  51598. reqHeaders.Set("Content-Type", "application/json")
  51599. c.urlParams_.Set("alt", alt)
  51600. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/attachDisk")
  51601. urls += "?" + c.urlParams_.Encode()
  51602. req, _ := http.NewRequest("POST", urls, body)
  51603. req.Header = reqHeaders
  51604. googleapi.Expand(req.URL, map[string]string{
  51605. "project": c.project,
  51606. "zone": c.zone,
  51607. "instance": c.instance,
  51608. })
  51609. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  51610. }
  51611. // Do executes the "compute.instances.attachDisk" call.
  51612. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  51613. // status code is an error. Response headers are in either
  51614. // *Operation.ServerResponse.Header or (if a response was returned at
  51615. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  51616. // to check whether the returned error was because
  51617. // http.StatusNotModified was returned.
  51618. func (c *InstancesAttachDiskCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  51619. gensupport.SetOptions(c.urlParams_, opts...)
  51620. res, err := c.doRequest("json")
  51621. if res != nil && res.StatusCode == http.StatusNotModified {
  51622. if res.Body != nil {
  51623. res.Body.Close()
  51624. }
  51625. return nil, &googleapi.Error{
  51626. Code: res.StatusCode,
  51627. Header: res.Header,
  51628. }
  51629. }
  51630. if err != nil {
  51631. return nil, err
  51632. }
  51633. defer googleapi.CloseBody(res)
  51634. if err := googleapi.CheckResponse(res); err != nil {
  51635. return nil, err
  51636. }
  51637. ret := &Operation{
  51638. ServerResponse: googleapi.ServerResponse{
  51639. Header: res.Header,
  51640. HTTPStatusCode: res.StatusCode,
  51641. },
  51642. }
  51643. target := &ret
  51644. if err := gensupport.DecodeResponse(target, res); err != nil {
  51645. return nil, err
  51646. }
  51647. return ret, nil
  51648. // {
  51649. // "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.",
  51650. // "httpMethod": "POST",
  51651. // "id": "compute.instances.attachDisk",
  51652. // "parameterOrder": [
  51653. // "project",
  51654. // "zone",
  51655. // "instance"
  51656. // ],
  51657. // "parameters": {
  51658. // "forceAttach": {
  51659. // "description": "Whether to force attach the disk even if it's currently attached to another instance. This is only available for regional disks.",
  51660. // "location": "query",
  51661. // "type": "boolean"
  51662. // },
  51663. // "instance": {
  51664. // "description": "The instance name for this request.",
  51665. // "location": "path",
  51666. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  51667. // "required": true,
  51668. // "type": "string"
  51669. // },
  51670. // "project": {
  51671. // "description": "Project ID for this request.",
  51672. // "location": "path",
  51673. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  51674. // "required": true,
  51675. // "type": "string"
  51676. // },
  51677. // "requestId": {
  51678. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  51679. // "location": "query",
  51680. // "type": "string"
  51681. // },
  51682. // "zone": {
  51683. // "description": "The name of the zone for this request.",
  51684. // "location": "path",
  51685. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  51686. // "required": true,
  51687. // "type": "string"
  51688. // }
  51689. // },
  51690. // "path": "{project}/zones/{zone}/instances/{instance}/attachDisk",
  51691. // "request": {
  51692. // "$ref": "AttachedDisk"
  51693. // },
  51694. // "response": {
  51695. // "$ref": "Operation"
  51696. // },
  51697. // "scopes": [
  51698. // "https://www.googleapis.com/auth/cloud-platform",
  51699. // "https://www.googleapis.com/auth/compute"
  51700. // ]
  51701. // }
  51702. }
  51703. // method id "compute.instances.delete":
  51704. type InstancesDeleteCall struct {
  51705. s *Service
  51706. project string
  51707. zone string
  51708. instance string
  51709. urlParams_ gensupport.URLParams
  51710. ctx_ context.Context
  51711. header_ http.Header
  51712. }
  51713. // Delete: Deletes the specified Instance resource. For more
  51714. // information, see Stopping or Deleting an Instance.
  51715. // For details, see https://cloud.google.com/compute/docs/reference/latest/instances/delete
  51716. func (r *InstancesService) Delete(project string, zone string, instance string) *InstancesDeleteCall {
  51717. c := &InstancesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  51718. c.project = project
  51719. c.zone = zone
  51720. c.instance = instance
  51721. return c
  51722. }
  51723. // RequestId sets the optional parameter "requestId": An optional
  51724. // request ID to identify requests. Specify a unique request ID so that
  51725. // if you must retry your request, the server will know to ignore the
  51726. // request if it has already been completed.
  51727. //
  51728. // For example, consider a situation where you make an initial request
  51729. // and the request times out. If you make the request again with the
  51730. // same request ID, the server can check if original operation with the
  51731. // same request ID was received, and if so, will ignore the second
  51732. // request. This prevents clients from accidentally creating duplicate
  51733. // commitments.
  51734. //
  51735. // The request ID must be a valid UUID with the exception that zero UUID
  51736. // is not supported (00000000-0000-0000-0000-000000000000).
  51737. func (c *InstancesDeleteCall) RequestId(requestId string) *InstancesDeleteCall {
  51738. c.urlParams_.Set("requestId", requestId)
  51739. return c
  51740. }
  51741. // Fields allows partial responses to be retrieved. See
  51742. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  51743. // for more information.
  51744. func (c *InstancesDeleteCall) Fields(s ...googleapi.Field) *InstancesDeleteCall {
  51745. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  51746. return c
  51747. }
  51748. // Context sets the context to be used in this call's Do method. Any
  51749. // pending HTTP request will be aborted if the provided context is
  51750. // canceled.
  51751. func (c *InstancesDeleteCall) Context(ctx context.Context) *InstancesDeleteCall {
  51752. c.ctx_ = ctx
  51753. return c
  51754. }
  51755. // Header returns an http.Header that can be modified by the caller to
  51756. // add HTTP headers to the request.
  51757. func (c *InstancesDeleteCall) Header() http.Header {
  51758. if c.header_ == nil {
  51759. c.header_ = make(http.Header)
  51760. }
  51761. return c.header_
  51762. }
  51763. func (c *InstancesDeleteCall) doRequest(alt string) (*http.Response, error) {
  51764. reqHeaders := make(http.Header)
  51765. for k, v := range c.header_ {
  51766. reqHeaders[k] = v
  51767. }
  51768. reqHeaders.Set("User-Agent", c.s.userAgent())
  51769. var body io.Reader = nil
  51770. c.urlParams_.Set("alt", alt)
  51771. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}")
  51772. urls += "?" + c.urlParams_.Encode()
  51773. req, _ := http.NewRequest("DELETE", urls, body)
  51774. req.Header = reqHeaders
  51775. googleapi.Expand(req.URL, map[string]string{
  51776. "project": c.project,
  51777. "zone": c.zone,
  51778. "instance": c.instance,
  51779. })
  51780. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  51781. }
  51782. // Do executes the "compute.instances.delete" call.
  51783. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  51784. // status code is an error. Response headers are in either
  51785. // *Operation.ServerResponse.Header or (if a response was returned at
  51786. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  51787. // to check whether the returned error was because
  51788. // http.StatusNotModified was returned.
  51789. func (c *InstancesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  51790. gensupport.SetOptions(c.urlParams_, opts...)
  51791. res, err := c.doRequest("json")
  51792. if res != nil && res.StatusCode == http.StatusNotModified {
  51793. if res.Body != nil {
  51794. res.Body.Close()
  51795. }
  51796. return nil, &googleapi.Error{
  51797. Code: res.StatusCode,
  51798. Header: res.Header,
  51799. }
  51800. }
  51801. if err != nil {
  51802. return nil, err
  51803. }
  51804. defer googleapi.CloseBody(res)
  51805. if err := googleapi.CheckResponse(res); err != nil {
  51806. return nil, err
  51807. }
  51808. ret := &Operation{
  51809. ServerResponse: googleapi.ServerResponse{
  51810. Header: res.Header,
  51811. HTTPStatusCode: res.StatusCode,
  51812. },
  51813. }
  51814. target := &ret
  51815. if err := gensupport.DecodeResponse(target, res); err != nil {
  51816. return nil, err
  51817. }
  51818. return ret, nil
  51819. // {
  51820. // "description": "Deletes the specified Instance resource. For more information, see Stopping or Deleting an Instance.",
  51821. // "httpMethod": "DELETE",
  51822. // "id": "compute.instances.delete",
  51823. // "parameterOrder": [
  51824. // "project",
  51825. // "zone",
  51826. // "instance"
  51827. // ],
  51828. // "parameters": {
  51829. // "instance": {
  51830. // "description": "Name of the instance resource to delete.",
  51831. // "location": "path",
  51832. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  51833. // "required": true,
  51834. // "type": "string"
  51835. // },
  51836. // "project": {
  51837. // "description": "Project ID for this request.",
  51838. // "location": "path",
  51839. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  51840. // "required": true,
  51841. // "type": "string"
  51842. // },
  51843. // "requestId": {
  51844. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  51845. // "location": "query",
  51846. // "type": "string"
  51847. // },
  51848. // "zone": {
  51849. // "description": "The name of the zone for this request.",
  51850. // "location": "path",
  51851. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  51852. // "required": true,
  51853. // "type": "string"
  51854. // }
  51855. // },
  51856. // "path": "{project}/zones/{zone}/instances/{instance}",
  51857. // "response": {
  51858. // "$ref": "Operation"
  51859. // },
  51860. // "scopes": [
  51861. // "https://www.googleapis.com/auth/cloud-platform",
  51862. // "https://www.googleapis.com/auth/compute"
  51863. // ]
  51864. // }
  51865. }
  51866. // method id "compute.instances.deleteAccessConfig":
  51867. type InstancesDeleteAccessConfigCall struct {
  51868. s *Service
  51869. project string
  51870. zone string
  51871. instance string
  51872. urlParams_ gensupport.URLParams
  51873. ctx_ context.Context
  51874. header_ http.Header
  51875. }
  51876. // DeleteAccessConfig: Deletes an access config from an instance's
  51877. // network interface.
  51878. // For details, see https://cloud.google.com/compute/docs/reference/latest/instances/deleteAccessConfig
  51879. func (r *InstancesService) DeleteAccessConfig(project string, zone string, instance string, accessConfig string, networkInterface string) *InstancesDeleteAccessConfigCall {
  51880. c := &InstancesDeleteAccessConfigCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  51881. c.project = project
  51882. c.zone = zone
  51883. c.instance = instance
  51884. c.urlParams_.Set("accessConfig", accessConfig)
  51885. c.urlParams_.Set("networkInterface", networkInterface)
  51886. return c
  51887. }
  51888. // RequestId sets the optional parameter "requestId": An optional
  51889. // request ID to identify requests. Specify a unique request ID so that
  51890. // if you must retry your request, the server will know to ignore the
  51891. // request if it has already been completed.
  51892. //
  51893. // For example, consider a situation where you make an initial request
  51894. // and the request times out. If you make the request again with the
  51895. // same request ID, the server can check if original operation with the
  51896. // same request ID was received, and if so, will ignore the second
  51897. // request. This prevents clients from accidentally creating duplicate
  51898. // commitments.
  51899. //
  51900. // The request ID must be a valid UUID with the exception that zero UUID
  51901. // is not supported (00000000-0000-0000-0000-000000000000).
  51902. func (c *InstancesDeleteAccessConfigCall) RequestId(requestId string) *InstancesDeleteAccessConfigCall {
  51903. c.urlParams_.Set("requestId", requestId)
  51904. return c
  51905. }
  51906. // Fields allows partial responses to be retrieved. See
  51907. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  51908. // for more information.
  51909. func (c *InstancesDeleteAccessConfigCall) Fields(s ...googleapi.Field) *InstancesDeleteAccessConfigCall {
  51910. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  51911. return c
  51912. }
  51913. // Context sets the context to be used in this call's Do method. Any
  51914. // pending HTTP request will be aborted if the provided context is
  51915. // canceled.
  51916. func (c *InstancesDeleteAccessConfigCall) Context(ctx context.Context) *InstancesDeleteAccessConfigCall {
  51917. c.ctx_ = ctx
  51918. return c
  51919. }
  51920. // Header returns an http.Header that can be modified by the caller to
  51921. // add HTTP headers to the request.
  51922. func (c *InstancesDeleteAccessConfigCall) Header() http.Header {
  51923. if c.header_ == nil {
  51924. c.header_ = make(http.Header)
  51925. }
  51926. return c.header_
  51927. }
  51928. func (c *InstancesDeleteAccessConfigCall) doRequest(alt string) (*http.Response, error) {
  51929. reqHeaders := make(http.Header)
  51930. for k, v := range c.header_ {
  51931. reqHeaders[k] = v
  51932. }
  51933. reqHeaders.Set("User-Agent", c.s.userAgent())
  51934. var body io.Reader = nil
  51935. c.urlParams_.Set("alt", alt)
  51936. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/deleteAccessConfig")
  51937. urls += "?" + c.urlParams_.Encode()
  51938. req, _ := http.NewRequest("POST", urls, body)
  51939. req.Header = reqHeaders
  51940. googleapi.Expand(req.URL, map[string]string{
  51941. "project": c.project,
  51942. "zone": c.zone,
  51943. "instance": c.instance,
  51944. })
  51945. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  51946. }
  51947. // Do executes the "compute.instances.deleteAccessConfig" call.
  51948. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  51949. // status code is an error. Response headers are in either
  51950. // *Operation.ServerResponse.Header or (if a response was returned at
  51951. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  51952. // to check whether the returned error was because
  51953. // http.StatusNotModified was returned.
  51954. func (c *InstancesDeleteAccessConfigCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  51955. gensupport.SetOptions(c.urlParams_, opts...)
  51956. res, err := c.doRequest("json")
  51957. if res != nil && res.StatusCode == http.StatusNotModified {
  51958. if res.Body != nil {
  51959. res.Body.Close()
  51960. }
  51961. return nil, &googleapi.Error{
  51962. Code: res.StatusCode,
  51963. Header: res.Header,
  51964. }
  51965. }
  51966. if err != nil {
  51967. return nil, err
  51968. }
  51969. defer googleapi.CloseBody(res)
  51970. if err := googleapi.CheckResponse(res); err != nil {
  51971. return nil, err
  51972. }
  51973. ret := &Operation{
  51974. ServerResponse: googleapi.ServerResponse{
  51975. Header: res.Header,
  51976. HTTPStatusCode: res.StatusCode,
  51977. },
  51978. }
  51979. target := &ret
  51980. if err := gensupport.DecodeResponse(target, res); err != nil {
  51981. return nil, err
  51982. }
  51983. return ret, nil
  51984. // {
  51985. // "description": "Deletes an access config from an instance's network interface.",
  51986. // "httpMethod": "POST",
  51987. // "id": "compute.instances.deleteAccessConfig",
  51988. // "parameterOrder": [
  51989. // "project",
  51990. // "zone",
  51991. // "instance",
  51992. // "accessConfig",
  51993. // "networkInterface"
  51994. // ],
  51995. // "parameters": {
  51996. // "accessConfig": {
  51997. // "description": "The name of the access config to delete.",
  51998. // "location": "query",
  51999. // "required": true,
  52000. // "type": "string"
  52001. // },
  52002. // "instance": {
  52003. // "description": "The instance name for this request.",
  52004. // "location": "path",
  52005. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  52006. // "required": true,
  52007. // "type": "string"
  52008. // },
  52009. // "networkInterface": {
  52010. // "description": "The name of the network interface.",
  52011. // "location": "query",
  52012. // "required": true,
  52013. // "type": "string"
  52014. // },
  52015. // "project": {
  52016. // "description": "Project ID for this request.",
  52017. // "location": "path",
  52018. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  52019. // "required": true,
  52020. // "type": "string"
  52021. // },
  52022. // "requestId": {
  52023. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  52024. // "location": "query",
  52025. // "type": "string"
  52026. // },
  52027. // "zone": {
  52028. // "description": "The name of the zone for this request.",
  52029. // "location": "path",
  52030. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  52031. // "required": true,
  52032. // "type": "string"
  52033. // }
  52034. // },
  52035. // "path": "{project}/zones/{zone}/instances/{instance}/deleteAccessConfig",
  52036. // "response": {
  52037. // "$ref": "Operation"
  52038. // },
  52039. // "scopes": [
  52040. // "https://www.googleapis.com/auth/cloud-platform",
  52041. // "https://www.googleapis.com/auth/compute"
  52042. // ]
  52043. // }
  52044. }
  52045. // method id "compute.instances.detachDisk":
  52046. type InstancesDetachDiskCall struct {
  52047. s *Service
  52048. project string
  52049. zone string
  52050. instance string
  52051. urlParams_ gensupport.URLParams
  52052. ctx_ context.Context
  52053. header_ http.Header
  52054. }
  52055. // DetachDisk: Detaches a disk from an instance.
  52056. // For details, see https://cloud.google.com/compute/docs/reference/latest/instances/detachDisk
  52057. func (r *InstancesService) DetachDisk(project string, zone string, instance string, deviceName string) *InstancesDetachDiskCall {
  52058. c := &InstancesDetachDiskCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  52059. c.project = project
  52060. c.zone = zone
  52061. c.instance = instance
  52062. c.urlParams_.Set("deviceName", deviceName)
  52063. return c
  52064. }
  52065. // RequestId sets the optional parameter "requestId": An optional
  52066. // request ID to identify requests. Specify a unique request ID so that
  52067. // if you must retry your request, the server will know to ignore the
  52068. // request if it has already been completed.
  52069. //
  52070. // For example, consider a situation where you make an initial request
  52071. // and the request times out. If you make the request again with the
  52072. // same request ID, the server can check if original operation with the
  52073. // same request ID was received, and if so, will ignore the second
  52074. // request. This prevents clients from accidentally creating duplicate
  52075. // commitments.
  52076. //
  52077. // The request ID must be a valid UUID with the exception that zero UUID
  52078. // is not supported (00000000-0000-0000-0000-000000000000).
  52079. func (c *InstancesDetachDiskCall) RequestId(requestId string) *InstancesDetachDiskCall {
  52080. c.urlParams_.Set("requestId", requestId)
  52081. return c
  52082. }
  52083. // Fields allows partial responses to be retrieved. See
  52084. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  52085. // for more information.
  52086. func (c *InstancesDetachDiskCall) Fields(s ...googleapi.Field) *InstancesDetachDiskCall {
  52087. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  52088. return c
  52089. }
  52090. // Context sets the context to be used in this call's Do method. Any
  52091. // pending HTTP request will be aborted if the provided context is
  52092. // canceled.
  52093. func (c *InstancesDetachDiskCall) Context(ctx context.Context) *InstancesDetachDiskCall {
  52094. c.ctx_ = ctx
  52095. return c
  52096. }
  52097. // Header returns an http.Header that can be modified by the caller to
  52098. // add HTTP headers to the request.
  52099. func (c *InstancesDetachDiskCall) Header() http.Header {
  52100. if c.header_ == nil {
  52101. c.header_ = make(http.Header)
  52102. }
  52103. return c.header_
  52104. }
  52105. func (c *InstancesDetachDiskCall) doRequest(alt string) (*http.Response, error) {
  52106. reqHeaders := make(http.Header)
  52107. for k, v := range c.header_ {
  52108. reqHeaders[k] = v
  52109. }
  52110. reqHeaders.Set("User-Agent", c.s.userAgent())
  52111. var body io.Reader = nil
  52112. c.urlParams_.Set("alt", alt)
  52113. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/detachDisk")
  52114. urls += "?" + c.urlParams_.Encode()
  52115. req, _ := http.NewRequest("POST", urls, body)
  52116. req.Header = reqHeaders
  52117. googleapi.Expand(req.URL, map[string]string{
  52118. "project": c.project,
  52119. "zone": c.zone,
  52120. "instance": c.instance,
  52121. })
  52122. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  52123. }
  52124. // Do executes the "compute.instances.detachDisk" call.
  52125. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  52126. // status code is an error. Response headers are in either
  52127. // *Operation.ServerResponse.Header or (if a response was returned at
  52128. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  52129. // to check whether the returned error was because
  52130. // http.StatusNotModified was returned.
  52131. func (c *InstancesDetachDiskCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  52132. gensupport.SetOptions(c.urlParams_, opts...)
  52133. res, err := c.doRequest("json")
  52134. if res != nil && res.StatusCode == http.StatusNotModified {
  52135. if res.Body != nil {
  52136. res.Body.Close()
  52137. }
  52138. return nil, &googleapi.Error{
  52139. Code: res.StatusCode,
  52140. Header: res.Header,
  52141. }
  52142. }
  52143. if err != nil {
  52144. return nil, err
  52145. }
  52146. defer googleapi.CloseBody(res)
  52147. if err := googleapi.CheckResponse(res); err != nil {
  52148. return nil, err
  52149. }
  52150. ret := &Operation{
  52151. ServerResponse: googleapi.ServerResponse{
  52152. Header: res.Header,
  52153. HTTPStatusCode: res.StatusCode,
  52154. },
  52155. }
  52156. target := &ret
  52157. if err := gensupport.DecodeResponse(target, res); err != nil {
  52158. return nil, err
  52159. }
  52160. return ret, nil
  52161. // {
  52162. // "description": "Detaches a disk from an instance.",
  52163. // "httpMethod": "POST",
  52164. // "id": "compute.instances.detachDisk",
  52165. // "parameterOrder": [
  52166. // "project",
  52167. // "zone",
  52168. // "instance",
  52169. // "deviceName"
  52170. // ],
  52171. // "parameters": {
  52172. // "deviceName": {
  52173. // "description": "Disk device name to detach.",
  52174. // "location": "query",
  52175. // "required": true,
  52176. // "type": "string"
  52177. // },
  52178. // "instance": {
  52179. // "description": "Instance name.",
  52180. // "location": "path",
  52181. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  52182. // "required": true,
  52183. // "type": "string"
  52184. // },
  52185. // "project": {
  52186. // "description": "Project ID for this request.",
  52187. // "location": "path",
  52188. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  52189. // "required": true,
  52190. // "type": "string"
  52191. // },
  52192. // "requestId": {
  52193. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  52194. // "location": "query",
  52195. // "type": "string"
  52196. // },
  52197. // "zone": {
  52198. // "description": "The name of the zone for this request.",
  52199. // "location": "path",
  52200. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  52201. // "required": true,
  52202. // "type": "string"
  52203. // }
  52204. // },
  52205. // "path": "{project}/zones/{zone}/instances/{instance}/detachDisk",
  52206. // "response": {
  52207. // "$ref": "Operation"
  52208. // },
  52209. // "scopes": [
  52210. // "https://www.googleapis.com/auth/cloud-platform",
  52211. // "https://www.googleapis.com/auth/compute"
  52212. // ]
  52213. // }
  52214. }
  52215. // method id "compute.instances.get":
  52216. type InstancesGetCall struct {
  52217. s *Service
  52218. project string
  52219. zone string
  52220. instance string
  52221. urlParams_ gensupport.URLParams
  52222. ifNoneMatch_ string
  52223. ctx_ context.Context
  52224. header_ http.Header
  52225. }
  52226. // Get: Returns the specified Instance resource. Gets a list of
  52227. // available instances by making a list() request.
  52228. // For details, see https://cloud.google.com/compute/docs/reference/latest/instances/get
  52229. func (r *InstancesService) Get(project string, zone string, instance string) *InstancesGetCall {
  52230. c := &InstancesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  52231. c.project = project
  52232. c.zone = zone
  52233. c.instance = instance
  52234. return c
  52235. }
  52236. // Fields allows partial responses to be retrieved. See
  52237. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  52238. // for more information.
  52239. func (c *InstancesGetCall) Fields(s ...googleapi.Field) *InstancesGetCall {
  52240. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  52241. return c
  52242. }
  52243. // IfNoneMatch sets the optional parameter which makes the operation
  52244. // fail if the object's ETag matches the given value. This is useful for
  52245. // getting updates only after the object has changed since the last
  52246. // request. Use googleapi.IsNotModified to check whether the response
  52247. // error from Do is the result of In-None-Match.
  52248. func (c *InstancesGetCall) IfNoneMatch(entityTag string) *InstancesGetCall {
  52249. c.ifNoneMatch_ = entityTag
  52250. return c
  52251. }
  52252. // Context sets the context to be used in this call's Do method. Any
  52253. // pending HTTP request will be aborted if the provided context is
  52254. // canceled.
  52255. func (c *InstancesGetCall) Context(ctx context.Context) *InstancesGetCall {
  52256. c.ctx_ = ctx
  52257. return c
  52258. }
  52259. // Header returns an http.Header that can be modified by the caller to
  52260. // add HTTP headers to the request.
  52261. func (c *InstancesGetCall) Header() http.Header {
  52262. if c.header_ == nil {
  52263. c.header_ = make(http.Header)
  52264. }
  52265. return c.header_
  52266. }
  52267. func (c *InstancesGetCall) doRequest(alt string) (*http.Response, error) {
  52268. reqHeaders := make(http.Header)
  52269. for k, v := range c.header_ {
  52270. reqHeaders[k] = v
  52271. }
  52272. reqHeaders.Set("User-Agent", c.s.userAgent())
  52273. if c.ifNoneMatch_ != "" {
  52274. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  52275. }
  52276. var body io.Reader = nil
  52277. c.urlParams_.Set("alt", alt)
  52278. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}")
  52279. urls += "?" + c.urlParams_.Encode()
  52280. req, _ := http.NewRequest("GET", urls, body)
  52281. req.Header = reqHeaders
  52282. googleapi.Expand(req.URL, map[string]string{
  52283. "project": c.project,
  52284. "zone": c.zone,
  52285. "instance": c.instance,
  52286. })
  52287. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  52288. }
  52289. // Do executes the "compute.instances.get" call.
  52290. // Exactly one of *Instance or error will be non-nil. Any non-2xx status
  52291. // code is an error. Response headers are in either
  52292. // *Instance.ServerResponse.Header or (if a response was returned at
  52293. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  52294. // to check whether the returned error was because
  52295. // http.StatusNotModified was returned.
  52296. func (c *InstancesGetCall) Do(opts ...googleapi.CallOption) (*Instance, error) {
  52297. gensupport.SetOptions(c.urlParams_, opts...)
  52298. res, err := c.doRequest("json")
  52299. if res != nil && res.StatusCode == http.StatusNotModified {
  52300. if res.Body != nil {
  52301. res.Body.Close()
  52302. }
  52303. return nil, &googleapi.Error{
  52304. Code: res.StatusCode,
  52305. Header: res.Header,
  52306. }
  52307. }
  52308. if err != nil {
  52309. return nil, err
  52310. }
  52311. defer googleapi.CloseBody(res)
  52312. if err := googleapi.CheckResponse(res); err != nil {
  52313. return nil, err
  52314. }
  52315. ret := &Instance{
  52316. ServerResponse: googleapi.ServerResponse{
  52317. Header: res.Header,
  52318. HTTPStatusCode: res.StatusCode,
  52319. },
  52320. }
  52321. target := &ret
  52322. if err := gensupport.DecodeResponse(target, res); err != nil {
  52323. return nil, err
  52324. }
  52325. return ret, nil
  52326. // {
  52327. // "description": "Returns the specified Instance resource. Gets a list of available instances by making a list() request.",
  52328. // "httpMethod": "GET",
  52329. // "id": "compute.instances.get",
  52330. // "parameterOrder": [
  52331. // "project",
  52332. // "zone",
  52333. // "instance"
  52334. // ],
  52335. // "parameters": {
  52336. // "instance": {
  52337. // "description": "Name of the instance resource to return.",
  52338. // "location": "path",
  52339. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  52340. // "required": true,
  52341. // "type": "string"
  52342. // },
  52343. // "project": {
  52344. // "description": "Project ID for this request.",
  52345. // "location": "path",
  52346. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  52347. // "required": true,
  52348. // "type": "string"
  52349. // },
  52350. // "zone": {
  52351. // "description": "The name of the zone for this request.",
  52352. // "location": "path",
  52353. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  52354. // "required": true,
  52355. // "type": "string"
  52356. // }
  52357. // },
  52358. // "path": "{project}/zones/{zone}/instances/{instance}",
  52359. // "response": {
  52360. // "$ref": "Instance"
  52361. // },
  52362. // "scopes": [
  52363. // "https://www.googleapis.com/auth/cloud-platform",
  52364. // "https://www.googleapis.com/auth/compute",
  52365. // "https://www.googleapis.com/auth/compute.readonly"
  52366. // ]
  52367. // }
  52368. }
  52369. // method id "compute.instances.getSerialPortOutput":
  52370. type InstancesGetSerialPortOutputCall struct {
  52371. s *Service
  52372. project string
  52373. zone string
  52374. instance string
  52375. urlParams_ gensupport.URLParams
  52376. ifNoneMatch_ string
  52377. ctx_ context.Context
  52378. header_ http.Header
  52379. }
  52380. // GetSerialPortOutput: Returns the specified instance's serial port
  52381. // output.
  52382. // For details, see https://cloud.google.com/compute/docs/reference/latest/instances/getSerialPortOutput
  52383. func (r *InstancesService) GetSerialPortOutput(project string, zone string, instance string) *InstancesGetSerialPortOutputCall {
  52384. c := &InstancesGetSerialPortOutputCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  52385. c.project = project
  52386. c.zone = zone
  52387. c.instance = instance
  52388. return c
  52389. }
  52390. // Port sets the optional parameter "port": Specifies which COM or
  52391. // serial port to retrieve data from.
  52392. func (c *InstancesGetSerialPortOutputCall) Port(port int64) *InstancesGetSerialPortOutputCall {
  52393. c.urlParams_.Set("port", fmt.Sprint(port))
  52394. return c
  52395. }
  52396. // Start sets the optional parameter "start": Returns output starting
  52397. // from a specific byte position. Use this to page through output when
  52398. // the output is too large to return in a single request. For the
  52399. // initial request, leave this field unspecified. For subsequent calls,
  52400. // this field should be set to the next value returned in the previous
  52401. // call.
  52402. func (c *InstancesGetSerialPortOutputCall) Start(start int64) *InstancesGetSerialPortOutputCall {
  52403. c.urlParams_.Set("start", fmt.Sprint(start))
  52404. return c
  52405. }
  52406. // Fields allows partial responses to be retrieved. See
  52407. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  52408. // for more information.
  52409. func (c *InstancesGetSerialPortOutputCall) Fields(s ...googleapi.Field) *InstancesGetSerialPortOutputCall {
  52410. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  52411. return c
  52412. }
  52413. // IfNoneMatch sets the optional parameter which makes the operation
  52414. // fail if the object's ETag matches the given value. This is useful for
  52415. // getting updates only after the object has changed since the last
  52416. // request. Use googleapi.IsNotModified to check whether the response
  52417. // error from Do is the result of In-None-Match.
  52418. func (c *InstancesGetSerialPortOutputCall) IfNoneMatch(entityTag string) *InstancesGetSerialPortOutputCall {
  52419. c.ifNoneMatch_ = entityTag
  52420. return c
  52421. }
  52422. // Context sets the context to be used in this call's Do method. Any
  52423. // pending HTTP request will be aborted if the provided context is
  52424. // canceled.
  52425. func (c *InstancesGetSerialPortOutputCall) Context(ctx context.Context) *InstancesGetSerialPortOutputCall {
  52426. c.ctx_ = ctx
  52427. return c
  52428. }
  52429. // Header returns an http.Header that can be modified by the caller to
  52430. // add HTTP headers to the request.
  52431. func (c *InstancesGetSerialPortOutputCall) Header() http.Header {
  52432. if c.header_ == nil {
  52433. c.header_ = make(http.Header)
  52434. }
  52435. return c.header_
  52436. }
  52437. func (c *InstancesGetSerialPortOutputCall) doRequest(alt string) (*http.Response, error) {
  52438. reqHeaders := make(http.Header)
  52439. for k, v := range c.header_ {
  52440. reqHeaders[k] = v
  52441. }
  52442. reqHeaders.Set("User-Agent", c.s.userAgent())
  52443. if c.ifNoneMatch_ != "" {
  52444. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  52445. }
  52446. var body io.Reader = nil
  52447. c.urlParams_.Set("alt", alt)
  52448. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/serialPort")
  52449. urls += "?" + c.urlParams_.Encode()
  52450. req, _ := http.NewRequest("GET", urls, body)
  52451. req.Header = reqHeaders
  52452. googleapi.Expand(req.URL, map[string]string{
  52453. "project": c.project,
  52454. "zone": c.zone,
  52455. "instance": c.instance,
  52456. })
  52457. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  52458. }
  52459. // Do executes the "compute.instances.getSerialPortOutput" call.
  52460. // Exactly one of *SerialPortOutput or error will be non-nil. Any
  52461. // non-2xx status code is an error. Response headers are in either
  52462. // *SerialPortOutput.ServerResponse.Header or (if a response was
  52463. // returned at all) in error.(*googleapi.Error).Header. Use
  52464. // googleapi.IsNotModified to check whether the returned error was
  52465. // because http.StatusNotModified was returned.
  52466. func (c *InstancesGetSerialPortOutputCall) Do(opts ...googleapi.CallOption) (*SerialPortOutput, error) {
  52467. gensupport.SetOptions(c.urlParams_, opts...)
  52468. res, err := c.doRequest("json")
  52469. if res != nil && res.StatusCode == http.StatusNotModified {
  52470. if res.Body != nil {
  52471. res.Body.Close()
  52472. }
  52473. return nil, &googleapi.Error{
  52474. Code: res.StatusCode,
  52475. Header: res.Header,
  52476. }
  52477. }
  52478. if err != nil {
  52479. return nil, err
  52480. }
  52481. defer googleapi.CloseBody(res)
  52482. if err := googleapi.CheckResponse(res); err != nil {
  52483. return nil, err
  52484. }
  52485. ret := &SerialPortOutput{
  52486. ServerResponse: googleapi.ServerResponse{
  52487. Header: res.Header,
  52488. HTTPStatusCode: res.StatusCode,
  52489. },
  52490. }
  52491. target := &ret
  52492. if err := gensupport.DecodeResponse(target, res); err != nil {
  52493. return nil, err
  52494. }
  52495. return ret, nil
  52496. // {
  52497. // "description": "Returns the specified instance's serial port output.",
  52498. // "httpMethod": "GET",
  52499. // "id": "compute.instances.getSerialPortOutput",
  52500. // "parameterOrder": [
  52501. // "project",
  52502. // "zone",
  52503. // "instance"
  52504. // ],
  52505. // "parameters": {
  52506. // "instance": {
  52507. // "description": "Name of the instance scoping this request.",
  52508. // "location": "path",
  52509. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  52510. // "required": true,
  52511. // "type": "string"
  52512. // },
  52513. // "port": {
  52514. // "default": "1",
  52515. // "description": "Specifies which COM or serial port to retrieve data from.",
  52516. // "format": "int32",
  52517. // "location": "query",
  52518. // "maximum": "4",
  52519. // "minimum": "1",
  52520. // "type": "integer"
  52521. // },
  52522. // "project": {
  52523. // "description": "Project ID for this request.",
  52524. // "location": "path",
  52525. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  52526. // "required": true,
  52527. // "type": "string"
  52528. // },
  52529. // "start": {
  52530. // "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.",
  52531. // "format": "int64",
  52532. // "location": "query",
  52533. // "type": "string"
  52534. // },
  52535. // "zone": {
  52536. // "description": "The name of the zone for this request.",
  52537. // "location": "path",
  52538. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  52539. // "required": true,
  52540. // "type": "string"
  52541. // }
  52542. // },
  52543. // "path": "{project}/zones/{zone}/instances/{instance}/serialPort",
  52544. // "response": {
  52545. // "$ref": "SerialPortOutput"
  52546. // },
  52547. // "scopes": [
  52548. // "https://www.googleapis.com/auth/cloud-platform",
  52549. // "https://www.googleapis.com/auth/compute",
  52550. // "https://www.googleapis.com/auth/compute.readonly"
  52551. // ]
  52552. // }
  52553. }
  52554. // method id "compute.instances.insert":
  52555. type InstancesInsertCall struct {
  52556. s *Service
  52557. project string
  52558. zone string
  52559. instance *Instance
  52560. urlParams_ gensupport.URLParams
  52561. ctx_ context.Context
  52562. header_ http.Header
  52563. }
  52564. // Insert: Creates an instance resource in the specified project using
  52565. // the data included in the request.
  52566. // For details, see https://cloud.google.com/compute/docs/reference/latest/instances/insert
  52567. func (r *InstancesService) Insert(project string, zone string, instance *Instance) *InstancesInsertCall {
  52568. c := &InstancesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  52569. c.project = project
  52570. c.zone = zone
  52571. c.instance = instance
  52572. return c
  52573. }
  52574. // RequestId sets the optional parameter "requestId": An optional
  52575. // request ID to identify requests. Specify a unique request ID so that
  52576. // if you must retry your request, the server will know to ignore the
  52577. // request if it has already been completed.
  52578. //
  52579. // For example, consider a situation where you make an initial request
  52580. // and the request times out. If you make the request again with the
  52581. // same request ID, the server can check if original operation with the
  52582. // same request ID was received, and if so, will ignore the second
  52583. // request. This prevents clients from accidentally creating duplicate
  52584. // commitments.
  52585. //
  52586. // The request ID must be a valid UUID with the exception that zero UUID
  52587. // is not supported (00000000-0000-0000-0000-000000000000).
  52588. func (c *InstancesInsertCall) RequestId(requestId string) *InstancesInsertCall {
  52589. c.urlParams_.Set("requestId", requestId)
  52590. return c
  52591. }
  52592. // SourceInstanceTemplate sets the optional parameter
  52593. // "sourceInstanceTemplate": Specifies instance template to create the
  52594. // instance.
  52595. //
  52596. // This field is optional. It can be a full or partial URL. For example,
  52597. // the following are all valid URLs to an instance template:
  52598. // -
  52599. // https://www.googleapis.com/compute/v1/projects/project/global/global/instanceTemplates/instanceTemplate
  52600. // - projects/project/global/global/instanceTemplates/instanceTemplate
  52601. //
  52602. // - global/instancesTemplates/instanceTemplate
  52603. func (c *InstancesInsertCall) SourceInstanceTemplate(sourceInstanceTemplate string) *InstancesInsertCall {
  52604. c.urlParams_.Set("sourceInstanceTemplate", sourceInstanceTemplate)
  52605. return c
  52606. }
  52607. // Fields allows partial responses to be retrieved. See
  52608. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  52609. // for more information.
  52610. func (c *InstancesInsertCall) Fields(s ...googleapi.Field) *InstancesInsertCall {
  52611. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  52612. return c
  52613. }
  52614. // Context sets the context to be used in this call's Do method. Any
  52615. // pending HTTP request will be aborted if the provided context is
  52616. // canceled.
  52617. func (c *InstancesInsertCall) Context(ctx context.Context) *InstancesInsertCall {
  52618. c.ctx_ = ctx
  52619. return c
  52620. }
  52621. // Header returns an http.Header that can be modified by the caller to
  52622. // add HTTP headers to the request.
  52623. func (c *InstancesInsertCall) Header() http.Header {
  52624. if c.header_ == nil {
  52625. c.header_ = make(http.Header)
  52626. }
  52627. return c.header_
  52628. }
  52629. func (c *InstancesInsertCall) doRequest(alt string) (*http.Response, error) {
  52630. reqHeaders := make(http.Header)
  52631. for k, v := range c.header_ {
  52632. reqHeaders[k] = v
  52633. }
  52634. reqHeaders.Set("User-Agent", c.s.userAgent())
  52635. var body io.Reader = nil
  52636. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instance)
  52637. if err != nil {
  52638. return nil, err
  52639. }
  52640. reqHeaders.Set("Content-Type", "application/json")
  52641. c.urlParams_.Set("alt", alt)
  52642. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances")
  52643. urls += "?" + c.urlParams_.Encode()
  52644. req, _ := http.NewRequest("POST", urls, body)
  52645. req.Header = reqHeaders
  52646. googleapi.Expand(req.URL, map[string]string{
  52647. "project": c.project,
  52648. "zone": c.zone,
  52649. })
  52650. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  52651. }
  52652. // Do executes the "compute.instances.insert" call.
  52653. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  52654. // status code is an error. Response headers are in either
  52655. // *Operation.ServerResponse.Header or (if a response was returned at
  52656. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  52657. // to check whether the returned error was because
  52658. // http.StatusNotModified was returned.
  52659. func (c *InstancesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  52660. gensupport.SetOptions(c.urlParams_, opts...)
  52661. res, err := c.doRequest("json")
  52662. if res != nil && res.StatusCode == http.StatusNotModified {
  52663. if res.Body != nil {
  52664. res.Body.Close()
  52665. }
  52666. return nil, &googleapi.Error{
  52667. Code: res.StatusCode,
  52668. Header: res.Header,
  52669. }
  52670. }
  52671. if err != nil {
  52672. return nil, err
  52673. }
  52674. defer googleapi.CloseBody(res)
  52675. if err := googleapi.CheckResponse(res); err != nil {
  52676. return nil, err
  52677. }
  52678. ret := &Operation{
  52679. ServerResponse: googleapi.ServerResponse{
  52680. Header: res.Header,
  52681. HTTPStatusCode: res.StatusCode,
  52682. },
  52683. }
  52684. target := &ret
  52685. if err := gensupport.DecodeResponse(target, res); err != nil {
  52686. return nil, err
  52687. }
  52688. return ret, nil
  52689. // {
  52690. // "description": "Creates an instance resource in the specified project using the data included in the request.",
  52691. // "httpMethod": "POST",
  52692. // "id": "compute.instances.insert",
  52693. // "parameterOrder": [
  52694. // "project",
  52695. // "zone"
  52696. // ],
  52697. // "parameters": {
  52698. // "project": {
  52699. // "description": "Project ID for this request.",
  52700. // "location": "path",
  52701. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  52702. // "required": true,
  52703. // "type": "string"
  52704. // },
  52705. // "requestId": {
  52706. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  52707. // "location": "query",
  52708. // "type": "string"
  52709. // },
  52710. // "sourceInstanceTemplate": {
  52711. // "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",
  52712. // "location": "query",
  52713. // "type": "string"
  52714. // },
  52715. // "zone": {
  52716. // "description": "The name of the zone for this request.",
  52717. // "location": "path",
  52718. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  52719. // "required": true,
  52720. // "type": "string"
  52721. // }
  52722. // },
  52723. // "path": "{project}/zones/{zone}/instances",
  52724. // "request": {
  52725. // "$ref": "Instance"
  52726. // },
  52727. // "response": {
  52728. // "$ref": "Operation"
  52729. // },
  52730. // "scopes": [
  52731. // "https://www.googleapis.com/auth/cloud-platform",
  52732. // "https://www.googleapis.com/auth/compute"
  52733. // ]
  52734. // }
  52735. }
  52736. // method id "compute.instances.list":
  52737. type InstancesListCall struct {
  52738. s *Service
  52739. project string
  52740. zone string
  52741. urlParams_ gensupport.URLParams
  52742. ifNoneMatch_ string
  52743. ctx_ context.Context
  52744. header_ http.Header
  52745. }
  52746. // List: Retrieves the list of instances contained within the specified
  52747. // zone.
  52748. // For details, see https://cloud.google.com/compute/docs/reference/latest/instances/list
  52749. func (r *InstancesService) List(project string, zone string) *InstancesListCall {
  52750. c := &InstancesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  52751. c.project = project
  52752. c.zone = zone
  52753. return c
  52754. }
  52755. // Filter sets the optional parameter "filter": A filter expression that
  52756. // filters resources listed in the response. The expression must specify
  52757. // the field name, a comparison operator, and the value that you want to
  52758. // use for filtering. The value must be a string, a number, or a
  52759. // boolean. The comparison operator must be either =, !=, >, or <.
  52760. //
  52761. // For example, if you are filtering Compute Engine instances, you can
  52762. // exclude instances named example-instance by specifying name !=
  52763. // example-instance.
  52764. //
  52765. // You can also filter nested fields. For example, you could specify
  52766. // scheduling.automaticRestart = false to include instances only if they
  52767. // are not scheduled for automatic restarts. You can use filtering on
  52768. // nested fields to filter based on resource labels.
  52769. //
  52770. // To filter on multiple expressions, provide each separate expression
  52771. // within parentheses. For example, (scheduling.automaticRestart = true)
  52772. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  52773. // AND expression. However, you can include AND and OR expressions
  52774. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  52775. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  52776. // true).
  52777. func (c *InstancesListCall) Filter(filter string) *InstancesListCall {
  52778. c.urlParams_.Set("filter", filter)
  52779. return c
  52780. }
  52781. // MaxResults sets the optional parameter "maxResults": The maximum
  52782. // number of results per page that should be returned. If the number of
  52783. // available results is larger than maxResults, Compute Engine returns a
  52784. // nextPageToken that can be used to get the next page of results in
  52785. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  52786. // (Default: 500)
  52787. func (c *InstancesListCall) MaxResults(maxResults int64) *InstancesListCall {
  52788. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  52789. return c
  52790. }
  52791. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  52792. // a certain order. By default, results are returned in alphanumerical
  52793. // order based on the resource name.
  52794. //
  52795. // You can also sort results in descending order based on the creation
  52796. // timestamp using orderBy="creationTimestamp desc". This sorts results
  52797. // based on the creationTimestamp field in reverse chronological order
  52798. // (newest result first). Use this to sort resources like operations so
  52799. // that the newest operation is returned first.
  52800. //
  52801. // Currently, only sorting by name or creationTimestamp desc is
  52802. // supported.
  52803. func (c *InstancesListCall) OrderBy(orderBy string) *InstancesListCall {
  52804. c.urlParams_.Set("orderBy", orderBy)
  52805. return c
  52806. }
  52807. // PageToken sets the optional parameter "pageToken": Specifies a page
  52808. // token to use. Set pageToken to the nextPageToken returned by a
  52809. // previous list request to get the next page of results.
  52810. func (c *InstancesListCall) PageToken(pageToken string) *InstancesListCall {
  52811. c.urlParams_.Set("pageToken", pageToken)
  52812. return c
  52813. }
  52814. // Fields allows partial responses to be retrieved. See
  52815. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  52816. // for more information.
  52817. func (c *InstancesListCall) Fields(s ...googleapi.Field) *InstancesListCall {
  52818. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  52819. return c
  52820. }
  52821. // IfNoneMatch sets the optional parameter which makes the operation
  52822. // fail if the object's ETag matches the given value. This is useful for
  52823. // getting updates only after the object has changed since the last
  52824. // request. Use googleapi.IsNotModified to check whether the response
  52825. // error from Do is the result of In-None-Match.
  52826. func (c *InstancesListCall) IfNoneMatch(entityTag string) *InstancesListCall {
  52827. c.ifNoneMatch_ = entityTag
  52828. return c
  52829. }
  52830. // Context sets the context to be used in this call's Do method. Any
  52831. // pending HTTP request will be aborted if the provided context is
  52832. // canceled.
  52833. func (c *InstancesListCall) Context(ctx context.Context) *InstancesListCall {
  52834. c.ctx_ = ctx
  52835. return c
  52836. }
  52837. // Header returns an http.Header that can be modified by the caller to
  52838. // add HTTP headers to the request.
  52839. func (c *InstancesListCall) Header() http.Header {
  52840. if c.header_ == nil {
  52841. c.header_ = make(http.Header)
  52842. }
  52843. return c.header_
  52844. }
  52845. func (c *InstancesListCall) doRequest(alt string) (*http.Response, error) {
  52846. reqHeaders := make(http.Header)
  52847. for k, v := range c.header_ {
  52848. reqHeaders[k] = v
  52849. }
  52850. reqHeaders.Set("User-Agent", c.s.userAgent())
  52851. if c.ifNoneMatch_ != "" {
  52852. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  52853. }
  52854. var body io.Reader = nil
  52855. c.urlParams_.Set("alt", alt)
  52856. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances")
  52857. urls += "?" + c.urlParams_.Encode()
  52858. req, _ := http.NewRequest("GET", urls, body)
  52859. req.Header = reqHeaders
  52860. googleapi.Expand(req.URL, map[string]string{
  52861. "project": c.project,
  52862. "zone": c.zone,
  52863. })
  52864. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  52865. }
  52866. // Do executes the "compute.instances.list" call.
  52867. // Exactly one of *InstanceList or error will be non-nil. Any non-2xx
  52868. // status code is an error. Response headers are in either
  52869. // *InstanceList.ServerResponse.Header or (if a response was returned at
  52870. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  52871. // to check whether the returned error was because
  52872. // http.StatusNotModified was returned.
  52873. func (c *InstancesListCall) Do(opts ...googleapi.CallOption) (*InstanceList, error) {
  52874. gensupport.SetOptions(c.urlParams_, opts...)
  52875. res, err := c.doRequest("json")
  52876. if res != nil && res.StatusCode == http.StatusNotModified {
  52877. if res.Body != nil {
  52878. res.Body.Close()
  52879. }
  52880. return nil, &googleapi.Error{
  52881. Code: res.StatusCode,
  52882. Header: res.Header,
  52883. }
  52884. }
  52885. if err != nil {
  52886. return nil, err
  52887. }
  52888. defer googleapi.CloseBody(res)
  52889. if err := googleapi.CheckResponse(res); err != nil {
  52890. return nil, err
  52891. }
  52892. ret := &InstanceList{
  52893. ServerResponse: googleapi.ServerResponse{
  52894. Header: res.Header,
  52895. HTTPStatusCode: res.StatusCode,
  52896. },
  52897. }
  52898. target := &ret
  52899. if err := gensupport.DecodeResponse(target, res); err != nil {
  52900. return nil, err
  52901. }
  52902. return ret, nil
  52903. // {
  52904. // "description": "Retrieves the list of instances contained within the specified zone.",
  52905. // "httpMethod": "GET",
  52906. // "id": "compute.instances.list",
  52907. // "parameterOrder": [
  52908. // "project",
  52909. // "zone"
  52910. // ],
  52911. // "parameters": {
  52912. // "filter": {
  52913. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  52914. // "location": "query",
  52915. // "type": "string"
  52916. // },
  52917. // "maxResults": {
  52918. // "default": "500",
  52919. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  52920. // "format": "uint32",
  52921. // "location": "query",
  52922. // "minimum": "0",
  52923. // "type": "integer"
  52924. // },
  52925. // "orderBy": {
  52926. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  52927. // "location": "query",
  52928. // "type": "string"
  52929. // },
  52930. // "pageToken": {
  52931. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  52932. // "location": "query",
  52933. // "type": "string"
  52934. // },
  52935. // "project": {
  52936. // "description": "Project ID for this request.",
  52937. // "location": "path",
  52938. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  52939. // "required": true,
  52940. // "type": "string"
  52941. // },
  52942. // "zone": {
  52943. // "description": "The name of the zone for this request.",
  52944. // "location": "path",
  52945. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  52946. // "required": true,
  52947. // "type": "string"
  52948. // }
  52949. // },
  52950. // "path": "{project}/zones/{zone}/instances",
  52951. // "response": {
  52952. // "$ref": "InstanceList"
  52953. // },
  52954. // "scopes": [
  52955. // "https://www.googleapis.com/auth/cloud-platform",
  52956. // "https://www.googleapis.com/auth/compute",
  52957. // "https://www.googleapis.com/auth/compute.readonly"
  52958. // ]
  52959. // }
  52960. }
  52961. // Pages invokes f for each page of results.
  52962. // A non-nil error returned from f will halt the iteration.
  52963. // The provided context supersedes any context provided to the Context method.
  52964. func (c *InstancesListCall) Pages(ctx context.Context, f func(*InstanceList) error) error {
  52965. c.ctx_ = ctx
  52966. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  52967. for {
  52968. x, err := c.Do()
  52969. if err != nil {
  52970. return err
  52971. }
  52972. if err := f(x); err != nil {
  52973. return err
  52974. }
  52975. if x.NextPageToken == "" {
  52976. return nil
  52977. }
  52978. c.PageToken(x.NextPageToken)
  52979. }
  52980. }
  52981. // method id "compute.instances.listReferrers":
  52982. type InstancesListReferrersCall struct {
  52983. s *Service
  52984. project string
  52985. zone string
  52986. instance string
  52987. urlParams_ gensupport.URLParams
  52988. ifNoneMatch_ string
  52989. ctx_ context.Context
  52990. header_ http.Header
  52991. }
  52992. // ListReferrers: Retrieves the list of referrers to instances contained
  52993. // within the specified zone.
  52994. func (r *InstancesService) ListReferrers(project string, zone string, instance string) *InstancesListReferrersCall {
  52995. c := &InstancesListReferrersCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  52996. c.project = project
  52997. c.zone = zone
  52998. c.instance = instance
  52999. return c
  53000. }
  53001. // Filter sets the optional parameter "filter": A filter expression that
  53002. // filters resources listed in the response. The expression must specify
  53003. // the field name, a comparison operator, and the value that you want to
  53004. // use for filtering. The value must be a string, a number, or a
  53005. // boolean. The comparison operator must be either =, !=, >, or <.
  53006. //
  53007. // For example, if you are filtering Compute Engine instances, you can
  53008. // exclude instances named example-instance by specifying name !=
  53009. // example-instance.
  53010. //
  53011. // You can also filter nested fields. For example, you could specify
  53012. // scheduling.automaticRestart = false to include instances only if they
  53013. // are not scheduled for automatic restarts. You can use filtering on
  53014. // nested fields to filter based on resource labels.
  53015. //
  53016. // To filter on multiple expressions, provide each separate expression
  53017. // within parentheses. For example, (scheduling.automaticRestart = true)
  53018. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  53019. // AND expression. However, you can include AND and OR expressions
  53020. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  53021. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  53022. // true).
  53023. func (c *InstancesListReferrersCall) Filter(filter string) *InstancesListReferrersCall {
  53024. c.urlParams_.Set("filter", filter)
  53025. return c
  53026. }
  53027. // MaxResults sets the optional parameter "maxResults": The maximum
  53028. // number of results per page that should be returned. If the number of
  53029. // available results is larger than maxResults, Compute Engine returns a
  53030. // nextPageToken that can be used to get the next page of results in
  53031. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  53032. // (Default: 500)
  53033. func (c *InstancesListReferrersCall) MaxResults(maxResults int64) *InstancesListReferrersCall {
  53034. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  53035. return c
  53036. }
  53037. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  53038. // a certain order. By default, results are returned in alphanumerical
  53039. // order based on the resource name.
  53040. //
  53041. // You can also sort results in descending order based on the creation
  53042. // timestamp using orderBy="creationTimestamp desc". This sorts results
  53043. // based on the creationTimestamp field in reverse chronological order
  53044. // (newest result first). Use this to sort resources like operations so
  53045. // that the newest operation is returned first.
  53046. //
  53047. // Currently, only sorting by name or creationTimestamp desc is
  53048. // supported.
  53049. func (c *InstancesListReferrersCall) OrderBy(orderBy string) *InstancesListReferrersCall {
  53050. c.urlParams_.Set("orderBy", orderBy)
  53051. return c
  53052. }
  53053. // PageToken sets the optional parameter "pageToken": Specifies a page
  53054. // token to use. Set pageToken to the nextPageToken returned by a
  53055. // previous list request to get the next page of results.
  53056. func (c *InstancesListReferrersCall) PageToken(pageToken string) *InstancesListReferrersCall {
  53057. c.urlParams_.Set("pageToken", pageToken)
  53058. return c
  53059. }
  53060. // Fields allows partial responses to be retrieved. See
  53061. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  53062. // for more information.
  53063. func (c *InstancesListReferrersCall) Fields(s ...googleapi.Field) *InstancesListReferrersCall {
  53064. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  53065. return c
  53066. }
  53067. // IfNoneMatch sets the optional parameter which makes the operation
  53068. // fail if the object's ETag matches the given value. This is useful for
  53069. // getting updates only after the object has changed since the last
  53070. // request. Use googleapi.IsNotModified to check whether the response
  53071. // error from Do is the result of In-None-Match.
  53072. func (c *InstancesListReferrersCall) IfNoneMatch(entityTag string) *InstancesListReferrersCall {
  53073. c.ifNoneMatch_ = entityTag
  53074. return c
  53075. }
  53076. // Context sets the context to be used in this call's Do method. Any
  53077. // pending HTTP request will be aborted if the provided context is
  53078. // canceled.
  53079. func (c *InstancesListReferrersCall) Context(ctx context.Context) *InstancesListReferrersCall {
  53080. c.ctx_ = ctx
  53081. return c
  53082. }
  53083. // Header returns an http.Header that can be modified by the caller to
  53084. // add HTTP headers to the request.
  53085. func (c *InstancesListReferrersCall) Header() http.Header {
  53086. if c.header_ == nil {
  53087. c.header_ = make(http.Header)
  53088. }
  53089. return c.header_
  53090. }
  53091. func (c *InstancesListReferrersCall) doRequest(alt string) (*http.Response, error) {
  53092. reqHeaders := make(http.Header)
  53093. for k, v := range c.header_ {
  53094. reqHeaders[k] = v
  53095. }
  53096. reqHeaders.Set("User-Agent", c.s.userAgent())
  53097. if c.ifNoneMatch_ != "" {
  53098. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  53099. }
  53100. var body io.Reader = nil
  53101. c.urlParams_.Set("alt", alt)
  53102. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/referrers")
  53103. urls += "?" + c.urlParams_.Encode()
  53104. req, _ := http.NewRequest("GET", urls, body)
  53105. req.Header = reqHeaders
  53106. googleapi.Expand(req.URL, map[string]string{
  53107. "project": c.project,
  53108. "zone": c.zone,
  53109. "instance": c.instance,
  53110. })
  53111. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  53112. }
  53113. // Do executes the "compute.instances.listReferrers" call.
  53114. // Exactly one of *InstanceListReferrers or error will be non-nil. Any
  53115. // non-2xx status code is an error. Response headers are in either
  53116. // *InstanceListReferrers.ServerResponse.Header or (if a response was
  53117. // returned at all) in error.(*googleapi.Error).Header. Use
  53118. // googleapi.IsNotModified to check whether the returned error was
  53119. // because http.StatusNotModified was returned.
  53120. func (c *InstancesListReferrersCall) Do(opts ...googleapi.CallOption) (*InstanceListReferrers, error) {
  53121. gensupport.SetOptions(c.urlParams_, opts...)
  53122. res, err := c.doRequest("json")
  53123. if res != nil && res.StatusCode == http.StatusNotModified {
  53124. if res.Body != nil {
  53125. res.Body.Close()
  53126. }
  53127. return nil, &googleapi.Error{
  53128. Code: res.StatusCode,
  53129. Header: res.Header,
  53130. }
  53131. }
  53132. if err != nil {
  53133. return nil, err
  53134. }
  53135. defer googleapi.CloseBody(res)
  53136. if err := googleapi.CheckResponse(res); err != nil {
  53137. return nil, err
  53138. }
  53139. ret := &InstanceListReferrers{
  53140. ServerResponse: googleapi.ServerResponse{
  53141. Header: res.Header,
  53142. HTTPStatusCode: res.StatusCode,
  53143. },
  53144. }
  53145. target := &ret
  53146. if err := gensupport.DecodeResponse(target, res); err != nil {
  53147. return nil, err
  53148. }
  53149. return ret, nil
  53150. // {
  53151. // "description": "Retrieves the list of referrers to instances contained within the specified zone.",
  53152. // "httpMethod": "GET",
  53153. // "id": "compute.instances.listReferrers",
  53154. // "parameterOrder": [
  53155. // "project",
  53156. // "zone",
  53157. // "instance"
  53158. // ],
  53159. // "parameters": {
  53160. // "filter": {
  53161. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  53162. // "location": "query",
  53163. // "type": "string"
  53164. // },
  53165. // "instance": {
  53166. // "description": "Name of the target instance scoping this request, or '-' if the request should span over all instances in the container.",
  53167. // "location": "path",
  53168. // "pattern": "-|[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  53169. // "required": true,
  53170. // "type": "string"
  53171. // },
  53172. // "maxResults": {
  53173. // "default": "500",
  53174. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  53175. // "format": "uint32",
  53176. // "location": "query",
  53177. // "minimum": "0",
  53178. // "type": "integer"
  53179. // },
  53180. // "orderBy": {
  53181. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  53182. // "location": "query",
  53183. // "type": "string"
  53184. // },
  53185. // "pageToken": {
  53186. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  53187. // "location": "query",
  53188. // "type": "string"
  53189. // },
  53190. // "project": {
  53191. // "description": "Project ID for this request.",
  53192. // "location": "path",
  53193. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  53194. // "required": true,
  53195. // "type": "string"
  53196. // },
  53197. // "zone": {
  53198. // "description": "The name of the zone for this request.",
  53199. // "location": "path",
  53200. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  53201. // "required": true,
  53202. // "type": "string"
  53203. // }
  53204. // },
  53205. // "path": "{project}/zones/{zone}/instances/{instance}/referrers",
  53206. // "response": {
  53207. // "$ref": "InstanceListReferrers"
  53208. // },
  53209. // "scopes": [
  53210. // "https://www.googleapis.com/auth/cloud-platform",
  53211. // "https://www.googleapis.com/auth/compute",
  53212. // "https://www.googleapis.com/auth/compute.readonly"
  53213. // ]
  53214. // }
  53215. }
  53216. // Pages invokes f for each page of results.
  53217. // A non-nil error returned from f will halt the iteration.
  53218. // The provided context supersedes any context provided to the Context method.
  53219. func (c *InstancesListReferrersCall) Pages(ctx context.Context, f func(*InstanceListReferrers) error) error {
  53220. c.ctx_ = ctx
  53221. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  53222. for {
  53223. x, err := c.Do()
  53224. if err != nil {
  53225. return err
  53226. }
  53227. if err := f(x); err != nil {
  53228. return err
  53229. }
  53230. if x.NextPageToken == "" {
  53231. return nil
  53232. }
  53233. c.PageToken(x.NextPageToken)
  53234. }
  53235. }
  53236. // method id "compute.instances.reset":
  53237. type InstancesResetCall struct {
  53238. s *Service
  53239. project string
  53240. zone string
  53241. instance string
  53242. urlParams_ gensupport.URLParams
  53243. ctx_ context.Context
  53244. header_ http.Header
  53245. }
  53246. // Reset: Performs a reset on the instance. For more information, see
  53247. // Resetting an instance.
  53248. // For details, see https://cloud.google.com/compute/docs/reference/latest/instances/reset
  53249. func (r *InstancesService) Reset(project string, zone string, instance string) *InstancesResetCall {
  53250. c := &InstancesResetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  53251. c.project = project
  53252. c.zone = zone
  53253. c.instance = instance
  53254. return c
  53255. }
  53256. // RequestId sets the optional parameter "requestId": An optional
  53257. // request ID to identify requests. Specify a unique request ID so that
  53258. // if you must retry your request, the server will know to ignore the
  53259. // request if it has already been completed.
  53260. //
  53261. // For example, consider a situation where you make an initial request
  53262. // and the request times out. If you make the request again with the
  53263. // same request ID, the server can check if original operation with the
  53264. // same request ID was received, and if so, will ignore the second
  53265. // request. This prevents clients from accidentally creating duplicate
  53266. // commitments.
  53267. //
  53268. // The request ID must be a valid UUID with the exception that zero UUID
  53269. // is not supported (00000000-0000-0000-0000-000000000000).
  53270. func (c *InstancesResetCall) RequestId(requestId string) *InstancesResetCall {
  53271. c.urlParams_.Set("requestId", requestId)
  53272. return c
  53273. }
  53274. // Fields allows partial responses to be retrieved. See
  53275. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  53276. // for more information.
  53277. func (c *InstancesResetCall) Fields(s ...googleapi.Field) *InstancesResetCall {
  53278. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  53279. return c
  53280. }
  53281. // Context sets the context to be used in this call's Do method. Any
  53282. // pending HTTP request will be aborted if the provided context is
  53283. // canceled.
  53284. func (c *InstancesResetCall) Context(ctx context.Context) *InstancesResetCall {
  53285. c.ctx_ = ctx
  53286. return c
  53287. }
  53288. // Header returns an http.Header that can be modified by the caller to
  53289. // add HTTP headers to the request.
  53290. func (c *InstancesResetCall) Header() http.Header {
  53291. if c.header_ == nil {
  53292. c.header_ = make(http.Header)
  53293. }
  53294. return c.header_
  53295. }
  53296. func (c *InstancesResetCall) doRequest(alt string) (*http.Response, error) {
  53297. reqHeaders := make(http.Header)
  53298. for k, v := range c.header_ {
  53299. reqHeaders[k] = v
  53300. }
  53301. reqHeaders.Set("User-Agent", c.s.userAgent())
  53302. var body io.Reader = nil
  53303. c.urlParams_.Set("alt", alt)
  53304. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/reset")
  53305. urls += "?" + c.urlParams_.Encode()
  53306. req, _ := http.NewRequest("POST", urls, body)
  53307. req.Header = reqHeaders
  53308. googleapi.Expand(req.URL, map[string]string{
  53309. "project": c.project,
  53310. "zone": c.zone,
  53311. "instance": c.instance,
  53312. })
  53313. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  53314. }
  53315. // Do executes the "compute.instances.reset" call.
  53316. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  53317. // status code is an error. Response headers are in either
  53318. // *Operation.ServerResponse.Header or (if a response was returned at
  53319. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  53320. // to check whether the returned error was because
  53321. // http.StatusNotModified was returned.
  53322. func (c *InstancesResetCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  53323. gensupport.SetOptions(c.urlParams_, opts...)
  53324. res, err := c.doRequest("json")
  53325. if res != nil && res.StatusCode == http.StatusNotModified {
  53326. if res.Body != nil {
  53327. res.Body.Close()
  53328. }
  53329. return nil, &googleapi.Error{
  53330. Code: res.StatusCode,
  53331. Header: res.Header,
  53332. }
  53333. }
  53334. if err != nil {
  53335. return nil, err
  53336. }
  53337. defer googleapi.CloseBody(res)
  53338. if err := googleapi.CheckResponse(res); err != nil {
  53339. return nil, err
  53340. }
  53341. ret := &Operation{
  53342. ServerResponse: googleapi.ServerResponse{
  53343. Header: res.Header,
  53344. HTTPStatusCode: res.StatusCode,
  53345. },
  53346. }
  53347. target := &ret
  53348. if err := gensupport.DecodeResponse(target, res); err != nil {
  53349. return nil, err
  53350. }
  53351. return ret, nil
  53352. // {
  53353. // "description": "Performs a reset on the instance. For more information, see Resetting an instance.",
  53354. // "httpMethod": "POST",
  53355. // "id": "compute.instances.reset",
  53356. // "parameterOrder": [
  53357. // "project",
  53358. // "zone",
  53359. // "instance"
  53360. // ],
  53361. // "parameters": {
  53362. // "instance": {
  53363. // "description": "Name of the instance scoping this request.",
  53364. // "location": "path",
  53365. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  53366. // "required": true,
  53367. // "type": "string"
  53368. // },
  53369. // "project": {
  53370. // "description": "Project ID for this request.",
  53371. // "location": "path",
  53372. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  53373. // "required": true,
  53374. // "type": "string"
  53375. // },
  53376. // "requestId": {
  53377. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  53378. // "location": "query",
  53379. // "type": "string"
  53380. // },
  53381. // "zone": {
  53382. // "description": "The name of the zone for this request.",
  53383. // "location": "path",
  53384. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  53385. // "required": true,
  53386. // "type": "string"
  53387. // }
  53388. // },
  53389. // "path": "{project}/zones/{zone}/instances/{instance}/reset",
  53390. // "response": {
  53391. // "$ref": "Operation"
  53392. // },
  53393. // "scopes": [
  53394. // "https://www.googleapis.com/auth/cloud-platform",
  53395. // "https://www.googleapis.com/auth/compute"
  53396. // ]
  53397. // }
  53398. }
  53399. // method id "compute.instances.setDeletionProtection":
  53400. type InstancesSetDeletionProtectionCall struct {
  53401. s *Service
  53402. project string
  53403. zone string
  53404. resource string
  53405. urlParams_ gensupport.URLParams
  53406. ctx_ context.Context
  53407. header_ http.Header
  53408. }
  53409. // SetDeletionProtection: Sets deletion protection on the instance.
  53410. func (r *InstancesService) SetDeletionProtection(project string, zone string, resource string) *InstancesSetDeletionProtectionCall {
  53411. c := &InstancesSetDeletionProtectionCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  53412. c.project = project
  53413. c.zone = zone
  53414. c.resource = resource
  53415. return c
  53416. }
  53417. // DeletionProtection sets the optional parameter "deletionProtection":
  53418. // Whether the resource should be protected against deletion.
  53419. func (c *InstancesSetDeletionProtectionCall) DeletionProtection(deletionProtection bool) *InstancesSetDeletionProtectionCall {
  53420. c.urlParams_.Set("deletionProtection", fmt.Sprint(deletionProtection))
  53421. return c
  53422. }
  53423. // RequestId sets the optional parameter "requestId": An optional
  53424. // request ID to identify requests. Specify a unique request ID so that
  53425. // if you must retry your request, the server will know to ignore the
  53426. // request if it has already been completed.
  53427. //
  53428. // For example, consider a situation where you make an initial request
  53429. // and the request times out. If you make the request again with the
  53430. // same request ID, the server can check if original operation with the
  53431. // same request ID was received, and if so, will ignore the second
  53432. // request. This prevents clients from accidentally creating duplicate
  53433. // commitments.
  53434. //
  53435. // The request ID must be a valid UUID with the exception that zero UUID
  53436. // is not supported (00000000-0000-0000-0000-000000000000).
  53437. func (c *InstancesSetDeletionProtectionCall) RequestId(requestId string) *InstancesSetDeletionProtectionCall {
  53438. c.urlParams_.Set("requestId", requestId)
  53439. return c
  53440. }
  53441. // Fields allows partial responses to be retrieved. See
  53442. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  53443. // for more information.
  53444. func (c *InstancesSetDeletionProtectionCall) Fields(s ...googleapi.Field) *InstancesSetDeletionProtectionCall {
  53445. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  53446. return c
  53447. }
  53448. // Context sets the context to be used in this call's Do method. Any
  53449. // pending HTTP request will be aborted if the provided context is
  53450. // canceled.
  53451. func (c *InstancesSetDeletionProtectionCall) Context(ctx context.Context) *InstancesSetDeletionProtectionCall {
  53452. c.ctx_ = ctx
  53453. return c
  53454. }
  53455. // Header returns an http.Header that can be modified by the caller to
  53456. // add HTTP headers to the request.
  53457. func (c *InstancesSetDeletionProtectionCall) Header() http.Header {
  53458. if c.header_ == nil {
  53459. c.header_ = make(http.Header)
  53460. }
  53461. return c.header_
  53462. }
  53463. func (c *InstancesSetDeletionProtectionCall) doRequest(alt string) (*http.Response, error) {
  53464. reqHeaders := make(http.Header)
  53465. for k, v := range c.header_ {
  53466. reqHeaders[k] = v
  53467. }
  53468. reqHeaders.Set("User-Agent", c.s.userAgent())
  53469. var body io.Reader = nil
  53470. c.urlParams_.Set("alt", alt)
  53471. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{resource}/setDeletionProtection")
  53472. urls += "?" + c.urlParams_.Encode()
  53473. req, _ := http.NewRequest("POST", urls, body)
  53474. req.Header = reqHeaders
  53475. googleapi.Expand(req.URL, map[string]string{
  53476. "project": c.project,
  53477. "zone": c.zone,
  53478. "resource": c.resource,
  53479. })
  53480. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  53481. }
  53482. // Do executes the "compute.instances.setDeletionProtection" call.
  53483. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  53484. // status code is an error. Response headers are in either
  53485. // *Operation.ServerResponse.Header or (if a response was returned at
  53486. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  53487. // to check whether the returned error was because
  53488. // http.StatusNotModified was returned.
  53489. func (c *InstancesSetDeletionProtectionCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  53490. gensupport.SetOptions(c.urlParams_, opts...)
  53491. res, err := c.doRequest("json")
  53492. if res != nil && res.StatusCode == http.StatusNotModified {
  53493. if res.Body != nil {
  53494. res.Body.Close()
  53495. }
  53496. return nil, &googleapi.Error{
  53497. Code: res.StatusCode,
  53498. Header: res.Header,
  53499. }
  53500. }
  53501. if err != nil {
  53502. return nil, err
  53503. }
  53504. defer googleapi.CloseBody(res)
  53505. if err := googleapi.CheckResponse(res); err != nil {
  53506. return nil, err
  53507. }
  53508. ret := &Operation{
  53509. ServerResponse: googleapi.ServerResponse{
  53510. Header: res.Header,
  53511. HTTPStatusCode: res.StatusCode,
  53512. },
  53513. }
  53514. target := &ret
  53515. if err := gensupport.DecodeResponse(target, res); err != nil {
  53516. return nil, err
  53517. }
  53518. return ret, nil
  53519. // {
  53520. // "description": "Sets deletion protection on the instance.",
  53521. // "httpMethod": "POST",
  53522. // "id": "compute.instances.setDeletionProtection",
  53523. // "parameterOrder": [
  53524. // "project",
  53525. // "zone",
  53526. // "resource"
  53527. // ],
  53528. // "parameters": {
  53529. // "deletionProtection": {
  53530. // "default": "true",
  53531. // "description": "Whether the resource should be protected against deletion.",
  53532. // "location": "query",
  53533. // "type": "boolean"
  53534. // },
  53535. // "project": {
  53536. // "description": "Project ID for this request.",
  53537. // "location": "path",
  53538. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  53539. // "required": true,
  53540. // "type": "string"
  53541. // },
  53542. // "requestId": {
  53543. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  53544. // "location": "query",
  53545. // "type": "string"
  53546. // },
  53547. // "resource": {
  53548. // "description": "Name of the resource for this request.",
  53549. // "location": "path",
  53550. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  53551. // "required": true,
  53552. // "type": "string"
  53553. // },
  53554. // "zone": {
  53555. // "description": "The name of the zone for this request.",
  53556. // "location": "path",
  53557. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  53558. // "required": true,
  53559. // "type": "string"
  53560. // }
  53561. // },
  53562. // "path": "{project}/zones/{zone}/instances/{resource}/setDeletionProtection",
  53563. // "response": {
  53564. // "$ref": "Operation"
  53565. // },
  53566. // "scopes": [
  53567. // "https://www.googleapis.com/auth/cloud-platform",
  53568. // "https://www.googleapis.com/auth/compute"
  53569. // ]
  53570. // }
  53571. }
  53572. // method id "compute.instances.setDiskAutoDelete":
  53573. type InstancesSetDiskAutoDeleteCall struct {
  53574. s *Service
  53575. project string
  53576. zone string
  53577. instance string
  53578. urlParams_ gensupport.URLParams
  53579. ctx_ context.Context
  53580. header_ http.Header
  53581. }
  53582. // SetDiskAutoDelete: Sets the auto-delete flag for a disk attached to
  53583. // an instance.
  53584. // For details, see https://cloud.google.com/compute/docs/reference/latest/instances/setDiskAutoDelete
  53585. func (r *InstancesService) SetDiskAutoDelete(project string, zone string, instance string, autoDelete bool, deviceName string) *InstancesSetDiskAutoDeleteCall {
  53586. c := &InstancesSetDiskAutoDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  53587. c.project = project
  53588. c.zone = zone
  53589. c.instance = instance
  53590. c.urlParams_.Set("autoDelete", fmt.Sprint(autoDelete))
  53591. c.urlParams_.Set("deviceName", deviceName)
  53592. return c
  53593. }
  53594. // RequestId sets the optional parameter "requestId": An optional
  53595. // request ID to identify requests. Specify a unique request ID so that
  53596. // if you must retry your request, the server will know to ignore the
  53597. // request if it has already been completed.
  53598. //
  53599. // For example, consider a situation where you make an initial request
  53600. // and the request times out. If you make the request again with the
  53601. // same request ID, the server can check if original operation with the
  53602. // same request ID was received, and if so, will ignore the second
  53603. // request. This prevents clients from accidentally creating duplicate
  53604. // commitments.
  53605. //
  53606. // The request ID must be a valid UUID with the exception that zero UUID
  53607. // is not supported (00000000-0000-0000-0000-000000000000).
  53608. func (c *InstancesSetDiskAutoDeleteCall) RequestId(requestId string) *InstancesSetDiskAutoDeleteCall {
  53609. c.urlParams_.Set("requestId", requestId)
  53610. return c
  53611. }
  53612. // Fields allows partial responses to be retrieved. See
  53613. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  53614. // for more information.
  53615. func (c *InstancesSetDiskAutoDeleteCall) Fields(s ...googleapi.Field) *InstancesSetDiskAutoDeleteCall {
  53616. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  53617. return c
  53618. }
  53619. // Context sets the context to be used in this call's Do method. Any
  53620. // pending HTTP request will be aborted if the provided context is
  53621. // canceled.
  53622. func (c *InstancesSetDiskAutoDeleteCall) Context(ctx context.Context) *InstancesSetDiskAutoDeleteCall {
  53623. c.ctx_ = ctx
  53624. return c
  53625. }
  53626. // Header returns an http.Header that can be modified by the caller to
  53627. // add HTTP headers to the request.
  53628. func (c *InstancesSetDiskAutoDeleteCall) Header() http.Header {
  53629. if c.header_ == nil {
  53630. c.header_ = make(http.Header)
  53631. }
  53632. return c.header_
  53633. }
  53634. func (c *InstancesSetDiskAutoDeleteCall) doRequest(alt string) (*http.Response, error) {
  53635. reqHeaders := make(http.Header)
  53636. for k, v := range c.header_ {
  53637. reqHeaders[k] = v
  53638. }
  53639. reqHeaders.Set("User-Agent", c.s.userAgent())
  53640. var body io.Reader = nil
  53641. c.urlParams_.Set("alt", alt)
  53642. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/setDiskAutoDelete")
  53643. urls += "?" + c.urlParams_.Encode()
  53644. req, _ := http.NewRequest("POST", urls, body)
  53645. req.Header = reqHeaders
  53646. googleapi.Expand(req.URL, map[string]string{
  53647. "project": c.project,
  53648. "zone": c.zone,
  53649. "instance": c.instance,
  53650. })
  53651. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  53652. }
  53653. // Do executes the "compute.instances.setDiskAutoDelete" call.
  53654. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  53655. // status code is an error. Response headers are in either
  53656. // *Operation.ServerResponse.Header or (if a response was returned at
  53657. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  53658. // to check whether the returned error was because
  53659. // http.StatusNotModified was returned.
  53660. func (c *InstancesSetDiskAutoDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  53661. gensupport.SetOptions(c.urlParams_, opts...)
  53662. res, err := c.doRequest("json")
  53663. if res != nil && res.StatusCode == http.StatusNotModified {
  53664. if res.Body != nil {
  53665. res.Body.Close()
  53666. }
  53667. return nil, &googleapi.Error{
  53668. Code: res.StatusCode,
  53669. Header: res.Header,
  53670. }
  53671. }
  53672. if err != nil {
  53673. return nil, err
  53674. }
  53675. defer googleapi.CloseBody(res)
  53676. if err := googleapi.CheckResponse(res); err != nil {
  53677. return nil, err
  53678. }
  53679. ret := &Operation{
  53680. ServerResponse: googleapi.ServerResponse{
  53681. Header: res.Header,
  53682. HTTPStatusCode: res.StatusCode,
  53683. },
  53684. }
  53685. target := &ret
  53686. if err := gensupport.DecodeResponse(target, res); err != nil {
  53687. return nil, err
  53688. }
  53689. return ret, nil
  53690. // {
  53691. // "description": "Sets the auto-delete flag for a disk attached to an instance.",
  53692. // "httpMethod": "POST",
  53693. // "id": "compute.instances.setDiskAutoDelete",
  53694. // "parameterOrder": [
  53695. // "project",
  53696. // "zone",
  53697. // "instance",
  53698. // "autoDelete",
  53699. // "deviceName"
  53700. // ],
  53701. // "parameters": {
  53702. // "autoDelete": {
  53703. // "description": "Whether to auto-delete the disk when the instance is deleted.",
  53704. // "location": "query",
  53705. // "required": true,
  53706. // "type": "boolean"
  53707. // },
  53708. // "deviceName": {
  53709. // "description": "The device name of the disk to modify.",
  53710. // "location": "query",
  53711. // "pattern": "\\w[\\w.-]{0,254}",
  53712. // "required": true,
  53713. // "type": "string"
  53714. // },
  53715. // "instance": {
  53716. // "description": "The instance name.",
  53717. // "location": "path",
  53718. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  53719. // "required": true,
  53720. // "type": "string"
  53721. // },
  53722. // "project": {
  53723. // "description": "Project ID for this request.",
  53724. // "location": "path",
  53725. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  53726. // "required": true,
  53727. // "type": "string"
  53728. // },
  53729. // "requestId": {
  53730. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  53731. // "location": "query",
  53732. // "type": "string"
  53733. // },
  53734. // "zone": {
  53735. // "description": "The name of the zone for this request.",
  53736. // "location": "path",
  53737. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  53738. // "required": true,
  53739. // "type": "string"
  53740. // }
  53741. // },
  53742. // "path": "{project}/zones/{zone}/instances/{instance}/setDiskAutoDelete",
  53743. // "response": {
  53744. // "$ref": "Operation"
  53745. // },
  53746. // "scopes": [
  53747. // "https://www.googleapis.com/auth/cloud-platform",
  53748. // "https://www.googleapis.com/auth/compute"
  53749. // ]
  53750. // }
  53751. }
  53752. // method id "compute.instances.setLabels":
  53753. type InstancesSetLabelsCall struct {
  53754. s *Service
  53755. project string
  53756. zone string
  53757. instance string
  53758. instancessetlabelsrequest *InstancesSetLabelsRequest
  53759. urlParams_ gensupport.URLParams
  53760. ctx_ context.Context
  53761. header_ http.Header
  53762. }
  53763. // SetLabels: Sets labels on an instance. To learn more about labels,
  53764. // read the Labeling Resources documentation.
  53765. func (r *InstancesService) SetLabels(project string, zone string, instance string, instancessetlabelsrequest *InstancesSetLabelsRequest) *InstancesSetLabelsCall {
  53766. c := &InstancesSetLabelsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  53767. c.project = project
  53768. c.zone = zone
  53769. c.instance = instance
  53770. c.instancessetlabelsrequest = instancessetlabelsrequest
  53771. return c
  53772. }
  53773. // RequestId sets the optional parameter "requestId": An optional
  53774. // request ID to identify requests. Specify a unique request ID so that
  53775. // if you must retry your request, the server will know to ignore the
  53776. // request if it has already been completed.
  53777. //
  53778. // For example, consider a situation where you make an initial request
  53779. // and the request times out. If you make the request again with the
  53780. // same request ID, the server can check if original operation with the
  53781. // same request ID was received, and if so, will ignore the second
  53782. // request. This prevents clients from accidentally creating duplicate
  53783. // commitments.
  53784. //
  53785. // The request ID must be a valid UUID with the exception that zero UUID
  53786. // is not supported (00000000-0000-0000-0000-000000000000).
  53787. func (c *InstancesSetLabelsCall) RequestId(requestId string) *InstancesSetLabelsCall {
  53788. c.urlParams_.Set("requestId", requestId)
  53789. return c
  53790. }
  53791. // Fields allows partial responses to be retrieved. See
  53792. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  53793. // for more information.
  53794. func (c *InstancesSetLabelsCall) Fields(s ...googleapi.Field) *InstancesSetLabelsCall {
  53795. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  53796. return c
  53797. }
  53798. // Context sets the context to be used in this call's Do method. Any
  53799. // pending HTTP request will be aborted if the provided context is
  53800. // canceled.
  53801. func (c *InstancesSetLabelsCall) Context(ctx context.Context) *InstancesSetLabelsCall {
  53802. c.ctx_ = ctx
  53803. return c
  53804. }
  53805. // Header returns an http.Header that can be modified by the caller to
  53806. // add HTTP headers to the request.
  53807. func (c *InstancesSetLabelsCall) Header() http.Header {
  53808. if c.header_ == nil {
  53809. c.header_ = make(http.Header)
  53810. }
  53811. return c.header_
  53812. }
  53813. func (c *InstancesSetLabelsCall) doRequest(alt string) (*http.Response, error) {
  53814. reqHeaders := make(http.Header)
  53815. for k, v := range c.header_ {
  53816. reqHeaders[k] = v
  53817. }
  53818. reqHeaders.Set("User-Agent", c.s.userAgent())
  53819. var body io.Reader = nil
  53820. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancessetlabelsrequest)
  53821. if err != nil {
  53822. return nil, err
  53823. }
  53824. reqHeaders.Set("Content-Type", "application/json")
  53825. c.urlParams_.Set("alt", alt)
  53826. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/setLabels")
  53827. urls += "?" + c.urlParams_.Encode()
  53828. req, _ := http.NewRequest("POST", urls, body)
  53829. req.Header = reqHeaders
  53830. googleapi.Expand(req.URL, map[string]string{
  53831. "project": c.project,
  53832. "zone": c.zone,
  53833. "instance": c.instance,
  53834. })
  53835. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  53836. }
  53837. // Do executes the "compute.instances.setLabels" call.
  53838. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  53839. // status code is an error. Response headers are in either
  53840. // *Operation.ServerResponse.Header or (if a response was returned at
  53841. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  53842. // to check whether the returned error was because
  53843. // http.StatusNotModified was returned.
  53844. func (c *InstancesSetLabelsCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  53845. gensupport.SetOptions(c.urlParams_, opts...)
  53846. res, err := c.doRequest("json")
  53847. if res != nil && res.StatusCode == http.StatusNotModified {
  53848. if res.Body != nil {
  53849. res.Body.Close()
  53850. }
  53851. return nil, &googleapi.Error{
  53852. Code: res.StatusCode,
  53853. Header: res.Header,
  53854. }
  53855. }
  53856. if err != nil {
  53857. return nil, err
  53858. }
  53859. defer googleapi.CloseBody(res)
  53860. if err := googleapi.CheckResponse(res); err != nil {
  53861. return nil, err
  53862. }
  53863. ret := &Operation{
  53864. ServerResponse: googleapi.ServerResponse{
  53865. Header: res.Header,
  53866. HTTPStatusCode: res.StatusCode,
  53867. },
  53868. }
  53869. target := &ret
  53870. if err := gensupport.DecodeResponse(target, res); err != nil {
  53871. return nil, err
  53872. }
  53873. return ret, nil
  53874. // {
  53875. // "description": "Sets labels on an instance. To learn more about labels, read the Labeling Resources documentation.",
  53876. // "httpMethod": "POST",
  53877. // "id": "compute.instances.setLabels",
  53878. // "parameterOrder": [
  53879. // "project",
  53880. // "zone",
  53881. // "instance"
  53882. // ],
  53883. // "parameters": {
  53884. // "instance": {
  53885. // "description": "Name of the instance scoping this request.",
  53886. // "location": "path",
  53887. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  53888. // "required": true,
  53889. // "type": "string"
  53890. // },
  53891. // "project": {
  53892. // "description": "Project ID for this request.",
  53893. // "location": "path",
  53894. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  53895. // "required": true,
  53896. // "type": "string"
  53897. // },
  53898. // "requestId": {
  53899. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  53900. // "location": "query",
  53901. // "type": "string"
  53902. // },
  53903. // "zone": {
  53904. // "description": "The name of the zone for this request.",
  53905. // "location": "path",
  53906. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  53907. // "required": true,
  53908. // "type": "string"
  53909. // }
  53910. // },
  53911. // "path": "{project}/zones/{zone}/instances/{instance}/setLabels",
  53912. // "request": {
  53913. // "$ref": "InstancesSetLabelsRequest"
  53914. // },
  53915. // "response": {
  53916. // "$ref": "Operation"
  53917. // },
  53918. // "scopes": [
  53919. // "https://www.googleapis.com/auth/cloud-platform",
  53920. // "https://www.googleapis.com/auth/compute"
  53921. // ]
  53922. // }
  53923. }
  53924. // method id "compute.instances.setMachineResources":
  53925. type InstancesSetMachineResourcesCall struct {
  53926. s *Service
  53927. project string
  53928. zone string
  53929. instance string
  53930. instancessetmachineresourcesrequest *InstancesSetMachineResourcesRequest
  53931. urlParams_ gensupport.URLParams
  53932. ctx_ context.Context
  53933. header_ http.Header
  53934. }
  53935. // SetMachineResources: Changes the number and/or type of accelerator
  53936. // for a stopped instance to the values specified in the request.
  53937. func (r *InstancesService) SetMachineResources(project string, zone string, instance string, instancessetmachineresourcesrequest *InstancesSetMachineResourcesRequest) *InstancesSetMachineResourcesCall {
  53938. c := &InstancesSetMachineResourcesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  53939. c.project = project
  53940. c.zone = zone
  53941. c.instance = instance
  53942. c.instancessetmachineresourcesrequest = instancessetmachineresourcesrequest
  53943. return c
  53944. }
  53945. // RequestId sets the optional parameter "requestId": An optional
  53946. // request ID to identify requests. Specify a unique request ID so that
  53947. // if you must retry your request, the server will know to ignore the
  53948. // request if it has already been completed.
  53949. //
  53950. // For example, consider a situation where you make an initial request
  53951. // and the request times out. If you make the request again with the
  53952. // same request ID, the server can check if original operation with the
  53953. // same request ID was received, and if so, will ignore the second
  53954. // request. This prevents clients from accidentally creating duplicate
  53955. // commitments.
  53956. //
  53957. // The request ID must be a valid UUID with the exception that zero UUID
  53958. // is not supported (00000000-0000-0000-0000-000000000000).
  53959. func (c *InstancesSetMachineResourcesCall) RequestId(requestId string) *InstancesSetMachineResourcesCall {
  53960. c.urlParams_.Set("requestId", requestId)
  53961. return c
  53962. }
  53963. // Fields allows partial responses to be retrieved. See
  53964. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  53965. // for more information.
  53966. func (c *InstancesSetMachineResourcesCall) Fields(s ...googleapi.Field) *InstancesSetMachineResourcesCall {
  53967. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  53968. return c
  53969. }
  53970. // Context sets the context to be used in this call's Do method. Any
  53971. // pending HTTP request will be aborted if the provided context is
  53972. // canceled.
  53973. func (c *InstancesSetMachineResourcesCall) Context(ctx context.Context) *InstancesSetMachineResourcesCall {
  53974. c.ctx_ = ctx
  53975. return c
  53976. }
  53977. // Header returns an http.Header that can be modified by the caller to
  53978. // add HTTP headers to the request.
  53979. func (c *InstancesSetMachineResourcesCall) Header() http.Header {
  53980. if c.header_ == nil {
  53981. c.header_ = make(http.Header)
  53982. }
  53983. return c.header_
  53984. }
  53985. func (c *InstancesSetMachineResourcesCall) doRequest(alt string) (*http.Response, error) {
  53986. reqHeaders := make(http.Header)
  53987. for k, v := range c.header_ {
  53988. reqHeaders[k] = v
  53989. }
  53990. reqHeaders.Set("User-Agent", c.s.userAgent())
  53991. var body io.Reader = nil
  53992. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancessetmachineresourcesrequest)
  53993. if err != nil {
  53994. return nil, err
  53995. }
  53996. reqHeaders.Set("Content-Type", "application/json")
  53997. c.urlParams_.Set("alt", alt)
  53998. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/setMachineResources")
  53999. urls += "?" + c.urlParams_.Encode()
  54000. req, _ := http.NewRequest("POST", urls, body)
  54001. req.Header = reqHeaders
  54002. googleapi.Expand(req.URL, map[string]string{
  54003. "project": c.project,
  54004. "zone": c.zone,
  54005. "instance": c.instance,
  54006. })
  54007. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  54008. }
  54009. // Do executes the "compute.instances.setMachineResources" call.
  54010. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  54011. // status code is an error. Response headers are in either
  54012. // *Operation.ServerResponse.Header or (if a response was returned at
  54013. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  54014. // to check whether the returned error was because
  54015. // http.StatusNotModified was returned.
  54016. func (c *InstancesSetMachineResourcesCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  54017. gensupport.SetOptions(c.urlParams_, opts...)
  54018. res, err := c.doRequest("json")
  54019. if res != nil && res.StatusCode == http.StatusNotModified {
  54020. if res.Body != nil {
  54021. res.Body.Close()
  54022. }
  54023. return nil, &googleapi.Error{
  54024. Code: res.StatusCode,
  54025. Header: res.Header,
  54026. }
  54027. }
  54028. if err != nil {
  54029. return nil, err
  54030. }
  54031. defer googleapi.CloseBody(res)
  54032. if err := googleapi.CheckResponse(res); err != nil {
  54033. return nil, err
  54034. }
  54035. ret := &Operation{
  54036. ServerResponse: googleapi.ServerResponse{
  54037. Header: res.Header,
  54038. HTTPStatusCode: res.StatusCode,
  54039. },
  54040. }
  54041. target := &ret
  54042. if err := gensupport.DecodeResponse(target, res); err != nil {
  54043. return nil, err
  54044. }
  54045. return ret, nil
  54046. // {
  54047. // "description": "Changes the number and/or type of accelerator for a stopped instance to the values specified in the request.",
  54048. // "httpMethod": "POST",
  54049. // "id": "compute.instances.setMachineResources",
  54050. // "parameterOrder": [
  54051. // "project",
  54052. // "zone",
  54053. // "instance"
  54054. // ],
  54055. // "parameters": {
  54056. // "instance": {
  54057. // "description": "Name of the instance scoping this request.",
  54058. // "location": "path",
  54059. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  54060. // "required": true,
  54061. // "type": "string"
  54062. // },
  54063. // "project": {
  54064. // "description": "Project ID for this request.",
  54065. // "location": "path",
  54066. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  54067. // "required": true,
  54068. // "type": "string"
  54069. // },
  54070. // "requestId": {
  54071. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  54072. // "location": "query",
  54073. // "type": "string"
  54074. // },
  54075. // "zone": {
  54076. // "description": "The name of the zone for this request.",
  54077. // "location": "path",
  54078. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  54079. // "required": true,
  54080. // "type": "string"
  54081. // }
  54082. // },
  54083. // "path": "{project}/zones/{zone}/instances/{instance}/setMachineResources",
  54084. // "request": {
  54085. // "$ref": "InstancesSetMachineResourcesRequest"
  54086. // },
  54087. // "response": {
  54088. // "$ref": "Operation"
  54089. // },
  54090. // "scopes": [
  54091. // "https://www.googleapis.com/auth/cloud-platform",
  54092. // "https://www.googleapis.com/auth/compute"
  54093. // ]
  54094. // }
  54095. }
  54096. // method id "compute.instances.setMachineType":
  54097. type InstancesSetMachineTypeCall struct {
  54098. s *Service
  54099. project string
  54100. zone string
  54101. instance string
  54102. instancessetmachinetyperequest *InstancesSetMachineTypeRequest
  54103. urlParams_ gensupport.URLParams
  54104. ctx_ context.Context
  54105. header_ http.Header
  54106. }
  54107. // SetMachineType: Changes the machine type for a stopped instance to
  54108. // the machine type specified in the request.
  54109. func (r *InstancesService) SetMachineType(project string, zone string, instance string, instancessetmachinetyperequest *InstancesSetMachineTypeRequest) *InstancesSetMachineTypeCall {
  54110. c := &InstancesSetMachineTypeCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  54111. c.project = project
  54112. c.zone = zone
  54113. c.instance = instance
  54114. c.instancessetmachinetyperequest = instancessetmachinetyperequest
  54115. return c
  54116. }
  54117. // RequestId sets the optional parameter "requestId": An optional
  54118. // request ID to identify requests. Specify a unique request ID so that
  54119. // if you must retry your request, the server will know to ignore the
  54120. // request if it has already been completed.
  54121. //
  54122. // For example, consider a situation where you make an initial request
  54123. // and the request times out. If you make the request again with the
  54124. // same request ID, the server can check if original operation with the
  54125. // same request ID was received, and if so, will ignore the second
  54126. // request. This prevents clients from accidentally creating duplicate
  54127. // commitments.
  54128. //
  54129. // The request ID must be a valid UUID with the exception that zero UUID
  54130. // is not supported (00000000-0000-0000-0000-000000000000).
  54131. func (c *InstancesSetMachineTypeCall) RequestId(requestId string) *InstancesSetMachineTypeCall {
  54132. c.urlParams_.Set("requestId", requestId)
  54133. return c
  54134. }
  54135. // Fields allows partial responses to be retrieved. See
  54136. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  54137. // for more information.
  54138. func (c *InstancesSetMachineTypeCall) Fields(s ...googleapi.Field) *InstancesSetMachineTypeCall {
  54139. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  54140. return c
  54141. }
  54142. // Context sets the context to be used in this call's Do method. Any
  54143. // pending HTTP request will be aborted if the provided context is
  54144. // canceled.
  54145. func (c *InstancesSetMachineTypeCall) Context(ctx context.Context) *InstancesSetMachineTypeCall {
  54146. c.ctx_ = ctx
  54147. return c
  54148. }
  54149. // Header returns an http.Header that can be modified by the caller to
  54150. // add HTTP headers to the request.
  54151. func (c *InstancesSetMachineTypeCall) Header() http.Header {
  54152. if c.header_ == nil {
  54153. c.header_ = make(http.Header)
  54154. }
  54155. return c.header_
  54156. }
  54157. func (c *InstancesSetMachineTypeCall) doRequest(alt string) (*http.Response, error) {
  54158. reqHeaders := make(http.Header)
  54159. for k, v := range c.header_ {
  54160. reqHeaders[k] = v
  54161. }
  54162. reqHeaders.Set("User-Agent", c.s.userAgent())
  54163. var body io.Reader = nil
  54164. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancessetmachinetyperequest)
  54165. if err != nil {
  54166. return nil, err
  54167. }
  54168. reqHeaders.Set("Content-Type", "application/json")
  54169. c.urlParams_.Set("alt", alt)
  54170. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/setMachineType")
  54171. urls += "?" + c.urlParams_.Encode()
  54172. req, _ := http.NewRequest("POST", urls, body)
  54173. req.Header = reqHeaders
  54174. googleapi.Expand(req.URL, map[string]string{
  54175. "project": c.project,
  54176. "zone": c.zone,
  54177. "instance": c.instance,
  54178. })
  54179. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  54180. }
  54181. // Do executes the "compute.instances.setMachineType" call.
  54182. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  54183. // status code is an error. Response headers are in either
  54184. // *Operation.ServerResponse.Header or (if a response was returned at
  54185. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  54186. // to check whether the returned error was because
  54187. // http.StatusNotModified was returned.
  54188. func (c *InstancesSetMachineTypeCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  54189. gensupport.SetOptions(c.urlParams_, opts...)
  54190. res, err := c.doRequest("json")
  54191. if res != nil && res.StatusCode == http.StatusNotModified {
  54192. if res.Body != nil {
  54193. res.Body.Close()
  54194. }
  54195. return nil, &googleapi.Error{
  54196. Code: res.StatusCode,
  54197. Header: res.Header,
  54198. }
  54199. }
  54200. if err != nil {
  54201. return nil, err
  54202. }
  54203. defer googleapi.CloseBody(res)
  54204. if err := googleapi.CheckResponse(res); err != nil {
  54205. return nil, err
  54206. }
  54207. ret := &Operation{
  54208. ServerResponse: googleapi.ServerResponse{
  54209. Header: res.Header,
  54210. HTTPStatusCode: res.StatusCode,
  54211. },
  54212. }
  54213. target := &ret
  54214. if err := gensupport.DecodeResponse(target, res); err != nil {
  54215. return nil, err
  54216. }
  54217. return ret, nil
  54218. // {
  54219. // "description": "Changes the machine type for a stopped instance to the machine type specified in the request.",
  54220. // "httpMethod": "POST",
  54221. // "id": "compute.instances.setMachineType",
  54222. // "parameterOrder": [
  54223. // "project",
  54224. // "zone",
  54225. // "instance"
  54226. // ],
  54227. // "parameters": {
  54228. // "instance": {
  54229. // "description": "Name of the instance scoping this request.",
  54230. // "location": "path",
  54231. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  54232. // "required": true,
  54233. // "type": "string"
  54234. // },
  54235. // "project": {
  54236. // "description": "Project ID for this request.",
  54237. // "location": "path",
  54238. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  54239. // "required": true,
  54240. // "type": "string"
  54241. // },
  54242. // "requestId": {
  54243. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  54244. // "location": "query",
  54245. // "type": "string"
  54246. // },
  54247. // "zone": {
  54248. // "description": "The name of the zone for this request.",
  54249. // "location": "path",
  54250. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  54251. // "required": true,
  54252. // "type": "string"
  54253. // }
  54254. // },
  54255. // "path": "{project}/zones/{zone}/instances/{instance}/setMachineType",
  54256. // "request": {
  54257. // "$ref": "InstancesSetMachineTypeRequest"
  54258. // },
  54259. // "response": {
  54260. // "$ref": "Operation"
  54261. // },
  54262. // "scopes": [
  54263. // "https://www.googleapis.com/auth/cloud-platform",
  54264. // "https://www.googleapis.com/auth/compute"
  54265. // ]
  54266. // }
  54267. }
  54268. // method id "compute.instances.setMetadata":
  54269. type InstancesSetMetadataCall struct {
  54270. s *Service
  54271. project string
  54272. zone string
  54273. instance string
  54274. metadata *Metadata
  54275. urlParams_ gensupport.URLParams
  54276. ctx_ context.Context
  54277. header_ http.Header
  54278. }
  54279. // SetMetadata: Sets metadata for the specified instance to the data
  54280. // included in the request.
  54281. // For details, see https://cloud.google.com/compute/docs/reference/latest/instances/setMetadata
  54282. func (r *InstancesService) SetMetadata(project string, zone string, instance string, metadata *Metadata) *InstancesSetMetadataCall {
  54283. c := &InstancesSetMetadataCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  54284. c.project = project
  54285. c.zone = zone
  54286. c.instance = instance
  54287. c.metadata = metadata
  54288. return c
  54289. }
  54290. // RequestId sets the optional parameter "requestId": An optional
  54291. // request ID to identify requests. Specify a unique request ID so that
  54292. // if you must retry your request, the server will know to ignore the
  54293. // request if it has already been completed.
  54294. //
  54295. // For example, consider a situation where you make an initial request
  54296. // and the request times out. If you make the request again with the
  54297. // same request ID, the server can check if original operation with the
  54298. // same request ID was received, and if so, will ignore the second
  54299. // request. This prevents clients from accidentally creating duplicate
  54300. // commitments.
  54301. //
  54302. // The request ID must be a valid UUID with the exception that zero UUID
  54303. // is not supported (00000000-0000-0000-0000-000000000000).
  54304. func (c *InstancesSetMetadataCall) RequestId(requestId string) *InstancesSetMetadataCall {
  54305. c.urlParams_.Set("requestId", requestId)
  54306. return c
  54307. }
  54308. // Fields allows partial responses to be retrieved. See
  54309. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  54310. // for more information.
  54311. func (c *InstancesSetMetadataCall) Fields(s ...googleapi.Field) *InstancesSetMetadataCall {
  54312. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  54313. return c
  54314. }
  54315. // Context sets the context to be used in this call's Do method. Any
  54316. // pending HTTP request will be aborted if the provided context is
  54317. // canceled.
  54318. func (c *InstancesSetMetadataCall) Context(ctx context.Context) *InstancesSetMetadataCall {
  54319. c.ctx_ = ctx
  54320. return c
  54321. }
  54322. // Header returns an http.Header that can be modified by the caller to
  54323. // add HTTP headers to the request.
  54324. func (c *InstancesSetMetadataCall) Header() http.Header {
  54325. if c.header_ == nil {
  54326. c.header_ = make(http.Header)
  54327. }
  54328. return c.header_
  54329. }
  54330. func (c *InstancesSetMetadataCall) doRequest(alt string) (*http.Response, error) {
  54331. reqHeaders := make(http.Header)
  54332. for k, v := range c.header_ {
  54333. reqHeaders[k] = v
  54334. }
  54335. reqHeaders.Set("User-Agent", c.s.userAgent())
  54336. var body io.Reader = nil
  54337. body, err := googleapi.WithoutDataWrapper.JSONReader(c.metadata)
  54338. if err != nil {
  54339. return nil, err
  54340. }
  54341. reqHeaders.Set("Content-Type", "application/json")
  54342. c.urlParams_.Set("alt", alt)
  54343. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/setMetadata")
  54344. urls += "?" + c.urlParams_.Encode()
  54345. req, _ := http.NewRequest("POST", urls, body)
  54346. req.Header = reqHeaders
  54347. googleapi.Expand(req.URL, map[string]string{
  54348. "project": c.project,
  54349. "zone": c.zone,
  54350. "instance": c.instance,
  54351. })
  54352. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  54353. }
  54354. // Do executes the "compute.instances.setMetadata" call.
  54355. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  54356. // status code is an error. Response headers are in either
  54357. // *Operation.ServerResponse.Header or (if a response was returned at
  54358. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  54359. // to check whether the returned error was because
  54360. // http.StatusNotModified was returned.
  54361. func (c *InstancesSetMetadataCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  54362. gensupport.SetOptions(c.urlParams_, opts...)
  54363. res, err := c.doRequest("json")
  54364. if res != nil && res.StatusCode == http.StatusNotModified {
  54365. if res.Body != nil {
  54366. res.Body.Close()
  54367. }
  54368. return nil, &googleapi.Error{
  54369. Code: res.StatusCode,
  54370. Header: res.Header,
  54371. }
  54372. }
  54373. if err != nil {
  54374. return nil, err
  54375. }
  54376. defer googleapi.CloseBody(res)
  54377. if err := googleapi.CheckResponse(res); err != nil {
  54378. return nil, err
  54379. }
  54380. ret := &Operation{
  54381. ServerResponse: googleapi.ServerResponse{
  54382. Header: res.Header,
  54383. HTTPStatusCode: res.StatusCode,
  54384. },
  54385. }
  54386. target := &ret
  54387. if err := gensupport.DecodeResponse(target, res); err != nil {
  54388. return nil, err
  54389. }
  54390. return ret, nil
  54391. // {
  54392. // "description": "Sets metadata for the specified instance to the data included in the request.",
  54393. // "httpMethod": "POST",
  54394. // "id": "compute.instances.setMetadata",
  54395. // "parameterOrder": [
  54396. // "project",
  54397. // "zone",
  54398. // "instance"
  54399. // ],
  54400. // "parameters": {
  54401. // "instance": {
  54402. // "description": "Name of the instance scoping this request.",
  54403. // "location": "path",
  54404. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  54405. // "required": true,
  54406. // "type": "string"
  54407. // },
  54408. // "project": {
  54409. // "description": "Project ID for this request.",
  54410. // "location": "path",
  54411. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  54412. // "required": true,
  54413. // "type": "string"
  54414. // },
  54415. // "requestId": {
  54416. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  54417. // "location": "query",
  54418. // "type": "string"
  54419. // },
  54420. // "zone": {
  54421. // "description": "The name of the zone for this request.",
  54422. // "location": "path",
  54423. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  54424. // "required": true,
  54425. // "type": "string"
  54426. // }
  54427. // },
  54428. // "path": "{project}/zones/{zone}/instances/{instance}/setMetadata",
  54429. // "request": {
  54430. // "$ref": "Metadata"
  54431. // },
  54432. // "response": {
  54433. // "$ref": "Operation"
  54434. // },
  54435. // "scopes": [
  54436. // "https://www.googleapis.com/auth/cloud-platform",
  54437. // "https://www.googleapis.com/auth/compute"
  54438. // ]
  54439. // }
  54440. }
  54441. // method id "compute.instances.setMinCpuPlatform":
  54442. type InstancesSetMinCpuPlatformCall struct {
  54443. s *Service
  54444. project string
  54445. zone string
  54446. instance string
  54447. instancessetmincpuplatformrequest *InstancesSetMinCpuPlatformRequest
  54448. urlParams_ gensupport.URLParams
  54449. ctx_ context.Context
  54450. header_ http.Header
  54451. }
  54452. // SetMinCpuPlatform: Changes the minimum CPU platform that this
  54453. // instance should use. This method can only be called on a stopped
  54454. // instance. For more information, read Specifying a Minimum CPU
  54455. // Platform.
  54456. func (r *InstancesService) SetMinCpuPlatform(project string, zone string, instance string, instancessetmincpuplatformrequest *InstancesSetMinCpuPlatformRequest) *InstancesSetMinCpuPlatformCall {
  54457. c := &InstancesSetMinCpuPlatformCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  54458. c.project = project
  54459. c.zone = zone
  54460. c.instance = instance
  54461. c.instancessetmincpuplatformrequest = instancessetmincpuplatformrequest
  54462. return c
  54463. }
  54464. // RequestId sets the optional parameter "requestId": An optional
  54465. // request ID to identify requests. Specify a unique request ID so that
  54466. // if you must retry your request, the server will know to ignore the
  54467. // request if it has already been completed.
  54468. //
  54469. // For example, consider a situation where you make an initial request
  54470. // and the request times out. If you make the request again with the
  54471. // same request ID, the server can check if original operation with the
  54472. // same request ID was received, and if so, will ignore the second
  54473. // request. This prevents clients from accidentally creating duplicate
  54474. // commitments.
  54475. //
  54476. // The request ID must be a valid UUID with the exception that zero UUID
  54477. // is not supported (00000000-0000-0000-0000-000000000000).
  54478. func (c *InstancesSetMinCpuPlatformCall) RequestId(requestId string) *InstancesSetMinCpuPlatformCall {
  54479. c.urlParams_.Set("requestId", requestId)
  54480. return c
  54481. }
  54482. // Fields allows partial responses to be retrieved. See
  54483. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  54484. // for more information.
  54485. func (c *InstancesSetMinCpuPlatformCall) Fields(s ...googleapi.Field) *InstancesSetMinCpuPlatformCall {
  54486. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  54487. return c
  54488. }
  54489. // Context sets the context to be used in this call's Do method. Any
  54490. // pending HTTP request will be aborted if the provided context is
  54491. // canceled.
  54492. func (c *InstancesSetMinCpuPlatformCall) Context(ctx context.Context) *InstancesSetMinCpuPlatformCall {
  54493. c.ctx_ = ctx
  54494. return c
  54495. }
  54496. // Header returns an http.Header that can be modified by the caller to
  54497. // add HTTP headers to the request.
  54498. func (c *InstancesSetMinCpuPlatformCall) Header() http.Header {
  54499. if c.header_ == nil {
  54500. c.header_ = make(http.Header)
  54501. }
  54502. return c.header_
  54503. }
  54504. func (c *InstancesSetMinCpuPlatformCall) doRequest(alt string) (*http.Response, error) {
  54505. reqHeaders := make(http.Header)
  54506. for k, v := range c.header_ {
  54507. reqHeaders[k] = v
  54508. }
  54509. reqHeaders.Set("User-Agent", c.s.userAgent())
  54510. var body io.Reader = nil
  54511. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancessetmincpuplatformrequest)
  54512. if err != nil {
  54513. return nil, err
  54514. }
  54515. reqHeaders.Set("Content-Type", "application/json")
  54516. c.urlParams_.Set("alt", alt)
  54517. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/setMinCpuPlatform")
  54518. urls += "?" + c.urlParams_.Encode()
  54519. req, _ := http.NewRequest("POST", urls, body)
  54520. req.Header = reqHeaders
  54521. googleapi.Expand(req.URL, map[string]string{
  54522. "project": c.project,
  54523. "zone": c.zone,
  54524. "instance": c.instance,
  54525. })
  54526. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  54527. }
  54528. // Do executes the "compute.instances.setMinCpuPlatform" call.
  54529. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  54530. // status code is an error. Response headers are in either
  54531. // *Operation.ServerResponse.Header or (if a response was returned at
  54532. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  54533. // to check whether the returned error was because
  54534. // http.StatusNotModified was returned.
  54535. func (c *InstancesSetMinCpuPlatformCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  54536. gensupport.SetOptions(c.urlParams_, opts...)
  54537. res, err := c.doRequest("json")
  54538. if res != nil && res.StatusCode == http.StatusNotModified {
  54539. if res.Body != nil {
  54540. res.Body.Close()
  54541. }
  54542. return nil, &googleapi.Error{
  54543. Code: res.StatusCode,
  54544. Header: res.Header,
  54545. }
  54546. }
  54547. if err != nil {
  54548. return nil, err
  54549. }
  54550. defer googleapi.CloseBody(res)
  54551. if err := googleapi.CheckResponse(res); err != nil {
  54552. return nil, err
  54553. }
  54554. ret := &Operation{
  54555. ServerResponse: googleapi.ServerResponse{
  54556. Header: res.Header,
  54557. HTTPStatusCode: res.StatusCode,
  54558. },
  54559. }
  54560. target := &ret
  54561. if err := gensupport.DecodeResponse(target, res); err != nil {
  54562. return nil, err
  54563. }
  54564. return ret, nil
  54565. // {
  54566. // "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.",
  54567. // "httpMethod": "POST",
  54568. // "id": "compute.instances.setMinCpuPlatform",
  54569. // "parameterOrder": [
  54570. // "project",
  54571. // "zone",
  54572. // "instance"
  54573. // ],
  54574. // "parameters": {
  54575. // "instance": {
  54576. // "description": "Name of the instance scoping this request.",
  54577. // "location": "path",
  54578. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  54579. // "required": true,
  54580. // "type": "string"
  54581. // },
  54582. // "project": {
  54583. // "description": "Project ID for this request.",
  54584. // "location": "path",
  54585. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  54586. // "required": true,
  54587. // "type": "string"
  54588. // },
  54589. // "requestId": {
  54590. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  54591. // "location": "query",
  54592. // "type": "string"
  54593. // },
  54594. // "zone": {
  54595. // "description": "The name of the zone for this request.",
  54596. // "location": "path",
  54597. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  54598. // "required": true,
  54599. // "type": "string"
  54600. // }
  54601. // },
  54602. // "path": "{project}/zones/{zone}/instances/{instance}/setMinCpuPlatform",
  54603. // "request": {
  54604. // "$ref": "InstancesSetMinCpuPlatformRequest"
  54605. // },
  54606. // "response": {
  54607. // "$ref": "Operation"
  54608. // },
  54609. // "scopes": [
  54610. // "https://www.googleapis.com/auth/cloud-platform",
  54611. // "https://www.googleapis.com/auth/compute"
  54612. // ]
  54613. // }
  54614. }
  54615. // method id "compute.instances.setScheduling":
  54616. type InstancesSetSchedulingCall struct {
  54617. s *Service
  54618. project string
  54619. zone string
  54620. instance string
  54621. scheduling *Scheduling
  54622. urlParams_ gensupport.URLParams
  54623. ctx_ context.Context
  54624. header_ http.Header
  54625. }
  54626. // SetScheduling: Sets an instance's scheduling options.
  54627. // For details, see https://cloud.google.com/compute/docs/reference/latest/instances/setScheduling
  54628. func (r *InstancesService) SetScheduling(project string, zone string, instance string, scheduling *Scheduling) *InstancesSetSchedulingCall {
  54629. c := &InstancesSetSchedulingCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  54630. c.project = project
  54631. c.zone = zone
  54632. c.instance = instance
  54633. c.scheduling = scheduling
  54634. return c
  54635. }
  54636. // RequestId sets the optional parameter "requestId": An optional
  54637. // request ID to identify requests. Specify a unique request ID so that
  54638. // if you must retry your request, the server will know to ignore the
  54639. // request if it has already been completed.
  54640. //
  54641. // For example, consider a situation where you make an initial request
  54642. // and the request times out. If you make the request again with the
  54643. // same request ID, the server can check if original operation with the
  54644. // same request ID was received, and if so, will ignore the second
  54645. // request. This prevents clients from accidentally creating duplicate
  54646. // commitments.
  54647. //
  54648. // The request ID must be a valid UUID with the exception that zero UUID
  54649. // is not supported (00000000-0000-0000-0000-000000000000).
  54650. func (c *InstancesSetSchedulingCall) RequestId(requestId string) *InstancesSetSchedulingCall {
  54651. c.urlParams_.Set("requestId", requestId)
  54652. return c
  54653. }
  54654. // Fields allows partial responses to be retrieved. See
  54655. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  54656. // for more information.
  54657. func (c *InstancesSetSchedulingCall) Fields(s ...googleapi.Field) *InstancesSetSchedulingCall {
  54658. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  54659. return c
  54660. }
  54661. // Context sets the context to be used in this call's Do method. Any
  54662. // pending HTTP request will be aborted if the provided context is
  54663. // canceled.
  54664. func (c *InstancesSetSchedulingCall) Context(ctx context.Context) *InstancesSetSchedulingCall {
  54665. c.ctx_ = ctx
  54666. return c
  54667. }
  54668. // Header returns an http.Header that can be modified by the caller to
  54669. // add HTTP headers to the request.
  54670. func (c *InstancesSetSchedulingCall) Header() http.Header {
  54671. if c.header_ == nil {
  54672. c.header_ = make(http.Header)
  54673. }
  54674. return c.header_
  54675. }
  54676. func (c *InstancesSetSchedulingCall) doRequest(alt string) (*http.Response, error) {
  54677. reqHeaders := make(http.Header)
  54678. for k, v := range c.header_ {
  54679. reqHeaders[k] = v
  54680. }
  54681. reqHeaders.Set("User-Agent", c.s.userAgent())
  54682. var body io.Reader = nil
  54683. body, err := googleapi.WithoutDataWrapper.JSONReader(c.scheduling)
  54684. if err != nil {
  54685. return nil, err
  54686. }
  54687. reqHeaders.Set("Content-Type", "application/json")
  54688. c.urlParams_.Set("alt", alt)
  54689. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/setScheduling")
  54690. urls += "?" + c.urlParams_.Encode()
  54691. req, _ := http.NewRequest("POST", urls, body)
  54692. req.Header = reqHeaders
  54693. googleapi.Expand(req.URL, map[string]string{
  54694. "project": c.project,
  54695. "zone": c.zone,
  54696. "instance": c.instance,
  54697. })
  54698. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  54699. }
  54700. // Do executes the "compute.instances.setScheduling" call.
  54701. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  54702. // status code is an error. Response headers are in either
  54703. // *Operation.ServerResponse.Header or (if a response was returned at
  54704. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  54705. // to check whether the returned error was because
  54706. // http.StatusNotModified was returned.
  54707. func (c *InstancesSetSchedulingCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  54708. gensupport.SetOptions(c.urlParams_, opts...)
  54709. res, err := c.doRequest("json")
  54710. if res != nil && res.StatusCode == http.StatusNotModified {
  54711. if res.Body != nil {
  54712. res.Body.Close()
  54713. }
  54714. return nil, &googleapi.Error{
  54715. Code: res.StatusCode,
  54716. Header: res.Header,
  54717. }
  54718. }
  54719. if err != nil {
  54720. return nil, err
  54721. }
  54722. defer googleapi.CloseBody(res)
  54723. if err := googleapi.CheckResponse(res); err != nil {
  54724. return nil, err
  54725. }
  54726. ret := &Operation{
  54727. ServerResponse: googleapi.ServerResponse{
  54728. Header: res.Header,
  54729. HTTPStatusCode: res.StatusCode,
  54730. },
  54731. }
  54732. target := &ret
  54733. if err := gensupport.DecodeResponse(target, res); err != nil {
  54734. return nil, err
  54735. }
  54736. return ret, nil
  54737. // {
  54738. // "description": "Sets an instance's scheduling options.",
  54739. // "httpMethod": "POST",
  54740. // "id": "compute.instances.setScheduling",
  54741. // "parameterOrder": [
  54742. // "project",
  54743. // "zone",
  54744. // "instance"
  54745. // ],
  54746. // "parameters": {
  54747. // "instance": {
  54748. // "description": "Instance name.",
  54749. // "location": "path",
  54750. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  54751. // "required": true,
  54752. // "type": "string"
  54753. // },
  54754. // "project": {
  54755. // "description": "Project ID for this request.",
  54756. // "location": "path",
  54757. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  54758. // "required": true,
  54759. // "type": "string"
  54760. // },
  54761. // "requestId": {
  54762. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  54763. // "location": "query",
  54764. // "type": "string"
  54765. // },
  54766. // "zone": {
  54767. // "description": "The name of the zone for this request.",
  54768. // "location": "path",
  54769. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  54770. // "required": true,
  54771. // "type": "string"
  54772. // }
  54773. // },
  54774. // "path": "{project}/zones/{zone}/instances/{instance}/setScheduling",
  54775. // "request": {
  54776. // "$ref": "Scheduling"
  54777. // },
  54778. // "response": {
  54779. // "$ref": "Operation"
  54780. // },
  54781. // "scopes": [
  54782. // "https://www.googleapis.com/auth/cloud-platform",
  54783. // "https://www.googleapis.com/auth/compute"
  54784. // ]
  54785. // }
  54786. }
  54787. // method id "compute.instances.setServiceAccount":
  54788. type InstancesSetServiceAccountCall struct {
  54789. s *Service
  54790. project string
  54791. zone string
  54792. instance string
  54793. instancessetserviceaccountrequest *InstancesSetServiceAccountRequest
  54794. urlParams_ gensupport.URLParams
  54795. ctx_ context.Context
  54796. header_ http.Header
  54797. }
  54798. // SetServiceAccount: Sets the service account on the instance. For more
  54799. // information, read Changing the service account and access scopes for
  54800. // an instance.
  54801. func (r *InstancesService) SetServiceAccount(project string, zone string, instance string, instancessetserviceaccountrequest *InstancesSetServiceAccountRequest) *InstancesSetServiceAccountCall {
  54802. c := &InstancesSetServiceAccountCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  54803. c.project = project
  54804. c.zone = zone
  54805. c.instance = instance
  54806. c.instancessetserviceaccountrequest = instancessetserviceaccountrequest
  54807. return c
  54808. }
  54809. // RequestId sets the optional parameter "requestId": An optional
  54810. // request ID to identify requests. Specify a unique request ID so that
  54811. // if you must retry your request, the server will know to ignore the
  54812. // request if it has already been completed.
  54813. //
  54814. // For example, consider a situation where you make an initial request
  54815. // and the request times out. If you make the request again with the
  54816. // same request ID, the server can check if original operation with the
  54817. // same request ID was received, and if so, will ignore the second
  54818. // request. This prevents clients from accidentally creating duplicate
  54819. // commitments.
  54820. //
  54821. // The request ID must be a valid UUID with the exception that zero UUID
  54822. // is not supported (00000000-0000-0000-0000-000000000000).
  54823. func (c *InstancesSetServiceAccountCall) RequestId(requestId string) *InstancesSetServiceAccountCall {
  54824. c.urlParams_.Set("requestId", requestId)
  54825. return c
  54826. }
  54827. // Fields allows partial responses to be retrieved. See
  54828. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  54829. // for more information.
  54830. func (c *InstancesSetServiceAccountCall) Fields(s ...googleapi.Field) *InstancesSetServiceAccountCall {
  54831. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  54832. return c
  54833. }
  54834. // Context sets the context to be used in this call's Do method. Any
  54835. // pending HTTP request will be aborted if the provided context is
  54836. // canceled.
  54837. func (c *InstancesSetServiceAccountCall) Context(ctx context.Context) *InstancesSetServiceAccountCall {
  54838. c.ctx_ = ctx
  54839. return c
  54840. }
  54841. // Header returns an http.Header that can be modified by the caller to
  54842. // add HTTP headers to the request.
  54843. func (c *InstancesSetServiceAccountCall) Header() http.Header {
  54844. if c.header_ == nil {
  54845. c.header_ = make(http.Header)
  54846. }
  54847. return c.header_
  54848. }
  54849. func (c *InstancesSetServiceAccountCall) doRequest(alt string) (*http.Response, error) {
  54850. reqHeaders := make(http.Header)
  54851. for k, v := range c.header_ {
  54852. reqHeaders[k] = v
  54853. }
  54854. reqHeaders.Set("User-Agent", c.s.userAgent())
  54855. var body io.Reader = nil
  54856. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancessetserviceaccountrequest)
  54857. if err != nil {
  54858. return nil, err
  54859. }
  54860. reqHeaders.Set("Content-Type", "application/json")
  54861. c.urlParams_.Set("alt", alt)
  54862. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/setServiceAccount")
  54863. urls += "?" + c.urlParams_.Encode()
  54864. req, _ := http.NewRequest("POST", urls, body)
  54865. req.Header = reqHeaders
  54866. googleapi.Expand(req.URL, map[string]string{
  54867. "project": c.project,
  54868. "zone": c.zone,
  54869. "instance": c.instance,
  54870. })
  54871. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  54872. }
  54873. // Do executes the "compute.instances.setServiceAccount" call.
  54874. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  54875. // status code is an error. Response headers are in either
  54876. // *Operation.ServerResponse.Header or (if a response was returned at
  54877. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  54878. // to check whether the returned error was because
  54879. // http.StatusNotModified was returned.
  54880. func (c *InstancesSetServiceAccountCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  54881. gensupport.SetOptions(c.urlParams_, opts...)
  54882. res, err := c.doRequest("json")
  54883. if res != nil && res.StatusCode == http.StatusNotModified {
  54884. if res.Body != nil {
  54885. res.Body.Close()
  54886. }
  54887. return nil, &googleapi.Error{
  54888. Code: res.StatusCode,
  54889. Header: res.Header,
  54890. }
  54891. }
  54892. if err != nil {
  54893. return nil, err
  54894. }
  54895. defer googleapi.CloseBody(res)
  54896. if err := googleapi.CheckResponse(res); err != nil {
  54897. return nil, err
  54898. }
  54899. ret := &Operation{
  54900. ServerResponse: googleapi.ServerResponse{
  54901. Header: res.Header,
  54902. HTTPStatusCode: res.StatusCode,
  54903. },
  54904. }
  54905. target := &ret
  54906. if err := gensupport.DecodeResponse(target, res); err != nil {
  54907. return nil, err
  54908. }
  54909. return ret, nil
  54910. // {
  54911. // "description": "Sets the service account on the instance. For more information, read Changing the service account and access scopes for an instance.",
  54912. // "httpMethod": "POST",
  54913. // "id": "compute.instances.setServiceAccount",
  54914. // "parameterOrder": [
  54915. // "project",
  54916. // "zone",
  54917. // "instance"
  54918. // ],
  54919. // "parameters": {
  54920. // "instance": {
  54921. // "description": "Name of the instance resource to start.",
  54922. // "location": "path",
  54923. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  54924. // "required": true,
  54925. // "type": "string"
  54926. // },
  54927. // "project": {
  54928. // "description": "Project ID for this request.",
  54929. // "location": "path",
  54930. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  54931. // "required": true,
  54932. // "type": "string"
  54933. // },
  54934. // "requestId": {
  54935. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  54936. // "location": "query",
  54937. // "type": "string"
  54938. // },
  54939. // "zone": {
  54940. // "description": "The name of the zone for this request.",
  54941. // "location": "path",
  54942. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  54943. // "required": true,
  54944. // "type": "string"
  54945. // }
  54946. // },
  54947. // "path": "{project}/zones/{zone}/instances/{instance}/setServiceAccount",
  54948. // "request": {
  54949. // "$ref": "InstancesSetServiceAccountRequest"
  54950. // },
  54951. // "response": {
  54952. // "$ref": "Operation"
  54953. // },
  54954. // "scopes": [
  54955. // "https://www.googleapis.com/auth/cloud-platform",
  54956. // "https://www.googleapis.com/auth/compute"
  54957. // ]
  54958. // }
  54959. }
  54960. // method id "compute.instances.setShieldedVmIntegrityPolicy":
  54961. type InstancesSetShieldedVmIntegrityPolicyCall struct {
  54962. s *Service
  54963. project string
  54964. zone string
  54965. instance string
  54966. shieldedvmintegritypolicy *ShieldedVmIntegrityPolicy
  54967. urlParams_ gensupport.URLParams
  54968. ctx_ context.Context
  54969. header_ http.Header
  54970. }
  54971. // SetShieldedVmIntegrityPolicy: Sets the Shielded VM integrity policy
  54972. // for an instance. This method supports PATCH semantics and uses the
  54973. // JSON merge patch format and processing rules.
  54974. func (r *InstancesService) SetShieldedVmIntegrityPolicy(project string, zone string, instance string, shieldedvmintegritypolicy *ShieldedVmIntegrityPolicy) *InstancesSetShieldedVmIntegrityPolicyCall {
  54975. c := &InstancesSetShieldedVmIntegrityPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  54976. c.project = project
  54977. c.zone = zone
  54978. c.instance = instance
  54979. c.shieldedvmintegritypolicy = shieldedvmintegritypolicy
  54980. return c
  54981. }
  54982. // RequestId sets the optional parameter "requestId": An optional
  54983. // request ID to identify requests. Specify a unique request ID so that
  54984. // if you must retry your request, the server will know to ignore the
  54985. // request if it has already been completed.
  54986. //
  54987. // For example, consider a situation where you make an initial request
  54988. // and the request times out. If you make the request again with the
  54989. // same request ID, the server can check if original operation with the
  54990. // same request ID was received, and if so, will ignore the second
  54991. // request. This prevents clients from accidentally creating duplicate
  54992. // commitments.
  54993. //
  54994. // The request ID must be a valid UUID with the exception that zero UUID
  54995. // is not supported (00000000-0000-0000-0000-000000000000).
  54996. func (c *InstancesSetShieldedVmIntegrityPolicyCall) RequestId(requestId string) *InstancesSetShieldedVmIntegrityPolicyCall {
  54997. c.urlParams_.Set("requestId", requestId)
  54998. return c
  54999. }
  55000. // Fields allows partial responses to be retrieved. See
  55001. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  55002. // for more information.
  55003. func (c *InstancesSetShieldedVmIntegrityPolicyCall) Fields(s ...googleapi.Field) *InstancesSetShieldedVmIntegrityPolicyCall {
  55004. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  55005. return c
  55006. }
  55007. // Context sets the context to be used in this call's Do method. Any
  55008. // pending HTTP request will be aborted if the provided context is
  55009. // canceled.
  55010. func (c *InstancesSetShieldedVmIntegrityPolicyCall) Context(ctx context.Context) *InstancesSetShieldedVmIntegrityPolicyCall {
  55011. c.ctx_ = ctx
  55012. return c
  55013. }
  55014. // Header returns an http.Header that can be modified by the caller to
  55015. // add HTTP headers to the request.
  55016. func (c *InstancesSetShieldedVmIntegrityPolicyCall) Header() http.Header {
  55017. if c.header_ == nil {
  55018. c.header_ = make(http.Header)
  55019. }
  55020. return c.header_
  55021. }
  55022. func (c *InstancesSetShieldedVmIntegrityPolicyCall) doRequest(alt string) (*http.Response, error) {
  55023. reqHeaders := make(http.Header)
  55024. for k, v := range c.header_ {
  55025. reqHeaders[k] = v
  55026. }
  55027. reqHeaders.Set("User-Agent", c.s.userAgent())
  55028. var body io.Reader = nil
  55029. body, err := googleapi.WithoutDataWrapper.JSONReader(c.shieldedvmintegritypolicy)
  55030. if err != nil {
  55031. return nil, err
  55032. }
  55033. reqHeaders.Set("Content-Type", "application/json")
  55034. c.urlParams_.Set("alt", alt)
  55035. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/setShieldedVmIntegrityPolicy")
  55036. urls += "?" + c.urlParams_.Encode()
  55037. req, _ := http.NewRequest("PATCH", urls, body)
  55038. req.Header = reqHeaders
  55039. googleapi.Expand(req.URL, map[string]string{
  55040. "project": c.project,
  55041. "zone": c.zone,
  55042. "instance": c.instance,
  55043. })
  55044. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  55045. }
  55046. // Do executes the "compute.instances.setShieldedVmIntegrityPolicy" call.
  55047. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  55048. // status code is an error. Response headers are in either
  55049. // *Operation.ServerResponse.Header or (if a response was returned at
  55050. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  55051. // to check whether the returned error was because
  55052. // http.StatusNotModified was returned.
  55053. func (c *InstancesSetShieldedVmIntegrityPolicyCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  55054. gensupport.SetOptions(c.urlParams_, opts...)
  55055. res, err := c.doRequest("json")
  55056. if res != nil && res.StatusCode == http.StatusNotModified {
  55057. if res.Body != nil {
  55058. res.Body.Close()
  55059. }
  55060. return nil, &googleapi.Error{
  55061. Code: res.StatusCode,
  55062. Header: res.Header,
  55063. }
  55064. }
  55065. if err != nil {
  55066. return nil, err
  55067. }
  55068. defer googleapi.CloseBody(res)
  55069. if err := googleapi.CheckResponse(res); err != nil {
  55070. return nil, err
  55071. }
  55072. ret := &Operation{
  55073. ServerResponse: googleapi.ServerResponse{
  55074. Header: res.Header,
  55075. HTTPStatusCode: res.StatusCode,
  55076. },
  55077. }
  55078. target := &ret
  55079. if err := gensupport.DecodeResponse(target, res); err != nil {
  55080. return nil, err
  55081. }
  55082. return ret, nil
  55083. // {
  55084. // "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.",
  55085. // "httpMethod": "PATCH",
  55086. // "id": "compute.instances.setShieldedVmIntegrityPolicy",
  55087. // "parameterOrder": [
  55088. // "project",
  55089. // "zone",
  55090. // "instance"
  55091. // ],
  55092. // "parameters": {
  55093. // "instance": {
  55094. // "description": "Name of the instance scoping this request.",
  55095. // "location": "path",
  55096. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  55097. // "required": true,
  55098. // "type": "string"
  55099. // },
  55100. // "project": {
  55101. // "description": "Project ID for this request.",
  55102. // "location": "path",
  55103. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  55104. // "required": true,
  55105. // "type": "string"
  55106. // },
  55107. // "requestId": {
  55108. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  55109. // "location": "query",
  55110. // "type": "string"
  55111. // },
  55112. // "zone": {
  55113. // "description": "The name of the zone for this request.",
  55114. // "location": "path",
  55115. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  55116. // "required": true,
  55117. // "type": "string"
  55118. // }
  55119. // },
  55120. // "path": "{project}/zones/{zone}/instances/{instance}/setShieldedVmIntegrityPolicy",
  55121. // "request": {
  55122. // "$ref": "ShieldedVmIntegrityPolicy"
  55123. // },
  55124. // "response": {
  55125. // "$ref": "Operation"
  55126. // },
  55127. // "scopes": [
  55128. // "https://www.googleapis.com/auth/cloud-platform",
  55129. // "https://www.googleapis.com/auth/compute"
  55130. // ]
  55131. // }
  55132. }
  55133. // method id "compute.instances.setTags":
  55134. type InstancesSetTagsCall struct {
  55135. s *Service
  55136. project string
  55137. zone string
  55138. instance string
  55139. tags *Tags
  55140. urlParams_ gensupport.URLParams
  55141. ctx_ context.Context
  55142. header_ http.Header
  55143. }
  55144. // SetTags: Sets tags for the specified instance to the data included in
  55145. // the request.
  55146. // For details, see https://cloud.google.com/compute/docs/reference/latest/instances/setTags
  55147. func (r *InstancesService) SetTags(project string, zone string, instance string, tags *Tags) *InstancesSetTagsCall {
  55148. c := &InstancesSetTagsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  55149. c.project = project
  55150. c.zone = zone
  55151. c.instance = instance
  55152. c.tags = tags
  55153. return c
  55154. }
  55155. // RequestId sets the optional parameter "requestId": An optional
  55156. // request ID to identify requests. Specify a unique request ID so that
  55157. // if you must retry your request, the server will know to ignore the
  55158. // request if it has already been completed.
  55159. //
  55160. // For example, consider a situation where you make an initial request
  55161. // and the request times out. If you make the request again with the
  55162. // same request ID, the server can check if original operation with the
  55163. // same request ID was received, and if so, will ignore the second
  55164. // request. This prevents clients from accidentally creating duplicate
  55165. // commitments.
  55166. //
  55167. // The request ID must be a valid UUID with the exception that zero UUID
  55168. // is not supported (00000000-0000-0000-0000-000000000000).
  55169. func (c *InstancesSetTagsCall) RequestId(requestId string) *InstancesSetTagsCall {
  55170. c.urlParams_.Set("requestId", requestId)
  55171. return c
  55172. }
  55173. // Fields allows partial responses to be retrieved. See
  55174. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  55175. // for more information.
  55176. func (c *InstancesSetTagsCall) Fields(s ...googleapi.Field) *InstancesSetTagsCall {
  55177. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  55178. return c
  55179. }
  55180. // Context sets the context to be used in this call's Do method. Any
  55181. // pending HTTP request will be aborted if the provided context is
  55182. // canceled.
  55183. func (c *InstancesSetTagsCall) Context(ctx context.Context) *InstancesSetTagsCall {
  55184. c.ctx_ = ctx
  55185. return c
  55186. }
  55187. // Header returns an http.Header that can be modified by the caller to
  55188. // add HTTP headers to the request.
  55189. func (c *InstancesSetTagsCall) Header() http.Header {
  55190. if c.header_ == nil {
  55191. c.header_ = make(http.Header)
  55192. }
  55193. return c.header_
  55194. }
  55195. func (c *InstancesSetTagsCall) doRequest(alt string) (*http.Response, error) {
  55196. reqHeaders := make(http.Header)
  55197. for k, v := range c.header_ {
  55198. reqHeaders[k] = v
  55199. }
  55200. reqHeaders.Set("User-Agent", c.s.userAgent())
  55201. var body io.Reader = nil
  55202. body, err := googleapi.WithoutDataWrapper.JSONReader(c.tags)
  55203. if err != nil {
  55204. return nil, err
  55205. }
  55206. reqHeaders.Set("Content-Type", "application/json")
  55207. c.urlParams_.Set("alt", alt)
  55208. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/setTags")
  55209. urls += "?" + c.urlParams_.Encode()
  55210. req, _ := http.NewRequest("POST", urls, body)
  55211. req.Header = reqHeaders
  55212. googleapi.Expand(req.URL, map[string]string{
  55213. "project": c.project,
  55214. "zone": c.zone,
  55215. "instance": c.instance,
  55216. })
  55217. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  55218. }
  55219. // Do executes the "compute.instances.setTags" call.
  55220. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  55221. // status code is an error. Response headers are in either
  55222. // *Operation.ServerResponse.Header or (if a response was returned at
  55223. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  55224. // to check whether the returned error was because
  55225. // http.StatusNotModified was returned.
  55226. func (c *InstancesSetTagsCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  55227. gensupport.SetOptions(c.urlParams_, opts...)
  55228. res, err := c.doRequest("json")
  55229. if res != nil && res.StatusCode == http.StatusNotModified {
  55230. if res.Body != nil {
  55231. res.Body.Close()
  55232. }
  55233. return nil, &googleapi.Error{
  55234. Code: res.StatusCode,
  55235. Header: res.Header,
  55236. }
  55237. }
  55238. if err != nil {
  55239. return nil, err
  55240. }
  55241. defer googleapi.CloseBody(res)
  55242. if err := googleapi.CheckResponse(res); err != nil {
  55243. return nil, err
  55244. }
  55245. ret := &Operation{
  55246. ServerResponse: googleapi.ServerResponse{
  55247. Header: res.Header,
  55248. HTTPStatusCode: res.StatusCode,
  55249. },
  55250. }
  55251. target := &ret
  55252. if err := gensupport.DecodeResponse(target, res); err != nil {
  55253. return nil, err
  55254. }
  55255. return ret, nil
  55256. // {
  55257. // "description": "Sets tags for the specified instance to the data included in the request.",
  55258. // "httpMethod": "POST",
  55259. // "id": "compute.instances.setTags",
  55260. // "parameterOrder": [
  55261. // "project",
  55262. // "zone",
  55263. // "instance"
  55264. // ],
  55265. // "parameters": {
  55266. // "instance": {
  55267. // "description": "Name of the instance scoping this request.",
  55268. // "location": "path",
  55269. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  55270. // "required": true,
  55271. // "type": "string"
  55272. // },
  55273. // "project": {
  55274. // "description": "Project ID for this request.",
  55275. // "location": "path",
  55276. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  55277. // "required": true,
  55278. // "type": "string"
  55279. // },
  55280. // "requestId": {
  55281. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  55282. // "location": "query",
  55283. // "type": "string"
  55284. // },
  55285. // "zone": {
  55286. // "description": "The name of the zone for this request.",
  55287. // "location": "path",
  55288. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  55289. // "required": true,
  55290. // "type": "string"
  55291. // }
  55292. // },
  55293. // "path": "{project}/zones/{zone}/instances/{instance}/setTags",
  55294. // "request": {
  55295. // "$ref": "Tags"
  55296. // },
  55297. // "response": {
  55298. // "$ref": "Operation"
  55299. // },
  55300. // "scopes": [
  55301. // "https://www.googleapis.com/auth/cloud-platform",
  55302. // "https://www.googleapis.com/auth/compute"
  55303. // ]
  55304. // }
  55305. }
  55306. // method id "compute.instances.simulateMaintenanceEvent":
  55307. type InstancesSimulateMaintenanceEventCall struct {
  55308. s *Service
  55309. project string
  55310. zone string
  55311. instance string
  55312. urlParams_ gensupport.URLParams
  55313. ctx_ context.Context
  55314. header_ http.Header
  55315. }
  55316. // SimulateMaintenanceEvent: Simulates a maintenance event on the
  55317. // instance.
  55318. func (r *InstancesService) SimulateMaintenanceEvent(project string, zone string, instance string) *InstancesSimulateMaintenanceEventCall {
  55319. c := &InstancesSimulateMaintenanceEventCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  55320. c.project = project
  55321. c.zone = zone
  55322. c.instance = instance
  55323. return c
  55324. }
  55325. // Fields allows partial responses to be retrieved. See
  55326. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  55327. // for more information.
  55328. func (c *InstancesSimulateMaintenanceEventCall) Fields(s ...googleapi.Field) *InstancesSimulateMaintenanceEventCall {
  55329. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  55330. return c
  55331. }
  55332. // Context sets the context to be used in this call's Do method. Any
  55333. // pending HTTP request will be aborted if the provided context is
  55334. // canceled.
  55335. func (c *InstancesSimulateMaintenanceEventCall) Context(ctx context.Context) *InstancesSimulateMaintenanceEventCall {
  55336. c.ctx_ = ctx
  55337. return c
  55338. }
  55339. // Header returns an http.Header that can be modified by the caller to
  55340. // add HTTP headers to the request.
  55341. func (c *InstancesSimulateMaintenanceEventCall) Header() http.Header {
  55342. if c.header_ == nil {
  55343. c.header_ = make(http.Header)
  55344. }
  55345. return c.header_
  55346. }
  55347. func (c *InstancesSimulateMaintenanceEventCall) doRequest(alt string) (*http.Response, error) {
  55348. reqHeaders := make(http.Header)
  55349. for k, v := range c.header_ {
  55350. reqHeaders[k] = v
  55351. }
  55352. reqHeaders.Set("User-Agent", c.s.userAgent())
  55353. var body io.Reader = nil
  55354. c.urlParams_.Set("alt", alt)
  55355. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/simulateMaintenanceEvent")
  55356. urls += "?" + c.urlParams_.Encode()
  55357. req, _ := http.NewRequest("POST", urls, body)
  55358. req.Header = reqHeaders
  55359. googleapi.Expand(req.URL, map[string]string{
  55360. "project": c.project,
  55361. "zone": c.zone,
  55362. "instance": c.instance,
  55363. })
  55364. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  55365. }
  55366. // Do executes the "compute.instances.simulateMaintenanceEvent" call.
  55367. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  55368. // status code is an error. Response headers are in either
  55369. // *Operation.ServerResponse.Header or (if a response was returned at
  55370. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  55371. // to check whether the returned error was because
  55372. // http.StatusNotModified was returned.
  55373. func (c *InstancesSimulateMaintenanceEventCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  55374. gensupport.SetOptions(c.urlParams_, opts...)
  55375. res, err := c.doRequest("json")
  55376. if res != nil && res.StatusCode == http.StatusNotModified {
  55377. if res.Body != nil {
  55378. res.Body.Close()
  55379. }
  55380. return nil, &googleapi.Error{
  55381. Code: res.StatusCode,
  55382. Header: res.Header,
  55383. }
  55384. }
  55385. if err != nil {
  55386. return nil, err
  55387. }
  55388. defer googleapi.CloseBody(res)
  55389. if err := googleapi.CheckResponse(res); err != nil {
  55390. return nil, err
  55391. }
  55392. ret := &Operation{
  55393. ServerResponse: googleapi.ServerResponse{
  55394. Header: res.Header,
  55395. HTTPStatusCode: res.StatusCode,
  55396. },
  55397. }
  55398. target := &ret
  55399. if err := gensupport.DecodeResponse(target, res); err != nil {
  55400. return nil, err
  55401. }
  55402. return ret, nil
  55403. // {
  55404. // "description": "Simulates a maintenance event on the instance.",
  55405. // "httpMethod": "POST",
  55406. // "id": "compute.instances.simulateMaintenanceEvent",
  55407. // "parameterOrder": [
  55408. // "project",
  55409. // "zone",
  55410. // "instance"
  55411. // ],
  55412. // "parameters": {
  55413. // "instance": {
  55414. // "description": "Name of the instance scoping this request.",
  55415. // "location": "path",
  55416. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  55417. // "required": true,
  55418. // "type": "string"
  55419. // },
  55420. // "project": {
  55421. // "description": "Project ID for this request.",
  55422. // "location": "path",
  55423. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  55424. // "required": true,
  55425. // "type": "string"
  55426. // },
  55427. // "zone": {
  55428. // "description": "The name of the zone for this request.",
  55429. // "location": "path",
  55430. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  55431. // "required": true,
  55432. // "type": "string"
  55433. // }
  55434. // },
  55435. // "path": "{project}/zones/{zone}/instances/{instance}/simulateMaintenanceEvent",
  55436. // "response": {
  55437. // "$ref": "Operation"
  55438. // },
  55439. // "scopes": [
  55440. // "https://www.googleapis.com/auth/cloud-platform",
  55441. // "https://www.googleapis.com/auth/compute"
  55442. // ]
  55443. // }
  55444. }
  55445. // method id "compute.instances.start":
  55446. type InstancesStartCall struct {
  55447. s *Service
  55448. project string
  55449. zone string
  55450. instance string
  55451. urlParams_ gensupport.URLParams
  55452. ctx_ context.Context
  55453. header_ http.Header
  55454. }
  55455. // Start: Starts an instance that was stopped using the instances().stop
  55456. // method. For more information, see Restart an instance.
  55457. // For details, see https://cloud.google.com/compute/docs/reference/latest/instances/start
  55458. func (r *InstancesService) Start(project string, zone string, instance string) *InstancesStartCall {
  55459. c := &InstancesStartCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  55460. c.project = project
  55461. c.zone = zone
  55462. c.instance = instance
  55463. return c
  55464. }
  55465. // RequestId sets the optional parameter "requestId": An optional
  55466. // request ID to identify requests. Specify a unique request ID so that
  55467. // if you must retry your request, the server will know to ignore the
  55468. // request if it has already been completed.
  55469. //
  55470. // For example, consider a situation where you make an initial request
  55471. // and the request times out. If you make the request again with the
  55472. // same request ID, the server can check if original operation with the
  55473. // same request ID was received, and if so, will ignore the second
  55474. // request. This prevents clients from accidentally creating duplicate
  55475. // commitments.
  55476. //
  55477. // The request ID must be a valid UUID with the exception that zero UUID
  55478. // is not supported (00000000-0000-0000-0000-000000000000).
  55479. func (c *InstancesStartCall) RequestId(requestId string) *InstancesStartCall {
  55480. c.urlParams_.Set("requestId", requestId)
  55481. return c
  55482. }
  55483. // Fields allows partial responses to be retrieved. See
  55484. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  55485. // for more information.
  55486. func (c *InstancesStartCall) Fields(s ...googleapi.Field) *InstancesStartCall {
  55487. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  55488. return c
  55489. }
  55490. // Context sets the context to be used in this call's Do method. Any
  55491. // pending HTTP request will be aborted if the provided context is
  55492. // canceled.
  55493. func (c *InstancesStartCall) Context(ctx context.Context) *InstancesStartCall {
  55494. c.ctx_ = ctx
  55495. return c
  55496. }
  55497. // Header returns an http.Header that can be modified by the caller to
  55498. // add HTTP headers to the request.
  55499. func (c *InstancesStartCall) Header() http.Header {
  55500. if c.header_ == nil {
  55501. c.header_ = make(http.Header)
  55502. }
  55503. return c.header_
  55504. }
  55505. func (c *InstancesStartCall) doRequest(alt string) (*http.Response, error) {
  55506. reqHeaders := make(http.Header)
  55507. for k, v := range c.header_ {
  55508. reqHeaders[k] = v
  55509. }
  55510. reqHeaders.Set("User-Agent", c.s.userAgent())
  55511. var body io.Reader = nil
  55512. c.urlParams_.Set("alt", alt)
  55513. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/start")
  55514. urls += "?" + c.urlParams_.Encode()
  55515. req, _ := http.NewRequest("POST", urls, body)
  55516. req.Header = reqHeaders
  55517. googleapi.Expand(req.URL, map[string]string{
  55518. "project": c.project,
  55519. "zone": c.zone,
  55520. "instance": c.instance,
  55521. })
  55522. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  55523. }
  55524. // Do executes the "compute.instances.start" call.
  55525. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  55526. // status code is an error. Response headers are in either
  55527. // *Operation.ServerResponse.Header or (if a response was returned at
  55528. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  55529. // to check whether the returned error was because
  55530. // http.StatusNotModified was returned.
  55531. func (c *InstancesStartCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  55532. gensupport.SetOptions(c.urlParams_, opts...)
  55533. res, err := c.doRequest("json")
  55534. if res != nil && res.StatusCode == http.StatusNotModified {
  55535. if res.Body != nil {
  55536. res.Body.Close()
  55537. }
  55538. return nil, &googleapi.Error{
  55539. Code: res.StatusCode,
  55540. Header: res.Header,
  55541. }
  55542. }
  55543. if err != nil {
  55544. return nil, err
  55545. }
  55546. defer googleapi.CloseBody(res)
  55547. if err := googleapi.CheckResponse(res); err != nil {
  55548. return nil, err
  55549. }
  55550. ret := &Operation{
  55551. ServerResponse: googleapi.ServerResponse{
  55552. Header: res.Header,
  55553. HTTPStatusCode: res.StatusCode,
  55554. },
  55555. }
  55556. target := &ret
  55557. if err := gensupport.DecodeResponse(target, res); err != nil {
  55558. return nil, err
  55559. }
  55560. return ret, nil
  55561. // {
  55562. // "description": "Starts an instance that was stopped using the instances().stop method. For more information, see Restart an instance.",
  55563. // "httpMethod": "POST",
  55564. // "id": "compute.instances.start",
  55565. // "parameterOrder": [
  55566. // "project",
  55567. // "zone",
  55568. // "instance"
  55569. // ],
  55570. // "parameters": {
  55571. // "instance": {
  55572. // "description": "Name of the instance resource to start.",
  55573. // "location": "path",
  55574. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  55575. // "required": true,
  55576. // "type": "string"
  55577. // },
  55578. // "project": {
  55579. // "description": "Project ID for this request.",
  55580. // "location": "path",
  55581. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  55582. // "required": true,
  55583. // "type": "string"
  55584. // },
  55585. // "requestId": {
  55586. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  55587. // "location": "query",
  55588. // "type": "string"
  55589. // },
  55590. // "zone": {
  55591. // "description": "The name of the zone for this request.",
  55592. // "location": "path",
  55593. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  55594. // "required": true,
  55595. // "type": "string"
  55596. // }
  55597. // },
  55598. // "path": "{project}/zones/{zone}/instances/{instance}/start",
  55599. // "response": {
  55600. // "$ref": "Operation"
  55601. // },
  55602. // "scopes": [
  55603. // "https://www.googleapis.com/auth/cloud-platform",
  55604. // "https://www.googleapis.com/auth/compute"
  55605. // ]
  55606. // }
  55607. }
  55608. // method id "compute.instances.startWithEncryptionKey":
  55609. type InstancesStartWithEncryptionKeyCall struct {
  55610. s *Service
  55611. project string
  55612. zone string
  55613. instance string
  55614. instancesstartwithencryptionkeyrequest *InstancesStartWithEncryptionKeyRequest
  55615. urlParams_ gensupport.URLParams
  55616. ctx_ context.Context
  55617. header_ http.Header
  55618. }
  55619. // StartWithEncryptionKey: Starts an instance that was stopped using the
  55620. // instances().stop method. For more information, see Restart an
  55621. // instance.
  55622. func (r *InstancesService) StartWithEncryptionKey(project string, zone string, instance string, instancesstartwithencryptionkeyrequest *InstancesStartWithEncryptionKeyRequest) *InstancesStartWithEncryptionKeyCall {
  55623. c := &InstancesStartWithEncryptionKeyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  55624. c.project = project
  55625. c.zone = zone
  55626. c.instance = instance
  55627. c.instancesstartwithencryptionkeyrequest = instancesstartwithencryptionkeyrequest
  55628. return c
  55629. }
  55630. // RequestId sets the optional parameter "requestId": An optional
  55631. // request ID to identify requests. Specify a unique request ID so that
  55632. // if you must retry your request, the server will know to ignore the
  55633. // request if it has already been completed.
  55634. //
  55635. // For example, consider a situation where you make an initial request
  55636. // and the request times out. If you make the request again with the
  55637. // same request ID, the server can check if original operation with the
  55638. // same request ID was received, and if so, will ignore the second
  55639. // request. This prevents clients from accidentally creating duplicate
  55640. // commitments.
  55641. //
  55642. // The request ID must be a valid UUID with the exception that zero UUID
  55643. // is not supported (00000000-0000-0000-0000-000000000000).
  55644. func (c *InstancesStartWithEncryptionKeyCall) RequestId(requestId string) *InstancesStartWithEncryptionKeyCall {
  55645. c.urlParams_.Set("requestId", requestId)
  55646. return c
  55647. }
  55648. // Fields allows partial responses to be retrieved. See
  55649. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  55650. // for more information.
  55651. func (c *InstancesStartWithEncryptionKeyCall) Fields(s ...googleapi.Field) *InstancesStartWithEncryptionKeyCall {
  55652. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  55653. return c
  55654. }
  55655. // Context sets the context to be used in this call's Do method. Any
  55656. // pending HTTP request will be aborted if the provided context is
  55657. // canceled.
  55658. func (c *InstancesStartWithEncryptionKeyCall) Context(ctx context.Context) *InstancesStartWithEncryptionKeyCall {
  55659. c.ctx_ = ctx
  55660. return c
  55661. }
  55662. // Header returns an http.Header that can be modified by the caller to
  55663. // add HTTP headers to the request.
  55664. func (c *InstancesStartWithEncryptionKeyCall) Header() http.Header {
  55665. if c.header_ == nil {
  55666. c.header_ = make(http.Header)
  55667. }
  55668. return c.header_
  55669. }
  55670. func (c *InstancesStartWithEncryptionKeyCall) doRequest(alt string) (*http.Response, error) {
  55671. reqHeaders := make(http.Header)
  55672. for k, v := range c.header_ {
  55673. reqHeaders[k] = v
  55674. }
  55675. reqHeaders.Set("User-Agent", c.s.userAgent())
  55676. var body io.Reader = nil
  55677. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancesstartwithencryptionkeyrequest)
  55678. if err != nil {
  55679. return nil, err
  55680. }
  55681. reqHeaders.Set("Content-Type", "application/json")
  55682. c.urlParams_.Set("alt", alt)
  55683. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/startWithEncryptionKey")
  55684. urls += "?" + c.urlParams_.Encode()
  55685. req, _ := http.NewRequest("POST", urls, body)
  55686. req.Header = reqHeaders
  55687. googleapi.Expand(req.URL, map[string]string{
  55688. "project": c.project,
  55689. "zone": c.zone,
  55690. "instance": c.instance,
  55691. })
  55692. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  55693. }
  55694. // Do executes the "compute.instances.startWithEncryptionKey" call.
  55695. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  55696. // status code is an error. Response headers are in either
  55697. // *Operation.ServerResponse.Header or (if a response was returned at
  55698. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  55699. // to check whether the returned error was because
  55700. // http.StatusNotModified was returned.
  55701. func (c *InstancesStartWithEncryptionKeyCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  55702. gensupport.SetOptions(c.urlParams_, opts...)
  55703. res, err := c.doRequest("json")
  55704. if res != nil && res.StatusCode == http.StatusNotModified {
  55705. if res.Body != nil {
  55706. res.Body.Close()
  55707. }
  55708. return nil, &googleapi.Error{
  55709. Code: res.StatusCode,
  55710. Header: res.Header,
  55711. }
  55712. }
  55713. if err != nil {
  55714. return nil, err
  55715. }
  55716. defer googleapi.CloseBody(res)
  55717. if err := googleapi.CheckResponse(res); err != nil {
  55718. return nil, err
  55719. }
  55720. ret := &Operation{
  55721. ServerResponse: googleapi.ServerResponse{
  55722. Header: res.Header,
  55723. HTTPStatusCode: res.StatusCode,
  55724. },
  55725. }
  55726. target := &ret
  55727. if err := gensupport.DecodeResponse(target, res); err != nil {
  55728. return nil, err
  55729. }
  55730. return ret, nil
  55731. // {
  55732. // "description": "Starts an instance that was stopped using the instances().stop method. For more information, see Restart an instance.",
  55733. // "httpMethod": "POST",
  55734. // "id": "compute.instances.startWithEncryptionKey",
  55735. // "parameterOrder": [
  55736. // "project",
  55737. // "zone",
  55738. // "instance"
  55739. // ],
  55740. // "parameters": {
  55741. // "instance": {
  55742. // "description": "Name of the instance resource to start.",
  55743. // "location": "path",
  55744. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  55745. // "required": true,
  55746. // "type": "string"
  55747. // },
  55748. // "project": {
  55749. // "description": "Project ID for this request.",
  55750. // "location": "path",
  55751. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  55752. // "required": true,
  55753. // "type": "string"
  55754. // },
  55755. // "requestId": {
  55756. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  55757. // "location": "query",
  55758. // "type": "string"
  55759. // },
  55760. // "zone": {
  55761. // "description": "The name of the zone for this request.",
  55762. // "location": "path",
  55763. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  55764. // "required": true,
  55765. // "type": "string"
  55766. // }
  55767. // },
  55768. // "path": "{project}/zones/{zone}/instances/{instance}/startWithEncryptionKey",
  55769. // "request": {
  55770. // "$ref": "InstancesStartWithEncryptionKeyRequest"
  55771. // },
  55772. // "response": {
  55773. // "$ref": "Operation"
  55774. // },
  55775. // "scopes": [
  55776. // "https://www.googleapis.com/auth/cloud-platform",
  55777. // "https://www.googleapis.com/auth/compute"
  55778. // ]
  55779. // }
  55780. }
  55781. // method id "compute.instances.stop":
  55782. type InstancesStopCall struct {
  55783. s *Service
  55784. project string
  55785. zone string
  55786. instance string
  55787. urlParams_ gensupport.URLParams
  55788. ctx_ context.Context
  55789. header_ http.Header
  55790. }
  55791. // Stop: Stops a running instance, shutting it down cleanly, and allows
  55792. // you to restart the instance at a later time. Stopped instances do not
  55793. // incur VM usage charges while they are stopped. However, resources
  55794. // that the VM is using, such as persistent disks and static IP
  55795. // addresses, will continue to be charged until they are deleted. For
  55796. // more information, see Stopping an instance.
  55797. // For details, see https://cloud.google.com/compute/docs/reference/latest/instances/stop
  55798. func (r *InstancesService) Stop(project string, zone string, instance string) *InstancesStopCall {
  55799. c := &InstancesStopCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  55800. c.project = project
  55801. c.zone = zone
  55802. c.instance = instance
  55803. return c
  55804. }
  55805. // RequestId sets the optional parameter "requestId": An optional
  55806. // request ID to identify requests. Specify a unique request ID so that
  55807. // if you must retry your request, the server will know to ignore the
  55808. // request if it has already been completed.
  55809. //
  55810. // For example, consider a situation where you make an initial request
  55811. // and the request times out. If you make the request again with the
  55812. // same request ID, the server can check if original operation with the
  55813. // same request ID was received, and if so, will ignore the second
  55814. // request. This prevents clients from accidentally creating duplicate
  55815. // commitments.
  55816. //
  55817. // The request ID must be a valid UUID with the exception that zero UUID
  55818. // is not supported (00000000-0000-0000-0000-000000000000).
  55819. func (c *InstancesStopCall) RequestId(requestId string) *InstancesStopCall {
  55820. c.urlParams_.Set("requestId", requestId)
  55821. return c
  55822. }
  55823. // Fields allows partial responses to be retrieved. See
  55824. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  55825. // for more information.
  55826. func (c *InstancesStopCall) Fields(s ...googleapi.Field) *InstancesStopCall {
  55827. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  55828. return c
  55829. }
  55830. // Context sets the context to be used in this call's Do method. Any
  55831. // pending HTTP request will be aborted if the provided context is
  55832. // canceled.
  55833. func (c *InstancesStopCall) Context(ctx context.Context) *InstancesStopCall {
  55834. c.ctx_ = ctx
  55835. return c
  55836. }
  55837. // Header returns an http.Header that can be modified by the caller to
  55838. // add HTTP headers to the request.
  55839. func (c *InstancesStopCall) Header() http.Header {
  55840. if c.header_ == nil {
  55841. c.header_ = make(http.Header)
  55842. }
  55843. return c.header_
  55844. }
  55845. func (c *InstancesStopCall) doRequest(alt string) (*http.Response, error) {
  55846. reqHeaders := make(http.Header)
  55847. for k, v := range c.header_ {
  55848. reqHeaders[k] = v
  55849. }
  55850. reqHeaders.Set("User-Agent", c.s.userAgent())
  55851. var body io.Reader = nil
  55852. c.urlParams_.Set("alt", alt)
  55853. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/stop")
  55854. urls += "?" + c.urlParams_.Encode()
  55855. req, _ := http.NewRequest("POST", urls, body)
  55856. req.Header = reqHeaders
  55857. googleapi.Expand(req.URL, map[string]string{
  55858. "project": c.project,
  55859. "zone": c.zone,
  55860. "instance": c.instance,
  55861. })
  55862. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  55863. }
  55864. // Do executes the "compute.instances.stop" call.
  55865. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  55866. // status code is an error. Response headers are in either
  55867. // *Operation.ServerResponse.Header or (if a response was returned at
  55868. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  55869. // to check whether the returned error was because
  55870. // http.StatusNotModified was returned.
  55871. func (c *InstancesStopCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  55872. gensupport.SetOptions(c.urlParams_, opts...)
  55873. res, err := c.doRequest("json")
  55874. if res != nil && res.StatusCode == http.StatusNotModified {
  55875. if res.Body != nil {
  55876. res.Body.Close()
  55877. }
  55878. return nil, &googleapi.Error{
  55879. Code: res.StatusCode,
  55880. Header: res.Header,
  55881. }
  55882. }
  55883. if err != nil {
  55884. return nil, err
  55885. }
  55886. defer googleapi.CloseBody(res)
  55887. if err := googleapi.CheckResponse(res); err != nil {
  55888. return nil, err
  55889. }
  55890. ret := &Operation{
  55891. ServerResponse: googleapi.ServerResponse{
  55892. Header: res.Header,
  55893. HTTPStatusCode: res.StatusCode,
  55894. },
  55895. }
  55896. target := &ret
  55897. if err := gensupport.DecodeResponse(target, res); err != nil {
  55898. return nil, err
  55899. }
  55900. return ret, nil
  55901. // {
  55902. // "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.",
  55903. // "httpMethod": "POST",
  55904. // "id": "compute.instances.stop",
  55905. // "parameterOrder": [
  55906. // "project",
  55907. // "zone",
  55908. // "instance"
  55909. // ],
  55910. // "parameters": {
  55911. // "instance": {
  55912. // "description": "Name of the instance resource to stop.",
  55913. // "location": "path",
  55914. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  55915. // "required": true,
  55916. // "type": "string"
  55917. // },
  55918. // "project": {
  55919. // "description": "Project ID for this request.",
  55920. // "location": "path",
  55921. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  55922. // "required": true,
  55923. // "type": "string"
  55924. // },
  55925. // "requestId": {
  55926. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  55927. // "location": "query",
  55928. // "type": "string"
  55929. // },
  55930. // "zone": {
  55931. // "description": "The name of the zone for this request.",
  55932. // "location": "path",
  55933. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  55934. // "required": true,
  55935. // "type": "string"
  55936. // }
  55937. // },
  55938. // "path": "{project}/zones/{zone}/instances/{instance}/stop",
  55939. // "response": {
  55940. // "$ref": "Operation"
  55941. // },
  55942. // "scopes": [
  55943. // "https://www.googleapis.com/auth/cloud-platform",
  55944. // "https://www.googleapis.com/auth/compute"
  55945. // ]
  55946. // }
  55947. }
  55948. // method id "compute.instances.testIamPermissions":
  55949. type InstancesTestIamPermissionsCall struct {
  55950. s *Service
  55951. project string
  55952. zone string
  55953. resource string
  55954. testpermissionsrequest *TestPermissionsRequest
  55955. urlParams_ gensupport.URLParams
  55956. ctx_ context.Context
  55957. header_ http.Header
  55958. }
  55959. // TestIamPermissions: Returns permissions that a caller has on the
  55960. // specified resource.
  55961. func (r *InstancesService) TestIamPermissions(project string, zone string, resource string, testpermissionsrequest *TestPermissionsRequest) *InstancesTestIamPermissionsCall {
  55962. c := &InstancesTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  55963. c.project = project
  55964. c.zone = zone
  55965. c.resource = resource
  55966. c.testpermissionsrequest = testpermissionsrequest
  55967. return c
  55968. }
  55969. // Fields allows partial responses to be retrieved. See
  55970. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  55971. // for more information.
  55972. func (c *InstancesTestIamPermissionsCall) Fields(s ...googleapi.Field) *InstancesTestIamPermissionsCall {
  55973. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  55974. return c
  55975. }
  55976. // Context sets the context to be used in this call's Do method. Any
  55977. // pending HTTP request will be aborted if the provided context is
  55978. // canceled.
  55979. func (c *InstancesTestIamPermissionsCall) Context(ctx context.Context) *InstancesTestIamPermissionsCall {
  55980. c.ctx_ = ctx
  55981. return c
  55982. }
  55983. // Header returns an http.Header that can be modified by the caller to
  55984. // add HTTP headers to the request.
  55985. func (c *InstancesTestIamPermissionsCall) Header() http.Header {
  55986. if c.header_ == nil {
  55987. c.header_ = make(http.Header)
  55988. }
  55989. return c.header_
  55990. }
  55991. func (c *InstancesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  55992. reqHeaders := make(http.Header)
  55993. for k, v := range c.header_ {
  55994. reqHeaders[k] = v
  55995. }
  55996. reqHeaders.Set("User-Agent", c.s.userAgent())
  55997. var body io.Reader = nil
  55998. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  55999. if err != nil {
  56000. return nil, err
  56001. }
  56002. reqHeaders.Set("Content-Type", "application/json")
  56003. c.urlParams_.Set("alt", alt)
  56004. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{resource}/testIamPermissions")
  56005. urls += "?" + c.urlParams_.Encode()
  56006. req, _ := http.NewRequest("POST", urls, body)
  56007. req.Header = reqHeaders
  56008. googleapi.Expand(req.URL, map[string]string{
  56009. "project": c.project,
  56010. "zone": c.zone,
  56011. "resource": c.resource,
  56012. })
  56013. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  56014. }
  56015. // Do executes the "compute.instances.testIamPermissions" call.
  56016. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  56017. // non-2xx status code is an error. Response headers are in either
  56018. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  56019. // returned at all) in error.(*googleapi.Error).Header. Use
  56020. // googleapi.IsNotModified to check whether the returned error was
  56021. // because http.StatusNotModified was returned.
  56022. func (c *InstancesTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  56023. gensupport.SetOptions(c.urlParams_, opts...)
  56024. res, err := c.doRequest("json")
  56025. if res != nil && res.StatusCode == http.StatusNotModified {
  56026. if res.Body != nil {
  56027. res.Body.Close()
  56028. }
  56029. return nil, &googleapi.Error{
  56030. Code: res.StatusCode,
  56031. Header: res.Header,
  56032. }
  56033. }
  56034. if err != nil {
  56035. return nil, err
  56036. }
  56037. defer googleapi.CloseBody(res)
  56038. if err := googleapi.CheckResponse(res); err != nil {
  56039. return nil, err
  56040. }
  56041. ret := &TestPermissionsResponse{
  56042. ServerResponse: googleapi.ServerResponse{
  56043. Header: res.Header,
  56044. HTTPStatusCode: res.StatusCode,
  56045. },
  56046. }
  56047. target := &ret
  56048. if err := gensupport.DecodeResponse(target, res); err != nil {
  56049. return nil, err
  56050. }
  56051. return ret, nil
  56052. // {
  56053. // "description": "Returns permissions that a caller has on the specified resource.",
  56054. // "httpMethod": "POST",
  56055. // "id": "compute.instances.testIamPermissions",
  56056. // "parameterOrder": [
  56057. // "project",
  56058. // "zone",
  56059. // "resource"
  56060. // ],
  56061. // "parameters": {
  56062. // "project": {
  56063. // "description": "Project ID for this request.",
  56064. // "location": "path",
  56065. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  56066. // "required": true,
  56067. // "type": "string"
  56068. // },
  56069. // "resource": {
  56070. // "description": "Name of the resource for this request.",
  56071. // "location": "path",
  56072. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  56073. // "required": true,
  56074. // "type": "string"
  56075. // },
  56076. // "zone": {
  56077. // "description": "The name of the zone for this request.",
  56078. // "location": "path",
  56079. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  56080. // "required": true,
  56081. // "type": "string"
  56082. // }
  56083. // },
  56084. // "path": "{project}/zones/{zone}/instances/{resource}/testIamPermissions",
  56085. // "request": {
  56086. // "$ref": "TestPermissionsRequest"
  56087. // },
  56088. // "response": {
  56089. // "$ref": "TestPermissionsResponse"
  56090. // },
  56091. // "scopes": [
  56092. // "https://www.googleapis.com/auth/cloud-platform",
  56093. // "https://www.googleapis.com/auth/compute",
  56094. // "https://www.googleapis.com/auth/compute.readonly"
  56095. // ]
  56096. // }
  56097. }
  56098. // method id "compute.instances.updateAccessConfig":
  56099. type InstancesUpdateAccessConfigCall struct {
  56100. s *Service
  56101. project string
  56102. zone string
  56103. instance string
  56104. accessconfig *AccessConfig
  56105. urlParams_ gensupport.URLParams
  56106. ctx_ context.Context
  56107. header_ http.Header
  56108. }
  56109. // UpdateAccessConfig: Updates the specified access config from an
  56110. // instance's network interface with the data included in the request.
  56111. // This method supports PATCH semantics and uses the JSON merge patch
  56112. // format and processing rules.
  56113. func (r *InstancesService) UpdateAccessConfig(project string, zone string, instance string, networkInterface string, accessconfig *AccessConfig) *InstancesUpdateAccessConfigCall {
  56114. c := &InstancesUpdateAccessConfigCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  56115. c.project = project
  56116. c.zone = zone
  56117. c.instance = instance
  56118. c.urlParams_.Set("networkInterface", networkInterface)
  56119. c.accessconfig = accessconfig
  56120. return c
  56121. }
  56122. // RequestId sets the optional parameter "requestId": An optional
  56123. // request ID to identify requests. Specify a unique request ID so that
  56124. // if you must retry your request, the server will know to ignore the
  56125. // request if it has already been completed.
  56126. //
  56127. // For example, consider a situation where you make an initial request
  56128. // and the request times out. If you make the request again with the
  56129. // same request ID, the server can check if original operation with the
  56130. // same request ID was received, and if so, will ignore the second
  56131. // request. This prevents clients from accidentally creating duplicate
  56132. // commitments.
  56133. //
  56134. // The request ID must be a valid UUID with the exception that zero UUID
  56135. // is not supported (00000000-0000-0000-0000-000000000000).
  56136. func (c *InstancesUpdateAccessConfigCall) RequestId(requestId string) *InstancesUpdateAccessConfigCall {
  56137. c.urlParams_.Set("requestId", requestId)
  56138. return c
  56139. }
  56140. // Fields allows partial responses to be retrieved. See
  56141. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  56142. // for more information.
  56143. func (c *InstancesUpdateAccessConfigCall) Fields(s ...googleapi.Field) *InstancesUpdateAccessConfigCall {
  56144. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  56145. return c
  56146. }
  56147. // Context sets the context to be used in this call's Do method. Any
  56148. // pending HTTP request will be aborted if the provided context is
  56149. // canceled.
  56150. func (c *InstancesUpdateAccessConfigCall) Context(ctx context.Context) *InstancesUpdateAccessConfigCall {
  56151. c.ctx_ = ctx
  56152. return c
  56153. }
  56154. // Header returns an http.Header that can be modified by the caller to
  56155. // add HTTP headers to the request.
  56156. func (c *InstancesUpdateAccessConfigCall) Header() http.Header {
  56157. if c.header_ == nil {
  56158. c.header_ = make(http.Header)
  56159. }
  56160. return c.header_
  56161. }
  56162. func (c *InstancesUpdateAccessConfigCall) doRequest(alt string) (*http.Response, error) {
  56163. reqHeaders := make(http.Header)
  56164. for k, v := range c.header_ {
  56165. reqHeaders[k] = v
  56166. }
  56167. reqHeaders.Set("User-Agent", c.s.userAgent())
  56168. var body io.Reader = nil
  56169. body, err := googleapi.WithoutDataWrapper.JSONReader(c.accessconfig)
  56170. if err != nil {
  56171. return nil, err
  56172. }
  56173. reqHeaders.Set("Content-Type", "application/json")
  56174. c.urlParams_.Set("alt", alt)
  56175. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/updateAccessConfig")
  56176. urls += "?" + c.urlParams_.Encode()
  56177. req, _ := http.NewRequest("POST", urls, body)
  56178. req.Header = reqHeaders
  56179. googleapi.Expand(req.URL, map[string]string{
  56180. "project": c.project,
  56181. "zone": c.zone,
  56182. "instance": c.instance,
  56183. })
  56184. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  56185. }
  56186. // Do executes the "compute.instances.updateAccessConfig" call.
  56187. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  56188. // status code is an error. Response headers are in either
  56189. // *Operation.ServerResponse.Header or (if a response was returned at
  56190. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  56191. // to check whether the returned error was because
  56192. // http.StatusNotModified was returned.
  56193. func (c *InstancesUpdateAccessConfigCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  56194. gensupport.SetOptions(c.urlParams_, opts...)
  56195. res, err := c.doRequest("json")
  56196. if res != nil && res.StatusCode == http.StatusNotModified {
  56197. if res.Body != nil {
  56198. res.Body.Close()
  56199. }
  56200. return nil, &googleapi.Error{
  56201. Code: res.StatusCode,
  56202. Header: res.Header,
  56203. }
  56204. }
  56205. if err != nil {
  56206. return nil, err
  56207. }
  56208. defer googleapi.CloseBody(res)
  56209. if err := googleapi.CheckResponse(res); err != nil {
  56210. return nil, err
  56211. }
  56212. ret := &Operation{
  56213. ServerResponse: googleapi.ServerResponse{
  56214. Header: res.Header,
  56215. HTTPStatusCode: res.StatusCode,
  56216. },
  56217. }
  56218. target := &ret
  56219. if err := gensupport.DecodeResponse(target, res); err != nil {
  56220. return nil, err
  56221. }
  56222. return ret, nil
  56223. // {
  56224. // "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.",
  56225. // "httpMethod": "POST",
  56226. // "id": "compute.instances.updateAccessConfig",
  56227. // "parameterOrder": [
  56228. // "project",
  56229. // "zone",
  56230. // "instance",
  56231. // "networkInterface"
  56232. // ],
  56233. // "parameters": {
  56234. // "instance": {
  56235. // "description": "The instance name for this request.",
  56236. // "location": "path",
  56237. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  56238. // "required": true,
  56239. // "type": "string"
  56240. // },
  56241. // "networkInterface": {
  56242. // "description": "The name of the network interface where the access config is attached.",
  56243. // "location": "query",
  56244. // "required": true,
  56245. // "type": "string"
  56246. // },
  56247. // "project": {
  56248. // "description": "Project ID for this request.",
  56249. // "location": "path",
  56250. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  56251. // "required": true,
  56252. // "type": "string"
  56253. // },
  56254. // "requestId": {
  56255. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  56256. // "location": "query",
  56257. // "type": "string"
  56258. // },
  56259. // "zone": {
  56260. // "description": "The name of the zone for this request.",
  56261. // "location": "path",
  56262. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  56263. // "required": true,
  56264. // "type": "string"
  56265. // }
  56266. // },
  56267. // "path": "{project}/zones/{zone}/instances/{instance}/updateAccessConfig",
  56268. // "request": {
  56269. // "$ref": "AccessConfig"
  56270. // },
  56271. // "response": {
  56272. // "$ref": "Operation"
  56273. // },
  56274. // "scopes": [
  56275. // "https://www.googleapis.com/auth/cloud-platform",
  56276. // "https://www.googleapis.com/auth/compute"
  56277. // ]
  56278. // }
  56279. }
  56280. // method id "compute.instances.updateNetworkInterface":
  56281. type InstancesUpdateNetworkInterfaceCall struct {
  56282. s *Service
  56283. project string
  56284. zone string
  56285. instance string
  56286. networkinterface *NetworkInterface
  56287. urlParams_ gensupport.URLParams
  56288. ctx_ context.Context
  56289. header_ http.Header
  56290. }
  56291. // UpdateNetworkInterface: Updates an instance's network interface. This
  56292. // method follows PATCH semantics.
  56293. func (r *InstancesService) UpdateNetworkInterface(project string, zone string, instance string, networkInterface string, networkinterface *NetworkInterface) *InstancesUpdateNetworkInterfaceCall {
  56294. c := &InstancesUpdateNetworkInterfaceCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  56295. c.project = project
  56296. c.zone = zone
  56297. c.instance = instance
  56298. c.urlParams_.Set("networkInterface", networkInterface)
  56299. c.networkinterface = networkinterface
  56300. return c
  56301. }
  56302. // RequestId sets the optional parameter "requestId": An optional
  56303. // request ID to identify requests. Specify a unique request ID so that
  56304. // if you must retry your request, the server will know to ignore the
  56305. // request if it has already been completed.
  56306. //
  56307. // For example, consider a situation where you make an initial request
  56308. // and the request times out. If you make the request again with the
  56309. // same request ID, the server can check if original operation with the
  56310. // same request ID was received, and if so, will ignore the second
  56311. // request. This prevents clients from accidentally creating duplicate
  56312. // commitments.
  56313. //
  56314. // The request ID must be a valid UUID with the exception that zero UUID
  56315. // is not supported (00000000-0000-0000-0000-000000000000).
  56316. func (c *InstancesUpdateNetworkInterfaceCall) RequestId(requestId string) *InstancesUpdateNetworkInterfaceCall {
  56317. c.urlParams_.Set("requestId", requestId)
  56318. return c
  56319. }
  56320. // Fields allows partial responses to be retrieved. See
  56321. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  56322. // for more information.
  56323. func (c *InstancesUpdateNetworkInterfaceCall) Fields(s ...googleapi.Field) *InstancesUpdateNetworkInterfaceCall {
  56324. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  56325. return c
  56326. }
  56327. // Context sets the context to be used in this call's Do method. Any
  56328. // pending HTTP request will be aborted if the provided context is
  56329. // canceled.
  56330. func (c *InstancesUpdateNetworkInterfaceCall) Context(ctx context.Context) *InstancesUpdateNetworkInterfaceCall {
  56331. c.ctx_ = ctx
  56332. return c
  56333. }
  56334. // Header returns an http.Header that can be modified by the caller to
  56335. // add HTTP headers to the request.
  56336. func (c *InstancesUpdateNetworkInterfaceCall) Header() http.Header {
  56337. if c.header_ == nil {
  56338. c.header_ = make(http.Header)
  56339. }
  56340. return c.header_
  56341. }
  56342. func (c *InstancesUpdateNetworkInterfaceCall) doRequest(alt string) (*http.Response, error) {
  56343. reqHeaders := make(http.Header)
  56344. for k, v := range c.header_ {
  56345. reqHeaders[k] = v
  56346. }
  56347. reqHeaders.Set("User-Agent", c.s.userAgent())
  56348. var body io.Reader = nil
  56349. body, err := googleapi.WithoutDataWrapper.JSONReader(c.networkinterface)
  56350. if err != nil {
  56351. return nil, err
  56352. }
  56353. reqHeaders.Set("Content-Type", "application/json")
  56354. c.urlParams_.Set("alt", alt)
  56355. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/updateNetworkInterface")
  56356. urls += "?" + c.urlParams_.Encode()
  56357. req, _ := http.NewRequest("PATCH", urls, body)
  56358. req.Header = reqHeaders
  56359. googleapi.Expand(req.URL, map[string]string{
  56360. "project": c.project,
  56361. "zone": c.zone,
  56362. "instance": c.instance,
  56363. })
  56364. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  56365. }
  56366. // Do executes the "compute.instances.updateNetworkInterface" call.
  56367. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  56368. // status code is an error. Response headers are in either
  56369. // *Operation.ServerResponse.Header or (if a response was returned at
  56370. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  56371. // to check whether the returned error was because
  56372. // http.StatusNotModified was returned.
  56373. func (c *InstancesUpdateNetworkInterfaceCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  56374. gensupport.SetOptions(c.urlParams_, opts...)
  56375. res, err := c.doRequest("json")
  56376. if res != nil && res.StatusCode == http.StatusNotModified {
  56377. if res.Body != nil {
  56378. res.Body.Close()
  56379. }
  56380. return nil, &googleapi.Error{
  56381. Code: res.StatusCode,
  56382. Header: res.Header,
  56383. }
  56384. }
  56385. if err != nil {
  56386. return nil, err
  56387. }
  56388. defer googleapi.CloseBody(res)
  56389. if err := googleapi.CheckResponse(res); err != nil {
  56390. return nil, err
  56391. }
  56392. ret := &Operation{
  56393. ServerResponse: googleapi.ServerResponse{
  56394. Header: res.Header,
  56395. HTTPStatusCode: res.StatusCode,
  56396. },
  56397. }
  56398. target := &ret
  56399. if err := gensupport.DecodeResponse(target, res); err != nil {
  56400. return nil, err
  56401. }
  56402. return ret, nil
  56403. // {
  56404. // "description": "Updates an instance's network interface. This method follows PATCH semantics.",
  56405. // "httpMethod": "PATCH",
  56406. // "id": "compute.instances.updateNetworkInterface",
  56407. // "parameterOrder": [
  56408. // "project",
  56409. // "zone",
  56410. // "instance",
  56411. // "networkInterface"
  56412. // ],
  56413. // "parameters": {
  56414. // "instance": {
  56415. // "description": "The instance name for this request.",
  56416. // "location": "path",
  56417. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  56418. // "required": true,
  56419. // "type": "string"
  56420. // },
  56421. // "networkInterface": {
  56422. // "description": "The name of the network interface to update.",
  56423. // "location": "query",
  56424. // "required": true,
  56425. // "type": "string"
  56426. // },
  56427. // "project": {
  56428. // "description": "Project ID for this request.",
  56429. // "location": "path",
  56430. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  56431. // "required": true,
  56432. // "type": "string"
  56433. // },
  56434. // "requestId": {
  56435. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  56436. // "location": "query",
  56437. // "type": "string"
  56438. // },
  56439. // "zone": {
  56440. // "description": "The name of the zone for this request.",
  56441. // "location": "path",
  56442. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  56443. // "required": true,
  56444. // "type": "string"
  56445. // }
  56446. // },
  56447. // "path": "{project}/zones/{zone}/instances/{instance}/updateNetworkInterface",
  56448. // "request": {
  56449. // "$ref": "NetworkInterface"
  56450. // },
  56451. // "response": {
  56452. // "$ref": "Operation"
  56453. // },
  56454. // "scopes": [
  56455. // "https://www.googleapis.com/auth/cloud-platform",
  56456. // "https://www.googleapis.com/auth/compute"
  56457. // ]
  56458. // }
  56459. }
  56460. // method id "compute.instances.updateShieldedVmConfig":
  56461. type InstancesUpdateShieldedVmConfigCall struct {
  56462. s *Service
  56463. project string
  56464. zone string
  56465. instance string
  56466. shieldedvmconfig *ShieldedVmConfig
  56467. urlParams_ gensupport.URLParams
  56468. ctx_ context.Context
  56469. header_ http.Header
  56470. }
  56471. // UpdateShieldedVmConfig: Updates the Shielded VM config for an
  56472. // instance. This method supports PATCH semantics and uses the JSON
  56473. // merge patch format and processing rules.
  56474. func (r *InstancesService) UpdateShieldedVmConfig(project string, zone string, instance string, shieldedvmconfig *ShieldedVmConfig) *InstancesUpdateShieldedVmConfigCall {
  56475. c := &InstancesUpdateShieldedVmConfigCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  56476. c.project = project
  56477. c.zone = zone
  56478. c.instance = instance
  56479. c.shieldedvmconfig = shieldedvmconfig
  56480. return c
  56481. }
  56482. // RequestId sets the optional parameter "requestId": An optional
  56483. // request ID to identify requests. Specify a unique request ID so that
  56484. // if you must retry your request, the server will know to ignore the
  56485. // request if it has already been completed.
  56486. //
  56487. // For example, consider a situation where you make an initial request
  56488. // and the request times out. If you make the request again with the
  56489. // same request ID, the server can check if original operation with the
  56490. // same request ID was received, and if so, will ignore the second
  56491. // request. This prevents clients from accidentally creating duplicate
  56492. // commitments.
  56493. //
  56494. // The request ID must be a valid UUID with the exception that zero UUID
  56495. // is not supported (00000000-0000-0000-0000-000000000000).
  56496. func (c *InstancesUpdateShieldedVmConfigCall) RequestId(requestId string) *InstancesUpdateShieldedVmConfigCall {
  56497. c.urlParams_.Set("requestId", requestId)
  56498. return c
  56499. }
  56500. // Fields allows partial responses to be retrieved. See
  56501. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  56502. // for more information.
  56503. func (c *InstancesUpdateShieldedVmConfigCall) Fields(s ...googleapi.Field) *InstancesUpdateShieldedVmConfigCall {
  56504. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  56505. return c
  56506. }
  56507. // Context sets the context to be used in this call's Do method. Any
  56508. // pending HTTP request will be aborted if the provided context is
  56509. // canceled.
  56510. func (c *InstancesUpdateShieldedVmConfigCall) Context(ctx context.Context) *InstancesUpdateShieldedVmConfigCall {
  56511. c.ctx_ = ctx
  56512. return c
  56513. }
  56514. // Header returns an http.Header that can be modified by the caller to
  56515. // add HTTP headers to the request.
  56516. func (c *InstancesUpdateShieldedVmConfigCall) Header() http.Header {
  56517. if c.header_ == nil {
  56518. c.header_ = make(http.Header)
  56519. }
  56520. return c.header_
  56521. }
  56522. func (c *InstancesUpdateShieldedVmConfigCall) doRequest(alt string) (*http.Response, error) {
  56523. reqHeaders := make(http.Header)
  56524. for k, v := range c.header_ {
  56525. reqHeaders[k] = v
  56526. }
  56527. reqHeaders.Set("User-Agent", c.s.userAgent())
  56528. var body io.Reader = nil
  56529. body, err := googleapi.WithoutDataWrapper.JSONReader(c.shieldedvmconfig)
  56530. if err != nil {
  56531. return nil, err
  56532. }
  56533. reqHeaders.Set("Content-Type", "application/json")
  56534. c.urlParams_.Set("alt", alt)
  56535. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/updateShieldedVmConfig")
  56536. urls += "?" + c.urlParams_.Encode()
  56537. req, _ := http.NewRequest("PATCH", urls, body)
  56538. req.Header = reqHeaders
  56539. googleapi.Expand(req.URL, map[string]string{
  56540. "project": c.project,
  56541. "zone": c.zone,
  56542. "instance": c.instance,
  56543. })
  56544. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  56545. }
  56546. // Do executes the "compute.instances.updateShieldedVmConfig" call.
  56547. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  56548. // status code is an error. Response headers are in either
  56549. // *Operation.ServerResponse.Header or (if a response was returned at
  56550. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  56551. // to check whether the returned error was because
  56552. // http.StatusNotModified was returned.
  56553. func (c *InstancesUpdateShieldedVmConfigCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  56554. gensupport.SetOptions(c.urlParams_, opts...)
  56555. res, err := c.doRequest("json")
  56556. if res != nil && res.StatusCode == http.StatusNotModified {
  56557. if res.Body != nil {
  56558. res.Body.Close()
  56559. }
  56560. return nil, &googleapi.Error{
  56561. Code: res.StatusCode,
  56562. Header: res.Header,
  56563. }
  56564. }
  56565. if err != nil {
  56566. return nil, err
  56567. }
  56568. defer googleapi.CloseBody(res)
  56569. if err := googleapi.CheckResponse(res); err != nil {
  56570. return nil, err
  56571. }
  56572. ret := &Operation{
  56573. ServerResponse: googleapi.ServerResponse{
  56574. Header: res.Header,
  56575. HTTPStatusCode: res.StatusCode,
  56576. },
  56577. }
  56578. target := &ret
  56579. if err := gensupport.DecodeResponse(target, res); err != nil {
  56580. return nil, err
  56581. }
  56582. return ret, nil
  56583. // {
  56584. // "description": "Updates the Shielded VM config for an instance. This method supports PATCH semantics and uses the JSON merge patch format and processing rules.",
  56585. // "httpMethod": "PATCH",
  56586. // "id": "compute.instances.updateShieldedVmConfig",
  56587. // "parameterOrder": [
  56588. // "project",
  56589. // "zone",
  56590. // "instance"
  56591. // ],
  56592. // "parameters": {
  56593. // "instance": {
  56594. // "description": "Name of the instance scoping this request.",
  56595. // "location": "path",
  56596. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  56597. // "required": true,
  56598. // "type": "string"
  56599. // },
  56600. // "project": {
  56601. // "description": "Project ID for this request.",
  56602. // "location": "path",
  56603. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  56604. // "required": true,
  56605. // "type": "string"
  56606. // },
  56607. // "requestId": {
  56608. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  56609. // "location": "query",
  56610. // "type": "string"
  56611. // },
  56612. // "zone": {
  56613. // "description": "The name of the zone for this request.",
  56614. // "location": "path",
  56615. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  56616. // "required": true,
  56617. // "type": "string"
  56618. // }
  56619. // },
  56620. // "path": "{project}/zones/{zone}/instances/{instance}/updateShieldedVmConfig",
  56621. // "request": {
  56622. // "$ref": "ShieldedVmConfig"
  56623. // },
  56624. // "response": {
  56625. // "$ref": "Operation"
  56626. // },
  56627. // "scopes": [
  56628. // "https://www.googleapis.com/auth/cloud-platform",
  56629. // "https://www.googleapis.com/auth/compute"
  56630. // ]
  56631. // }
  56632. }
  56633. // method id "compute.interconnectAttachments.aggregatedList":
  56634. type InterconnectAttachmentsAggregatedListCall struct {
  56635. s *Service
  56636. project string
  56637. urlParams_ gensupport.URLParams
  56638. ifNoneMatch_ string
  56639. ctx_ context.Context
  56640. header_ http.Header
  56641. }
  56642. // AggregatedList: Retrieves an aggregated list of interconnect
  56643. // attachments.
  56644. func (r *InterconnectAttachmentsService) AggregatedList(project string) *InterconnectAttachmentsAggregatedListCall {
  56645. c := &InterconnectAttachmentsAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  56646. c.project = project
  56647. return c
  56648. }
  56649. // Filter sets the optional parameter "filter": A filter expression that
  56650. // filters resources listed in the response. The expression must specify
  56651. // the field name, a comparison operator, and the value that you want to
  56652. // use for filtering. The value must be a string, a number, or a
  56653. // boolean. The comparison operator must be either =, !=, >, or <.
  56654. //
  56655. // For example, if you are filtering Compute Engine instances, you can
  56656. // exclude instances named example-instance by specifying name !=
  56657. // example-instance.
  56658. //
  56659. // You can also filter nested fields. For example, you could specify
  56660. // scheduling.automaticRestart = false to include instances only if they
  56661. // are not scheduled for automatic restarts. You can use filtering on
  56662. // nested fields to filter based on resource labels.
  56663. //
  56664. // To filter on multiple expressions, provide each separate expression
  56665. // within parentheses. For example, (scheduling.automaticRestart = true)
  56666. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  56667. // AND expression. However, you can include AND and OR expressions
  56668. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  56669. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  56670. // true).
  56671. func (c *InterconnectAttachmentsAggregatedListCall) Filter(filter string) *InterconnectAttachmentsAggregatedListCall {
  56672. c.urlParams_.Set("filter", filter)
  56673. return c
  56674. }
  56675. // MaxResults sets the optional parameter "maxResults": The maximum
  56676. // number of results per page that should be returned. If the number of
  56677. // available results is larger than maxResults, Compute Engine returns a
  56678. // nextPageToken that can be used to get the next page of results in
  56679. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  56680. // (Default: 500)
  56681. func (c *InterconnectAttachmentsAggregatedListCall) MaxResults(maxResults int64) *InterconnectAttachmentsAggregatedListCall {
  56682. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  56683. return c
  56684. }
  56685. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  56686. // a certain order. By default, results are returned in alphanumerical
  56687. // order based on the resource name.
  56688. //
  56689. // You can also sort results in descending order based on the creation
  56690. // timestamp using orderBy="creationTimestamp desc". This sorts results
  56691. // based on the creationTimestamp field in reverse chronological order
  56692. // (newest result first). Use this to sort resources like operations so
  56693. // that the newest operation is returned first.
  56694. //
  56695. // Currently, only sorting by name or creationTimestamp desc is
  56696. // supported.
  56697. func (c *InterconnectAttachmentsAggregatedListCall) OrderBy(orderBy string) *InterconnectAttachmentsAggregatedListCall {
  56698. c.urlParams_.Set("orderBy", orderBy)
  56699. return c
  56700. }
  56701. // PageToken sets the optional parameter "pageToken": Specifies a page
  56702. // token to use. Set pageToken to the nextPageToken returned by a
  56703. // previous list request to get the next page of results.
  56704. func (c *InterconnectAttachmentsAggregatedListCall) PageToken(pageToken string) *InterconnectAttachmentsAggregatedListCall {
  56705. c.urlParams_.Set("pageToken", pageToken)
  56706. return c
  56707. }
  56708. // Fields allows partial responses to be retrieved. See
  56709. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  56710. // for more information.
  56711. func (c *InterconnectAttachmentsAggregatedListCall) Fields(s ...googleapi.Field) *InterconnectAttachmentsAggregatedListCall {
  56712. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  56713. return c
  56714. }
  56715. // IfNoneMatch sets the optional parameter which makes the operation
  56716. // fail if the object's ETag matches the given value. This is useful for
  56717. // getting updates only after the object has changed since the last
  56718. // request. Use googleapi.IsNotModified to check whether the response
  56719. // error from Do is the result of In-None-Match.
  56720. func (c *InterconnectAttachmentsAggregatedListCall) IfNoneMatch(entityTag string) *InterconnectAttachmentsAggregatedListCall {
  56721. c.ifNoneMatch_ = entityTag
  56722. return c
  56723. }
  56724. // Context sets the context to be used in this call's Do method. Any
  56725. // pending HTTP request will be aborted if the provided context is
  56726. // canceled.
  56727. func (c *InterconnectAttachmentsAggregatedListCall) Context(ctx context.Context) *InterconnectAttachmentsAggregatedListCall {
  56728. c.ctx_ = ctx
  56729. return c
  56730. }
  56731. // Header returns an http.Header that can be modified by the caller to
  56732. // add HTTP headers to the request.
  56733. func (c *InterconnectAttachmentsAggregatedListCall) Header() http.Header {
  56734. if c.header_ == nil {
  56735. c.header_ = make(http.Header)
  56736. }
  56737. return c.header_
  56738. }
  56739. func (c *InterconnectAttachmentsAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  56740. reqHeaders := make(http.Header)
  56741. for k, v := range c.header_ {
  56742. reqHeaders[k] = v
  56743. }
  56744. reqHeaders.Set("User-Agent", c.s.userAgent())
  56745. if c.ifNoneMatch_ != "" {
  56746. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  56747. }
  56748. var body io.Reader = nil
  56749. c.urlParams_.Set("alt", alt)
  56750. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/interconnectAttachments")
  56751. urls += "?" + c.urlParams_.Encode()
  56752. req, _ := http.NewRequest("GET", urls, body)
  56753. req.Header = reqHeaders
  56754. googleapi.Expand(req.URL, map[string]string{
  56755. "project": c.project,
  56756. })
  56757. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  56758. }
  56759. // Do executes the "compute.interconnectAttachments.aggregatedList" call.
  56760. // Exactly one of *InterconnectAttachmentAggregatedList or error will be
  56761. // non-nil. Any non-2xx status code is an error. Response headers are in
  56762. // either *InterconnectAttachmentAggregatedList.ServerResponse.Header or
  56763. // (if a response was returned at all) in
  56764. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  56765. // whether the returned error was because http.StatusNotModified was
  56766. // returned.
  56767. func (c *InterconnectAttachmentsAggregatedListCall) Do(opts ...googleapi.CallOption) (*InterconnectAttachmentAggregatedList, error) {
  56768. gensupport.SetOptions(c.urlParams_, opts...)
  56769. res, err := c.doRequest("json")
  56770. if res != nil && res.StatusCode == http.StatusNotModified {
  56771. if res.Body != nil {
  56772. res.Body.Close()
  56773. }
  56774. return nil, &googleapi.Error{
  56775. Code: res.StatusCode,
  56776. Header: res.Header,
  56777. }
  56778. }
  56779. if err != nil {
  56780. return nil, err
  56781. }
  56782. defer googleapi.CloseBody(res)
  56783. if err := googleapi.CheckResponse(res); err != nil {
  56784. return nil, err
  56785. }
  56786. ret := &InterconnectAttachmentAggregatedList{
  56787. ServerResponse: googleapi.ServerResponse{
  56788. Header: res.Header,
  56789. HTTPStatusCode: res.StatusCode,
  56790. },
  56791. }
  56792. target := &ret
  56793. if err := gensupport.DecodeResponse(target, res); err != nil {
  56794. return nil, err
  56795. }
  56796. return ret, nil
  56797. // {
  56798. // "description": "Retrieves an aggregated list of interconnect attachments.",
  56799. // "httpMethod": "GET",
  56800. // "id": "compute.interconnectAttachments.aggregatedList",
  56801. // "parameterOrder": [
  56802. // "project"
  56803. // ],
  56804. // "parameters": {
  56805. // "filter": {
  56806. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  56807. // "location": "query",
  56808. // "type": "string"
  56809. // },
  56810. // "maxResults": {
  56811. // "default": "500",
  56812. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  56813. // "format": "uint32",
  56814. // "location": "query",
  56815. // "minimum": "0",
  56816. // "type": "integer"
  56817. // },
  56818. // "orderBy": {
  56819. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  56820. // "location": "query",
  56821. // "type": "string"
  56822. // },
  56823. // "pageToken": {
  56824. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  56825. // "location": "query",
  56826. // "type": "string"
  56827. // },
  56828. // "project": {
  56829. // "description": "Project ID for this request.",
  56830. // "location": "path",
  56831. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  56832. // "required": true,
  56833. // "type": "string"
  56834. // }
  56835. // },
  56836. // "path": "{project}/aggregated/interconnectAttachments",
  56837. // "response": {
  56838. // "$ref": "InterconnectAttachmentAggregatedList"
  56839. // },
  56840. // "scopes": [
  56841. // "https://www.googleapis.com/auth/cloud-platform",
  56842. // "https://www.googleapis.com/auth/compute",
  56843. // "https://www.googleapis.com/auth/compute.readonly"
  56844. // ]
  56845. // }
  56846. }
  56847. // Pages invokes f for each page of results.
  56848. // A non-nil error returned from f will halt the iteration.
  56849. // The provided context supersedes any context provided to the Context method.
  56850. func (c *InterconnectAttachmentsAggregatedListCall) Pages(ctx context.Context, f func(*InterconnectAttachmentAggregatedList) error) error {
  56851. c.ctx_ = ctx
  56852. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  56853. for {
  56854. x, err := c.Do()
  56855. if err != nil {
  56856. return err
  56857. }
  56858. if err := f(x); err != nil {
  56859. return err
  56860. }
  56861. if x.NextPageToken == "" {
  56862. return nil
  56863. }
  56864. c.PageToken(x.NextPageToken)
  56865. }
  56866. }
  56867. // method id "compute.interconnectAttachments.delete":
  56868. type InterconnectAttachmentsDeleteCall struct {
  56869. s *Service
  56870. project string
  56871. region string
  56872. interconnectAttachment string
  56873. urlParams_ gensupport.URLParams
  56874. ctx_ context.Context
  56875. header_ http.Header
  56876. }
  56877. // Delete: Deletes the specified interconnect attachment.
  56878. func (r *InterconnectAttachmentsService) Delete(project string, region string, interconnectAttachment string) *InterconnectAttachmentsDeleteCall {
  56879. c := &InterconnectAttachmentsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  56880. c.project = project
  56881. c.region = region
  56882. c.interconnectAttachment = interconnectAttachment
  56883. return c
  56884. }
  56885. // RequestId sets the optional parameter "requestId": An optional
  56886. // request ID to identify requests. Specify a unique request ID so that
  56887. // if you must retry your request, the server will know to ignore the
  56888. // request if it has already been completed.
  56889. //
  56890. // For example, consider a situation where you make an initial request
  56891. // and the request times out. If you make the request again with the
  56892. // same request ID, the server can check if original operation with the
  56893. // same request ID was received, and if so, will ignore the second
  56894. // request. This prevents clients from accidentally creating duplicate
  56895. // commitments.
  56896. //
  56897. // The request ID must be a valid UUID with the exception that zero UUID
  56898. // is not supported (00000000-0000-0000-0000-000000000000).
  56899. func (c *InterconnectAttachmentsDeleteCall) RequestId(requestId string) *InterconnectAttachmentsDeleteCall {
  56900. c.urlParams_.Set("requestId", requestId)
  56901. return c
  56902. }
  56903. // Fields allows partial responses to be retrieved. See
  56904. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  56905. // for more information.
  56906. func (c *InterconnectAttachmentsDeleteCall) Fields(s ...googleapi.Field) *InterconnectAttachmentsDeleteCall {
  56907. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  56908. return c
  56909. }
  56910. // Context sets the context to be used in this call's Do method. Any
  56911. // pending HTTP request will be aborted if the provided context is
  56912. // canceled.
  56913. func (c *InterconnectAttachmentsDeleteCall) Context(ctx context.Context) *InterconnectAttachmentsDeleteCall {
  56914. c.ctx_ = ctx
  56915. return c
  56916. }
  56917. // Header returns an http.Header that can be modified by the caller to
  56918. // add HTTP headers to the request.
  56919. func (c *InterconnectAttachmentsDeleteCall) Header() http.Header {
  56920. if c.header_ == nil {
  56921. c.header_ = make(http.Header)
  56922. }
  56923. return c.header_
  56924. }
  56925. func (c *InterconnectAttachmentsDeleteCall) doRequest(alt string) (*http.Response, error) {
  56926. reqHeaders := make(http.Header)
  56927. for k, v := range c.header_ {
  56928. reqHeaders[k] = v
  56929. }
  56930. reqHeaders.Set("User-Agent", c.s.userAgent())
  56931. var body io.Reader = nil
  56932. c.urlParams_.Set("alt", alt)
  56933. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/interconnectAttachments/{interconnectAttachment}")
  56934. urls += "?" + c.urlParams_.Encode()
  56935. req, _ := http.NewRequest("DELETE", urls, body)
  56936. req.Header = reqHeaders
  56937. googleapi.Expand(req.URL, map[string]string{
  56938. "project": c.project,
  56939. "region": c.region,
  56940. "interconnectAttachment": c.interconnectAttachment,
  56941. })
  56942. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  56943. }
  56944. // Do executes the "compute.interconnectAttachments.delete" call.
  56945. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  56946. // status code is an error. Response headers are in either
  56947. // *Operation.ServerResponse.Header or (if a response was returned at
  56948. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  56949. // to check whether the returned error was because
  56950. // http.StatusNotModified was returned.
  56951. func (c *InterconnectAttachmentsDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  56952. gensupport.SetOptions(c.urlParams_, opts...)
  56953. res, err := c.doRequest("json")
  56954. if res != nil && res.StatusCode == http.StatusNotModified {
  56955. if res.Body != nil {
  56956. res.Body.Close()
  56957. }
  56958. return nil, &googleapi.Error{
  56959. Code: res.StatusCode,
  56960. Header: res.Header,
  56961. }
  56962. }
  56963. if err != nil {
  56964. return nil, err
  56965. }
  56966. defer googleapi.CloseBody(res)
  56967. if err := googleapi.CheckResponse(res); err != nil {
  56968. return nil, err
  56969. }
  56970. ret := &Operation{
  56971. ServerResponse: googleapi.ServerResponse{
  56972. Header: res.Header,
  56973. HTTPStatusCode: res.StatusCode,
  56974. },
  56975. }
  56976. target := &ret
  56977. if err := gensupport.DecodeResponse(target, res); err != nil {
  56978. return nil, err
  56979. }
  56980. return ret, nil
  56981. // {
  56982. // "description": "Deletes the specified interconnect attachment.",
  56983. // "httpMethod": "DELETE",
  56984. // "id": "compute.interconnectAttachments.delete",
  56985. // "parameterOrder": [
  56986. // "project",
  56987. // "region",
  56988. // "interconnectAttachment"
  56989. // ],
  56990. // "parameters": {
  56991. // "interconnectAttachment": {
  56992. // "description": "Name of the interconnect attachment to delete.",
  56993. // "location": "path",
  56994. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  56995. // "required": true,
  56996. // "type": "string"
  56997. // },
  56998. // "project": {
  56999. // "description": "Project ID for this request.",
  57000. // "location": "path",
  57001. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  57002. // "required": true,
  57003. // "type": "string"
  57004. // },
  57005. // "region": {
  57006. // "description": "Name of the region for this request.",
  57007. // "location": "path",
  57008. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  57009. // "required": true,
  57010. // "type": "string"
  57011. // },
  57012. // "requestId": {
  57013. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  57014. // "location": "query",
  57015. // "type": "string"
  57016. // }
  57017. // },
  57018. // "path": "{project}/regions/{region}/interconnectAttachments/{interconnectAttachment}",
  57019. // "response": {
  57020. // "$ref": "Operation"
  57021. // },
  57022. // "scopes": [
  57023. // "https://www.googleapis.com/auth/cloud-platform",
  57024. // "https://www.googleapis.com/auth/compute"
  57025. // ]
  57026. // }
  57027. }
  57028. // method id "compute.interconnectAttachments.get":
  57029. type InterconnectAttachmentsGetCall struct {
  57030. s *Service
  57031. project string
  57032. region string
  57033. interconnectAttachment string
  57034. urlParams_ gensupport.URLParams
  57035. ifNoneMatch_ string
  57036. ctx_ context.Context
  57037. header_ http.Header
  57038. }
  57039. // Get: Returns the specified interconnect attachment.
  57040. func (r *InterconnectAttachmentsService) Get(project string, region string, interconnectAttachment string) *InterconnectAttachmentsGetCall {
  57041. c := &InterconnectAttachmentsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  57042. c.project = project
  57043. c.region = region
  57044. c.interconnectAttachment = interconnectAttachment
  57045. return c
  57046. }
  57047. // Fields allows partial responses to be retrieved. See
  57048. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  57049. // for more information.
  57050. func (c *InterconnectAttachmentsGetCall) Fields(s ...googleapi.Field) *InterconnectAttachmentsGetCall {
  57051. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  57052. return c
  57053. }
  57054. // IfNoneMatch sets the optional parameter which makes the operation
  57055. // fail if the object's ETag matches the given value. This is useful for
  57056. // getting updates only after the object has changed since the last
  57057. // request. Use googleapi.IsNotModified to check whether the response
  57058. // error from Do is the result of In-None-Match.
  57059. func (c *InterconnectAttachmentsGetCall) IfNoneMatch(entityTag string) *InterconnectAttachmentsGetCall {
  57060. c.ifNoneMatch_ = entityTag
  57061. return c
  57062. }
  57063. // Context sets the context to be used in this call's Do method. Any
  57064. // pending HTTP request will be aborted if the provided context is
  57065. // canceled.
  57066. func (c *InterconnectAttachmentsGetCall) Context(ctx context.Context) *InterconnectAttachmentsGetCall {
  57067. c.ctx_ = ctx
  57068. return c
  57069. }
  57070. // Header returns an http.Header that can be modified by the caller to
  57071. // add HTTP headers to the request.
  57072. func (c *InterconnectAttachmentsGetCall) Header() http.Header {
  57073. if c.header_ == nil {
  57074. c.header_ = make(http.Header)
  57075. }
  57076. return c.header_
  57077. }
  57078. func (c *InterconnectAttachmentsGetCall) doRequest(alt string) (*http.Response, error) {
  57079. reqHeaders := make(http.Header)
  57080. for k, v := range c.header_ {
  57081. reqHeaders[k] = v
  57082. }
  57083. reqHeaders.Set("User-Agent", c.s.userAgent())
  57084. if c.ifNoneMatch_ != "" {
  57085. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  57086. }
  57087. var body io.Reader = nil
  57088. c.urlParams_.Set("alt", alt)
  57089. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/interconnectAttachments/{interconnectAttachment}")
  57090. urls += "?" + c.urlParams_.Encode()
  57091. req, _ := http.NewRequest("GET", urls, body)
  57092. req.Header = reqHeaders
  57093. googleapi.Expand(req.URL, map[string]string{
  57094. "project": c.project,
  57095. "region": c.region,
  57096. "interconnectAttachment": c.interconnectAttachment,
  57097. })
  57098. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  57099. }
  57100. // Do executes the "compute.interconnectAttachments.get" call.
  57101. // Exactly one of *InterconnectAttachment or error will be non-nil. Any
  57102. // non-2xx status code is an error. Response headers are in either
  57103. // *InterconnectAttachment.ServerResponse.Header or (if a response was
  57104. // returned at all) in error.(*googleapi.Error).Header. Use
  57105. // googleapi.IsNotModified to check whether the returned error was
  57106. // because http.StatusNotModified was returned.
  57107. func (c *InterconnectAttachmentsGetCall) Do(opts ...googleapi.CallOption) (*InterconnectAttachment, error) {
  57108. gensupport.SetOptions(c.urlParams_, opts...)
  57109. res, err := c.doRequest("json")
  57110. if res != nil && res.StatusCode == http.StatusNotModified {
  57111. if res.Body != nil {
  57112. res.Body.Close()
  57113. }
  57114. return nil, &googleapi.Error{
  57115. Code: res.StatusCode,
  57116. Header: res.Header,
  57117. }
  57118. }
  57119. if err != nil {
  57120. return nil, err
  57121. }
  57122. defer googleapi.CloseBody(res)
  57123. if err := googleapi.CheckResponse(res); err != nil {
  57124. return nil, err
  57125. }
  57126. ret := &InterconnectAttachment{
  57127. ServerResponse: googleapi.ServerResponse{
  57128. Header: res.Header,
  57129. HTTPStatusCode: res.StatusCode,
  57130. },
  57131. }
  57132. target := &ret
  57133. if err := gensupport.DecodeResponse(target, res); err != nil {
  57134. return nil, err
  57135. }
  57136. return ret, nil
  57137. // {
  57138. // "description": "Returns the specified interconnect attachment.",
  57139. // "httpMethod": "GET",
  57140. // "id": "compute.interconnectAttachments.get",
  57141. // "parameterOrder": [
  57142. // "project",
  57143. // "region",
  57144. // "interconnectAttachment"
  57145. // ],
  57146. // "parameters": {
  57147. // "interconnectAttachment": {
  57148. // "description": "Name of the interconnect attachment to return.",
  57149. // "location": "path",
  57150. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  57151. // "required": true,
  57152. // "type": "string"
  57153. // },
  57154. // "project": {
  57155. // "description": "Project ID for this request.",
  57156. // "location": "path",
  57157. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  57158. // "required": true,
  57159. // "type": "string"
  57160. // },
  57161. // "region": {
  57162. // "description": "Name of the region for this request.",
  57163. // "location": "path",
  57164. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  57165. // "required": true,
  57166. // "type": "string"
  57167. // }
  57168. // },
  57169. // "path": "{project}/regions/{region}/interconnectAttachments/{interconnectAttachment}",
  57170. // "response": {
  57171. // "$ref": "InterconnectAttachment"
  57172. // },
  57173. // "scopes": [
  57174. // "https://www.googleapis.com/auth/cloud-platform",
  57175. // "https://www.googleapis.com/auth/compute",
  57176. // "https://www.googleapis.com/auth/compute.readonly"
  57177. // ]
  57178. // }
  57179. }
  57180. // method id "compute.interconnectAttachments.insert":
  57181. type InterconnectAttachmentsInsertCall struct {
  57182. s *Service
  57183. project string
  57184. region string
  57185. interconnectattachment *InterconnectAttachment
  57186. urlParams_ gensupport.URLParams
  57187. ctx_ context.Context
  57188. header_ http.Header
  57189. }
  57190. // Insert: Creates an InterconnectAttachment in the specified project
  57191. // using the data included in the request.
  57192. func (r *InterconnectAttachmentsService) Insert(project string, region string, interconnectattachment *InterconnectAttachment) *InterconnectAttachmentsInsertCall {
  57193. c := &InterconnectAttachmentsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  57194. c.project = project
  57195. c.region = region
  57196. c.interconnectattachment = interconnectattachment
  57197. return c
  57198. }
  57199. // RequestId sets the optional parameter "requestId": An optional
  57200. // request ID to identify requests. Specify a unique request ID so that
  57201. // if you must retry your request, the server will know to ignore the
  57202. // request if it has already been completed.
  57203. //
  57204. // For example, consider a situation where you make an initial request
  57205. // and the request times out. If you make the request again with the
  57206. // same request ID, the server can check if original operation with the
  57207. // same request ID was received, and if so, will ignore the second
  57208. // request. This prevents clients from accidentally creating duplicate
  57209. // commitments.
  57210. //
  57211. // The request ID must be a valid UUID with the exception that zero UUID
  57212. // is not supported (00000000-0000-0000-0000-000000000000).
  57213. func (c *InterconnectAttachmentsInsertCall) RequestId(requestId string) *InterconnectAttachmentsInsertCall {
  57214. c.urlParams_.Set("requestId", requestId)
  57215. return c
  57216. }
  57217. // Fields allows partial responses to be retrieved. See
  57218. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  57219. // for more information.
  57220. func (c *InterconnectAttachmentsInsertCall) Fields(s ...googleapi.Field) *InterconnectAttachmentsInsertCall {
  57221. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  57222. return c
  57223. }
  57224. // Context sets the context to be used in this call's Do method. Any
  57225. // pending HTTP request will be aborted if the provided context is
  57226. // canceled.
  57227. func (c *InterconnectAttachmentsInsertCall) Context(ctx context.Context) *InterconnectAttachmentsInsertCall {
  57228. c.ctx_ = ctx
  57229. return c
  57230. }
  57231. // Header returns an http.Header that can be modified by the caller to
  57232. // add HTTP headers to the request.
  57233. func (c *InterconnectAttachmentsInsertCall) Header() http.Header {
  57234. if c.header_ == nil {
  57235. c.header_ = make(http.Header)
  57236. }
  57237. return c.header_
  57238. }
  57239. func (c *InterconnectAttachmentsInsertCall) doRequest(alt string) (*http.Response, error) {
  57240. reqHeaders := make(http.Header)
  57241. for k, v := range c.header_ {
  57242. reqHeaders[k] = v
  57243. }
  57244. reqHeaders.Set("User-Agent", c.s.userAgent())
  57245. var body io.Reader = nil
  57246. body, err := googleapi.WithoutDataWrapper.JSONReader(c.interconnectattachment)
  57247. if err != nil {
  57248. return nil, err
  57249. }
  57250. reqHeaders.Set("Content-Type", "application/json")
  57251. c.urlParams_.Set("alt", alt)
  57252. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/interconnectAttachments")
  57253. urls += "?" + c.urlParams_.Encode()
  57254. req, _ := http.NewRequest("POST", urls, body)
  57255. req.Header = reqHeaders
  57256. googleapi.Expand(req.URL, map[string]string{
  57257. "project": c.project,
  57258. "region": c.region,
  57259. })
  57260. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  57261. }
  57262. // Do executes the "compute.interconnectAttachments.insert" call.
  57263. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  57264. // status code is an error. Response headers are in either
  57265. // *Operation.ServerResponse.Header or (if a response was returned at
  57266. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  57267. // to check whether the returned error was because
  57268. // http.StatusNotModified was returned.
  57269. func (c *InterconnectAttachmentsInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  57270. gensupport.SetOptions(c.urlParams_, opts...)
  57271. res, err := c.doRequest("json")
  57272. if res != nil && res.StatusCode == http.StatusNotModified {
  57273. if res.Body != nil {
  57274. res.Body.Close()
  57275. }
  57276. return nil, &googleapi.Error{
  57277. Code: res.StatusCode,
  57278. Header: res.Header,
  57279. }
  57280. }
  57281. if err != nil {
  57282. return nil, err
  57283. }
  57284. defer googleapi.CloseBody(res)
  57285. if err := googleapi.CheckResponse(res); err != nil {
  57286. return nil, err
  57287. }
  57288. ret := &Operation{
  57289. ServerResponse: googleapi.ServerResponse{
  57290. Header: res.Header,
  57291. HTTPStatusCode: res.StatusCode,
  57292. },
  57293. }
  57294. target := &ret
  57295. if err := gensupport.DecodeResponse(target, res); err != nil {
  57296. return nil, err
  57297. }
  57298. return ret, nil
  57299. // {
  57300. // "description": "Creates an InterconnectAttachment in the specified project using the data included in the request.",
  57301. // "httpMethod": "POST",
  57302. // "id": "compute.interconnectAttachments.insert",
  57303. // "parameterOrder": [
  57304. // "project",
  57305. // "region"
  57306. // ],
  57307. // "parameters": {
  57308. // "project": {
  57309. // "description": "Project ID for this request.",
  57310. // "location": "path",
  57311. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  57312. // "required": true,
  57313. // "type": "string"
  57314. // },
  57315. // "region": {
  57316. // "description": "Name of the region for this request.",
  57317. // "location": "path",
  57318. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  57319. // "required": true,
  57320. // "type": "string"
  57321. // },
  57322. // "requestId": {
  57323. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  57324. // "location": "query",
  57325. // "type": "string"
  57326. // }
  57327. // },
  57328. // "path": "{project}/regions/{region}/interconnectAttachments",
  57329. // "request": {
  57330. // "$ref": "InterconnectAttachment"
  57331. // },
  57332. // "response": {
  57333. // "$ref": "Operation"
  57334. // },
  57335. // "scopes": [
  57336. // "https://www.googleapis.com/auth/cloud-platform",
  57337. // "https://www.googleapis.com/auth/compute"
  57338. // ]
  57339. // }
  57340. }
  57341. // method id "compute.interconnectAttachments.list":
  57342. type InterconnectAttachmentsListCall struct {
  57343. s *Service
  57344. project string
  57345. region string
  57346. urlParams_ gensupport.URLParams
  57347. ifNoneMatch_ string
  57348. ctx_ context.Context
  57349. header_ http.Header
  57350. }
  57351. // List: Retrieves the list of interconnect attachments contained within
  57352. // the specified region.
  57353. func (r *InterconnectAttachmentsService) List(project string, region string) *InterconnectAttachmentsListCall {
  57354. c := &InterconnectAttachmentsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  57355. c.project = project
  57356. c.region = region
  57357. return c
  57358. }
  57359. // Filter sets the optional parameter "filter": A filter expression that
  57360. // filters resources listed in the response. The expression must specify
  57361. // the field name, a comparison operator, and the value that you want to
  57362. // use for filtering. The value must be a string, a number, or a
  57363. // boolean. The comparison operator must be either =, !=, >, or <.
  57364. //
  57365. // For example, if you are filtering Compute Engine instances, you can
  57366. // exclude instances named example-instance by specifying name !=
  57367. // example-instance.
  57368. //
  57369. // You can also filter nested fields. For example, you could specify
  57370. // scheduling.automaticRestart = false to include instances only if they
  57371. // are not scheduled for automatic restarts. You can use filtering on
  57372. // nested fields to filter based on resource labels.
  57373. //
  57374. // To filter on multiple expressions, provide each separate expression
  57375. // within parentheses. For example, (scheduling.automaticRestart = true)
  57376. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  57377. // AND expression. However, you can include AND and OR expressions
  57378. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  57379. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  57380. // true).
  57381. func (c *InterconnectAttachmentsListCall) Filter(filter string) *InterconnectAttachmentsListCall {
  57382. c.urlParams_.Set("filter", filter)
  57383. return c
  57384. }
  57385. // MaxResults sets the optional parameter "maxResults": The maximum
  57386. // number of results per page that should be returned. If the number of
  57387. // available results is larger than maxResults, Compute Engine returns a
  57388. // nextPageToken that can be used to get the next page of results in
  57389. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  57390. // (Default: 500)
  57391. func (c *InterconnectAttachmentsListCall) MaxResults(maxResults int64) *InterconnectAttachmentsListCall {
  57392. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  57393. return c
  57394. }
  57395. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  57396. // a certain order. By default, results are returned in alphanumerical
  57397. // order based on the resource name.
  57398. //
  57399. // You can also sort results in descending order based on the creation
  57400. // timestamp using orderBy="creationTimestamp desc". This sorts results
  57401. // based on the creationTimestamp field in reverse chronological order
  57402. // (newest result first). Use this to sort resources like operations so
  57403. // that the newest operation is returned first.
  57404. //
  57405. // Currently, only sorting by name or creationTimestamp desc is
  57406. // supported.
  57407. func (c *InterconnectAttachmentsListCall) OrderBy(orderBy string) *InterconnectAttachmentsListCall {
  57408. c.urlParams_.Set("orderBy", orderBy)
  57409. return c
  57410. }
  57411. // PageToken sets the optional parameter "pageToken": Specifies a page
  57412. // token to use. Set pageToken to the nextPageToken returned by a
  57413. // previous list request to get the next page of results.
  57414. func (c *InterconnectAttachmentsListCall) PageToken(pageToken string) *InterconnectAttachmentsListCall {
  57415. c.urlParams_.Set("pageToken", pageToken)
  57416. return c
  57417. }
  57418. // Fields allows partial responses to be retrieved. See
  57419. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  57420. // for more information.
  57421. func (c *InterconnectAttachmentsListCall) Fields(s ...googleapi.Field) *InterconnectAttachmentsListCall {
  57422. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  57423. return c
  57424. }
  57425. // IfNoneMatch sets the optional parameter which makes the operation
  57426. // fail if the object's ETag matches the given value. This is useful for
  57427. // getting updates only after the object has changed since the last
  57428. // request. Use googleapi.IsNotModified to check whether the response
  57429. // error from Do is the result of In-None-Match.
  57430. func (c *InterconnectAttachmentsListCall) IfNoneMatch(entityTag string) *InterconnectAttachmentsListCall {
  57431. c.ifNoneMatch_ = entityTag
  57432. return c
  57433. }
  57434. // Context sets the context to be used in this call's Do method. Any
  57435. // pending HTTP request will be aborted if the provided context is
  57436. // canceled.
  57437. func (c *InterconnectAttachmentsListCall) Context(ctx context.Context) *InterconnectAttachmentsListCall {
  57438. c.ctx_ = ctx
  57439. return c
  57440. }
  57441. // Header returns an http.Header that can be modified by the caller to
  57442. // add HTTP headers to the request.
  57443. func (c *InterconnectAttachmentsListCall) Header() http.Header {
  57444. if c.header_ == nil {
  57445. c.header_ = make(http.Header)
  57446. }
  57447. return c.header_
  57448. }
  57449. func (c *InterconnectAttachmentsListCall) doRequest(alt string) (*http.Response, error) {
  57450. reqHeaders := make(http.Header)
  57451. for k, v := range c.header_ {
  57452. reqHeaders[k] = v
  57453. }
  57454. reqHeaders.Set("User-Agent", c.s.userAgent())
  57455. if c.ifNoneMatch_ != "" {
  57456. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  57457. }
  57458. var body io.Reader = nil
  57459. c.urlParams_.Set("alt", alt)
  57460. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/interconnectAttachments")
  57461. urls += "?" + c.urlParams_.Encode()
  57462. req, _ := http.NewRequest("GET", urls, body)
  57463. req.Header = reqHeaders
  57464. googleapi.Expand(req.URL, map[string]string{
  57465. "project": c.project,
  57466. "region": c.region,
  57467. })
  57468. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  57469. }
  57470. // Do executes the "compute.interconnectAttachments.list" call.
  57471. // Exactly one of *InterconnectAttachmentList or error will be non-nil.
  57472. // Any non-2xx status code is an error. Response headers are in either
  57473. // *InterconnectAttachmentList.ServerResponse.Header or (if a response
  57474. // was returned at all) in error.(*googleapi.Error).Header. Use
  57475. // googleapi.IsNotModified to check whether the returned error was
  57476. // because http.StatusNotModified was returned.
  57477. func (c *InterconnectAttachmentsListCall) Do(opts ...googleapi.CallOption) (*InterconnectAttachmentList, error) {
  57478. gensupport.SetOptions(c.urlParams_, opts...)
  57479. res, err := c.doRequest("json")
  57480. if res != nil && res.StatusCode == http.StatusNotModified {
  57481. if res.Body != nil {
  57482. res.Body.Close()
  57483. }
  57484. return nil, &googleapi.Error{
  57485. Code: res.StatusCode,
  57486. Header: res.Header,
  57487. }
  57488. }
  57489. if err != nil {
  57490. return nil, err
  57491. }
  57492. defer googleapi.CloseBody(res)
  57493. if err := googleapi.CheckResponse(res); err != nil {
  57494. return nil, err
  57495. }
  57496. ret := &InterconnectAttachmentList{
  57497. ServerResponse: googleapi.ServerResponse{
  57498. Header: res.Header,
  57499. HTTPStatusCode: res.StatusCode,
  57500. },
  57501. }
  57502. target := &ret
  57503. if err := gensupport.DecodeResponse(target, res); err != nil {
  57504. return nil, err
  57505. }
  57506. return ret, nil
  57507. // {
  57508. // "description": "Retrieves the list of interconnect attachments contained within the specified region.",
  57509. // "httpMethod": "GET",
  57510. // "id": "compute.interconnectAttachments.list",
  57511. // "parameterOrder": [
  57512. // "project",
  57513. // "region"
  57514. // ],
  57515. // "parameters": {
  57516. // "filter": {
  57517. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  57518. // "location": "query",
  57519. // "type": "string"
  57520. // },
  57521. // "maxResults": {
  57522. // "default": "500",
  57523. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  57524. // "format": "uint32",
  57525. // "location": "query",
  57526. // "minimum": "0",
  57527. // "type": "integer"
  57528. // },
  57529. // "orderBy": {
  57530. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  57531. // "location": "query",
  57532. // "type": "string"
  57533. // },
  57534. // "pageToken": {
  57535. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  57536. // "location": "query",
  57537. // "type": "string"
  57538. // },
  57539. // "project": {
  57540. // "description": "Project ID for this request.",
  57541. // "location": "path",
  57542. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  57543. // "required": true,
  57544. // "type": "string"
  57545. // },
  57546. // "region": {
  57547. // "description": "Name of the region for this request.",
  57548. // "location": "path",
  57549. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  57550. // "required": true,
  57551. // "type": "string"
  57552. // }
  57553. // },
  57554. // "path": "{project}/regions/{region}/interconnectAttachments",
  57555. // "response": {
  57556. // "$ref": "InterconnectAttachmentList"
  57557. // },
  57558. // "scopes": [
  57559. // "https://www.googleapis.com/auth/cloud-platform",
  57560. // "https://www.googleapis.com/auth/compute",
  57561. // "https://www.googleapis.com/auth/compute.readonly"
  57562. // ]
  57563. // }
  57564. }
  57565. // Pages invokes f for each page of results.
  57566. // A non-nil error returned from f will halt the iteration.
  57567. // The provided context supersedes any context provided to the Context method.
  57568. func (c *InterconnectAttachmentsListCall) Pages(ctx context.Context, f func(*InterconnectAttachmentList) error) error {
  57569. c.ctx_ = ctx
  57570. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  57571. for {
  57572. x, err := c.Do()
  57573. if err != nil {
  57574. return err
  57575. }
  57576. if err := f(x); err != nil {
  57577. return err
  57578. }
  57579. if x.NextPageToken == "" {
  57580. return nil
  57581. }
  57582. c.PageToken(x.NextPageToken)
  57583. }
  57584. }
  57585. // method id "compute.interconnectAttachments.patch":
  57586. type InterconnectAttachmentsPatchCall struct {
  57587. s *Service
  57588. project string
  57589. region string
  57590. interconnectAttachment string
  57591. interconnectattachment *InterconnectAttachment
  57592. urlParams_ gensupport.URLParams
  57593. ctx_ context.Context
  57594. header_ http.Header
  57595. }
  57596. // Patch: Updates the specified interconnect attachment with the data
  57597. // included in the request. This method supports PATCH semantics and
  57598. // uses the JSON merge patch format and processing rules.
  57599. func (r *InterconnectAttachmentsService) Patch(project string, region string, interconnectAttachment string, interconnectattachment *InterconnectAttachment) *InterconnectAttachmentsPatchCall {
  57600. c := &InterconnectAttachmentsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  57601. c.project = project
  57602. c.region = region
  57603. c.interconnectAttachment = interconnectAttachment
  57604. c.interconnectattachment = interconnectattachment
  57605. return c
  57606. }
  57607. // RequestId sets the optional parameter "requestId": An optional
  57608. // request ID to identify requests. Specify a unique request ID so that
  57609. // if you must retry your request, the server will know to ignore the
  57610. // request if it has already been completed.
  57611. //
  57612. // For example, consider a situation where you make an initial request
  57613. // and the request times out. If you make the request again with the
  57614. // same request ID, the server can check if original operation with the
  57615. // same request ID was received, and if so, will ignore the second
  57616. // request. This prevents clients from accidentally creating duplicate
  57617. // commitments.
  57618. //
  57619. // The request ID must be a valid UUID with the exception that zero UUID
  57620. // is not supported (00000000-0000-0000-0000-000000000000).
  57621. func (c *InterconnectAttachmentsPatchCall) RequestId(requestId string) *InterconnectAttachmentsPatchCall {
  57622. c.urlParams_.Set("requestId", requestId)
  57623. return c
  57624. }
  57625. // Fields allows partial responses to be retrieved. See
  57626. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  57627. // for more information.
  57628. func (c *InterconnectAttachmentsPatchCall) Fields(s ...googleapi.Field) *InterconnectAttachmentsPatchCall {
  57629. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  57630. return c
  57631. }
  57632. // Context sets the context to be used in this call's Do method. Any
  57633. // pending HTTP request will be aborted if the provided context is
  57634. // canceled.
  57635. func (c *InterconnectAttachmentsPatchCall) Context(ctx context.Context) *InterconnectAttachmentsPatchCall {
  57636. c.ctx_ = ctx
  57637. return c
  57638. }
  57639. // Header returns an http.Header that can be modified by the caller to
  57640. // add HTTP headers to the request.
  57641. func (c *InterconnectAttachmentsPatchCall) Header() http.Header {
  57642. if c.header_ == nil {
  57643. c.header_ = make(http.Header)
  57644. }
  57645. return c.header_
  57646. }
  57647. func (c *InterconnectAttachmentsPatchCall) doRequest(alt string) (*http.Response, error) {
  57648. reqHeaders := make(http.Header)
  57649. for k, v := range c.header_ {
  57650. reqHeaders[k] = v
  57651. }
  57652. reqHeaders.Set("User-Agent", c.s.userAgent())
  57653. var body io.Reader = nil
  57654. body, err := googleapi.WithoutDataWrapper.JSONReader(c.interconnectattachment)
  57655. if err != nil {
  57656. return nil, err
  57657. }
  57658. reqHeaders.Set("Content-Type", "application/json")
  57659. c.urlParams_.Set("alt", alt)
  57660. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/interconnectAttachments/{interconnectAttachment}")
  57661. urls += "?" + c.urlParams_.Encode()
  57662. req, _ := http.NewRequest("PATCH", urls, body)
  57663. req.Header = reqHeaders
  57664. googleapi.Expand(req.URL, map[string]string{
  57665. "project": c.project,
  57666. "region": c.region,
  57667. "interconnectAttachment": c.interconnectAttachment,
  57668. })
  57669. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  57670. }
  57671. // Do executes the "compute.interconnectAttachments.patch" call.
  57672. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  57673. // status code is an error. Response headers are in either
  57674. // *Operation.ServerResponse.Header or (if a response was returned at
  57675. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  57676. // to check whether the returned error was because
  57677. // http.StatusNotModified was returned.
  57678. func (c *InterconnectAttachmentsPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  57679. gensupport.SetOptions(c.urlParams_, opts...)
  57680. res, err := c.doRequest("json")
  57681. if res != nil && res.StatusCode == http.StatusNotModified {
  57682. if res.Body != nil {
  57683. res.Body.Close()
  57684. }
  57685. return nil, &googleapi.Error{
  57686. Code: res.StatusCode,
  57687. Header: res.Header,
  57688. }
  57689. }
  57690. if err != nil {
  57691. return nil, err
  57692. }
  57693. defer googleapi.CloseBody(res)
  57694. if err := googleapi.CheckResponse(res); err != nil {
  57695. return nil, err
  57696. }
  57697. ret := &Operation{
  57698. ServerResponse: googleapi.ServerResponse{
  57699. Header: res.Header,
  57700. HTTPStatusCode: res.StatusCode,
  57701. },
  57702. }
  57703. target := &ret
  57704. if err := gensupport.DecodeResponse(target, res); err != nil {
  57705. return nil, err
  57706. }
  57707. return ret, nil
  57708. // {
  57709. // "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.",
  57710. // "httpMethod": "PATCH",
  57711. // "id": "compute.interconnectAttachments.patch",
  57712. // "parameterOrder": [
  57713. // "project",
  57714. // "region",
  57715. // "interconnectAttachment"
  57716. // ],
  57717. // "parameters": {
  57718. // "interconnectAttachment": {
  57719. // "description": "Name of the interconnect attachment to patch.",
  57720. // "location": "path",
  57721. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  57722. // "required": true,
  57723. // "type": "string"
  57724. // },
  57725. // "project": {
  57726. // "description": "Project ID for this request.",
  57727. // "location": "path",
  57728. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  57729. // "required": true,
  57730. // "type": "string"
  57731. // },
  57732. // "region": {
  57733. // "description": "Name of the region scoping this request.",
  57734. // "location": "path",
  57735. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  57736. // "required": true,
  57737. // "type": "string"
  57738. // },
  57739. // "requestId": {
  57740. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  57741. // "location": "query",
  57742. // "type": "string"
  57743. // }
  57744. // },
  57745. // "path": "{project}/regions/{region}/interconnectAttachments/{interconnectAttachment}",
  57746. // "request": {
  57747. // "$ref": "InterconnectAttachment"
  57748. // },
  57749. // "response": {
  57750. // "$ref": "Operation"
  57751. // },
  57752. // "scopes": [
  57753. // "https://www.googleapis.com/auth/cloud-platform",
  57754. // "https://www.googleapis.com/auth/compute"
  57755. // ]
  57756. // }
  57757. }
  57758. // method id "compute.interconnectAttachments.setLabels":
  57759. type InterconnectAttachmentsSetLabelsCall struct {
  57760. s *Service
  57761. project string
  57762. region string
  57763. resource string
  57764. regionsetlabelsrequest *RegionSetLabelsRequest
  57765. urlParams_ gensupport.URLParams
  57766. ctx_ context.Context
  57767. header_ http.Header
  57768. }
  57769. // SetLabels: Sets the labels on an InterconnectAttachment. To learn
  57770. // more about labels, read the Labeling Resources documentation.
  57771. func (r *InterconnectAttachmentsService) SetLabels(project string, region string, resource string, regionsetlabelsrequest *RegionSetLabelsRequest) *InterconnectAttachmentsSetLabelsCall {
  57772. c := &InterconnectAttachmentsSetLabelsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  57773. c.project = project
  57774. c.region = region
  57775. c.resource = resource
  57776. c.regionsetlabelsrequest = regionsetlabelsrequest
  57777. return c
  57778. }
  57779. // RequestId sets the optional parameter "requestId": An optional
  57780. // request ID to identify requests. Specify a unique request ID so that
  57781. // if you must retry your request, the server will know to ignore the
  57782. // request if it has already been completed.
  57783. //
  57784. // For example, consider a situation where you make an initial request
  57785. // and the request times out. If you make the request again with the
  57786. // same request ID, the server can check if original operation with the
  57787. // same request ID was received, and if so, will ignore the second
  57788. // request. This prevents clients from accidentally creating duplicate
  57789. // commitments.
  57790. //
  57791. // The request ID must be a valid UUID with the exception that zero UUID
  57792. // is not supported (00000000-0000-0000-0000-000000000000).
  57793. func (c *InterconnectAttachmentsSetLabelsCall) RequestId(requestId string) *InterconnectAttachmentsSetLabelsCall {
  57794. c.urlParams_.Set("requestId", requestId)
  57795. return c
  57796. }
  57797. // Fields allows partial responses to be retrieved. See
  57798. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  57799. // for more information.
  57800. func (c *InterconnectAttachmentsSetLabelsCall) Fields(s ...googleapi.Field) *InterconnectAttachmentsSetLabelsCall {
  57801. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  57802. return c
  57803. }
  57804. // Context sets the context to be used in this call's Do method. Any
  57805. // pending HTTP request will be aborted if the provided context is
  57806. // canceled.
  57807. func (c *InterconnectAttachmentsSetLabelsCall) Context(ctx context.Context) *InterconnectAttachmentsSetLabelsCall {
  57808. c.ctx_ = ctx
  57809. return c
  57810. }
  57811. // Header returns an http.Header that can be modified by the caller to
  57812. // add HTTP headers to the request.
  57813. func (c *InterconnectAttachmentsSetLabelsCall) Header() http.Header {
  57814. if c.header_ == nil {
  57815. c.header_ = make(http.Header)
  57816. }
  57817. return c.header_
  57818. }
  57819. func (c *InterconnectAttachmentsSetLabelsCall) doRequest(alt string) (*http.Response, error) {
  57820. reqHeaders := make(http.Header)
  57821. for k, v := range c.header_ {
  57822. reqHeaders[k] = v
  57823. }
  57824. reqHeaders.Set("User-Agent", c.s.userAgent())
  57825. var body io.Reader = nil
  57826. body, err := googleapi.WithoutDataWrapper.JSONReader(c.regionsetlabelsrequest)
  57827. if err != nil {
  57828. return nil, err
  57829. }
  57830. reqHeaders.Set("Content-Type", "application/json")
  57831. c.urlParams_.Set("alt", alt)
  57832. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/interconnectAttachments/{resource}/setLabels")
  57833. urls += "?" + c.urlParams_.Encode()
  57834. req, _ := http.NewRequest("POST", urls, body)
  57835. req.Header = reqHeaders
  57836. googleapi.Expand(req.URL, map[string]string{
  57837. "project": c.project,
  57838. "region": c.region,
  57839. "resource": c.resource,
  57840. })
  57841. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  57842. }
  57843. // Do executes the "compute.interconnectAttachments.setLabels" call.
  57844. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  57845. // status code is an error. Response headers are in either
  57846. // *Operation.ServerResponse.Header or (if a response was returned at
  57847. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  57848. // to check whether the returned error was because
  57849. // http.StatusNotModified was returned.
  57850. func (c *InterconnectAttachmentsSetLabelsCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  57851. gensupport.SetOptions(c.urlParams_, opts...)
  57852. res, err := c.doRequest("json")
  57853. if res != nil && res.StatusCode == http.StatusNotModified {
  57854. if res.Body != nil {
  57855. res.Body.Close()
  57856. }
  57857. return nil, &googleapi.Error{
  57858. Code: res.StatusCode,
  57859. Header: res.Header,
  57860. }
  57861. }
  57862. if err != nil {
  57863. return nil, err
  57864. }
  57865. defer googleapi.CloseBody(res)
  57866. if err := googleapi.CheckResponse(res); err != nil {
  57867. return nil, err
  57868. }
  57869. ret := &Operation{
  57870. ServerResponse: googleapi.ServerResponse{
  57871. Header: res.Header,
  57872. HTTPStatusCode: res.StatusCode,
  57873. },
  57874. }
  57875. target := &ret
  57876. if err := gensupport.DecodeResponse(target, res); err != nil {
  57877. return nil, err
  57878. }
  57879. return ret, nil
  57880. // {
  57881. // "description": "Sets the labels on an InterconnectAttachment. To learn more about labels, read the Labeling Resources documentation.",
  57882. // "httpMethod": "POST",
  57883. // "id": "compute.interconnectAttachments.setLabels",
  57884. // "parameterOrder": [
  57885. // "project",
  57886. // "region",
  57887. // "resource"
  57888. // ],
  57889. // "parameters": {
  57890. // "project": {
  57891. // "description": "Project ID for this request.",
  57892. // "location": "path",
  57893. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  57894. // "required": true,
  57895. // "type": "string"
  57896. // },
  57897. // "region": {
  57898. // "description": "The region for this request.",
  57899. // "location": "path",
  57900. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  57901. // "required": true,
  57902. // "type": "string"
  57903. // },
  57904. // "requestId": {
  57905. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  57906. // "location": "query",
  57907. // "type": "string"
  57908. // },
  57909. // "resource": {
  57910. // "description": "Name of the resource for this request.",
  57911. // "location": "path",
  57912. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  57913. // "required": true,
  57914. // "type": "string"
  57915. // }
  57916. // },
  57917. // "path": "{project}/regions/{region}/interconnectAttachments/{resource}/setLabels",
  57918. // "request": {
  57919. // "$ref": "RegionSetLabelsRequest"
  57920. // },
  57921. // "response": {
  57922. // "$ref": "Operation"
  57923. // },
  57924. // "scopes": [
  57925. // "https://www.googleapis.com/auth/cloud-platform",
  57926. // "https://www.googleapis.com/auth/compute"
  57927. // ]
  57928. // }
  57929. }
  57930. // method id "compute.interconnectAttachments.testIamPermissions":
  57931. type InterconnectAttachmentsTestIamPermissionsCall struct {
  57932. s *Service
  57933. project string
  57934. region string
  57935. resource string
  57936. testpermissionsrequest *TestPermissionsRequest
  57937. urlParams_ gensupport.URLParams
  57938. ctx_ context.Context
  57939. header_ http.Header
  57940. }
  57941. // TestIamPermissions: Returns permissions that a caller has on the
  57942. // specified resource.
  57943. func (r *InterconnectAttachmentsService) TestIamPermissions(project string, region string, resource string, testpermissionsrequest *TestPermissionsRequest) *InterconnectAttachmentsTestIamPermissionsCall {
  57944. c := &InterconnectAttachmentsTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  57945. c.project = project
  57946. c.region = region
  57947. c.resource = resource
  57948. c.testpermissionsrequest = testpermissionsrequest
  57949. return c
  57950. }
  57951. // Fields allows partial responses to be retrieved. See
  57952. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  57953. // for more information.
  57954. func (c *InterconnectAttachmentsTestIamPermissionsCall) Fields(s ...googleapi.Field) *InterconnectAttachmentsTestIamPermissionsCall {
  57955. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  57956. return c
  57957. }
  57958. // Context sets the context to be used in this call's Do method. Any
  57959. // pending HTTP request will be aborted if the provided context is
  57960. // canceled.
  57961. func (c *InterconnectAttachmentsTestIamPermissionsCall) Context(ctx context.Context) *InterconnectAttachmentsTestIamPermissionsCall {
  57962. c.ctx_ = ctx
  57963. return c
  57964. }
  57965. // Header returns an http.Header that can be modified by the caller to
  57966. // add HTTP headers to the request.
  57967. func (c *InterconnectAttachmentsTestIamPermissionsCall) Header() http.Header {
  57968. if c.header_ == nil {
  57969. c.header_ = make(http.Header)
  57970. }
  57971. return c.header_
  57972. }
  57973. func (c *InterconnectAttachmentsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  57974. reqHeaders := make(http.Header)
  57975. for k, v := range c.header_ {
  57976. reqHeaders[k] = v
  57977. }
  57978. reqHeaders.Set("User-Agent", c.s.userAgent())
  57979. var body io.Reader = nil
  57980. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  57981. if err != nil {
  57982. return nil, err
  57983. }
  57984. reqHeaders.Set("Content-Type", "application/json")
  57985. c.urlParams_.Set("alt", alt)
  57986. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/interconnectAttachments/{resource}/testIamPermissions")
  57987. urls += "?" + c.urlParams_.Encode()
  57988. req, _ := http.NewRequest("POST", urls, body)
  57989. req.Header = reqHeaders
  57990. googleapi.Expand(req.URL, map[string]string{
  57991. "project": c.project,
  57992. "region": c.region,
  57993. "resource": c.resource,
  57994. })
  57995. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  57996. }
  57997. // Do executes the "compute.interconnectAttachments.testIamPermissions" call.
  57998. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  57999. // non-2xx status code is an error. Response headers are in either
  58000. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  58001. // returned at all) in error.(*googleapi.Error).Header. Use
  58002. // googleapi.IsNotModified to check whether the returned error was
  58003. // because http.StatusNotModified was returned.
  58004. func (c *InterconnectAttachmentsTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  58005. gensupport.SetOptions(c.urlParams_, opts...)
  58006. res, err := c.doRequest("json")
  58007. if res != nil && res.StatusCode == http.StatusNotModified {
  58008. if res.Body != nil {
  58009. res.Body.Close()
  58010. }
  58011. return nil, &googleapi.Error{
  58012. Code: res.StatusCode,
  58013. Header: res.Header,
  58014. }
  58015. }
  58016. if err != nil {
  58017. return nil, err
  58018. }
  58019. defer googleapi.CloseBody(res)
  58020. if err := googleapi.CheckResponse(res); err != nil {
  58021. return nil, err
  58022. }
  58023. ret := &TestPermissionsResponse{
  58024. ServerResponse: googleapi.ServerResponse{
  58025. Header: res.Header,
  58026. HTTPStatusCode: res.StatusCode,
  58027. },
  58028. }
  58029. target := &ret
  58030. if err := gensupport.DecodeResponse(target, res); err != nil {
  58031. return nil, err
  58032. }
  58033. return ret, nil
  58034. // {
  58035. // "description": "Returns permissions that a caller has on the specified resource.",
  58036. // "httpMethod": "POST",
  58037. // "id": "compute.interconnectAttachments.testIamPermissions",
  58038. // "parameterOrder": [
  58039. // "project",
  58040. // "region",
  58041. // "resource"
  58042. // ],
  58043. // "parameters": {
  58044. // "project": {
  58045. // "description": "Project ID for this request.",
  58046. // "location": "path",
  58047. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  58048. // "required": true,
  58049. // "type": "string"
  58050. // },
  58051. // "region": {
  58052. // "description": "The name of the region for this request.",
  58053. // "location": "path",
  58054. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  58055. // "required": true,
  58056. // "type": "string"
  58057. // },
  58058. // "resource": {
  58059. // "description": "Name of the resource for this request.",
  58060. // "location": "path",
  58061. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  58062. // "required": true,
  58063. // "type": "string"
  58064. // }
  58065. // },
  58066. // "path": "{project}/regions/{region}/interconnectAttachments/{resource}/testIamPermissions",
  58067. // "request": {
  58068. // "$ref": "TestPermissionsRequest"
  58069. // },
  58070. // "response": {
  58071. // "$ref": "TestPermissionsResponse"
  58072. // },
  58073. // "scopes": [
  58074. // "https://www.googleapis.com/auth/cloud-platform",
  58075. // "https://www.googleapis.com/auth/compute",
  58076. // "https://www.googleapis.com/auth/compute.readonly"
  58077. // ]
  58078. // }
  58079. }
  58080. // method id "compute.interconnectLocations.get":
  58081. type InterconnectLocationsGetCall struct {
  58082. s *Service
  58083. project string
  58084. interconnectLocation string
  58085. urlParams_ gensupport.URLParams
  58086. ifNoneMatch_ string
  58087. ctx_ context.Context
  58088. header_ http.Header
  58089. }
  58090. // Get: Returns the details for the specified interconnect location.
  58091. // Gets a list of available interconnect locations by making a list()
  58092. // request.
  58093. func (r *InterconnectLocationsService) Get(project string, interconnectLocation string) *InterconnectLocationsGetCall {
  58094. c := &InterconnectLocationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  58095. c.project = project
  58096. c.interconnectLocation = interconnectLocation
  58097. return c
  58098. }
  58099. // Fields allows partial responses to be retrieved. See
  58100. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  58101. // for more information.
  58102. func (c *InterconnectLocationsGetCall) Fields(s ...googleapi.Field) *InterconnectLocationsGetCall {
  58103. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  58104. return c
  58105. }
  58106. // IfNoneMatch sets the optional parameter which makes the operation
  58107. // fail if the object's ETag matches the given value. This is useful for
  58108. // getting updates only after the object has changed since the last
  58109. // request. Use googleapi.IsNotModified to check whether the response
  58110. // error from Do is the result of In-None-Match.
  58111. func (c *InterconnectLocationsGetCall) IfNoneMatch(entityTag string) *InterconnectLocationsGetCall {
  58112. c.ifNoneMatch_ = entityTag
  58113. return c
  58114. }
  58115. // Context sets the context to be used in this call's Do method. Any
  58116. // pending HTTP request will be aborted if the provided context is
  58117. // canceled.
  58118. func (c *InterconnectLocationsGetCall) Context(ctx context.Context) *InterconnectLocationsGetCall {
  58119. c.ctx_ = ctx
  58120. return c
  58121. }
  58122. // Header returns an http.Header that can be modified by the caller to
  58123. // add HTTP headers to the request.
  58124. func (c *InterconnectLocationsGetCall) Header() http.Header {
  58125. if c.header_ == nil {
  58126. c.header_ = make(http.Header)
  58127. }
  58128. return c.header_
  58129. }
  58130. func (c *InterconnectLocationsGetCall) doRequest(alt string) (*http.Response, error) {
  58131. reqHeaders := make(http.Header)
  58132. for k, v := range c.header_ {
  58133. reqHeaders[k] = v
  58134. }
  58135. reqHeaders.Set("User-Agent", c.s.userAgent())
  58136. if c.ifNoneMatch_ != "" {
  58137. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  58138. }
  58139. var body io.Reader = nil
  58140. c.urlParams_.Set("alt", alt)
  58141. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/interconnectLocations/{interconnectLocation}")
  58142. urls += "?" + c.urlParams_.Encode()
  58143. req, _ := http.NewRequest("GET", urls, body)
  58144. req.Header = reqHeaders
  58145. googleapi.Expand(req.URL, map[string]string{
  58146. "project": c.project,
  58147. "interconnectLocation": c.interconnectLocation,
  58148. })
  58149. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  58150. }
  58151. // Do executes the "compute.interconnectLocations.get" call.
  58152. // Exactly one of *InterconnectLocation or error will be non-nil. Any
  58153. // non-2xx status code is an error. Response headers are in either
  58154. // *InterconnectLocation.ServerResponse.Header or (if a response was
  58155. // returned at all) in error.(*googleapi.Error).Header. Use
  58156. // googleapi.IsNotModified to check whether the returned error was
  58157. // because http.StatusNotModified was returned.
  58158. func (c *InterconnectLocationsGetCall) Do(opts ...googleapi.CallOption) (*InterconnectLocation, error) {
  58159. gensupport.SetOptions(c.urlParams_, opts...)
  58160. res, err := c.doRequest("json")
  58161. if res != nil && res.StatusCode == http.StatusNotModified {
  58162. if res.Body != nil {
  58163. res.Body.Close()
  58164. }
  58165. return nil, &googleapi.Error{
  58166. Code: res.StatusCode,
  58167. Header: res.Header,
  58168. }
  58169. }
  58170. if err != nil {
  58171. return nil, err
  58172. }
  58173. defer googleapi.CloseBody(res)
  58174. if err := googleapi.CheckResponse(res); err != nil {
  58175. return nil, err
  58176. }
  58177. ret := &InterconnectLocation{
  58178. ServerResponse: googleapi.ServerResponse{
  58179. Header: res.Header,
  58180. HTTPStatusCode: res.StatusCode,
  58181. },
  58182. }
  58183. target := &ret
  58184. if err := gensupport.DecodeResponse(target, res); err != nil {
  58185. return nil, err
  58186. }
  58187. return ret, nil
  58188. // {
  58189. // "description": "Returns the details for the specified interconnect location. Gets a list of available interconnect locations by making a list() request.",
  58190. // "httpMethod": "GET",
  58191. // "id": "compute.interconnectLocations.get",
  58192. // "parameterOrder": [
  58193. // "project",
  58194. // "interconnectLocation"
  58195. // ],
  58196. // "parameters": {
  58197. // "interconnectLocation": {
  58198. // "description": "Name of the interconnect location to return.",
  58199. // "location": "path",
  58200. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  58201. // "required": true,
  58202. // "type": "string"
  58203. // },
  58204. // "project": {
  58205. // "description": "Project ID for this request.",
  58206. // "location": "path",
  58207. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  58208. // "required": true,
  58209. // "type": "string"
  58210. // }
  58211. // },
  58212. // "path": "{project}/global/interconnectLocations/{interconnectLocation}",
  58213. // "response": {
  58214. // "$ref": "InterconnectLocation"
  58215. // },
  58216. // "scopes": [
  58217. // "https://www.googleapis.com/auth/cloud-platform",
  58218. // "https://www.googleapis.com/auth/compute",
  58219. // "https://www.googleapis.com/auth/compute.readonly"
  58220. // ]
  58221. // }
  58222. }
  58223. // method id "compute.interconnectLocations.list":
  58224. type InterconnectLocationsListCall struct {
  58225. s *Service
  58226. project string
  58227. urlParams_ gensupport.URLParams
  58228. ifNoneMatch_ string
  58229. ctx_ context.Context
  58230. header_ http.Header
  58231. }
  58232. // List: Retrieves the list of interconnect locations available to the
  58233. // specified project.
  58234. func (r *InterconnectLocationsService) List(project string) *InterconnectLocationsListCall {
  58235. c := &InterconnectLocationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  58236. c.project = project
  58237. return c
  58238. }
  58239. // Filter sets the optional parameter "filter": A filter expression that
  58240. // filters resources listed in the response. The expression must specify
  58241. // the field name, a comparison operator, and the value that you want to
  58242. // use for filtering. The value must be a string, a number, or a
  58243. // boolean. The comparison operator must be either =, !=, >, or <.
  58244. //
  58245. // For example, if you are filtering Compute Engine instances, you can
  58246. // exclude instances named example-instance by specifying name !=
  58247. // example-instance.
  58248. //
  58249. // You can also filter nested fields. For example, you could specify
  58250. // scheduling.automaticRestart = false to include instances only if they
  58251. // are not scheduled for automatic restarts. You can use filtering on
  58252. // nested fields to filter based on resource labels.
  58253. //
  58254. // To filter on multiple expressions, provide each separate expression
  58255. // within parentheses. For example, (scheduling.automaticRestart = true)
  58256. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  58257. // AND expression. However, you can include AND and OR expressions
  58258. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  58259. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  58260. // true).
  58261. func (c *InterconnectLocationsListCall) Filter(filter string) *InterconnectLocationsListCall {
  58262. c.urlParams_.Set("filter", filter)
  58263. return c
  58264. }
  58265. // MaxResults sets the optional parameter "maxResults": The maximum
  58266. // number of results per page that should be returned. If the number of
  58267. // available results is larger than maxResults, Compute Engine returns a
  58268. // nextPageToken that can be used to get the next page of results in
  58269. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  58270. // (Default: 500)
  58271. func (c *InterconnectLocationsListCall) MaxResults(maxResults int64) *InterconnectLocationsListCall {
  58272. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  58273. return c
  58274. }
  58275. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  58276. // a certain order. By default, results are returned in alphanumerical
  58277. // order based on the resource name.
  58278. //
  58279. // You can also sort results in descending order based on the creation
  58280. // timestamp using orderBy="creationTimestamp desc". This sorts results
  58281. // based on the creationTimestamp field in reverse chronological order
  58282. // (newest result first). Use this to sort resources like operations so
  58283. // that the newest operation is returned first.
  58284. //
  58285. // Currently, only sorting by name or creationTimestamp desc is
  58286. // supported.
  58287. func (c *InterconnectLocationsListCall) OrderBy(orderBy string) *InterconnectLocationsListCall {
  58288. c.urlParams_.Set("orderBy", orderBy)
  58289. return c
  58290. }
  58291. // PageToken sets the optional parameter "pageToken": Specifies a page
  58292. // token to use. Set pageToken to the nextPageToken returned by a
  58293. // previous list request to get the next page of results.
  58294. func (c *InterconnectLocationsListCall) PageToken(pageToken string) *InterconnectLocationsListCall {
  58295. c.urlParams_.Set("pageToken", pageToken)
  58296. return c
  58297. }
  58298. // Fields allows partial responses to be retrieved. See
  58299. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  58300. // for more information.
  58301. func (c *InterconnectLocationsListCall) Fields(s ...googleapi.Field) *InterconnectLocationsListCall {
  58302. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  58303. return c
  58304. }
  58305. // IfNoneMatch sets the optional parameter which makes the operation
  58306. // fail if the object's ETag matches the given value. This is useful for
  58307. // getting updates only after the object has changed since the last
  58308. // request. Use googleapi.IsNotModified to check whether the response
  58309. // error from Do is the result of In-None-Match.
  58310. func (c *InterconnectLocationsListCall) IfNoneMatch(entityTag string) *InterconnectLocationsListCall {
  58311. c.ifNoneMatch_ = entityTag
  58312. return c
  58313. }
  58314. // Context sets the context to be used in this call's Do method. Any
  58315. // pending HTTP request will be aborted if the provided context is
  58316. // canceled.
  58317. func (c *InterconnectLocationsListCall) Context(ctx context.Context) *InterconnectLocationsListCall {
  58318. c.ctx_ = ctx
  58319. return c
  58320. }
  58321. // Header returns an http.Header that can be modified by the caller to
  58322. // add HTTP headers to the request.
  58323. func (c *InterconnectLocationsListCall) Header() http.Header {
  58324. if c.header_ == nil {
  58325. c.header_ = make(http.Header)
  58326. }
  58327. return c.header_
  58328. }
  58329. func (c *InterconnectLocationsListCall) doRequest(alt string) (*http.Response, error) {
  58330. reqHeaders := make(http.Header)
  58331. for k, v := range c.header_ {
  58332. reqHeaders[k] = v
  58333. }
  58334. reqHeaders.Set("User-Agent", c.s.userAgent())
  58335. if c.ifNoneMatch_ != "" {
  58336. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  58337. }
  58338. var body io.Reader = nil
  58339. c.urlParams_.Set("alt", alt)
  58340. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/interconnectLocations")
  58341. urls += "?" + c.urlParams_.Encode()
  58342. req, _ := http.NewRequest("GET", urls, body)
  58343. req.Header = reqHeaders
  58344. googleapi.Expand(req.URL, map[string]string{
  58345. "project": c.project,
  58346. })
  58347. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  58348. }
  58349. // Do executes the "compute.interconnectLocations.list" call.
  58350. // Exactly one of *InterconnectLocationList or error will be non-nil.
  58351. // Any non-2xx status code is an error. Response headers are in either
  58352. // *InterconnectLocationList.ServerResponse.Header or (if a response was
  58353. // returned at all) in error.(*googleapi.Error).Header. Use
  58354. // googleapi.IsNotModified to check whether the returned error was
  58355. // because http.StatusNotModified was returned.
  58356. func (c *InterconnectLocationsListCall) Do(opts ...googleapi.CallOption) (*InterconnectLocationList, error) {
  58357. gensupport.SetOptions(c.urlParams_, opts...)
  58358. res, err := c.doRequest("json")
  58359. if res != nil && res.StatusCode == http.StatusNotModified {
  58360. if res.Body != nil {
  58361. res.Body.Close()
  58362. }
  58363. return nil, &googleapi.Error{
  58364. Code: res.StatusCode,
  58365. Header: res.Header,
  58366. }
  58367. }
  58368. if err != nil {
  58369. return nil, err
  58370. }
  58371. defer googleapi.CloseBody(res)
  58372. if err := googleapi.CheckResponse(res); err != nil {
  58373. return nil, err
  58374. }
  58375. ret := &InterconnectLocationList{
  58376. ServerResponse: googleapi.ServerResponse{
  58377. Header: res.Header,
  58378. HTTPStatusCode: res.StatusCode,
  58379. },
  58380. }
  58381. target := &ret
  58382. if err := gensupport.DecodeResponse(target, res); err != nil {
  58383. return nil, err
  58384. }
  58385. return ret, nil
  58386. // {
  58387. // "description": "Retrieves the list of interconnect locations available to the specified project.",
  58388. // "httpMethod": "GET",
  58389. // "id": "compute.interconnectLocations.list",
  58390. // "parameterOrder": [
  58391. // "project"
  58392. // ],
  58393. // "parameters": {
  58394. // "filter": {
  58395. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  58396. // "location": "query",
  58397. // "type": "string"
  58398. // },
  58399. // "maxResults": {
  58400. // "default": "500",
  58401. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  58402. // "format": "uint32",
  58403. // "location": "query",
  58404. // "minimum": "0",
  58405. // "type": "integer"
  58406. // },
  58407. // "orderBy": {
  58408. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  58409. // "location": "query",
  58410. // "type": "string"
  58411. // },
  58412. // "pageToken": {
  58413. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  58414. // "location": "query",
  58415. // "type": "string"
  58416. // },
  58417. // "project": {
  58418. // "description": "Project ID for this request.",
  58419. // "location": "path",
  58420. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  58421. // "required": true,
  58422. // "type": "string"
  58423. // }
  58424. // },
  58425. // "path": "{project}/global/interconnectLocations",
  58426. // "response": {
  58427. // "$ref": "InterconnectLocationList"
  58428. // },
  58429. // "scopes": [
  58430. // "https://www.googleapis.com/auth/cloud-platform",
  58431. // "https://www.googleapis.com/auth/compute",
  58432. // "https://www.googleapis.com/auth/compute.readonly"
  58433. // ]
  58434. // }
  58435. }
  58436. // Pages invokes f for each page of results.
  58437. // A non-nil error returned from f will halt the iteration.
  58438. // The provided context supersedes any context provided to the Context method.
  58439. func (c *InterconnectLocationsListCall) Pages(ctx context.Context, f func(*InterconnectLocationList) error) error {
  58440. c.ctx_ = ctx
  58441. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  58442. for {
  58443. x, err := c.Do()
  58444. if err != nil {
  58445. return err
  58446. }
  58447. if err := f(x); err != nil {
  58448. return err
  58449. }
  58450. if x.NextPageToken == "" {
  58451. return nil
  58452. }
  58453. c.PageToken(x.NextPageToken)
  58454. }
  58455. }
  58456. // method id "compute.interconnects.delete":
  58457. type InterconnectsDeleteCall struct {
  58458. s *Service
  58459. project string
  58460. interconnect string
  58461. urlParams_ gensupport.URLParams
  58462. ctx_ context.Context
  58463. header_ http.Header
  58464. }
  58465. // Delete: Deletes the specified interconnect.
  58466. func (r *InterconnectsService) Delete(project string, interconnect string) *InterconnectsDeleteCall {
  58467. c := &InterconnectsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  58468. c.project = project
  58469. c.interconnect = interconnect
  58470. return c
  58471. }
  58472. // RequestId sets the optional parameter "requestId": An optional
  58473. // request ID to identify requests. Specify a unique request ID so that
  58474. // if you must retry your request, the server will know to ignore the
  58475. // request if it has already been completed.
  58476. //
  58477. // For example, consider a situation where you make an initial request
  58478. // and the request times out. If you make the request again with the
  58479. // same request ID, the server can check if original operation with the
  58480. // same request ID was received, and if so, will ignore the second
  58481. // request. This prevents clients from accidentally creating duplicate
  58482. // commitments.
  58483. //
  58484. // The request ID must be a valid UUID with the exception that zero UUID
  58485. // is not supported (00000000-0000-0000-0000-000000000000).
  58486. func (c *InterconnectsDeleteCall) RequestId(requestId string) *InterconnectsDeleteCall {
  58487. c.urlParams_.Set("requestId", requestId)
  58488. return c
  58489. }
  58490. // Fields allows partial responses to be retrieved. See
  58491. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  58492. // for more information.
  58493. func (c *InterconnectsDeleteCall) Fields(s ...googleapi.Field) *InterconnectsDeleteCall {
  58494. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  58495. return c
  58496. }
  58497. // Context sets the context to be used in this call's Do method. Any
  58498. // pending HTTP request will be aborted if the provided context is
  58499. // canceled.
  58500. func (c *InterconnectsDeleteCall) Context(ctx context.Context) *InterconnectsDeleteCall {
  58501. c.ctx_ = ctx
  58502. return c
  58503. }
  58504. // Header returns an http.Header that can be modified by the caller to
  58505. // add HTTP headers to the request.
  58506. func (c *InterconnectsDeleteCall) Header() http.Header {
  58507. if c.header_ == nil {
  58508. c.header_ = make(http.Header)
  58509. }
  58510. return c.header_
  58511. }
  58512. func (c *InterconnectsDeleteCall) doRequest(alt string) (*http.Response, error) {
  58513. reqHeaders := make(http.Header)
  58514. for k, v := range c.header_ {
  58515. reqHeaders[k] = v
  58516. }
  58517. reqHeaders.Set("User-Agent", c.s.userAgent())
  58518. var body io.Reader = nil
  58519. c.urlParams_.Set("alt", alt)
  58520. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/interconnects/{interconnect}")
  58521. urls += "?" + c.urlParams_.Encode()
  58522. req, _ := http.NewRequest("DELETE", urls, body)
  58523. req.Header = reqHeaders
  58524. googleapi.Expand(req.URL, map[string]string{
  58525. "project": c.project,
  58526. "interconnect": c.interconnect,
  58527. })
  58528. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  58529. }
  58530. // Do executes the "compute.interconnects.delete" call.
  58531. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  58532. // status code is an error. Response headers are in either
  58533. // *Operation.ServerResponse.Header or (if a response was returned at
  58534. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  58535. // to check whether the returned error was because
  58536. // http.StatusNotModified was returned.
  58537. func (c *InterconnectsDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  58538. gensupport.SetOptions(c.urlParams_, opts...)
  58539. res, err := c.doRequest("json")
  58540. if res != nil && res.StatusCode == http.StatusNotModified {
  58541. if res.Body != nil {
  58542. res.Body.Close()
  58543. }
  58544. return nil, &googleapi.Error{
  58545. Code: res.StatusCode,
  58546. Header: res.Header,
  58547. }
  58548. }
  58549. if err != nil {
  58550. return nil, err
  58551. }
  58552. defer googleapi.CloseBody(res)
  58553. if err := googleapi.CheckResponse(res); err != nil {
  58554. return nil, err
  58555. }
  58556. ret := &Operation{
  58557. ServerResponse: googleapi.ServerResponse{
  58558. Header: res.Header,
  58559. HTTPStatusCode: res.StatusCode,
  58560. },
  58561. }
  58562. target := &ret
  58563. if err := gensupport.DecodeResponse(target, res); err != nil {
  58564. return nil, err
  58565. }
  58566. return ret, nil
  58567. // {
  58568. // "description": "Deletes the specified interconnect.",
  58569. // "httpMethod": "DELETE",
  58570. // "id": "compute.interconnects.delete",
  58571. // "parameterOrder": [
  58572. // "project",
  58573. // "interconnect"
  58574. // ],
  58575. // "parameters": {
  58576. // "interconnect": {
  58577. // "description": "Name of the interconnect to delete.",
  58578. // "location": "path",
  58579. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  58580. // "required": true,
  58581. // "type": "string"
  58582. // },
  58583. // "project": {
  58584. // "description": "Project ID for this request.",
  58585. // "location": "path",
  58586. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  58587. // "required": true,
  58588. // "type": "string"
  58589. // },
  58590. // "requestId": {
  58591. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  58592. // "location": "query",
  58593. // "type": "string"
  58594. // }
  58595. // },
  58596. // "path": "{project}/global/interconnects/{interconnect}",
  58597. // "response": {
  58598. // "$ref": "Operation"
  58599. // },
  58600. // "scopes": [
  58601. // "https://www.googleapis.com/auth/cloud-platform",
  58602. // "https://www.googleapis.com/auth/compute"
  58603. // ]
  58604. // }
  58605. }
  58606. // method id "compute.interconnects.get":
  58607. type InterconnectsGetCall struct {
  58608. s *Service
  58609. project string
  58610. interconnect string
  58611. urlParams_ gensupport.URLParams
  58612. ifNoneMatch_ string
  58613. ctx_ context.Context
  58614. header_ http.Header
  58615. }
  58616. // Get: Returns the specified interconnect. Get a list of available
  58617. // interconnects by making a list() request.
  58618. func (r *InterconnectsService) Get(project string, interconnect string) *InterconnectsGetCall {
  58619. c := &InterconnectsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  58620. c.project = project
  58621. c.interconnect = interconnect
  58622. return c
  58623. }
  58624. // Fields allows partial responses to be retrieved. See
  58625. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  58626. // for more information.
  58627. func (c *InterconnectsGetCall) Fields(s ...googleapi.Field) *InterconnectsGetCall {
  58628. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  58629. return c
  58630. }
  58631. // IfNoneMatch sets the optional parameter which makes the operation
  58632. // fail if the object's ETag matches the given value. This is useful for
  58633. // getting updates only after the object has changed since the last
  58634. // request. Use googleapi.IsNotModified to check whether the response
  58635. // error from Do is the result of In-None-Match.
  58636. func (c *InterconnectsGetCall) IfNoneMatch(entityTag string) *InterconnectsGetCall {
  58637. c.ifNoneMatch_ = entityTag
  58638. return c
  58639. }
  58640. // Context sets the context to be used in this call's Do method. Any
  58641. // pending HTTP request will be aborted if the provided context is
  58642. // canceled.
  58643. func (c *InterconnectsGetCall) Context(ctx context.Context) *InterconnectsGetCall {
  58644. c.ctx_ = ctx
  58645. return c
  58646. }
  58647. // Header returns an http.Header that can be modified by the caller to
  58648. // add HTTP headers to the request.
  58649. func (c *InterconnectsGetCall) Header() http.Header {
  58650. if c.header_ == nil {
  58651. c.header_ = make(http.Header)
  58652. }
  58653. return c.header_
  58654. }
  58655. func (c *InterconnectsGetCall) doRequest(alt string) (*http.Response, error) {
  58656. reqHeaders := make(http.Header)
  58657. for k, v := range c.header_ {
  58658. reqHeaders[k] = v
  58659. }
  58660. reqHeaders.Set("User-Agent", c.s.userAgent())
  58661. if c.ifNoneMatch_ != "" {
  58662. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  58663. }
  58664. var body io.Reader = nil
  58665. c.urlParams_.Set("alt", alt)
  58666. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/interconnects/{interconnect}")
  58667. urls += "?" + c.urlParams_.Encode()
  58668. req, _ := http.NewRequest("GET", urls, body)
  58669. req.Header = reqHeaders
  58670. googleapi.Expand(req.URL, map[string]string{
  58671. "project": c.project,
  58672. "interconnect": c.interconnect,
  58673. })
  58674. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  58675. }
  58676. // Do executes the "compute.interconnects.get" call.
  58677. // Exactly one of *Interconnect or error will be non-nil. Any non-2xx
  58678. // status code is an error. Response headers are in either
  58679. // *Interconnect.ServerResponse.Header or (if a response was returned at
  58680. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  58681. // to check whether the returned error was because
  58682. // http.StatusNotModified was returned.
  58683. func (c *InterconnectsGetCall) Do(opts ...googleapi.CallOption) (*Interconnect, error) {
  58684. gensupport.SetOptions(c.urlParams_, opts...)
  58685. res, err := c.doRequest("json")
  58686. if res != nil && res.StatusCode == http.StatusNotModified {
  58687. if res.Body != nil {
  58688. res.Body.Close()
  58689. }
  58690. return nil, &googleapi.Error{
  58691. Code: res.StatusCode,
  58692. Header: res.Header,
  58693. }
  58694. }
  58695. if err != nil {
  58696. return nil, err
  58697. }
  58698. defer googleapi.CloseBody(res)
  58699. if err := googleapi.CheckResponse(res); err != nil {
  58700. return nil, err
  58701. }
  58702. ret := &Interconnect{
  58703. ServerResponse: googleapi.ServerResponse{
  58704. Header: res.Header,
  58705. HTTPStatusCode: res.StatusCode,
  58706. },
  58707. }
  58708. target := &ret
  58709. if err := gensupport.DecodeResponse(target, res); err != nil {
  58710. return nil, err
  58711. }
  58712. return ret, nil
  58713. // {
  58714. // "description": "Returns the specified interconnect. Get a list of available interconnects by making a list() request.",
  58715. // "httpMethod": "GET",
  58716. // "id": "compute.interconnects.get",
  58717. // "parameterOrder": [
  58718. // "project",
  58719. // "interconnect"
  58720. // ],
  58721. // "parameters": {
  58722. // "interconnect": {
  58723. // "description": "Name of the interconnect to return.",
  58724. // "location": "path",
  58725. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  58726. // "required": true,
  58727. // "type": "string"
  58728. // },
  58729. // "project": {
  58730. // "description": "Project ID for this request.",
  58731. // "location": "path",
  58732. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  58733. // "required": true,
  58734. // "type": "string"
  58735. // }
  58736. // },
  58737. // "path": "{project}/global/interconnects/{interconnect}",
  58738. // "response": {
  58739. // "$ref": "Interconnect"
  58740. // },
  58741. // "scopes": [
  58742. // "https://www.googleapis.com/auth/cloud-platform",
  58743. // "https://www.googleapis.com/auth/compute",
  58744. // "https://www.googleapis.com/auth/compute.readonly"
  58745. // ]
  58746. // }
  58747. }
  58748. // method id "compute.interconnects.insert":
  58749. type InterconnectsInsertCall struct {
  58750. s *Service
  58751. project string
  58752. interconnect *Interconnect
  58753. urlParams_ gensupport.URLParams
  58754. ctx_ context.Context
  58755. header_ http.Header
  58756. }
  58757. // Insert: Creates a Interconnect in the specified project using the
  58758. // data included in the request.
  58759. func (r *InterconnectsService) Insert(project string, interconnect *Interconnect) *InterconnectsInsertCall {
  58760. c := &InterconnectsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  58761. c.project = project
  58762. c.interconnect = interconnect
  58763. return c
  58764. }
  58765. // RequestId sets the optional parameter "requestId": An optional
  58766. // request ID to identify requests. Specify a unique request ID so that
  58767. // if you must retry your request, the server will know to ignore the
  58768. // request if it has already been completed.
  58769. //
  58770. // For example, consider a situation where you make an initial request
  58771. // and the request times out. If you make the request again with the
  58772. // same request ID, the server can check if original operation with the
  58773. // same request ID was received, and if so, will ignore the second
  58774. // request. This prevents clients from accidentally creating duplicate
  58775. // commitments.
  58776. //
  58777. // The request ID must be a valid UUID with the exception that zero UUID
  58778. // is not supported (00000000-0000-0000-0000-000000000000).
  58779. func (c *InterconnectsInsertCall) RequestId(requestId string) *InterconnectsInsertCall {
  58780. c.urlParams_.Set("requestId", requestId)
  58781. return c
  58782. }
  58783. // Fields allows partial responses to be retrieved. See
  58784. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  58785. // for more information.
  58786. func (c *InterconnectsInsertCall) Fields(s ...googleapi.Field) *InterconnectsInsertCall {
  58787. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  58788. return c
  58789. }
  58790. // Context sets the context to be used in this call's Do method. Any
  58791. // pending HTTP request will be aborted if the provided context is
  58792. // canceled.
  58793. func (c *InterconnectsInsertCall) Context(ctx context.Context) *InterconnectsInsertCall {
  58794. c.ctx_ = ctx
  58795. return c
  58796. }
  58797. // Header returns an http.Header that can be modified by the caller to
  58798. // add HTTP headers to the request.
  58799. func (c *InterconnectsInsertCall) Header() http.Header {
  58800. if c.header_ == nil {
  58801. c.header_ = make(http.Header)
  58802. }
  58803. return c.header_
  58804. }
  58805. func (c *InterconnectsInsertCall) doRequest(alt string) (*http.Response, error) {
  58806. reqHeaders := make(http.Header)
  58807. for k, v := range c.header_ {
  58808. reqHeaders[k] = v
  58809. }
  58810. reqHeaders.Set("User-Agent", c.s.userAgent())
  58811. var body io.Reader = nil
  58812. body, err := googleapi.WithoutDataWrapper.JSONReader(c.interconnect)
  58813. if err != nil {
  58814. return nil, err
  58815. }
  58816. reqHeaders.Set("Content-Type", "application/json")
  58817. c.urlParams_.Set("alt", alt)
  58818. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/interconnects")
  58819. urls += "?" + c.urlParams_.Encode()
  58820. req, _ := http.NewRequest("POST", urls, body)
  58821. req.Header = reqHeaders
  58822. googleapi.Expand(req.URL, map[string]string{
  58823. "project": c.project,
  58824. })
  58825. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  58826. }
  58827. // Do executes the "compute.interconnects.insert" call.
  58828. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  58829. // status code is an error. Response headers are in either
  58830. // *Operation.ServerResponse.Header or (if a response was returned at
  58831. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  58832. // to check whether the returned error was because
  58833. // http.StatusNotModified was returned.
  58834. func (c *InterconnectsInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  58835. gensupport.SetOptions(c.urlParams_, opts...)
  58836. res, err := c.doRequest("json")
  58837. if res != nil && res.StatusCode == http.StatusNotModified {
  58838. if res.Body != nil {
  58839. res.Body.Close()
  58840. }
  58841. return nil, &googleapi.Error{
  58842. Code: res.StatusCode,
  58843. Header: res.Header,
  58844. }
  58845. }
  58846. if err != nil {
  58847. return nil, err
  58848. }
  58849. defer googleapi.CloseBody(res)
  58850. if err := googleapi.CheckResponse(res); err != nil {
  58851. return nil, err
  58852. }
  58853. ret := &Operation{
  58854. ServerResponse: googleapi.ServerResponse{
  58855. Header: res.Header,
  58856. HTTPStatusCode: res.StatusCode,
  58857. },
  58858. }
  58859. target := &ret
  58860. if err := gensupport.DecodeResponse(target, res); err != nil {
  58861. return nil, err
  58862. }
  58863. return ret, nil
  58864. // {
  58865. // "description": "Creates a Interconnect in the specified project using the data included in the request.",
  58866. // "httpMethod": "POST",
  58867. // "id": "compute.interconnects.insert",
  58868. // "parameterOrder": [
  58869. // "project"
  58870. // ],
  58871. // "parameters": {
  58872. // "project": {
  58873. // "description": "Project ID for this request.",
  58874. // "location": "path",
  58875. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  58876. // "required": true,
  58877. // "type": "string"
  58878. // },
  58879. // "requestId": {
  58880. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  58881. // "location": "query",
  58882. // "type": "string"
  58883. // }
  58884. // },
  58885. // "path": "{project}/global/interconnects",
  58886. // "request": {
  58887. // "$ref": "Interconnect"
  58888. // },
  58889. // "response": {
  58890. // "$ref": "Operation"
  58891. // },
  58892. // "scopes": [
  58893. // "https://www.googleapis.com/auth/cloud-platform",
  58894. // "https://www.googleapis.com/auth/compute"
  58895. // ]
  58896. // }
  58897. }
  58898. // method id "compute.interconnects.list":
  58899. type InterconnectsListCall struct {
  58900. s *Service
  58901. project string
  58902. urlParams_ gensupport.URLParams
  58903. ifNoneMatch_ string
  58904. ctx_ context.Context
  58905. header_ http.Header
  58906. }
  58907. // List: Retrieves the list of interconnect available to the specified
  58908. // project.
  58909. func (r *InterconnectsService) List(project string) *InterconnectsListCall {
  58910. c := &InterconnectsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  58911. c.project = project
  58912. return c
  58913. }
  58914. // Filter sets the optional parameter "filter": A filter expression that
  58915. // filters resources listed in the response. The expression must specify
  58916. // the field name, a comparison operator, and the value that you want to
  58917. // use for filtering. The value must be a string, a number, or a
  58918. // boolean. The comparison operator must be either =, !=, >, or <.
  58919. //
  58920. // For example, if you are filtering Compute Engine instances, you can
  58921. // exclude instances named example-instance by specifying name !=
  58922. // example-instance.
  58923. //
  58924. // You can also filter nested fields. For example, you could specify
  58925. // scheduling.automaticRestart = false to include instances only if they
  58926. // are not scheduled for automatic restarts. You can use filtering on
  58927. // nested fields to filter based on resource labels.
  58928. //
  58929. // To filter on multiple expressions, provide each separate expression
  58930. // within parentheses. For example, (scheduling.automaticRestart = true)
  58931. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  58932. // AND expression. However, you can include AND and OR expressions
  58933. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  58934. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  58935. // true).
  58936. func (c *InterconnectsListCall) Filter(filter string) *InterconnectsListCall {
  58937. c.urlParams_.Set("filter", filter)
  58938. return c
  58939. }
  58940. // MaxResults sets the optional parameter "maxResults": The maximum
  58941. // number of results per page that should be returned. If the number of
  58942. // available results is larger than maxResults, Compute Engine returns a
  58943. // nextPageToken that can be used to get the next page of results in
  58944. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  58945. // (Default: 500)
  58946. func (c *InterconnectsListCall) MaxResults(maxResults int64) *InterconnectsListCall {
  58947. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  58948. return c
  58949. }
  58950. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  58951. // a certain order. By default, results are returned in alphanumerical
  58952. // order based on the resource name.
  58953. //
  58954. // You can also sort results in descending order based on the creation
  58955. // timestamp using orderBy="creationTimestamp desc". This sorts results
  58956. // based on the creationTimestamp field in reverse chronological order
  58957. // (newest result first). Use this to sort resources like operations so
  58958. // that the newest operation is returned first.
  58959. //
  58960. // Currently, only sorting by name or creationTimestamp desc is
  58961. // supported.
  58962. func (c *InterconnectsListCall) OrderBy(orderBy string) *InterconnectsListCall {
  58963. c.urlParams_.Set("orderBy", orderBy)
  58964. return c
  58965. }
  58966. // PageToken sets the optional parameter "pageToken": Specifies a page
  58967. // token to use. Set pageToken to the nextPageToken returned by a
  58968. // previous list request to get the next page of results.
  58969. func (c *InterconnectsListCall) PageToken(pageToken string) *InterconnectsListCall {
  58970. c.urlParams_.Set("pageToken", pageToken)
  58971. return c
  58972. }
  58973. // Fields allows partial responses to be retrieved. See
  58974. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  58975. // for more information.
  58976. func (c *InterconnectsListCall) Fields(s ...googleapi.Field) *InterconnectsListCall {
  58977. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  58978. return c
  58979. }
  58980. // IfNoneMatch sets the optional parameter which makes the operation
  58981. // fail if the object's ETag matches the given value. This is useful for
  58982. // getting updates only after the object has changed since the last
  58983. // request. Use googleapi.IsNotModified to check whether the response
  58984. // error from Do is the result of In-None-Match.
  58985. func (c *InterconnectsListCall) IfNoneMatch(entityTag string) *InterconnectsListCall {
  58986. c.ifNoneMatch_ = entityTag
  58987. return c
  58988. }
  58989. // Context sets the context to be used in this call's Do method. Any
  58990. // pending HTTP request will be aborted if the provided context is
  58991. // canceled.
  58992. func (c *InterconnectsListCall) Context(ctx context.Context) *InterconnectsListCall {
  58993. c.ctx_ = ctx
  58994. return c
  58995. }
  58996. // Header returns an http.Header that can be modified by the caller to
  58997. // add HTTP headers to the request.
  58998. func (c *InterconnectsListCall) Header() http.Header {
  58999. if c.header_ == nil {
  59000. c.header_ = make(http.Header)
  59001. }
  59002. return c.header_
  59003. }
  59004. func (c *InterconnectsListCall) doRequest(alt string) (*http.Response, error) {
  59005. reqHeaders := make(http.Header)
  59006. for k, v := range c.header_ {
  59007. reqHeaders[k] = v
  59008. }
  59009. reqHeaders.Set("User-Agent", c.s.userAgent())
  59010. if c.ifNoneMatch_ != "" {
  59011. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  59012. }
  59013. var body io.Reader = nil
  59014. c.urlParams_.Set("alt", alt)
  59015. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/interconnects")
  59016. urls += "?" + c.urlParams_.Encode()
  59017. req, _ := http.NewRequest("GET", urls, body)
  59018. req.Header = reqHeaders
  59019. googleapi.Expand(req.URL, map[string]string{
  59020. "project": c.project,
  59021. })
  59022. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  59023. }
  59024. // Do executes the "compute.interconnects.list" call.
  59025. // Exactly one of *InterconnectList or error will be non-nil. Any
  59026. // non-2xx status code is an error. Response headers are in either
  59027. // *InterconnectList.ServerResponse.Header or (if a response was
  59028. // returned at all) in error.(*googleapi.Error).Header. Use
  59029. // googleapi.IsNotModified to check whether the returned error was
  59030. // because http.StatusNotModified was returned.
  59031. func (c *InterconnectsListCall) Do(opts ...googleapi.CallOption) (*InterconnectList, error) {
  59032. gensupport.SetOptions(c.urlParams_, opts...)
  59033. res, err := c.doRequest("json")
  59034. if res != nil && res.StatusCode == http.StatusNotModified {
  59035. if res.Body != nil {
  59036. res.Body.Close()
  59037. }
  59038. return nil, &googleapi.Error{
  59039. Code: res.StatusCode,
  59040. Header: res.Header,
  59041. }
  59042. }
  59043. if err != nil {
  59044. return nil, err
  59045. }
  59046. defer googleapi.CloseBody(res)
  59047. if err := googleapi.CheckResponse(res); err != nil {
  59048. return nil, err
  59049. }
  59050. ret := &InterconnectList{
  59051. ServerResponse: googleapi.ServerResponse{
  59052. Header: res.Header,
  59053. HTTPStatusCode: res.StatusCode,
  59054. },
  59055. }
  59056. target := &ret
  59057. if err := gensupport.DecodeResponse(target, res); err != nil {
  59058. return nil, err
  59059. }
  59060. return ret, nil
  59061. // {
  59062. // "description": "Retrieves the list of interconnect available to the specified project.",
  59063. // "httpMethod": "GET",
  59064. // "id": "compute.interconnects.list",
  59065. // "parameterOrder": [
  59066. // "project"
  59067. // ],
  59068. // "parameters": {
  59069. // "filter": {
  59070. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  59071. // "location": "query",
  59072. // "type": "string"
  59073. // },
  59074. // "maxResults": {
  59075. // "default": "500",
  59076. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  59077. // "format": "uint32",
  59078. // "location": "query",
  59079. // "minimum": "0",
  59080. // "type": "integer"
  59081. // },
  59082. // "orderBy": {
  59083. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  59084. // "location": "query",
  59085. // "type": "string"
  59086. // },
  59087. // "pageToken": {
  59088. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  59089. // "location": "query",
  59090. // "type": "string"
  59091. // },
  59092. // "project": {
  59093. // "description": "Project ID for this request.",
  59094. // "location": "path",
  59095. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  59096. // "required": true,
  59097. // "type": "string"
  59098. // }
  59099. // },
  59100. // "path": "{project}/global/interconnects",
  59101. // "response": {
  59102. // "$ref": "InterconnectList"
  59103. // },
  59104. // "scopes": [
  59105. // "https://www.googleapis.com/auth/cloud-platform",
  59106. // "https://www.googleapis.com/auth/compute",
  59107. // "https://www.googleapis.com/auth/compute.readonly"
  59108. // ]
  59109. // }
  59110. }
  59111. // Pages invokes f for each page of results.
  59112. // A non-nil error returned from f will halt the iteration.
  59113. // The provided context supersedes any context provided to the Context method.
  59114. func (c *InterconnectsListCall) Pages(ctx context.Context, f func(*InterconnectList) error) error {
  59115. c.ctx_ = ctx
  59116. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  59117. for {
  59118. x, err := c.Do()
  59119. if err != nil {
  59120. return err
  59121. }
  59122. if err := f(x); err != nil {
  59123. return err
  59124. }
  59125. if x.NextPageToken == "" {
  59126. return nil
  59127. }
  59128. c.PageToken(x.NextPageToken)
  59129. }
  59130. }
  59131. // method id "compute.interconnects.patch":
  59132. type InterconnectsPatchCall struct {
  59133. s *Service
  59134. project string
  59135. interconnect string
  59136. interconnect2 *Interconnect
  59137. urlParams_ gensupport.URLParams
  59138. ctx_ context.Context
  59139. header_ http.Header
  59140. }
  59141. // Patch: Updates the specified interconnect with the data included in
  59142. // the request. This method supports PATCH semantics and uses the JSON
  59143. // merge patch format and processing rules.
  59144. func (r *InterconnectsService) Patch(project string, interconnect string, interconnect2 *Interconnect) *InterconnectsPatchCall {
  59145. c := &InterconnectsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  59146. c.project = project
  59147. c.interconnect = interconnect
  59148. c.interconnect2 = interconnect2
  59149. return c
  59150. }
  59151. // RequestId sets the optional parameter "requestId": An optional
  59152. // request ID to identify requests. Specify a unique request ID so that
  59153. // if you must retry your request, the server will know to ignore the
  59154. // request if it has already been completed.
  59155. //
  59156. // For example, consider a situation where you make an initial request
  59157. // and the request times out. If you make the request again with the
  59158. // same request ID, the server can check if original operation with the
  59159. // same request ID was received, and if so, will ignore the second
  59160. // request. This prevents clients from accidentally creating duplicate
  59161. // commitments.
  59162. //
  59163. // The request ID must be a valid UUID with the exception that zero UUID
  59164. // is not supported (00000000-0000-0000-0000-000000000000).
  59165. func (c *InterconnectsPatchCall) RequestId(requestId string) *InterconnectsPatchCall {
  59166. c.urlParams_.Set("requestId", requestId)
  59167. return c
  59168. }
  59169. // Fields allows partial responses to be retrieved. See
  59170. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  59171. // for more information.
  59172. func (c *InterconnectsPatchCall) Fields(s ...googleapi.Field) *InterconnectsPatchCall {
  59173. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  59174. return c
  59175. }
  59176. // Context sets the context to be used in this call's Do method. Any
  59177. // pending HTTP request will be aborted if the provided context is
  59178. // canceled.
  59179. func (c *InterconnectsPatchCall) Context(ctx context.Context) *InterconnectsPatchCall {
  59180. c.ctx_ = ctx
  59181. return c
  59182. }
  59183. // Header returns an http.Header that can be modified by the caller to
  59184. // add HTTP headers to the request.
  59185. func (c *InterconnectsPatchCall) Header() http.Header {
  59186. if c.header_ == nil {
  59187. c.header_ = make(http.Header)
  59188. }
  59189. return c.header_
  59190. }
  59191. func (c *InterconnectsPatchCall) doRequest(alt string) (*http.Response, error) {
  59192. reqHeaders := make(http.Header)
  59193. for k, v := range c.header_ {
  59194. reqHeaders[k] = v
  59195. }
  59196. reqHeaders.Set("User-Agent", c.s.userAgent())
  59197. var body io.Reader = nil
  59198. body, err := googleapi.WithoutDataWrapper.JSONReader(c.interconnect2)
  59199. if err != nil {
  59200. return nil, err
  59201. }
  59202. reqHeaders.Set("Content-Type", "application/json")
  59203. c.urlParams_.Set("alt", alt)
  59204. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/interconnects/{interconnect}")
  59205. urls += "?" + c.urlParams_.Encode()
  59206. req, _ := http.NewRequest("PATCH", urls, body)
  59207. req.Header = reqHeaders
  59208. googleapi.Expand(req.URL, map[string]string{
  59209. "project": c.project,
  59210. "interconnect": c.interconnect,
  59211. })
  59212. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  59213. }
  59214. // Do executes the "compute.interconnects.patch" call.
  59215. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  59216. // status code is an error. Response headers are in either
  59217. // *Operation.ServerResponse.Header or (if a response was returned at
  59218. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  59219. // to check whether the returned error was because
  59220. // http.StatusNotModified was returned.
  59221. func (c *InterconnectsPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  59222. gensupport.SetOptions(c.urlParams_, opts...)
  59223. res, err := c.doRequest("json")
  59224. if res != nil && res.StatusCode == http.StatusNotModified {
  59225. if res.Body != nil {
  59226. res.Body.Close()
  59227. }
  59228. return nil, &googleapi.Error{
  59229. Code: res.StatusCode,
  59230. Header: res.Header,
  59231. }
  59232. }
  59233. if err != nil {
  59234. return nil, err
  59235. }
  59236. defer googleapi.CloseBody(res)
  59237. if err := googleapi.CheckResponse(res); err != nil {
  59238. return nil, err
  59239. }
  59240. ret := &Operation{
  59241. ServerResponse: googleapi.ServerResponse{
  59242. Header: res.Header,
  59243. HTTPStatusCode: res.StatusCode,
  59244. },
  59245. }
  59246. target := &ret
  59247. if err := gensupport.DecodeResponse(target, res); err != nil {
  59248. return nil, err
  59249. }
  59250. return ret, nil
  59251. // {
  59252. // "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.",
  59253. // "httpMethod": "PATCH",
  59254. // "id": "compute.interconnects.patch",
  59255. // "parameterOrder": [
  59256. // "project",
  59257. // "interconnect"
  59258. // ],
  59259. // "parameters": {
  59260. // "interconnect": {
  59261. // "description": "Name of the interconnect to update.",
  59262. // "location": "path",
  59263. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  59264. // "required": true,
  59265. // "type": "string"
  59266. // },
  59267. // "project": {
  59268. // "description": "Project ID for this request.",
  59269. // "location": "path",
  59270. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  59271. // "required": true,
  59272. // "type": "string"
  59273. // },
  59274. // "requestId": {
  59275. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  59276. // "location": "query",
  59277. // "type": "string"
  59278. // }
  59279. // },
  59280. // "path": "{project}/global/interconnects/{interconnect}",
  59281. // "request": {
  59282. // "$ref": "Interconnect"
  59283. // },
  59284. // "response": {
  59285. // "$ref": "Operation"
  59286. // },
  59287. // "scopes": [
  59288. // "https://www.googleapis.com/auth/cloud-platform",
  59289. // "https://www.googleapis.com/auth/compute"
  59290. // ]
  59291. // }
  59292. }
  59293. // method id "compute.interconnects.setLabels":
  59294. type InterconnectsSetLabelsCall struct {
  59295. s *Service
  59296. project string
  59297. resource string
  59298. globalsetlabelsrequest *GlobalSetLabelsRequest
  59299. urlParams_ gensupport.URLParams
  59300. ctx_ context.Context
  59301. header_ http.Header
  59302. }
  59303. // SetLabels: Sets the labels on an Interconnect. To learn more about
  59304. // labels, read the Labeling Resources documentation.
  59305. func (r *InterconnectsService) SetLabels(project string, resource string, globalsetlabelsrequest *GlobalSetLabelsRequest) *InterconnectsSetLabelsCall {
  59306. c := &InterconnectsSetLabelsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  59307. c.project = project
  59308. c.resource = resource
  59309. c.globalsetlabelsrequest = globalsetlabelsrequest
  59310. return c
  59311. }
  59312. // Fields allows partial responses to be retrieved. See
  59313. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  59314. // for more information.
  59315. func (c *InterconnectsSetLabelsCall) Fields(s ...googleapi.Field) *InterconnectsSetLabelsCall {
  59316. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  59317. return c
  59318. }
  59319. // Context sets the context to be used in this call's Do method. Any
  59320. // pending HTTP request will be aborted if the provided context is
  59321. // canceled.
  59322. func (c *InterconnectsSetLabelsCall) Context(ctx context.Context) *InterconnectsSetLabelsCall {
  59323. c.ctx_ = ctx
  59324. return c
  59325. }
  59326. // Header returns an http.Header that can be modified by the caller to
  59327. // add HTTP headers to the request.
  59328. func (c *InterconnectsSetLabelsCall) Header() http.Header {
  59329. if c.header_ == nil {
  59330. c.header_ = make(http.Header)
  59331. }
  59332. return c.header_
  59333. }
  59334. func (c *InterconnectsSetLabelsCall) doRequest(alt string) (*http.Response, error) {
  59335. reqHeaders := make(http.Header)
  59336. for k, v := range c.header_ {
  59337. reqHeaders[k] = v
  59338. }
  59339. reqHeaders.Set("User-Agent", c.s.userAgent())
  59340. var body io.Reader = nil
  59341. body, err := googleapi.WithoutDataWrapper.JSONReader(c.globalsetlabelsrequest)
  59342. if err != nil {
  59343. return nil, err
  59344. }
  59345. reqHeaders.Set("Content-Type", "application/json")
  59346. c.urlParams_.Set("alt", alt)
  59347. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/interconnects/{resource}/setLabels")
  59348. urls += "?" + c.urlParams_.Encode()
  59349. req, _ := http.NewRequest("POST", urls, body)
  59350. req.Header = reqHeaders
  59351. googleapi.Expand(req.URL, map[string]string{
  59352. "project": c.project,
  59353. "resource": c.resource,
  59354. })
  59355. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  59356. }
  59357. // Do executes the "compute.interconnects.setLabels" call.
  59358. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  59359. // status code is an error. Response headers are in either
  59360. // *Operation.ServerResponse.Header or (if a response was returned at
  59361. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  59362. // to check whether the returned error was because
  59363. // http.StatusNotModified was returned.
  59364. func (c *InterconnectsSetLabelsCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  59365. gensupport.SetOptions(c.urlParams_, opts...)
  59366. res, err := c.doRequest("json")
  59367. if res != nil && res.StatusCode == http.StatusNotModified {
  59368. if res.Body != nil {
  59369. res.Body.Close()
  59370. }
  59371. return nil, &googleapi.Error{
  59372. Code: res.StatusCode,
  59373. Header: res.Header,
  59374. }
  59375. }
  59376. if err != nil {
  59377. return nil, err
  59378. }
  59379. defer googleapi.CloseBody(res)
  59380. if err := googleapi.CheckResponse(res); err != nil {
  59381. return nil, err
  59382. }
  59383. ret := &Operation{
  59384. ServerResponse: googleapi.ServerResponse{
  59385. Header: res.Header,
  59386. HTTPStatusCode: res.StatusCode,
  59387. },
  59388. }
  59389. target := &ret
  59390. if err := gensupport.DecodeResponse(target, res); err != nil {
  59391. return nil, err
  59392. }
  59393. return ret, nil
  59394. // {
  59395. // "description": "Sets the labels on an Interconnect. To learn more about labels, read the Labeling Resources documentation.",
  59396. // "httpMethod": "POST",
  59397. // "id": "compute.interconnects.setLabels",
  59398. // "parameterOrder": [
  59399. // "project",
  59400. // "resource"
  59401. // ],
  59402. // "parameters": {
  59403. // "project": {
  59404. // "description": "Project ID for this request.",
  59405. // "location": "path",
  59406. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  59407. // "required": true,
  59408. // "type": "string"
  59409. // },
  59410. // "resource": {
  59411. // "description": "Name of the resource for this request.",
  59412. // "location": "path",
  59413. // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?",
  59414. // "required": true,
  59415. // "type": "string"
  59416. // }
  59417. // },
  59418. // "path": "{project}/global/interconnects/{resource}/setLabels",
  59419. // "request": {
  59420. // "$ref": "GlobalSetLabelsRequest"
  59421. // },
  59422. // "response": {
  59423. // "$ref": "Operation"
  59424. // },
  59425. // "scopes": [
  59426. // "https://www.googleapis.com/auth/cloud-platform",
  59427. // "https://www.googleapis.com/auth/compute"
  59428. // ]
  59429. // }
  59430. }
  59431. // method id "compute.interconnects.testIamPermissions":
  59432. type InterconnectsTestIamPermissionsCall struct {
  59433. s *Service
  59434. project string
  59435. resource string
  59436. testpermissionsrequest *TestPermissionsRequest
  59437. urlParams_ gensupport.URLParams
  59438. ctx_ context.Context
  59439. header_ http.Header
  59440. }
  59441. // TestIamPermissions: Returns permissions that a caller has on the
  59442. // specified resource.
  59443. func (r *InterconnectsService) TestIamPermissions(project string, resource string, testpermissionsrequest *TestPermissionsRequest) *InterconnectsTestIamPermissionsCall {
  59444. c := &InterconnectsTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  59445. c.project = project
  59446. c.resource = resource
  59447. c.testpermissionsrequest = testpermissionsrequest
  59448. return c
  59449. }
  59450. // Fields allows partial responses to be retrieved. See
  59451. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  59452. // for more information.
  59453. func (c *InterconnectsTestIamPermissionsCall) Fields(s ...googleapi.Field) *InterconnectsTestIamPermissionsCall {
  59454. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  59455. return c
  59456. }
  59457. // Context sets the context to be used in this call's Do method. Any
  59458. // pending HTTP request will be aborted if the provided context is
  59459. // canceled.
  59460. func (c *InterconnectsTestIamPermissionsCall) Context(ctx context.Context) *InterconnectsTestIamPermissionsCall {
  59461. c.ctx_ = ctx
  59462. return c
  59463. }
  59464. // Header returns an http.Header that can be modified by the caller to
  59465. // add HTTP headers to the request.
  59466. func (c *InterconnectsTestIamPermissionsCall) Header() http.Header {
  59467. if c.header_ == nil {
  59468. c.header_ = make(http.Header)
  59469. }
  59470. return c.header_
  59471. }
  59472. func (c *InterconnectsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  59473. reqHeaders := make(http.Header)
  59474. for k, v := range c.header_ {
  59475. reqHeaders[k] = v
  59476. }
  59477. reqHeaders.Set("User-Agent", c.s.userAgent())
  59478. var body io.Reader = nil
  59479. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  59480. if err != nil {
  59481. return nil, err
  59482. }
  59483. reqHeaders.Set("Content-Type", "application/json")
  59484. c.urlParams_.Set("alt", alt)
  59485. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/interconnects/{resource}/testIamPermissions")
  59486. urls += "?" + c.urlParams_.Encode()
  59487. req, _ := http.NewRequest("POST", urls, body)
  59488. req.Header = reqHeaders
  59489. googleapi.Expand(req.URL, map[string]string{
  59490. "project": c.project,
  59491. "resource": c.resource,
  59492. })
  59493. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  59494. }
  59495. // Do executes the "compute.interconnects.testIamPermissions" call.
  59496. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  59497. // non-2xx status code is an error. Response headers are in either
  59498. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  59499. // returned at all) in error.(*googleapi.Error).Header. Use
  59500. // googleapi.IsNotModified to check whether the returned error was
  59501. // because http.StatusNotModified was returned.
  59502. func (c *InterconnectsTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, 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 := &TestPermissionsResponse{
  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": "Returns permissions that a caller has on the specified resource.",
  59534. // "httpMethod": "POST",
  59535. // "id": "compute.interconnects.testIamPermissions",
  59536. // "parameterOrder": [
  59537. // "project",
  59538. // "resource"
  59539. // ],
  59540. // "parameters": {
  59541. // "project": {
  59542. // "description": "Project ID for this request.",
  59543. // "location": "path",
  59544. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  59545. // "required": true,
  59546. // "type": "string"
  59547. // },
  59548. // "resource": {
  59549. // "description": "Name of the resource for this request.",
  59550. // "location": "path",
  59551. // "pattern": "(?:[-a-z0-9_]{0,62}[a-z0-9])?",
  59552. // "required": true,
  59553. // "type": "string"
  59554. // }
  59555. // },
  59556. // "path": "{project}/global/interconnects/{resource}/testIamPermissions",
  59557. // "request": {
  59558. // "$ref": "TestPermissionsRequest"
  59559. // },
  59560. // "response": {
  59561. // "$ref": "TestPermissionsResponse"
  59562. // },
  59563. // "scopes": [
  59564. // "https://www.googleapis.com/auth/cloud-platform",
  59565. // "https://www.googleapis.com/auth/compute",
  59566. // "https://www.googleapis.com/auth/compute.readonly"
  59567. // ]
  59568. // }
  59569. }
  59570. // method id "compute.licenseCodes.get":
  59571. type LicenseCodesGetCall struct {
  59572. s *Service
  59573. project string
  59574. licenseCode string
  59575. urlParams_ gensupport.URLParams
  59576. ifNoneMatch_ string
  59577. ctx_ context.Context
  59578. header_ http.Header
  59579. }
  59580. // Get: Return a specified license code. License codes are mirrored
  59581. // across all projects that have permissions to read the License Code.
  59582. func (r *LicenseCodesService) Get(project string, licenseCode string) *LicenseCodesGetCall {
  59583. c := &LicenseCodesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  59584. c.project = project
  59585. c.licenseCode = licenseCode
  59586. return c
  59587. }
  59588. // Fields allows partial responses to be retrieved. See
  59589. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  59590. // for more information.
  59591. func (c *LicenseCodesGetCall) Fields(s ...googleapi.Field) *LicenseCodesGetCall {
  59592. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  59593. return c
  59594. }
  59595. // IfNoneMatch sets the optional parameter which makes the operation
  59596. // fail if the object's ETag matches the given value. This is useful for
  59597. // getting updates only after the object has changed since the last
  59598. // request. Use googleapi.IsNotModified to check whether the response
  59599. // error from Do is the result of In-None-Match.
  59600. func (c *LicenseCodesGetCall) IfNoneMatch(entityTag string) *LicenseCodesGetCall {
  59601. c.ifNoneMatch_ = entityTag
  59602. return c
  59603. }
  59604. // Context sets the context to be used in this call's Do method. Any
  59605. // pending HTTP request will be aborted if the provided context is
  59606. // canceled.
  59607. func (c *LicenseCodesGetCall) Context(ctx context.Context) *LicenseCodesGetCall {
  59608. c.ctx_ = ctx
  59609. return c
  59610. }
  59611. // Header returns an http.Header that can be modified by the caller to
  59612. // add HTTP headers to the request.
  59613. func (c *LicenseCodesGetCall) Header() http.Header {
  59614. if c.header_ == nil {
  59615. c.header_ = make(http.Header)
  59616. }
  59617. return c.header_
  59618. }
  59619. func (c *LicenseCodesGetCall) doRequest(alt string) (*http.Response, error) {
  59620. reqHeaders := make(http.Header)
  59621. for k, v := range c.header_ {
  59622. reqHeaders[k] = v
  59623. }
  59624. reqHeaders.Set("User-Agent", c.s.userAgent())
  59625. if c.ifNoneMatch_ != "" {
  59626. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  59627. }
  59628. var body io.Reader = nil
  59629. c.urlParams_.Set("alt", alt)
  59630. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/licenseCodes/{licenseCode}")
  59631. urls += "?" + c.urlParams_.Encode()
  59632. req, _ := http.NewRequest("GET", urls, body)
  59633. req.Header = reqHeaders
  59634. googleapi.Expand(req.URL, map[string]string{
  59635. "project": c.project,
  59636. "licenseCode": c.licenseCode,
  59637. })
  59638. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  59639. }
  59640. // Do executes the "compute.licenseCodes.get" call.
  59641. // Exactly one of *LicenseCode or error will be non-nil. Any non-2xx
  59642. // status code is an error. Response headers are in either
  59643. // *LicenseCode.ServerResponse.Header or (if a response was returned at
  59644. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  59645. // to check whether the returned error was because
  59646. // http.StatusNotModified was returned.
  59647. func (c *LicenseCodesGetCall) Do(opts ...googleapi.CallOption) (*LicenseCode, error) {
  59648. gensupport.SetOptions(c.urlParams_, opts...)
  59649. res, err := c.doRequest("json")
  59650. if res != nil && res.StatusCode == http.StatusNotModified {
  59651. if res.Body != nil {
  59652. res.Body.Close()
  59653. }
  59654. return nil, &googleapi.Error{
  59655. Code: res.StatusCode,
  59656. Header: res.Header,
  59657. }
  59658. }
  59659. if err != nil {
  59660. return nil, err
  59661. }
  59662. defer googleapi.CloseBody(res)
  59663. if err := googleapi.CheckResponse(res); err != nil {
  59664. return nil, err
  59665. }
  59666. ret := &LicenseCode{
  59667. ServerResponse: googleapi.ServerResponse{
  59668. Header: res.Header,
  59669. HTTPStatusCode: res.StatusCode,
  59670. },
  59671. }
  59672. target := &ret
  59673. if err := gensupport.DecodeResponse(target, res); err != nil {
  59674. return nil, err
  59675. }
  59676. return ret, nil
  59677. // {
  59678. // "description": "Return a specified license code. License codes are mirrored across all projects that have permissions to read the License Code.",
  59679. // "httpMethod": "GET",
  59680. // "id": "compute.licenseCodes.get",
  59681. // "parameterOrder": [
  59682. // "project",
  59683. // "licenseCode"
  59684. // ],
  59685. // "parameters": {
  59686. // "licenseCode": {
  59687. // "description": "Number corresponding to the License code resource to return.",
  59688. // "location": "path",
  59689. // "pattern": "[0-9]{0,61}?",
  59690. // "required": true,
  59691. // "type": "string"
  59692. // },
  59693. // "project": {
  59694. // "description": "Project ID for this request.",
  59695. // "location": "path",
  59696. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  59697. // "required": true,
  59698. // "type": "string"
  59699. // }
  59700. // },
  59701. // "path": "{project}/global/licenseCodes/{licenseCode}",
  59702. // "response": {
  59703. // "$ref": "LicenseCode"
  59704. // },
  59705. // "scopes": [
  59706. // "https://www.googleapis.com/auth/cloud-platform",
  59707. // "https://www.googleapis.com/auth/compute",
  59708. // "https://www.googleapis.com/auth/compute.readonly"
  59709. // ]
  59710. // }
  59711. }
  59712. // method id "compute.licenses.delete":
  59713. type LicensesDeleteCall struct {
  59714. s *Service
  59715. project string
  59716. license string
  59717. urlParams_ gensupport.URLParams
  59718. ctx_ context.Context
  59719. header_ http.Header
  59720. }
  59721. // Delete: Deletes the specified license.
  59722. func (r *LicensesService) Delete(project string, license string) *LicensesDeleteCall {
  59723. c := &LicensesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  59724. c.project = project
  59725. c.license = license
  59726. return c
  59727. }
  59728. // RequestId sets the optional parameter "requestId": An optional
  59729. // request ID to identify requests. Specify a unique request ID so that
  59730. // if you must retry your request, the server will know to ignore the
  59731. // request if it has already been completed.
  59732. //
  59733. // For example, consider a situation where you make an initial request
  59734. // and the request times out. If you make the request again with the
  59735. // same request ID, the server can check if original operation with the
  59736. // same request ID was received, and if so, will ignore the second
  59737. // request. This prevents clients from accidentally creating duplicate
  59738. // commitments.
  59739. //
  59740. // The request ID must be a valid UUID with the exception that zero UUID
  59741. // is not supported (00000000-0000-0000-0000-000000000000).
  59742. func (c *LicensesDeleteCall) RequestId(requestId string) *LicensesDeleteCall {
  59743. c.urlParams_.Set("requestId", requestId)
  59744. return c
  59745. }
  59746. // Fields allows partial responses to be retrieved. See
  59747. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  59748. // for more information.
  59749. func (c *LicensesDeleteCall) Fields(s ...googleapi.Field) *LicensesDeleteCall {
  59750. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  59751. return c
  59752. }
  59753. // Context sets the context to be used in this call's Do method. Any
  59754. // pending HTTP request will be aborted if the provided context is
  59755. // canceled.
  59756. func (c *LicensesDeleteCall) Context(ctx context.Context) *LicensesDeleteCall {
  59757. c.ctx_ = ctx
  59758. return c
  59759. }
  59760. // Header returns an http.Header that can be modified by the caller to
  59761. // add HTTP headers to the request.
  59762. func (c *LicensesDeleteCall) Header() http.Header {
  59763. if c.header_ == nil {
  59764. c.header_ = make(http.Header)
  59765. }
  59766. return c.header_
  59767. }
  59768. func (c *LicensesDeleteCall) doRequest(alt string) (*http.Response, error) {
  59769. reqHeaders := make(http.Header)
  59770. for k, v := range c.header_ {
  59771. reqHeaders[k] = v
  59772. }
  59773. reqHeaders.Set("User-Agent", c.s.userAgent())
  59774. var body io.Reader = nil
  59775. c.urlParams_.Set("alt", alt)
  59776. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/licenses/{license}")
  59777. urls += "?" + c.urlParams_.Encode()
  59778. req, _ := http.NewRequest("DELETE", urls, body)
  59779. req.Header = reqHeaders
  59780. googleapi.Expand(req.URL, map[string]string{
  59781. "project": c.project,
  59782. "license": c.license,
  59783. })
  59784. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  59785. }
  59786. // Do executes the "compute.licenses.delete" call.
  59787. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  59788. // status code is an error. Response headers are in either
  59789. // *Operation.ServerResponse.Header or (if a response was returned at
  59790. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  59791. // to check whether the returned error was because
  59792. // http.StatusNotModified was returned.
  59793. func (c *LicensesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  59794. gensupport.SetOptions(c.urlParams_, opts...)
  59795. res, err := c.doRequest("json")
  59796. if res != nil && res.StatusCode == http.StatusNotModified {
  59797. if res.Body != nil {
  59798. res.Body.Close()
  59799. }
  59800. return nil, &googleapi.Error{
  59801. Code: res.StatusCode,
  59802. Header: res.Header,
  59803. }
  59804. }
  59805. if err != nil {
  59806. return nil, err
  59807. }
  59808. defer googleapi.CloseBody(res)
  59809. if err := googleapi.CheckResponse(res); err != nil {
  59810. return nil, err
  59811. }
  59812. ret := &Operation{
  59813. ServerResponse: googleapi.ServerResponse{
  59814. Header: res.Header,
  59815. HTTPStatusCode: res.StatusCode,
  59816. },
  59817. }
  59818. target := &ret
  59819. if err := gensupport.DecodeResponse(target, res); err != nil {
  59820. return nil, err
  59821. }
  59822. return ret, nil
  59823. // {
  59824. // "description": "Deletes the specified license.",
  59825. // "httpMethod": "DELETE",
  59826. // "id": "compute.licenses.delete",
  59827. // "parameterOrder": [
  59828. // "project",
  59829. // "license"
  59830. // ],
  59831. // "parameters": {
  59832. // "license": {
  59833. // "description": "Name of the license resource to delete.",
  59834. // "location": "path",
  59835. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  59836. // "required": true,
  59837. // "type": "string"
  59838. // },
  59839. // "project": {
  59840. // "description": "Project ID for this request.",
  59841. // "location": "path",
  59842. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  59843. // "required": true,
  59844. // "type": "string"
  59845. // },
  59846. // "requestId": {
  59847. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  59848. // "location": "query",
  59849. // "type": "string"
  59850. // }
  59851. // },
  59852. // "path": "{project}/global/licenses/{license}",
  59853. // "response": {
  59854. // "$ref": "Operation"
  59855. // },
  59856. // "scopes": [
  59857. // "https://www.googleapis.com/auth/cloud-platform",
  59858. // "https://www.googleapis.com/auth/compute"
  59859. // ]
  59860. // }
  59861. }
  59862. // method id "compute.licenses.get":
  59863. type LicensesGetCall struct {
  59864. s *Service
  59865. project string
  59866. license string
  59867. urlParams_ gensupport.URLParams
  59868. ifNoneMatch_ string
  59869. ctx_ context.Context
  59870. header_ http.Header
  59871. }
  59872. // Get: Returns the specified License resource.
  59873. // For details, see https://cloud.google.com/compute/docs/reference/latest/licenses/get
  59874. func (r *LicensesService) Get(project string, license string) *LicensesGetCall {
  59875. c := &LicensesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  59876. c.project = project
  59877. c.license = license
  59878. return c
  59879. }
  59880. // Fields allows partial responses to be retrieved. See
  59881. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  59882. // for more information.
  59883. func (c *LicensesGetCall) Fields(s ...googleapi.Field) *LicensesGetCall {
  59884. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  59885. return c
  59886. }
  59887. // IfNoneMatch sets the optional parameter which makes the operation
  59888. // fail if the object's ETag matches the given value. This is useful for
  59889. // getting updates only after the object has changed since the last
  59890. // request. Use googleapi.IsNotModified to check whether the response
  59891. // error from Do is the result of In-None-Match.
  59892. func (c *LicensesGetCall) IfNoneMatch(entityTag string) *LicensesGetCall {
  59893. c.ifNoneMatch_ = entityTag
  59894. return c
  59895. }
  59896. // Context sets the context to be used in this call's Do method. Any
  59897. // pending HTTP request will be aborted if the provided context is
  59898. // canceled.
  59899. func (c *LicensesGetCall) Context(ctx context.Context) *LicensesGetCall {
  59900. c.ctx_ = ctx
  59901. return c
  59902. }
  59903. // Header returns an http.Header that can be modified by the caller to
  59904. // add HTTP headers to the request.
  59905. func (c *LicensesGetCall) Header() http.Header {
  59906. if c.header_ == nil {
  59907. c.header_ = make(http.Header)
  59908. }
  59909. return c.header_
  59910. }
  59911. func (c *LicensesGetCall) doRequest(alt string) (*http.Response, error) {
  59912. reqHeaders := make(http.Header)
  59913. for k, v := range c.header_ {
  59914. reqHeaders[k] = v
  59915. }
  59916. reqHeaders.Set("User-Agent", c.s.userAgent())
  59917. if c.ifNoneMatch_ != "" {
  59918. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  59919. }
  59920. var body io.Reader = nil
  59921. c.urlParams_.Set("alt", alt)
  59922. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/licenses/{license}")
  59923. urls += "?" + c.urlParams_.Encode()
  59924. req, _ := http.NewRequest("GET", urls, body)
  59925. req.Header = reqHeaders
  59926. googleapi.Expand(req.URL, map[string]string{
  59927. "project": c.project,
  59928. "license": c.license,
  59929. })
  59930. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  59931. }
  59932. // Do executes the "compute.licenses.get" call.
  59933. // Exactly one of *License or error will be non-nil. Any non-2xx status
  59934. // code is an error. Response headers are in either
  59935. // *License.ServerResponse.Header or (if a response was returned at all)
  59936. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  59937. // check whether the returned error was because http.StatusNotModified
  59938. // was returned.
  59939. func (c *LicensesGetCall) Do(opts ...googleapi.CallOption) (*License, error) {
  59940. gensupport.SetOptions(c.urlParams_, opts...)
  59941. res, err := c.doRequest("json")
  59942. if res != nil && res.StatusCode == http.StatusNotModified {
  59943. if res.Body != nil {
  59944. res.Body.Close()
  59945. }
  59946. return nil, &googleapi.Error{
  59947. Code: res.StatusCode,
  59948. Header: res.Header,
  59949. }
  59950. }
  59951. if err != nil {
  59952. return nil, err
  59953. }
  59954. defer googleapi.CloseBody(res)
  59955. if err := googleapi.CheckResponse(res); err != nil {
  59956. return nil, err
  59957. }
  59958. ret := &License{
  59959. ServerResponse: googleapi.ServerResponse{
  59960. Header: res.Header,
  59961. HTTPStatusCode: res.StatusCode,
  59962. },
  59963. }
  59964. target := &ret
  59965. if err := gensupport.DecodeResponse(target, res); err != nil {
  59966. return nil, err
  59967. }
  59968. return ret, nil
  59969. // {
  59970. // "description": "Returns the specified License resource.",
  59971. // "httpMethod": "GET",
  59972. // "id": "compute.licenses.get",
  59973. // "parameterOrder": [
  59974. // "project",
  59975. // "license"
  59976. // ],
  59977. // "parameters": {
  59978. // "license": {
  59979. // "description": "Name of the License resource to return.",
  59980. // "location": "path",
  59981. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  59982. // "required": true,
  59983. // "type": "string"
  59984. // },
  59985. // "project": {
  59986. // "description": "Project ID for this request.",
  59987. // "location": "path",
  59988. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  59989. // "required": true,
  59990. // "type": "string"
  59991. // }
  59992. // },
  59993. // "path": "{project}/global/licenses/{license}",
  59994. // "response": {
  59995. // "$ref": "License"
  59996. // },
  59997. // "scopes": [
  59998. // "https://www.googleapis.com/auth/cloud-platform",
  59999. // "https://www.googleapis.com/auth/compute",
  60000. // "https://www.googleapis.com/auth/compute.readonly"
  60001. // ]
  60002. // }
  60003. }
  60004. // method id "compute.licenses.insert":
  60005. type LicensesInsertCall struct {
  60006. s *Service
  60007. project string
  60008. license *License
  60009. urlParams_ gensupport.URLParams
  60010. ctx_ context.Context
  60011. header_ http.Header
  60012. }
  60013. // Insert: Create a License resource in the specified project.
  60014. func (r *LicensesService) Insert(project string, license *License) *LicensesInsertCall {
  60015. c := &LicensesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  60016. c.project = project
  60017. c.license = license
  60018. return c
  60019. }
  60020. // RequestId sets the optional parameter "requestId": An optional
  60021. // request ID to identify requests. Specify a unique request ID so that
  60022. // if you must retry your request, the server will know to ignore the
  60023. // request if it has already been completed.
  60024. //
  60025. // For example, consider a situation where you make an initial request
  60026. // and the request times out. If you make the request again with the
  60027. // same request ID, the server can check if original operation with the
  60028. // same request ID was received, and if so, will ignore the second
  60029. // request. This prevents clients from accidentally creating duplicate
  60030. // commitments.
  60031. //
  60032. // The request ID must be a valid UUID with the exception that zero UUID
  60033. // is not supported (00000000-0000-0000-0000-000000000000).
  60034. func (c *LicensesInsertCall) RequestId(requestId string) *LicensesInsertCall {
  60035. c.urlParams_.Set("requestId", requestId)
  60036. return c
  60037. }
  60038. // Fields allows partial responses to be retrieved. See
  60039. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  60040. // for more information.
  60041. func (c *LicensesInsertCall) Fields(s ...googleapi.Field) *LicensesInsertCall {
  60042. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  60043. return c
  60044. }
  60045. // Context sets the context to be used in this call's Do method. Any
  60046. // pending HTTP request will be aborted if the provided context is
  60047. // canceled.
  60048. func (c *LicensesInsertCall) Context(ctx context.Context) *LicensesInsertCall {
  60049. c.ctx_ = ctx
  60050. return c
  60051. }
  60052. // Header returns an http.Header that can be modified by the caller to
  60053. // add HTTP headers to the request.
  60054. func (c *LicensesInsertCall) Header() http.Header {
  60055. if c.header_ == nil {
  60056. c.header_ = make(http.Header)
  60057. }
  60058. return c.header_
  60059. }
  60060. func (c *LicensesInsertCall) doRequest(alt string) (*http.Response, error) {
  60061. reqHeaders := make(http.Header)
  60062. for k, v := range c.header_ {
  60063. reqHeaders[k] = v
  60064. }
  60065. reqHeaders.Set("User-Agent", c.s.userAgent())
  60066. var body io.Reader = nil
  60067. body, err := googleapi.WithoutDataWrapper.JSONReader(c.license)
  60068. if err != nil {
  60069. return nil, err
  60070. }
  60071. reqHeaders.Set("Content-Type", "application/json")
  60072. c.urlParams_.Set("alt", alt)
  60073. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/licenses")
  60074. urls += "?" + c.urlParams_.Encode()
  60075. req, _ := http.NewRequest("POST", urls, body)
  60076. req.Header = reqHeaders
  60077. googleapi.Expand(req.URL, map[string]string{
  60078. "project": c.project,
  60079. })
  60080. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  60081. }
  60082. // Do executes the "compute.licenses.insert" call.
  60083. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  60084. // status code is an error. Response headers are in either
  60085. // *Operation.ServerResponse.Header or (if a response was returned at
  60086. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  60087. // to check whether the returned error was because
  60088. // http.StatusNotModified was returned.
  60089. func (c *LicensesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  60090. gensupport.SetOptions(c.urlParams_, opts...)
  60091. res, err := c.doRequest("json")
  60092. if res != nil && res.StatusCode == http.StatusNotModified {
  60093. if res.Body != nil {
  60094. res.Body.Close()
  60095. }
  60096. return nil, &googleapi.Error{
  60097. Code: res.StatusCode,
  60098. Header: res.Header,
  60099. }
  60100. }
  60101. if err != nil {
  60102. return nil, err
  60103. }
  60104. defer googleapi.CloseBody(res)
  60105. if err := googleapi.CheckResponse(res); err != nil {
  60106. return nil, err
  60107. }
  60108. ret := &Operation{
  60109. ServerResponse: googleapi.ServerResponse{
  60110. Header: res.Header,
  60111. HTTPStatusCode: res.StatusCode,
  60112. },
  60113. }
  60114. target := &ret
  60115. if err := gensupport.DecodeResponse(target, res); err != nil {
  60116. return nil, err
  60117. }
  60118. return ret, nil
  60119. // {
  60120. // "description": "Create a License resource in the specified project.",
  60121. // "httpMethod": "POST",
  60122. // "id": "compute.licenses.insert",
  60123. // "parameterOrder": [
  60124. // "project"
  60125. // ],
  60126. // "parameters": {
  60127. // "project": {
  60128. // "description": "Project ID for this request.",
  60129. // "location": "path",
  60130. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  60131. // "required": true,
  60132. // "type": "string"
  60133. // },
  60134. // "requestId": {
  60135. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  60136. // "location": "query",
  60137. // "type": "string"
  60138. // }
  60139. // },
  60140. // "path": "{project}/global/licenses",
  60141. // "request": {
  60142. // "$ref": "License"
  60143. // },
  60144. // "response": {
  60145. // "$ref": "Operation"
  60146. // },
  60147. // "scopes": [
  60148. // "https://www.googleapis.com/auth/cloud-platform",
  60149. // "https://www.googleapis.com/auth/compute",
  60150. // "https://www.googleapis.com/auth/devstorage.full_control",
  60151. // "https://www.googleapis.com/auth/devstorage.read_only",
  60152. // "https://www.googleapis.com/auth/devstorage.read_write"
  60153. // ]
  60154. // }
  60155. }
  60156. // method id "compute.licenses.list":
  60157. type LicensesListCall struct {
  60158. s *Service
  60159. project string
  60160. urlParams_ gensupport.URLParams
  60161. ifNoneMatch_ string
  60162. ctx_ context.Context
  60163. header_ http.Header
  60164. }
  60165. // List: Retrieves the list of licenses available in the specified
  60166. // project. This method does not get any licenses that belong to other
  60167. // projects, including licenses attached to publicly-available images,
  60168. // like Debian 9. If you want to get a list of publicly-available
  60169. // licenses, use this method to make a request to the respective image
  60170. // project, such as debian-cloud or windows-cloud.
  60171. func (r *LicensesService) List(project string) *LicensesListCall {
  60172. c := &LicensesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  60173. c.project = project
  60174. return c
  60175. }
  60176. // Filter sets the optional parameter "filter": A filter expression that
  60177. // filters resources listed in the response. The expression must specify
  60178. // the field name, a comparison operator, and the value that you want to
  60179. // use for filtering. The value must be a string, a number, or a
  60180. // boolean. The comparison operator must be either =, !=, >, or <.
  60181. //
  60182. // For example, if you are filtering Compute Engine instances, you can
  60183. // exclude instances named example-instance by specifying name !=
  60184. // example-instance.
  60185. //
  60186. // You can also filter nested fields. For example, you could specify
  60187. // scheduling.automaticRestart = false to include instances only if they
  60188. // are not scheduled for automatic restarts. You can use filtering on
  60189. // nested fields to filter based on resource labels.
  60190. //
  60191. // To filter on multiple expressions, provide each separate expression
  60192. // within parentheses. For example, (scheduling.automaticRestart = true)
  60193. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  60194. // AND expression. However, you can include AND and OR expressions
  60195. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  60196. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  60197. // true).
  60198. func (c *LicensesListCall) Filter(filter string) *LicensesListCall {
  60199. c.urlParams_.Set("filter", filter)
  60200. return c
  60201. }
  60202. // MaxResults sets the optional parameter "maxResults": The maximum
  60203. // number of results per page that should be returned. If the number of
  60204. // available results is larger than maxResults, Compute Engine returns a
  60205. // nextPageToken that can be used to get the next page of results in
  60206. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  60207. // (Default: 500)
  60208. func (c *LicensesListCall) MaxResults(maxResults int64) *LicensesListCall {
  60209. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  60210. return c
  60211. }
  60212. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  60213. // a certain order. By default, results are returned in alphanumerical
  60214. // order based on the resource name.
  60215. //
  60216. // You can also sort results in descending order based on the creation
  60217. // timestamp using orderBy="creationTimestamp desc". This sorts results
  60218. // based on the creationTimestamp field in reverse chronological order
  60219. // (newest result first). Use this to sort resources like operations so
  60220. // that the newest operation is returned first.
  60221. //
  60222. // Currently, only sorting by name or creationTimestamp desc is
  60223. // supported.
  60224. func (c *LicensesListCall) OrderBy(orderBy string) *LicensesListCall {
  60225. c.urlParams_.Set("orderBy", orderBy)
  60226. return c
  60227. }
  60228. // PageToken sets the optional parameter "pageToken": Specifies a page
  60229. // token to use. Set pageToken to the nextPageToken returned by a
  60230. // previous list request to get the next page of results.
  60231. func (c *LicensesListCall) PageToken(pageToken string) *LicensesListCall {
  60232. c.urlParams_.Set("pageToken", pageToken)
  60233. return c
  60234. }
  60235. // Fields allows partial responses to be retrieved. See
  60236. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  60237. // for more information.
  60238. func (c *LicensesListCall) Fields(s ...googleapi.Field) *LicensesListCall {
  60239. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  60240. return c
  60241. }
  60242. // IfNoneMatch sets the optional parameter which makes the operation
  60243. // fail if the object's ETag matches the given value. This is useful for
  60244. // getting updates only after the object has changed since the last
  60245. // request. Use googleapi.IsNotModified to check whether the response
  60246. // error from Do is the result of In-None-Match.
  60247. func (c *LicensesListCall) IfNoneMatch(entityTag string) *LicensesListCall {
  60248. c.ifNoneMatch_ = entityTag
  60249. return c
  60250. }
  60251. // Context sets the context to be used in this call's Do method. Any
  60252. // pending HTTP request will be aborted if the provided context is
  60253. // canceled.
  60254. func (c *LicensesListCall) Context(ctx context.Context) *LicensesListCall {
  60255. c.ctx_ = ctx
  60256. return c
  60257. }
  60258. // Header returns an http.Header that can be modified by the caller to
  60259. // add HTTP headers to the request.
  60260. func (c *LicensesListCall) Header() http.Header {
  60261. if c.header_ == nil {
  60262. c.header_ = make(http.Header)
  60263. }
  60264. return c.header_
  60265. }
  60266. func (c *LicensesListCall) doRequest(alt string) (*http.Response, error) {
  60267. reqHeaders := make(http.Header)
  60268. for k, v := range c.header_ {
  60269. reqHeaders[k] = v
  60270. }
  60271. reqHeaders.Set("User-Agent", c.s.userAgent())
  60272. if c.ifNoneMatch_ != "" {
  60273. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  60274. }
  60275. var body io.Reader = nil
  60276. c.urlParams_.Set("alt", alt)
  60277. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/licenses")
  60278. urls += "?" + c.urlParams_.Encode()
  60279. req, _ := http.NewRequest("GET", urls, body)
  60280. req.Header = reqHeaders
  60281. googleapi.Expand(req.URL, map[string]string{
  60282. "project": c.project,
  60283. })
  60284. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  60285. }
  60286. // Do executes the "compute.licenses.list" call.
  60287. // Exactly one of *LicensesListResponse or error will be non-nil. Any
  60288. // non-2xx status code is an error. Response headers are in either
  60289. // *LicensesListResponse.ServerResponse.Header or (if a response was
  60290. // returned at all) in error.(*googleapi.Error).Header. Use
  60291. // googleapi.IsNotModified to check whether the returned error was
  60292. // because http.StatusNotModified was returned.
  60293. func (c *LicensesListCall) Do(opts ...googleapi.CallOption) (*LicensesListResponse, error) {
  60294. gensupport.SetOptions(c.urlParams_, opts...)
  60295. res, err := c.doRequest("json")
  60296. if res != nil && res.StatusCode == http.StatusNotModified {
  60297. if res.Body != nil {
  60298. res.Body.Close()
  60299. }
  60300. return nil, &googleapi.Error{
  60301. Code: res.StatusCode,
  60302. Header: res.Header,
  60303. }
  60304. }
  60305. if err != nil {
  60306. return nil, err
  60307. }
  60308. defer googleapi.CloseBody(res)
  60309. if err := googleapi.CheckResponse(res); err != nil {
  60310. return nil, err
  60311. }
  60312. ret := &LicensesListResponse{
  60313. ServerResponse: googleapi.ServerResponse{
  60314. Header: res.Header,
  60315. HTTPStatusCode: res.StatusCode,
  60316. },
  60317. }
  60318. target := &ret
  60319. if err := gensupport.DecodeResponse(target, res); err != nil {
  60320. return nil, err
  60321. }
  60322. return ret, nil
  60323. // {
  60324. // "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.",
  60325. // "httpMethod": "GET",
  60326. // "id": "compute.licenses.list",
  60327. // "parameterOrder": [
  60328. // "project"
  60329. // ],
  60330. // "parameters": {
  60331. // "filter": {
  60332. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  60333. // "location": "query",
  60334. // "type": "string"
  60335. // },
  60336. // "maxResults": {
  60337. // "default": "500",
  60338. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  60339. // "format": "uint32",
  60340. // "location": "query",
  60341. // "minimum": "0",
  60342. // "type": "integer"
  60343. // },
  60344. // "orderBy": {
  60345. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  60346. // "location": "query",
  60347. // "type": "string"
  60348. // },
  60349. // "pageToken": {
  60350. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  60351. // "location": "query",
  60352. // "type": "string"
  60353. // },
  60354. // "project": {
  60355. // "description": "Project ID for this request.",
  60356. // "location": "path",
  60357. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  60358. // "required": true,
  60359. // "type": "string"
  60360. // }
  60361. // },
  60362. // "path": "{project}/global/licenses",
  60363. // "response": {
  60364. // "$ref": "LicensesListResponse"
  60365. // },
  60366. // "scopes": [
  60367. // "https://www.googleapis.com/auth/cloud-platform",
  60368. // "https://www.googleapis.com/auth/compute",
  60369. // "https://www.googleapis.com/auth/compute.readonly"
  60370. // ]
  60371. // }
  60372. }
  60373. // Pages invokes f for each page of results.
  60374. // A non-nil error returned from f will halt the iteration.
  60375. // The provided context supersedes any context provided to the Context method.
  60376. func (c *LicensesListCall) Pages(ctx context.Context, f func(*LicensesListResponse) error) error {
  60377. c.ctx_ = ctx
  60378. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  60379. for {
  60380. x, err := c.Do()
  60381. if err != nil {
  60382. return err
  60383. }
  60384. if err := f(x); err != nil {
  60385. return err
  60386. }
  60387. if x.NextPageToken == "" {
  60388. return nil
  60389. }
  60390. c.PageToken(x.NextPageToken)
  60391. }
  60392. }
  60393. // method id "compute.machineTypes.aggregatedList":
  60394. type MachineTypesAggregatedListCall struct {
  60395. s *Service
  60396. project string
  60397. urlParams_ gensupport.URLParams
  60398. ifNoneMatch_ string
  60399. ctx_ context.Context
  60400. header_ http.Header
  60401. }
  60402. // AggregatedList: Retrieves an aggregated list of machine types.
  60403. // For details, see https://cloud.google.com/compute/docs/reference/latest/machineTypes/aggregatedList
  60404. func (r *MachineTypesService) AggregatedList(project string) *MachineTypesAggregatedListCall {
  60405. c := &MachineTypesAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  60406. c.project = project
  60407. return c
  60408. }
  60409. // Filter sets the optional parameter "filter": A filter expression that
  60410. // filters resources listed in the response. The expression must specify
  60411. // the field name, a comparison operator, and the value that you want to
  60412. // use for filtering. The value must be a string, a number, or a
  60413. // boolean. The comparison operator must be either =, !=, >, or <.
  60414. //
  60415. // For example, if you are filtering Compute Engine instances, you can
  60416. // exclude instances named example-instance by specifying name !=
  60417. // example-instance.
  60418. //
  60419. // You can also filter nested fields. For example, you could specify
  60420. // scheduling.automaticRestart = false to include instances only if they
  60421. // are not scheduled for automatic restarts. You can use filtering on
  60422. // nested fields to filter based on resource labels.
  60423. //
  60424. // To filter on multiple expressions, provide each separate expression
  60425. // within parentheses. For example, (scheduling.automaticRestart = true)
  60426. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  60427. // AND expression. However, you can include AND and OR expressions
  60428. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  60429. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  60430. // true).
  60431. func (c *MachineTypesAggregatedListCall) Filter(filter string) *MachineTypesAggregatedListCall {
  60432. c.urlParams_.Set("filter", filter)
  60433. return c
  60434. }
  60435. // MaxResults sets the optional parameter "maxResults": The maximum
  60436. // number of results per page that should be returned. If the number of
  60437. // available results is larger than maxResults, Compute Engine returns a
  60438. // nextPageToken that can be used to get the next page of results in
  60439. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  60440. // (Default: 500)
  60441. func (c *MachineTypesAggregatedListCall) MaxResults(maxResults int64) *MachineTypesAggregatedListCall {
  60442. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  60443. return c
  60444. }
  60445. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  60446. // a certain order. By default, results are returned in alphanumerical
  60447. // order based on the resource name.
  60448. //
  60449. // You can also sort results in descending order based on the creation
  60450. // timestamp using orderBy="creationTimestamp desc". This sorts results
  60451. // based on the creationTimestamp field in reverse chronological order
  60452. // (newest result first). Use this to sort resources like operations so
  60453. // that the newest operation is returned first.
  60454. //
  60455. // Currently, only sorting by name or creationTimestamp desc is
  60456. // supported.
  60457. func (c *MachineTypesAggregatedListCall) OrderBy(orderBy string) *MachineTypesAggregatedListCall {
  60458. c.urlParams_.Set("orderBy", orderBy)
  60459. return c
  60460. }
  60461. // PageToken sets the optional parameter "pageToken": Specifies a page
  60462. // token to use. Set pageToken to the nextPageToken returned by a
  60463. // previous list request to get the next page of results.
  60464. func (c *MachineTypesAggregatedListCall) PageToken(pageToken string) *MachineTypesAggregatedListCall {
  60465. c.urlParams_.Set("pageToken", pageToken)
  60466. return c
  60467. }
  60468. // Fields allows partial responses to be retrieved. See
  60469. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  60470. // for more information.
  60471. func (c *MachineTypesAggregatedListCall) Fields(s ...googleapi.Field) *MachineTypesAggregatedListCall {
  60472. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  60473. return c
  60474. }
  60475. // IfNoneMatch sets the optional parameter which makes the operation
  60476. // fail if the object's ETag matches the given value. This is useful for
  60477. // getting updates only after the object has changed since the last
  60478. // request. Use googleapi.IsNotModified to check whether the response
  60479. // error from Do is the result of In-None-Match.
  60480. func (c *MachineTypesAggregatedListCall) IfNoneMatch(entityTag string) *MachineTypesAggregatedListCall {
  60481. c.ifNoneMatch_ = entityTag
  60482. return c
  60483. }
  60484. // Context sets the context to be used in this call's Do method. Any
  60485. // pending HTTP request will be aborted if the provided context is
  60486. // canceled.
  60487. func (c *MachineTypesAggregatedListCall) Context(ctx context.Context) *MachineTypesAggregatedListCall {
  60488. c.ctx_ = ctx
  60489. return c
  60490. }
  60491. // Header returns an http.Header that can be modified by the caller to
  60492. // add HTTP headers to the request.
  60493. func (c *MachineTypesAggregatedListCall) Header() http.Header {
  60494. if c.header_ == nil {
  60495. c.header_ = make(http.Header)
  60496. }
  60497. return c.header_
  60498. }
  60499. func (c *MachineTypesAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  60500. reqHeaders := make(http.Header)
  60501. for k, v := range c.header_ {
  60502. reqHeaders[k] = v
  60503. }
  60504. reqHeaders.Set("User-Agent", c.s.userAgent())
  60505. if c.ifNoneMatch_ != "" {
  60506. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  60507. }
  60508. var body io.Reader = nil
  60509. c.urlParams_.Set("alt", alt)
  60510. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/machineTypes")
  60511. urls += "?" + c.urlParams_.Encode()
  60512. req, _ := http.NewRequest("GET", urls, body)
  60513. req.Header = reqHeaders
  60514. googleapi.Expand(req.URL, map[string]string{
  60515. "project": c.project,
  60516. })
  60517. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  60518. }
  60519. // Do executes the "compute.machineTypes.aggregatedList" call.
  60520. // Exactly one of *MachineTypeAggregatedList or error will be non-nil.
  60521. // Any non-2xx status code is an error. Response headers are in either
  60522. // *MachineTypeAggregatedList.ServerResponse.Header or (if a response
  60523. // was returned at all) in error.(*googleapi.Error).Header. Use
  60524. // googleapi.IsNotModified to check whether the returned error was
  60525. // because http.StatusNotModified was returned.
  60526. func (c *MachineTypesAggregatedListCall) Do(opts ...googleapi.CallOption) (*MachineTypeAggregatedList, error) {
  60527. gensupport.SetOptions(c.urlParams_, opts...)
  60528. res, err := c.doRequest("json")
  60529. if res != nil && res.StatusCode == http.StatusNotModified {
  60530. if res.Body != nil {
  60531. res.Body.Close()
  60532. }
  60533. return nil, &googleapi.Error{
  60534. Code: res.StatusCode,
  60535. Header: res.Header,
  60536. }
  60537. }
  60538. if err != nil {
  60539. return nil, err
  60540. }
  60541. defer googleapi.CloseBody(res)
  60542. if err := googleapi.CheckResponse(res); err != nil {
  60543. return nil, err
  60544. }
  60545. ret := &MachineTypeAggregatedList{
  60546. ServerResponse: googleapi.ServerResponse{
  60547. Header: res.Header,
  60548. HTTPStatusCode: res.StatusCode,
  60549. },
  60550. }
  60551. target := &ret
  60552. if err := gensupport.DecodeResponse(target, res); err != nil {
  60553. return nil, err
  60554. }
  60555. return ret, nil
  60556. // {
  60557. // "description": "Retrieves an aggregated list of machine types.",
  60558. // "httpMethod": "GET",
  60559. // "id": "compute.machineTypes.aggregatedList",
  60560. // "parameterOrder": [
  60561. // "project"
  60562. // ],
  60563. // "parameters": {
  60564. // "filter": {
  60565. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  60566. // "location": "query",
  60567. // "type": "string"
  60568. // },
  60569. // "maxResults": {
  60570. // "default": "500",
  60571. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  60572. // "format": "uint32",
  60573. // "location": "query",
  60574. // "minimum": "0",
  60575. // "type": "integer"
  60576. // },
  60577. // "orderBy": {
  60578. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  60579. // "location": "query",
  60580. // "type": "string"
  60581. // },
  60582. // "pageToken": {
  60583. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  60584. // "location": "query",
  60585. // "type": "string"
  60586. // },
  60587. // "project": {
  60588. // "description": "Project ID for this request.",
  60589. // "location": "path",
  60590. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  60591. // "required": true,
  60592. // "type": "string"
  60593. // }
  60594. // },
  60595. // "path": "{project}/aggregated/machineTypes",
  60596. // "response": {
  60597. // "$ref": "MachineTypeAggregatedList"
  60598. // },
  60599. // "scopes": [
  60600. // "https://www.googleapis.com/auth/cloud-platform",
  60601. // "https://www.googleapis.com/auth/compute",
  60602. // "https://www.googleapis.com/auth/compute.readonly"
  60603. // ]
  60604. // }
  60605. }
  60606. // Pages invokes f for each page of results.
  60607. // A non-nil error returned from f will halt the iteration.
  60608. // The provided context supersedes any context provided to the Context method.
  60609. func (c *MachineTypesAggregatedListCall) Pages(ctx context.Context, f func(*MachineTypeAggregatedList) error) error {
  60610. c.ctx_ = ctx
  60611. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  60612. for {
  60613. x, err := c.Do()
  60614. if err != nil {
  60615. return err
  60616. }
  60617. if err := f(x); err != nil {
  60618. return err
  60619. }
  60620. if x.NextPageToken == "" {
  60621. return nil
  60622. }
  60623. c.PageToken(x.NextPageToken)
  60624. }
  60625. }
  60626. // method id "compute.machineTypes.get":
  60627. type MachineTypesGetCall struct {
  60628. s *Service
  60629. project string
  60630. zone string
  60631. machineType string
  60632. urlParams_ gensupport.URLParams
  60633. ifNoneMatch_ string
  60634. ctx_ context.Context
  60635. header_ http.Header
  60636. }
  60637. // Get: Returns the specified machine type. Gets a list of available
  60638. // machine types by making a list() request.
  60639. // For details, see https://cloud.google.com/compute/docs/reference/latest/machineTypes/get
  60640. func (r *MachineTypesService) Get(project string, zone string, machineType string) *MachineTypesGetCall {
  60641. c := &MachineTypesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  60642. c.project = project
  60643. c.zone = zone
  60644. c.machineType = machineType
  60645. return c
  60646. }
  60647. // Fields allows partial responses to be retrieved. See
  60648. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  60649. // for more information.
  60650. func (c *MachineTypesGetCall) Fields(s ...googleapi.Field) *MachineTypesGetCall {
  60651. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  60652. return c
  60653. }
  60654. // IfNoneMatch sets the optional parameter which makes the operation
  60655. // fail if the object's ETag matches the given value. This is useful for
  60656. // getting updates only after the object has changed since the last
  60657. // request. Use googleapi.IsNotModified to check whether the response
  60658. // error from Do is the result of In-None-Match.
  60659. func (c *MachineTypesGetCall) IfNoneMatch(entityTag string) *MachineTypesGetCall {
  60660. c.ifNoneMatch_ = entityTag
  60661. return c
  60662. }
  60663. // Context sets the context to be used in this call's Do method. Any
  60664. // pending HTTP request will be aborted if the provided context is
  60665. // canceled.
  60666. func (c *MachineTypesGetCall) Context(ctx context.Context) *MachineTypesGetCall {
  60667. c.ctx_ = ctx
  60668. return c
  60669. }
  60670. // Header returns an http.Header that can be modified by the caller to
  60671. // add HTTP headers to the request.
  60672. func (c *MachineTypesGetCall) Header() http.Header {
  60673. if c.header_ == nil {
  60674. c.header_ = make(http.Header)
  60675. }
  60676. return c.header_
  60677. }
  60678. func (c *MachineTypesGetCall) doRequest(alt string) (*http.Response, error) {
  60679. reqHeaders := make(http.Header)
  60680. for k, v := range c.header_ {
  60681. reqHeaders[k] = v
  60682. }
  60683. reqHeaders.Set("User-Agent", c.s.userAgent())
  60684. if c.ifNoneMatch_ != "" {
  60685. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  60686. }
  60687. var body io.Reader = nil
  60688. c.urlParams_.Set("alt", alt)
  60689. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/machineTypes/{machineType}")
  60690. urls += "?" + c.urlParams_.Encode()
  60691. req, _ := http.NewRequest("GET", urls, body)
  60692. req.Header = reqHeaders
  60693. googleapi.Expand(req.URL, map[string]string{
  60694. "project": c.project,
  60695. "zone": c.zone,
  60696. "machineType": c.machineType,
  60697. })
  60698. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  60699. }
  60700. // Do executes the "compute.machineTypes.get" call.
  60701. // Exactly one of *MachineType or error will be non-nil. Any non-2xx
  60702. // status code is an error. Response headers are in either
  60703. // *MachineType.ServerResponse.Header or (if a response was returned at
  60704. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  60705. // to check whether the returned error was because
  60706. // http.StatusNotModified was returned.
  60707. func (c *MachineTypesGetCall) Do(opts ...googleapi.CallOption) (*MachineType, error) {
  60708. gensupport.SetOptions(c.urlParams_, opts...)
  60709. res, err := c.doRequest("json")
  60710. if res != nil && res.StatusCode == http.StatusNotModified {
  60711. if res.Body != nil {
  60712. res.Body.Close()
  60713. }
  60714. return nil, &googleapi.Error{
  60715. Code: res.StatusCode,
  60716. Header: res.Header,
  60717. }
  60718. }
  60719. if err != nil {
  60720. return nil, err
  60721. }
  60722. defer googleapi.CloseBody(res)
  60723. if err := googleapi.CheckResponse(res); err != nil {
  60724. return nil, err
  60725. }
  60726. ret := &MachineType{
  60727. ServerResponse: googleapi.ServerResponse{
  60728. Header: res.Header,
  60729. HTTPStatusCode: res.StatusCode,
  60730. },
  60731. }
  60732. target := &ret
  60733. if err := gensupport.DecodeResponse(target, res); err != nil {
  60734. return nil, err
  60735. }
  60736. return ret, nil
  60737. // {
  60738. // "description": "Returns the specified machine type. Gets a list of available machine types by making a list() request.",
  60739. // "httpMethod": "GET",
  60740. // "id": "compute.machineTypes.get",
  60741. // "parameterOrder": [
  60742. // "project",
  60743. // "zone",
  60744. // "machineType"
  60745. // ],
  60746. // "parameters": {
  60747. // "machineType": {
  60748. // "description": "Name of the machine type to return.",
  60749. // "location": "path",
  60750. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  60751. // "required": true,
  60752. // "type": "string"
  60753. // },
  60754. // "project": {
  60755. // "description": "Project ID for this request.",
  60756. // "location": "path",
  60757. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  60758. // "required": true,
  60759. // "type": "string"
  60760. // },
  60761. // "zone": {
  60762. // "description": "The name of the zone for this request.",
  60763. // "location": "path",
  60764. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  60765. // "required": true,
  60766. // "type": "string"
  60767. // }
  60768. // },
  60769. // "path": "{project}/zones/{zone}/machineTypes/{machineType}",
  60770. // "response": {
  60771. // "$ref": "MachineType"
  60772. // },
  60773. // "scopes": [
  60774. // "https://www.googleapis.com/auth/cloud-platform",
  60775. // "https://www.googleapis.com/auth/compute",
  60776. // "https://www.googleapis.com/auth/compute.readonly"
  60777. // ]
  60778. // }
  60779. }
  60780. // method id "compute.machineTypes.list":
  60781. type MachineTypesListCall struct {
  60782. s *Service
  60783. project string
  60784. zone string
  60785. urlParams_ gensupport.URLParams
  60786. ifNoneMatch_ string
  60787. ctx_ context.Context
  60788. header_ http.Header
  60789. }
  60790. // List: Retrieves a list of machine types available to the specified
  60791. // project.
  60792. // For details, see https://cloud.google.com/compute/docs/reference/latest/machineTypes/list
  60793. func (r *MachineTypesService) List(project string, zone string) *MachineTypesListCall {
  60794. c := &MachineTypesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  60795. c.project = project
  60796. c.zone = zone
  60797. return c
  60798. }
  60799. // Filter sets the optional parameter "filter": A filter expression that
  60800. // filters resources listed in the response. The expression must specify
  60801. // the field name, a comparison operator, and the value that you want to
  60802. // use for filtering. The value must be a string, a number, or a
  60803. // boolean. The comparison operator must be either =, !=, >, or <.
  60804. //
  60805. // For example, if you are filtering Compute Engine instances, you can
  60806. // exclude instances named example-instance by specifying name !=
  60807. // example-instance.
  60808. //
  60809. // You can also filter nested fields. For example, you could specify
  60810. // scheduling.automaticRestart = false to include instances only if they
  60811. // are not scheduled for automatic restarts. You can use filtering on
  60812. // nested fields to filter based on resource labels.
  60813. //
  60814. // To filter on multiple expressions, provide each separate expression
  60815. // within parentheses. For example, (scheduling.automaticRestart = true)
  60816. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  60817. // AND expression. However, you can include AND and OR expressions
  60818. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  60819. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  60820. // true).
  60821. func (c *MachineTypesListCall) Filter(filter string) *MachineTypesListCall {
  60822. c.urlParams_.Set("filter", filter)
  60823. return c
  60824. }
  60825. // MaxResults sets the optional parameter "maxResults": The maximum
  60826. // number of results per page that should be returned. If the number of
  60827. // available results is larger than maxResults, Compute Engine returns a
  60828. // nextPageToken that can be used to get the next page of results in
  60829. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  60830. // (Default: 500)
  60831. func (c *MachineTypesListCall) MaxResults(maxResults int64) *MachineTypesListCall {
  60832. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  60833. return c
  60834. }
  60835. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  60836. // a certain order. By default, results are returned in alphanumerical
  60837. // order based on the resource name.
  60838. //
  60839. // You can also sort results in descending order based on the creation
  60840. // timestamp using orderBy="creationTimestamp desc". This sorts results
  60841. // based on the creationTimestamp field in reverse chronological order
  60842. // (newest result first). Use this to sort resources like operations so
  60843. // that the newest operation is returned first.
  60844. //
  60845. // Currently, only sorting by name or creationTimestamp desc is
  60846. // supported.
  60847. func (c *MachineTypesListCall) OrderBy(orderBy string) *MachineTypesListCall {
  60848. c.urlParams_.Set("orderBy", orderBy)
  60849. return c
  60850. }
  60851. // PageToken sets the optional parameter "pageToken": Specifies a page
  60852. // token to use. Set pageToken to the nextPageToken returned by a
  60853. // previous list request to get the next page of results.
  60854. func (c *MachineTypesListCall) PageToken(pageToken string) *MachineTypesListCall {
  60855. c.urlParams_.Set("pageToken", pageToken)
  60856. return c
  60857. }
  60858. // Fields allows partial responses to be retrieved. See
  60859. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  60860. // for more information.
  60861. func (c *MachineTypesListCall) Fields(s ...googleapi.Field) *MachineTypesListCall {
  60862. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  60863. return c
  60864. }
  60865. // IfNoneMatch sets the optional parameter which makes the operation
  60866. // fail if the object's ETag matches the given value. This is useful for
  60867. // getting updates only after the object has changed since the last
  60868. // request. Use googleapi.IsNotModified to check whether the response
  60869. // error from Do is the result of In-None-Match.
  60870. func (c *MachineTypesListCall) IfNoneMatch(entityTag string) *MachineTypesListCall {
  60871. c.ifNoneMatch_ = entityTag
  60872. return c
  60873. }
  60874. // Context sets the context to be used in this call's Do method. Any
  60875. // pending HTTP request will be aborted if the provided context is
  60876. // canceled.
  60877. func (c *MachineTypesListCall) Context(ctx context.Context) *MachineTypesListCall {
  60878. c.ctx_ = ctx
  60879. return c
  60880. }
  60881. // Header returns an http.Header that can be modified by the caller to
  60882. // add HTTP headers to the request.
  60883. func (c *MachineTypesListCall) Header() http.Header {
  60884. if c.header_ == nil {
  60885. c.header_ = make(http.Header)
  60886. }
  60887. return c.header_
  60888. }
  60889. func (c *MachineTypesListCall) doRequest(alt string) (*http.Response, error) {
  60890. reqHeaders := make(http.Header)
  60891. for k, v := range c.header_ {
  60892. reqHeaders[k] = v
  60893. }
  60894. reqHeaders.Set("User-Agent", c.s.userAgent())
  60895. if c.ifNoneMatch_ != "" {
  60896. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  60897. }
  60898. var body io.Reader = nil
  60899. c.urlParams_.Set("alt", alt)
  60900. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/machineTypes")
  60901. urls += "?" + c.urlParams_.Encode()
  60902. req, _ := http.NewRequest("GET", urls, body)
  60903. req.Header = reqHeaders
  60904. googleapi.Expand(req.URL, map[string]string{
  60905. "project": c.project,
  60906. "zone": c.zone,
  60907. })
  60908. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  60909. }
  60910. // Do executes the "compute.machineTypes.list" call.
  60911. // Exactly one of *MachineTypeList or error will be non-nil. Any non-2xx
  60912. // status code is an error. Response headers are in either
  60913. // *MachineTypeList.ServerResponse.Header or (if a response was returned
  60914. // at all) in error.(*googleapi.Error).Header. Use
  60915. // googleapi.IsNotModified to check whether the returned error was
  60916. // because http.StatusNotModified was returned.
  60917. func (c *MachineTypesListCall) Do(opts ...googleapi.CallOption) (*MachineTypeList, error) {
  60918. gensupport.SetOptions(c.urlParams_, opts...)
  60919. res, err := c.doRequest("json")
  60920. if res != nil && res.StatusCode == http.StatusNotModified {
  60921. if res.Body != nil {
  60922. res.Body.Close()
  60923. }
  60924. return nil, &googleapi.Error{
  60925. Code: res.StatusCode,
  60926. Header: res.Header,
  60927. }
  60928. }
  60929. if err != nil {
  60930. return nil, err
  60931. }
  60932. defer googleapi.CloseBody(res)
  60933. if err := googleapi.CheckResponse(res); err != nil {
  60934. return nil, err
  60935. }
  60936. ret := &MachineTypeList{
  60937. ServerResponse: googleapi.ServerResponse{
  60938. Header: res.Header,
  60939. HTTPStatusCode: res.StatusCode,
  60940. },
  60941. }
  60942. target := &ret
  60943. if err := gensupport.DecodeResponse(target, res); err != nil {
  60944. return nil, err
  60945. }
  60946. return ret, nil
  60947. // {
  60948. // "description": "Retrieves a list of machine types available to the specified project.",
  60949. // "httpMethod": "GET",
  60950. // "id": "compute.machineTypes.list",
  60951. // "parameterOrder": [
  60952. // "project",
  60953. // "zone"
  60954. // ],
  60955. // "parameters": {
  60956. // "filter": {
  60957. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  60958. // "location": "query",
  60959. // "type": "string"
  60960. // },
  60961. // "maxResults": {
  60962. // "default": "500",
  60963. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  60964. // "format": "uint32",
  60965. // "location": "query",
  60966. // "minimum": "0",
  60967. // "type": "integer"
  60968. // },
  60969. // "orderBy": {
  60970. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  60971. // "location": "query",
  60972. // "type": "string"
  60973. // },
  60974. // "pageToken": {
  60975. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  60976. // "location": "query",
  60977. // "type": "string"
  60978. // },
  60979. // "project": {
  60980. // "description": "Project ID for this request.",
  60981. // "location": "path",
  60982. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  60983. // "required": true,
  60984. // "type": "string"
  60985. // },
  60986. // "zone": {
  60987. // "description": "The name of the zone for this request.",
  60988. // "location": "path",
  60989. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  60990. // "required": true,
  60991. // "type": "string"
  60992. // }
  60993. // },
  60994. // "path": "{project}/zones/{zone}/machineTypes",
  60995. // "response": {
  60996. // "$ref": "MachineTypeList"
  60997. // },
  60998. // "scopes": [
  60999. // "https://www.googleapis.com/auth/cloud-platform",
  61000. // "https://www.googleapis.com/auth/compute",
  61001. // "https://www.googleapis.com/auth/compute.readonly"
  61002. // ]
  61003. // }
  61004. }
  61005. // Pages invokes f for each page of results.
  61006. // A non-nil error returned from f will halt the iteration.
  61007. // The provided context supersedes any context provided to the Context method.
  61008. func (c *MachineTypesListCall) Pages(ctx context.Context, f func(*MachineTypeList) error) error {
  61009. c.ctx_ = ctx
  61010. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  61011. for {
  61012. x, err := c.Do()
  61013. if err != nil {
  61014. return err
  61015. }
  61016. if err := f(x); err != nil {
  61017. return err
  61018. }
  61019. if x.NextPageToken == "" {
  61020. return nil
  61021. }
  61022. c.PageToken(x.NextPageToken)
  61023. }
  61024. }
  61025. // method id "compute.networkEndpointGroups.aggregatedList":
  61026. type NetworkEndpointGroupsAggregatedListCall struct {
  61027. s *Service
  61028. project string
  61029. urlParams_ gensupport.URLParams
  61030. ifNoneMatch_ string
  61031. ctx_ context.Context
  61032. header_ http.Header
  61033. }
  61034. // AggregatedList: Retrieves the list of network endpoint groups and
  61035. // sorts them by zone.
  61036. func (r *NetworkEndpointGroupsService) AggregatedList(project string) *NetworkEndpointGroupsAggregatedListCall {
  61037. c := &NetworkEndpointGroupsAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  61038. c.project = project
  61039. return c
  61040. }
  61041. // Filter sets the optional parameter "filter": A filter expression that
  61042. // filters resources listed in the response. The expression must specify
  61043. // the field name, a comparison operator, and the value that you want to
  61044. // use for filtering. The value must be a string, a number, or a
  61045. // boolean. The comparison operator must be either =, !=, >, or <.
  61046. //
  61047. // For example, if you are filtering Compute Engine instances, you can
  61048. // exclude instances named example-instance by specifying name !=
  61049. // example-instance.
  61050. //
  61051. // You can also filter nested fields. For example, you could specify
  61052. // scheduling.automaticRestart = false to include instances only if they
  61053. // are not scheduled for automatic restarts. You can use filtering on
  61054. // nested fields to filter based on resource labels.
  61055. //
  61056. // To filter on multiple expressions, provide each separate expression
  61057. // within parentheses. For example, (scheduling.automaticRestart = true)
  61058. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  61059. // AND expression. However, you can include AND and OR expressions
  61060. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  61061. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  61062. // true).
  61063. func (c *NetworkEndpointGroupsAggregatedListCall) Filter(filter string) *NetworkEndpointGroupsAggregatedListCall {
  61064. c.urlParams_.Set("filter", filter)
  61065. return c
  61066. }
  61067. // MaxResults sets the optional parameter "maxResults": The maximum
  61068. // number of results per page that should be returned. If the number of
  61069. // available results is larger than maxResults, Compute Engine returns a
  61070. // nextPageToken that can be used to get the next page of results in
  61071. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  61072. // (Default: 500)
  61073. func (c *NetworkEndpointGroupsAggregatedListCall) MaxResults(maxResults int64) *NetworkEndpointGroupsAggregatedListCall {
  61074. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  61075. return c
  61076. }
  61077. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  61078. // a certain order. By default, results are returned in alphanumerical
  61079. // order based on the resource name.
  61080. //
  61081. // You can also sort results in descending order based on the creation
  61082. // timestamp using orderBy="creationTimestamp desc". This sorts results
  61083. // based on the creationTimestamp field in reverse chronological order
  61084. // (newest result first). Use this to sort resources like operations so
  61085. // that the newest operation is returned first.
  61086. //
  61087. // Currently, only sorting by name or creationTimestamp desc is
  61088. // supported.
  61089. func (c *NetworkEndpointGroupsAggregatedListCall) OrderBy(orderBy string) *NetworkEndpointGroupsAggregatedListCall {
  61090. c.urlParams_.Set("orderBy", orderBy)
  61091. return c
  61092. }
  61093. // PageToken sets the optional parameter "pageToken": Specifies a page
  61094. // token to use. Set pageToken to the nextPageToken returned by a
  61095. // previous list request to get the next page of results.
  61096. func (c *NetworkEndpointGroupsAggregatedListCall) PageToken(pageToken string) *NetworkEndpointGroupsAggregatedListCall {
  61097. c.urlParams_.Set("pageToken", pageToken)
  61098. return c
  61099. }
  61100. // Fields allows partial responses to be retrieved. See
  61101. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  61102. // for more information.
  61103. func (c *NetworkEndpointGroupsAggregatedListCall) Fields(s ...googleapi.Field) *NetworkEndpointGroupsAggregatedListCall {
  61104. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  61105. return c
  61106. }
  61107. // IfNoneMatch sets the optional parameter which makes the operation
  61108. // fail if the object's ETag matches the given value. This is useful for
  61109. // getting updates only after the object has changed since the last
  61110. // request. Use googleapi.IsNotModified to check whether the response
  61111. // error from Do is the result of In-None-Match.
  61112. func (c *NetworkEndpointGroupsAggregatedListCall) IfNoneMatch(entityTag string) *NetworkEndpointGroupsAggregatedListCall {
  61113. c.ifNoneMatch_ = entityTag
  61114. return c
  61115. }
  61116. // Context sets the context to be used in this call's Do method. Any
  61117. // pending HTTP request will be aborted if the provided context is
  61118. // canceled.
  61119. func (c *NetworkEndpointGroupsAggregatedListCall) Context(ctx context.Context) *NetworkEndpointGroupsAggregatedListCall {
  61120. c.ctx_ = ctx
  61121. return c
  61122. }
  61123. // Header returns an http.Header that can be modified by the caller to
  61124. // add HTTP headers to the request.
  61125. func (c *NetworkEndpointGroupsAggregatedListCall) Header() http.Header {
  61126. if c.header_ == nil {
  61127. c.header_ = make(http.Header)
  61128. }
  61129. return c.header_
  61130. }
  61131. func (c *NetworkEndpointGroupsAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  61132. reqHeaders := make(http.Header)
  61133. for k, v := range c.header_ {
  61134. reqHeaders[k] = v
  61135. }
  61136. reqHeaders.Set("User-Agent", c.s.userAgent())
  61137. if c.ifNoneMatch_ != "" {
  61138. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  61139. }
  61140. var body io.Reader = nil
  61141. c.urlParams_.Set("alt", alt)
  61142. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/networkEndpointGroups")
  61143. urls += "?" + c.urlParams_.Encode()
  61144. req, _ := http.NewRequest("GET", urls, body)
  61145. req.Header = reqHeaders
  61146. googleapi.Expand(req.URL, map[string]string{
  61147. "project": c.project,
  61148. })
  61149. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  61150. }
  61151. // Do executes the "compute.networkEndpointGroups.aggregatedList" call.
  61152. // Exactly one of *NetworkEndpointGroupAggregatedList or error will be
  61153. // non-nil. Any non-2xx status code is an error. Response headers are in
  61154. // either *NetworkEndpointGroupAggregatedList.ServerResponse.Header or
  61155. // (if a response was returned at all) in
  61156. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  61157. // whether the returned error was because http.StatusNotModified was
  61158. // returned.
  61159. func (c *NetworkEndpointGroupsAggregatedListCall) Do(opts ...googleapi.CallOption) (*NetworkEndpointGroupAggregatedList, error) {
  61160. gensupport.SetOptions(c.urlParams_, opts...)
  61161. res, err := c.doRequest("json")
  61162. if res != nil && res.StatusCode == http.StatusNotModified {
  61163. if res.Body != nil {
  61164. res.Body.Close()
  61165. }
  61166. return nil, &googleapi.Error{
  61167. Code: res.StatusCode,
  61168. Header: res.Header,
  61169. }
  61170. }
  61171. if err != nil {
  61172. return nil, err
  61173. }
  61174. defer googleapi.CloseBody(res)
  61175. if err := googleapi.CheckResponse(res); err != nil {
  61176. return nil, err
  61177. }
  61178. ret := &NetworkEndpointGroupAggregatedList{
  61179. ServerResponse: googleapi.ServerResponse{
  61180. Header: res.Header,
  61181. HTTPStatusCode: res.StatusCode,
  61182. },
  61183. }
  61184. target := &ret
  61185. if err := gensupport.DecodeResponse(target, res); err != nil {
  61186. return nil, err
  61187. }
  61188. return ret, nil
  61189. // {
  61190. // "description": "Retrieves the list of network endpoint groups and sorts them by zone.",
  61191. // "httpMethod": "GET",
  61192. // "id": "compute.networkEndpointGroups.aggregatedList",
  61193. // "parameterOrder": [
  61194. // "project"
  61195. // ],
  61196. // "parameters": {
  61197. // "filter": {
  61198. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  61199. // "location": "query",
  61200. // "type": "string"
  61201. // },
  61202. // "maxResults": {
  61203. // "default": "500",
  61204. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  61205. // "format": "uint32",
  61206. // "location": "query",
  61207. // "minimum": "0",
  61208. // "type": "integer"
  61209. // },
  61210. // "orderBy": {
  61211. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  61212. // "location": "query",
  61213. // "type": "string"
  61214. // },
  61215. // "pageToken": {
  61216. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  61217. // "location": "query",
  61218. // "type": "string"
  61219. // },
  61220. // "project": {
  61221. // "description": "Project ID for this request.",
  61222. // "location": "path",
  61223. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  61224. // "required": true,
  61225. // "type": "string"
  61226. // }
  61227. // },
  61228. // "path": "{project}/aggregated/networkEndpointGroups",
  61229. // "response": {
  61230. // "$ref": "NetworkEndpointGroupAggregatedList"
  61231. // },
  61232. // "scopes": [
  61233. // "https://www.googleapis.com/auth/cloud-platform",
  61234. // "https://www.googleapis.com/auth/compute",
  61235. // "https://www.googleapis.com/auth/compute.readonly"
  61236. // ]
  61237. // }
  61238. }
  61239. // Pages invokes f for each page of results.
  61240. // A non-nil error returned from f will halt the iteration.
  61241. // The provided context supersedes any context provided to the Context method.
  61242. func (c *NetworkEndpointGroupsAggregatedListCall) Pages(ctx context.Context, f func(*NetworkEndpointGroupAggregatedList) error) error {
  61243. c.ctx_ = ctx
  61244. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  61245. for {
  61246. x, err := c.Do()
  61247. if err != nil {
  61248. return err
  61249. }
  61250. if err := f(x); err != nil {
  61251. return err
  61252. }
  61253. if x.NextPageToken == "" {
  61254. return nil
  61255. }
  61256. c.PageToken(x.NextPageToken)
  61257. }
  61258. }
  61259. // method id "compute.networkEndpointGroups.attachNetworkEndpoints":
  61260. type NetworkEndpointGroupsAttachNetworkEndpointsCall struct {
  61261. s *Service
  61262. project string
  61263. zone string
  61264. networkEndpointGroup string
  61265. networkendpointgroupsattachendpointsrequest *NetworkEndpointGroupsAttachEndpointsRequest
  61266. urlParams_ gensupport.URLParams
  61267. ctx_ context.Context
  61268. header_ http.Header
  61269. }
  61270. // AttachNetworkEndpoints: Attach a list of network endpoints to the
  61271. // specified network endpoint group.
  61272. func (r *NetworkEndpointGroupsService) AttachNetworkEndpoints(project string, zone string, networkEndpointGroup string, networkendpointgroupsattachendpointsrequest *NetworkEndpointGroupsAttachEndpointsRequest) *NetworkEndpointGroupsAttachNetworkEndpointsCall {
  61273. c := &NetworkEndpointGroupsAttachNetworkEndpointsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  61274. c.project = project
  61275. c.zone = zone
  61276. c.networkEndpointGroup = networkEndpointGroup
  61277. c.networkendpointgroupsattachendpointsrequest = networkendpointgroupsattachendpointsrequest
  61278. return c
  61279. }
  61280. // RequestId sets the optional parameter "requestId": An optional
  61281. // request ID to identify requests. Specify a unique request ID so that
  61282. // if you must retry your request, the server will know to ignore the
  61283. // request if it has already been completed.
  61284. //
  61285. // For example, consider a situation where you make an initial request
  61286. // and the request times out. If you make the request again with the
  61287. // same request ID, the server can check if original operation with the
  61288. // same request ID was received, and if so, will ignore the second
  61289. // request. This prevents clients from accidentally creating duplicate
  61290. // commitments.
  61291. //
  61292. // The request ID must be a valid UUID with the exception that zero UUID
  61293. // is not supported (00000000-0000-0000-0000-000000000000).
  61294. func (c *NetworkEndpointGroupsAttachNetworkEndpointsCall) RequestId(requestId string) *NetworkEndpointGroupsAttachNetworkEndpointsCall {
  61295. c.urlParams_.Set("requestId", requestId)
  61296. return c
  61297. }
  61298. // Fields allows partial responses to be retrieved. See
  61299. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  61300. // for more information.
  61301. func (c *NetworkEndpointGroupsAttachNetworkEndpointsCall) Fields(s ...googleapi.Field) *NetworkEndpointGroupsAttachNetworkEndpointsCall {
  61302. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  61303. return c
  61304. }
  61305. // Context sets the context to be used in this call's Do method. Any
  61306. // pending HTTP request will be aborted if the provided context is
  61307. // canceled.
  61308. func (c *NetworkEndpointGroupsAttachNetworkEndpointsCall) Context(ctx context.Context) *NetworkEndpointGroupsAttachNetworkEndpointsCall {
  61309. c.ctx_ = ctx
  61310. return c
  61311. }
  61312. // Header returns an http.Header that can be modified by the caller to
  61313. // add HTTP headers to the request.
  61314. func (c *NetworkEndpointGroupsAttachNetworkEndpointsCall) Header() http.Header {
  61315. if c.header_ == nil {
  61316. c.header_ = make(http.Header)
  61317. }
  61318. return c.header_
  61319. }
  61320. func (c *NetworkEndpointGroupsAttachNetworkEndpointsCall) doRequest(alt string) (*http.Response, error) {
  61321. reqHeaders := make(http.Header)
  61322. for k, v := range c.header_ {
  61323. reqHeaders[k] = v
  61324. }
  61325. reqHeaders.Set("User-Agent", c.s.userAgent())
  61326. var body io.Reader = nil
  61327. body, err := googleapi.WithoutDataWrapper.JSONReader(c.networkendpointgroupsattachendpointsrequest)
  61328. if err != nil {
  61329. return nil, err
  61330. }
  61331. reqHeaders.Set("Content-Type", "application/json")
  61332. c.urlParams_.Set("alt", alt)
  61333. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/networkEndpointGroups/{networkEndpointGroup}/attachNetworkEndpoints")
  61334. urls += "?" + c.urlParams_.Encode()
  61335. req, _ := http.NewRequest("POST", urls, body)
  61336. req.Header = reqHeaders
  61337. googleapi.Expand(req.URL, map[string]string{
  61338. "project": c.project,
  61339. "zone": c.zone,
  61340. "networkEndpointGroup": c.networkEndpointGroup,
  61341. })
  61342. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  61343. }
  61344. // Do executes the "compute.networkEndpointGroups.attachNetworkEndpoints" call.
  61345. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  61346. // status code is an error. Response headers are in either
  61347. // *Operation.ServerResponse.Header or (if a response was returned at
  61348. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  61349. // to check whether the returned error was because
  61350. // http.StatusNotModified was returned.
  61351. func (c *NetworkEndpointGroupsAttachNetworkEndpointsCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  61352. gensupport.SetOptions(c.urlParams_, opts...)
  61353. res, err := c.doRequest("json")
  61354. if res != nil && res.StatusCode == http.StatusNotModified {
  61355. if res.Body != nil {
  61356. res.Body.Close()
  61357. }
  61358. return nil, &googleapi.Error{
  61359. Code: res.StatusCode,
  61360. Header: res.Header,
  61361. }
  61362. }
  61363. if err != nil {
  61364. return nil, err
  61365. }
  61366. defer googleapi.CloseBody(res)
  61367. if err := googleapi.CheckResponse(res); err != nil {
  61368. return nil, err
  61369. }
  61370. ret := &Operation{
  61371. ServerResponse: googleapi.ServerResponse{
  61372. Header: res.Header,
  61373. HTTPStatusCode: res.StatusCode,
  61374. },
  61375. }
  61376. target := &ret
  61377. if err := gensupport.DecodeResponse(target, res); err != nil {
  61378. return nil, err
  61379. }
  61380. return ret, nil
  61381. // {
  61382. // "description": "Attach a list of network endpoints to the specified network endpoint group.",
  61383. // "httpMethod": "POST",
  61384. // "id": "compute.networkEndpointGroups.attachNetworkEndpoints",
  61385. // "parameterOrder": [
  61386. // "project",
  61387. // "zone",
  61388. // "networkEndpointGroup"
  61389. // ],
  61390. // "parameters": {
  61391. // "networkEndpointGroup": {
  61392. // "description": "The name of the network endpoint group where you are attaching network endpoints to. It should comply with RFC1035.",
  61393. // "location": "path",
  61394. // "required": true,
  61395. // "type": "string"
  61396. // },
  61397. // "project": {
  61398. // "description": "Project ID for this request.",
  61399. // "location": "path",
  61400. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  61401. // "required": true,
  61402. // "type": "string"
  61403. // },
  61404. // "requestId": {
  61405. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  61406. // "location": "query",
  61407. // "type": "string"
  61408. // },
  61409. // "zone": {
  61410. // "description": "The name of the zone where the network endpoint group is located. It should comply with RFC1035.",
  61411. // "location": "path",
  61412. // "required": true,
  61413. // "type": "string"
  61414. // }
  61415. // },
  61416. // "path": "{project}/zones/{zone}/networkEndpointGroups/{networkEndpointGroup}/attachNetworkEndpoints",
  61417. // "request": {
  61418. // "$ref": "NetworkEndpointGroupsAttachEndpointsRequest"
  61419. // },
  61420. // "response": {
  61421. // "$ref": "Operation"
  61422. // },
  61423. // "scopes": [
  61424. // "https://www.googleapis.com/auth/cloud-platform",
  61425. // "https://www.googleapis.com/auth/compute"
  61426. // ]
  61427. // }
  61428. }
  61429. // method id "compute.networkEndpointGroups.delete":
  61430. type NetworkEndpointGroupsDeleteCall struct {
  61431. s *Service
  61432. project string
  61433. zone string
  61434. networkEndpointGroup string
  61435. urlParams_ gensupport.URLParams
  61436. ctx_ context.Context
  61437. header_ http.Header
  61438. }
  61439. // Delete: Deletes the specified network endpoint group. The network
  61440. // endpoints in the NEG and the VM instances they belong to are not
  61441. // terminated when the NEG is deleted. Note that the NEG cannot be
  61442. // deleted if there are backend services referencing it.
  61443. func (r *NetworkEndpointGroupsService) Delete(project string, zone string, networkEndpointGroup string) *NetworkEndpointGroupsDeleteCall {
  61444. c := &NetworkEndpointGroupsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  61445. c.project = project
  61446. c.zone = zone
  61447. c.networkEndpointGroup = networkEndpointGroup
  61448. return c
  61449. }
  61450. // RequestId sets the optional parameter "requestId": An optional
  61451. // request ID to identify requests. Specify a unique request ID so that
  61452. // if you must retry your request, the server will know to ignore the
  61453. // request if it has already been completed.
  61454. //
  61455. // For example, consider a situation where you make an initial request
  61456. // and the request times out. If you make the request again with the
  61457. // same request ID, the server can check if original operation with the
  61458. // same request ID was received, and if so, will ignore the second
  61459. // request. This prevents clients from accidentally creating duplicate
  61460. // commitments.
  61461. //
  61462. // The request ID must be a valid UUID with the exception that zero UUID
  61463. // is not supported (00000000-0000-0000-0000-000000000000).
  61464. func (c *NetworkEndpointGroupsDeleteCall) RequestId(requestId string) *NetworkEndpointGroupsDeleteCall {
  61465. c.urlParams_.Set("requestId", requestId)
  61466. return c
  61467. }
  61468. // Fields allows partial responses to be retrieved. See
  61469. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  61470. // for more information.
  61471. func (c *NetworkEndpointGroupsDeleteCall) Fields(s ...googleapi.Field) *NetworkEndpointGroupsDeleteCall {
  61472. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  61473. return c
  61474. }
  61475. // Context sets the context to be used in this call's Do method. Any
  61476. // pending HTTP request will be aborted if the provided context is
  61477. // canceled.
  61478. func (c *NetworkEndpointGroupsDeleteCall) Context(ctx context.Context) *NetworkEndpointGroupsDeleteCall {
  61479. c.ctx_ = ctx
  61480. return c
  61481. }
  61482. // Header returns an http.Header that can be modified by the caller to
  61483. // add HTTP headers to the request.
  61484. func (c *NetworkEndpointGroupsDeleteCall) Header() http.Header {
  61485. if c.header_ == nil {
  61486. c.header_ = make(http.Header)
  61487. }
  61488. return c.header_
  61489. }
  61490. func (c *NetworkEndpointGroupsDeleteCall) doRequest(alt string) (*http.Response, error) {
  61491. reqHeaders := make(http.Header)
  61492. for k, v := range c.header_ {
  61493. reqHeaders[k] = v
  61494. }
  61495. reqHeaders.Set("User-Agent", c.s.userAgent())
  61496. var body io.Reader = nil
  61497. c.urlParams_.Set("alt", alt)
  61498. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/networkEndpointGroups/{networkEndpointGroup}")
  61499. urls += "?" + c.urlParams_.Encode()
  61500. req, _ := http.NewRequest("DELETE", urls, body)
  61501. req.Header = reqHeaders
  61502. googleapi.Expand(req.URL, map[string]string{
  61503. "project": c.project,
  61504. "zone": c.zone,
  61505. "networkEndpointGroup": c.networkEndpointGroup,
  61506. })
  61507. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  61508. }
  61509. // Do executes the "compute.networkEndpointGroups.delete" call.
  61510. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  61511. // status code is an error. Response headers are in either
  61512. // *Operation.ServerResponse.Header or (if a response was returned at
  61513. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  61514. // to check whether the returned error was because
  61515. // http.StatusNotModified was returned.
  61516. func (c *NetworkEndpointGroupsDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  61517. gensupport.SetOptions(c.urlParams_, opts...)
  61518. res, err := c.doRequest("json")
  61519. if res != nil && res.StatusCode == http.StatusNotModified {
  61520. if res.Body != nil {
  61521. res.Body.Close()
  61522. }
  61523. return nil, &googleapi.Error{
  61524. Code: res.StatusCode,
  61525. Header: res.Header,
  61526. }
  61527. }
  61528. if err != nil {
  61529. return nil, err
  61530. }
  61531. defer googleapi.CloseBody(res)
  61532. if err := googleapi.CheckResponse(res); err != nil {
  61533. return nil, err
  61534. }
  61535. ret := &Operation{
  61536. ServerResponse: googleapi.ServerResponse{
  61537. Header: res.Header,
  61538. HTTPStatusCode: res.StatusCode,
  61539. },
  61540. }
  61541. target := &ret
  61542. if err := gensupport.DecodeResponse(target, res); err != nil {
  61543. return nil, err
  61544. }
  61545. return ret, nil
  61546. // {
  61547. // "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.",
  61548. // "httpMethod": "DELETE",
  61549. // "id": "compute.networkEndpointGroups.delete",
  61550. // "parameterOrder": [
  61551. // "project",
  61552. // "zone",
  61553. // "networkEndpointGroup"
  61554. // ],
  61555. // "parameters": {
  61556. // "networkEndpointGroup": {
  61557. // "description": "The name of the network endpoint group to delete. It should comply with RFC1035.",
  61558. // "location": "path",
  61559. // "required": true,
  61560. // "type": "string"
  61561. // },
  61562. // "project": {
  61563. // "description": "Project ID for this request.",
  61564. // "location": "path",
  61565. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  61566. // "required": true,
  61567. // "type": "string"
  61568. // },
  61569. // "requestId": {
  61570. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  61571. // "location": "query",
  61572. // "type": "string"
  61573. // },
  61574. // "zone": {
  61575. // "description": "The name of the zone where the network endpoint group is located. It should comply with RFC1035.",
  61576. // "location": "path",
  61577. // "required": true,
  61578. // "type": "string"
  61579. // }
  61580. // },
  61581. // "path": "{project}/zones/{zone}/networkEndpointGroups/{networkEndpointGroup}",
  61582. // "response": {
  61583. // "$ref": "Operation"
  61584. // },
  61585. // "scopes": [
  61586. // "https://www.googleapis.com/auth/cloud-platform",
  61587. // "https://www.googleapis.com/auth/compute"
  61588. // ]
  61589. // }
  61590. }
  61591. // method id "compute.networkEndpointGroups.detachNetworkEndpoints":
  61592. type NetworkEndpointGroupsDetachNetworkEndpointsCall struct {
  61593. s *Service
  61594. project string
  61595. zone string
  61596. networkEndpointGroup string
  61597. networkendpointgroupsdetachendpointsrequest *NetworkEndpointGroupsDetachEndpointsRequest
  61598. urlParams_ gensupport.URLParams
  61599. ctx_ context.Context
  61600. header_ http.Header
  61601. }
  61602. // DetachNetworkEndpoints: Detach a list of network endpoints from the
  61603. // specified network endpoint group.
  61604. func (r *NetworkEndpointGroupsService) DetachNetworkEndpoints(project string, zone string, networkEndpointGroup string, networkendpointgroupsdetachendpointsrequest *NetworkEndpointGroupsDetachEndpointsRequest) *NetworkEndpointGroupsDetachNetworkEndpointsCall {
  61605. c := &NetworkEndpointGroupsDetachNetworkEndpointsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  61606. c.project = project
  61607. c.zone = zone
  61608. c.networkEndpointGroup = networkEndpointGroup
  61609. c.networkendpointgroupsdetachendpointsrequest = networkendpointgroupsdetachendpointsrequest
  61610. return c
  61611. }
  61612. // RequestId sets the optional parameter "requestId": An optional
  61613. // request ID to identify requests. Specify a unique request ID so that
  61614. // if you must retry your request, the server will know to ignore the
  61615. // request if it has already been completed.
  61616. //
  61617. // For example, consider a situation where you make an initial request
  61618. // and the request times out. If you make the request again with the
  61619. // same request ID, the server can check if original operation with the
  61620. // same request ID was received, and if so, will ignore the second
  61621. // request. This prevents clients from accidentally creating duplicate
  61622. // commitments.
  61623. //
  61624. // The request ID must be a valid UUID with the exception that zero UUID
  61625. // is not supported (00000000-0000-0000-0000-000000000000).
  61626. func (c *NetworkEndpointGroupsDetachNetworkEndpointsCall) RequestId(requestId string) *NetworkEndpointGroupsDetachNetworkEndpointsCall {
  61627. c.urlParams_.Set("requestId", requestId)
  61628. return c
  61629. }
  61630. // Fields allows partial responses to be retrieved. See
  61631. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  61632. // for more information.
  61633. func (c *NetworkEndpointGroupsDetachNetworkEndpointsCall) Fields(s ...googleapi.Field) *NetworkEndpointGroupsDetachNetworkEndpointsCall {
  61634. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  61635. return c
  61636. }
  61637. // Context sets the context to be used in this call's Do method. Any
  61638. // pending HTTP request will be aborted if the provided context is
  61639. // canceled.
  61640. func (c *NetworkEndpointGroupsDetachNetworkEndpointsCall) Context(ctx context.Context) *NetworkEndpointGroupsDetachNetworkEndpointsCall {
  61641. c.ctx_ = ctx
  61642. return c
  61643. }
  61644. // Header returns an http.Header that can be modified by the caller to
  61645. // add HTTP headers to the request.
  61646. func (c *NetworkEndpointGroupsDetachNetworkEndpointsCall) Header() http.Header {
  61647. if c.header_ == nil {
  61648. c.header_ = make(http.Header)
  61649. }
  61650. return c.header_
  61651. }
  61652. func (c *NetworkEndpointGroupsDetachNetworkEndpointsCall) doRequest(alt string) (*http.Response, error) {
  61653. reqHeaders := make(http.Header)
  61654. for k, v := range c.header_ {
  61655. reqHeaders[k] = v
  61656. }
  61657. reqHeaders.Set("User-Agent", c.s.userAgent())
  61658. var body io.Reader = nil
  61659. body, err := googleapi.WithoutDataWrapper.JSONReader(c.networkendpointgroupsdetachendpointsrequest)
  61660. if err != nil {
  61661. return nil, err
  61662. }
  61663. reqHeaders.Set("Content-Type", "application/json")
  61664. c.urlParams_.Set("alt", alt)
  61665. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/networkEndpointGroups/{networkEndpointGroup}/detachNetworkEndpoints")
  61666. urls += "?" + c.urlParams_.Encode()
  61667. req, _ := http.NewRequest("POST", urls, body)
  61668. req.Header = reqHeaders
  61669. googleapi.Expand(req.URL, map[string]string{
  61670. "project": c.project,
  61671. "zone": c.zone,
  61672. "networkEndpointGroup": c.networkEndpointGroup,
  61673. })
  61674. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  61675. }
  61676. // Do executes the "compute.networkEndpointGroups.detachNetworkEndpoints" call.
  61677. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  61678. // status code is an error. Response headers are in either
  61679. // *Operation.ServerResponse.Header or (if a response was returned at
  61680. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  61681. // to check whether the returned error was because
  61682. // http.StatusNotModified was returned.
  61683. func (c *NetworkEndpointGroupsDetachNetworkEndpointsCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  61684. gensupport.SetOptions(c.urlParams_, opts...)
  61685. res, err := c.doRequest("json")
  61686. if res != nil && res.StatusCode == http.StatusNotModified {
  61687. if res.Body != nil {
  61688. res.Body.Close()
  61689. }
  61690. return nil, &googleapi.Error{
  61691. Code: res.StatusCode,
  61692. Header: res.Header,
  61693. }
  61694. }
  61695. if err != nil {
  61696. return nil, err
  61697. }
  61698. defer googleapi.CloseBody(res)
  61699. if err := googleapi.CheckResponse(res); err != nil {
  61700. return nil, err
  61701. }
  61702. ret := &Operation{
  61703. ServerResponse: googleapi.ServerResponse{
  61704. Header: res.Header,
  61705. HTTPStatusCode: res.StatusCode,
  61706. },
  61707. }
  61708. target := &ret
  61709. if err := gensupport.DecodeResponse(target, res); err != nil {
  61710. return nil, err
  61711. }
  61712. return ret, nil
  61713. // {
  61714. // "description": "Detach a list of network endpoints from the specified network endpoint group.",
  61715. // "httpMethod": "POST",
  61716. // "id": "compute.networkEndpointGroups.detachNetworkEndpoints",
  61717. // "parameterOrder": [
  61718. // "project",
  61719. // "zone",
  61720. // "networkEndpointGroup"
  61721. // ],
  61722. // "parameters": {
  61723. // "networkEndpointGroup": {
  61724. // "description": "The name of the network endpoint group where you are removing network endpoints. It should comply with RFC1035.",
  61725. // "location": "path",
  61726. // "required": true,
  61727. // "type": "string"
  61728. // },
  61729. // "project": {
  61730. // "description": "Project ID for this request.",
  61731. // "location": "path",
  61732. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  61733. // "required": true,
  61734. // "type": "string"
  61735. // },
  61736. // "requestId": {
  61737. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  61738. // "location": "query",
  61739. // "type": "string"
  61740. // },
  61741. // "zone": {
  61742. // "description": "The name of the zone where the network endpoint group is located. It should comply with RFC1035.",
  61743. // "location": "path",
  61744. // "required": true,
  61745. // "type": "string"
  61746. // }
  61747. // },
  61748. // "path": "{project}/zones/{zone}/networkEndpointGroups/{networkEndpointGroup}/detachNetworkEndpoints",
  61749. // "request": {
  61750. // "$ref": "NetworkEndpointGroupsDetachEndpointsRequest"
  61751. // },
  61752. // "response": {
  61753. // "$ref": "Operation"
  61754. // },
  61755. // "scopes": [
  61756. // "https://www.googleapis.com/auth/cloud-platform",
  61757. // "https://www.googleapis.com/auth/compute"
  61758. // ]
  61759. // }
  61760. }
  61761. // method id "compute.networkEndpointGroups.get":
  61762. type NetworkEndpointGroupsGetCall struct {
  61763. s *Service
  61764. project string
  61765. zone string
  61766. networkEndpointGroup string
  61767. urlParams_ gensupport.URLParams
  61768. ifNoneMatch_ string
  61769. ctx_ context.Context
  61770. header_ http.Header
  61771. }
  61772. // Get: Returns the specified network endpoint group. Gets a list of
  61773. // available network endpoint groups by making a list() request.
  61774. func (r *NetworkEndpointGroupsService) Get(project string, zone string, networkEndpointGroup string) *NetworkEndpointGroupsGetCall {
  61775. c := &NetworkEndpointGroupsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  61776. c.project = project
  61777. c.zone = zone
  61778. c.networkEndpointGroup = networkEndpointGroup
  61779. return c
  61780. }
  61781. // Fields allows partial responses to be retrieved. See
  61782. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  61783. // for more information.
  61784. func (c *NetworkEndpointGroupsGetCall) Fields(s ...googleapi.Field) *NetworkEndpointGroupsGetCall {
  61785. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  61786. return c
  61787. }
  61788. // IfNoneMatch sets the optional parameter which makes the operation
  61789. // fail if the object's ETag matches the given value. This is useful for
  61790. // getting updates only after the object has changed since the last
  61791. // request. Use googleapi.IsNotModified to check whether the response
  61792. // error from Do is the result of In-None-Match.
  61793. func (c *NetworkEndpointGroupsGetCall) IfNoneMatch(entityTag string) *NetworkEndpointGroupsGetCall {
  61794. c.ifNoneMatch_ = entityTag
  61795. return c
  61796. }
  61797. // Context sets the context to be used in this call's Do method. Any
  61798. // pending HTTP request will be aborted if the provided context is
  61799. // canceled.
  61800. func (c *NetworkEndpointGroupsGetCall) Context(ctx context.Context) *NetworkEndpointGroupsGetCall {
  61801. c.ctx_ = ctx
  61802. return c
  61803. }
  61804. // Header returns an http.Header that can be modified by the caller to
  61805. // add HTTP headers to the request.
  61806. func (c *NetworkEndpointGroupsGetCall) Header() http.Header {
  61807. if c.header_ == nil {
  61808. c.header_ = make(http.Header)
  61809. }
  61810. return c.header_
  61811. }
  61812. func (c *NetworkEndpointGroupsGetCall) doRequest(alt string) (*http.Response, error) {
  61813. reqHeaders := make(http.Header)
  61814. for k, v := range c.header_ {
  61815. reqHeaders[k] = v
  61816. }
  61817. reqHeaders.Set("User-Agent", c.s.userAgent())
  61818. if c.ifNoneMatch_ != "" {
  61819. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  61820. }
  61821. var body io.Reader = nil
  61822. c.urlParams_.Set("alt", alt)
  61823. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/networkEndpointGroups/{networkEndpointGroup}")
  61824. urls += "?" + c.urlParams_.Encode()
  61825. req, _ := http.NewRequest("GET", urls, body)
  61826. req.Header = reqHeaders
  61827. googleapi.Expand(req.URL, map[string]string{
  61828. "project": c.project,
  61829. "zone": c.zone,
  61830. "networkEndpointGroup": c.networkEndpointGroup,
  61831. })
  61832. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  61833. }
  61834. // Do executes the "compute.networkEndpointGroups.get" call.
  61835. // Exactly one of *NetworkEndpointGroup or error will be non-nil. Any
  61836. // non-2xx status code is an error. Response headers are in either
  61837. // *NetworkEndpointGroup.ServerResponse.Header or (if a response was
  61838. // returned at all) in error.(*googleapi.Error).Header. Use
  61839. // googleapi.IsNotModified to check whether the returned error was
  61840. // because http.StatusNotModified was returned.
  61841. func (c *NetworkEndpointGroupsGetCall) Do(opts ...googleapi.CallOption) (*NetworkEndpointGroup, error) {
  61842. gensupport.SetOptions(c.urlParams_, opts...)
  61843. res, err := c.doRequest("json")
  61844. if res != nil && res.StatusCode == http.StatusNotModified {
  61845. if res.Body != nil {
  61846. res.Body.Close()
  61847. }
  61848. return nil, &googleapi.Error{
  61849. Code: res.StatusCode,
  61850. Header: res.Header,
  61851. }
  61852. }
  61853. if err != nil {
  61854. return nil, err
  61855. }
  61856. defer googleapi.CloseBody(res)
  61857. if err := googleapi.CheckResponse(res); err != nil {
  61858. return nil, err
  61859. }
  61860. ret := &NetworkEndpointGroup{
  61861. ServerResponse: googleapi.ServerResponse{
  61862. Header: res.Header,
  61863. HTTPStatusCode: res.StatusCode,
  61864. },
  61865. }
  61866. target := &ret
  61867. if err := gensupport.DecodeResponse(target, res); err != nil {
  61868. return nil, err
  61869. }
  61870. return ret, nil
  61871. // {
  61872. // "description": "Returns the specified network endpoint group. Gets a list of available network endpoint groups by making a list() request.",
  61873. // "httpMethod": "GET",
  61874. // "id": "compute.networkEndpointGroups.get",
  61875. // "parameterOrder": [
  61876. // "project",
  61877. // "zone",
  61878. // "networkEndpointGroup"
  61879. // ],
  61880. // "parameters": {
  61881. // "networkEndpointGroup": {
  61882. // "description": "The name of the network endpoint group. It should comply with RFC1035.",
  61883. // "location": "path",
  61884. // "required": true,
  61885. // "type": "string"
  61886. // },
  61887. // "project": {
  61888. // "description": "Project ID for this request.",
  61889. // "location": "path",
  61890. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  61891. // "required": true,
  61892. // "type": "string"
  61893. // },
  61894. // "zone": {
  61895. // "description": "The name of the zone where the network endpoint group is located. It should comply with RFC1035.",
  61896. // "location": "path",
  61897. // "required": true,
  61898. // "type": "string"
  61899. // }
  61900. // },
  61901. // "path": "{project}/zones/{zone}/networkEndpointGroups/{networkEndpointGroup}",
  61902. // "response": {
  61903. // "$ref": "NetworkEndpointGroup"
  61904. // },
  61905. // "scopes": [
  61906. // "https://www.googleapis.com/auth/cloud-platform",
  61907. // "https://www.googleapis.com/auth/compute",
  61908. // "https://www.googleapis.com/auth/compute.readonly"
  61909. // ]
  61910. // }
  61911. }
  61912. // method id "compute.networkEndpointGroups.insert":
  61913. type NetworkEndpointGroupsInsertCall struct {
  61914. s *Service
  61915. project string
  61916. zone string
  61917. networkendpointgroup *NetworkEndpointGroup
  61918. urlParams_ gensupport.URLParams
  61919. ctx_ context.Context
  61920. header_ http.Header
  61921. }
  61922. // Insert: Creates a network endpoint group in the specified project
  61923. // using the parameters that are included in the request.
  61924. func (r *NetworkEndpointGroupsService) Insert(project string, zone string, networkendpointgroup *NetworkEndpointGroup) *NetworkEndpointGroupsInsertCall {
  61925. c := &NetworkEndpointGroupsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  61926. c.project = project
  61927. c.zone = zone
  61928. c.networkendpointgroup = networkendpointgroup
  61929. return c
  61930. }
  61931. // RequestId sets the optional parameter "requestId": An optional
  61932. // request ID to identify requests. Specify a unique request ID so that
  61933. // if you must retry your request, the server will know to ignore the
  61934. // request if it has already been completed.
  61935. //
  61936. // For example, consider a situation where you make an initial request
  61937. // and the request times out. If you make the request again with the
  61938. // same request ID, the server can check if original operation with the
  61939. // same request ID was received, and if so, will ignore the second
  61940. // request. This prevents clients from accidentally creating duplicate
  61941. // commitments.
  61942. //
  61943. // The request ID must be a valid UUID with the exception that zero UUID
  61944. // is not supported (00000000-0000-0000-0000-000000000000).
  61945. func (c *NetworkEndpointGroupsInsertCall) RequestId(requestId string) *NetworkEndpointGroupsInsertCall {
  61946. c.urlParams_.Set("requestId", requestId)
  61947. return c
  61948. }
  61949. // Fields allows partial responses to be retrieved. See
  61950. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  61951. // for more information.
  61952. func (c *NetworkEndpointGroupsInsertCall) Fields(s ...googleapi.Field) *NetworkEndpointGroupsInsertCall {
  61953. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  61954. return c
  61955. }
  61956. // Context sets the context to be used in this call's Do method. Any
  61957. // pending HTTP request will be aborted if the provided context is
  61958. // canceled.
  61959. func (c *NetworkEndpointGroupsInsertCall) Context(ctx context.Context) *NetworkEndpointGroupsInsertCall {
  61960. c.ctx_ = ctx
  61961. return c
  61962. }
  61963. // Header returns an http.Header that can be modified by the caller to
  61964. // add HTTP headers to the request.
  61965. func (c *NetworkEndpointGroupsInsertCall) Header() http.Header {
  61966. if c.header_ == nil {
  61967. c.header_ = make(http.Header)
  61968. }
  61969. return c.header_
  61970. }
  61971. func (c *NetworkEndpointGroupsInsertCall) doRequest(alt string) (*http.Response, error) {
  61972. reqHeaders := make(http.Header)
  61973. for k, v := range c.header_ {
  61974. reqHeaders[k] = v
  61975. }
  61976. reqHeaders.Set("User-Agent", c.s.userAgent())
  61977. var body io.Reader = nil
  61978. body, err := googleapi.WithoutDataWrapper.JSONReader(c.networkendpointgroup)
  61979. if err != nil {
  61980. return nil, err
  61981. }
  61982. reqHeaders.Set("Content-Type", "application/json")
  61983. c.urlParams_.Set("alt", alt)
  61984. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/networkEndpointGroups")
  61985. urls += "?" + c.urlParams_.Encode()
  61986. req, _ := http.NewRequest("POST", urls, body)
  61987. req.Header = reqHeaders
  61988. googleapi.Expand(req.URL, map[string]string{
  61989. "project": c.project,
  61990. "zone": c.zone,
  61991. })
  61992. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  61993. }
  61994. // Do executes the "compute.networkEndpointGroups.insert" call.
  61995. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  61996. // status code is an error. Response headers are in either
  61997. // *Operation.ServerResponse.Header or (if a response was returned at
  61998. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  61999. // to check whether the returned error was because
  62000. // http.StatusNotModified was returned.
  62001. func (c *NetworkEndpointGroupsInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  62002. gensupport.SetOptions(c.urlParams_, opts...)
  62003. res, err := c.doRequest("json")
  62004. if res != nil && res.StatusCode == http.StatusNotModified {
  62005. if res.Body != nil {
  62006. res.Body.Close()
  62007. }
  62008. return nil, &googleapi.Error{
  62009. Code: res.StatusCode,
  62010. Header: res.Header,
  62011. }
  62012. }
  62013. if err != nil {
  62014. return nil, err
  62015. }
  62016. defer googleapi.CloseBody(res)
  62017. if err := googleapi.CheckResponse(res); err != nil {
  62018. return nil, err
  62019. }
  62020. ret := &Operation{
  62021. ServerResponse: googleapi.ServerResponse{
  62022. Header: res.Header,
  62023. HTTPStatusCode: res.StatusCode,
  62024. },
  62025. }
  62026. target := &ret
  62027. if err := gensupport.DecodeResponse(target, res); err != nil {
  62028. return nil, err
  62029. }
  62030. return ret, nil
  62031. // {
  62032. // "description": "Creates a network endpoint group in the specified project using the parameters that are included in the request.",
  62033. // "httpMethod": "POST",
  62034. // "id": "compute.networkEndpointGroups.insert",
  62035. // "parameterOrder": [
  62036. // "project",
  62037. // "zone"
  62038. // ],
  62039. // "parameters": {
  62040. // "project": {
  62041. // "description": "Project ID for this request.",
  62042. // "location": "path",
  62043. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  62044. // "required": true,
  62045. // "type": "string"
  62046. // },
  62047. // "requestId": {
  62048. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  62049. // "location": "query",
  62050. // "type": "string"
  62051. // },
  62052. // "zone": {
  62053. // "description": "The name of the zone where you want to create the network endpoint group. It should comply with RFC1035.",
  62054. // "location": "path",
  62055. // "required": true,
  62056. // "type": "string"
  62057. // }
  62058. // },
  62059. // "path": "{project}/zones/{zone}/networkEndpointGroups",
  62060. // "request": {
  62061. // "$ref": "NetworkEndpointGroup"
  62062. // },
  62063. // "response": {
  62064. // "$ref": "Operation"
  62065. // },
  62066. // "scopes": [
  62067. // "https://www.googleapis.com/auth/cloud-platform",
  62068. // "https://www.googleapis.com/auth/compute"
  62069. // ]
  62070. // }
  62071. }
  62072. // method id "compute.networkEndpointGroups.list":
  62073. type NetworkEndpointGroupsListCall struct {
  62074. s *Service
  62075. project string
  62076. zone string
  62077. urlParams_ gensupport.URLParams
  62078. ifNoneMatch_ string
  62079. ctx_ context.Context
  62080. header_ http.Header
  62081. }
  62082. // List: Retrieves the list of network endpoint groups that are located
  62083. // in the specified project and zone.
  62084. func (r *NetworkEndpointGroupsService) List(project string, zone string) *NetworkEndpointGroupsListCall {
  62085. c := &NetworkEndpointGroupsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  62086. c.project = project
  62087. c.zone = zone
  62088. return c
  62089. }
  62090. // Filter sets the optional parameter "filter": A filter expression that
  62091. // filters resources listed in the response. The expression must specify
  62092. // the field name, a comparison operator, and the value that you want to
  62093. // use for filtering. The value must be a string, a number, or a
  62094. // boolean. The comparison operator must be either =, !=, >, or <.
  62095. //
  62096. // For example, if you are filtering Compute Engine instances, you can
  62097. // exclude instances named example-instance by specifying name !=
  62098. // example-instance.
  62099. //
  62100. // You can also filter nested fields. For example, you could specify
  62101. // scheduling.automaticRestart = false to include instances only if they
  62102. // are not scheduled for automatic restarts. You can use filtering on
  62103. // nested fields to filter based on resource labels.
  62104. //
  62105. // To filter on multiple expressions, provide each separate expression
  62106. // within parentheses. For example, (scheduling.automaticRestart = true)
  62107. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  62108. // AND expression. However, you can include AND and OR expressions
  62109. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  62110. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  62111. // true).
  62112. func (c *NetworkEndpointGroupsListCall) Filter(filter string) *NetworkEndpointGroupsListCall {
  62113. c.urlParams_.Set("filter", filter)
  62114. return c
  62115. }
  62116. // MaxResults sets the optional parameter "maxResults": The maximum
  62117. // number of results per page that should be returned. If the number of
  62118. // available results is larger than maxResults, Compute Engine returns a
  62119. // nextPageToken that can be used to get the next page of results in
  62120. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  62121. // (Default: 500)
  62122. func (c *NetworkEndpointGroupsListCall) MaxResults(maxResults int64) *NetworkEndpointGroupsListCall {
  62123. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  62124. return c
  62125. }
  62126. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  62127. // a certain order. By default, results are returned in alphanumerical
  62128. // order based on the resource name.
  62129. //
  62130. // You can also sort results in descending order based on the creation
  62131. // timestamp using orderBy="creationTimestamp desc". This sorts results
  62132. // based on the creationTimestamp field in reverse chronological order
  62133. // (newest result first). Use this to sort resources like operations so
  62134. // that the newest operation is returned first.
  62135. //
  62136. // Currently, only sorting by name or creationTimestamp desc is
  62137. // supported.
  62138. func (c *NetworkEndpointGroupsListCall) OrderBy(orderBy string) *NetworkEndpointGroupsListCall {
  62139. c.urlParams_.Set("orderBy", orderBy)
  62140. return c
  62141. }
  62142. // PageToken sets the optional parameter "pageToken": Specifies a page
  62143. // token to use. Set pageToken to the nextPageToken returned by a
  62144. // previous list request to get the next page of results.
  62145. func (c *NetworkEndpointGroupsListCall) PageToken(pageToken string) *NetworkEndpointGroupsListCall {
  62146. c.urlParams_.Set("pageToken", pageToken)
  62147. return c
  62148. }
  62149. // Fields allows partial responses to be retrieved. See
  62150. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  62151. // for more information.
  62152. func (c *NetworkEndpointGroupsListCall) Fields(s ...googleapi.Field) *NetworkEndpointGroupsListCall {
  62153. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  62154. return c
  62155. }
  62156. // IfNoneMatch sets the optional parameter which makes the operation
  62157. // fail if the object's ETag matches the given value. This is useful for
  62158. // getting updates only after the object has changed since the last
  62159. // request. Use googleapi.IsNotModified to check whether the response
  62160. // error from Do is the result of In-None-Match.
  62161. func (c *NetworkEndpointGroupsListCall) IfNoneMatch(entityTag string) *NetworkEndpointGroupsListCall {
  62162. c.ifNoneMatch_ = entityTag
  62163. return c
  62164. }
  62165. // Context sets the context to be used in this call's Do method. Any
  62166. // pending HTTP request will be aborted if the provided context is
  62167. // canceled.
  62168. func (c *NetworkEndpointGroupsListCall) Context(ctx context.Context) *NetworkEndpointGroupsListCall {
  62169. c.ctx_ = ctx
  62170. return c
  62171. }
  62172. // Header returns an http.Header that can be modified by the caller to
  62173. // add HTTP headers to the request.
  62174. func (c *NetworkEndpointGroupsListCall) Header() http.Header {
  62175. if c.header_ == nil {
  62176. c.header_ = make(http.Header)
  62177. }
  62178. return c.header_
  62179. }
  62180. func (c *NetworkEndpointGroupsListCall) doRequest(alt string) (*http.Response, error) {
  62181. reqHeaders := make(http.Header)
  62182. for k, v := range c.header_ {
  62183. reqHeaders[k] = v
  62184. }
  62185. reqHeaders.Set("User-Agent", c.s.userAgent())
  62186. if c.ifNoneMatch_ != "" {
  62187. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  62188. }
  62189. var body io.Reader = nil
  62190. c.urlParams_.Set("alt", alt)
  62191. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/networkEndpointGroups")
  62192. urls += "?" + c.urlParams_.Encode()
  62193. req, _ := http.NewRequest("GET", urls, body)
  62194. req.Header = reqHeaders
  62195. googleapi.Expand(req.URL, map[string]string{
  62196. "project": c.project,
  62197. "zone": c.zone,
  62198. })
  62199. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  62200. }
  62201. // Do executes the "compute.networkEndpointGroups.list" call.
  62202. // Exactly one of *NetworkEndpointGroupList or error will be non-nil.
  62203. // Any non-2xx status code is an error. Response headers are in either
  62204. // *NetworkEndpointGroupList.ServerResponse.Header or (if a response was
  62205. // returned at all) in error.(*googleapi.Error).Header. Use
  62206. // googleapi.IsNotModified to check whether the returned error was
  62207. // because http.StatusNotModified was returned.
  62208. func (c *NetworkEndpointGroupsListCall) Do(opts ...googleapi.CallOption) (*NetworkEndpointGroupList, error) {
  62209. gensupport.SetOptions(c.urlParams_, opts...)
  62210. res, err := c.doRequest("json")
  62211. if res != nil && res.StatusCode == http.StatusNotModified {
  62212. if res.Body != nil {
  62213. res.Body.Close()
  62214. }
  62215. return nil, &googleapi.Error{
  62216. Code: res.StatusCode,
  62217. Header: res.Header,
  62218. }
  62219. }
  62220. if err != nil {
  62221. return nil, err
  62222. }
  62223. defer googleapi.CloseBody(res)
  62224. if err := googleapi.CheckResponse(res); err != nil {
  62225. return nil, err
  62226. }
  62227. ret := &NetworkEndpointGroupList{
  62228. ServerResponse: googleapi.ServerResponse{
  62229. Header: res.Header,
  62230. HTTPStatusCode: res.StatusCode,
  62231. },
  62232. }
  62233. target := &ret
  62234. if err := gensupport.DecodeResponse(target, res); err != nil {
  62235. return nil, err
  62236. }
  62237. return ret, nil
  62238. // {
  62239. // "description": "Retrieves the list of network endpoint groups that are located in the specified project and zone.",
  62240. // "httpMethod": "GET",
  62241. // "id": "compute.networkEndpointGroups.list",
  62242. // "parameterOrder": [
  62243. // "project",
  62244. // "zone"
  62245. // ],
  62246. // "parameters": {
  62247. // "filter": {
  62248. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  62249. // "location": "query",
  62250. // "type": "string"
  62251. // },
  62252. // "maxResults": {
  62253. // "default": "500",
  62254. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  62255. // "format": "uint32",
  62256. // "location": "query",
  62257. // "minimum": "0",
  62258. // "type": "integer"
  62259. // },
  62260. // "orderBy": {
  62261. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  62262. // "location": "query",
  62263. // "type": "string"
  62264. // },
  62265. // "pageToken": {
  62266. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  62267. // "location": "query",
  62268. // "type": "string"
  62269. // },
  62270. // "project": {
  62271. // "description": "Project ID for this request.",
  62272. // "location": "path",
  62273. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  62274. // "required": true,
  62275. // "type": "string"
  62276. // },
  62277. // "zone": {
  62278. // "description": "The name of the zone where the network endpoint group is located. It should comply with RFC1035.",
  62279. // "location": "path",
  62280. // "required": true,
  62281. // "type": "string"
  62282. // }
  62283. // },
  62284. // "path": "{project}/zones/{zone}/networkEndpointGroups",
  62285. // "response": {
  62286. // "$ref": "NetworkEndpointGroupList"
  62287. // },
  62288. // "scopes": [
  62289. // "https://www.googleapis.com/auth/cloud-platform",
  62290. // "https://www.googleapis.com/auth/compute",
  62291. // "https://www.googleapis.com/auth/compute.readonly"
  62292. // ]
  62293. // }
  62294. }
  62295. // Pages invokes f for each page of results.
  62296. // A non-nil error returned from f will halt the iteration.
  62297. // The provided context supersedes any context provided to the Context method.
  62298. func (c *NetworkEndpointGroupsListCall) Pages(ctx context.Context, f func(*NetworkEndpointGroupList) error) error {
  62299. c.ctx_ = ctx
  62300. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  62301. for {
  62302. x, err := c.Do()
  62303. if err != nil {
  62304. return err
  62305. }
  62306. if err := f(x); err != nil {
  62307. return err
  62308. }
  62309. if x.NextPageToken == "" {
  62310. return nil
  62311. }
  62312. c.PageToken(x.NextPageToken)
  62313. }
  62314. }
  62315. // method id "compute.networkEndpointGroups.listNetworkEndpoints":
  62316. type NetworkEndpointGroupsListNetworkEndpointsCall struct {
  62317. s *Service
  62318. project string
  62319. zone string
  62320. networkEndpointGroup string
  62321. networkendpointgroupslistendpointsrequest *NetworkEndpointGroupsListEndpointsRequest
  62322. urlParams_ gensupport.URLParams
  62323. ctx_ context.Context
  62324. header_ http.Header
  62325. }
  62326. // ListNetworkEndpoints: Lists the network endpoints in the specified
  62327. // network endpoint group.
  62328. func (r *NetworkEndpointGroupsService) ListNetworkEndpoints(project string, zone string, networkEndpointGroup string, networkendpointgroupslistendpointsrequest *NetworkEndpointGroupsListEndpointsRequest) *NetworkEndpointGroupsListNetworkEndpointsCall {
  62329. c := &NetworkEndpointGroupsListNetworkEndpointsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  62330. c.project = project
  62331. c.zone = zone
  62332. c.networkEndpointGroup = networkEndpointGroup
  62333. c.networkendpointgroupslistendpointsrequest = networkendpointgroupslistendpointsrequest
  62334. return c
  62335. }
  62336. // Filter sets the optional parameter "filter": A filter expression that
  62337. // filters resources listed in the response. The expression must specify
  62338. // the field name, a comparison operator, and the value that you want to
  62339. // use for filtering. The value must be a string, a number, or a
  62340. // boolean. The comparison operator must be either =, !=, >, or <.
  62341. //
  62342. // For example, if you are filtering Compute Engine instances, you can
  62343. // exclude instances named example-instance by specifying name !=
  62344. // example-instance.
  62345. //
  62346. // You can also filter nested fields. For example, you could specify
  62347. // scheduling.automaticRestart = false to include instances only if they
  62348. // are not scheduled for automatic restarts. You can use filtering on
  62349. // nested fields to filter based on resource labels.
  62350. //
  62351. // To filter on multiple expressions, provide each separate expression
  62352. // within parentheses. For example, (scheduling.automaticRestart = true)
  62353. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  62354. // AND expression. However, you can include AND and OR expressions
  62355. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  62356. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  62357. // true).
  62358. func (c *NetworkEndpointGroupsListNetworkEndpointsCall) Filter(filter string) *NetworkEndpointGroupsListNetworkEndpointsCall {
  62359. c.urlParams_.Set("filter", filter)
  62360. return c
  62361. }
  62362. // MaxResults sets the optional parameter "maxResults": The maximum
  62363. // number of results per page that should be returned. If the number of
  62364. // available results is larger than maxResults, Compute Engine returns a
  62365. // nextPageToken that can be used to get the next page of results in
  62366. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  62367. // (Default: 500)
  62368. func (c *NetworkEndpointGroupsListNetworkEndpointsCall) MaxResults(maxResults int64) *NetworkEndpointGroupsListNetworkEndpointsCall {
  62369. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  62370. return c
  62371. }
  62372. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  62373. // a certain order. By default, results are returned in alphanumerical
  62374. // order based on the resource name.
  62375. //
  62376. // You can also sort results in descending order based on the creation
  62377. // timestamp using orderBy="creationTimestamp desc". This sorts results
  62378. // based on the creationTimestamp field in reverse chronological order
  62379. // (newest result first). Use this to sort resources like operations so
  62380. // that the newest operation is returned first.
  62381. //
  62382. // Currently, only sorting by name or creationTimestamp desc is
  62383. // supported.
  62384. func (c *NetworkEndpointGroupsListNetworkEndpointsCall) OrderBy(orderBy string) *NetworkEndpointGroupsListNetworkEndpointsCall {
  62385. c.urlParams_.Set("orderBy", orderBy)
  62386. return c
  62387. }
  62388. // PageToken sets the optional parameter "pageToken": Specifies a page
  62389. // token to use. Set pageToken to the nextPageToken returned by a
  62390. // previous list request to get the next page of results.
  62391. func (c *NetworkEndpointGroupsListNetworkEndpointsCall) PageToken(pageToken string) *NetworkEndpointGroupsListNetworkEndpointsCall {
  62392. c.urlParams_.Set("pageToken", pageToken)
  62393. return c
  62394. }
  62395. // Fields allows partial responses to be retrieved. See
  62396. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  62397. // for more information.
  62398. func (c *NetworkEndpointGroupsListNetworkEndpointsCall) Fields(s ...googleapi.Field) *NetworkEndpointGroupsListNetworkEndpointsCall {
  62399. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  62400. return c
  62401. }
  62402. // Context sets the context to be used in this call's Do method. Any
  62403. // pending HTTP request will be aborted if the provided context is
  62404. // canceled.
  62405. func (c *NetworkEndpointGroupsListNetworkEndpointsCall) Context(ctx context.Context) *NetworkEndpointGroupsListNetworkEndpointsCall {
  62406. c.ctx_ = ctx
  62407. return c
  62408. }
  62409. // Header returns an http.Header that can be modified by the caller to
  62410. // add HTTP headers to the request.
  62411. func (c *NetworkEndpointGroupsListNetworkEndpointsCall) Header() http.Header {
  62412. if c.header_ == nil {
  62413. c.header_ = make(http.Header)
  62414. }
  62415. return c.header_
  62416. }
  62417. func (c *NetworkEndpointGroupsListNetworkEndpointsCall) doRequest(alt string) (*http.Response, error) {
  62418. reqHeaders := make(http.Header)
  62419. for k, v := range c.header_ {
  62420. reqHeaders[k] = v
  62421. }
  62422. reqHeaders.Set("User-Agent", c.s.userAgent())
  62423. var body io.Reader = nil
  62424. body, err := googleapi.WithoutDataWrapper.JSONReader(c.networkendpointgroupslistendpointsrequest)
  62425. if err != nil {
  62426. return nil, err
  62427. }
  62428. reqHeaders.Set("Content-Type", "application/json")
  62429. c.urlParams_.Set("alt", alt)
  62430. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/networkEndpointGroups/{networkEndpointGroup}/listNetworkEndpoints")
  62431. urls += "?" + c.urlParams_.Encode()
  62432. req, _ := http.NewRequest("POST", urls, body)
  62433. req.Header = reqHeaders
  62434. googleapi.Expand(req.URL, map[string]string{
  62435. "project": c.project,
  62436. "zone": c.zone,
  62437. "networkEndpointGroup": c.networkEndpointGroup,
  62438. })
  62439. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  62440. }
  62441. // Do executes the "compute.networkEndpointGroups.listNetworkEndpoints" call.
  62442. // Exactly one of *NetworkEndpointGroupsListNetworkEndpoints or error
  62443. // will be non-nil. Any non-2xx status code is an error. Response
  62444. // headers are in either
  62445. // *NetworkEndpointGroupsListNetworkEndpoints.ServerResponse.Header or
  62446. // (if a response was returned at all) in
  62447. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  62448. // whether the returned error was because http.StatusNotModified was
  62449. // returned.
  62450. func (c *NetworkEndpointGroupsListNetworkEndpointsCall) Do(opts ...googleapi.CallOption) (*NetworkEndpointGroupsListNetworkEndpoints, error) {
  62451. gensupport.SetOptions(c.urlParams_, opts...)
  62452. res, err := c.doRequest("json")
  62453. if res != nil && res.StatusCode == http.StatusNotModified {
  62454. if res.Body != nil {
  62455. res.Body.Close()
  62456. }
  62457. return nil, &googleapi.Error{
  62458. Code: res.StatusCode,
  62459. Header: res.Header,
  62460. }
  62461. }
  62462. if err != nil {
  62463. return nil, err
  62464. }
  62465. defer googleapi.CloseBody(res)
  62466. if err := googleapi.CheckResponse(res); err != nil {
  62467. return nil, err
  62468. }
  62469. ret := &NetworkEndpointGroupsListNetworkEndpoints{
  62470. ServerResponse: googleapi.ServerResponse{
  62471. Header: res.Header,
  62472. HTTPStatusCode: res.StatusCode,
  62473. },
  62474. }
  62475. target := &ret
  62476. if err := gensupport.DecodeResponse(target, res); err != nil {
  62477. return nil, err
  62478. }
  62479. return ret, nil
  62480. // {
  62481. // "description": "Lists the network endpoints in the specified network endpoint group.",
  62482. // "httpMethod": "POST",
  62483. // "id": "compute.networkEndpointGroups.listNetworkEndpoints",
  62484. // "parameterOrder": [
  62485. // "project",
  62486. // "zone",
  62487. // "networkEndpointGroup"
  62488. // ],
  62489. // "parameters": {
  62490. // "filter": {
  62491. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  62492. // "location": "query",
  62493. // "type": "string"
  62494. // },
  62495. // "maxResults": {
  62496. // "default": "500",
  62497. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  62498. // "format": "uint32",
  62499. // "location": "query",
  62500. // "minimum": "0",
  62501. // "type": "integer"
  62502. // },
  62503. // "networkEndpointGroup": {
  62504. // "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.",
  62505. // "location": "path",
  62506. // "required": true,
  62507. // "type": "string"
  62508. // },
  62509. // "orderBy": {
  62510. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  62511. // "location": "query",
  62512. // "type": "string"
  62513. // },
  62514. // "pageToken": {
  62515. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  62516. // "location": "query",
  62517. // "type": "string"
  62518. // },
  62519. // "project": {
  62520. // "description": "Project ID for this request.",
  62521. // "location": "path",
  62522. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  62523. // "required": true,
  62524. // "type": "string"
  62525. // },
  62526. // "zone": {
  62527. // "description": "The name of the zone where the network endpoint group is located. It should comply with RFC1035.",
  62528. // "location": "path",
  62529. // "required": true,
  62530. // "type": "string"
  62531. // }
  62532. // },
  62533. // "path": "{project}/zones/{zone}/networkEndpointGroups/{networkEndpointGroup}/listNetworkEndpoints",
  62534. // "request": {
  62535. // "$ref": "NetworkEndpointGroupsListEndpointsRequest"
  62536. // },
  62537. // "response": {
  62538. // "$ref": "NetworkEndpointGroupsListNetworkEndpoints"
  62539. // },
  62540. // "scopes": [
  62541. // "https://www.googleapis.com/auth/cloud-platform",
  62542. // "https://www.googleapis.com/auth/compute",
  62543. // "https://www.googleapis.com/auth/compute.readonly"
  62544. // ]
  62545. // }
  62546. }
  62547. // Pages invokes f for each page of results.
  62548. // A non-nil error returned from f will halt the iteration.
  62549. // The provided context supersedes any context provided to the Context method.
  62550. func (c *NetworkEndpointGroupsListNetworkEndpointsCall) Pages(ctx context.Context, f func(*NetworkEndpointGroupsListNetworkEndpoints) error) error {
  62551. c.ctx_ = ctx
  62552. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  62553. for {
  62554. x, err := c.Do()
  62555. if err != nil {
  62556. return err
  62557. }
  62558. if err := f(x); err != nil {
  62559. return err
  62560. }
  62561. if x.NextPageToken == "" {
  62562. return nil
  62563. }
  62564. c.PageToken(x.NextPageToken)
  62565. }
  62566. }
  62567. // method id "compute.networkEndpointGroups.testIamPermissions":
  62568. type NetworkEndpointGroupsTestIamPermissionsCall struct {
  62569. s *Service
  62570. project string
  62571. zone string
  62572. resource string
  62573. testpermissionsrequest *TestPermissionsRequest
  62574. urlParams_ gensupport.URLParams
  62575. ctx_ context.Context
  62576. header_ http.Header
  62577. }
  62578. // TestIamPermissions: Returns permissions that a caller has on the
  62579. // specified resource.
  62580. func (r *NetworkEndpointGroupsService) TestIamPermissions(project string, zone string, resource string, testpermissionsrequest *TestPermissionsRequest) *NetworkEndpointGroupsTestIamPermissionsCall {
  62581. c := &NetworkEndpointGroupsTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  62582. c.project = project
  62583. c.zone = zone
  62584. c.resource = resource
  62585. c.testpermissionsrequest = testpermissionsrequest
  62586. return c
  62587. }
  62588. // Fields allows partial responses to be retrieved. See
  62589. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  62590. // for more information.
  62591. func (c *NetworkEndpointGroupsTestIamPermissionsCall) Fields(s ...googleapi.Field) *NetworkEndpointGroupsTestIamPermissionsCall {
  62592. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  62593. return c
  62594. }
  62595. // Context sets the context to be used in this call's Do method. Any
  62596. // pending HTTP request will be aborted if the provided context is
  62597. // canceled.
  62598. func (c *NetworkEndpointGroupsTestIamPermissionsCall) Context(ctx context.Context) *NetworkEndpointGroupsTestIamPermissionsCall {
  62599. c.ctx_ = ctx
  62600. return c
  62601. }
  62602. // Header returns an http.Header that can be modified by the caller to
  62603. // add HTTP headers to the request.
  62604. func (c *NetworkEndpointGroupsTestIamPermissionsCall) Header() http.Header {
  62605. if c.header_ == nil {
  62606. c.header_ = make(http.Header)
  62607. }
  62608. return c.header_
  62609. }
  62610. func (c *NetworkEndpointGroupsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  62611. reqHeaders := make(http.Header)
  62612. for k, v := range c.header_ {
  62613. reqHeaders[k] = v
  62614. }
  62615. reqHeaders.Set("User-Agent", c.s.userAgent())
  62616. var body io.Reader = nil
  62617. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  62618. if err != nil {
  62619. return nil, err
  62620. }
  62621. reqHeaders.Set("Content-Type", "application/json")
  62622. c.urlParams_.Set("alt", alt)
  62623. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/networkEndpointGroups/{resource}/testIamPermissions")
  62624. urls += "?" + c.urlParams_.Encode()
  62625. req, _ := http.NewRequest("POST", urls, body)
  62626. req.Header = reqHeaders
  62627. googleapi.Expand(req.URL, map[string]string{
  62628. "project": c.project,
  62629. "zone": c.zone,
  62630. "resource": c.resource,
  62631. })
  62632. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  62633. }
  62634. // Do executes the "compute.networkEndpointGroups.testIamPermissions" call.
  62635. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  62636. // non-2xx status code is an error. Response headers are in either
  62637. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  62638. // returned at all) in error.(*googleapi.Error).Header. Use
  62639. // googleapi.IsNotModified to check whether the returned error was
  62640. // because http.StatusNotModified was returned.
  62641. func (c *NetworkEndpointGroupsTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  62642. gensupport.SetOptions(c.urlParams_, opts...)
  62643. res, err := c.doRequest("json")
  62644. if res != nil && res.StatusCode == http.StatusNotModified {
  62645. if res.Body != nil {
  62646. res.Body.Close()
  62647. }
  62648. return nil, &googleapi.Error{
  62649. Code: res.StatusCode,
  62650. Header: res.Header,
  62651. }
  62652. }
  62653. if err != nil {
  62654. return nil, err
  62655. }
  62656. defer googleapi.CloseBody(res)
  62657. if err := googleapi.CheckResponse(res); err != nil {
  62658. return nil, err
  62659. }
  62660. ret := &TestPermissionsResponse{
  62661. ServerResponse: googleapi.ServerResponse{
  62662. Header: res.Header,
  62663. HTTPStatusCode: res.StatusCode,
  62664. },
  62665. }
  62666. target := &ret
  62667. if err := gensupport.DecodeResponse(target, res); err != nil {
  62668. return nil, err
  62669. }
  62670. return ret, nil
  62671. // {
  62672. // "description": "Returns permissions that a caller has on the specified resource.",
  62673. // "httpMethod": "POST",
  62674. // "id": "compute.networkEndpointGroups.testIamPermissions",
  62675. // "parameterOrder": [
  62676. // "project",
  62677. // "zone",
  62678. // "resource"
  62679. // ],
  62680. // "parameters": {
  62681. // "project": {
  62682. // "description": "Project ID for this request.",
  62683. // "location": "path",
  62684. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  62685. // "required": true,
  62686. // "type": "string"
  62687. // },
  62688. // "resource": {
  62689. // "description": "Name of the resource for this request.",
  62690. // "location": "path",
  62691. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  62692. // "required": true,
  62693. // "type": "string"
  62694. // },
  62695. // "zone": {
  62696. // "description": "The name of the zone for this request.",
  62697. // "location": "path",
  62698. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  62699. // "required": true,
  62700. // "type": "string"
  62701. // }
  62702. // },
  62703. // "path": "{project}/zones/{zone}/networkEndpointGroups/{resource}/testIamPermissions",
  62704. // "request": {
  62705. // "$ref": "TestPermissionsRequest"
  62706. // },
  62707. // "response": {
  62708. // "$ref": "TestPermissionsResponse"
  62709. // },
  62710. // "scopes": [
  62711. // "https://www.googleapis.com/auth/cloud-platform",
  62712. // "https://www.googleapis.com/auth/compute",
  62713. // "https://www.googleapis.com/auth/compute.readonly"
  62714. // ]
  62715. // }
  62716. }
  62717. // method id "compute.networks.addPeering":
  62718. type NetworksAddPeeringCall struct {
  62719. s *Service
  62720. project string
  62721. network string
  62722. networksaddpeeringrequest *NetworksAddPeeringRequest
  62723. urlParams_ gensupport.URLParams
  62724. ctx_ context.Context
  62725. header_ http.Header
  62726. }
  62727. // AddPeering: Adds a peering to the specified network.
  62728. func (r *NetworksService) AddPeering(project string, network string, networksaddpeeringrequest *NetworksAddPeeringRequest) *NetworksAddPeeringCall {
  62729. c := &NetworksAddPeeringCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  62730. c.project = project
  62731. c.network = network
  62732. c.networksaddpeeringrequest = networksaddpeeringrequest
  62733. return c
  62734. }
  62735. // RequestId sets the optional parameter "requestId": An optional
  62736. // request ID to identify requests. Specify a unique request ID so that
  62737. // if you must retry your request, the server will know to ignore the
  62738. // request if it has already been completed.
  62739. //
  62740. // For example, consider a situation where you make an initial request
  62741. // and the request times out. If you make the request again with the
  62742. // same request ID, the server can check if original operation with the
  62743. // same request ID was received, and if so, will ignore the second
  62744. // request. This prevents clients from accidentally creating duplicate
  62745. // commitments.
  62746. //
  62747. // The request ID must be a valid UUID with the exception that zero UUID
  62748. // is not supported (00000000-0000-0000-0000-000000000000).
  62749. func (c *NetworksAddPeeringCall) RequestId(requestId string) *NetworksAddPeeringCall {
  62750. c.urlParams_.Set("requestId", requestId)
  62751. return c
  62752. }
  62753. // Fields allows partial responses to be retrieved. See
  62754. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  62755. // for more information.
  62756. func (c *NetworksAddPeeringCall) Fields(s ...googleapi.Field) *NetworksAddPeeringCall {
  62757. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  62758. return c
  62759. }
  62760. // Context sets the context to be used in this call's Do method. Any
  62761. // pending HTTP request will be aborted if the provided context is
  62762. // canceled.
  62763. func (c *NetworksAddPeeringCall) Context(ctx context.Context) *NetworksAddPeeringCall {
  62764. c.ctx_ = ctx
  62765. return c
  62766. }
  62767. // Header returns an http.Header that can be modified by the caller to
  62768. // add HTTP headers to the request.
  62769. func (c *NetworksAddPeeringCall) Header() http.Header {
  62770. if c.header_ == nil {
  62771. c.header_ = make(http.Header)
  62772. }
  62773. return c.header_
  62774. }
  62775. func (c *NetworksAddPeeringCall) doRequest(alt string) (*http.Response, error) {
  62776. reqHeaders := make(http.Header)
  62777. for k, v := range c.header_ {
  62778. reqHeaders[k] = v
  62779. }
  62780. reqHeaders.Set("User-Agent", c.s.userAgent())
  62781. var body io.Reader = nil
  62782. body, err := googleapi.WithoutDataWrapper.JSONReader(c.networksaddpeeringrequest)
  62783. if err != nil {
  62784. return nil, err
  62785. }
  62786. reqHeaders.Set("Content-Type", "application/json")
  62787. c.urlParams_.Set("alt", alt)
  62788. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/networks/{network}/addPeering")
  62789. urls += "?" + c.urlParams_.Encode()
  62790. req, _ := http.NewRequest("POST", urls, body)
  62791. req.Header = reqHeaders
  62792. googleapi.Expand(req.URL, map[string]string{
  62793. "project": c.project,
  62794. "network": c.network,
  62795. })
  62796. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  62797. }
  62798. // Do executes the "compute.networks.addPeering" call.
  62799. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  62800. // status code is an error. Response headers are in either
  62801. // *Operation.ServerResponse.Header or (if a response was returned at
  62802. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  62803. // to check whether the returned error was because
  62804. // http.StatusNotModified was returned.
  62805. func (c *NetworksAddPeeringCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  62806. gensupport.SetOptions(c.urlParams_, opts...)
  62807. res, err := c.doRequest("json")
  62808. if res != nil && res.StatusCode == http.StatusNotModified {
  62809. if res.Body != nil {
  62810. res.Body.Close()
  62811. }
  62812. return nil, &googleapi.Error{
  62813. Code: res.StatusCode,
  62814. Header: res.Header,
  62815. }
  62816. }
  62817. if err != nil {
  62818. return nil, err
  62819. }
  62820. defer googleapi.CloseBody(res)
  62821. if err := googleapi.CheckResponse(res); err != nil {
  62822. return nil, err
  62823. }
  62824. ret := &Operation{
  62825. ServerResponse: googleapi.ServerResponse{
  62826. Header: res.Header,
  62827. HTTPStatusCode: res.StatusCode,
  62828. },
  62829. }
  62830. target := &ret
  62831. if err := gensupport.DecodeResponse(target, res); err != nil {
  62832. return nil, err
  62833. }
  62834. return ret, nil
  62835. // {
  62836. // "description": "Adds a peering to the specified network.",
  62837. // "httpMethod": "POST",
  62838. // "id": "compute.networks.addPeering",
  62839. // "parameterOrder": [
  62840. // "project",
  62841. // "network"
  62842. // ],
  62843. // "parameters": {
  62844. // "network": {
  62845. // "description": "Name of the network resource to add peering to.",
  62846. // "location": "path",
  62847. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  62848. // "required": true,
  62849. // "type": "string"
  62850. // },
  62851. // "project": {
  62852. // "description": "Project ID for this request.",
  62853. // "location": "path",
  62854. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  62855. // "required": true,
  62856. // "type": "string"
  62857. // },
  62858. // "requestId": {
  62859. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  62860. // "location": "query",
  62861. // "type": "string"
  62862. // }
  62863. // },
  62864. // "path": "{project}/global/networks/{network}/addPeering",
  62865. // "request": {
  62866. // "$ref": "NetworksAddPeeringRequest"
  62867. // },
  62868. // "response": {
  62869. // "$ref": "Operation"
  62870. // },
  62871. // "scopes": [
  62872. // "https://www.googleapis.com/auth/cloud-platform",
  62873. // "https://www.googleapis.com/auth/compute"
  62874. // ]
  62875. // }
  62876. }
  62877. // method id "compute.networks.delete":
  62878. type NetworksDeleteCall struct {
  62879. s *Service
  62880. project string
  62881. network string
  62882. urlParams_ gensupport.URLParams
  62883. ctx_ context.Context
  62884. header_ http.Header
  62885. }
  62886. // Delete: Deletes the specified network.
  62887. // For details, see https://cloud.google.com/compute/docs/reference/latest/networks/delete
  62888. func (r *NetworksService) Delete(project string, network string) *NetworksDeleteCall {
  62889. c := &NetworksDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  62890. c.project = project
  62891. c.network = network
  62892. return c
  62893. }
  62894. // RequestId sets the optional parameter "requestId": An optional
  62895. // request ID to identify requests. Specify a unique request ID so that
  62896. // if you must retry your request, the server will know to ignore the
  62897. // request if it has already been completed.
  62898. //
  62899. // For example, consider a situation where you make an initial request
  62900. // and the request times out. If you make the request again with the
  62901. // same request ID, the server can check if original operation with the
  62902. // same request ID was received, and if so, will ignore the second
  62903. // request. This prevents clients from accidentally creating duplicate
  62904. // commitments.
  62905. //
  62906. // The request ID must be a valid UUID with the exception that zero UUID
  62907. // is not supported (00000000-0000-0000-0000-000000000000).
  62908. func (c *NetworksDeleteCall) RequestId(requestId string) *NetworksDeleteCall {
  62909. c.urlParams_.Set("requestId", requestId)
  62910. return c
  62911. }
  62912. // Fields allows partial responses to be retrieved. See
  62913. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  62914. // for more information.
  62915. func (c *NetworksDeleteCall) Fields(s ...googleapi.Field) *NetworksDeleteCall {
  62916. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  62917. return c
  62918. }
  62919. // Context sets the context to be used in this call's Do method. Any
  62920. // pending HTTP request will be aborted if the provided context is
  62921. // canceled.
  62922. func (c *NetworksDeleteCall) Context(ctx context.Context) *NetworksDeleteCall {
  62923. c.ctx_ = ctx
  62924. return c
  62925. }
  62926. // Header returns an http.Header that can be modified by the caller to
  62927. // add HTTP headers to the request.
  62928. func (c *NetworksDeleteCall) Header() http.Header {
  62929. if c.header_ == nil {
  62930. c.header_ = make(http.Header)
  62931. }
  62932. return c.header_
  62933. }
  62934. func (c *NetworksDeleteCall) doRequest(alt string) (*http.Response, error) {
  62935. reqHeaders := make(http.Header)
  62936. for k, v := range c.header_ {
  62937. reqHeaders[k] = v
  62938. }
  62939. reqHeaders.Set("User-Agent", c.s.userAgent())
  62940. var body io.Reader = nil
  62941. c.urlParams_.Set("alt", alt)
  62942. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/networks/{network}")
  62943. urls += "?" + c.urlParams_.Encode()
  62944. req, _ := http.NewRequest("DELETE", urls, body)
  62945. req.Header = reqHeaders
  62946. googleapi.Expand(req.URL, map[string]string{
  62947. "project": c.project,
  62948. "network": c.network,
  62949. })
  62950. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  62951. }
  62952. // Do executes the "compute.networks.delete" call.
  62953. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  62954. // status code is an error. Response headers are in either
  62955. // *Operation.ServerResponse.Header or (if a response was returned at
  62956. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  62957. // to check whether the returned error was because
  62958. // http.StatusNotModified was returned.
  62959. func (c *NetworksDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  62960. gensupport.SetOptions(c.urlParams_, opts...)
  62961. res, err := c.doRequest("json")
  62962. if res != nil && res.StatusCode == http.StatusNotModified {
  62963. if res.Body != nil {
  62964. res.Body.Close()
  62965. }
  62966. return nil, &googleapi.Error{
  62967. Code: res.StatusCode,
  62968. Header: res.Header,
  62969. }
  62970. }
  62971. if err != nil {
  62972. return nil, err
  62973. }
  62974. defer googleapi.CloseBody(res)
  62975. if err := googleapi.CheckResponse(res); err != nil {
  62976. return nil, err
  62977. }
  62978. ret := &Operation{
  62979. ServerResponse: googleapi.ServerResponse{
  62980. Header: res.Header,
  62981. HTTPStatusCode: res.StatusCode,
  62982. },
  62983. }
  62984. target := &ret
  62985. if err := gensupport.DecodeResponse(target, res); err != nil {
  62986. return nil, err
  62987. }
  62988. return ret, nil
  62989. // {
  62990. // "description": "Deletes the specified network.",
  62991. // "httpMethod": "DELETE",
  62992. // "id": "compute.networks.delete",
  62993. // "parameterOrder": [
  62994. // "project",
  62995. // "network"
  62996. // ],
  62997. // "parameters": {
  62998. // "network": {
  62999. // "description": "Name of the network to delete.",
  63000. // "location": "path",
  63001. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  63002. // "required": true,
  63003. // "type": "string"
  63004. // },
  63005. // "project": {
  63006. // "description": "Project ID for this request.",
  63007. // "location": "path",
  63008. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  63009. // "required": true,
  63010. // "type": "string"
  63011. // },
  63012. // "requestId": {
  63013. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  63014. // "location": "query",
  63015. // "type": "string"
  63016. // }
  63017. // },
  63018. // "path": "{project}/global/networks/{network}",
  63019. // "response": {
  63020. // "$ref": "Operation"
  63021. // },
  63022. // "scopes": [
  63023. // "https://www.googleapis.com/auth/cloud-platform",
  63024. // "https://www.googleapis.com/auth/compute"
  63025. // ]
  63026. // }
  63027. }
  63028. // method id "compute.networks.get":
  63029. type NetworksGetCall struct {
  63030. s *Service
  63031. project string
  63032. network string
  63033. urlParams_ gensupport.URLParams
  63034. ifNoneMatch_ string
  63035. ctx_ context.Context
  63036. header_ http.Header
  63037. }
  63038. // Get: Returns the specified network. Gets a list of available networks
  63039. // by making a list() request.
  63040. // For details, see https://cloud.google.com/compute/docs/reference/latest/networks/get
  63041. func (r *NetworksService) Get(project string, network string) *NetworksGetCall {
  63042. c := &NetworksGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  63043. c.project = project
  63044. c.network = network
  63045. return c
  63046. }
  63047. // Fields allows partial responses to be retrieved. See
  63048. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  63049. // for more information.
  63050. func (c *NetworksGetCall) Fields(s ...googleapi.Field) *NetworksGetCall {
  63051. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  63052. return c
  63053. }
  63054. // IfNoneMatch sets the optional parameter which makes the operation
  63055. // fail if the object's ETag matches the given value. This is useful for
  63056. // getting updates only after the object has changed since the last
  63057. // request. Use googleapi.IsNotModified to check whether the response
  63058. // error from Do is the result of In-None-Match.
  63059. func (c *NetworksGetCall) IfNoneMatch(entityTag string) *NetworksGetCall {
  63060. c.ifNoneMatch_ = entityTag
  63061. return c
  63062. }
  63063. // Context sets the context to be used in this call's Do method. Any
  63064. // pending HTTP request will be aborted if the provided context is
  63065. // canceled.
  63066. func (c *NetworksGetCall) Context(ctx context.Context) *NetworksGetCall {
  63067. c.ctx_ = ctx
  63068. return c
  63069. }
  63070. // Header returns an http.Header that can be modified by the caller to
  63071. // add HTTP headers to the request.
  63072. func (c *NetworksGetCall) Header() http.Header {
  63073. if c.header_ == nil {
  63074. c.header_ = make(http.Header)
  63075. }
  63076. return c.header_
  63077. }
  63078. func (c *NetworksGetCall) doRequest(alt string) (*http.Response, error) {
  63079. reqHeaders := make(http.Header)
  63080. for k, v := range c.header_ {
  63081. reqHeaders[k] = v
  63082. }
  63083. reqHeaders.Set("User-Agent", c.s.userAgent())
  63084. if c.ifNoneMatch_ != "" {
  63085. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  63086. }
  63087. var body io.Reader = nil
  63088. c.urlParams_.Set("alt", alt)
  63089. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/networks/{network}")
  63090. urls += "?" + c.urlParams_.Encode()
  63091. req, _ := http.NewRequest("GET", urls, body)
  63092. req.Header = reqHeaders
  63093. googleapi.Expand(req.URL, map[string]string{
  63094. "project": c.project,
  63095. "network": c.network,
  63096. })
  63097. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  63098. }
  63099. // Do executes the "compute.networks.get" call.
  63100. // Exactly one of *Network or error will be non-nil. Any non-2xx status
  63101. // code is an error. Response headers are in either
  63102. // *Network.ServerResponse.Header or (if a response was returned at all)
  63103. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  63104. // check whether the returned error was because http.StatusNotModified
  63105. // was returned.
  63106. func (c *NetworksGetCall) Do(opts ...googleapi.CallOption) (*Network, error) {
  63107. gensupport.SetOptions(c.urlParams_, opts...)
  63108. res, err := c.doRequest("json")
  63109. if res != nil && res.StatusCode == http.StatusNotModified {
  63110. if res.Body != nil {
  63111. res.Body.Close()
  63112. }
  63113. return nil, &googleapi.Error{
  63114. Code: res.StatusCode,
  63115. Header: res.Header,
  63116. }
  63117. }
  63118. if err != nil {
  63119. return nil, err
  63120. }
  63121. defer googleapi.CloseBody(res)
  63122. if err := googleapi.CheckResponse(res); err != nil {
  63123. return nil, err
  63124. }
  63125. ret := &Network{
  63126. ServerResponse: googleapi.ServerResponse{
  63127. Header: res.Header,
  63128. HTTPStatusCode: res.StatusCode,
  63129. },
  63130. }
  63131. target := &ret
  63132. if err := gensupport.DecodeResponse(target, res); err != nil {
  63133. return nil, err
  63134. }
  63135. return ret, nil
  63136. // {
  63137. // "description": "Returns the specified network. Gets a list of available networks by making a list() request.",
  63138. // "httpMethod": "GET",
  63139. // "id": "compute.networks.get",
  63140. // "parameterOrder": [
  63141. // "project",
  63142. // "network"
  63143. // ],
  63144. // "parameters": {
  63145. // "network": {
  63146. // "description": "Name of the network to return.",
  63147. // "location": "path",
  63148. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  63149. // "required": true,
  63150. // "type": "string"
  63151. // },
  63152. // "project": {
  63153. // "description": "Project ID for this request.",
  63154. // "location": "path",
  63155. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  63156. // "required": true,
  63157. // "type": "string"
  63158. // }
  63159. // },
  63160. // "path": "{project}/global/networks/{network}",
  63161. // "response": {
  63162. // "$ref": "Network"
  63163. // },
  63164. // "scopes": [
  63165. // "https://www.googleapis.com/auth/cloud-platform",
  63166. // "https://www.googleapis.com/auth/compute",
  63167. // "https://www.googleapis.com/auth/compute.readonly"
  63168. // ]
  63169. // }
  63170. }
  63171. // method id "compute.networks.insert":
  63172. type NetworksInsertCall struct {
  63173. s *Service
  63174. project string
  63175. network *Network
  63176. urlParams_ gensupport.URLParams
  63177. ctx_ context.Context
  63178. header_ http.Header
  63179. }
  63180. // Insert: Creates a network in the specified project using the data
  63181. // included in the request.
  63182. // For details, see https://cloud.google.com/compute/docs/reference/latest/networks/insert
  63183. func (r *NetworksService) Insert(project string, network *Network) *NetworksInsertCall {
  63184. c := &NetworksInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  63185. c.project = project
  63186. c.network = network
  63187. return c
  63188. }
  63189. // RequestId sets the optional parameter "requestId": An optional
  63190. // request ID to identify requests. Specify a unique request ID so that
  63191. // if you must retry your request, the server will know to ignore the
  63192. // request if it has already been completed.
  63193. //
  63194. // For example, consider a situation where you make an initial request
  63195. // and the request times out. If you make the request again with the
  63196. // same request ID, the server can check if original operation with the
  63197. // same request ID was received, and if so, will ignore the second
  63198. // request. This prevents clients from accidentally creating duplicate
  63199. // commitments.
  63200. //
  63201. // The request ID must be a valid UUID with the exception that zero UUID
  63202. // is not supported (00000000-0000-0000-0000-000000000000).
  63203. func (c *NetworksInsertCall) RequestId(requestId string) *NetworksInsertCall {
  63204. c.urlParams_.Set("requestId", requestId)
  63205. return c
  63206. }
  63207. // Fields allows partial responses to be retrieved. See
  63208. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  63209. // for more information.
  63210. func (c *NetworksInsertCall) Fields(s ...googleapi.Field) *NetworksInsertCall {
  63211. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  63212. return c
  63213. }
  63214. // Context sets the context to be used in this call's Do method. Any
  63215. // pending HTTP request will be aborted if the provided context is
  63216. // canceled.
  63217. func (c *NetworksInsertCall) Context(ctx context.Context) *NetworksInsertCall {
  63218. c.ctx_ = ctx
  63219. return c
  63220. }
  63221. // Header returns an http.Header that can be modified by the caller to
  63222. // add HTTP headers to the request.
  63223. func (c *NetworksInsertCall) Header() http.Header {
  63224. if c.header_ == nil {
  63225. c.header_ = make(http.Header)
  63226. }
  63227. return c.header_
  63228. }
  63229. func (c *NetworksInsertCall) doRequest(alt string) (*http.Response, error) {
  63230. reqHeaders := make(http.Header)
  63231. for k, v := range c.header_ {
  63232. reqHeaders[k] = v
  63233. }
  63234. reqHeaders.Set("User-Agent", c.s.userAgent())
  63235. var body io.Reader = nil
  63236. body, err := googleapi.WithoutDataWrapper.JSONReader(c.network)
  63237. if err != nil {
  63238. return nil, err
  63239. }
  63240. reqHeaders.Set("Content-Type", "application/json")
  63241. c.urlParams_.Set("alt", alt)
  63242. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/networks")
  63243. urls += "?" + c.urlParams_.Encode()
  63244. req, _ := http.NewRequest("POST", urls, body)
  63245. req.Header = reqHeaders
  63246. googleapi.Expand(req.URL, map[string]string{
  63247. "project": c.project,
  63248. })
  63249. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  63250. }
  63251. // Do executes the "compute.networks.insert" call.
  63252. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  63253. // status code is an error. Response headers are in either
  63254. // *Operation.ServerResponse.Header or (if a response was returned at
  63255. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  63256. // to check whether the returned error was because
  63257. // http.StatusNotModified was returned.
  63258. func (c *NetworksInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  63259. gensupport.SetOptions(c.urlParams_, opts...)
  63260. res, err := c.doRequest("json")
  63261. if res != nil && res.StatusCode == http.StatusNotModified {
  63262. if res.Body != nil {
  63263. res.Body.Close()
  63264. }
  63265. return nil, &googleapi.Error{
  63266. Code: res.StatusCode,
  63267. Header: res.Header,
  63268. }
  63269. }
  63270. if err != nil {
  63271. return nil, err
  63272. }
  63273. defer googleapi.CloseBody(res)
  63274. if err := googleapi.CheckResponse(res); err != nil {
  63275. return nil, err
  63276. }
  63277. ret := &Operation{
  63278. ServerResponse: googleapi.ServerResponse{
  63279. Header: res.Header,
  63280. HTTPStatusCode: res.StatusCode,
  63281. },
  63282. }
  63283. target := &ret
  63284. if err := gensupport.DecodeResponse(target, res); err != nil {
  63285. return nil, err
  63286. }
  63287. return ret, nil
  63288. // {
  63289. // "description": "Creates a network in the specified project using the data included in the request.",
  63290. // "httpMethod": "POST",
  63291. // "id": "compute.networks.insert",
  63292. // "parameterOrder": [
  63293. // "project"
  63294. // ],
  63295. // "parameters": {
  63296. // "project": {
  63297. // "description": "Project ID for this request.",
  63298. // "location": "path",
  63299. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  63300. // "required": true,
  63301. // "type": "string"
  63302. // },
  63303. // "requestId": {
  63304. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  63305. // "location": "query",
  63306. // "type": "string"
  63307. // }
  63308. // },
  63309. // "path": "{project}/global/networks",
  63310. // "request": {
  63311. // "$ref": "Network"
  63312. // },
  63313. // "response": {
  63314. // "$ref": "Operation"
  63315. // },
  63316. // "scopes": [
  63317. // "https://www.googleapis.com/auth/cloud-platform",
  63318. // "https://www.googleapis.com/auth/compute"
  63319. // ]
  63320. // }
  63321. }
  63322. // method id "compute.networks.list":
  63323. type NetworksListCall struct {
  63324. s *Service
  63325. project string
  63326. urlParams_ gensupport.URLParams
  63327. ifNoneMatch_ string
  63328. ctx_ context.Context
  63329. header_ http.Header
  63330. }
  63331. // List: Retrieves the list of networks available to the specified
  63332. // project.
  63333. // For details, see https://cloud.google.com/compute/docs/reference/latest/networks/list
  63334. func (r *NetworksService) List(project string) *NetworksListCall {
  63335. c := &NetworksListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  63336. c.project = project
  63337. return c
  63338. }
  63339. // Filter sets the optional parameter "filter": A filter expression that
  63340. // filters resources listed in the response. The expression must specify
  63341. // the field name, a comparison operator, and the value that you want to
  63342. // use for filtering. The value must be a string, a number, or a
  63343. // boolean. The comparison operator must be either =, !=, >, or <.
  63344. //
  63345. // For example, if you are filtering Compute Engine instances, you can
  63346. // exclude instances named example-instance by specifying name !=
  63347. // example-instance.
  63348. //
  63349. // You can also filter nested fields. For example, you could specify
  63350. // scheduling.automaticRestart = false to include instances only if they
  63351. // are not scheduled for automatic restarts. You can use filtering on
  63352. // nested fields to filter based on resource labels.
  63353. //
  63354. // To filter on multiple expressions, provide each separate expression
  63355. // within parentheses. For example, (scheduling.automaticRestart = true)
  63356. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  63357. // AND expression. However, you can include AND and OR expressions
  63358. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  63359. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  63360. // true).
  63361. func (c *NetworksListCall) Filter(filter string) *NetworksListCall {
  63362. c.urlParams_.Set("filter", filter)
  63363. return c
  63364. }
  63365. // MaxResults sets the optional parameter "maxResults": The maximum
  63366. // number of results per page that should be returned. If the number of
  63367. // available results is larger than maxResults, Compute Engine returns a
  63368. // nextPageToken that can be used to get the next page of results in
  63369. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  63370. // (Default: 500)
  63371. func (c *NetworksListCall) MaxResults(maxResults int64) *NetworksListCall {
  63372. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  63373. return c
  63374. }
  63375. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  63376. // a certain order. By default, results are returned in alphanumerical
  63377. // order based on the resource name.
  63378. //
  63379. // You can also sort results in descending order based on the creation
  63380. // timestamp using orderBy="creationTimestamp desc". This sorts results
  63381. // based on the creationTimestamp field in reverse chronological order
  63382. // (newest result first). Use this to sort resources like operations so
  63383. // that the newest operation is returned first.
  63384. //
  63385. // Currently, only sorting by name or creationTimestamp desc is
  63386. // supported.
  63387. func (c *NetworksListCall) OrderBy(orderBy string) *NetworksListCall {
  63388. c.urlParams_.Set("orderBy", orderBy)
  63389. return c
  63390. }
  63391. // PageToken sets the optional parameter "pageToken": Specifies a page
  63392. // token to use. Set pageToken to the nextPageToken returned by a
  63393. // previous list request to get the next page of results.
  63394. func (c *NetworksListCall) PageToken(pageToken string) *NetworksListCall {
  63395. c.urlParams_.Set("pageToken", pageToken)
  63396. return c
  63397. }
  63398. // Fields allows partial responses to be retrieved. See
  63399. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  63400. // for more information.
  63401. func (c *NetworksListCall) Fields(s ...googleapi.Field) *NetworksListCall {
  63402. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  63403. return c
  63404. }
  63405. // IfNoneMatch sets the optional parameter which makes the operation
  63406. // fail if the object's ETag matches the given value. This is useful for
  63407. // getting updates only after the object has changed since the last
  63408. // request. Use googleapi.IsNotModified to check whether the response
  63409. // error from Do is the result of In-None-Match.
  63410. func (c *NetworksListCall) IfNoneMatch(entityTag string) *NetworksListCall {
  63411. c.ifNoneMatch_ = entityTag
  63412. return c
  63413. }
  63414. // Context sets the context to be used in this call's Do method. Any
  63415. // pending HTTP request will be aborted if the provided context is
  63416. // canceled.
  63417. func (c *NetworksListCall) Context(ctx context.Context) *NetworksListCall {
  63418. c.ctx_ = ctx
  63419. return c
  63420. }
  63421. // Header returns an http.Header that can be modified by the caller to
  63422. // add HTTP headers to the request.
  63423. func (c *NetworksListCall) Header() http.Header {
  63424. if c.header_ == nil {
  63425. c.header_ = make(http.Header)
  63426. }
  63427. return c.header_
  63428. }
  63429. func (c *NetworksListCall) doRequest(alt string) (*http.Response, error) {
  63430. reqHeaders := make(http.Header)
  63431. for k, v := range c.header_ {
  63432. reqHeaders[k] = v
  63433. }
  63434. reqHeaders.Set("User-Agent", c.s.userAgent())
  63435. if c.ifNoneMatch_ != "" {
  63436. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  63437. }
  63438. var body io.Reader = nil
  63439. c.urlParams_.Set("alt", alt)
  63440. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/networks")
  63441. urls += "?" + c.urlParams_.Encode()
  63442. req, _ := http.NewRequest("GET", urls, body)
  63443. req.Header = reqHeaders
  63444. googleapi.Expand(req.URL, map[string]string{
  63445. "project": c.project,
  63446. })
  63447. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  63448. }
  63449. // Do executes the "compute.networks.list" call.
  63450. // Exactly one of *NetworkList or error will be non-nil. Any non-2xx
  63451. // status code is an error. Response headers are in either
  63452. // *NetworkList.ServerResponse.Header or (if a response was returned at
  63453. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  63454. // to check whether the returned error was because
  63455. // http.StatusNotModified was returned.
  63456. func (c *NetworksListCall) Do(opts ...googleapi.CallOption) (*NetworkList, error) {
  63457. gensupport.SetOptions(c.urlParams_, opts...)
  63458. res, err := c.doRequest("json")
  63459. if res != nil && res.StatusCode == http.StatusNotModified {
  63460. if res.Body != nil {
  63461. res.Body.Close()
  63462. }
  63463. return nil, &googleapi.Error{
  63464. Code: res.StatusCode,
  63465. Header: res.Header,
  63466. }
  63467. }
  63468. if err != nil {
  63469. return nil, err
  63470. }
  63471. defer googleapi.CloseBody(res)
  63472. if err := googleapi.CheckResponse(res); err != nil {
  63473. return nil, err
  63474. }
  63475. ret := &NetworkList{
  63476. ServerResponse: googleapi.ServerResponse{
  63477. Header: res.Header,
  63478. HTTPStatusCode: res.StatusCode,
  63479. },
  63480. }
  63481. target := &ret
  63482. if err := gensupport.DecodeResponse(target, res); err != nil {
  63483. return nil, err
  63484. }
  63485. return ret, nil
  63486. // {
  63487. // "description": "Retrieves the list of networks available to the specified project.",
  63488. // "httpMethod": "GET",
  63489. // "id": "compute.networks.list",
  63490. // "parameterOrder": [
  63491. // "project"
  63492. // ],
  63493. // "parameters": {
  63494. // "filter": {
  63495. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  63496. // "location": "query",
  63497. // "type": "string"
  63498. // },
  63499. // "maxResults": {
  63500. // "default": "500",
  63501. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  63502. // "format": "uint32",
  63503. // "location": "query",
  63504. // "minimum": "0",
  63505. // "type": "integer"
  63506. // },
  63507. // "orderBy": {
  63508. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  63509. // "location": "query",
  63510. // "type": "string"
  63511. // },
  63512. // "pageToken": {
  63513. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  63514. // "location": "query",
  63515. // "type": "string"
  63516. // },
  63517. // "project": {
  63518. // "description": "Project ID for this request.",
  63519. // "location": "path",
  63520. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  63521. // "required": true,
  63522. // "type": "string"
  63523. // }
  63524. // },
  63525. // "path": "{project}/global/networks",
  63526. // "response": {
  63527. // "$ref": "NetworkList"
  63528. // },
  63529. // "scopes": [
  63530. // "https://www.googleapis.com/auth/cloud-platform",
  63531. // "https://www.googleapis.com/auth/compute",
  63532. // "https://www.googleapis.com/auth/compute.readonly"
  63533. // ]
  63534. // }
  63535. }
  63536. // Pages invokes f for each page of results.
  63537. // A non-nil error returned from f will halt the iteration.
  63538. // The provided context supersedes any context provided to the Context method.
  63539. func (c *NetworksListCall) Pages(ctx context.Context, f func(*NetworkList) error) error {
  63540. c.ctx_ = ctx
  63541. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  63542. for {
  63543. x, err := c.Do()
  63544. if err != nil {
  63545. return err
  63546. }
  63547. if err := f(x); err != nil {
  63548. return err
  63549. }
  63550. if x.NextPageToken == "" {
  63551. return nil
  63552. }
  63553. c.PageToken(x.NextPageToken)
  63554. }
  63555. }
  63556. // method id "compute.networks.patch":
  63557. type NetworksPatchCall struct {
  63558. s *Service
  63559. project string
  63560. network string
  63561. network2 *Network
  63562. urlParams_ gensupport.URLParams
  63563. ctx_ context.Context
  63564. header_ http.Header
  63565. }
  63566. // Patch: Patches the specified network with the data included in the
  63567. // request. Only the following fields can be modified:
  63568. // routingConfig.routingMode.
  63569. func (r *NetworksService) Patch(project string, network string, network2 *Network) *NetworksPatchCall {
  63570. c := &NetworksPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  63571. c.project = project
  63572. c.network = network
  63573. c.network2 = network2
  63574. return c
  63575. }
  63576. // RequestId sets the optional parameter "requestId": An optional
  63577. // request ID to identify requests. Specify a unique request ID so that
  63578. // if you must retry your request, the server will know to ignore the
  63579. // request if it has already been completed.
  63580. //
  63581. // For example, consider a situation where you make an initial request
  63582. // and the request times out. If you make the request again with the
  63583. // same request ID, the server can check if original operation with the
  63584. // same request ID was received, and if so, will ignore the second
  63585. // request. This prevents clients from accidentally creating duplicate
  63586. // commitments.
  63587. //
  63588. // The request ID must be a valid UUID with the exception that zero UUID
  63589. // is not supported (00000000-0000-0000-0000-000000000000).
  63590. func (c *NetworksPatchCall) RequestId(requestId string) *NetworksPatchCall {
  63591. c.urlParams_.Set("requestId", requestId)
  63592. return c
  63593. }
  63594. // Fields allows partial responses to be retrieved. See
  63595. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  63596. // for more information.
  63597. func (c *NetworksPatchCall) Fields(s ...googleapi.Field) *NetworksPatchCall {
  63598. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  63599. return c
  63600. }
  63601. // Context sets the context to be used in this call's Do method. Any
  63602. // pending HTTP request will be aborted if the provided context is
  63603. // canceled.
  63604. func (c *NetworksPatchCall) Context(ctx context.Context) *NetworksPatchCall {
  63605. c.ctx_ = ctx
  63606. return c
  63607. }
  63608. // Header returns an http.Header that can be modified by the caller to
  63609. // add HTTP headers to the request.
  63610. func (c *NetworksPatchCall) Header() http.Header {
  63611. if c.header_ == nil {
  63612. c.header_ = make(http.Header)
  63613. }
  63614. return c.header_
  63615. }
  63616. func (c *NetworksPatchCall) doRequest(alt string) (*http.Response, error) {
  63617. reqHeaders := make(http.Header)
  63618. for k, v := range c.header_ {
  63619. reqHeaders[k] = v
  63620. }
  63621. reqHeaders.Set("User-Agent", c.s.userAgent())
  63622. var body io.Reader = nil
  63623. body, err := googleapi.WithoutDataWrapper.JSONReader(c.network2)
  63624. if err != nil {
  63625. return nil, err
  63626. }
  63627. reqHeaders.Set("Content-Type", "application/json")
  63628. c.urlParams_.Set("alt", alt)
  63629. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/networks/{network}")
  63630. urls += "?" + c.urlParams_.Encode()
  63631. req, _ := http.NewRequest("PATCH", urls, body)
  63632. req.Header = reqHeaders
  63633. googleapi.Expand(req.URL, map[string]string{
  63634. "project": c.project,
  63635. "network": c.network,
  63636. })
  63637. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  63638. }
  63639. // Do executes the "compute.networks.patch" call.
  63640. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  63641. // status code is an error. Response headers are in either
  63642. // *Operation.ServerResponse.Header or (if a response was returned at
  63643. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  63644. // to check whether the returned error was because
  63645. // http.StatusNotModified was returned.
  63646. func (c *NetworksPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  63647. gensupport.SetOptions(c.urlParams_, opts...)
  63648. res, err := c.doRequest("json")
  63649. if res != nil && res.StatusCode == http.StatusNotModified {
  63650. if res.Body != nil {
  63651. res.Body.Close()
  63652. }
  63653. return nil, &googleapi.Error{
  63654. Code: res.StatusCode,
  63655. Header: res.Header,
  63656. }
  63657. }
  63658. if err != nil {
  63659. return nil, err
  63660. }
  63661. defer googleapi.CloseBody(res)
  63662. if err := googleapi.CheckResponse(res); err != nil {
  63663. return nil, err
  63664. }
  63665. ret := &Operation{
  63666. ServerResponse: googleapi.ServerResponse{
  63667. Header: res.Header,
  63668. HTTPStatusCode: res.StatusCode,
  63669. },
  63670. }
  63671. target := &ret
  63672. if err := gensupport.DecodeResponse(target, res); err != nil {
  63673. return nil, err
  63674. }
  63675. return ret, nil
  63676. // {
  63677. // "description": "Patches the specified network with the data included in the request. Only the following fields can be modified: routingConfig.routingMode.",
  63678. // "httpMethod": "PATCH",
  63679. // "id": "compute.networks.patch",
  63680. // "parameterOrder": [
  63681. // "project",
  63682. // "network"
  63683. // ],
  63684. // "parameters": {
  63685. // "network": {
  63686. // "description": "Name of the network to update.",
  63687. // "location": "path",
  63688. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  63689. // "required": true,
  63690. // "type": "string"
  63691. // },
  63692. // "project": {
  63693. // "description": "Project ID for this request.",
  63694. // "location": "path",
  63695. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  63696. // "required": true,
  63697. // "type": "string"
  63698. // },
  63699. // "requestId": {
  63700. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  63701. // "location": "query",
  63702. // "type": "string"
  63703. // }
  63704. // },
  63705. // "path": "{project}/global/networks/{network}",
  63706. // "request": {
  63707. // "$ref": "Network"
  63708. // },
  63709. // "response": {
  63710. // "$ref": "Operation"
  63711. // },
  63712. // "scopes": [
  63713. // "https://www.googleapis.com/auth/cloud-platform",
  63714. // "https://www.googleapis.com/auth/compute"
  63715. // ]
  63716. // }
  63717. }
  63718. // method id "compute.networks.removePeering":
  63719. type NetworksRemovePeeringCall struct {
  63720. s *Service
  63721. project string
  63722. network string
  63723. networksremovepeeringrequest *NetworksRemovePeeringRequest
  63724. urlParams_ gensupport.URLParams
  63725. ctx_ context.Context
  63726. header_ http.Header
  63727. }
  63728. // RemovePeering: Removes a peering from the specified network.
  63729. func (r *NetworksService) RemovePeering(project string, network string, networksremovepeeringrequest *NetworksRemovePeeringRequest) *NetworksRemovePeeringCall {
  63730. c := &NetworksRemovePeeringCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  63731. c.project = project
  63732. c.network = network
  63733. c.networksremovepeeringrequest = networksremovepeeringrequest
  63734. return c
  63735. }
  63736. // RequestId sets the optional parameter "requestId": An optional
  63737. // request ID to identify requests. Specify a unique request ID so that
  63738. // if you must retry your request, the server will know to ignore the
  63739. // request if it has already been completed.
  63740. //
  63741. // For example, consider a situation where you make an initial request
  63742. // and the request times out. If you make the request again with the
  63743. // same request ID, the server can check if original operation with the
  63744. // same request ID was received, and if so, will ignore the second
  63745. // request. This prevents clients from accidentally creating duplicate
  63746. // commitments.
  63747. //
  63748. // The request ID must be a valid UUID with the exception that zero UUID
  63749. // is not supported (00000000-0000-0000-0000-000000000000).
  63750. func (c *NetworksRemovePeeringCall) RequestId(requestId string) *NetworksRemovePeeringCall {
  63751. c.urlParams_.Set("requestId", requestId)
  63752. return c
  63753. }
  63754. // Fields allows partial responses to be retrieved. See
  63755. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  63756. // for more information.
  63757. func (c *NetworksRemovePeeringCall) Fields(s ...googleapi.Field) *NetworksRemovePeeringCall {
  63758. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  63759. return c
  63760. }
  63761. // Context sets the context to be used in this call's Do method. Any
  63762. // pending HTTP request will be aborted if the provided context is
  63763. // canceled.
  63764. func (c *NetworksRemovePeeringCall) Context(ctx context.Context) *NetworksRemovePeeringCall {
  63765. c.ctx_ = ctx
  63766. return c
  63767. }
  63768. // Header returns an http.Header that can be modified by the caller to
  63769. // add HTTP headers to the request.
  63770. func (c *NetworksRemovePeeringCall) Header() http.Header {
  63771. if c.header_ == nil {
  63772. c.header_ = make(http.Header)
  63773. }
  63774. return c.header_
  63775. }
  63776. func (c *NetworksRemovePeeringCall) doRequest(alt string) (*http.Response, error) {
  63777. reqHeaders := make(http.Header)
  63778. for k, v := range c.header_ {
  63779. reqHeaders[k] = v
  63780. }
  63781. reqHeaders.Set("User-Agent", c.s.userAgent())
  63782. var body io.Reader = nil
  63783. body, err := googleapi.WithoutDataWrapper.JSONReader(c.networksremovepeeringrequest)
  63784. if err != nil {
  63785. return nil, err
  63786. }
  63787. reqHeaders.Set("Content-Type", "application/json")
  63788. c.urlParams_.Set("alt", alt)
  63789. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/networks/{network}/removePeering")
  63790. urls += "?" + c.urlParams_.Encode()
  63791. req, _ := http.NewRequest("POST", urls, body)
  63792. req.Header = reqHeaders
  63793. googleapi.Expand(req.URL, map[string]string{
  63794. "project": c.project,
  63795. "network": c.network,
  63796. })
  63797. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  63798. }
  63799. // Do executes the "compute.networks.removePeering" call.
  63800. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  63801. // status code is an error. Response headers are in either
  63802. // *Operation.ServerResponse.Header or (if a response was returned at
  63803. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  63804. // to check whether the returned error was because
  63805. // http.StatusNotModified was returned.
  63806. func (c *NetworksRemovePeeringCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  63807. gensupport.SetOptions(c.urlParams_, opts...)
  63808. res, err := c.doRequest("json")
  63809. if res != nil && res.StatusCode == http.StatusNotModified {
  63810. if res.Body != nil {
  63811. res.Body.Close()
  63812. }
  63813. return nil, &googleapi.Error{
  63814. Code: res.StatusCode,
  63815. Header: res.Header,
  63816. }
  63817. }
  63818. if err != nil {
  63819. return nil, err
  63820. }
  63821. defer googleapi.CloseBody(res)
  63822. if err := googleapi.CheckResponse(res); err != nil {
  63823. return nil, err
  63824. }
  63825. ret := &Operation{
  63826. ServerResponse: googleapi.ServerResponse{
  63827. Header: res.Header,
  63828. HTTPStatusCode: res.StatusCode,
  63829. },
  63830. }
  63831. target := &ret
  63832. if err := gensupport.DecodeResponse(target, res); err != nil {
  63833. return nil, err
  63834. }
  63835. return ret, nil
  63836. // {
  63837. // "description": "Removes a peering from the specified network.",
  63838. // "httpMethod": "POST",
  63839. // "id": "compute.networks.removePeering",
  63840. // "parameterOrder": [
  63841. // "project",
  63842. // "network"
  63843. // ],
  63844. // "parameters": {
  63845. // "network": {
  63846. // "description": "Name of the network resource to remove peering from.",
  63847. // "location": "path",
  63848. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  63849. // "required": true,
  63850. // "type": "string"
  63851. // },
  63852. // "project": {
  63853. // "description": "Project ID for this request.",
  63854. // "location": "path",
  63855. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  63856. // "required": true,
  63857. // "type": "string"
  63858. // },
  63859. // "requestId": {
  63860. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  63861. // "location": "query",
  63862. // "type": "string"
  63863. // }
  63864. // },
  63865. // "path": "{project}/global/networks/{network}/removePeering",
  63866. // "request": {
  63867. // "$ref": "NetworksRemovePeeringRequest"
  63868. // },
  63869. // "response": {
  63870. // "$ref": "Operation"
  63871. // },
  63872. // "scopes": [
  63873. // "https://www.googleapis.com/auth/cloud-platform",
  63874. // "https://www.googleapis.com/auth/compute"
  63875. // ]
  63876. // }
  63877. }
  63878. // method id "compute.networks.switchToCustomMode":
  63879. type NetworksSwitchToCustomModeCall struct {
  63880. s *Service
  63881. project string
  63882. network string
  63883. urlParams_ gensupport.URLParams
  63884. ctx_ context.Context
  63885. header_ http.Header
  63886. }
  63887. // SwitchToCustomMode: Switches the network mode from auto subnet mode
  63888. // to custom subnet mode.
  63889. func (r *NetworksService) SwitchToCustomMode(project string, network string) *NetworksSwitchToCustomModeCall {
  63890. c := &NetworksSwitchToCustomModeCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  63891. c.project = project
  63892. c.network = network
  63893. return c
  63894. }
  63895. // RequestId sets the optional parameter "requestId": An optional
  63896. // request ID to identify requests. Specify a unique request ID so that
  63897. // if you must retry your request, the server will know to ignore the
  63898. // request if it has already been completed.
  63899. //
  63900. // For example, consider a situation where you make an initial request
  63901. // and the request times out. If you make the request again with the
  63902. // same request ID, the server can check if original operation with the
  63903. // same request ID was received, and if so, will ignore the second
  63904. // request. This prevents clients from accidentally creating duplicate
  63905. // commitments.
  63906. //
  63907. // The request ID must be a valid UUID with the exception that zero UUID
  63908. // is not supported (00000000-0000-0000-0000-000000000000).
  63909. func (c *NetworksSwitchToCustomModeCall) RequestId(requestId string) *NetworksSwitchToCustomModeCall {
  63910. c.urlParams_.Set("requestId", requestId)
  63911. return c
  63912. }
  63913. // Fields allows partial responses to be retrieved. See
  63914. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  63915. // for more information.
  63916. func (c *NetworksSwitchToCustomModeCall) Fields(s ...googleapi.Field) *NetworksSwitchToCustomModeCall {
  63917. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  63918. return c
  63919. }
  63920. // Context sets the context to be used in this call's Do method. Any
  63921. // pending HTTP request will be aborted if the provided context is
  63922. // canceled.
  63923. func (c *NetworksSwitchToCustomModeCall) Context(ctx context.Context) *NetworksSwitchToCustomModeCall {
  63924. c.ctx_ = ctx
  63925. return c
  63926. }
  63927. // Header returns an http.Header that can be modified by the caller to
  63928. // add HTTP headers to the request.
  63929. func (c *NetworksSwitchToCustomModeCall) Header() http.Header {
  63930. if c.header_ == nil {
  63931. c.header_ = make(http.Header)
  63932. }
  63933. return c.header_
  63934. }
  63935. func (c *NetworksSwitchToCustomModeCall) doRequest(alt string) (*http.Response, error) {
  63936. reqHeaders := make(http.Header)
  63937. for k, v := range c.header_ {
  63938. reqHeaders[k] = v
  63939. }
  63940. reqHeaders.Set("User-Agent", c.s.userAgent())
  63941. var body io.Reader = nil
  63942. c.urlParams_.Set("alt", alt)
  63943. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/networks/{network}/switchToCustomMode")
  63944. urls += "?" + c.urlParams_.Encode()
  63945. req, _ := http.NewRequest("POST", urls, body)
  63946. req.Header = reqHeaders
  63947. googleapi.Expand(req.URL, map[string]string{
  63948. "project": c.project,
  63949. "network": c.network,
  63950. })
  63951. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  63952. }
  63953. // Do executes the "compute.networks.switchToCustomMode" call.
  63954. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  63955. // status code is an error. Response headers are in either
  63956. // *Operation.ServerResponse.Header or (if a response was returned at
  63957. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  63958. // to check whether the returned error was because
  63959. // http.StatusNotModified was returned.
  63960. func (c *NetworksSwitchToCustomModeCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  63961. gensupport.SetOptions(c.urlParams_, opts...)
  63962. res, err := c.doRequest("json")
  63963. if res != nil && res.StatusCode == http.StatusNotModified {
  63964. if res.Body != nil {
  63965. res.Body.Close()
  63966. }
  63967. return nil, &googleapi.Error{
  63968. Code: res.StatusCode,
  63969. Header: res.Header,
  63970. }
  63971. }
  63972. if err != nil {
  63973. return nil, err
  63974. }
  63975. defer googleapi.CloseBody(res)
  63976. if err := googleapi.CheckResponse(res); err != nil {
  63977. return nil, err
  63978. }
  63979. ret := &Operation{
  63980. ServerResponse: googleapi.ServerResponse{
  63981. Header: res.Header,
  63982. HTTPStatusCode: res.StatusCode,
  63983. },
  63984. }
  63985. target := &ret
  63986. if err := gensupport.DecodeResponse(target, res); err != nil {
  63987. return nil, err
  63988. }
  63989. return ret, nil
  63990. // {
  63991. // "description": "Switches the network mode from auto subnet mode to custom subnet mode.",
  63992. // "httpMethod": "POST",
  63993. // "id": "compute.networks.switchToCustomMode",
  63994. // "parameterOrder": [
  63995. // "project",
  63996. // "network"
  63997. // ],
  63998. // "parameters": {
  63999. // "network": {
  64000. // "description": "Name of the network to be updated.",
  64001. // "location": "path",
  64002. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  64003. // "required": true,
  64004. // "type": "string"
  64005. // },
  64006. // "project": {
  64007. // "description": "Project ID for this request.",
  64008. // "location": "path",
  64009. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  64010. // "required": true,
  64011. // "type": "string"
  64012. // },
  64013. // "requestId": {
  64014. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  64015. // "location": "query",
  64016. // "type": "string"
  64017. // }
  64018. // },
  64019. // "path": "{project}/global/networks/{network}/switchToCustomMode",
  64020. // "response": {
  64021. // "$ref": "Operation"
  64022. // },
  64023. // "scopes": [
  64024. // "https://www.googleapis.com/auth/cloud-platform",
  64025. // "https://www.googleapis.com/auth/compute"
  64026. // ]
  64027. // }
  64028. }
  64029. // method id "compute.networks.testIamPermissions":
  64030. type NetworksTestIamPermissionsCall struct {
  64031. s *Service
  64032. project string
  64033. resource string
  64034. testpermissionsrequest *TestPermissionsRequest
  64035. urlParams_ gensupport.URLParams
  64036. ctx_ context.Context
  64037. header_ http.Header
  64038. }
  64039. // TestIamPermissions: Returns permissions that a caller has on the
  64040. // specified resource.
  64041. func (r *NetworksService) TestIamPermissions(project string, resource string, testpermissionsrequest *TestPermissionsRequest) *NetworksTestIamPermissionsCall {
  64042. c := &NetworksTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  64043. c.project = project
  64044. c.resource = resource
  64045. c.testpermissionsrequest = testpermissionsrequest
  64046. return c
  64047. }
  64048. // Fields allows partial responses to be retrieved. See
  64049. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  64050. // for more information.
  64051. func (c *NetworksTestIamPermissionsCall) Fields(s ...googleapi.Field) *NetworksTestIamPermissionsCall {
  64052. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  64053. return c
  64054. }
  64055. // Context sets the context to be used in this call's Do method. Any
  64056. // pending HTTP request will be aborted if the provided context is
  64057. // canceled.
  64058. func (c *NetworksTestIamPermissionsCall) Context(ctx context.Context) *NetworksTestIamPermissionsCall {
  64059. c.ctx_ = ctx
  64060. return c
  64061. }
  64062. // Header returns an http.Header that can be modified by the caller to
  64063. // add HTTP headers to the request.
  64064. func (c *NetworksTestIamPermissionsCall) Header() http.Header {
  64065. if c.header_ == nil {
  64066. c.header_ = make(http.Header)
  64067. }
  64068. return c.header_
  64069. }
  64070. func (c *NetworksTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  64071. reqHeaders := make(http.Header)
  64072. for k, v := range c.header_ {
  64073. reqHeaders[k] = v
  64074. }
  64075. reqHeaders.Set("User-Agent", c.s.userAgent())
  64076. var body io.Reader = nil
  64077. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  64078. if err != nil {
  64079. return nil, err
  64080. }
  64081. reqHeaders.Set("Content-Type", "application/json")
  64082. c.urlParams_.Set("alt", alt)
  64083. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/networks/{resource}/testIamPermissions")
  64084. urls += "?" + c.urlParams_.Encode()
  64085. req, _ := http.NewRequest("POST", urls, body)
  64086. req.Header = reqHeaders
  64087. googleapi.Expand(req.URL, map[string]string{
  64088. "project": c.project,
  64089. "resource": c.resource,
  64090. })
  64091. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  64092. }
  64093. // Do executes the "compute.networks.testIamPermissions" call.
  64094. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  64095. // non-2xx status code is an error. Response headers are in either
  64096. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  64097. // returned at all) in error.(*googleapi.Error).Header. Use
  64098. // googleapi.IsNotModified to check whether the returned error was
  64099. // because http.StatusNotModified was returned.
  64100. func (c *NetworksTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  64101. gensupport.SetOptions(c.urlParams_, opts...)
  64102. res, err := c.doRequest("json")
  64103. if res != nil && res.StatusCode == http.StatusNotModified {
  64104. if res.Body != nil {
  64105. res.Body.Close()
  64106. }
  64107. return nil, &googleapi.Error{
  64108. Code: res.StatusCode,
  64109. Header: res.Header,
  64110. }
  64111. }
  64112. if err != nil {
  64113. return nil, err
  64114. }
  64115. defer googleapi.CloseBody(res)
  64116. if err := googleapi.CheckResponse(res); err != nil {
  64117. return nil, err
  64118. }
  64119. ret := &TestPermissionsResponse{
  64120. ServerResponse: googleapi.ServerResponse{
  64121. Header: res.Header,
  64122. HTTPStatusCode: res.StatusCode,
  64123. },
  64124. }
  64125. target := &ret
  64126. if err := gensupport.DecodeResponse(target, res); err != nil {
  64127. return nil, err
  64128. }
  64129. return ret, nil
  64130. // {
  64131. // "description": "Returns permissions that a caller has on the specified resource.",
  64132. // "httpMethod": "POST",
  64133. // "id": "compute.networks.testIamPermissions",
  64134. // "parameterOrder": [
  64135. // "project",
  64136. // "resource"
  64137. // ],
  64138. // "parameters": {
  64139. // "project": {
  64140. // "description": "Project ID for this request.",
  64141. // "location": "path",
  64142. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  64143. // "required": true,
  64144. // "type": "string"
  64145. // },
  64146. // "resource": {
  64147. // "description": "Name of the resource for this request.",
  64148. // "location": "path",
  64149. // "pattern": "(?:[-a-z0-9_]{0,62}[a-z0-9])?",
  64150. // "required": true,
  64151. // "type": "string"
  64152. // }
  64153. // },
  64154. // "path": "{project}/global/networks/{resource}/testIamPermissions",
  64155. // "request": {
  64156. // "$ref": "TestPermissionsRequest"
  64157. // },
  64158. // "response": {
  64159. // "$ref": "TestPermissionsResponse"
  64160. // },
  64161. // "scopes": [
  64162. // "https://www.googleapis.com/auth/cloud-platform",
  64163. // "https://www.googleapis.com/auth/compute",
  64164. // "https://www.googleapis.com/auth/compute.readonly"
  64165. // ]
  64166. // }
  64167. }
  64168. // method id "compute.nodeGroups.addNodes":
  64169. type NodeGroupsAddNodesCall struct {
  64170. s *Service
  64171. project string
  64172. zone string
  64173. nodeGroup string
  64174. nodegroupsaddnodesrequest *NodeGroupsAddNodesRequest
  64175. urlParams_ gensupport.URLParams
  64176. ctx_ context.Context
  64177. header_ http.Header
  64178. }
  64179. // AddNodes: Adds specified number of nodes to the node group.
  64180. func (r *NodeGroupsService) AddNodes(project string, zone string, nodeGroup string, nodegroupsaddnodesrequest *NodeGroupsAddNodesRequest) *NodeGroupsAddNodesCall {
  64181. c := &NodeGroupsAddNodesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  64182. c.project = project
  64183. c.zone = zone
  64184. c.nodeGroup = nodeGroup
  64185. c.nodegroupsaddnodesrequest = nodegroupsaddnodesrequest
  64186. return c
  64187. }
  64188. // RequestId sets the optional parameter "requestId": An optional
  64189. // request ID to identify requests. Specify a unique request ID so that
  64190. // if you must retry your request, the server will know to ignore the
  64191. // request if it has already been completed.
  64192. //
  64193. // For example, consider a situation where you make an initial request
  64194. // and the request times out. If you make the request again with the
  64195. // same request ID, the server can check if original operation with the
  64196. // same request ID was received, and if so, will ignore the second
  64197. // request. This prevents clients from accidentally creating duplicate
  64198. // commitments.
  64199. //
  64200. // The request ID must be a valid UUID with the exception that zero UUID
  64201. // is not supported (00000000-0000-0000-0000-000000000000).
  64202. func (c *NodeGroupsAddNodesCall) RequestId(requestId string) *NodeGroupsAddNodesCall {
  64203. c.urlParams_.Set("requestId", requestId)
  64204. return c
  64205. }
  64206. // Fields allows partial responses to be retrieved. See
  64207. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  64208. // for more information.
  64209. func (c *NodeGroupsAddNodesCall) Fields(s ...googleapi.Field) *NodeGroupsAddNodesCall {
  64210. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  64211. return c
  64212. }
  64213. // Context sets the context to be used in this call's Do method. Any
  64214. // pending HTTP request will be aborted if the provided context is
  64215. // canceled.
  64216. func (c *NodeGroupsAddNodesCall) Context(ctx context.Context) *NodeGroupsAddNodesCall {
  64217. c.ctx_ = ctx
  64218. return c
  64219. }
  64220. // Header returns an http.Header that can be modified by the caller to
  64221. // add HTTP headers to the request.
  64222. func (c *NodeGroupsAddNodesCall) Header() http.Header {
  64223. if c.header_ == nil {
  64224. c.header_ = make(http.Header)
  64225. }
  64226. return c.header_
  64227. }
  64228. func (c *NodeGroupsAddNodesCall) doRequest(alt string) (*http.Response, error) {
  64229. reqHeaders := make(http.Header)
  64230. for k, v := range c.header_ {
  64231. reqHeaders[k] = v
  64232. }
  64233. reqHeaders.Set("User-Agent", c.s.userAgent())
  64234. var body io.Reader = nil
  64235. body, err := googleapi.WithoutDataWrapper.JSONReader(c.nodegroupsaddnodesrequest)
  64236. if err != nil {
  64237. return nil, err
  64238. }
  64239. reqHeaders.Set("Content-Type", "application/json")
  64240. c.urlParams_.Set("alt", alt)
  64241. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/nodeGroups/{nodeGroup}/addNodes")
  64242. urls += "?" + c.urlParams_.Encode()
  64243. req, _ := http.NewRequest("POST", urls, body)
  64244. req.Header = reqHeaders
  64245. googleapi.Expand(req.URL, map[string]string{
  64246. "project": c.project,
  64247. "zone": c.zone,
  64248. "nodeGroup": c.nodeGroup,
  64249. })
  64250. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  64251. }
  64252. // Do executes the "compute.nodeGroups.addNodes" call.
  64253. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  64254. // status code is an error. Response headers are in either
  64255. // *Operation.ServerResponse.Header or (if a response was returned at
  64256. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  64257. // to check whether the returned error was because
  64258. // http.StatusNotModified was returned.
  64259. func (c *NodeGroupsAddNodesCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  64260. gensupport.SetOptions(c.urlParams_, opts...)
  64261. res, err := c.doRequest("json")
  64262. if res != nil && res.StatusCode == http.StatusNotModified {
  64263. if res.Body != nil {
  64264. res.Body.Close()
  64265. }
  64266. return nil, &googleapi.Error{
  64267. Code: res.StatusCode,
  64268. Header: res.Header,
  64269. }
  64270. }
  64271. if err != nil {
  64272. return nil, err
  64273. }
  64274. defer googleapi.CloseBody(res)
  64275. if err := googleapi.CheckResponse(res); err != nil {
  64276. return nil, err
  64277. }
  64278. ret := &Operation{
  64279. ServerResponse: googleapi.ServerResponse{
  64280. Header: res.Header,
  64281. HTTPStatusCode: res.StatusCode,
  64282. },
  64283. }
  64284. target := &ret
  64285. if err := gensupport.DecodeResponse(target, res); err != nil {
  64286. return nil, err
  64287. }
  64288. return ret, nil
  64289. // {
  64290. // "description": "Adds specified number of nodes to the node group.",
  64291. // "httpMethod": "POST",
  64292. // "id": "compute.nodeGroups.addNodes",
  64293. // "parameterOrder": [
  64294. // "project",
  64295. // "zone",
  64296. // "nodeGroup"
  64297. // ],
  64298. // "parameters": {
  64299. // "nodeGroup": {
  64300. // "description": "Name of the NodeGroup resource to delete.",
  64301. // "location": "path",
  64302. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  64303. // "required": true,
  64304. // "type": "string"
  64305. // },
  64306. // "project": {
  64307. // "description": "Project ID for this request.",
  64308. // "location": "path",
  64309. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  64310. // "required": true,
  64311. // "type": "string"
  64312. // },
  64313. // "requestId": {
  64314. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  64315. // "location": "query",
  64316. // "type": "string"
  64317. // },
  64318. // "zone": {
  64319. // "description": "The name of the zone for this request.",
  64320. // "location": "path",
  64321. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  64322. // "required": true,
  64323. // "type": "string"
  64324. // }
  64325. // },
  64326. // "path": "{project}/zones/{zone}/nodeGroups/{nodeGroup}/addNodes",
  64327. // "request": {
  64328. // "$ref": "NodeGroupsAddNodesRequest"
  64329. // },
  64330. // "response": {
  64331. // "$ref": "Operation"
  64332. // },
  64333. // "scopes": [
  64334. // "https://www.googleapis.com/auth/cloud-platform",
  64335. // "https://www.googleapis.com/auth/compute"
  64336. // ]
  64337. // }
  64338. }
  64339. // method id "compute.nodeGroups.aggregatedList":
  64340. type NodeGroupsAggregatedListCall struct {
  64341. s *Service
  64342. project string
  64343. urlParams_ gensupport.URLParams
  64344. ifNoneMatch_ string
  64345. ctx_ context.Context
  64346. header_ http.Header
  64347. }
  64348. // AggregatedList: Retrieves an aggregated list of node groups.
  64349. func (r *NodeGroupsService) AggregatedList(project string) *NodeGroupsAggregatedListCall {
  64350. c := &NodeGroupsAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  64351. c.project = project
  64352. return c
  64353. }
  64354. // Filter sets the optional parameter "filter": A filter expression that
  64355. // filters resources listed in the response. The expression must specify
  64356. // the field name, a comparison operator, and the value that you want to
  64357. // use for filtering. The value must be a string, a number, or a
  64358. // boolean. The comparison operator must be either =, !=, >, or <.
  64359. //
  64360. // For example, if you are filtering Compute Engine instances, you can
  64361. // exclude instances named example-instance by specifying name !=
  64362. // example-instance.
  64363. //
  64364. // You can also filter nested fields. For example, you could specify
  64365. // scheduling.automaticRestart = false to include instances only if they
  64366. // are not scheduled for automatic restarts. You can use filtering on
  64367. // nested fields to filter based on resource labels.
  64368. //
  64369. // To filter on multiple expressions, provide each separate expression
  64370. // within parentheses. For example, (scheduling.automaticRestart = true)
  64371. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  64372. // AND expression. However, you can include AND and OR expressions
  64373. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  64374. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  64375. // true).
  64376. func (c *NodeGroupsAggregatedListCall) Filter(filter string) *NodeGroupsAggregatedListCall {
  64377. c.urlParams_.Set("filter", filter)
  64378. return c
  64379. }
  64380. // MaxResults sets the optional parameter "maxResults": The maximum
  64381. // number of results per page that should be returned. If the number of
  64382. // available results is larger than maxResults, Compute Engine returns a
  64383. // nextPageToken that can be used to get the next page of results in
  64384. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  64385. // (Default: 500)
  64386. func (c *NodeGroupsAggregatedListCall) MaxResults(maxResults int64) *NodeGroupsAggregatedListCall {
  64387. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  64388. return c
  64389. }
  64390. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  64391. // a certain order. By default, results are returned in alphanumerical
  64392. // order based on the resource name.
  64393. //
  64394. // You can also sort results in descending order based on the creation
  64395. // timestamp using orderBy="creationTimestamp desc". This sorts results
  64396. // based on the creationTimestamp field in reverse chronological order
  64397. // (newest result first). Use this to sort resources like operations so
  64398. // that the newest operation is returned first.
  64399. //
  64400. // Currently, only sorting by name or creationTimestamp desc is
  64401. // supported.
  64402. func (c *NodeGroupsAggregatedListCall) OrderBy(orderBy string) *NodeGroupsAggregatedListCall {
  64403. c.urlParams_.Set("orderBy", orderBy)
  64404. return c
  64405. }
  64406. // PageToken sets the optional parameter "pageToken": Specifies a page
  64407. // token to use. Set pageToken to the nextPageToken returned by a
  64408. // previous list request to get the next page of results.
  64409. func (c *NodeGroupsAggregatedListCall) PageToken(pageToken string) *NodeGroupsAggregatedListCall {
  64410. c.urlParams_.Set("pageToken", pageToken)
  64411. return c
  64412. }
  64413. // Fields allows partial responses to be retrieved. See
  64414. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  64415. // for more information.
  64416. func (c *NodeGroupsAggregatedListCall) Fields(s ...googleapi.Field) *NodeGroupsAggregatedListCall {
  64417. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  64418. return c
  64419. }
  64420. // IfNoneMatch sets the optional parameter which makes the operation
  64421. // fail if the object's ETag matches the given value. This is useful for
  64422. // getting updates only after the object has changed since the last
  64423. // request. Use googleapi.IsNotModified to check whether the response
  64424. // error from Do is the result of In-None-Match.
  64425. func (c *NodeGroupsAggregatedListCall) IfNoneMatch(entityTag string) *NodeGroupsAggregatedListCall {
  64426. c.ifNoneMatch_ = entityTag
  64427. return c
  64428. }
  64429. // Context sets the context to be used in this call's Do method. Any
  64430. // pending HTTP request will be aborted if the provided context is
  64431. // canceled.
  64432. func (c *NodeGroupsAggregatedListCall) Context(ctx context.Context) *NodeGroupsAggregatedListCall {
  64433. c.ctx_ = ctx
  64434. return c
  64435. }
  64436. // Header returns an http.Header that can be modified by the caller to
  64437. // add HTTP headers to the request.
  64438. func (c *NodeGroupsAggregatedListCall) Header() http.Header {
  64439. if c.header_ == nil {
  64440. c.header_ = make(http.Header)
  64441. }
  64442. return c.header_
  64443. }
  64444. func (c *NodeGroupsAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  64445. reqHeaders := make(http.Header)
  64446. for k, v := range c.header_ {
  64447. reqHeaders[k] = v
  64448. }
  64449. reqHeaders.Set("User-Agent", c.s.userAgent())
  64450. if c.ifNoneMatch_ != "" {
  64451. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  64452. }
  64453. var body io.Reader = nil
  64454. c.urlParams_.Set("alt", alt)
  64455. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/nodeGroups")
  64456. urls += "?" + c.urlParams_.Encode()
  64457. req, _ := http.NewRequest("GET", urls, body)
  64458. req.Header = reqHeaders
  64459. googleapi.Expand(req.URL, map[string]string{
  64460. "project": c.project,
  64461. })
  64462. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  64463. }
  64464. // Do executes the "compute.nodeGroups.aggregatedList" call.
  64465. // Exactly one of *NodeGroupAggregatedList or error will be non-nil. Any
  64466. // non-2xx status code is an error. Response headers are in either
  64467. // *NodeGroupAggregatedList.ServerResponse.Header or (if a response was
  64468. // returned at all) in error.(*googleapi.Error).Header. Use
  64469. // googleapi.IsNotModified to check whether the returned error was
  64470. // because http.StatusNotModified was returned.
  64471. func (c *NodeGroupsAggregatedListCall) Do(opts ...googleapi.CallOption) (*NodeGroupAggregatedList, error) {
  64472. gensupport.SetOptions(c.urlParams_, opts...)
  64473. res, err := c.doRequest("json")
  64474. if res != nil && res.StatusCode == http.StatusNotModified {
  64475. if res.Body != nil {
  64476. res.Body.Close()
  64477. }
  64478. return nil, &googleapi.Error{
  64479. Code: res.StatusCode,
  64480. Header: res.Header,
  64481. }
  64482. }
  64483. if err != nil {
  64484. return nil, err
  64485. }
  64486. defer googleapi.CloseBody(res)
  64487. if err := googleapi.CheckResponse(res); err != nil {
  64488. return nil, err
  64489. }
  64490. ret := &NodeGroupAggregatedList{
  64491. ServerResponse: googleapi.ServerResponse{
  64492. Header: res.Header,
  64493. HTTPStatusCode: res.StatusCode,
  64494. },
  64495. }
  64496. target := &ret
  64497. if err := gensupport.DecodeResponse(target, res); err != nil {
  64498. return nil, err
  64499. }
  64500. return ret, nil
  64501. // {
  64502. // "description": "Retrieves an aggregated list of node groups.",
  64503. // "httpMethod": "GET",
  64504. // "id": "compute.nodeGroups.aggregatedList",
  64505. // "parameterOrder": [
  64506. // "project"
  64507. // ],
  64508. // "parameters": {
  64509. // "filter": {
  64510. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  64511. // "location": "query",
  64512. // "type": "string"
  64513. // },
  64514. // "maxResults": {
  64515. // "default": "500",
  64516. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  64517. // "format": "uint32",
  64518. // "location": "query",
  64519. // "minimum": "0",
  64520. // "type": "integer"
  64521. // },
  64522. // "orderBy": {
  64523. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  64524. // "location": "query",
  64525. // "type": "string"
  64526. // },
  64527. // "pageToken": {
  64528. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  64529. // "location": "query",
  64530. // "type": "string"
  64531. // },
  64532. // "project": {
  64533. // "description": "Project ID for this request.",
  64534. // "location": "path",
  64535. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  64536. // "required": true,
  64537. // "type": "string"
  64538. // }
  64539. // },
  64540. // "path": "{project}/aggregated/nodeGroups",
  64541. // "response": {
  64542. // "$ref": "NodeGroupAggregatedList"
  64543. // },
  64544. // "scopes": [
  64545. // "https://www.googleapis.com/auth/cloud-platform",
  64546. // "https://www.googleapis.com/auth/compute",
  64547. // "https://www.googleapis.com/auth/compute.readonly"
  64548. // ]
  64549. // }
  64550. }
  64551. // Pages invokes f for each page of results.
  64552. // A non-nil error returned from f will halt the iteration.
  64553. // The provided context supersedes any context provided to the Context method.
  64554. func (c *NodeGroupsAggregatedListCall) Pages(ctx context.Context, f func(*NodeGroupAggregatedList) error) error {
  64555. c.ctx_ = ctx
  64556. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  64557. for {
  64558. x, err := c.Do()
  64559. if err != nil {
  64560. return err
  64561. }
  64562. if err := f(x); err != nil {
  64563. return err
  64564. }
  64565. if x.NextPageToken == "" {
  64566. return nil
  64567. }
  64568. c.PageToken(x.NextPageToken)
  64569. }
  64570. }
  64571. // method id "compute.nodeGroups.delete":
  64572. type NodeGroupsDeleteCall struct {
  64573. s *Service
  64574. project string
  64575. zone string
  64576. nodeGroup string
  64577. urlParams_ gensupport.URLParams
  64578. ctx_ context.Context
  64579. header_ http.Header
  64580. }
  64581. // Delete: Deletes the specified NodeGroup resource.
  64582. func (r *NodeGroupsService) Delete(project string, zone string, nodeGroup string) *NodeGroupsDeleteCall {
  64583. c := &NodeGroupsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  64584. c.project = project
  64585. c.zone = zone
  64586. c.nodeGroup = nodeGroup
  64587. return c
  64588. }
  64589. // RequestId sets the optional parameter "requestId": An optional
  64590. // request ID to identify requests. Specify a unique request ID so that
  64591. // if you must retry your request, the server will know to ignore the
  64592. // request if it has already been completed.
  64593. //
  64594. // For example, consider a situation where you make an initial request
  64595. // and the request times out. If you make the request again with the
  64596. // same request ID, the server can check if original operation with the
  64597. // same request ID was received, and if so, will ignore the second
  64598. // request. This prevents clients from accidentally creating duplicate
  64599. // commitments.
  64600. //
  64601. // The request ID must be a valid UUID with the exception that zero UUID
  64602. // is not supported (00000000-0000-0000-0000-000000000000).
  64603. func (c *NodeGroupsDeleteCall) RequestId(requestId string) *NodeGroupsDeleteCall {
  64604. c.urlParams_.Set("requestId", requestId)
  64605. return c
  64606. }
  64607. // Fields allows partial responses to be retrieved. See
  64608. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  64609. // for more information.
  64610. func (c *NodeGroupsDeleteCall) Fields(s ...googleapi.Field) *NodeGroupsDeleteCall {
  64611. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  64612. return c
  64613. }
  64614. // Context sets the context to be used in this call's Do method. Any
  64615. // pending HTTP request will be aborted if the provided context is
  64616. // canceled.
  64617. func (c *NodeGroupsDeleteCall) Context(ctx context.Context) *NodeGroupsDeleteCall {
  64618. c.ctx_ = ctx
  64619. return c
  64620. }
  64621. // Header returns an http.Header that can be modified by the caller to
  64622. // add HTTP headers to the request.
  64623. func (c *NodeGroupsDeleteCall) Header() http.Header {
  64624. if c.header_ == nil {
  64625. c.header_ = make(http.Header)
  64626. }
  64627. return c.header_
  64628. }
  64629. func (c *NodeGroupsDeleteCall) doRequest(alt string) (*http.Response, error) {
  64630. reqHeaders := make(http.Header)
  64631. for k, v := range c.header_ {
  64632. reqHeaders[k] = v
  64633. }
  64634. reqHeaders.Set("User-Agent", c.s.userAgent())
  64635. var body io.Reader = nil
  64636. c.urlParams_.Set("alt", alt)
  64637. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/nodeGroups/{nodeGroup}")
  64638. urls += "?" + c.urlParams_.Encode()
  64639. req, _ := http.NewRequest("DELETE", urls, body)
  64640. req.Header = reqHeaders
  64641. googleapi.Expand(req.URL, map[string]string{
  64642. "project": c.project,
  64643. "zone": c.zone,
  64644. "nodeGroup": c.nodeGroup,
  64645. })
  64646. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  64647. }
  64648. // Do executes the "compute.nodeGroups.delete" call.
  64649. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  64650. // status code is an error. Response headers are in either
  64651. // *Operation.ServerResponse.Header or (if a response was returned at
  64652. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  64653. // to check whether the returned error was because
  64654. // http.StatusNotModified was returned.
  64655. func (c *NodeGroupsDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  64656. gensupport.SetOptions(c.urlParams_, opts...)
  64657. res, err := c.doRequest("json")
  64658. if res != nil && res.StatusCode == http.StatusNotModified {
  64659. if res.Body != nil {
  64660. res.Body.Close()
  64661. }
  64662. return nil, &googleapi.Error{
  64663. Code: res.StatusCode,
  64664. Header: res.Header,
  64665. }
  64666. }
  64667. if err != nil {
  64668. return nil, err
  64669. }
  64670. defer googleapi.CloseBody(res)
  64671. if err := googleapi.CheckResponse(res); err != nil {
  64672. return nil, err
  64673. }
  64674. ret := &Operation{
  64675. ServerResponse: googleapi.ServerResponse{
  64676. Header: res.Header,
  64677. HTTPStatusCode: res.StatusCode,
  64678. },
  64679. }
  64680. target := &ret
  64681. if err := gensupport.DecodeResponse(target, res); err != nil {
  64682. return nil, err
  64683. }
  64684. return ret, nil
  64685. // {
  64686. // "description": "Deletes the specified NodeGroup resource.",
  64687. // "httpMethod": "DELETE",
  64688. // "id": "compute.nodeGroups.delete",
  64689. // "parameterOrder": [
  64690. // "project",
  64691. // "zone",
  64692. // "nodeGroup"
  64693. // ],
  64694. // "parameters": {
  64695. // "nodeGroup": {
  64696. // "description": "Name of the NodeGroup resource to delete.",
  64697. // "location": "path",
  64698. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  64699. // "required": true,
  64700. // "type": "string"
  64701. // },
  64702. // "project": {
  64703. // "description": "Project ID for this request.",
  64704. // "location": "path",
  64705. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  64706. // "required": true,
  64707. // "type": "string"
  64708. // },
  64709. // "requestId": {
  64710. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  64711. // "location": "query",
  64712. // "type": "string"
  64713. // },
  64714. // "zone": {
  64715. // "description": "The name of the zone for this request.",
  64716. // "location": "path",
  64717. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  64718. // "required": true,
  64719. // "type": "string"
  64720. // }
  64721. // },
  64722. // "path": "{project}/zones/{zone}/nodeGroups/{nodeGroup}",
  64723. // "response": {
  64724. // "$ref": "Operation"
  64725. // },
  64726. // "scopes": [
  64727. // "https://www.googleapis.com/auth/cloud-platform",
  64728. // "https://www.googleapis.com/auth/compute"
  64729. // ]
  64730. // }
  64731. }
  64732. // method id "compute.nodeGroups.deleteNodes":
  64733. type NodeGroupsDeleteNodesCall struct {
  64734. s *Service
  64735. project string
  64736. zone string
  64737. nodeGroup string
  64738. nodegroupsdeletenodesrequest *NodeGroupsDeleteNodesRequest
  64739. urlParams_ gensupport.URLParams
  64740. ctx_ context.Context
  64741. header_ http.Header
  64742. }
  64743. // DeleteNodes: Deletes specified nodes from the node group.
  64744. func (r *NodeGroupsService) DeleteNodes(project string, zone string, nodeGroup string, nodegroupsdeletenodesrequest *NodeGroupsDeleteNodesRequest) *NodeGroupsDeleteNodesCall {
  64745. c := &NodeGroupsDeleteNodesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  64746. c.project = project
  64747. c.zone = zone
  64748. c.nodeGroup = nodeGroup
  64749. c.nodegroupsdeletenodesrequest = nodegroupsdeletenodesrequest
  64750. return c
  64751. }
  64752. // RequestId sets the optional parameter "requestId": An optional
  64753. // request ID to identify requests. Specify a unique request ID so that
  64754. // if you must retry your request, the server will know to ignore the
  64755. // request if it has already been completed.
  64756. //
  64757. // For example, consider a situation where you make an initial request
  64758. // and the request times out. If you make the request again with the
  64759. // same request ID, the server can check if original operation with the
  64760. // same request ID was received, and if so, will ignore the second
  64761. // request. This prevents clients from accidentally creating duplicate
  64762. // commitments.
  64763. //
  64764. // The request ID must be a valid UUID with the exception that zero UUID
  64765. // is not supported (00000000-0000-0000-0000-000000000000).
  64766. func (c *NodeGroupsDeleteNodesCall) RequestId(requestId string) *NodeGroupsDeleteNodesCall {
  64767. c.urlParams_.Set("requestId", requestId)
  64768. return c
  64769. }
  64770. // Fields allows partial responses to be retrieved. See
  64771. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  64772. // for more information.
  64773. func (c *NodeGroupsDeleteNodesCall) Fields(s ...googleapi.Field) *NodeGroupsDeleteNodesCall {
  64774. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  64775. return c
  64776. }
  64777. // Context sets the context to be used in this call's Do method. Any
  64778. // pending HTTP request will be aborted if the provided context is
  64779. // canceled.
  64780. func (c *NodeGroupsDeleteNodesCall) Context(ctx context.Context) *NodeGroupsDeleteNodesCall {
  64781. c.ctx_ = ctx
  64782. return c
  64783. }
  64784. // Header returns an http.Header that can be modified by the caller to
  64785. // add HTTP headers to the request.
  64786. func (c *NodeGroupsDeleteNodesCall) Header() http.Header {
  64787. if c.header_ == nil {
  64788. c.header_ = make(http.Header)
  64789. }
  64790. return c.header_
  64791. }
  64792. func (c *NodeGroupsDeleteNodesCall) doRequest(alt string) (*http.Response, error) {
  64793. reqHeaders := make(http.Header)
  64794. for k, v := range c.header_ {
  64795. reqHeaders[k] = v
  64796. }
  64797. reqHeaders.Set("User-Agent", c.s.userAgent())
  64798. var body io.Reader = nil
  64799. body, err := googleapi.WithoutDataWrapper.JSONReader(c.nodegroupsdeletenodesrequest)
  64800. if err != nil {
  64801. return nil, err
  64802. }
  64803. reqHeaders.Set("Content-Type", "application/json")
  64804. c.urlParams_.Set("alt", alt)
  64805. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/nodeGroups/{nodeGroup}/deleteNodes")
  64806. urls += "?" + c.urlParams_.Encode()
  64807. req, _ := http.NewRequest("POST", urls, body)
  64808. req.Header = reqHeaders
  64809. googleapi.Expand(req.URL, map[string]string{
  64810. "project": c.project,
  64811. "zone": c.zone,
  64812. "nodeGroup": c.nodeGroup,
  64813. })
  64814. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  64815. }
  64816. // Do executes the "compute.nodeGroups.deleteNodes" call.
  64817. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  64818. // status code is an error. Response headers are in either
  64819. // *Operation.ServerResponse.Header or (if a response was returned at
  64820. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  64821. // to check whether the returned error was because
  64822. // http.StatusNotModified was returned.
  64823. func (c *NodeGroupsDeleteNodesCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  64824. gensupport.SetOptions(c.urlParams_, opts...)
  64825. res, err := c.doRequest("json")
  64826. if res != nil && res.StatusCode == http.StatusNotModified {
  64827. if res.Body != nil {
  64828. res.Body.Close()
  64829. }
  64830. return nil, &googleapi.Error{
  64831. Code: res.StatusCode,
  64832. Header: res.Header,
  64833. }
  64834. }
  64835. if err != nil {
  64836. return nil, err
  64837. }
  64838. defer googleapi.CloseBody(res)
  64839. if err := googleapi.CheckResponse(res); err != nil {
  64840. return nil, err
  64841. }
  64842. ret := &Operation{
  64843. ServerResponse: googleapi.ServerResponse{
  64844. Header: res.Header,
  64845. HTTPStatusCode: res.StatusCode,
  64846. },
  64847. }
  64848. target := &ret
  64849. if err := gensupport.DecodeResponse(target, res); err != nil {
  64850. return nil, err
  64851. }
  64852. return ret, nil
  64853. // {
  64854. // "description": "Deletes specified nodes from the node group.",
  64855. // "httpMethod": "POST",
  64856. // "id": "compute.nodeGroups.deleteNodes",
  64857. // "parameterOrder": [
  64858. // "project",
  64859. // "zone",
  64860. // "nodeGroup"
  64861. // ],
  64862. // "parameters": {
  64863. // "nodeGroup": {
  64864. // "description": "Name of the NodeGroup resource to delete.",
  64865. // "location": "path",
  64866. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  64867. // "required": true,
  64868. // "type": "string"
  64869. // },
  64870. // "project": {
  64871. // "description": "Project ID for this request.",
  64872. // "location": "path",
  64873. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  64874. // "required": true,
  64875. // "type": "string"
  64876. // },
  64877. // "requestId": {
  64878. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  64879. // "location": "query",
  64880. // "type": "string"
  64881. // },
  64882. // "zone": {
  64883. // "description": "The name of the zone for this request.",
  64884. // "location": "path",
  64885. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  64886. // "required": true,
  64887. // "type": "string"
  64888. // }
  64889. // },
  64890. // "path": "{project}/zones/{zone}/nodeGroups/{nodeGroup}/deleteNodes",
  64891. // "request": {
  64892. // "$ref": "NodeGroupsDeleteNodesRequest"
  64893. // },
  64894. // "response": {
  64895. // "$ref": "Operation"
  64896. // },
  64897. // "scopes": [
  64898. // "https://www.googleapis.com/auth/cloud-platform",
  64899. // "https://www.googleapis.com/auth/compute"
  64900. // ]
  64901. // }
  64902. }
  64903. // method id "compute.nodeGroups.get":
  64904. type NodeGroupsGetCall struct {
  64905. s *Service
  64906. project string
  64907. zone string
  64908. nodeGroup string
  64909. urlParams_ gensupport.URLParams
  64910. ifNoneMatch_ string
  64911. ctx_ context.Context
  64912. header_ http.Header
  64913. }
  64914. // Get: Returns the specified NodeGroup. Get a list of available
  64915. // NodeGroups by making a list() request.
  64916. func (r *NodeGroupsService) Get(project string, zone string, nodeGroup string) *NodeGroupsGetCall {
  64917. c := &NodeGroupsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  64918. c.project = project
  64919. c.zone = zone
  64920. c.nodeGroup = nodeGroup
  64921. return c
  64922. }
  64923. // Fields allows partial responses to be retrieved. See
  64924. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  64925. // for more information.
  64926. func (c *NodeGroupsGetCall) Fields(s ...googleapi.Field) *NodeGroupsGetCall {
  64927. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  64928. return c
  64929. }
  64930. // IfNoneMatch sets the optional parameter which makes the operation
  64931. // fail if the object's ETag matches the given value. This is useful for
  64932. // getting updates only after the object has changed since the last
  64933. // request. Use googleapi.IsNotModified to check whether the response
  64934. // error from Do is the result of In-None-Match.
  64935. func (c *NodeGroupsGetCall) IfNoneMatch(entityTag string) *NodeGroupsGetCall {
  64936. c.ifNoneMatch_ = entityTag
  64937. return c
  64938. }
  64939. // Context sets the context to be used in this call's Do method. Any
  64940. // pending HTTP request will be aborted if the provided context is
  64941. // canceled.
  64942. func (c *NodeGroupsGetCall) Context(ctx context.Context) *NodeGroupsGetCall {
  64943. c.ctx_ = ctx
  64944. return c
  64945. }
  64946. // Header returns an http.Header that can be modified by the caller to
  64947. // add HTTP headers to the request.
  64948. func (c *NodeGroupsGetCall) Header() http.Header {
  64949. if c.header_ == nil {
  64950. c.header_ = make(http.Header)
  64951. }
  64952. return c.header_
  64953. }
  64954. func (c *NodeGroupsGetCall) doRequest(alt string) (*http.Response, error) {
  64955. reqHeaders := make(http.Header)
  64956. for k, v := range c.header_ {
  64957. reqHeaders[k] = v
  64958. }
  64959. reqHeaders.Set("User-Agent", c.s.userAgent())
  64960. if c.ifNoneMatch_ != "" {
  64961. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  64962. }
  64963. var body io.Reader = nil
  64964. c.urlParams_.Set("alt", alt)
  64965. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/nodeGroups/{nodeGroup}")
  64966. urls += "?" + c.urlParams_.Encode()
  64967. req, _ := http.NewRequest("GET", urls, body)
  64968. req.Header = reqHeaders
  64969. googleapi.Expand(req.URL, map[string]string{
  64970. "project": c.project,
  64971. "zone": c.zone,
  64972. "nodeGroup": c.nodeGroup,
  64973. })
  64974. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  64975. }
  64976. // Do executes the "compute.nodeGroups.get" call.
  64977. // Exactly one of *NodeGroup or error will be non-nil. Any non-2xx
  64978. // status code is an error. Response headers are in either
  64979. // *NodeGroup.ServerResponse.Header or (if a response was returned at
  64980. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  64981. // to check whether the returned error was because
  64982. // http.StatusNotModified was returned.
  64983. func (c *NodeGroupsGetCall) Do(opts ...googleapi.CallOption) (*NodeGroup, error) {
  64984. gensupport.SetOptions(c.urlParams_, opts...)
  64985. res, err := c.doRequest("json")
  64986. if res != nil && res.StatusCode == http.StatusNotModified {
  64987. if res.Body != nil {
  64988. res.Body.Close()
  64989. }
  64990. return nil, &googleapi.Error{
  64991. Code: res.StatusCode,
  64992. Header: res.Header,
  64993. }
  64994. }
  64995. if err != nil {
  64996. return nil, err
  64997. }
  64998. defer googleapi.CloseBody(res)
  64999. if err := googleapi.CheckResponse(res); err != nil {
  65000. return nil, err
  65001. }
  65002. ret := &NodeGroup{
  65003. ServerResponse: googleapi.ServerResponse{
  65004. Header: res.Header,
  65005. HTTPStatusCode: res.StatusCode,
  65006. },
  65007. }
  65008. target := &ret
  65009. if err := gensupport.DecodeResponse(target, res); err != nil {
  65010. return nil, err
  65011. }
  65012. return ret, nil
  65013. // {
  65014. // "description": "Returns the specified NodeGroup. Get a list of available NodeGroups by making a list() request.",
  65015. // "httpMethod": "GET",
  65016. // "id": "compute.nodeGroups.get",
  65017. // "parameterOrder": [
  65018. // "project",
  65019. // "zone",
  65020. // "nodeGroup"
  65021. // ],
  65022. // "parameters": {
  65023. // "nodeGroup": {
  65024. // "description": "Name of the node group to return.",
  65025. // "location": "path",
  65026. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  65027. // "required": true,
  65028. // "type": "string"
  65029. // },
  65030. // "project": {
  65031. // "description": "Project ID for this request.",
  65032. // "location": "path",
  65033. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  65034. // "required": true,
  65035. // "type": "string"
  65036. // },
  65037. // "zone": {
  65038. // "description": "The name of the zone for this request.",
  65039. // "location": "path",
  65040. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  65041. // "required": true,
  65042. // "type": "string"
  65043. // }
  65044. // },
  65045. // "path": "{project}/zones/{zone}/nodeGroups/{nodeGroup}",
  65046. // "response": {
  65047. // "$ref": "NodeGroup"
  65048. // },
  65049. // "scopes": [
  65050. // "https://www.googleapis.com/auth/cloud-platform",
  65051. // "https://www.googleapis.com/auth/compute",
  65052. // "https://www.googleapis.com/auth/compute.readonly"
  65053. // ]
  65054. // }
  65055. }
  65056. // method id "compute.nodeGroups.getIamPolicy":
  65057. type NodeGroupsGetIamPolicyCall struct {
  65058. s *Service
  65059. project string
  65060. zone string
  65061. resource string
  65062. urlParams_ gensupport.URLParams
  65063. ifNoneMatch_ string
  65064. ctx_ context.Context
  65065. header_ http.Header
  65066. }
  65067. // GetIamPolicy: Gets the access control policy for a resource. May be
  65068. // empty if no such policy or resource exists.
  65069. func (r *NodeGroupsService) GetIamPolicy(project string, zone string, resource string) *NodeGroupsGetIamPolicyCall {
  65070. c := &NodeGroupsGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  65071. c.project = project
  65072. c.zone = zone
  65073. c.resource = resource
  65074. return c
  65075. }
  65076. // Fields allows partial responses to be retrieved. See
  65077. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  65078. // for more information.
  65079. func (c *NodeGroupsGetIamPolicyCall) Fields(s ...googleapi.Field) *NodeGroupsGetIamPolicyCall {
  65080. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  65081. return c
  65082. }
  65083. // IfNoneMatch sets the optional parameter which makes the operation
  65084. // fail if the object's ETag matches the given value. This is useful for
  65085. // getting updates only after the object has changed since the last
  65086. // request. Use googleapi.IsNotModified to check whether the response
  65087. // error from Do is the result of In-None-Match.
  65088. func (c *NodeGroupsGetIamPolicyCall) IfNoneMatch(entityTag string) *NodeGroupsGetIamPolicyCall {
  65089. c.ifNoneMatch_ = entityTag
  65090. return c
  65091. }
  65092. // Context sets the context to be used in this call's Do method. Any
  65093. // pending HTTP request will be aborted if the provided context is
  65094. // canceled.
  65095. func (c *NodeGroupsGetIamPolicyCall) Context(ctx context.Context) *NodeGroupsGetIamPolicyCall {
  65096. c.ctx_ = ctx
  65097. return c
  65098. }
  65099. // Header returns an http.Header that can be modified by the caller to
  65100. // add HTTP headers to the request.
  65101. func (c *NodeGroupsGetIamPolicyCall) Header() http.Header {
  65102. if c.header_ == nil {
  65103. c.header_ = make(http.Header)
  65104. }
  65105. return c.header_
  65106. }
  65107. func (c *NodeGroupsGetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  65108. reqHeaders := make(http.Header)
  65109. for k, v := range c.header_ {
  65110. reqHeaders[k] = v
  65111. }
  65112. reqHeaders.Set("User-Agent", c.s.userAgent())
  65113. if c.ifNoneMatch_ != "" {
  65114. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  65115. }
  65116. var body io.Reader = nil
  65117. c.urlParams_.Set("alt", alt)
  65118. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/nodeGroups/{resource}/getIamPolicy")
  65119. urls += "?" + c.urlParams_.Encode()
  65120. req, _ := http.NewRequest("GET", urls, body)
  65121. req.Header = reqHeaders
  65122. googleapi.Expand(req.URL, map[string]string{
  65123. "project": c.project,
  65124. "zone": c.zone,
  65125. "resource": c.resource,
  65126. })
  65127. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  65128. }
  65129. // Do executes the "compute.nodeGroups.getIamPolicy" call.
  65130. // Exactly one of *Policy or error will be non-nil. Any non-2xx status
  65131. // code is an error. Response headers are in either
  65132. // *Policy.ServerResponse.Header or (if a response was returned at all)
  65133. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  65134. // check whether the returned error was because http.StatusNotModified
  65135. // was returned.
  65136. func (c *NodeGroupsGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  65137. gensupport.SetOptions(c.urlParams_, opts...)
  65138. res, err := c.doRequest("json")
  65139. if res != nil && res.StatusCode == http.StatusNotModified {
  65140. if res.Body != nil {
  65141. res.Body.Close()
  65142. }
  65143. return nil, &googleapi.Error{
  65144. Code: res.StatusCode,
  65145. Header: res.Header,
  65146. }
  65147. }
  65148. if err != nil {
  65149. return nil, err
  65150. }
  65151. defer googleapi.CloseBody(res)
  65152. if err := googleapi.CheckResponse(res); err != nil {
  65153. return nil, err
  65154. }
  65155. ret := &Policy{
  65156. ServerResponse: googleapi.ServerResponse{
  65157. Header: res.Header,
  65158. HTTPStatusCode: res.StatusCode,
  65159. },
  65160. }
  65161. target := &ret
  65162. if err := gensupport.DecodeResponse(target, res); err != nil {
  65163. return nil, err
  65164. }
  65165. return ret, nil
  65166. // {
  65167. // "description": "Gets the access control policy for a resource. May be empty if no such policy or resource exists.",
  65168. // "httpMethod": "GET",
  65169. // "id": "compute.nodeGroups.getIamPolicy",
  65170. // "parameterOrder": [
  65171. // "project",
  65172. // "zone",
  65173. // "resource"
  65174. // ],
  65175. // "parameters": {
  65176. // "project": {
  65177. // "description": "Project ID for this request.",
  65178. // "location": "path",
  65179. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  65180. // "required": true,
  65181. // "type": "string"
  65182. // },
  65183. // "resource": {
  65184. // "description": "Name of the resource for this request.",
  65185. // "location": "path",
  65186. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  65187. // "required": true,
  65188. // "type": "string"
  65189. // },
  65190. // "zone": {
  65191. // "description": "The name of the zone for this request.",
  65192. // "location": "path",
  65193. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  65194. // "required": true,
  65195. // "type": "string"
  65196. // }
  65197. // },
  65198. // "path": "{project}/zones/{zone}/nodeGroups/{resource}/getIamPolicy",
  65199. // "response": {
  65200. // "$ref": "Policy"
  65201. // },
  65202. // "scopes": [
  65203. // "https://www.googleapis.com/auth/cloud-platform",
  65204. // "https://www.googleapis.com/auth/compute",
  65205. // "https://www.googleapis.com/auth/compute.readonly"
  65206. // ]
  65207. // }
  65208. }
  65209. // method id "compute.nodeGroups.insert":
  65210. type NodeGroupsInsertCall struct {
  65211. s *Service
  65212. project string
  65213. zone string
  65214. nodegroup *NodeGroup
  65215. urlParams_ gensupport.URLParams
  65216. ctx_ context.Context
  65217. header_ http.Header
  65218. }
  65219. // Insert: Creates a NodeGroup resource in the specified project using
  65220. // the data included in the request.
  65221. func (r *NodeGroupsService) Insert(project string, zone string, initialNodeCount int64, nodegroup *NodeGroup) *NodeGroupsInsertCall {
  65222. c := &NodeGroupsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  65223. c.project = project
  65224. c.zone = zone
  65225. c.urlParams_.Set("initialNodeCount", fmt.Sprint(initialNodeCount))
  65226. c.nodegroup = nodegroup
  65227. return c
  65228. }
  65229. // RequestId sets the optional parameter "requestId": An optional
  65230. // request ID to identify requests. Specify a unique request ID so that
  65231. // if you must retry your request, the server will know to ignore the
  65232. // request if it has already been completed.
  65233. //
  65234. // For example, consider a situation where you make an initial request
  65235. // and the request times out. If you make the request again with the
  65236. // same request ID, the server can check if original operation with the
  65237. // same request ID was received, and if so, will ignore the second
  65238. // request. This prevents clients from accidentally creating duplicate
  65239. // commitments.
  65240. //
  65241. // The request ID must be a valid UUID with the exception that zero UUID
  65242. // is not supported (00000000-0000-0000-0000-000000000000).
  65243. func (c *NodeGroupsInsertCall) RequestId(requestId string) *NodeGroupsInsertCall {
  65244. c.urlParams_.Set("requestId", requestId)
  65245. return c
  65246. }
  65247. // Fields allows partial responses to be retrieved. See
  65248. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  65249. // for more information.
  65250. func (c *NodeGroupsInsertCall) Fields(s ...googleapi.Field) *NodeGroupsInsertCall {
  65251. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  65252. return c
  65253. }
  65254. // Context sets the context to be used in this call's Do method. Any
  65255. // pending HTTP request will be aborted if the provided context is
  65256. // canceled.
  65257. func (c *NodeGroupsInsertCall) Context(ctx context.Context) *NodeGroupsInsertCall {
  65258. c.ctx_ = ctx
  65259. return c
  65260. }
  65261. // Header returns an http.Header that can be modified by the caller to
  65262. // add HTTP headers to the request.
  65263. func (c *NodeGroupsInsertCall) Header() http.Header {
  65264. if c.header_ == nil {
  65265. c.header_ = make(http.Header)
  65266. }
  65267. return c.header_
  65268. }
  65269. func (c *NodeGroupsInsertCall) doRequest(alt string) (*http.Response, error) {
  65270. reqHeaders := make(http.Header)
  65271. for k, v := range c.header_ {
  65272. reqHeaders[k] = v
  65273. }
  65274. reqHeaders.Set("User-Agent", c.s.userAgent())
  65275. var body io.Reader = nil
  65276. body, err := googleapi.WithoutDataWrapper.JSONReader(c.nodegroup)
  65277. if err != nil {
  65278. return nil, err
  65279. }
  65280. reqHeaders.Set("Content-Type", "application/json")
  65281. c.urlParams_.Set("alt", alt)
  65282. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/nodeGroups")
  65283. urls += "?" + c.urlParams_.Encode()
  65284. req, _ := http.NewRequest("POST", urls, body)
  65285. req.Header = reqHeaders
  65286. googleapi.Expand(req.URL, map[string]string{
  65287. "project": c.project,
  65288. "zone": c.zone,
  65289. })
  65290. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  65291. }
  65292. // Do executes the "compute.nodeGroups.insert" call.
  65293. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  65294. // status code is an error. Response headers are in either
  65295. // *Operation.ServerResponse.Header or (if a response was returned at
  65296. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  65297. // to check whether the returned error was because
  65298. // http.StatusNotModified was returned.
  65299. func (c *NodeGroupsInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  65300. gensupport.SetOptions(c.urlParams_, opts...)
  65301. res, err := c.doRequest("json")
  65302. if res != nil && res.StatusCode == http.StatusNotModified {
  65303. if res.Body != nil {
  65304. res.Body.Close()
  65305. }
  65306. return nil, &googleapi.Error{
  65307. Code: res.StatusCode,
  65308. Header: res.Header,
  65309. }
  65310. }
  65311. if err != nil {
  65312. return nil, err
  65313. }
  65314. defer googleapi.CloseBody(res)
  65315. if err := googleapi.CheckResponse(res); err != nil {
  65316. return nil, err
  65317. }
  65318. ret := &Operation{
  65319. ServerResponse: googleapi.ServerResponse{
  65320. Header: res.Header,
  65321. HTTPStatusCode: res.StatusCode,
  65322. },
  65323. }
  65324. target := &ret
  65325. if err := gensupport.DecodeResponse(target, res); err != nil {
  65326. return nil, err
  65327. }
  65328. return ret, nil
  65329. // {
  65330. // "description": "Creates a NodeGroup resource in the specified project using the data included in the request.",
  65331. // "httpMethod": "POST",
  65332. // "id": "compute.nodeGroups.insert",
  65333. // "parameterOrder": [
  65334. // "project",
  65335. // "zone",
  65336. // "initialNodeCount"
  65337. // ],
  65338. // "parameters": {
  65339. // "initialNodeCount": {
  65340. // "description": "Initial count of nodes in the node group.",
  65341. // "format": "int32",
  65342. // "location": "query",
  65343. // "required": true,
  65344. // "type": "integer"
  65345. // },
  65346. // "project": {
  65347. // "description": "Project ID for this request.",
  65348. // "location": "path",
  65349. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  65350. // "required": true,
  65351. // "type": "string"
  65352. // },
  65353. // "requestId": {
  65354. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  65355. // "location": "query",
  65356. // "type": "string"
  65357. // },
  65358. // "zone": {
  65359. // "description": "The name of the zone for this request.",
  65360. // "location": "path",
  65361. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  65362. // "required": true,
  65363. // "type": "string"
  65364. // }
  65365. // },
  65366. // "path": "{project}/zones/{zone}/nodeGroups",
  65367. // "request": {
  65368. // "$ref": "NodeGroup"
  65369. // },
  65370. // "response": {
  65371. // "$ref": "Operation"
  65372. // },
  65373. // "scopes": [
  65374. // "https://www.googleapis.com/auth/cloud-platform",
  65375. // "https://www.googleapis.com/auth/compute"
  65376. // ]
  65377. // }
  65378. }
  65379. // method id "compute.nodeGroups.list":
  65380. type NodeGroupsListCall struct {
  65381. s *Service
  65382. project string
  65383. zone string
  65384. urlParams_ gensupport.URLParams
  65385. ifNoneMatch_ string
  65386. ctx_ context.Context
  65387. header_ http.Header
  65388. }
  65389. // List: Retrieves a list of node groups available to the specified
  65390. // project.
  65391. func (r *NodeGroupsService) List(project string, zone string) *NodeGroupsListCall {
  65392. c := &NodeGroupsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  65393. c.project = project
  65394. c.zone = zone
  65395. return c
  65396. }
  65397. // Filter sets the optional parameter "filter": A filter expression that
  65398. // filters resources listed in the response. The expression must specify
  65399. // the field name, a comparison operator, and the value that you want to
  65400. // use for filtering. The value must be a string, a number, or a
  65401. // boolean. The comparison operator must be either =, !=, >, or <.
  65402. //
  65403. // For example, if you are filtering Compute Engine instances, you can
  65404. // exclude instances named example-instance by specifying name !=
  65405. // example-instance.
  65406. //
  65407. // You can also filter nested fields. For example, you could specify
  65408. // scheduling.automaticRestart = false to include instances only if they
  65409. // are not scheduled for automatic restarts. You can use filtering on
  65410. // nested fields to filter based on resource labels.
  65411. //
  65412. // To filter on multiple expressions, provide each separate expression
  65413. // within parentheses. For example, (scheduling.automaticRestart = true)
  65414. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  65415. // AND expression. However, you can include AND and OR expressions
  65416. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  65417. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  65418. // true).
  65419. func (c *NodeGroupsListCall) Filter(filter string) *NodeGroupsListCall {
  65420. c.urlParams_.Set("filter", filter)
  65421. return c
  65422. }
  65423. // MaxResults sets the optional parameter "maxResults": The maximum
  65424. // number of results per page that should be returned. If the number of
  65425. // available results is larger than maxResults, Compute Engine returns a
  65426. // nextPageToken that can be used to get the next page of results in
  65427. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  65428. // (Default: 500)
  65429. func (c *NodeGroupsListCall) MaxResults(maxResults int64) *NodeGroupsListCall {
  65430. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  65431. return c
  65432. }
  65433. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  65434. // a certain order. By default, results are returned in alphanumerical
  65435. // order based on the resource name.
  65436. //
  65437. // You can also sort results in descending order based on the creation
  65438. // timestamp using orderBy="creationTimestamp desc". This sorts results
  65439. // based on the creationTimestamp field in reverse chronological order
  65440. // (newest result first). Use this to sort resources like operations so
  65441. // that the newest operation is returned first.
  65442. //
  65443. // Currently, only sorting by name or creationTimestamp desc is
  65444. // supported.
  65445. func (c *NodeGroupsListCall) OrderBy(orderBy string) *NodeGroupsListCall {
  65446. c.urlParams_.Set("orderBy", orderBy)
  65447. return c
  65448. }
  65449. // PageToken sets the optional parameter "pageToken": Specifies a page
  65450. // token to use. Set pageToken to the nextPageToken returned by a
  65451. // previous list request to get the next page of results.
  65452. func (c *NodeGroupsListCall) PageToken(pageToken string) *NodeGroupsListCall {
  65453. c.urlParams_.Set("pageToken", pageToken)
  65454. return c
  65455. }
  65456. // Fields allows partial responses to be retrieved. See
  65457. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  65458. // for more information.
  65459. func (c *NodeGroupsListCall) Fields(s ...googleapi.Field) *NodeGroupsListCall {
  65460. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  65461. return c
  65462. }
  65463. // IfNoneMatch sets the optional parameter which makes the operation
  65464. // fail if the object's ETag matches the given value. This is useful for
  65465. // getting updates only after the object has changed since the last
  65466. // request. Use googleapi.IsNotModified to check whether the response
  65467. // error from Do is the result of In-None-Match.
  65468. func (c *NodeGroupsListCall) IfNoneMatch(entityTag string) *NodeGroupsListCall {
  65469. c.ifNoneMatch_ = entityTag
  65470. return c
  65471. }
  65472. // Context sets the context to be used in this call's Do method. Any
  65473. // pending HTTP request will be aborted if the provided context is
  65474. // canceled.
  65475. func (c *NodeGroupsListCall) Context(ctx context.Context) *NodeGroupsListCall {
  65476. c.ctx_ = ctx
  65477. return c
  65478. }
  65479. // Header returns an http.Header that can be modified by the caller to
  65480. // add HTTP headers to the request.
  65481. func (c *NodeGroupsListCall) Header() http.Header {
  65482. if c.header_ == nil {
  65483. c.header_ = make(http.Header)
  65484. }
  65485. return c.header_
  65486. }
  65487. func (c *NodeGroupsListCall) doRequest(alt string) (*http.Response, error) {
  65488. reqHeaders := make(http.Header)
  65489. for k, v := range c.header_ {
  65490. reqHeaders[k] = v
  65491. }
  65492. reqHeaders.Set("User-Agent", c.s.userAgent())
  65493. if c.ifNoneMatch_ != "" {
  65494. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  65495. }
  65496. var body io.Reader = nil
  65497. c.urlParams_.Set("alt", alt)
  65498. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/nodeGroups")
  65499. urls += "?" + c.urlParams_.Encode()
  65500. req, _ := http.NewRequest("GET", urls, body)
  65501. req.Header = reqHeaders
  65502. googleapi.Expand(req.URL, map[string]string{
  65503. "project": c.project,
  65504. "zone": c.zone,
  65505. })
  65506. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  65507. }
  65508. // Do executes the "compute.nodeGroups.list" call.
  65509. // Exactly one of *NodeGroupList or error will be non-nil. Any non-2xx
  65510. // status code is an error. Response headers are in either
  65511. // *NodeGroupList.ServerResponse.Header or (if a response was returned
  65512. // at all) in error.(*googleapi.Error).Header. Use
  65513. // googleapi.IsNotModified to check whether the returned error was
  65514. // because http.StatusNotModified was returned.
  65515. func (c *NodeGroupsListCall) Do(opts ...googleapi.CallOption) (*NodeGroupList, error) {
  65516. gensupport.SetOptions(c.urlParams_, opts...)
  65517. res, err := c.doRequest("json")
  65518. if res != nil && res.StatusCode == http.StatusNotModified {
  65519. if res.Body != nil {
  65520. res.Body.Close()
  65521. }
  65522. return nil, &googleapi.Error{
  65523. Code: res.StatusCode,
  65524. Header: res.Header,
  65525. }
  65526. }
  65527. if err != nil {
  65528. return nil, err
  65529. }
  65530. defer googleapi.CloseBody(res)
  65531. if err := googleapi.CheckResponse(res); err != nil {
  65532. return nil, err
  65533. }
  65534. ret := &NodeGroupList{
  65535. ServerResponse: googleapi.ServerResponse{
  65536. Header: res.Header,
  65537. HTTPStatusCode: res.StatusCode,
  65538. },
  65539. }
  65540. target := &ret
  65541. if err := gensupport.DecodeResponse(target, res); err != nil {
  65542. return nil, err
  65543. }
  65544. return ret, nil
  65545. // {
  65546. // "description": "Retrieves a list of node groups available to the specified project.",
  65547. // "httpMethod": "GET",
  65548. // "id": "compute.nodeGroups.list",
  65549. // "parameterOrder": [
  65550. // "project",
  65551. // "zone"
  65552. // ],
  65553. // "parameters": {
  65554. // "filter": {
  65555. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  65556. // "location": "query",
  65557. // "type": "string"
  65558. // },
  65559. // "maxResults": {
  65560. // "default": "500",
  65561. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  65562. // "format": "uint32",
  65563. // "location": "query",
  65564. // "minimum": "0",
  65565. // "type": "integer"
  65566. // },
  65567. // "orderBy": {
  65568. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  65569. // "location": "query",
  65570. // "type": "string"
  65571. // },
  65572. // "pageToken": {
  65573. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  65574. // "location": "query",
  65575. // "type": "string"
  65576. // },
  65577. // "project": {
  65578. // "description": "Project ID for this request.",
  65579. // "location": "path",
  65580. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  65581. // "required": true,
  65582. // "type": "string"
  65583. // },
  65584. // "zone": {
  65585. // "description": "The name of the zone for this request.",
  65586. // "location": "path",
  65587. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  65588. // "required": true,
  65589. // "type": "string"
  65590. // }
  65591. // },
  65592. // "path": "{project}/zones/{zone}/nodeGroups",
  65593. // "response": {
  65594. // "$ref": "NodeGroupList"
  65595. // },
  65596. // "scopes": [
  65597. // "https://www.googleapis.com/auth/cloud-platform",
  65598. // "https://www.googleapis.com/auth/compute",
  65599. // "https://www.googleapis.com/auth/compute.readonly"
  65600. // ]
  65601. // }
  65602. }
  65603. // Pages invokes f for each page of results.
  65604. // A non-nil error returned from f will halt the iteration.
  65605. // The provided context supersedes any context provided to the Context method.
  65606. func (c *NodeGroupsListCall) Pages(ctx context.Context, f func(*NodeGroupList) error) error {
  65607. c.ctx_ = ctx
  65608. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  65609. for {
  65610. x, err := c.Do()
  65611. if err != nil {
  65612. return err
  65613. }
  65614. if err := f(x); err != nil {
  65615. return err
  65616. }
  65617. if x.NextPageToken == "" {
  65618. return nil
  65619. }
  65620. c.PageToken(x.NextPageToken)
  65621. }
  65622. }
  65623. // method id "compute.nodeGroups.setIamPolicy":
  65624. type NodeGroupsSetIamPolicyCall struct {
  65625. s *Service
  65626. project string
  65627. zone string
  65628. resource string
  65629. zonesetpolicyrequest *ZoneSetPolicyRequest
  65630. urlParams_ gensupport.URLParams
  65631. ctx_ context.Context
  65632. header_ http.Header
  65633. }
  65634. // SetIamPolicy: Sets the access control policy on the specified
  65635. // resource. Replaces any existing policy.
  65636. func (r *NodeGroupsService) SetIamPolicy(project string, zone string, resource string, zonesetpolicyrequest *ZoneSetPolicyRequest) *NodeGroupsSetIamPolicyCall {
  65637. c := &NodeGroupsSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  65638. c.project = project
  65639. c.zone = zone
  65640. c.resource = resource
  65641. c.zonesetpolicyrequest = zonesetpolicyrequest
  65642. return c
  65643. }
  65644. // Fields allows partial responses to be retrieved. See
  65645. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  65646. // for more information.
  65647. func (c *NodeGroupsSetIamPolicyCall) Fields(s ...googleapi.Field) *NodeGroupsSetIamPolicyCall {
  65648. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  65649. return c
  65650. }
  65651. // Context sets the context to be used in this call's Do method. Any
  65652. // pending HTTP request will be aborted if the provided context is
  65653. // canceled.
  65654. func (c *NodeGroupsSetIamPolicyCall) Context(ctx context.Context) *NodeGroupsSetIamPolicyCall {
  65655. c.ctx_ = ctx
  65656. return c
  65657. }
  65658. // Header returns an http.Header that can be modified by the caller to
  65659. // add HTTP headers to the request.
  65660. func (c *NodeGroupsSetIamPolicyCall) Header() http.Header {
  65661. if c.header_ == nil {
  65662. c.header_ = make(http.Header)
  65663. }
  65664. return c.header_
  65665. }
  65666. func (c *NodeGroupsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  65667. reqHeaders := make(http.Header)
  65668. for k, v := range c.header_ {
  65669. reqHeaders[k] = v
  65670. }
  65671. reqHeaders.Set("User-Agent", c.s.userAgent())
  65672. var body io.Reader = nil
  65673. body, err := googleapi.WithoutDataWrapper.JSONReader(c.zonesetpolicyrequest)
  65674. if err != nil {
  65675. return nil, err
  65676. }
  65677. reqHeaders.Set("Content-Type", "application/json")
  65678. c.urlParams_.Set("alt", alt)
  65679. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/nodeGroups/{resource}/setIamPolicy")
  65680. urls += "?" + c.urlParams_.Encode()
  65681. req, _ := http.NewRequest("POST", urls, body)
  65682. req.Header = reqHeaders
  65683. googleapi.Expand(req.URL, map[string]string{
  65684. "project": c.project,
  65685. "zone": c.zone,
  65686. "resource": c.resource,
  65687. })
  65688. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  65689. }
  65690. // Do executes the "compute.nodeGroups.setIamPolicy" call.
  65691. // Exactly one of *Policy or error will be non-nil. Any non-2xx status
  65692. // code is an error. Response headers are in either
  65693. // *Policy.ServerResponse.Header or (if a response was returned at all)
  65694. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  65695. // check whether the returned error was because http.StatusNotModified
  65696. // was returned.
  65697. func (c *NodeGroupsSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  65698. gensupport.SetOptions(c.urlParams_, opts...)
  65699. res, err := c.doRequest("json")
  65700. if res != nil && res.StatusCode == http.StatusNotModified {
  65701. if res.Body != nil {
  65702. res.Body.Close()
  65703. }
  65704. return nil, &googleapi.Error{
  65705. Code: res.StatusCode,
  65706. Header: res.Header,
  65707. }
  65708. }
  65709. if err != nil {
  65710. return nil, err
  65711. }
  65712. defer googleapi.CloseBody(res)
  65713. if err := googleapi.CheckResponse(res); err != nil {
  65714. return nil, err
  65715. }
  65716. ret := &Policy{
  65717. ServerResponse: googleapi.ServerResponse{
  65718. Header: res.Header,
  65719. HTTPStatusCode: res.StatusCode,
  65720. },
  65721. }
  65722. target := &ret
  65723. if err := gensupport.DecodeResponse(target, res); err != nil {
  65724. return nil, err
  65725. }
  65726. return ret, nil
  65727. // {
  65728. // "description": "Sets the access control policy on the specified resource. Replaces any existing policy.",
  65729. // "httpMethod": "POST",
  65730. // "id": "compute.nodeGroups.setIamPolicy",
  65731. // "parameterOrder": [
  65732. // "project",
  65733. // "zone",
  65734. // "resource"
  65735. // ],
  65736. // "parameters": {
  65737. // "project": {
  65738. // "description": "Project ID for this request.",
  65739. // "location": "path",
  65740. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  65741. // "required": true,
  65742. // "type": "string"
  65743. // },
  65744. // "resource": {
  65745. // "description": "Name of the resource for this request.",
  65746. // "location": "path",
  65747. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  65748. // "required": true,
  65749. // "type": "string"
  65750. // },
  65751. // "zone": {
  65752. // "description": "The name of the zone for this request.",
  65753. // "location": "path",
  65754. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  65755. // "required": true,
  65756. // "type": "string"
  65757. // }
  65758. // },
  65759. // "path": "{project}/zones/{zone}/nodeGroups/{resource}/setIamPolicy",
  65760. // "request": {
  65761. // "$ref": "ZoneSetPolicyRequest"
  65762. // },
  65763. // "response": {
  65764. // "$ref": "Policy"
  65765. // },
  65766. // "scopes": [
  65767. // "https://www.googleapis.com/auth/cloud-platform",
  65768. // "https://www.googleapis.com/auth/compute"
  65769. // ]
  65770. // }
  65771. }
  65772. // method id "compute.nodeGroups.setNodeTemplate":
  65773. type NodeGroupsSetNodeTemplateCall struct {
  65774. s *Service
  65775. project string
  65776. zone string
  65777. nodeGroup string
  65778. nodegroupssetnodetemplaterequest *NodeGroupsSetNodeTemplateRequest
  65779. urlParams_ gensupport.URLParams
  65780. ctx_ context.Context
  65781. header_ http.Header
  65782. }
  65783. // SetNodeTemplate: Updates the node template of the node group.
  65784. func (r *NodeGroupsService) SetNodeTemplate(project string, zone string, nodeGroup string, nodegroupssetnodetemplaterequest *NodeGroupsSetNodeTemplateRequest) *NodeGroupsSetNodeTemplateCall {
  65785. c := &NodeGroupsSetNodeTemplateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  65786. c.project = project
  65787. c.zone = zone
  65788. c.nodeGroup = nodeGroup
  65789. c.nodegroupssetnodetemplaterequest = nodegroupssetnodetemplaterequest
  65790. return c
  65791. }
  65792. // RequestId sets the optional parameter "requestId": An optional
  65793. // request ID to identify requests. Specify a unique request ID so that
  65794. // if you must retry your request, the server will know to ignore the
  65795. // request if it has already been completed.
  65796. //
  65797. // For example, consider a situation where you make an initial request
  65798. // and the request times out. If you make the request again with the
  65799. // same request ID, the server can check if original operation with the
  65800. // same request ID was received, and if so, will ignore the second
  65801. // request. This prevents clients from accidentally creating duplicate
  65802. // commitments.
  65803. //
  65804. // The request ID must be a valid UUID with the exception that zero UUID
  65805. // is not supported (00000000-0000-0000-0000-000000000000).
  65806. func (c *NodeGroupsSetNodeTemplateCall) RequestId(requestId string) *NodeGroupsSetNodeTemplateCall {
  65807. c.urlParams_.Set("requestId", requestId)
  65808. return c
  65809. }
  65810. // Fields allows partial responses to be retrieved. See
  65811. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  65812. // for more information.
  65813. func (c *NodeGroupsSetNodeTemplateCall) Fields(s ...googleapi.Field) *NodeGroupsSetNodeTemplateCall {
  65814. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  65815. return c
  65816. }
  65817. // Context sets the context to be used in this call's Do method. Any
  65818. // pending HTTP request will be aborted if the provided context is
  65819. // canceled.
  65820. func (c *NodeGroupsSetNodeTemplateCall) Context(ctx context.Context) *NodeGroupsSetNodeTemplateCall {
  65821. c.ctx_ = ctx
  65822. return c
  65823. }
  65824. // Header returns an http.Header that can be modified by the caller to
  65825. // add HTTP headers to the request.
  65826. func (c *NodeGroupsSetNodeTemplateCall) Header() http.Header {
  65827. if c.header_ == nil {
  65828. c.header_ = make(http.Header)
  65829. }
  65830. return c.header_
  65831. }
  65832. func (c *NodeGroupsSetNodeTemplateCall) doRequest(alt string) (*http.Response, error) {
  65833. reqHeaders := make(http.Header)
  65834. for k, v := range c.header_ {
  65835. reqHeaders[k] = v
  65836. }
  65837. reqHeaders.Set("User-Agent", c.s.userAgent())
  65838. var body io.Reader = nil
  65839. body, err := googleapi.WithoutDataWrapper.JSONReader(c.nodegroupssetnodetemplaterequest)
  65840. if err != nil {
  65841. return nil, err
  65842. }
  65843. reqHeaders.Set("Content-Type", "application/json")
  65844. c.urlParams_.Set("alt", alt)
  65845. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/nodeGroups/{nodeGroup}/setNodeTemplate")
  65846. urls += "?" + c.urlParams_.Encode()
  65847. req, _ := http.NewRequest("POST", urls, body)
  65848. req.Header = reqHeaders
  65849. googleapi.Expand(req.URL, map[string]string{
  65850. "project": c.project,
  65851. "zone": c.zone,
  65852. "nodeGroup": c.nodeGroup,
  65853. })
  65854. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  65855. }
  65856. // Do executes the "compute.nodeGroups.setNodeTemplate" call.
  65857. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  65858. // status code is an error. Response headers are in either
  65859. // *Operation.ServerResponse.Header or (if a response was returned at
  65860. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  65861. // to check whether the returned error was because
  65862. // http.StatusNotModified was returned.
  65863. func (c *NodeGroupsSetNodeTemplateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  65864. gensupport.SetOptions(c.urlParams_, opts...)
  65865. res, err := c.doRequest("json")
  65866. if res != nil && res.StatusCode == http.StatusNotModified {
  65867. if res.Body != nil {
  65868. res.Body.Close()
  65869. }
  65870. return nil, &googleapi.Error{
  65871. Code: res.StatusCode,
  65872. Header: res.Header,
  65873. }
  65874. }
  65875. if err != nil {
  65876. return nil, err
  65877. }
  65878. defer googleapi.CloseBody(res)
  65879. if err := googleapi.CheckResponse(res); err != nil {
  65880. return nil, err
  65881. }
  65882. ret := &Operation{
  65883. ServerResponse: googleapi.ServerResponse{
  65884. Header: res.Header,
  65885. HTTPStatusCode: res.StatusCode,
  65886. },
  65887. }
  65888. target := &ret
  65889. if err := gensupport.DecodeResponse(target, res); err != nil {
  65890. return nil, err
  65891. }
  65892. return ret, nil
  65893. // {
  65894. // "description": "Updates the node template of the node group.",
  65895. // "httpMethod": "POST",
  65896. // "id": "compute.nodeGroups.setNodeTemplate",
  65897. // "parameterOrder": [
  65898. // "project",
  65899. // "zone",
  65900. // "nodeGroup"
  65901. // ],
  65902. // "parameters": {
  65903. // "nodeGroup": {
  65904. // "description": "Name of the NodeGroup resource to delete.",
  65905. // "location": "path",
  65906. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  65907. // "required": true,
  65908. // "type": "string"
  65909. // },
  65910. // "project": {
  65911. // "description": "Project ID for this request.",
  65912. // "location": "path",
  65913. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  65914. // "required": true,
  65915. // "type": "string"
  65916. // },
  65917. // "requestId": {
  65918. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  65919. // "location": "query",
  65920. // "type": "string"
  65921. // },
  65922. // "zone": {
  65923. // "description": "The name of the zone for this request.",
  65924. // "location": "path",
  65925. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  65926. // "required": true,
  65927. // "type": "string"
  65928. // }
  65929. // },
  65930. // "path": "{project}/zones/{zone}/nodeGroups/{nodeGroup}/setNodeTemplate",
  65931. // "request": {
  65932. // "$ref": "NodeGroupsSetNodeTemplateRequest"
  65933. // },
  65934. // "response": {
  65935. // "$ref": "Operation"
  65936. // },
  65937. // "scopes": [
  65938. // "https://www.googleapis.com/auth/cloud-platform",
  65939. // "https://www.googleapis.com/auth/compute"
  65940. // ]
  65941. // }
  65942. }
  65943. // method id "compute.nodeGroups.testIamPermissions":
  65944. type NodeGroupsTestIamPermissionsCall struct {
  65945. s *Service
  65946. project string
  65947. zone string
  65948. resource string
  65949. testpermissionsrequest *TestPermissionsRequest
  65950. urlParams_ gensupport.URLParams
  65951. ctx_ context.Context
  65952. header_ http.Header
  65953. }
  65954. // TestIamPermissions: Returns permissions that a caller has on the
  65955. // specified resource.
  65956. func (r *NodeGroupsService) TestIamPermissions(project string, zone string, resource string, testpermissionsrequest *TestPermissionsRequest) *NodeGroupsTestIamPermissionsCall {
  65957. c := &NodeGroupsTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  65958. c.project = project
  65959. c.zone = zone
  65960. c.resource = resource
  65961. c.testpermissionsrequest = testpermissionsrequest
  65962. return c
  65963. }
  65964. // Fields allows partial responses to be retrieved. See
  65965. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  65966. // for more information.
  65967. func (c *NodeGroupsTestIamPermissionsCall) Fields(s ...googleapi.Field) *NodeGroupsTestIamPermissionsCall {
  65968. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  65969. return c
  65970. }
  65971. // Context sets the context to be used in this call's Do method. Any
  65972. // pending HTTP request will be aborted if the provided context is
  65973. // canceled.
  65974. func (c *NodeGroupsTestIamPermissionsCall) Context(ctx context.Context) *NodeGroupsTestIamPermissionsCall {
  65975. c.ctx_ = ctx
  65976. return c
  65977. }
  65978. // Header returns an http.Header that can be modified by the caller to
  65979. // add HTTP headers to the request.
  65980. func (c *NodeGroupsTestIamPermissionsCall) Header() http.Header {
  65981. if c.header_ == nil {
  65982. c.header_ = make(http.Header)
  65983. }
  65984. return c.header_
  65985. }
  65986. func (c *NodeGroupsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  65987. reqHeaders := make(http.Header)
  65988. for k, v := range c.header_ {
  65989. reqHeaders[k] = v
  65990. }
  65991. reqHeaders.Set("User-Agent", c.s.userAgent())
  65992. var body io.Reader = nil
  65993. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  65994. if err != nil {
  65995. return nil, err
  65996. }
  65997. reqHeaders.Set("Content-Type", "application/json")
  65998. c.urlParams_.Set("alt", alt)
  65999. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/nodeGroups/{resource}/testIamPermissions")
  66000. urls += "?" + c.urlParams_.Encode()
  66001. req, _ := http.NewRequest("POST", urls, body)
  66002. req.Header = reqHeaders
  66003. googleapi.Expand(req.URL, map[string]string{
  66004. "project": c.project,
  66005. "zone": c.zone,
  66006. "resource": c.resource,
  66007. })
  66008. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  66009. }
  66010. // Do executes the "compute.nodeGroups.testIamPermissions" call.
  66011. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  66012. // non-2xx status code is an error. Response headers are in either
  66013. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  66014. // returned at all) in error.(*googleapi.Error).Header. Use
  66015. // googleapi.IsNotModified to check whether the returned error was
  66016. // because http.StatusNotModified was returned.
  66017. func (c *NodeGroupsTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  66018. gensupport.SetOptions(c.urlParams_, opts...)
  66019. res, err := c.doRequest("json")
  66020. if res != nil && res.StatusCode == http.StatusNotModified {
  66021. if res.Body != nil {
  66022. res.Body.Close()
  66023. }
  66024. return nil, &googleapi.Error{
  66025. Code: res.StatusCode,
  66026. Header: res.Header,
  66027. }
  66028. }
  66029. if err != nil {
  66030. return nil, err
  66031. }
  66032. defer googleapi.CloseBody(res)
  66033. if err := googleapi.CheckResponse(res); err != nil {
  66034. return nil, err
  66035. }
  66036. ret := &TestPermissionsResponse{
  66037. ServerResponse: googleapi.ServerResponse{
  66038. Header: res.Header,
  66039. HTTPStatusCode: res.StatusCode,
  66040. },
  66041. }
  66042. target := &ret
  66043. if err := gensupport.DecodeResponse(target, res); err != nil {
  66044. return nil, err
  66045. }
  66046. return ret, nil
  66047. // {
  66048. // "description": "Returns permissions that a caller has on the specified resource.",
  66049. // "httpMethod": "POST",
  66050. // "id": "compute.nodeGroups.testIamPermissions",
  66051. // "parameterOrder": [
  66052. // "project",
  66053. // "zone",
  66054. // "resource"
  66055. // ],
  66056. // "parameters": {
  66057. // "project": {
  66058. // "description": "Project ID for this request.",
  66059. // "location": "path",
  66060. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  66061. // "required": true,
  66062. // "type": "string"
  66063. // },
  66064. // "resource": {
  66065. // "description": "Name of the resource for this request.",
  66066. // "location": "path",
  66067. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  66068. // "required": true,
  66069. // "type": "string"
  66070. // },
  66071. // "zone": {
  66072. // "description": "The name of the zone for this request.",
  66073. // "location": "path",
  66074. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  66075. // "required": true,
  66076. // "type": "string"
  66077. // }
  66078. // },
  66079. // "path": "{project}/zones/{zone}/nodeGroups/{resource}/testIamPermissions",
  66080. // "request": {
  66081. // "$ref": "TestPermissionsRequest"
  66082. // },
  66083. // "response": {
  66084. // "$ref": "TestPermissionsResponse"
  66085. // },
  66086. // "scopes": [
  66087. // "https://www.googleapis.com/auth/cloud-platform",
  66088. // "https://www.googleapis.com/auth/compute",
  66089. // "https://www.googleapis.com/auth/compute.readonly"
  66090. // ]
  66091. // }
  66092. }
  66093. // method id "compute.nodeTemplates.aggregatedList":
  66094. type NodeTemplatesAggregatedListCall struct {
  66095. s *Service
  66096. project string
  66097. urlParams_ gensupport.URLParams
  66098. ifNoneMatch_ string
  66099. ctx_ context.Context
  66100. header_ http.Header
  66101. }
  66102. // AggregatedList: Retrieves an aggregated list of node templates.
  66103. func (r *NodeTemplatesService) AggregatedList(project string) *NodeTemplatesAggregatedListCall {
  66104. c := &NodeTemplatesAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  66105. c.project = project
  66106. return c
  66107. }
  66108. // Filter sets the optional parameter "filter": A filter expression that
  66109. // filters resources listed in the response. The expression must specify
  66110. // the field name, a comparison operator, and the value that you want to
  66111. // use for filtering. The value must be a string, a number, or a
  66112. // boolean. The comparison operator must be either =, !=, >, or <.
  66113. //
  66114. // For example, if you are filtering Compute Engine instances, you can
  66115. // exclude instances named example-instance by specifying name !=
  66116. // example-instance.
  66117. //
  66118. // You can also filter nested fields. For example, you could specify
  66119. // scheduling.automaticRestart = false to include instances only if they
  66120. // are not scheduled for automatic restarts. You can use filtering on
  66121. // nested fields to filter based on resource labels.
  66122. //
  66123. // To filter on multiple expressions, provide each separate expression
  66124. // within parentheses. For example, (scheduling.automaticRestart = true)
  66125. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  66126. // AND expression. However, you can include AND and OR expressions
  66127. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  66128. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  66129. // true).
  66130. func (c *NodeTemplatesAggregatedListCall) Filter(filter string) *NodeTemplatesAggregatedListCall {
  66131. c.urlParams_.Set("filter", filter)
  66132. return c
  66133. }
  66134. // MaxResults sets the optional parameter "maxResults": The maximum
  66135. // number of results per page that should be returned. If the number of
  66136. // available results is larger than maxResults, Compute Engine returns a
  66137. // nextPageToken that can be used to get the next page of results in
  66138. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  66139. // (Default: 500)
  66140. func (c *NodeTemplatesAggregatedListCall) MaxResults(maxResults int64) *NodeTemplatesAggregatedListCall {
  66141. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  66142. return c
  66143. }
  66144. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  66145. // a certain order. By default, results are returned in alphanumerical
  66146. // order based on the resource name.
  66147. //
  66148. // You can also sort results in descending order based on the creation
  66149. // timestamp using orderBy="creationTimestamp desc". This sorts results
  66150. // based on the creationTimestamp field in reverse chronological order
  66151. // (newest result first). Use this to sort resources like operations so
  66152. // that the newest operation is returned first.
  66153. //
  66154. // Currently, only sorting by name or creationTimestamp desc is
  66155. // supported.
  66156. func (c *NodeTemplatesAggregatedListCall) OrderBy(orderBy string) *NodeTemplatesAggregatedListCall {
  66157. c.urlParams_.Set("orderBy", orderBy)
  66158. return c
  66159. }
  66160. // PageToken sets the optional parameter "pageToken": Specifies a page
  66161. // token to use. Set pageToken to the nextPageToken returned by a
  66162. // previous list request to get the next page of results.
  66163. func (c *NodeTemplatesAggregatedListCall) PageToken(pageToken string) *NodeTemplatesAggregatedListCall {
  66164. c.urlParams_.Set("pageToken", pageToken)
  66165. return c
  66166. }
  66167. // Fields allows partial responses to be retrieved. See
  66168. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  66169. // for more information.
  66170. func (c *NodeTemplatesAggregatedListCall) Fields(s ...googleapi.Field) *NodeTemplatesAggregatedListCall {
  66171. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  66172. return c
  66173. }
  66174. // IfNoneMatch sets the optional parameter which makes the operation
  66175. // fail if the object's ETag matches the given value. This is useful for
  66176. // getting updates only after the object has changed since the last
  66177. // request. Use googleapi.IsNotModified to check whether the response
  66178. // error from Do is the result of In-None-Match.
  66179. func (c *NodeTemplatesAggregatedListCall) IfNoneMatch(entityTag string) *NodeTemplatesAggregatedListCall {
  66180. c.ifNoneMatch_ = entityTag
  66181. return c
  66182. }
  66183. // Context sets the context to be used in this call's Do method. Any
  66184. // pending HTTP request will be aborted if the provided context is
  66185. // canceled.
  66186. func (c *NodeTemplatesAggregatedListCall) Context(ctx context.Context) *NodeTemplatesAggregatedListCall {
  66187. c.ctx_ = ctx
  66188. return c
  66189. }
  66190. // Header returns an http.Header that can be modified by the caller to
  66191. // add HTTP headers to the request.
  66192. func (c *NodeTemplatesAggregatedListCall) Header() http.Header {
  66193. if c.header_ == nil {
  66194. c.header_ = make(http.Header)
  66195. }
  66196. return c.header_
  66197. }
  66198. func (c *NodeTemplatesAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  66199. reqHeaders := make(http.Header)
  66200. for k, v := range c.header_ {
  66201. reqHeaders[k] = v
  66202. }
  66203. reqHeaders.Set("User-Agent", c.s.userAgent())
  66204. if c.ifNoneMatch_ != "" {
  66205. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  66206. }
  66207. var body io.Reader = nil
  66208. c.urlParams_.Set("alt", alt)
  66209. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/nodeTemplates")
  66210. urls += "?" + c.urlParams_.Encode()
  66211. req, _ := http.NewRequest("GET", urls, body)
  66212. req.Header = reqHeaders
  66213. googleapi.Expand(req.URL, map[string]string{
  66214. "project": c.project,
  66215. })
  66216. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  66217. }
  66218. // Do executes the "compute.nodeTemplates.aggregatedList" call.
  66219. // Exactly one of *NodeTemplateAggregatedList or error will be non-nil.
  66220. // Any non-2xx status code is an error. Response headers are in either
  66221. // *NodeTemplateAggregatedList.ServerResponse.Header or (if a response
  66222. // was returned at all) in error.(*googleapi.Error).Header. Use
  66223. // googleapi.IsNotModified to check whether the returned error was
  66224. // because http.StatusNotModified was returned.
  66225. func (c *NodeTemplatesAggregatedListCall) Do(opts ...googleapi.CallOption) (*NodeTemplateAggregatedList, error) {
  66226. gensupport.SetOptions(c.urlParams_, opts...)
  66227. res, err := c.doRequest("json")
  66228. if res != nil && res.StatusCode == http.StatusNotModified {
  66229. if res.Body != nil {
  66230. res.Body.Close()
  66231. }
  66232. return nil, &googleapi.Error{
  66233. Code: res.StatusCode,
  66234. Header: res.Header,
  66235. }
  66236. }
  66237. if err != nil {
  66238. return nil, err
  66239. }
  66240. defer googleapi.CloseBody(res)
  66241. if err := googleapi.CheckResponse(res); err != nil {
  66242. return nil, err
  66243. }
  66244. ret := &NodeTemplateAggregatedList{
  66245. ServerResponse: googleapi.ServerResponse{
  66246. Header: res.Header,
  66247. HTTPStatusCode: res.StatusCode,
  66248. },
  66249. }
  66250. target := &ret
  66251. if err := gensupport.DecodeResponse(target, res); err != nil {
  66252. return nil, err
  66253. }
  66254. return ret, nil
  66255. // {
  66256. // "description": "Retrieves an aggregated list of node templates.",
  66257. // "httpMethod": "GET",
  66258. // "id": "compute.nodeTemplates.aggregatedList",
  66259. // "parameterOrder": [
  66260. // "project"
  66261. // ],
  66262. // "parameters": {
  66263. // "filter": {
  66264. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  66265. // "location": "query",
  66266. // "type": "string"
  66267. // },
  66268. // "maxResults": {
  66269. // "default": "500",
  66270. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  66271. // "format": "uint32",
  66272. // "location": "query",
  66273. // "minimum": "0",
  66274. // "type": "integer"
  66275. // },
  66276. // "orderBy": {
  66277. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  66278. // "location": "query",
  66279. // "type": "string"
  66280. // },
  66281. // "pageToken": {
  66282. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  66283. // "location": "query",
  66284. // "type": "string"
  66285. // },
  66286. // "project": {
  66287. // "description": "Project ID for this request.",
  66288. // "location": "path",
  66289. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  66290. // "required": true,
  66291. // "type": "string"
  66292. // }
  66293. // },
  66294. // "path": "{project}/aggregated/nodeTemplates",
  66295. // "response": {
  66296. // "$ref": "NodeTemplateAggregatedList"
  66297. // },
  66298. // "scopes": [
  66299. // "https://www.googleapis.com/auth/cloud-platform",
  66300. // "https://www.googleapis.com/auth/compute",
  66301. // "https://www.googleapis.com/auth/compute.readonly"
  66302. // ]
  66303. // }
  66304. }
  66305. // Pages invokes f for each page of results.
  66306. // A non-nil error returned from f will halt the iteration.
  66307. // The provided context supersedes any context provided to the Context method.
  66308. func (c *NodeTemplatesAggregatedListCall) Pages(ctx context.Context, f func(*NodeTemplateAggregatedList) error) error {
  66309. c.ctx_ = ctx
  66310. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  66311. for {
  66312. x, err := c.Do()
  66313. if err != nil {
  66314. return err
  66315. }
  66316. if err := f(x); err != nil {
  66317. return err
  66318. }
  66319. if x.NextPageToken == "" {
  66320. return nil
  66321. }
  66322. c.PageToken(x.NextPageToken)
  66323. }
  66324. }
  66325. // method id "compute.nodeTemplates.delete":
  66326. type NodeTemplatesDeleteCall struct {
  66327. s *Service
  66328. project string
  66329. region string
  66330. nodeTemplate string
  66331. urlParams_ gensupport.URLParams
  66332. ctx_ context.Context
  66333. header_ http.Header
  66334. }
  66335. // Delete: Deletes the specified NodeTemplate resource.
  66336. func (r *NodeTemplatesService) Delete(project string, region string, nodeTemplate string) *NodeTemplatesDeleteCall {
  66337. c := &NodeTemplatesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  66338. c.project = project
  66339. c.region = region
  66340. c.nodeTemplate = nodeTemplate
  66341. return c
  66342. }
  66343. // RequestId sets the optional parameter "requestId": An optional
  66344. // request ID to identify requests. Specify a unique request ID so that
  66345. // if you must retry your request, the server will know to ignore the
  66346. // request if it has already been completed.
  66347. //
  66348. // For example, consider a situation where you make an initial request
  66349. // and the request times out. If you make the request again with the
  66350. // same request ID, the server can check if original operation with the
  66351. // same request ID was received, and if so, will ignore the second
  66352. // request. This prevents clients from accidentally creating duplicate
  66353. // commitments.
  66354. //
  66355. // The request ID must be a valid UUID with the exception that zero UUID
  66356. // is not supported (00000000-0000-0000-0000-000000000000).
  66357. func (c *NodeTemplatesDeleteCall) RequestId(requestId string) *NodeTemplatesDeleteCall {
  66358. c.urlParams_.Set("requestId", requestId)
  66359. return c
  66360. }
  66361. // Fields allows partial responses to be retrieved. See
  66362. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  66363. // for more information.
  66364. func (c *NodeTemplatesDeleteCall) Fields(s ...googleapi.Field) *NodeTemplatesDeleteCall {
  66365. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  66366. return c
  66367. }
  66368. // Context sets the context to be used in this call's Do method. Any
  66369. // pending HTTP request will be aborted if the provided context is
  66370. // canceled.
  66371. func (c *NodeTemplatesDeleteCall) Context(ctx context.Context) *NodeTemplatesDeleteCall {
  66372. c.ctx_ = ctx
  66373. return c
  66374. }
  66375. // Header returns an http.Header that can be modified by the caller to
  66376. // add HTTP headers to the request.
  66377. func (c *NodeTemplatesDeleteCall) Header() http.Header {
  66378. if c.header_ == nil {
  66379. c.header_ = make(http.Header)
  66380. }
  66381. return c.header_
  66382. }
  66383. func (c *NodeTemplatesDeleteCall) doRequest(alt string) (*http.Response, error) {
  66384. reqHeaders := make(http.Header)
  66385. for k, v := range c.header_ {
  66386. reqHeaders[k] = v
  66387. }
  66388. reqHeaders.Set("User-Agent", c.s.userAgent())
  66389. var body io.Reader = nil
  66390. c.urlParams_.Set("alt", alt)
  66391. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/nodeTemplates/{nodeTemplate}")
  66392. urls += "?" + c.urlParams_.Encode()
  66393. req, _ := http.NewRequest("DELETE", urls, body)
  66394. req.Header = reqHeaders
  66395. googleapi.Expand(req.URL, map[string]string{
  66396. "project": c.project,
  66397. "region": c.region,
  66398. "nodeTemplate": c.nodeTemplate,
  66399. })
  66400. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  66401. }
  66402. // Do executes the "compute.nodeTemplates.delete" call.
  66403. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  66404. // status code is an error. Response headers are in either
  66405. // *Operation.ServerResponse.Header or (if a response was returned at
  66406. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  66407. // to check whether the returned error was because
  66408. // http.StatusNotModified was returned.
  66409. func (c *NodeTemplatesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  66410. gensupport.SetOptions(c.urlParams_, opts...)
  66411. res, err := c.doRequest("json")
  66412. if res != nil && res.StatusCode == http.StatusNotModified {
  66413. if res.Body != nil {
  66414. res.Body.Close()
  66415. }
  66416. return nil, &googleapi.Error{
  66417. Code: res.StatusCode,
  66418. Header: res.Header,
  66419. }
  66420. }
  66421. if err != nil {
  66422. return nil, err
  66423. }
  66424. defer googleapi.CloseBody(res)
  66425. if err := googleapi.CheckResponse(res); err != nil {
  66426. return nil, err
  66427. }
  66428. ret := &Operation{
  66429. ServerResponse: googleapi.ServerResponse{
  66430. Header: res.Header,
  66431. HTTPStatusCode: res.StatusCode,
  66432. },
  66433. }
  66434. target := &ret
  66435. if err := gensupport.DecodeResponse(target, res); err != nil {
  66436. return nil, err
  66437. }
  66438. return ret, nil
  66439. // {
  66440. // "description": "Deletes the specified NodeTemplate resource.",
  66441. // "httpMethod": "DELETE",
  66442. // "id": "compute.nodeTemplates.delete",
  66443. // "parameterOrder": [
  66444. // "project",
  66445. // "region",
  66446. // "nodeTemplate"
  66447. // ],
  66448. // "parameters": {
  66449. // "nodeTemplate": {
  66450. // "description": "Name of the NodeTemplate resource to delete.",
  66451. // "location": "path",
  66452. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  66453. // "required": true,
  66454. // "type": "string"
  66455. // },
  66456. // "project": {
  66457. // "description": "Project ID for this request.",
  66458. // "location": "path",
  66459. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  66460. // "required": true,
  66461. // "type": "string"
  66462. // },
  66463. // "region": {
  66464. // "description": "The name of the region for this request.",
  66465. // "location": "path",
  66466. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  66467. // "required": true,
  66468. // "type": "string"
  66469. // },
  66470. // "requestId": {
  66471. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  66472. // "location": "query",
  66473. // "type": "string"
  66474. // }
  66475. // },
  66476. // "path": "{project}/regions/{region}/nodeTemplates/{nodeTemplate}",
  66477. // "response": {
  66478. // "$ref": "Operation"
  66479. // },
  66480. // "scopes": [
  66481. // "https://www.googleapis.com/auth/cloud-platform",
  66482. // "https://www.googleapis.com/auth/compute"
  66483. // ]
  66484. // }
  66485. }
  66486. // method id "compute.nodeTemplates.get":
  66487. type NodeTemplatesGetCall struct {
  66488. s *Service
  66489. project string
  66490. region string
  66491. nodeTemplate string
  66492. urlParams_ gensupport.URLParams
  66493. ifNoneMatch_ string
  66494. ctx_ context.Context
  66495. header_ http.Header
  66496. }
  66497. // Get: Returns the specified node template. Gets a list of available
  66498. // node templates by making a list() request.
  66499. func (r *NodeTemplatesService) Get(project string, region string, nodeTemplate string) *NodeTemplatesGetCall {
  66500. c := &NodeTemplatesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  66501. c.project = project
  66502. c.region = region
  66503. c.nodeTemplate = nodeTemplate
  66504. return c
  66505. }
  66506. // Fields allows partial responses to be retrieved. See
  66507. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  66508. // for more information.
  66509. func (c *NodeTemplatesGetCall) Fields(s ...googleapi.Field) *NodeTemplatesGetCall {
  66510. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  66511. return c
  66512. }
  66513. // IfNoneMatch sets the optional parameter which makes the operation
  66514. // fail if the object's ETag matches the given value. This is useful for
  66515. // getting updates only after the object has changed since the last
  66516. // request. Use googleapi.IsNotModified to check whether the response
  66517. // error from Do is the result of In-None-Match.
  66518. func (c *NodeTemplatesGetCall) IfNoneMatch(entityTag string) *NodeTemplatesGetCall {
  66519. c.ifNoneMatch_ = entityTag
  66520. return c
  66521. }
  66522. // Context sets the context to be used in this call's Do method. Any
  66523. // pending HTTP request will be aborted if the provided context is
  66524. // canceled.
  66525. func (c *NodeTemplatesGetCall) Context(ctx context.Context) *NodeTemplatesGetCall {
  66526. c.ctx_ = ctx
  66527. return c
  66528. }
  66529. // Header returns an http.Header that can be modified by the caller to
  66530. // add HTTP headers to the request.
  66531. func (c *NodeTemplatesGetCall) Header() http.Header {
  66532. if c.header_ == nil {
  66533. c.header_ = make(http.Header)
  66534. }
  66535. return c.header_
  66536. }
  66537. func (c *NodeTemplatesGetCall) doRequest(alt string) (*http.Response, error) {
  66538. reqHeaders := make(http.Header)
  66539. for k, v := range c.header_ {
  66540. reqHeaders[k] = v
  66541. }
  66542. reqHeaders.Set("User-Agent", c.s.userAgent())
  66543. if c.ifNoneMatch_ != "" {
  66544. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  66545. }
  66546. var body io.Reader = nil
  66547. c.urlParams_.Set("alt", alt)
  66548. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/nodeTemplates/{nodeTemplate}")
  66549. urls += "?" + c.urlParams_.Encode()
  66550. req, _ := http.NewRequest("GET", urls, body)
  66551. req.Header = reqHeaders
  66552. googleapi.Expand(req.URL, map[string]string{
  66553. "project": c.project,
  66554. "region": c.region,
  66555. "nodeTemplate": c.nodeTemplate,
  66556. })
  66557. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  66558. }
  66559. // Do executes the "compute.nodeTemplates.get" call.
  66560. // Exactly one of *NodeTemplate or error will be non-nil. Any non-2xx
  66561. // status code is an error. Response headers are in either
  66562. // *NodeTemplate.ServerResponse.Header or (if a response was returned at
  66563. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  66564. // to check whether the returned error was because
  66565. // http.StatusNotModified was returned.
  66566. func (c *NodeTemplatesGetCall) Do(opts ...googleapi.CallOption) (*NodeTemplate, error) {
  66567. gensupport.SetOptions(c.urlParams_, opts...)
  66568. res, err := c.doRequest("json")
  66569. if res != nil && res.StatusCode == http.StatusNotModified {
  66570. if res.Body != nil {
  66571. res.Body.Close()
  66572. }
  66573. return nil, &googleapi.Error{
  66574. Code: res.StatusCode,
  66575. Header: res.Header,
  66576. }
  66577. }
  66578. if err != nil {
  66579. return nil, err
  66580. }
  66581. defer googleapi.CloseBody(res)
  66582. if err := googleapi.CheckResponse(res); err != nil {
  66583. return nil, err
  66584. }
  66585. ret := &NodeTemplate{
  66586. ServerResponse: googleapi.ServerResponse{
  66587. Header: res.Header,
  66588. HTTPStatusCode: res.StatusCode,
  66589. },
  66590. }
  66591. target := &ret
  66592. if err := gensupport.DecodeResponse(target, res); err != nil {
  66593. return nil, err
  66594. }
  66595. return ret, nil
  66596. // {
  66597. // "description": "Returns the specified node template. Gets a list of available node templates by making a list() request.",
  66598. // "httpMethod": "GET",
  66599. // "id": "compute.nodeTemplates.get",
  66600. // "parameterOrder": [
  66601. // "project",
  66602. // "region",
  66603. // "nodeTemplate"
  66604. // ],
  66605. // "parameters": {
  66606. // "nodeTemplate": {
  66607. // "description": "Name of the node template to return.",
  66608. // "location": "path",
  66609. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  66610. // "required": true,
  66611. // "type": "string"
  66612. // },
  66613. // "project": {
  66614. // "description": "Project ID for this request.",
  66615. // "location": "path",
  66616. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  66617. // "required": true,
  66618. // "type": "string"
  66619. // },
  66620. // "region": {
  66621. // "description": "The name of the region for this request.",
  66622. // "location": "path",
  66623. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  66624. // "required": true,
  66625. // "type": "string"
  66626. // }
  66627. // },
  66628. // "path": "{project}/regions/{region}/nodeTemplates/{nodeTemplate}",
  66629. // "response": {
  66630. // "$ref": "NodeTemplate"
  66631. // },
  66632. // "scopes": [
  66633. // "https://www.googleapis.com/auth/cloud-platform",
  66634. // "https://www.googleapis.com/auth/compute",
  66635. // "https://www.googleapis.com/auth/compute.readonly"
  66636. // ]
  66637. // }
  66638. }
  66639. // method id "compute.nodeTemplates.getIamPolicy":
  66640. type NodeTemplatesGetIamPolicyCall struct {
  66641. s *Service
  66642. project string
  66643. region string
  66644. resource string
  66645. urlParams_ gensupport.URLParams
  66646. ifNoneMatch_ string
  66647. ctx_ context.Context
  66648. header_ http.Header
  66649. }
  66650. // GetIamPolicy: Gets the access control policy for a resource. May be
  66651. // empty if no such policy or resource exists.
  66652. func (r *NodeTemplatesService) GetIamPolicy(project string, region string, resource string) *NodeTemplatesGetIamPolicyCall {
  66653. c := &NodeTemplatesGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  66654. c.project = project
  66655. c.region = region
  66656. c.resource = resource
  66657. return c
  66658. }
  66659. // Fields allows partial responses to be retrieved. See
  66660. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  66661. // for more information.
  66662. func (c *NodeTemplatesGetIamPolicyCall) Fields(s ...googleapi.Field) *NodeTemplatesGetIamPolicyCall {
  66663. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  66664. return c
  66665. }
  66666. // IfNoneMatch sets the optional parameter which makes the operation
  66667. // fail if the object's ETag matches the given value. This is useful for
  66668. // getting updates only after the object has changed since the last
  66669. // request. Use googleapi.IsNotModified to check whether the response
  66670. // error from Do is the result of In-None-Match.
  66671. func (c *NodeTemplatesGetIamPolicyCall) IfNoneMatch(entityTag string) *NodeTemplatesGetIamPolicyCall {
  66672. c.ifNoneMatch_ = entityTag
  66673. return c
  66674. }
  66675. // Context sets the context to be used in this call's Do method. Any
  66676. // pending HTTP request will be aborted if the provided context is
  66677. // canceled.
  66678. func (c *NodeTemplatesGetIamPolicyCall) Context(ctx context.Context) *NodeTemplatesGetIamPolicyCall {
  66679. c.ctx_ = ctx
  66680. return c
  66681. }
  66682. // Header returns an http.Header that can be modified by the caller to
  66683. // add HTTP headers to the request.
  66684. func (c *NodeTemplatesGetIamPolicyCall) Header() http.Header {
  66685. if c.header_ == nil {
  66686. c.header_ = make(http.Header)
  66687. }
  66688. return c.header_
  66689. }
  66690. func (c *NodeTemplatesGetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  66691. reqHeaders := make(http.Header)
  66692. for k, v := range c.header_ {
  66693. reqHeaders[k] = v
  66694. }
  66695. reqHeaders.Set("User-Agent", c.s.userAgent())
  66696. if c.ifNoneMatch_ != "" {
  66697. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  66698. }
  66699. var body io.Reader = nil
  66700. c.urlParams_.Set("alt", alt)
  66701. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/nodeTemplates/{resource}/getIamPolicy")
  66702. urls += "?" + c.urlParams_.Encode()
  66703. req, _ := http.NewRequest("GET", urls, body)
  66704. req.Header = reqHeaders
  66705. googleapi.Expand(req.URL, map[string]string{
  66706. "project": c.project,
  66707. "region": c.region,
  66708. "resource": c.resource,
  66709. })
  66710. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  66711. }
  66712. // Do executes the "compute.nodeTemplates.getIamPolicy" call.
  66713. // Exactly one of *Policy or error will be non-nil. Any non-2xx status
  66714. // code is an error. Response headers are in either
  66715. // *Policy.ServerResponse.Header or (if a response was returned at all)
  66716. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  66717. // check whether the returned error was because http.StatusNotModified
  66718. // was returned.
  66719. func (c *NodeTemplatesGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  66720. gensupport.SetOptions(c.urlParams_, opts...)
  66721. res, err := c.doRequest("json")
  66722. if res != nil && res.StatusCode == http.StatusNotModified {
  66723. if res.Body != nil {
  66724. res.Body.Close()
  66725. }
  66726. return nil, &googleapi.Error{
  66727. Code: res.StatusCode,
  66728. Header: res.Header,
  66729. }
  66730. }
  66731. if err != nil {
  66732. return nil, err
  66733. }
  66734. defer googleapi.CloseBody(res)
  66735. if err := googleapi.CheckResponse(res); err != nil {
  66736. return nil, err
  66737. }
  66738. ret := &Policy{
  66739. ServerResponse: googleapi.ServerResponse{
  66740. Header: res.Header,
  66741. HTTPStatusCode: res.StatusCode,
  66742. },
  66743. }
  66744. target := &ret
  66745. if err := gensupport.DecodeResponse(target, res); err != nil {
  66746. return nil, err
  66747. }
  66748. return ret, nil
  66749. // {
  66750. // "description": "Gets the access control policy for a resource. May be empty if no such policy or resource exists.",
  66751. // "httpMethod": "GET",
  66752. // "id": "compute.nodeTemplates.getIamPolicy",
  66753. // "parameterOrder": [
  66754. // "project",
  66755. // "region",
  66756. // "resource"
  66757. // ],
  66758. // "parameters": {
  66759. // "project": {
  66760. // "description": "Project ID for this request.",
  66761. // "location": "path",
  66762. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  66763. // "required": true,
  66764. // "type": "string"
  66765. // },
  66766. // "region": {
  66767. // "description": "The name of the region for this request.",
  66768. // "location": "path",
  66769. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  66770. // "required": true,
  66771. // "type": "string"
  66772. // },
  66773. // "resource": {
  66774. // "description": "Name of the resource for this request.",
  66775. // "location": "path",
  66776. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  66777. // "required": true,
  66778. // "type": "string"
  66779. // }
  66780. // },
  66781. // "path": "{project}/regions/{region}/nodeTemplates/{resource}/getIamPolicy",
  66782. // "response": {
  66783. // "$ref": "Policy"
  66784. // },
  66785. // "scopes": [
  66786. // "https://www.googleapis.com/auth/cloud-platform",
  66787. // "https://www.googleapis.com/auth/compute",
  66788. // "https://www.googleapis.com/auth/compute.readonly"
  66789. // ]
  66790. // }
  66791. }
  66792. // method id "compute.nodeTemplates.insert":
  66793. type NodeTemplatesInsertCall struct {
  66794. s *Service
  66795. project string
  66796. region string
  66797. nodetemplate *NodeTemplate
  66798. urlParams_ gensupport.URLParams
  66799. ctx_ context.Context
  66800. header_ http.Header
  66801. }
  66802. // Insert: Creates a NodeTemplate resource in the specified project
  66803. // using the data included in the request.
  66804. func (r *NodeTemplatesService) Insert(project string, region string, nodetemplate *NodeTemplate) *NodeTemplatesInsertCall {
  66805. c := &NodeTemplatesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  66806. c.project = project
  66807. c.region = region
  66808. c.nodetemplate = nodetemplate
  66809. return c
  66810. }
  66811. // RequestId sets the optional parameter "requestId": An optional
  66812. // request ID to identify requests. Specify a unique request ID so that
  66813. // if you must retry your request, the server will know to ignore the
  66814. // request if it has already been completed.
  66815. //
  66816. // For example, consider a situation where you make an initial request
  66817. // and the request times out. If you make the request again with the
  66818. // same request ID, the server can check if original operation with the
  66819. // same request ID was received, and if so, will ignore the second
  66820. // request. This prevents clients from accidentally creating duplicate
  66821. // commitments.
  66822. //
  66823. // The request ID must be a valid UUID with the exception that zero UUID
  66824. // is not supported (00000000-0000-0000-0000-000000000000).
  66825. func (c *NodeTemplatesInsertCall) RequestId(requestId string) *NodeTemplatesInsertCall {
  66826. c.urlParams_.Set("requestId", requestId)
  66827. return c
  66828. }
  66829. // Fields allows partial responses to be retrieved. See
  66830. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  66831. // for more information.
  66832. func (c *NodeTemplatesInsertCall) Fields(s ...googleapi.Field) *NodeTemplatesInsertCall {
  66833. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  66834. return c
  66835. }
  66836. // Context sets the context to be used in this call's Do method. Any
  66837. // pending HTTP request will be aborted if the provided context is
  66838. // canceled.
  66839. func (c *NodeTemplatesInsertCall) Context(ctx context.Context) *NodeTemplatesInsertCall {
  66840. c.ctx_ = ctx
  66841. return c
  66842. }
  66843. // Header returns an http.Header that can be modified by the caller to
  66844. // add HTTP headers to the request.
  66845. func (c *NodeTemplatesInsertCall) Header() http.Header {
  66846. if c.header_ == nil {
  66847. c.header_ = make(http.Header)
  66848. }
  66849. return c.header_
  66850. }
  66851. func (c *NodeTemplatesInsertCall) doRequest(alt string) (*http.Response, error) {
  66852. reqHeaders := make(http.Header)
  66853. for k, v := range c.header_ {
  66854. reqHeaders[k] = v
  66855. }
  66856. reqHeaders.Set("User-Agent", c.s.userAgent())
  66857. var body io.Reader = nil
  66858. body, err := googleapi.WithoutDataWrapper.JSONReader(c.nodetemplate)
  66859. if err != nil {
  66860. return nil, err
  66861. }
  66862. reqHeaders.Set("Content-Type", "application/json")
  66863. c.urlParams_.Set("alt", alt)
  66864. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/nodeTemplates")
  66865. urls += "?" + c.urlParams_.Encode()
  66866. req, _ := http.NewRequest("POST", urls, body)
  66867. req.Header = reqHeaders
  66868. googleapi.Expand(req.URL, map[string]string{
  66869. "project": c.project,
  66870. "region": c.region,
  66871. })
  66872. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  66873. }
  66874. // Do executes the "compute.nodeTemplates.insert" call.
  66875. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  66876. // status code is an error. Response headers are in either
  66877. // *Operation.ServerResponse.Header or (if a response was returned at
  66878. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  66879. // to check whether the returned error was because
  66880. // http.StatusNotModified was returned.
  66881. func (c *NodeTemplatesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  66882. gensupport.SetOptions(c.urlParams_, opts...)
  66883. res, err := c.doRequest("json")
  66884. if res != nil && res.StatusCode == http.StatusNotModified {
  66885. if res.Body != nil {
  66886. res.Body.Close()
  66887. }
  66888. return nil, &googleapi.Error{
  66889. Code: res.StatusCode,
  66890. Header: res.Header,
  66891. }
  66892. }
  66893. if err != nil {
  66894. return nil, err
  66895. }
  66896. defer googleapi.CloseBody(res)
  66897. if err := googleapi.CheckResponse(res); err != nil {
  66898. return nil, err
  66899. }
  66900. ret := &Operation{
  66901. ServerResponse: googleapi.ServerResponse{
  66902. Header: res.Header,
  66903. HTTPStatusCode: res.StatusCode,
  66904. },
  66905. }
  66906. target := &ret
  66907. if err := gensupport.DecodeResponse(target, res); err != nil {
  66908. return nil, err
  66909. }
  66910. return ret, nil
  66911. // {
  66912. // "description": "Creates a NodeTemplate resource in the specified project using the data included in the request.",
  66913. // "httpMethod": "POST",
  66914. // "id": "compute.nodeTemplates.insert",
  66915. // "parameterOrder": [
  66916. // "project",
  66917. // "region"
  66918. // ],
  66919. // "parameters": {
  66920. // "project": {
  66921. // "description": "Project ID for this request.",
  66922. // "location": "path",
  66923. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  66924. // "required": true,
  66925. // "type": "string"
  66926. // },
  66927. // "region": {
  66928. // "description": "The name of the region for this request.",
  66929. // "location": "path",
  66930. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  66931. // "required": true,
  66932. // "type": "string"
  66933. // },
  66934. // "requestId": {
  66935. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  66936. // "location": "query",
  66937. // "type": "string"
  66938. // }
  66939. // },
  66940. // "path": "{project}/regions/{region}/nodeTemplates",
  66941. // "request": {
  66942. // "$ref": "NodeTemplate"
  66943. // },
  66944. // "response": {
  66945. // "$ref": "Operation"
  66946. // },
  66947. // "scopes": [
  66948. // "https://www.googleapis.com/auth/cloud-platform",
  66949. // "https://www.googleapis.com/auth/compute"
  66950. // ]
  66951. // }
  66952. }
  66953. // method id "compute.nodeTemplates.list":
  66954. type NodeTemplatesListCall struct {
  66955. s *Service
  66956. project string
  66957. region string
  66958. urlParams_ gensupport.URLParams
  66959. ifNoneMatch_ string
  66960. ctx_ context.Context
  66961. header_ http.Header
  66962. }
  66963. // List: Retrieves a list of node templates available to the specified
  66964. // project.
  66965. func (r *NodeTemplatesService) List(project string, region string) *NodeTemplatesListCall {
  66966. c := &NodeTemplatesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  66967. c.project = project
  66968. c.region = region
  66969. return c
  66970. }
  66971. // Filter sets the optional parameter "filter": A filter expression that
  66972. // filters resources listed in the response. The expression must specify
  66973. // the field name, a comparison operator, and the value that you want to
  66974. // use for filtering. The value must be a string, a number, or a
  66975. // boolean. The comparison operator must be either =, !=, >, or <.
  66976. //
  66977. // For example, if you are filtering Compute Engine instances, you can
  66978. // exclude instances named example-instance by specifying name !=
  66979. // example-instance.
  66980. //
  66981. // You can also filter nested fields. For example, you could specify
  66982. // scheduling.automaticRestart = false to include instances only if they
  66983. // are not scheduled for automatic restarts. You can use filtering on
  66984. // nested fields to filter based on resource labels.
  66985. //
  66986. // To filter on multiple expressions, provide each separate expression
  66987. // within parentheses. For example, (scheduling.automaticRestart = true)
  66988. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  66989. // AND expression. However, you can include AND and OR expressions
  66990. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  66991. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  66992. // true).
  66993. func (c *NodeTemplatesListCall) Filter(filter string) *NodeTemplatesListCall {
  66994. c.urlParams_.Set("filter", filter)
  66995. return c
  66996. }
  66997. // MaxResults sets the optional parameter "maxResults": The maximum
  66998. // number of results per page that should be returned. If the number of
  66999. // available results is larger than maxResults, Compute Engine returns a
  67000. // nextPageToken that can be used to get the next page of results in
  67001. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  67002. // (Default: 500)
  67003. func (c *NodeTemplatesListCall) MaxResults(maxResults int64) *NodeTemplatesListCall {
  67004. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  67005. return c
  67006. }
  67007. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  67008. // a certain order. By default, results are returned in alphanumerical
  67009. // order based on the resource name.
  67010. //
  67011. // You can also sort results in descending order based on the creation
  67012. // timestamp using orderBy="creationTimestamp desc". This sorts results
  67013. // based on the creationTimestamp field in reverse chronological order
  67014. // (newest result first). Use this to sort resources like operations so
  67015. // that the newest operation is returned first.
  67016. //
  67017. // Currently, only sorting by name or creationTimestamp desc is
  67018. // supported.
  67019. func (c *NodeTemplatesListCall) OrderBy(orderBy string) *NodeTemplatesListCall {
  67020. c.urlParams_.Set("orderBy", orderBy)
  67021. return c
  67022. }
  67023. // PageToken sets the optional parameter "pageToken": Specifies a page
  67024. // token to use. Set pageToken to the nextPageToken returned by a
  67025. // previous list request to get the next page of results.
  67026. func (c *NodeTemplatesListCall) PageToken(pageToken string) *NodeTemplatesListCall {
  67027. c.urlParams_.Set("pageToken", pageToken)
  67028. return c
  67029. }
  67030. // Fields allows partial responses to be retrieved. See
  67031. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  67032. // for more information.
  67033. func (c *NodeTemplatesListCall) Fields(s ...googleapi.Field) *NodeTemplatesListCall {
  67034. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  67035. return c
  67036. }
  67037. // IfNoneMatch sets the optional parameter which makes the operation
  67038. // fail if the object's ETag matches the given value. This is useful for
  67039. // getting updates only after the object has changed since the last
  67040. // request. Use googleapi.IsNotModified to check whether the response
  67041. // error from Do is the result of In-None-Match.
  67042. func (c *NodeTemplatesListCall) IfNoneMatch(entityTag string) *NodeTemplatesListCall {
  67043. c.ifNoneMatch_ = entityTag
  67044. return c
  67045. }
  67046. // Context sets the context to be used in this call's Do method. Any
  67047. // pending HTTP request will be aborted if the provided context is
  67048. // canceled.
  67049. func (c *NodeTemplatesListCall) Context(ctx context.Context) *NodeTemplatesListCall {
  67050. c.ctx_ = ctx
  67051. return c
  67052. }
  67053. // Header returns an http.Header that can be modified by the caller to
  67054. // add HTTP headers to the request.
  67055. func (c *NodeTemplatesListCall) Header() http.Header {
  67056. if c.header_ == nil {
  67057. c.header_ = make(http.Header)
  67058. }
  67059. return c.header_
  67060. }
  67061. func (c *NodeTemplatesListCall) doRequest(alt string) (*http.Response, error) {
  67062. reqHeaders := make(http.Header)
  67063. for k, v := range c.header_ {
  67064. reqHeaders[k] = v
  67065. }
  67066. reqHeaders.Set("User-Agent", c.s.userAgent())
  67067. if c.ifNoneMatch_ != "" {
  67068. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  67069. }
  67070. var body io.Reader = nil
  67071. c.urlParams_.Set("alt", alt)
  67072. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/nodeTemplates")
  67073. urls += "?" + c.urlParams_.Encode()
  67074. req, _ := http.NewRequest("GET", urls, body)
  67075. req.Header = reqHeaders
  67076. googleapi.Expand(req.URL, map[string]string{
  67077. "project": c.project,
  67078. "region": c.region,
  67079. })
  67080. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  67081. }
  67082. // Do executes the "compute.nodeTemplates.list" call.
  67083. // Exactly one of *NodeTemplateList or error will be non-nil. Any
  67084. // non-2xx status code is an error. Response headers are in either
  67085. // *NodeTemplateList.ServerResponse.Header or (if a response was
  67086. // returned at all) in error.(*googleapi.Error).Header. Use
  67087. // googleapi.IsNotModified to check whether the returned error was
  67088. // because http.StatusNotModified was returned.
  67089. func (c *NodeTemplatesListCall) Do(opts ...googleapi.CallOption) (*NodeTemplateList, error) {
  67090. gensupport.SetOptions(c.urlParams_, opts...)
  67091. res, err := c.doRequest("json")
  67092. if res != nil && res.StatusCode == http.StatusNotModified {
  67093. if res.Body != nil {
  67094. res.Body.Close()
  67095. }
  67096. return nil, &googleapi.Error{
  67097. Code: res.StatusCode,
  67098. Header: res.Header,
  67099. }
  67100. }
  67101. if err != nil {
  67102. return nil, err
  67103. }
  67104. defer googleapi.CloseBody(res)
  67105. if err := googleapi.CheckResponse(res); err != nil {
  67106. return nil, err
  67107. }
  67108. ret := &NodeTemplateList{
  67109. ServerResponse: googleapi.ServerResponse{
  67110. Header: res.Header,
  67111. HTTPStatusCode: res.StatusCode,
  67112. },
  67113. }
  67114. target := &ret
  67115. if err := gensupport.DecodeResponse(target, res); err != nil {
  67116. return nil, err
  67117. }
  67118. return ret, nil
  67119. // {
  67120. // "description": "Retrieves a list of node templates available to the specified project.",
  67121. // "httpMethod": "GET",
  67122. // "id": "compute.nodeTemplates.list",
  67123. // "parameterOrder": [
  67124. // "project",
  67125. // "region"
  67126. // ],
  67127. // "parameters": {
  67128. // "filter": {
  67129. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  67130. // "location": "query",
  67131. // "type": "string"
  67132. // },
  67133. // "maxResults": {
  67134. // "default": "500",
  67135. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  67136. // "format": "uint32",
  67137. // "location": "query",
  67138. // "minimum": "0",
  67139. // "type": "integer"
  67140. // },
  67141. // "orderBy": {
  67142. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  67143. // "location": "query",
  67144. // "type": "string"
  67145. // },
  67146. // "pageToken": {
  67147. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  67148. // "location": "query",
  67149. // "type": "string"
  67150. // },
  67151. // "project": {
  67152. // "description": "Project ID for this request.",
  67153. // "location": "path",
  67154. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  67155. // "required": true,
  67156. // "type": "string"
  67157. // },
  67158. // "region": {
  67159. // "description": "The name of the region for this request.",
  67160. // "location": "path",
  67161. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  67162. // "required": true,
  67163. // "type": "string"
  67164. // }
  67165. // },
  67166. // "path": "{project}/regions/{region}/nodeTemplates",
  67167. // "response": {
  67168. // "$ref": "NodeTemplateList"
  67169. // },
  67170. // "scopes": [
  67171. // "https://www.googleapis.com/auth/cloud-platform",
  67172. // "https://www.googleapis.com/auth/compute",
  67173. // "https://www.googleapis.com/auth/compute.readonly"
  67174. // ]
  67175. // }
  67176. }
  67177. // Pages invokes f for each page of results.
  67178. // A non-nil error returned from f will halt the iteration.
  67179. // The provided context supersedes any context provided to the Context method.
  67180. func (c *NodeTemplatesListCall) Pages(ctx context.Context, f func(*NodeTemplateList) error) error {
  67181. c.ctx_ = ctx
  67182. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  67183. for {
  67184. x, err := c.Do()
  67185. if err != nil {
  67186. return err
  67187. }
  67188. if err := f(x); err != nil {
  67189. return err
  67190. }
  67191. if x.NextPageToken == "" {
  67192. return nil
  67193. }
  67194. c.PageToken(x.NextPageToken)
  67195. }
  67196. }
  67197. // method id "compute.nodeTemplates.setIamPolicy":
  67198. type NodeTemplatesSetIamPolicyCall struct {
  67199. s *Service
  67200. project string
  67201. region string
  67202. resource string
  67203. regionsetpolicyrequest *RegionSetPolicyRequest
  67204. urlParams_ gensupport.URLParams
  67205. ctx_ context.Context
  67206. header_ http.Header
  67207. }
  67208. // SetIamPolicy: Sets the access control policy on the specified
  67209. // resource. Replaces any existing policy.
  67210. func (r *NodeTemplatesService) SetIamPolicy(project string, region string, resource string, regionsetpolicyrequest *RegionSetPolicyRequest) *NodeTemplatesSetIamPolicyCall {
  67211. c := &NodeTemplatesSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  67212. c.project = project
  67213. c.region = region
  67214. c.resource = resource
  67215. c.regionsetpolicyrequest = regionsetpolicyrequest
  67216. return c
  67217. }
  67218. // Fields allows partial responses to be retrieved. See
  67219. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  67220. // for more information.
  67221. func (c *NodeTemplatesSetIamPolicyCall) Fields(s ...googleapi.Field) *NodeTemplatesSetIamPolicyCall {
  67222. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  67223. return c
  67224. }
  67225. // Context sets the context to be used in this call's Do method. Any
  67226. // pending HTTP request will be aborted if the provided context is
  67227. // canceled.
  67228. func (c *NodeTemplatesSetIamPolicyCall) Context(ctx context.Context) *NodeTemplatesSetIamPolicyCall {
  67229. c.ctx_ = ctx
  67230. return c
  67231. }
  67232. // Header returns an http.Header that can be modified by the caller to
  67233. // add HTTP headers to the request.
  67234. func (c *NodeTemplatesSetIamPolicyCall) Header() http.Header {
  67235. if c.header_ == nil {
  67236. c.header_ = make(http.Header)
  67237. }
  67238. return c.header_
  67239. }
  67240. func (c *NodeTemplatesSetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  67241. reqHeaders := make(http.Header)
  67242. for k, v := range c.header_ {
  67243. reqHeaders[k] = v
  67244. }
  67245. reqHeaders.Set("User-Agent", c.s.userAgent())
  67246. var body io.Reader = nil
  67247. body, err := googleapi.WithoutDataWrapper.JSONReader(c.regionsetpolicyrequest)
  67248. if err != nil {
  67249. return nil, err
  67250. }
  67251. reqHeaders.Set("Content-Type", "application/json")
  67252. c.urlParams_.Set("alt", alt)
  67253. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/nodeTemplates/{resource}/setIamPolicy")
  67254. urls += "?" + c.urlParams_.Encode()
  67255. req, _ := http.NewRequest("POST", urls, body)
  67256. req.Header = reqHeaders
  67257. googleapi.Expand(req.URL, map[string]string{
  67258. "project": c.project,
  67259. "region": c.region,
  67260. "resource": c.resource,
  67261. })
  67262. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  67263. }
  67264. // Do executes the "compute.nodeTemplates.setIamPolicy" call.
  67265. // Exactly one of *Policy or error will be non-nil. Any non-2xx status
  67266. // code is an error. Response headers are in either
  67267. // *Policy.ServerResponse.Header or (if a response was returned at all)
  67268. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  67269. // check whether the returned error was because http.StatusNotModified
  67270. // was returned.
  67271. func (c *NodeTemplatesSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  67272. gensupport.SetOptions(c.urlParams_, opts...)
  67273. res, err := c.doRequest("json")
  67274. if res != nil && res.StatusCode == http.StatusNotModified {
  67275. if res.Body != nil {
  67276. res.Body.Close()
  67277. }
  67278. return nil, &googleapi.Error{
  67279. Code: res.StatusCode,
  67280. Header: res.Header,
  67281. }
  67282. }
  67283. if err != nil {
  67284. return nil, err
  67285. }
  67286. defer googleapi.CloseBody(res)
  67287. if err := googleapi.CheckResponse(res); err != nil {
  67288. return nil, err
  67289. }
  67290. ret := &Policy{
  67291. ServerResponse: googleapi.ServerResponse{
  67292. Header: res.Header,
  67293. HTTPStatusCode: res.StatusCode,
  67294. },
  67295. }
  67296. target := &ret
  67297. if err := gensupport.DecodeResponse(target, res); err != nil {
  67298. return nil, err
  67299. }
  67300. return ret, nil
  67301. // {
  67302. // "description": "Sets the access control policy on the specified resource. Replaces any existing policy.",
  67303. // "httpMethod": "POST",
  67304. // "id": "compute.nodeTemplates.setIamPolicy",
  67305. // "parameterOrder": [
  67306. // "project",
  67307. // "region",
  67308. // "resource"
  67309. // ],
  67310. // "parameters": {
  67311. // "project": {
  67312. // "description": "Project ID for this request.",
  67313. // "location": "path",
  67314. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  67315. // "required": true,
  67316. // "type": "string"
  67317. // },
  67318. // "region": {
  67319. // "description": "The name of the region for this request.",
  67320. // "location": "path",
  67321. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  67322. // "required": true,
  67323. // "type": "string"
  67324. // },
  67325. // "resource": {
  67326. // "description": "Name of the resource for this request.",
  67327. // "location": "path",
  67328. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  67329. // "required": true,
  67330. // "type": "string"
  67331. // }
  67332. // },
  67333. // "path": "{project}/regions/{region}/nodeTemplates/{resource}/setIamPolicy",
  67334. // "request": {
  67335. // "$ref": "RegionSetPolicyRequest"
  67336. // },
  67337. // "response": {
  67338. // "$ref": "Policy"
  67339. // },
  67340. // "scopes": [
  67341. // "https://www.googleapis.com/auth/cloud-platform",
  67342. // "https://www.googleapis.com/auth/compute"
  67343. // ]
  67344. // }
  67345. }
  67346. // method id "compute.nodeTemplates.testIamPermissions":
  67347. type NodeTemplatesTestIamPermissionsCall struct {
  67348. s *Service
  67349. project string
  67350. region string
  67351. resource string
  67352. testpermissionsrequest *TestPermissionsRequest
  67353. urlParams_ gensupport.URLParams
  67354. ctx_ context.Context
  67355. header_ http.Header
  67356. }
  67357. // TestIamPermissions: Returns permissions that a caller has on the
  67358. // specified resource.
  67359. func (r *NodeTemplatesService) TestIamPermissions(project string, region string, resource string, testpermissionsrequest *TestPermissionsRequest) *NodeTemplatesTestIamPermissionsCall {
  67360. c := &NodeTemplatesTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  67361. c.project = project
  67362. c.region = region
  67363. c.resource = resource
  67364. c.testpermissionsrequest = testpermissionsrequest
  67365. return c
  67366. }
  67367. // Fields allows partial responses to be retrieved. See
  67368. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  67369. // for more information.
  67370. func (c *NodeTemplatesTestIamPermissionsCall) Fields(s ...googleapi.Field) *NodeTemplatesTestIamPermissionsCall {
  67371. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  67372. return c
  67373. }
  67374. // Context sets the context to be used in this call's Do method. Any
  67375. // pending HTTP request will be aborted if the provided context is
  67376. // canceled.
  67377. func (c *NodeTemplatesTestIamPermissionsCall) Context(ctx context.Context) *NodeTemplatesTestIamPermissionsCall {
  67378. c.ctx_ = ctx
  67379. return c
  67380. }
  67381. // Header returns an http.Header that can be modified by the caller to
  67382. // add HTTP headers to the request.
  67383. func (c *NodeTemplatesTestIamPermissionsCall) Header() http.Header {
  67384. if c.header_ == nil {
  67385. c.header_ = make(http.Header)
  67386. }
  67387. return c.header_
  67388. }
  67389. func (c *NodeTemplatesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  67390. reqHeaders := make(http.Header)
  67391. for k, v := range c.header_ {
  67392. reqHeaders[k] = v
  67393. }
  67394. reqHeaders.Set("User-Agent", c.s.userAgent())
  67395. var body io.Reader = nil
  67396. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  67397. if err != nil {
  67398. return nil, err
  67399. }
  67400. reqHeaders.Set("Content-Type", "application/json")
  67401. c.urlParams_.Set("alt", alt)
  67402. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/nodeTemplates/{resource}/testIamPermissions")
  67403. urls += "?" + c.urlParams_.Encode()
  67404. req, _ := http.NewRequest("POST", urls, body)
  67405. req.Header = reqHeaders
  67406. googleapi.Expand(req.URL, map[string]string{
  67407. "project": c.project,
  67408. "region": c.region,
  67409. "resource": c.resource,
  67410. })
  67411. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  67412. }
  67413. // Do executes the "compute.nodeTemplates.testIamPermissions" call.
  67414. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  67415. // non-2xx status code is an error. Response headers are in either
  67416. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  67417. // returned at all) in error.(*googleapi.Error).Header. Use
  67418. // googleapi.IsNotModified to check whether the returned error was
  67419. // because http.StatusNotModified was returned.
  67420. func (c *NodeTemplatesTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  67421. gensupport.SetOptions(c.urlParams_, opts...)
  67422. res, err := c.doRequest("json")
  67423. if res != nil && res.StatusCode == http.StatusNotModified {
  67424. if res.Body != nil {
  67425. res.Body.Close()
  67426. }
  67427. return nil, &googleapi.Error{
  67428. Code: res.StatusCode,
  67429. Header: res.Header,
  67430. }
  67431. }
  67432. if err != nil {
  67433. return nil, err
  67434. }
  67435. defer googleapi.CloseBody(res)
  67436. if err := googleapi.CheckResponse(res); err != nil {
  67437. return nil, err
  67438. }
  67439. ret := &TestPermissionsResponse{
  67440. ServerResponse: googleapi.ServerResponse{
  67441. Header: res.Header,
  67442. HTTPStatusCode: res.StatusCode,
  67443. },
  67444. }
  67445. target := &ret
  67446. if err := gensupport.DecodeResponse(target, res); err != nil {
  67447. return nil, err
  67448. }
  67449. return ret, nil
  67450. // {
  67451. // "description": "Returns permissions that a caller has on the specified resource.",
  67452. // "httpMethod": "POST",
  67453. // "id": "compute.nodeTemplates.testIamPermissions",
  67454. // "parameterOrder": [
  67455. // "project",
  67456. // "region",
  67457. // "resource"
  67458. // ],
  67459. // "parameters": {
  67460. // "project": {
  67461. // "description": "Project ID for this request.",
  67462. // "location": "path",
  67463. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  67464. // "required": true,
  67465. // "type": "string"
  67466. // },
  67467. // "region": {
  67468. // "description": "The name of the region for this request.",
  67469. // "location": "path",
  67470. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  67471. // "required": true,
  67472. // "type": "string"
  67473. // },
  67474. // "resource": {
  67475. // "description": "Name of the resource for this request.",
  67476. // "location": "path",
  67477. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  67478. // "required": true,
  67479. // "type": "string"
  67480. // }
  67481. // },
  67482. // "path": "{project}/regions/{region}/nodeTemplates/{resource}/testIamPermissions",
  67483. // "request": {
  67484. // "$ref": "TestPermissionsRequest"
  67485. // },
  67486. // "response": {
  67487. // "$ref": "TestPermissionsResponse"
  67488. // },
  67489. // "scopes": [
  67490. // "https://www.googleapis.com/auth/cloud-platform",
  67491. // "https://www.googleapis.com/auth/compute",
  67492. // "https://www.googleapis.com/auth/compute.readonly"
  67493. // ]
  67494. // }
  67495. }
  67496. // method id "compute.nodeTypes.aggregatedList":
  67497. type NodeTypesAggregatedListCall struct {
  67498. s *Service
  67499. project string
  67500. urlParams_ gensupport.URLParams
  67501. ifNoneMatch_ string
  67502. ctx_ context.Context
  67503. header_ http.Header
  67504. }
  67505. // AggregatedList: Retrieves an aggregated list of node types.
  67506. func (r *NodeTypesService) AggregatedList(project string) *NodeTypesAggregatedListCall {
  67507. c := &NodeTypesAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  67508. c.project = project
  67509. return c
  67510. }
  67511. // Filter sets the optional parameter "filter": A filter expression that
  67512. // filters resources listed in the response. The expression must specify
  67513. // the field name, a comparison operator, and the value that you want to
  67514. // use for filtering. The value must be a string, a number, or a
  67515. // boolean. The comparison operator must be either =, !=, >, or <.
  67516. //
  67517. // For example, if you are filtering Compute Engine instances, you can
  67518. // exclude instances named example-instance by specifying name !=
  67519. // example-instance.
  67520. //
  67521. // You can also filter nested fields. For example, you could specify
  67522. // scheduling.automaticRestart = false to include instances only if they
  67523. // are not scheduled for automatic restarts. You can use filtering on
  67524. // nested fields to filter based on resource labels.
  67525. //
  67526. // To filter on multiple expressions, provide each separate expression
  67527. // within parentheses. For example, (scheduling.automaticRestart = true)
  67528. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  67529. // AND expression. However, you can include AND and OR expressions
  67530. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  67531. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  67532. // true).
  67533. func (c *NodeTypesAggregatedListCall) Filter(filter string) *NodeTypesAggregatedListCall {
  67534. c.urlParams_.Set("filter", filter)
  67535. return c
  67536. }
  67537. // MaxResults sets the optional parameter "maxResults": The maximum
  67538. // number of results per page that should be returned. If the number of
  67539. // available results is larger than maxResults, Compute Engine returns a
  67540. // nextPageToken that can be used to get the next page of results in
  67541. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  67542. // (Default: 500)
  67543. func (c *NodeTypesAggregatedListCall) MaxResults(maxResults int64) *NodeTypesAggregatedListCall {
  67544. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  67545. return c
  67546. }
  67547. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  67548. // a certain order. By default, results are returned in alphanumerical
  67549. // order based on the resource name.
  67550. //
  67551. // You can also sort results in descending order based on the creation
  67552. // timestamp using orderBy="creationTimestamp desc". This sorts results
  67553. // based on the creationTimestamp field in reverse chronological order
  67554. // (newest result first). Use this to sort resources like operations so
  67555. // that the newest operation is returned first.
  67556. //
  67557. // Currently, only sorting by name or creationTimestamp desc is
  67558. // supported.
  67559. func (c *NodeTypesAggregatedListCall) OrderBy(orderBy string) *NodeTypesAggregatedListCall {
  67560. c.urlParams_.Set("orderBy", orderBy)
  67561. return c
  67562. }
  67563. // PageToken sets the optional parameter "pageToken": Specifies a page
  67564. // token to use. Set pageToken to the nextPageToken returned by a
  67565. // previous list request to get the next page of results.
  67566. func (c *NodeTypesAggregatedListCall) PageToken(pageToken string) *NodeTypesAggregatedListCall {
  67567. c.urlParams_.Set("pageToken", pageToken)
  67568. return c
  67569. }
  67570. // Fields allows partial responses to be retrieved. See
  67571. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  67572. // for more information.
  67573. func (c *NodeTypesAggregatedListCall) Fields(s ...googleapi.Field) *NodeTypesAggregatedListCall {
  67574. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  67575. return c
  67576. }
  67577. // IfNoneMatch sets the optional parameter which makes the operation
  67578. // fail if the object's ETag matches the given value. This is useful for
  67579. // getting updates only after the object has changed since the last
  67580. // request. Use googleapi.IsNotModified to check whether the response
  67581. // error from Do is the result of In-None-Match.
  67582. func (c *NodeTypesAggregatedListCall) IfNoneMatch(entityTag string) *NodeTypesAggregatedListCall {
  67583. c.ifNoneMatch_ = entityTag
  67584. return c
  67585. }
  67586. // Context sets the context to be used in this call's Do method. Any
  67587. // pending HTTP request will be aborted if the provided context is
  67588. // canceled.
  67589. func (c *NodeTypesAggregatedListCall) Context(ctx context.Context) *NodeTypesAggregatedListCall {
  67590. c.ctx_ = ctx
  67591. return c
  67592. }
  67593. // Header returns an http.Header that can be modified by the caller to
  67594. // add HTTP headers to the request.
  67595. func (c *NodeTypesAggregatedListCall) Header() http.Header {
  67596. if c.header_ == nil {
  67597. c.header_ = make(http.Header)
  67598. }
  67599. return c.header_
  67600. }
  67601. func (c *NodeTypesAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  67602. reqHeaders := make(http.Header)
  67603. for k, v := range c.header_ {
  67604. reqHeaders[k] = v
  67605. }
  67606. reqHeaders.Set("User-Agent", c.s.userAgent())
  67607. if c.ifNoneMatch_ != "" {
  67608. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  67609. }
  67610. var body io.Reader = nil
  67611. c.urlParams_.Set("alt", alt)
  67612. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/nodeTypes")
  67613. urls += "?" + c.urlParams_.Encode()
  67614. req, _ := http.NewRequest("GET", urls, body)
  67615. req.Header = reqHeaders
  67616. googleapi.Expand(req.URL, map[string]string{
  67617. "project": c.project,
  67618. })
  67619. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  67620. }
  67621. // Do executes the "compute.nodeTypes.aggregatedList" call.
  67622. // Exactly one of *NodeTypeAggregatedList or error will be non-nil. Any
  67623. // non-2xx status code is an error. Response headers are in either
  67624. // *NodeTypeAggregatedList.ServerResponse.Header or (if a response was
  67625. // returned at all) in error.(*googleapi.Error).Header. Use
  67626. // googleapi.IsNotModified to check whether the returned error was
  67627. // because http.StatusNotModified was returned.
  67628. func (c *NodeTypesAggregatedListCall) Do(opts ...googleapi.CallOption) (*NodeTypeAggregatedList, error) {
  67629. gensupport.SetOptions(c.urlParams_, opts...)
  67630. res, err := c.doRequest("json")
  67631. if res != nil && res.StatusCode == http.StatusNotModified {
  67632. if res.Body != nil {
  67633. res.Body.Close()
  67634. }
  67635. return nil, &googleapi.Error{
  67636. Code: res.StatusCode,
  67637. Header: res.Header,
  67638. }
  67639. }
  67640. if err != nil {
  67641. return nil, err
  67642. }
  67643. defer googleapi.CloseBody(res)
  67644. if err := googleapi.CheckResponse(res); err != nil {
  67645. return nil, err
  67646. }
  67647. ret := &NodeTypeAggregatedList{
  67648. ServerResponse: googleapi.ServerResponse{
  67649. Header: res.Header,
  67650. HTTPStatusCode: res.StatusCode,
  67651. },
  67652. }
  67653. target := &ret
  67654. if err := gensupport.DecodeResponse(target, res); err != nil {
  67655. return nil, err
  67656. }
  67657. return ret, nil
  67658. // {
  67659. // "description": "Retrieves an aggregated list of node types.",
  67660. // "httpMethod": "GET",
  67661. // "id": "compute.nodeTypes.aggregatedList",
  67662. // "parameterOrder": [
  67663. // "project"
  67664. // ],
  67665. // "parameters": {
  67666. // "filter": {
  67667. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  67668. // "location": "query",
  67669. // "type": "string"
  67670. // },
  67671. // "maxResults": {
  67672. // "default": "500",
  67673. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  67674. // "format": "uint32",
  67675. // "location": "query",
  67676. // "minimum": "0",
  67677. // "type": "integer"
  67678. // },
  67679. // "orderBy": {
  67680. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  67681. // "location": "query",
  67682. // "type": "string"
  67683. // },
  67684. // "pageToken": {
  67685. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  67686. // "location": "query",
  67687. // "type": "string"
  67688. // },
  67689. // "project": {
  67690. // "description": "Project ID for this request.",
  67691. // "location": "path",
  67692. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  67693. // "required": true,
  67694. // "type": "string"
  67695. // }
  67696. // },
  67697. // "path": "{project}/aggregated/nodeTypes",
  67698. // "response": {
  67699. // "$ref": "NodeTypeAggregatedList"
  67700. // },
  67701. // "scopes": [
  67702. // "https://www.googleapis.com/auth/cloud-platform",
  67703. // "https://www.googleapis.com/auth/compute",
  67704. // "https://www.googleapis.com/auth/compute.readonly"
  67705. // ]
  67706. // }
  67707. }
  67708. // Pages invokes f for each page of results.
  67709. // A non-nil error returned from f will halt the iteration.
  67710. // The provided context supersedes any context provided to the Context method.
  67711. func (c *NodeTypesAggregatedListCall) Pages(ctx context.Context, f func(*NodeTypeAggregatedList) error) error {
  67712. c.ctx_ = ctx
  67713. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  67714. for {
  67715. x, err := c.Do()
  67716. if err != nil {
  67717. return err
  67718. }
  67719. if err := f(x); err != nil {
  67720. return err
  67721. }
  67722. if x.NextPageToken == "" {
  67723. return nil
  67724. }
  67725. c.PageToken(x.NextPageToken)
  67726. }
  67727. }
  67728. // method id "compute.nodeTypes.get":
  67729. type NodeTypesGetCall struct {
  67730. s *Service
  67731. project string
  67732. zone string
  67733. nodeType string
  67734. urlParams_ gensupport.URLParams
  67735. ifNoneMatch_ string
  67736. ctx_ context.Context
  67737. header_ http.Header
  67738. }
  67739. // Get: Returns the specified node type. Gets a list of available node
  67740. // types by making a list() request.
  67741. func (r *NodeTypesService) Get(project string, zone string, nodeType string) *NodeTypesGetCall {
  67742. c := &NodeTypesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  67743. c.project = project
  67744. c.zone = zone
  67745. c.nodeType = nodeType
  67746. return c
  67747. }
  67748. // Fields allows partial responses to be retrieved. See
  67749. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  67750. // for more information.
  67751. func (c *NodeTypesGetCall) Fields(s ...googleapi.Field) *NodeTypesGetCall {
  67752. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  67753. return c
  67754. }
  67755. // IfNoneMatch sets the optional parameter which makes the operation
  67756. // fail if the object's ETag matches the given value. This is useful for
  67757. // getting updates only after the object has changed since the last
  67758. // request. Use googleapi.IsNotModified to check whether the response
  67759. // error from Do is the result of In-None-Match.
  67760. func (c *NodeTypesGetCall) IfNoneMatch(entityTag string) *NodeTypesGetCall {
  67761. c.ifNoneMatch_ = entityTag
  67762. return c
  67763. }
  67764. // Context sets the context to be used in this call's Do method. Any
  67765. // pending HTTP request will be aborted if the provided context is
  67766. // canceled.
  67767. func (c *NodeTypesGetCall) Context(ctx context.Context) *NodeTypesGetCall {
  67768. c.ctx_ = ctx
  67769. return c
  67770. }
  67771. // Header returns an http.Header that can be modified by the caller to
  67772. // add HTTP headers to the request.
  67773. func (c *NodeTypesGetCall) Header() http.Header {
  67774. if c.header_ == nil {
  67775. c.header_ = make(http.Header)
  67776. }
  67777. return c.header_
  67778. }
  67779. func (c *NodeTypesGetCall) doRequest(alt string) (*http.Response, error) {
  67780. reqHeaders := make(http.Header)
  67781. for k, v := range c.header_ {
  67782. reqHeaders[k] = v
  67783. }
  67784. reqHeaders.Set("User-Agent", c.s.userAgent())
  67785. if c.ifNoneMatch_ != "" {
  67786. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  67787. }
  67788. var body io.Reader = nil
  67789. c.urlParams_.Set("alt", alt)
  67790. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/nodeTypes/{nodeType}")
  67791. urls += "?" + c.urlParams_.Encode()
  67792. req, _ := http.NewRequest("GET", urls, body)
  67793. req.Header = reqHeaders
  67794. googleapi.Expand(req.URL, map[string]string{
  67795. "project": c.project,
  67796. "zone": c.zone,
  67797. "nodeType": c.nodeType,
  67798. })
  67799. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  67800. }
  67801. // Do executes the "compute.nodeTypes.get" call.
  67802. // Exactly one of *NodeType or error will be non-nil. Any non-2xx status
  67803. // code is an error. Response headers are in either
  67804. // *NodeType.ServerResponse.Header or (if a response was returned at
  67805. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  67806. // to check whether the returned error was because
  67807. // http.StatusNotModified was returned.
  67808. func (c *NodeTypesGetCall) Do(opts ...googleapi.CallOption) (*NodeType, error) {
  67809. gensupport.SetOptions(c.urlParams_, opts...)
  67810. res, err := c.doRequest("json")
  67811. if res != nil && res.StatusCode == http.StatusNotModified {
  67812. if res.Body != nil {
  67813. res.Body.Close()
  67814. }
  67815. return nil, &googleapi.Error{
  67816. Code: res.StatusCode,
  67817. Header: res.Header,
  67818. }
  67819. }
  67820. if err != nil {
  67821. return nil, err
  67822. }
  67823. defer googleapi.CloseBody(res)
  67824. if err := googleapi.CheckResponse(res); err != nil {
  67825. return nil, err
  67826. }
  67827. ret := &NodeType{
  67828. ServerResponse: googleapi.ServerResponse{
  67829. Header: res.Header,
  67830. HTTPStatusCode: res.StatusCode,
  67831. },
  67832. }
  67833. target := &ret
  67834. if err := gensupport.DecodeResponse(target, res); err != nil {
  67835. return nil, err
  67836. }
  67837. return ret, nil
  67838. // {
  67839. // "description": "Returns the specified node type. Gets a list of available node types by making a list() request.",
  67840. // "httpMethod": "GET",
  67841. // "id": "compute.nodeTypes.get",
  67842. // "parameterOrder": [
  67843. // "project",
  67844. // "zone",
  67845. // "nodeType"
  67846. // ],
  67847. // "parameters": {
  67848. // "nodeType": {
  67849. // "description": "Name of the node type to return.",
  67850. // "location": "path",
  67851. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  67852. // "required": true,
  67853. // "type": "string"
  67854. // },
  67855. // "project": {
  67856. // "description": "Project ID for this request.",
  67857. // "location": "path",
  67858. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  67859. // "required": true,
  67860. // "type": "string"
  67861. // },
  67862. // "zone": {
  67863. // "description": "The name of the zone for this request.",
  67864. // "location": "path",
  67865. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  67866. // "required": true,
  67867. // "type": "string"
  67868. // }
  67869. // },
  67870. // "path": "{project}/zones/{zone}/nodeTypes/{nodeType}",
  67871. // "response": {
  67872. // "$ref": "NodeType"
  67873. // },
  67874. // "scopes": [
  67875. // "https://www.googleapis.com/auth/cloud-platform",
  67876. // "https://www.googleapis.com/auth/compute",
  67877. // "https://www.googleapis.com/auth/compute.readonly"
  67878. // ]
  67879. // }
  67880. }
  67881. // method id "compute.nodeTypes.list":
  67882. type NodeTypesListCall struct {
  67883. s *Service
  67884. project string
  67885. zone string
  67886. urlParams_ gensupport.URLParams
  67887. ifNoneMatch_ string
  67888. ctx_ context.Context
  67889. header_ http.Header
  67890. }
  67891. // List: Retrieves a list of node types available to the specified
  67892. // project.
  67893. func (r *NodeTypesService) List(project string, zone string) *NodeTypesListCall {
  67894. c := &NodeTypesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  67895. c.project = project
  67896. c.zone = zone
  67897. return c
  67898. }
  67899. // Filter sets the optional parameter "filter": A filter expression that
  67900. // filters resources listed in the response. The expression must specify
  67901. // the field name, a comparison operator, and the value that you want to
  67902. // use for filtering. The value must be a string, a number, or a
  67903. // boolean. The comparison operator must be either =, !=, >, or <.
  67904. //
  67905. // For example, if you are filtering Compute Engine instances, you can
  67906. // exclude instances named example-instance by specifying name !=
  67907. // example-instance.
  67908. //
  67909. // You can also filter nested fields. For example, you could specify
  67910. // scheduling.automaticRestart = false to include instances only if they
  67911. // are not scheduled for automatic restarts. You can use filtering on
  67912. // nested fields to filter based on resource labels.
  67913. //
  67914. // To filter on multiple expressions, provide each separate expression
  67915. // within parentheses. For example, (scheduling.automaticRestart = true)
  67916. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  67917. // AND expression. However, you can include AND and OR expressions
  67918. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  67919. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  67920. // true).
  67921. func (c *NodeTypesListCall) Filter(filter string) *NodeTypesListCall {
  67922. c.urlParams_.Set("filter", filter)
  67923. return c
  67924. }
  67925. // MaxResults sets the optional parameter "maxResults": The maximum
  67926. // number of results per page that should be returned. If the number of
  67927. // available results is larger than maxResults, Compute Engine returns a
  67928. // nextPageToken that can be used to get the next page of results in
  67929. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  67930. // (Default: 500)
  67931. func (c *NodeTypesListCall) MaxResults(maxResults int64) *NodeTypesListCall {
  67932. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  67933. return c
  67934. }
  67935. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  67936. // a certain order. By default, results are returned in alphanumerical
  67937. // order based on the resource name.
  67938. //
  67939. // You can also sort results in descending order based on the creation
  67940. // timestamp using orderBy="creationTimestamp desc". This sorts results
  67941. // based on the creationTimestamp field in reverse chronological order
  67942. // (newest result first). Use this to sort resources like operations so
  67943. // that the newest operation is returned first.
  67944. //
  67945. // Currently, only sorting by name or creationTimestamp desc is
  67946. // supported.
  67947. func (c *NodeTypesListCall) OrderBy(orderBy string) *NodeTypesListCall {
  67948. c.urlParams_.Set("orderBy", orderBy)
  67949. return c
  67950. }
  67951. // PageToken sets the optional parameter "pageToken": Specifies a page
  67952. // token to use. Set pageToken to the nextPageToken returned by a
  67953. // previous list request to get the next page of results.
  67954. func (c *NodeTypesListCall) PageToken(pageToken string) *NodeTypesListCall {
  67955. c.urlParams_.Set("pageToken", pageToken)
  67956. return c
  67957. }
  67958. // Fields allows partial responses to be retrieved. See
  67959. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  67960. // for more information.
  67961. func (c *NodeTypesListCall) Fields(s ...googleapi.Field) *NodeTypesListCall {
  67962. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  67963. return c
  67964. }
  67965. // IfNoneMatch sets the optional parameter which makes the operation
  67966. // fail if the object's ETag matches the given value. This is useful for
  67967. // getting updates only after the object has changed since the last
  67968. // request. Use googleapi.IsNotModified to check whether the response
  67969. // error from Do is the result of In-None-Match.
  67970. func (c *NodeTypesListCall) IfNoneMatch(entityTag string) *NodeTypesListCall {
  67971. c.ifNoneMatch_ = entityTag
  67972. return c
  67973. }
  67974. // Context sets the context to be used in this call's Do method. Any
  67975. // pending HTTP request will be aborted if the provided context is
  67976. // canceled.
  67977. func (c *NodeTypesListCall) Context(ctx context.Context) *NodeTypesListCall {
  67978. c.ctx_ = ctx
  67979. return c
  67980. }
  67981. // Header returns an http.Header that can be modified by the caller to
  67982. // add HTTP headers to the request.
  67983. func (c *NodeTypesListCall) Header() http.Header {
  67984. if c.header_ == nil {
  67985. c.header_ = make(http.Header)
  67986. }
  67987. return c.header_
  67988. }
  67989. func (c *NodeTypesListCall) doRequest(alt string) (*http.Response, error) {
  67990. reqHeaders := make(http.Header)
  67991. for k, v := range c.header_ {
  67992. reqHeaders[k] = v
  67993. }
  67994. reqHeaders.Set("User-Agent", c.s.userAgent())
  67995. if c.ifNoneMatch_ != "" {
  67996. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  67997. }
  67998. var body io.Reader = nil
  67999. c.urlParams_.Set("alt", alt)
  68000. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/nodeTypes")
  68001. urls += "?" + c.urlParams_.Encode()
  68002. req, _ := http.NewRequest("GET", urls, body)
  68003. req.Header = reqHeaders
  68004. googleapi.Expand(req.URL, map[string]string{
  68005. "project": c.project,
  68006. "zone": c.zone,
  68007. })
  68008. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  68009. }
  68010. // Do executes the "compute.nodeTypes.list" call.
  68011. // Exactly one of *NodeTypeList or error will be non-nil. Any non-2xx
  68012. // status code is an error. Response headers are in either
  68013. // *NodeTypeList.ServerResponse.Header or (if a response was returned at
  68014. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  68015. // to check whether the returned error was because
  68016. // http.StatusNotModified was returned.
  68017. func (c *NodeTypesListCall) Do(opts ...googleapi.CallOption) (*NodeTypeList, error) {
  68018. gensupport.SetOptions(c.urlParams_, opts...)
  68019. res, err := c.doRequest("json")
  68020. if res != nil && res.StatusCode == http.StatusNotModified {
  68021. if res.Body != nil {
  68022. res.Body.Close()
  68023. }
  68024. return nil, &googleapi.Error{
  68025. Code: res.StatusCode,
  68026. Header: res.Header,
  68027. }
  68028. }
  68029. if err != nil {
  68030. return nil, err
  68031. }
  68032. defer googleapi.CloseBody(res)
  68033. if err := googleapi.CheckResponse(res); err != nil {
  68034. return nil, err
  68035. }
  68036. ret := &NodeTypeList{
  68037. ServerResponse: googleapi.ServerResponse{
  68038. Header: res.Header,
  68039. HTTPStatusCode: res.StatusCode,
  68040. },
  68041. }
  68042. target := &ret
  68043. if err := gensupport.DecodeResponse(target, res); err != nil {
  68044. return nil, err
  68045. }
  68046. return ret, nil
  68047. // {
  68048. // "description": "Retrieves a list of node types available to the specified project.",
  68049. // "httpMethod": "GET",
  68050. // "id": "compute.nodeTypes.list",
  68051. // "parameterOrder": [
  68052. // "project",
  68053. // "zone"
  68054. // ],
  68055. // "parameters": {
  68056. // "filter": {
  68057. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  68058. // "location": "query",
  68059. // "type": "string"
  68060. // },
  68061. // "maxResults": {
  68062. // "default": "500",
  68063. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  68064. // "format": "uint32",
  68065. // "location": "query",
  68066. // "minimum": "0",
  68067. // "type": "integer"
  68068. // },
  68069. // "orderBy": {
  68070. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  68071. // "location": "query",
  68072. // "type": "string"
  68073. // },
  68074. // "pageToken": {
  68075. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  68076. // "location": "query",
  68077. // "type": "string"
  68078. // },
  68079. // "project": {
  68080. // "description": "Project ID for this request.",
  68081. // "location": "path",
  68082. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  68083. // "required": true,
  68084. // "type": "string"
  68085. // },
  68086. // "zone": {
  68087. // "description": "The name of the zone for this request.",
  68088. // "location": "path",
  68089. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  68090. // "required": true,
  68091. // "type": "string"
  68092. // }
  68093. // },
  68094. // "path": "{project}/zones/{zone}/nodeTypes",
  68095. // "response": {
  68096. // "$ref": "NodeTypeList"
  68097. // },
  68098. // "scopes": [
  68099. // "https://www.googleapis.com/auth/cloud-platform",
  68100. // "https://www.googleapis.com/auth/compute",
  68101. // "https://www.googleapis.com/auth/compute.readonly"
  68102. // ]
  68103. // }
  68104. }
  68105. // Pages invokes f for each page of results.
  68106. // A non-nil error returned from f will halt the iteration.
  68107. // The provided context supersedes any context provided to the Context method.
  68108. func (c *NodeTypesListCall) Pages(ctx context.Context, f func(*NodeTypeList) error) error {
  68109. c.ctx_ = ctx
  68110. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  68111. for {
  68112. x, err := c.Do()
  68113. if err != nil {
  68114. return err
  68115. }
  68116. if err := f(x); err != nil {
  68117. return err
  68118. }
  68119. if x.NextPageToken == "" {
  68120. return nil
  68121. }
  68122. c.PageToken(x.NextPageToken)
  68123. }
  68124. }
  68125. // method id "compute.projects.disableXpnHost":
  68126. type ProjectsDisableXpnHostCall struct {
  68127. s *Service
  68128. project string
  68129. urlParams_ gensupport.URLParams
  68130. ctx_ context.Context
  68131. header_ http.Header
  68132. }
  68133. // DisableXpnHost: Disable this project as a shared VPC host project.
  68134. func (r *ProjectsService) DisableXpnHost(project string) *ProjectsDisableXpnHostCall {
  68135. c := &ProjectsDisableXpnHostCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  68136. c.project = project
  68137. return c
  68138. }
  68139. // RequestId sets the optional parameter "requestId": An optional
  68140. // request ID to identify requests. Specify a unique request ID so that
  68141. // if you must retry your request, the server will know to ignore the
  68142. // request if it has already been completed.
  68143. //
  68144. // For example, consider a situation where you make an initial request
  68145. // and the request times out. If you make the request again with the
  68146. // same request ID, the server can check if original operation with the
  68147. // same request ID was received, and if so, will ignore the second
  68148. // request. This prevents clients from accidentally creating duplicate
  68149. // commitments.
  68150. //
  68151. // The request ID must be a valid UUID with the exception that zero UUID
  68152. // is not supported (00000000-0000-0000-0000-000000000000).
  68153. func (c *ProjectsDisableXpnHostCall) RequestId(requestId string) *ProjectsDisableXpnHostCall {
  68154. c.urlParams_.Set("requestId", requestId)
  68155. return c
  68156. }
  68157. // Fields allows partial responses to be retrieved. See
  68158. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  68159. // for more information.
  68160. func (c *ProjectsDisableXpnHostCall) Fields(s ...googleapi.Field) *ProjectsDisableXpnHostCall {
  68161. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  68162. return c
  68163. }
  68164. // Context sets the context to be used in this call's Do method. Any
  68165. // pending HTTP request will be aborted if the provided context is
  68166. // canceled.
  68167. func (c *ProjectsDisableXpnHostCall) Context(ctx context.Context) *ProjectsDisableXpnHostCall {
  68168. c.ctx_ = ctx
  68169. return c
  68170. }
  68171. // Header returns an http.Header that can be modified by the caller to
  68172. // add HTTP headers to the request.
  68173. func (c *ProjectsDisableXpnHostCall) Header() http.Header {
  68174. if c.header_ == nil {
  68175. c.header_ = make(http.Header)
  68176. }
  68177. return c.header_
  68178. }
  68179. func (c *ProjectsDisableXpnHostCall) doRequest(alt string) (*http.Response, error) {
  68180. reqHeaders := make(http.Header)
  68181. for k, v := range c.header_ {
  68182. reqHeaders[k] = v
  68183. }
  68184. reqHeaders.Set("User-Agent", c.s.userAgent())
  68185. var body io.Reader = nil
  68186. c.urlParams_.Set("alt", alt)
  68187. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/disableXpnHost")
  68188. urls += "?" + c.urlParams_.Encode()
  68189. req, _ := http.NewRequest("POST", urls, body)
  68190. req.Header = reqHeaders
  68191. googleapi.Expand(req.URL, map[string]string{
  68192. "project": c.project,
  68193. })
  68194. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  68195. }
  68196. // Do executes the "compute.projects.disableXpnHost" call.
  68197. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  68198. // status code is an error. Response headers are in either
  68199. // *Operation.ServerResponse.Header or (if a response was returned at
  68200. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  68201. // to check whether the returned error was because
  68202. // http.StatusNotModified was returned.
  68203. func (c *ProjectsDisableXpnHostCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  68204. gensupport.SetOptions(c.urlParams_, opts...)
  68205. res, err := c.doRequest("json")
  68206. if res != nil && res.StatusCode == http.StatusNotModified {
  68207. if res.Body != nil {
  68208. res.Body.Close()
  68209. }
  68210. return nil, &googleapi.Error{
  68211. Code: res.StatusCode,
  68212. Header: res.Header,
  68213. }
  68214. }
  68215. if err != nil {
  68216. return nil, err
  68217. }
  68218. defer googleapi.CloseBody(res)
  68219. if err := googleapi.CheckResponse(res); err != nil {
  68220. return nil, err
  68221. }
  68222. ret := &Operation{
  68223. ServerResponse: googleapi.ServerResponse{
  68224. Header: res.Header,
  68225. HTTPStatusCode: res.StatusCode,
  68226. },
  68227. }
  68228. target := &ret
  68229. if err := gensupport.DecodeResponse(target, res); err != nil {
  68230. return nil, err
  68231. }
  68232. return ret, nil
  68233. // {
  68234. // "description": "Disable this project as a shared VPC host project.",
  68235. // "httpMethod": "POST",
  68236. // "id": "compute.projects.disableXpnHost",
  68237. // "parameterOrder": [
  68238. // "project"
  68239. // ],
  68240. // "parameters": {
  68241. // "project": {
  68242. // "description": "Project ID for this request.",
  68243. // "location": "path",
  68244. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  68245. // "required": true,
  68246. // "type": "string"
  68247. // },
  68248. // "requestId": {
  68249. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  68250. // "location": "query",
  68251. // "type": "string"
  68252. // }
  68253. // },
  68254. // "path": "{project}/disableXpnHost",
  68255. // "response": {
  68256. // "$ref": "Operation"
  68257. // },
  68258. // "scopes": [
  68259. // "https://www.googleapis.com/auth/cloud-platform",
  68260. // "https://www.googleapis.com/auth/compute"
  68261. // ]
  68262. // }
  68263. }
  68264. // method id "compute.projects.disableXpnResource":
  68265. type ProjectsDisableXpnResourceCall struct {
  68266. s *Service
  68267. project string
  68268. projectsdisablexpnresourcerequest *ProjectsDisableXpnResourceRequest
  68269. urlParams_ gensupport.URLParams
  68270. ctx_ context.Context
  68271. header_ http.Header
  68272. }
  68273. // DisableXpnResource: Disable a serivce resource (a.k.a service
  68274. // project) associated with this host project.
  68275. func (r *ProjectsService) DisableXpnResource(project string, projectsdisablexpnresourcerequest *ProjectsDisableXpnResourceRequest) *ProjectsDisableXpnResourceCall {
  68276. c := &ProjectsDisableXpnResourceCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  68277. c.project = project
  68278. c.projectsdisablexpnresourcerequest = projectsdisablexpnresourcerequest
  68279. return c
  68280. }
  68281. // RequestId sets the optional parameter "requestId": An optional
  68282. // request ID to identify requests. Specify a unique request ID so that
  68283. // if you must retry your request, the server will know to ignore the
  68284. // request if it has already been completed.
  68285. //
  68286. // For example, consider a situation where you make an initial request
  68287. // and the request times out. If you make the request again with the
  68288. // same request ID, the server can check if original operation with the
  68289. // same request ID was received, and if so, will ignore the second
  68290. // request. This prevents clients from accidentally creating duplicate
  68291. // commitments.
  68292. //
  68293. // The request ID must be a valid UUID with the exception that zero UUID
  68294. // is not supported (00000000-0000-0000-0000-000000000000).
  68295. func (c *ProjectsDisableXpnResourceCall) RequestId(requestId string) *ProjectsDisableXpnResourceCall {
  68296. c.urlParams_.Set("requestId", requestId)
  68297. return c
  68298. }
  68299. // Fields allows partial responses to be retrieved. See
  68300. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  68301. // for more information.
  68302. func (c *ProjectsDisableXpnResourceCall) Fields(s ...googleapi.Field) *ProjectsDisableXpnResourceCall {
  68303. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  68304. return c
  68305. }
  68306. // Context sets the context to be used in this call's Do method. Any
  68307. // pending HTTP request will be aborted if the provided context is
  68308. // canceled.
  68309. func (c *ProjectsDisableXpnResourceCall) Context(ctx context.Context) *ProjectsDisableXpnResourceCall {
  68310. c.ctx_ = ctx
  68311. return c
  68312. }
  68313. // Header returns an http.Header that can be modified by the caller to
  68314. // add HTTP headers to the request.
  68315. func (c *ProjectsDisableXpnResourceCall) Header() http.Header {
  68316. if c.header_ == nil {
  68317. c.header_ = make(http.Header)
  68318. }
  68319. return c.header_
  68320. }
  68321. func (c *ProjectsDisableXpnResourceCall) doRequest(alt string) (*http.Response, error) {
  68322. reqHeaders := make(http.Header)
  68323. for k, v := range c.header_ {
  68324. reqHeaders[k] = v
  68325. }
  68326. reqHeaders.Set("User-Agent", c.s.userAgent())
  68327. var body io.Reader = nil
  68328. body, err := googleapi.WithoutDataWrapper.JSONReader(c.projectsdisablexpnresourcerequest)
  68329. if err != nil {
  68330. return nil, err
  68331. }
  68332. reqHeaders.Set("Content-Type", "application/json")
  68333. c.urlParams_.Set("alt", alt)
  68334. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/disableXpnResource")
  68335. urls += "?" + c.urlParams_.Encode()
  68336. req, _ := http.NewRequest("POST", urls, body)
  68337. req.Header = reqHeaders
  68338. googleapi.Expand(req.URL, map[string]string{
  68339. "project": c.project,
  68340. })
  68341. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  68342. }
  68343. // Do executes the "compute.projects.disableXpnResource" call.
  68344. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  68345. // status code is an error. Response headers are in either
  68346. // *Operation.ServerResponse.Header or (if a response was returned at
  68347. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  68348. // to check whether the returned error was because
  68349. // http.StatusNotModified was returned.
  68350. func (c *ProjectsDisableXpnResourceCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  68351. gensupport.SetOptions(c.urlParams_, opts...)
  68352. res, err := c.doRequest("json")
  68353. if res != nil && res.StatusCode == http.StatusNotModified {
  68354. if res.Body != nil {
  68355. res.Body.Close()
  68356. }
  68357. return nil, &googleapi.Error{
  68358. Code: res.StatusCode,
  68359. Header: res.Header,
  68360. }
  68361. }
  68362. if err != nil {
  68363. return nil, err
  68364. }
  68365. defer googleapi.CloseBody(res)
  68366. if err := googleapi.CheckResponse(res); err != nil {
  68367. return nil, err
  68368. }
  68369. ret := &Operation{
  68370. ServerResponse: googleapi.ServerResponse{
  68371. Header: res.Header,
  68372. HTTPStatusCode: res.StatusCode,
  68373. },
  68374. }
  68375. target := &ret
  68376. if err := gensupport.DecodeResponse(target, res); err != nil {
  68377. return nil, err
  68378. }
  68379. return ret, nil
  68380. // {
  68381. // "description": "Disable a serivce resource (a.k.a service project) associated with this host project.",
  68382. // "httpMethod": "POST",
  68383. // "id": "compute.projects.disableXpnResource",
  68384. // "parameterOrder": [
  68385. // "project"
  68386. // ],
  68387. // "parameters": {
  68388. // "project": {
  68389. // "description": "Project ID for this request.",
  68390. // "location": "path",
  68391. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  68392. // "required": true,
  68393. // "type": "string"
  68394. // },
  68395. // "requestId": {
  68396. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  68397. // "location": "query",
  68398. // "type": "string"
  68399. // }
  68400. // },
  68401. // "path": "{project}/disableXpnResource",
  68402. // "request": {
  68403. // "$ref": "ProjectsDisableXpnResourceRequest"
  68404. // },
  68405. // "response": {
  68406. // "$ref": "Operation"
  68407. // },
  68408. // "scopes": [
  68409. // "https://www.googleapis.com/auth/cloud-platform",
  68410. // "https://www.googleapis.com/auth/compute"
  68411. // ]
  68412. // }
  68413. }
  68414. // method id "compute.projects.enableXpnHost":
  68415. type ProjectsEnableXpnHostCall struct {
  68416. s *Service
  68417. project string
  68418. urlParams_ gensupport.URLParams
  68419. ctx_ context.Context
  68420. header_ http.Header
  68421. }
  68422. // EnableXpnHost: Enable this project as a shared VPC host project.
  68423. func (r *ProjectsService) EnableXpnHost(project string) *ProjectsEnableXpnHostCall {
  68424. c := &ProjectsEnableXpnHostCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  68425. c.project = project
  68426. return c
  68427. }
  68428. // RequestId sets the optional parameter "requestId": An optional
  68429. // request ID to identify requests. Specify a unique request ID so that
  68430. // if you must retry your request, the server will know to ignore the
  68431. // request if it has already been completed.
  68432. //
  68433. // For example, consider a situation where you make an initial request
  68434. // and the request times out. If you make the request again with the
  68435. // same request ID, the server can check if original operation with the
  68436. // same request ID was received, and if so, will ignore the second
  68437. // request. This prevents clients from accidentally creating duplicate
  68438. // commitments.
  68439. //
  68440. // The request ID must be a valid UUID with the exception that zero UUID
  68441. // is not supported (00000000-0000-0000-0000-000000000000).
  68442. func (c *ProjectsEnableXpnHostCall) RequestId(requestId string) *ProjectsEnableXpnHostCall {
  68443. c.urlParams_.Set("requestId", requestId)
  68444. return c
  68445. }
  68446. // Fields allows partial responses to be retrieved. See
  68447. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  68448. // for more information.
  68449. func (c *ProjectsEnableXpnHostCall) Fields(s ...googleapi.Field) *ProjectsEnableXpnHostCall {
  68450. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  68451. return c
  68452. }
  68453. // Context sets the context to be used in this call's Do method. Any
  68454. // pending HTTP request will be aborted if the provided context is
  68455. // canceled.
  68456. func (c *ProjectsEnableXpnHostCall) Context(ctx context.Context) *ProjectsEnableXpnHostCall {
  68457. c.ctx_ = ctx
  68458. return c
  68459. }
  68460. // Header returns an http.Header that can be modified by the caller to
  68461. // add HTTP headers to the request.
  68462. func (c *ProjectsEnableXpnHostCall) Header() http.Header {
  68463. if c.header_ == nil {
  68464. c.header_ = make(http.Header)
  68465. }
  68466. return c.header_
  68467. }
  68468. func (c *ProjectsEnableXpnHostCall) doRequest(alt string) (*http.Response, error) {
  68469. reqHeaders := make(http.Header)
  68470. for k, v := range c.header_ {
  68471. reqHeaders[k] = v
  68472. }
  68473. reqHeaders.Set("User-Agent", c.s.userAgent())
  68474. var body io.Reader = nil
  68475. c.urlParams_.Set("alt", alt)
  68476. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/enableXpnHost")
  68477. urls += "?" + c.urlParams_.Encode()
  68478. req, _ := http.NewRequest("POST", urls, body)
  68479. req.Header = reqHeaders
  68480. googleapi.Expand(req.URL, map[string]string{
  68481. "project": c.project,
  68482. })
  68483. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  68484. }
  68485. // Do executes the "compute.projects.enableXpnHost" call.
  68486. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  68487. // status code is an error. Response headers are in either
  68488. // *Operation.ServerResponse.Header or (if a response was returned at
  68489. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  68490. // to check whether the returned error was because
  68491. // http.StatusNotModified was returned.
  68492. func (c *ProjectsEnableXpnHostCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  68493. gensupport.SetOptions(c.urlParams_, opts...)
  68494. res, err := c.doRequest("json")
  68495. if res != nil && res.StatusCode == http.StatusNotModified {
  68496. if res.Body != nil {
  68497. res.Body.Close()
  68498. }
  68499. return nil, &googleapi.Error{
  68500. Code: res.StatusCode,
  68501. Header: res.Header,
  68502. }
  68503. }
  68504. if err != nil {
  68505. return nil, err
  68506. }
  68507. defer googleapi.CloseBody(res)
  68508. if err := googleapi.CheckResponse(res); err != nil {
  68509. return nil, err
  68510. }
  68511. ret := &Operation{
  68512. ServerResponse: googleapi.ServerResponse{
  68513. Header: res.Header,
  68514. HTTPStatusCode: res.StatusCode,
  68515. },
  68516. }
  68517. target := &ret
  68518. if err := gensupport.DecodeResponse(target, res); err != nil {
  68519. return nil, err
  68520. }
  68521. return ret, nil
  68522. // {
  68523. // "description": "Enable this project as a shared VPC host project.",
  68524. // "httpMethod": "POST",
  68525. // "id": "compute.projects.enableXpnHost",
  68526. // "parameterOrder": [
  68527. // "project"
  68528. // ],
  68529. // "parameters": {
  68530. // "project": {
  68531. // "description": "Project ID for this request.",
  68532. // "location": "path",
  68533. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  68534. // "required": true,
  68535. // "type": "string"
  68536. // },
  68537. // "requestId": {
  68538. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  68539. // "location": "query",
  68540. // "type": "string"
  68541. // }
  68542. // },
  68543. // "path": "{project}/enableXpnHost",
  68544. // "response": {
  68545. // "$ref": "Operation"
  68546. // },
  68547. // "scopes": [
  68548. // "https://www.googleapis.com/auth/cloud-platform",
  68549. // "https://www.googleapis.com/auth/compute"
  68550. // ]
  68551. // }
  68552. }
  68553. // method id "compute.projects.enableXpnResource":
  68554. type ProjectsEnableXpnResourceCall struct {
  68555. s *Service
  68556. project string
  68557. projectsenablexpnresourcerequest *ProjectsEnableXpnResourceRequest
  68558. urlParams_ gensupport.URLParams
  68559. ctx_ context.Context
  68560. header_ http.Header
  68561. }
  68562. // EnableXpnResource: Enable service resource (a.k.a service project)
  68563. // for a host project, so that subnets in the host project can be used
  68564. // by instances in the service project.
  68565. func (r *ProjectsService) EnableXpnResource(project string, projectsenablexpnresourcerequest *ProjectsEnableXpnResourceRequest) *ProjectsEnableXpnResourceCall {
  68566. c := &ProjectsEnableXpnResourceCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  68567. c.project = project
  68568. c.projectsenablexpnresourcerequest = projectsenablexpnresourcerequest
  68569. return c
  68570. }
  68571. // RequestId sets the optional parameter "requestId": An optional
  68572. // request ID to identify requests. Specify a unique request ID so that
  68573. // if you must retry your request, the server will know to ignore the
  68574. // request if it has already been completed.
  68575. //
  68576. // For example, consider a situation where you make an initial request
  68577. // and the request times out. If you make the request again with the
  68578. // same request ID, the server can check if original operation with the
  68579. // same request ID was received, and if so, will ignore the second
  68580. // request. This prevents clients from accidentally creating duplicate
  68581. // commitments.
  68582. //
  68583. // The request ID must be a valid UUID with the exception that zero UUID
  68584. // is not supported (00000000-0000-0000-0000-000000000000).
  68585. func (c *ProjectsEnableXpnResourceCall) RequestId(requestId string) *ProjectsEnableXpnResourceCall {
  68586. c.urlParams_.Set("requestId", requestId)
  68587. return c
  68588. }
  68589. // Fields allows partial responses to be retrieved. See
  68590. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  68591. // for more information.
  68592. func (c *ProjectsEnableXpnResourceCall) Fields(s ...googleapi.Field) *ProjectsEnableXpnResourceCall {
  68593. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  68594. return c
  68595. }
  68596. // Context sets the context to be used in this call's Do method. Any
  68597. // pending HTTP request will be aborted if the provided context is
  68598. // canceled.
  68599. func (c *ProjectsEnableXpnResourceCall) Context(ctx context.Context) *ProjectsEnableXpnResourceCall {
  68600. c.ctx_ = ctx
  68601. return c
  68602. }
  68603. // Header returns an http.Header that can be modified by the caller to
  68604. // add HTTP headers to the request.
  68605. func (c *ProjectsEnableXpnResourceCall) Header() http.Header {
  68606. if c.header_ == nil {
  68607. c.header_ = make(http.Header)
  68608. }
  68609. return c.header_
  68610. }
  68611. func (c *ProjectsEnableXpnResourceCall) doRequest(alt string) (*http.Response, error) {
  68612. reqHeaders := make(http.Header)
  68613. for k, v := range c.header_ {
  68614. reqHeaders[k] = v
  68615. }
  68616. reqHeaders.Set("User-Agent", c.s.userAgent())
  68617. var body io.Reader = nil
  68618. body, err := googleapi.WithoutDataWrapper.JSONReader(c.projectsenablexpnresourcerequest)
  68619. if err != nil {
  68620. return nil, err
  68621. }
  68622. reqHeaders.Set("Content-Type", "application/json")
  68623. c.urlParams_.Set("alt", alt)
  68624. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/enableXpnResource")
  68625. urls += "?" + c.urlParams_.Encode()
  68626. req, _ := http.NewRequest("POST", urls, body)
  68627. req.Header = reqHeaders
  68628. googleapi.Expand(req.URL, map[string]string{
  68629. "project": c.project,
  68630. })
  68631. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  68632. }
  68633. // Do executes the "compute.projects.enableXpnResource" call.
  68634. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  68635. // status code is an error. Response headers are in either
  68636. // *Operation.ServerResponse.Header or (if a response was returned at
  68637. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  68638. // to check whether the returned error was because
  68639. // http.StatusNotModified was returned.
  68640. func (c *ProjectsEnableXpnResourceCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  68641. gensupport.SetOptions(c.urlParams_, opts...)
  68642. res, err := c.doRequest("json")
  68643. if res != nil && res.StatusCode == http.StatusNotModified {
  68644. if res.Body != nil {
  68645. res.Body.Close()
  68646. }
  68647. return nil, &googleapi.Error{
  68648. Code: res.StatusCode,
  68649. Header: res.Header,
  68650. }
  68651. }
  68652. if err != nil {
  68653. return nil, err
  68654. }
  68655. defer googleapi.CloseBody(res)
  68656. if err := googleapi.CheckResponse(res); err != nil {
  68657. return nil, err
  68658. }
  68659. ret := &Operation{
  68660. ServerResponse: googleapi.ServerResponse{
  68661. Header: res.Header,
  68662. HTTPStatusCode: res.StatusCode,
  68663. },
  68664. }
  68665. target := &ret
  68666. if err := gensupport.DecodeResponse(target, res); err != nil {
  68667. return nil, err
  68668. }
  68669. return ret, nil
  68670. // {
  68671. // "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.",
  68672. // "httpMethod": "POST",
  68673. // "id": "compute.projects.enableXpnResource",
  68674. // "parameterOrder": [
  68675. // "project"
  68676. // ],
  68677. // "parameters": {
  68678. // "project": {
  68679. // "description": "Project ID for this request.",
  68680. // "location": "path",
  68681. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  68682. // "required": true,
  68683. // "type": "string"
  68684. // },
  68685. // "requestId": {
  68686. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  68687. // "location": "query",
  68688. // "type": "string"
  68689. // }
  68690. // },
  68691. // "path": "{project}/enableXpnResource",
  68692. // "request": {
  68693. // "$ref": "ProjectsEnableXpnResourceRequest"
  68694. // },
  68695. // "response": {
  68696. // "$ref": "Operation"
  68697. // },
  68698. // "scopes": [
  68699. // "https://www.googleapis.com/auth/cloud-platform",
  68700. // "https://www.googleapis.com/auth/compute"
  68701. // ]
  68702. // }
  68703. }
  68704. // method id "compute.projects.get":
  68705. type ProjectsGetCall struct {
  68706. s *Service
  68707. project string
  68708. urlParams_ gensupport.URLParams
  68709. ifNoneMatch_ string
  68710. ctx_ context.Context
  68711. header_ http.Header
  68712. }
  68713. // Get: Returns the specified Project resource.
  68714. // For details, see https://cloud.google.com/compute/docs/reference/latest/projects/get
  68715. func (r *ProjectsService) Get(project string) *ProjectsGetCall {
  68716. c := &ProjectsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  68717. c.project = project
  68718. return c
  68719. }
  68720. // Fields allows partial responses to be retrieved. See
  68721. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  68722. // for more information.
  68723. func (c *ProjectsGetCall) Fields(s ...googleapi.Field) *ProjectsGetCall {
  68724. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  68725. return c
  68726. }
  68727. // IfNoneMatch sets the optional parameter which makes the operation
  68728. // fail if the object's ETag matches the given value. This is useful for
  68729. // getting updates only after the object has changed since the last
  68730. // request. Use googleapi.IsNotModified to check whether the response
  68731. // error from Do is the result of In-None-Match.
  68732. func (c *ProjectsGetCall) IfNoneMatch(entityTag string) *ProjectsGetCall {
  68733. c.ifNoneMatch_ = entityTag
  68734. return c
  68735. }
  68736. // Context sets the context to be used in this call's Do method. Any
  68737. // pending HTTP request will be aborted if the provided context is
  68738. // canceled.
  68739. func (c *ProjectsGetCall) Context(ctx context.Context) *ProjectsGetCall {
  68740. c.ctx_ = ctx
  68741. return c
  68742. }
  68743. // Header returns an http.Header that can be modified by the caller to
  68744. // add HTTP headers to the request.
  68745. func (c *ProjectsGetCall) Header() http.Header {
  68746. if c.header_ == nil {
  68747. c.header_ = make(http.Header)
  68748. }
  68749. return c.header_
  68750. }
  68751. func (c *ProjectsGetCall) doRequest(alt string) (*http.Response, error) {
  68752. reqHeaders := make(http.Header)
  68753. for k, v := range c.header_ {
  68754. reqHeaders[k] = v
  68755. }
  68756. reqHeaders.Set("User-Agent", c.s.userAgent())
  68757. if c.ifNoneMatch_ != "" {
  68758. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  68759. }
  68760. var body io.Reader = nil
  68761. c.urlParams_.Set("alt", alt)
  68762. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}")
  68763. urls += "?" + c.urlParams_.Encode()
  68764. req, _ := http.NewRequest("GET", urls, body)
  68765. req.Header = reqHeaders
  68766. googleapi.Expand(req.URL, map[string]string{
  68767. "project": c.project,
  68768. })
  68769. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  68770. }
  68771. // Do executes the "compute.projects.get" call.
  68772. // Exactly one of *Project or error will be non-nil. Any non-2xx status
  68773. // code is an error. Response headers are in either
  68774. // *Project.ServerResponse.Header or (if a response was returned at all)
  68775. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  68776. // check whether the returned error was because http.StatusNotModified
  68777. // was returned.
  68778. func (c *ProjectsGetCall) Do(opts ...googleapi.CallOption) (*Project, error) {
  68779. gensupport.SetOptions(c.urlParams_, opts...)
  68780. res, err := c.doRequest("json")
  68781. if res != nil && res.StatusCode == http.StatusNotModified {
  68782. if res.Body != nil {
  68783. res.Body.Close()
  68784. }
  68785. return nil, &googleapi.Error{
  68786. Code: res.StatusCode,
  68787. Header: res.Header,
  68788. }
  68789. }
  68790. if err != nil {
  68791. return nil, err
  68792. }
  68793. defer googleapi.CloseBody(res)
  68794. if err := googleapi.CheckResponse(res); err != nil {
  68795. return nil, err
  68796. }
  68797. ret := &Project{
  68798. ServerResponse: googleapi.ServerResponse{
  68799. Header: res.Header,
  68800. HTTPStatusCode: res.StatusCode,
  68801. },
  68802. }
  68803. target := &ret
  68804. if err := gensupport.DecodeResponse(target, res); err != nil {
  68805. return nil, err
  68806. }
  68807. return ret, nil
  68808. // {
  68809. // "description": "Returns the specified Project resource.",
  68810. // "httpMethod": "GET",
  68811. // "id": "compute.projects.get",
  68812. // "parameterOrder": [
  68813. // "project"
  68814. // ],
  68815. // "parameters": {
  68816. // "project": {
  68817. // "description": "Project ID for this request.",
  68818. // "location": "path",
  68819. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  68820. // "required": true,
  68821. // "type": "string"
  68822. // }
  68823. // },
  68824. // "path": "{project}",
  68825. // "response": {
  68826. // "$ref": "Project"
  68827. // },
  68828. // "scopes": [
  68829. // "https://www.googleapis.com/auth/cloud-platform",
  68830. // "https://www.googleapis.com/auth/compute",
  68831. // "https://www.googleapis.com/auth/compute.readonly"
  68832. // ]
  68833. // }
  68834. }
  68835. // method id "compute.projects.getXpnHost":
  68836. type ProjectsGetXpnHostCall struct {
  68837. s *Service
  68838. project string
  68839. urlParams_ gensupport.URLParams
  68840. ifNoneMatch_ string
  68841. ctx_ context.Context
  68842. header_ http.Header
  68843. }
  68844. // GetXpnHost: Gets the shared VPC host project that this project links
  68845. // to. May be empty if no link exists.
  68846. func (r *ProjectsService) GetXpnHost(project string) *ProjectsGetXpnHostCall {
  68847. c := &ProjectsGetXpnHostCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  68848. c.project = project
  68849. return c
  68850. }
  68851. // Fields allows partial responses to be retrieved. See
  68852. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  68853. // for more information.
  68854. func (c *ProjectsGetXpnHostCall) Fields(s ...googleapi.Field) *ProjectsGetXpnHostCall {
  68855. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  68856. return c
  68857. }
  68858. // IfNoneMatch sets the optional parameter which makes the operation
  68859. // fail if the object's ETag matches the given value. This is useful for
  68860. // getting updates only after the object has changed since the last
  68861. // request. Use googleapi.IsNotModified to check whether the response
  68862. // error from Do is the result of In-None-Match.
  68863. func (c *ProjectsGetXpnHostCall) IfNoneMatch(entityTag string) *ProjectsGetXpnHostCall {
  68864. c.ifNoneMatch_ = entityTag
  68865. return c
  68866. }
  68867. // Context sets the context to be used in this call's Do method. Any
  68868. // pending HTTP request will be aborted if the provided context is
  68869. // canceled.
  68870. func (c *ProjectsGetXpnHostCall) Context(ctx context.Context) *ProjectsGetXpnHostCall {
  68871. c.ctx_ = ctx
  68872. return c
  68873. }
  68874. // Header returns an http.Header that can be modified by the caller to
  68875. // add HTTP headers to the request.
  68876. func (c *ProjectsGetXpnHostCall) Header() http.Header {
  68877. if c.header_ == nil {
  68878. c.header_ = make(http.Header)
  68879. }
  68880. return c.header_
  68881. }
  68882. func (c *ProjectsGetXpnHostCall) doRequest(alt string) (*http.Response, error) {
  68883. reqHeaders := make(http.Header)
  68884. for k, v := range c.header_ {
  68885. reqHeaders[k] = v
  68886. }
  68887. reqHeaders.Set("User-Agent", c.s.userAgent())
  68888. if c.ifNoneMatch_ != "" {
  68889. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  68890. }
  68891. var body io.Reader = nil
  68892. c.urlParams_.Set("alt", alt)
  68893. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/getXpnHost")
  68894. urls += "?" + c.urlParams_.Encode()
  68895. req, _ := http.NewRequest("GET", urls, body)
  68896. req.Header = reqHeaders
  68897. googleapi.Expand(req.URL, map[string]string{
  68898. "project": c.project,
  68899. })
  68900. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  68901. }
  68902. // Do executes the "compute.projects.getXpnHost" call.
  68903. // Exactly one of *Project or error will be non-nil. Any non-2xx status
  68904. // code is an error. Response headers are in either
  68905. // *Project.ServerResponse.Header or (if a response was returned at all)
  68906. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  68907. // check whether the returned error was because http.StatusNotModified
  68908. // was returned.
  68909. func (c *ProjectsGetXpnHostCall) Do(opts ...googleapi.CallOption) (*Project, error) {
  68910. gensupport.SetOptions(c.urlParams_, opts...)
  68911. res, err := c.doRequest("json")
  68912. if res != nil && res.StatusCode == http.StatusNotModified {
  68913. if res.Body != nil {
  68914. res.Body.Close()
  68915. }
  68916. return nil, &googleapi.Error{
  68917. Code: res.StatusCode,
  68918. Header: res.Header,
  68919. }
  68920. }
  68921. if err != nil {
  68922. return nil, err
  68923. }
  68924. defer googleapi.CloseBody(res)
  68925. if err := googleapi.CheckResponse(res); err != nil {
  68926. return nil, err
  68927. }
  68928. ret := &Project{
  68929. ServerResponse: googleapi.ServerResponse{
  68930. Header: res.Header,
  68931. HTTPStatusCode: res.StatusCode,
  68932. },
  68933. }
  68934. target := &ret
  68935. if err := gensupport.DecodeResponse(target, res); err != nil {
  68936. return nil, err
  68937. }
  68938. return ret, nil
  68939. // {
  68940. // "description": "Gets the shared VPC host project that this project links to. May be empty if no link exists.",
  68941. // "httpMethod": "GET",
  68942. // "id": "compute.projects.getXpnHost",
  68943. // "parameterOrder": [
  68944. // "project"
  68945. // ],
  68946. // "parameters": {
  68947. // "project": {
  68948. // "description": "Project ID for this request.",
  68949. // "location": "path",
  68950. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  68951. // "required": true,
  68952. // "type": "string"
  68953. // }
  68954. // },
  68955. // "path": "{project}/getXpnHost",
  68956. // "response": {
  68957. // "$ref": "Project"
  68958. // },
  68959. // "scopes": [
  68960. // "https://www.googleapis.com/auth/cloud-platform",
  68961. // "https://www.googleapis.com/auth/compute"
  68962. // ]
  68963. // }
  68964. }
  68965. // method id "compute.projects.getXpnResources":
  68966. type ProjectsGetXpnResourcesCall struct {
  68967. s *Service
  68968. project string
  68969. urlParams_ gensupport.URLParams
  68970. ifNoneMatch_ string
  68971. ctx_ context.Context
  68972. header_ http.Header
  68973. }
  68974. // GetXpnResources: Gets service resources (a.k.a service project)
  68975. // associated with this host project.
  68976. func (r *ProjectsService) GetXpnResources(project string) *ProjectsGetXpnResourcesCall {
  68977. c := &ProjectsGetXpnResourcesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  68978. c.project = project
  68979. return c
  68980. }
  68981. // Filter sets the optional parameter "filter":
  68982. func (c *ProjectsGetXpnResourcesCall) Filter(filter string) *ProjectsGetXpnResourcesCall {
  68983. c.urlParams_.Set("filter", filter)
  68984. return c
  68985. }
  68986. // MaxResults sets the optional parameter "maxResults":
  68987. func (c *ProjectsGetXpnResourcesCall) MaxResults(maxResults int64) *ProjectsGetXpnResourcesCall {
  68988. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  68989. return c
  68990. }
  68991. // OrderBy sets the optional parameter "order_by":
  68992. func (c *ProjectsGetXpnResourcesCall) OrderBy(orderBy string) *ProjectsGetXpnResourcesCall {
  68993. c.urlParams_.Set("order_by", orderBy)
  68994. return c
  68995. }
  68996. // PageToken sets the optional parameter "pageToken":
  68997. func (c *ProjectsGetXpnResourcesCall) PageToken(pageToken string) *ProjectsGetXpnResourcesCall {
  68998. c.urlParams_.Set("pageToken", pageToken)
  68999. return c
  69000. }
  69001. // Fields allows partial responses to be retrieved. See
  69002. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  69003. // for more information.
  69004. func (c *ProjectsGetXpnResourcesCall) Fields(s ...googleapi.Field) *ProjectsGetXpnResourcesCall {
  69005. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  69006. return c
  69007. }
  69008. // IfNoneMatch sets the optional parameter which makes the operation
  69009. // fail if the object's ETag matches the given value. This is useful for
  69010. // getting updates only after the object has changed since the last
  69011. // request. Use googleapi.IsNotModified to check whether the response
  69012. // error from Do is the result of In-None-Match.
  69013. func (c *ProjectsGetXpnResourcesCall) IfNoneMatch(entityTag string) *ProjectsGetXpnResourcesCall {
  69014. c.ifNoneMatch_ = entityTag
  69015. return c
  69016. }
  69017. // Context sets the context to be used in this call's Do method. Any
  69018. // pending HTTP request will be aborted if the provided context is
  69019. // canceled.
  69020. func (c *ProjectsGetXpnResourcesCall) Context(ctx context.Context) *ProjectsGetXpnResourcesCall {
  69021. c.ctx_ = ctx
  69022. return c
  69023. }
  69024. // Header returns an http.Header that can be modified by the caller to
  69025. // add HTTP headers to the request.
  69026. func (c *ProjectsGetXpnResourcesCall) Header() http.Header {
  69027. if c.header_ == nil {
  69028. c.header_ = make(http.Header)
  69029. }
  69030. return c.header_
  69031. }
  69032. func (c *ProjectsGetXpnResourcesCall) doRequest(alt string) (*http.Response, error) {
  69033. reqHeaders := make(http.Header)
  69034. for k, v := range c.header_ {
  69035. reqHeaders[k] = v
  69036. }
  69037. reqHeaders.Set("User-Agent", c.s.userAgent())
  69038. if c.ifNoneMatch_ != "" {
  69039. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  69040. }
  69041. var body io.Reader = nil
  69042. c.urlParams_.Set("alt", alt)
  69043. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/getXpnResources")
  69044. urls += "?" + c.urlParams_.Encode()
  69045. req, _ := http.NewRequest("GET", urls, body)
  69046. req.Header = reqHeaders
  69047. googleapi.Expand(req.URL, map[string]string{
  69048. "project": c.project,
  69049. })
  69050. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  69051. }
  69052. // Do executes the "compute.projects.getXpnResources" call.
  69053. // Exactly one of *ProjectsGetXpnResources or error will be non-nil. Any
  69054. // non-2xx status code is an error. Response headers are in either
  69055. // *ProjectsGetXpnResources.ServerResponse.Header or (if a response was
  69056. // returned at all) in error.(*googleapi.Error).Header. Use
  69057. // googleapi.IsNotModified to check whether the returned error was
  69058. // because http.StatusNotModified was returned.
  69059. func (c *ProjectsGetXpnResourcesCall) Do(opts ...googleapi.CallOption) (*ProjectsGetXpnResources, error) {
  69060. gensupport.SetOptions(c.urlParams_, opts...)
  69061. res, err := c.doRequest("json")
  69062. if res != nil && res.StatusCode == http.StatusNotModified {
  69063. if res.Body != nil {
  69064. res.Body.Close()
  69065. }
  69066. return nil, &googleapi.Error{
  69067. Code: res.StatusCode,
  69068. Header: res.Header,
  69069. }
  69070. }
  69071. if err != nil {
  69072. return nil, err
  69073. }
  69074. defer googleapi.CloseBody(res)
  69075. if err := googleapi.CheckResponse(res); err != nil {
  69076. return nil, err
  69077. }
  69078. ret := &ProjectsGetXpnResources{
  69079. ServerResponse: googleapi.ServerResponse{
  69080. Header: res.Header,
  69081. HTTPStatusCode: res.StatusCode,
  69082. },
  69083. }
  69084. target := &ret
  69085. if err := gensupport.DecodeResponse(target, res); err != nil {
  69086. return nil, err
  69087. }
  69088. return ret, nil
  69089. // {
  69090. // "description": "Gets service resources (a.k.a service project) associated with this host project.",
  69091. // "httpMethod": "GET",
  69092. // "id": "compute.projects.getXpnResources",
  69093. // "parameterOrder": [
  69094. // "project"
  69095. // ],
  69096. // "parameters": {
  69097. // "filter": {
  69098. // "location": "query",
  69099. // "type": "string"
  69100. // },
  69101. // "maxResults": {
  69102. // "default": "500",
  69103. // "format": "uint32",
  69104. // "location": "query",
  69105. // "minimum": "0",
  69106. // "type": "integer"
  69107. // },
  69108. // "order_by": {
  69109. // "location": "query",
  69110. // "type": "string"
  69111. // },
  69112. // "pageToken": {
  69113. // "location": "query",
  69114. // "type": "string"
  69115. // },
  69116. // "project": {
  69117. // "description": "Project ID for this request.",
  69118. // "location": "path",
  69119. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  69120. // "required": true,
  69121. // "type": "string"
  69122. // }
  69123. // },
  69124. // "path": "{project}/getXpnResources",
  69125. // "response": {
  69126. // "$ref": "ProjectsGetXpnResources"
  69127. // },
  69128. // "scopes": [
  69129. // "https://www.googleapis.com/auth/cloud-platform",
  69130. // "https://www.googleapis.com/auth/compute"
  69131. // ]
  69132. // }
  69133. }
  69134. // Pages invokes f for each page of results.
  69135. // A non-nil error returned from f will halt the iteration.
  69136. // The provided context supersedes any context provided to the Context method.
  69137. func (c *ProjectsGetXpnResourcesCall) Pages(ctx context.Context, f func(*ProjectsGetXpnResources) error) error {
  69138. c.ctx_ = ctx
  69139. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  69140. for {
  69141. x, err := c.Do()
  69142. if err != nil {
  69143. return err
  69144. }
  69145. if err := f(x); err != nil {
  69146. return err
  69147. }
  69148. if x.NextPageToken == "" {
  69149. return nil
  69150. }
  69151. c.PageToken(x.NextPageToken)
  69152. }
  69153. }
  69154. // method id "compute.projects.listXpnHosts":
  69155. type ProjectsListXpnHostsCall struct {
  69156. s *Service
  69157. project string
  69158. projectslistxpnhostsrequest *ProjectsListXpnHostsRequest
  69159. urlParams_ gensupport.URLParams
  69160. ctx_ context.Context
  69161. header_ http.Header
  69162. }
  69163. // ListXpnHosts: Lists all shared VPC host projects visible to the user
  69164. // in an organization.
  69165. func (r *ProjectsService) ListXpnHosts(project string, projectslistxpnhostsrequest *ProjectsListXpnHostsRequest) *ProjectsListXpnHostsCall {
  69166. c := &ProjectsListXpnHostsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  69167. c.project = project
  69168. c.projectslistxpnhostsrequest = projectslistxpnhostsrequest
  69169. return c
  69170. }
  69171. // Filter sets the optional parameter "filter":
  69172. func (c *ProjectsListXpnHostsCall) Filter(filter string) *ProjectsListXpnHostsCall {
  69173. c.urlParams_.Set("filter", filter)
  69174. return c
  69175. }
  69176. // MaxResults sets the optional parameter "maxResults":
  69177. func (c *ProjectsListXpnHostsCall) MaxResults(maxResults int64) *ProjectsListXpnHostsCall {
  69178. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  69179. return c
  69180. }
  69181. // OrderBy sets the optional parameter "order_by":
  69182. func (c *ProjectsListXpnHostsCall) OrderBy(orderBy string) *ProjectsListXpnHostsCall {
  69183. c.urlParams_.Set("order_by", orderBy)
  69184. return c
  69185. }
  69186. // PageToken sets the optional parameter "pageToken":
  69187. func (c *ProjectsListXpnHostsCall) PageToken(pageToken string) *ProjectsListXpnHostsCall {
  69188. c.urlParams_.Set("pageToken", pageToken)
  69189. return c
  69190. }
  69191. // Fields allows partial responses to be retrieved. See
  69192. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  69193. // for more information.
  69194. func (c *ProjectsListXpnHostsCall) Fields(s ...googleapi.Field) *ProjectsListXpnHostsCall {
  69195. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  69196. return c
  69197. }
  69198. // Context sets the context to be used in this call's Do method. Any
  69199. // pending HTTP request will be aborted if the provided context is
  69200. // canceled.
  69201. func (c *ProjectsListXpnHostsCall) Context(ctx context.Context) *ProjectsListXpnHostsCall {
  69202. c.ctx_ = ctx
  69203. return c
  69204. }
  69205. // Header returns an http.Header that can be modified by the caller to
  69206. // add HTTP headers to the request.
  69207. func (c *ProjectsListXpnHostsCall) Header() http.Header {
  69208. if c.header_ == nil {
  69209. c.header_ = make(http.Header)
  69210. }
  69211. return c.header_
  69212. }
  69213. func (c *ProjectsListXpnHostsCall) doRequest(alt string) (*http.Response, error) {
  69214. reqHeaders := make(http.Header)
  69215. for k, v := range c.header_ {
  69216. reqHeaders[k] = v
  69217. }
  69218. reqHeaders.Set("User-Agent", c.s.userAgent())
  69219. var body io.Reader = nil
  69220. body, err := googleapi.WithoutDataWrapper.JSONReader(c.projectslistxpnhostsrequest)
  69221. if err != nil {
  69222. return nil, err
  69223. }
  69224. reqHeaders.Set("Content-Type", "application/json")
  69225. c.urlParams_.Set("alt", alt)
  69226. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/listXpnHosts")
  69227. urls += "?" + c.urlParams_.Encode()
  69228. req, _ := http.NewRequest("POST", urls, body)
  69229. req.Header = reqHeaders
  69230. googleapi.Expand(req.URL, map[string]string{
  69231. "project": c.project,
  69232. })
  69233. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  69234. }
  69235. // Do executes the "compute.projects.listXpnHosts" call.
  69236. // Exactly one of *XpnHostList or error will be non-nil. Any non-2xx
  69237. // status code is an error. Response headers are in either
  69238. // *XpnHostList.ServerResponse.Header or (if a response was returned at
  69239. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  69240. // to check whether the returned error was because
  69241. // http.StatusNotModified was returned.
  69242. func (c *ProjectsListXpnHostsCall) Do(opts ...googleapi.CallOption) (*XpnHostList, error) {
  69243. gensupport.SetOptions(c.urlParams_, opts...)
  69244. res, err := c.doRequest("json")
  69245. if res != nil && res.StatusCode == http.StatusNotModified {
  69246. if res.Body != nil {
  69247. res.Body.Close()
  69248. }
  69249. return nil, &googleapi.Error{
  69250. Code: res.StatusCode,
  69251. Header: res.Header,
  69252. }
  69253. }
  69254. if err != nil {
  69255. return nil, err
  69256. }
  69257. defer googleapi.CloseBody(res)
  69258. if err := googleapi.CheckResponse(res); err != nil {
  69259. return nil, err
  69260. }
  69261. ret := &XpnHostList{
  69262. ServerResponse: googleapi.ServerResponse{
  69263. Header: res.Header,
  69264. HTTPStatusCode: res.StatusCode,
  69265. },
  69266. }
  69267. target := &ret
  69268. if err := gensupport.DecodeResponse(target, res); err != nil {
  69269. return nil, err
  69270. }
  69271. return ret, nil
  69272. // {
  69273. // "description": "Lists all shared VPC host projects visible to the user in an organization.",
  69274. // "httpMethod": "POST",
  69275. // "id": "compute.projects.listXpnHosts",
  69276. // "parameterOrder": [
  69277. // "project"
  69278. // ],
  69279. // "parameters": {
  69280. // "filter": {
  69281. // "location": "query",
  69282. // "type": "string"
  69283. // },
  69284. // "maxResults": {
  69285. // "default": "500",
  69286. // "format": "uint32",
  69287. // "location": "query",
  69288. // "minimum": "0",
  69289. // "type": "integer"
  69290. // },
  69291. // "order_by": {
  69292. // "location": "query",
  69293. // "type": "string"
  69294. // },
  69295. // "pageToken": {
  69296. // "location": "query",
  69297. // "type": "string"
  69298. // },
  69299. // "project": {
  69300. // "description": "Project ID for this request.",
  69301. // "location": "path",
  69302. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  69303. // "required": true,
  69304. // "type": "string"
  69305. // }
  69306. // },
  69307. // "path": "{project}/listXpnHosts",
  69308. // "request": {
  69309. // "$ref": "ProjectsListXpnHostsRequest"
  69310. // },
  69311. // "response": {
  69312. // "$ref": "XpnHostList"
  69313. // },
  69314. // "scopes": [
  69315. // "https://www.googleapis.com/auth/cloud-platform",
  69316. // "https://www.googleapis.com/auth/compute"
  69317. // ]
  69318. // }
  69319. }
  69320. // Pages invokes f for each page of results.
  69321. // A non-nil error returned from f will halt the iteration.
  69322. // The provided context supersedes any context provided to the Context method.
  69323. func (c *ProjectsListXpnHostsCall) Pages(ctx context.Context, f func(*XpnHostList) error) error {
  69324. c.ctx_ = ctx
  69325. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  69326. for {
  69327. x, err := c.Do()
  69328. if err != nil {
  69329. return err
  69330. }
  69331. if err := f(x); err != nil {
  69332. return err
  69333. }
  69334. if x.NextPageToken == "" {
  69335. return nil
  69336. }
  69337. c.PageToken(x.NextPageToken)
  69338. }
  69339. }
  69340. // method id "compute.projects.moveDisk":
  69341. type ProjectsMoveDiskCall struct {
  69342. s *Service
  69343. project string
  69344. diskmoverequest *DiskMoveRequest
  69345. urlParams_ gensupport.URLParams
  69346. ctx_ context.Context
  69347. header_ http.Header
  69348. }
  69349. // MoveDisk: Moves a persistent disk from one zone to another.
  69350. func (r *ProjectsService) MoveDisk(project string, diskmoverequest *DiskMoveRequest) *ProjectsMoveDiskCall {
  69351. c := &ProjectsMoveDiskCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  69352. c.project = project
  69353. c.diskmoverequest = diskmoverequest
  69354. return c
  69355. }
  69356. // RequestId sets the optional parameter "requestId": An optional
  69357. // request ID to identify requests. Specify a unique request ID so that
  69358. // if you must retry your request, the server will know to ignore the
  69359. // request if it has already been completed.
  69360. //
  69361. // For example, consider a situation where you make an initial request
  69362. // and the request times out. If you make the request again with the
  69363. // same request ID, the server can check if original operation with the
  69364. // same request ID was received, and if so, will ignore the second
  69365. // request. This prevents clients from accidentally creating duplicate
  69366. // commitments.
  69367. //
  69368. // The request ID must be a valid UUID with the exception that zero UUID
  69369. // is not supported (00000000-0000-0000-0000-000000000000).
  69370. func (c *ProjectsMoveDiskCall) RequestId(requestId string) *ProjectsMoveDiskCall {
  69371. c.urlParams_.Set("requestId", requestId)
  69372. return c
  69373. }
  69374. // Fields allows partial responses to be retrieved. See
  69375. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  69376. // for more information.
  69377. func (c *ProjectsMoveDiskCall) Fields(s ...googleapi.Field) *ProjectsMoveDiskCall {
  69378. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  69379. return c
  69380. }
  69381. // Context sets the context to be used in this call's Do method. Any
  69382. // pending HTTP request will be aborted if the provided context is
  69383. // canceled.
  69384. func (c *ProjectsMoveDiskCall) Context(ctx context.Context) *ProjectsMoveDiskCall {
  69385. c.ctx_ = ctx
  69386. return c
  69387. }
  69388. // Header returns an http.Header that can be modified by the caller to
  69389. // add HTTP headers to the request.
  69390. func (c *ProjectsMoveDiskCall) Header() http.Header {
  69391. if c.header_ == nil {
  69392. c.header_ = make(http.Header)
  69393. }
  69394. return c.header_
  69395. }
  69396. func (c *ProjectsMoveDiskCall) doRequest(alt string) (*http.Response, error) {
  69397. reqHeaders := make(http.Header)
  69398. for k, v := range c.header_ {
  69399. reqHeaders[k] = v
  69400. }
  69401. reqHeaders.Set("User-Agent", c.s.userAgent())
  69402. var body io.Reader = nil
  69403. body, err := googleapi.WithoutDataWrapper.JSONReader(c.diskmoverequest)
  69404. if err != nil {
  69405. return nil, err
  69406. }
  69407. reqHeaders.Set("Content-Type", "application/json")
  69408. c.urlParams_.Set("alt", alt)
  69409. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/moveDisk")
  69410. urls += "?" + c.urlParams_.Encode()
  69411. req, _ := http.NewRequest("POST", urls, body)
  69412. req.Header = reqHeaders
  69413. googleapi.Expand(req.URL, map[string]string{
  69414. "project": c.project,
  69415. })
  69416. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  69417. }
  69418. // Do executes the "compute.projects.moveDisk" call.
  69419. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  69420. // status code is an error. Response headers are in either
  69421. // *Operation.ServerResponse.Header or (if a response was returned at
  69422. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  69423. // to check whether the returned error was because
  69424. // http.StatusNotModified was returned.
  69425. func (c *ProjectsMoveDiskCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  69426. gensupport.SetOptions(c.urlParams_, opts...)
  69427. res, err := c.doRequest("json")
  69428. if res != nil && res.StatusCode == http.StatusNotModified {
  69429. if res.Body != nil {
  69430. res.Body.Close()
  69431. }
  69432. return nil, &googleapi.Error{
  69433. Code: res.StatusCode,
  69434. Header: res.Header,
  69435. }
  69436. }
  69437. if err != nil {
  69438. return nil, err
  69439. }
  69440. defer googleapi.CloseBody(res)
  69441. if err := googleapi.CheckResponse(res); err != nil {
  69442. return nil, err
  69443. }
  69444. ret := &Operation{
  69445. ServerResponse: googleapi.ServerResponse{
  69446. Header: res.Header,
  69447. HTTPStatusCode: res.StatusCode,
  69448. },
  69449. }
  69450. target := &ret
  69451. if err := gensupport.DecodeResponse(target, res); err != nil {
  69452. return nil, err
  69453. }
  69454. return ret, nil
  69455. // {
  69456. // "description": "Moves a persistent disk from one zone to another.",
  69457. // "httpMethod": "POST",
  69458. // "id": "compute.projects.moveDisk",
  69459. // "parameterOrder": [
  69460. // "project"
  69461. // ],
  69462. // "parameters": {
  69463. // "project": {
  69464. // "description": "Project ID for this request.",
  69465. // "location": "path",
  69466. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  69467. // "required": true,
  69468. // "type": "string"
  69469. // },
  69470. // "requestId": {
  69471. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  69472. // "location": "query",
  69473. // "type": "string"
  69474. // }
  69475. // },
  69476. // "path": "{project}/moveDisk",
  69477. // "request": {
  69478. // "$ref": "DiskMoveRequest"
  69479. // },
  69480. // "response": {
  69481. // "$ref": "Operation"
  69482. // },
  69483. // "scopes": [
  69484. // "https://www.googleapis.com/auth/cloud-platform",
  69485. // "https://www.googleapis.com/auth/compute"
  69486. // ]
  69487. // }
  69488. }
  69489. // method id "compute.projects.moveInstance":
  69490. type ProjectsMoveInstanceCall struct {
  69491. s *Service
  69492. project string
  69493. instancemoverequest *InstanceMoveRequest
  69494. urlParams_ gensupport.URLParams
  69495. ctx_ context.Context
  69496. header_ http.Header
  69497. }
  69498. // MoveInstance: Moves an instance and its attached persistent disks
  69499. // from one zone to another.
  69500. func (r *ProjectsService) MoveInstance(project string, instancemoverequest *InstanceMoveRequest) *ProjectsMoveInstanceCall {
  69501. c := &ProjectsMoveInstanceCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  69502. c.project = project
  69503. c.instancemoverequest = instancemoverequest
  69504. return c
  69505. }
  69506. // RequestId sets the optional parameter "requestId": An optional
  69507. // request ID to identify requests. Specify a unique request ID so that
  69508. // if you must retry your request, the server will know to ignore the
  69509. // request if it has already been completed.
  69510. //
  69511. // For example, consider a situation where you make an initial request
  69512. // and the request times out. If you make the request again with the
  69513. // same request ID, the server can check if original operation with the
  69514. // same request ID was received, and if so, will ignore the second
  69515. // request. This prevents clients from accidentally creating duplicate
  69516. // commitments.
  69517. //
  69518. // The request ID must be a valid UUID with the exception that zero UUID
  69519. // is not supported (00000000-0000-0000-0000-000000000000).
  69520. func (c *ProjectsMoveInstanceCall) RequestId(requestId string) *ProjectsMoveInstanceCall {
  69521. c.urlParams_.Set("requestId", requestId)
  69522. return c
  69523. }
  69524. // Fields allows partial responses to be retrieved. See
  69525. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  69526. // for more information.
  69527. func (c *ProjectsMoveInstanceCall) Fields(s ...googleapi.Field) *ProjectsMoveInstanceCall {
  69528. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  69529. return c
  69530. }
  69531. // Context sets the context to be used in this call's Do method. Any
  69532. // pending HTTP request will be aborted if the provided context is
  69533. // canceled.
  69534. func (c *ProjectsMoveInstanceCall) Context(ctx context.Context) *ProjectsMoveInstanceCall {
  69535. c.ctx_ = ctx
  69536. return c
  69537. }
  69538. // Header returns an http.Header that can be modified by the caller to
  69539. // add HTTP headers to the request.
  69540. func (c *ProjectsMoveInstanceCall) Header() http.Header {
  69541. if c.header_ == nil {
  69542. c.header_ = make(http.Header)
  69543. }
  69544. return c.header_
  69545. }
  69546. func (c *ProjectsMoveInstanceCall) doRequest(alt string) (*http.Response, error) {
  69547. reqHeaders := make(http.Header)
  69548. for k, v := range c.header_ {
  69549. reqHeaders[k] = v
  69550. }
  69551. reqHeaders.Set("User-Agent", c.s.userAgent())
  69552. var body io.Reader = nil
  69553. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancemoverequest)
  69554. if err != nil {
  69555. return nil, err
  69556. }
  69557. reqHeaders.Set("Content-Type", "application/json")
  69558. c.urlParams_.Set("alt", alt)
  69559. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/moveInstance")
  69560. urls += "?" + c.urlParams_.Encode()
  69561. req, _ := http.NewRequest("POST", urls, body)
  69562. req.Header = reqHeaders
  69563. googleapi.Expand(req.URL, map[string]string{
  69564. "project": c.project,
  69565. })
  69566. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  69567. }
  69568. // Do executes the "compute.projects.moveInstance" call.
  69569. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  69570. // status code is an error. Response headers are in either
  69571. // *Operation.ServerResponse.Header or (if a response was returned at
  69572. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  69573. // to check whether the returned error was because
  69574. // http.StatusNotModified was returned.
  69575. func (c *ProjectsMoveInstanceCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  69576. gensupport.SetOptions(c.urlParams_, opts...)
  69577. res, err := c.doRequest("json")
  69578. if res != nil && res.StatusCode == http.StatusNotModified {
  69579. if res.Body != nil {
  69580. res.Body.Close()
  69581. }
  69582. return nil, &googleapi.Error{
  69583. Code: res.StatusCode,
  69584. Header: res.Header,
  69585. }
  69586. }
  69587. if err != nil {
  69588. return nil, err
  69589. }
  69590. defer googleapi.CloseBody(res)
  69591. if err := googleapi.CheckResponse(res); err != nil {
  69592. return nil, err
  69593. }
  69594. ret := &Operation{
  69595. ServerResponse: googleapi.ServerResponse{
  69596. Header: res.Header,
  69597. HTTPStatusCode: res.StatusCode,
  69598. },
  69599. }
  69600. target := &ret
  69601. if err := gensupport.DecodeResponse(target, res); err != nil {
  69602. return nil, err
  69603. }
  69604. return ret, nil
  69605. // {
  69606. // "description": "Moves an instance and its attached persistent disks from one zone to another.",
  69607. // "httpMethod": "POST",
  69608. // "id": "compute.projects.moveInstance",
  69609. // "parameterOrder": [
  69610. // "project"
  69611. // ],
  69612. // "parameters": {
  69613. // "project": {
  69614. // "description": "Project ID for this request.",
  69615. // "location": "path",
  69616. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  69617. // "required": true,
  69618. // "type": "string"
  69619. // },
  69620. // "requestId": {
  69621. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  69622. // "location": "query",
  69623. // "type": "string"
  69624. // }
  69625. // },
  69626. // "path": "{project}/moveInstance",
  69627. // "request": {
  69628. // "$ref": "InstanceMoveRequest"
  69629. // },
  69630. // "response": {
  69631. // "$ref": "Operation"
  69632. // },
  69633. // "scopes": [
  69634. // "https://www.googleapis.com/auth/cloud-platform",
  69635. // "https://www.googleapis.com/auth/compute"
  69636. // ]
  69637. // }
  69638. }
  69639. // method id "compute.projects.setCommonInstanceMetadata":
  69640. type ProjectsSetCommonInstanceMetadataCall struct {
  69641. s *Service
  69642. project string
  69643. metadata *Metadata
  69644. urlParams_ gensupport.URLParams
  69645. ctx_ context.Context
  69646. header_ http.Header
  69647. }
  69648. // SetCommonInstanceMetadata: Sets metadata common to all instances
  69649. // within the specified project using the data included in the request.
  69650. // For details, see https://cloud.google.com/compute/docs/reference/latest/projects/setCommonInstanceMetadata
  69651. func (r *ProjectsService) SetCommonInstanceMetadata(project string, metadata *Metadata) *ProjectsSetCommonInstanceMetadataCall {
  69652. c := &ProjectsSetCommonInstanceMetadataCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  69653. c.project = project
  69654. c.metadata = metadata
  69655. return c
  69656. }
  69657. // RequestId sets the optional parameter "requestId": An optional
  69658. // request ID to identify requests. Specify a unique request ID so that
  69659. // if you must retry your request, the server will know to ignore the
  69660. // request if it has already been completed.
  69661. //
  69662. // For example, consider a situation where you make an initial request
  69663. // and the request times out. If you make the request again with the
  69664. // same request ID, the server can check if original operation with the
  69665. // same request ID was received, and if so, will ignore the second
  69666. // request. This prevents clients from accidentally creating duplicate
  69667. // commitments.
  69668. //
  69669. // The request ID must be a valid UUID with the exception that zero UUID
  69670. // is not supported (00000000-0000-0000-0000-000000000000).
  69671. func (c *ProjectsSetCommonInstanceMetadataCall) RequestId(requestId string) *ProjectsSetCommonInstanceMetadataCall {
  69672. c.urlParams_.Set("requestId", requestId)
  69673. return c
  69674. }
  69675. // Fields allows partial responses to be retrieved. See
  69676. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  69677. // for more information.
  69678. func (c *ProjectsSetCommonInstanceMetadataCall) Fields(s ...googleapi.Field) *ProjectsSetCommonInstanceMetadataCall {
  69679. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  69680. return c
  69681. }
  69682. // Context sets the context to be used in this call's Do method. Any
  69683. // pending HTTP request will be aborted if the provided context is
  69684. // canceled.
  69685. func (c *ProjectsSetCommonInstanceMetadataCall) Context(ctx context.Context) *ProjectsSetCommonInstanceMetadataCall {
  69686. c.ctx_ = ctx
  69687. return c
  69688. }
  69689. // Header returns an http.Header that can be modified by the caller to
  69690. // add HTTP headers to the request.
  69691. func (c *ProjectsSetCommonInstanceMetadataCall) Header() http.Header {
  69692. if c.header_ == nil {
  69693. c.header_ = make(http.Header)
  69694. }
  69695. return c.header_
  69696. }
  69697. func (c *ProjectsSetCommonInstanceMetadataCall) doRequest(alt string) (*http.Response, error) {
  69698. reqHeaders := make(http.Header)
  69699. for k, v := range c.header_ {
  69700. reqHeaders[k] = v
  69701. }
  69702. reqHeaders.Set("User-Agent", c.s.userAgent())
  69703. var body io.Reader = nil
  69704. body, err := googleapi.WithoutDataWrapper.JSONReader(c.metadata)
  69705. if err != nil {
  69706. return nil, err
  69707. }
  69708. reqHeaders.Set("Content-Type", "application/json")
  69709. c.urlParams_.Set("alt", alt)
  69710. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/setCommonInstanceMetadata")
  69711. urls += "?" + c.urlParams_.Encode()
  69712. req, _ := http.NewRequest("POST", urls, body)
  69713. req.Header = reqHeaders
  69714. googleapi.Expand(req.URL, map[string]string{
  69715. "project": c.project,
  69716. })
  69717. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  69718. }
  69719. // Do executes the "compute.projects.setCommonInstanceMetadata" call.
  69720. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  69721. // status code is an error. Response headers are in either
  69722. // *Operation.ServerResponse.Header or (if a response was returned at
  69723. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  69724. // to check whether the returned error was because
  69725. // http.StatusNotModified was returned.
  69726. func (c *ProjectsSetCommonInstanceMetadataCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  69727. gensupport.SetOptions(c.urlParams_, opts...)
  69728. res, err := c.doRequest("json")
  69729. if res != nil && res.StatusCode == http.StatusNotModified {
  69730. if res.Body != nil {
  69731. res.Body.Close()
  69732. }
  69733. return nil, &googleapi.Error{
  69734. Code: res.StatusCode,
  69735. Header: res.Header,
  69736. }
  69737. }
  69738. if err != nil {
  69739. return nil, err
  69740. }
  69741. defer googleapi.CloseBody(res)
  69742. if err := googleapi.CheckResponse(res); err != nil {
  69743. return nil, err
  69744. }
  69745. ret := &Operation{
  69746. ServerResponse: googleapi.ServerResponse{
  69747. Header: res.Header,
  69748. HTTPStatusCode: res.StatusCode,
  69749. },
  69750. }
  69751. target := &ret
  69752. if err := gensupport.DecodeResponse(target, res); err != nil {
  69753. return nil, err
  69754. }
  69755. return ret, nil
  69756. // {
  69757. // "description": "Sets metadata common to all instances within the specified project using the data included in the request.",
  69758. // "httpMethod": "POST",
  69759. // "id": "compute.projects.setCommonInstanceMetadata",
  69760. // "parameterOrder": [
  69761. // "project"
  69762. // ],
  69763. // "parameters": {
  69764. // "project": {
  69765. // "description": "Project ID for this request.",
  69766. // "location": "path",
  69767. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  69768. // "required": true,
  69769. // "type": "string"
  69770. // },
  69771. // "requestId": {
  69772. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  69773. // "location": "query",
  69774. // "type": "string"
  69775. // }
  69776. // },
  69777. // "path": "{project}/setCommonInstanceMetadata",
  69778. // "request": {
  69779. // "$ref": "Metadata"
  69780. // },
  69781. // "response": {
  69782. // "$ref": "Operation"
  69783. // },
  69784. // "scopes": [
  69785. // "https://www.googleapis.com/auth/cloud-platform",
  69786. // "https://www.googleapis.com/auth/compute"
  69787. // ]
  69788. // }
  69789. }
  69790. // method id "compute.projects.setDefaultNetworkTier":
  69791. type ProjectsSetDefaultNetworkTierCall struct {
  69792. s *Service
  69793. project string
  69794. projectssetdefaultnetworktierrequest *ProjectsSetDefaultNetworkTierRequest
  69795. urlParams_ gensupport.URLParams
  69796. ctx_ context.Context
  69797. header_ http.Header
  69798. }
  69799. // SetDefaultNetworkTier: Sets the default network tier of the project.
  69800. // The default network tier is used when an
  69801. // address/forwardingRule/instance is created without specifying the
  69802. // network tier field.
  69803. func (r *ProjectsService) SetDefaultNetworkTier(project string, projectssetdefaultnetworktierrequest *ProjectsSetDefaultNetworkTierRequest) *ProjectsSetDefaultNetworkTierCall {
  69804. c := &ProjectsSetDefaultNetworkTierCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  69805. c.project = project
  69806. c.projectssetdefaultnetworktierrequest = projectssetdefaultnetworktierrequest
  69807. return c
  69808. }
  69809. // RequestId sets the optional parameter "requestId": An optional
  69810. // request ID to identify requests. Specify a unique request ID so that
  69811. // if you must retry your request, the server will know to ignore the
  69812. // request if it has already been completed.
  69813. //
  69814. // For example, consider a situation where you make an initial request
  69815. // and the request times out. If you make the request again with the
  69816. // same request ID, the server can check if original operation with the
  69817. // same request ID was received, and if so, will ignore the second
  69818. // request. This prevents clients from accidentally creating duplicate
  69819. // commitments.
  69820. //
  69821. // The request ID must be a valid UUID with the exception that zero UUID
  69822. // is not supported (00000000-0000-0000-0000-000000000000).
  69823. func (c *ProjectsSetDefaultNetworkTierCall) RequestId(requestId string) *ProjectsSetDefaultNetworkTierCall {
  69824. c.urlParams_.Set("requestId", requestId)
  69825. return c
  69826. }
  69827. // Fields allows partial responses to be retrieved. See
  69828. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  69829. // for more information.
  69830. func (c *ProjectsSetDefaultNetworkTierCall) Fields(s ...googleapi.Field) *ProjectsSetDefaultNetworkTierCall {
  69831. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  69832. return c
  69833. }
  69834. // Context sets the context to be used in this call's Do method. Any
  69835. // pending HTTP request will be aborted if the provided context is
  69836. // canceled.
  69837. func (c *ProjectsSetDefaultNetworkTierCall) Context(ctx context.Context) *ProjectsSetDefaultNetworkTierCall {
  69838. c.ctx_ = ctx
  69839. return c
  69840. }
  69841. // Header returns an http.Header that can be modified by the caller to
  69842. // add HTTP headers to the request.
  69843. func (c *ProjectsSetDefaultNetworkTierCall) Header() http.Header {
  69844. if c.header_ == nil {
  69845. c.header_ = make(http.Header)
  69846. }
  69847. return c.header_
  69848. }
  69849. func (c *ProjectsSetDefaultNetworkTierCall) doRequest(alt string) (*http.Response, error) {
  69850. reqHeaders := make(http.Header)
  69851. for k, v := range c.header_ {
  69852. reqHeaders[k] = v
  69853. }
  69854. reqHeaders.Set("User-Agent", c.s.userAgent())
  69855. var body io.Reader = nil
  69856. body, err := googleapi.WithoutDataWrapper.JSONReader(c.projectssetdefaultnetworktierrequest)
  69857. if err != nil {
  69858. return nil, err
  69859. }
  69860. reqHeaders.Set("Content-Type", "application/json")
  69861. c.urlParams_.Set("alt", alt)
  69862. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/setDefaultNetworkTier")
  69863. urls += "?" + c.urlParams_.Encode()
  69864. req, _ := http.NewRequest("POST", urls, body)
  69865. req.Header = reqHeaders
  69866. googleapi.Expand(req.URL, map[string]string{
  69867. "project": c.project,
  69868. })
  69869. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  69870. }
  69871. // Do executes the "compute.projects.setDefaultNetworkTier" call.
  69872. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  69873. // status code is an error. Response headers are in either
  69874. // *Operation.ServerResponse.Header or (if a response was returned at
  69875. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  69876. // to check whether the returned error was because
  69877. // http.StatusNotModified was returned.
  69878. func (c *ProjectsSetDefaultNetworkTierCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  69879. gensupport.SetOptions(c.urlParams_, opts...)
  69880. res, err := c.doRequest("json")
  69881. if res != nil && res.StatusCode == http.StatusNotModified {
  69882. if res.Body != nil {
  69883. res.Body.Close()
  69884. }
  69885. return nil, &googleapi.Error{
  69886. Code: res.StatusCode,
  69887. Header: res.Header,
  69888. }
  69889. }
  69890. if err != nil {
  69891. return nil, err
  69892. }
  69893. defer googleapi.CloseBody(res)
  69894. if err := googleapi.CheckResponse(res); err != nil {
  69895. return nil, err
  69896. }
  69897. ret := &Operation{
  69898. ServerResponse: googleapi.ServerResponse{
  69899. Header: res.Header,
  69900. HTTPStatusCode: res.StatusCode,
  69901. },
  69902. }
  69903. target := &ret
  69904. if err := gensupport.DecodeResponse(target, res); err != nil {
  69905. return nil, err
  69906. }
  69907. return ret, nil
  69908. // {
  69909. // "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.",
  69910. // "httpMethod": "POST",
  69911. // "id": "compute.projects.setDefaultNetworkTier",
  69912. // "parameterOrder": [
  69913. // "project"
  69914. // ],
  69915. // "parameters": {
  69916. // "project": {
  69917. // "description": "Project ID for this request.",
  69918. // "location": "path",
  69919. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  69920. // "required": true,
  69921. // "type": "string"
  69922. // },
  69923. // "requestId": {
  69924. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  69925. // "location": "query",
  69926. // "type": "string"
  69927. // }
  69928. // },
  69929. // "path": "{project}/setDefaultNetworkTier",
  69930. // "request": {
  69931. // "$ref": "ProjectsSetDefaultNetworkTierRequest"
  69932. // },
  69933. // "response": {
  69934. // "$ref": "Operation"
  69935. // },
  69936. // "scopes": [
  69937. // "https://www.googleapis.com/auth/cloud-platform",
  69938. // "https://www.googleapis.com/auth/compute"
  69939. // ]
  69940. // }
  69941. }
  69942. // method id "compute.projects.setUsageExportBucket":
  69943. type ProjectsSetUsageExportBucketCall struct {
  69944. s *Service
  69945. project string
  69946. usageexportlocation *UsageExportLocation
  69947. urlParams_ gensupport.URLParams
  69948. ctx_ context.Context
  69949. header_ http.Header
  69950. }
  69951. // SetUsageExportBucket: Enables the usage export feature and sets the
  69952. // usage export bucket where reports are stored. If you provide an empty
  69953. // request body using this method, the usage export feature will be
  69954. // disabled.
  69955. // For details, see https://cloud.google.com/compute/docs/reference/latest/projects/setUsageExportBucket
  69956. func (r *ProjectsService) SetUsageExportBucket(project string, usageexportlocation *UsageExportLocation) *ProjectsSetUsageExportBucketCall {
  69957. c := &ProjectsSetUsageExportBucketCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  69958. c.project = project
  69959. c.usageexportlocation = usageexportlocation
  69960. return c
  69961. }
  69962. // RequestId sets the optional parameter "requestId": An optional
  69963. // request ID to identify requests. Specify a unique request ID so that
  69964. // if you must retry your request, the server will know to ignore the
  69965. // request if it has already been completed.
  69966. //
  69967. // For example, consider a situation where you make an initial request
  69968. // and the request times out. If you make the request again with the
  69969. // same request ID, the server can check if original operation with the
  69970. // same request ID was received, and if so, will ignore the second
  69971. // request. This prevents clients from accidentally creating duplicate
  69972. // commitments.
  69973. //
  69974. // The request ID must be a valid UUID with the exception that zero UUID
  69975. // is not supported (00000000-0000-0000-0000-000000000000).
  69976. func (c *ProjectsSetUsageExportBucketCall) RequestId(requestId string) *ProjectsSetUsageExportBucketCall {
  69977. c.urlParams_.Set("requestId", requestId)
  69978. return c
  69979. }
  69980. // Fields allows partial responses to be retrieved. See
  69981. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  69982. // for more information.
  69983. func (c *ProjectsSetUsageExportBucketCall) Fields(s ...googleapi.Field) *ProjectsSetUsageExportBucketCall {
  69984. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  69985. return c
  69986. }
  69987. // Context sets the context to be used in this call's Do method. Any
  69988. // pending HTTP request will be aborted if the provided context is
  69989. // canceled.
  69990. func (c *ProjectsSetUsageExportBucketCall) Context(ctx context.Context) *ProjectsSetUsageExportBucketCall {
  69991. c.ctx_ = ctx
  69992. return c
  69993. }
  69994. // Header returns an http.Header that can be modified by the caller to
  69995. // add HTTP headers to the request.
  69996. func (c *ProjectsSetUsageExportBucketCall) Header() http.Header {
  69997. if c.header_ == nil {
  69998. c.header_ = make(http.Header)
  69999. }
  70000. return c.header_
  70001. }
  70002. func (c *ProjectsSetUsageExportBucketCall) doRequest(alt string) (*http.Response, error) {
  70003. reqHeaders := make(http.Header)
  70004. for k, v := range c.header_ {
  70005. reqHeaders[k] = v
  70006. }
  70007. reqHeaders.Set("User-Agent", c.s.userAgent())
  70008. var body io.Reader = nil
  70009. body, err := googleapi.WithoutDataWrapper.JSONReader(c.usageexportlocation)
  70010. if err != nil {
  70011. return nil, err
  70012. }
  70013. reqHeaders.Set("Content-Type", "application/json")
  70014. c.urlParams_.Set("alt", alt)
  70015. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/setUsageExportBucket")
  70016. urls += "?" + c.urlParams_.Encode()
  70017. req, _ := http.NewRequest("POST", urls, body)
  70018. req.Header = reqHeaders
  70019. googleapi.Expand(req.URL, map[string]string{
  70020. "project": c.project,
  70021. })
  70022. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  70023. }
  70024. // Do executes the "compute.projects.setUsageExportBucket" call.
  70025. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  70026. // status code is an error. Response headers are in either
  70027. // *Operation.ServerResponse.Header or (if a response was returned at
  70028. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  70029. // to check whether the returned error was because
  70030. // http.StatusNotModified was returned.
  70031. func (c *ProjectsSetUsageExportBucketCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  70032. gensupport.SetOptions(c.urlParams_, opts...)
  70033. res, err := c.doRequest("json")
  70034. if res != nil && res.StatusCode == http.StatusNotModified {
  70035. if res.Body != nil {
  70036. res.Body.Close()
  70037. }
  70038. return nil, &googleapi.Error{
  70039. Code: res.StatusCode,
  70040. Header: res.Header,
  70041. }
  70042. }
  70043. if err != nil {
  70044. return nil, err
  70045. }
  70046. defer googleapi.CloseBody(res)
  70047. if err := googleapi.CheckResponse(res); err != nil {
  70048. return nil, err
  70049. }
  70050. ret := &Operation{
  70051. ServerResponse: googleapi.ServerResponse{
  70052. Header: res.Header,
  70053. HTTPStatusCode: res.StatusCode,
  70054. },
  70055. }
  70056. target := &ret
  70057. if err := gensupport.DecodeResponse(target, res); err != nil {
  70058. return nil, err
  70059. }
  70060. return ret, nil
  70061. // {
  70062. // "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.",
  70063. // "httpMethod": "POST",
  70064. // "id": "compute.projects.setUsageExportBucket",
  70065. // "parameterOrder": [
  70066. // "project"
  70067. // ],
  70068. // "parameters": {
  70069. // "project": {
  70070. // "description": "Project ID for this request.",
  70071. // "location": "path",
  70072. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  70073. // "required": true,
  70074. // "type": "string"
  70075. // },
  70076. // "requestId": {
  70077. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  70078. // "location": "query",
  70079. // "type": "string"
  70080. // }
  70081. // },
  70082. // "path": "{project}/setUsageExportBucket",
  70083. // "request": {
  70084. // "$ref": "UsageExportLocation"
  70085. // },
  70086. // "response": {
  70087. // "$ref": "Operation"
  70088. // },
  70089. // "scopes": [
  70090. // "https://www.googleapis.com/auth/cloud-platform",
  70091. // "https://www.googleapis.com/auth/compute",
  70092. // "https://www.googleapis.com/auth/devstorage.full_control",
  70093. // "https://www.googleapis.com/auth/devstorage.read_only",
  70094. // "https://www.googleapis.com/auth/devstorage.read_write"
  70095. // ]
  70096. // }
  70097. }
  70098. // method id "compute.regionAutoscalers.delete":
  70099. type RegionAutoscalersDeleteCall struct {
  70100. s *Service
  70101. project string
  70102. region string
  70103. autoscaler string
  70104. urlParams_ gensupport.URLParams
  70105. ctx_ context.Context
  70106. header_ http.Header
  70107. }
  70108. // Delete: Deletes the specified autoscaler.
  70109. func (r *RegionAutoscalersService) Delete(project string, region string, autoscaler string) *RegionAutoscalersDeleteCall {
  70110. c := &RegionAutoscalersDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  70111. c.project = project
  70112. c.region = region
  70113. c.autoscaler = autoscaler
  70114. return c
  70115. }
  70116. // RequestId sets the optional parameter "requestId": An optional
  70117. // request ID to identify requests. Specify a unique request ID so that
  70118. // if you must retry your request, the server will know to ignore the
  70119. // request if it has already been completed.
  70120. //
  70121. // For example, consider a situation where you make an initial request
  70122. // and the request times out. If you make the request again with the
  70123. // same request ID, the server can check if original operation with the
  70124. // same request ID was received, and if so, will ignore the second
  70125. // request. This prevents clients from accidentally creating duplicate
  70126. // commitments.
  70127. //
  70128. // The request ID must be a valid UUID with the exception that zero UUID
  70129. // is not supported (00000000-0000-0000-0000-000000000000).
  70130. func (c *RegionAutoscalersDeleteCall) RequestId(requestId string) *RegionAutoscalersDeleteCall {
  70131. c.urlParams_.Set("requestId", requestId)
  70132. return c
  70133. }
  70134. // Fields allows partial responses to be retrieved. See
  70135. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  70136. // for more information.
  70137. func (c *RegionAutoscalersDeleteCall) Fields(s ...googleapi.Field) *RegionAutoscalersDeleteCall {
  70138. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  70139. return c
  70140. }
  70141. // Context sets the context to be used in this call's Do method. Any
  70142. // pending HTTP request will be aborted if the provided context is
  70143. // canceled.
  70144. func (c *RegionAutoscalersDeleteCall) Context(ctx context.Context) *RegionAutoscalersDeleteCall {
  70145. c.ctx_ = ctx
  70146. return c
  70147. }
  70148. // Header returns an http.Header that can be modified by the caller to
  70149. // add HTTP headers to the request.
  70150. func (c *RegionAutoscalersDeleteCall) Header() http.Header {
  70151. if c.header_ == nil {
  70152. c.header_ = make(http.Header)
  70153. }
  70154. return c.header_
  70155. }
  70156. func (c *RegionAutoscalersDeleteCall) doRequest(alt string) (*http.Response, error) {
  70157. reqHeaders := make(http.Header)
  70158. for k, v := range c.header_ {
  70159. reqHeaders[k] = v
  70160. }
  70161. reqHeaders.Set("User-Agent", c.s.userAgent())
  70162. var body io.Reader = nil
  70163. c.urlParams_.Set("alt", alt)
  70164. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/autoscalers/{autoscaler}")
  70165. urls += "?" + c.urlParams_.Encode()
  70166. req, _ := http.NewRequest("DELETE", urls, body)
  70167. req.Header = reqHeaders
  70168. googleapi.Expand(req.URL, map[string]string{
  70169. "project": c.project,
  70170. "region": c.region,
  70171. "autoscaler": c.autoscaler,
  70172. })
  70173. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  70174. }
  70175. // Do executes the "compute.regionAutoscalers.delete" call.
  70176. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  70177. // status code is an error. Response headers are in either
  70178. // *Operation.ServerResponse.Header or (if a response was returned at
  70179. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  70180. // to check whether the returned error was because
  70181. // http.StatusNotModified was returned.
  70182. func (c *RegionAutoscalersDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  70183. gensupport.SetOptions(c.urlParams_, opts...)
  70184. res, err := c.doRequest("json")
  70185. if res != nil && res.StatusCode == http.StatusNotModified {
  70186. if res.Body != nil {
  70187. res.Body.Close()
  70188. }
  70189. return nil, &googleapi.Error{
  70190. Code: res.StatusCode,
  70191. Header: res.Header,
  70192. }
  70193. }
  70194. if err != nil {
  70195. return nil, err
  70196. }
  70197. defer googleapi.CloseBody(res)
  70198. if err := googleapi.CheckResponse(res); err != nil {
  70199. return nil, err
  70200. }
  70201. ret := &Operation{
  70202. ServerResponse: googleapi.ServerResponse{
  70203. Header: res.Header,
  70204. HTTPStatusCode: res.StatusCode,
  70205. },
  70206. }
  70207. target := &ret
  70208. if err := gensupport.DecodeResponse(target, res); err != nil {
  70209. return nil, err
  70210. }
  70211. return ret, nil
  70212. // {
  70213. // "description": "Deletes the specified autoscaler.",
  70214. // "httpMethod": "DELETE",
  70215. // "id": "compute.regionAutoscalers.delete",
  70216. // "parameterOrder": [
  70217. // "project",
  70218. // "region",
  70219. // "autoscaler"
  70220. // ],
  70221. // "parameters": {
  70222. // "autoscaler": {
  70223. // "description": "Name of the autoscaler to delete.",
  70224. // "location": "path",
  70225. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  70226. // "required": true,
  70227. // "type": "string"
  70228. // },
  70229. // "project": {
  70230. // "description": "Project ID for this request.",
  70231. // "location": "path",
  70232. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  70233. // "required": true,
  70234. // "type": "string"
  70235. // },
  70236. // "region": {
  70237. // "description": "Name of the region scoping this request.",
  70238. // "location": "path",
  70239. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  70240. // "required": true,
  70241. // "type": "string"
  70242. // },
  70243. // "requestId": {
  70244. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  70245. // "location": "query",
  70246. // "type": "string"
  70247. // }
  70248. // },
  70249. // "path": "{project}/regions/{region}/autoscalers/{autoscaler}",
  70250. // "response": {
  70251. // "$ref": "Operation"
  70252. // },
  70253. // "scopes": [
  70254. // "https://www.googleapis.com/auth/cloud-platform",
  70255. // "https://www.googleapis.com/auth/compute"
  70256. // ]
  70257. // }
  70258. }
  70259. // method id "compute.regionAutoscalers.get":
  70260. type RegionAutoscalersGetCall struct {
  70261. s *Service
  70262. project string
  70263. region string
  70264. autoscaler string
  70265. urlParams_ gensupport.URLParams
  70266. ifNoneMatch_ string
  70267. ctx_ context.Context
  70268. header_ http.Header
  70269. }
  70270. // Get: Returns the specified autoscaler.
  70271. func (r *RegionAutoscalersService) Get(project string, region string, autoscaler string) *RegionAutoscalersGetCall {
  70272. c := &RegionAutoscalersGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  70273. c.project = project
  70274. c.region = region
  70275. c.autoscaler = autoscaler
  70276. return c
  70277. }
  70278. // Fields allows partial responses to be retrieved. See
  70279. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  70280. // for more information.
  70281. func (c *RegionAutoscalersGetCall) Fields(s ...googleapi.Field) *RegionAutoscalersGetCall {
  70282. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  70283. return c
  70284. }
  70285. // IfNoneMatch sets the optional parameter which makes the operation
  70286. // fail if the object's ETag matches the given value. This is useful for
  70287. // getting updates only after the object has changed since the last
  70288. // request. Use googleapi.IsNotModified to check whether the response
  70289. // error from Do is the result of In-None-Match.
  70290. func (c *RegionAutoscalersGetCall) IfNoneMatch(entityTag string) *RegionAutoscalersGetCall {
  70291. c.ifNoneMatch_ = entityTag
  70292. return c
  70293. }
  70294. // Context sets the context to be used in this call's Do method. Any
  70295. // pending HTTP request will be aborted if the provided context is
  70296. // canceled.
  70297. func (c *RegionAutoscalersGetCall) Context(ctx context.Context) *RegionAutoscalersGetCall {
  70298. c.ctx_ = ctx
  70299. return c
  70300. }
  70301. // Header returns an http.Header that can be modified by the caller to
  70302. // add HTTP headers to the request.
  70303. func (c *RegionAutoscalersGetCall) Header() http.Header {
  70304. if c.header_ == nil {
  70305. c.header_ = make(http.Header)
  70306. }
  70307. return c.header_
  70308. }
  70309. func (c *RegionAutoscalersGetCall) doRequest(alt string) (*http.Response, error) {
  70310. reqHeaders := make(http.Header)
  70311. for k, v := range c.header_ {
  70312. reqHeaders[k] = v
  70313. }
  70314. reqHeaders.Set("User-Agent", c.s.userAgent())
  70315. if c.ifNoneMatch_ != "" {
  70316. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  70317. }
  70318. var body io.Reader = nil
  70319. c.urlParams_.Set("alt", alt)
  70320. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/autoscalers/{autoscaler}")
  70321. urls += "?" + c.urlParams_.Encode()
  70322. req, _ := http.NewRequest("GET", urls, body)
  70323. req.Header = reqHeaders
  70324. googleapi.Expand(req.URL, map[string]string{
  70325. "project": c.project,
  70326. "region": c.region,
  70327. "autoscaler": c.autoscaler,
  70328. })
  70329. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  70330. }
  70331. // Do executes the "compute.regionAutoscalers.get" call.
  70332. // Exactly one of *Autoscaler or error will be non-nil. Any non-2xx
  70333. // status code is an error. Response headers are in either
  70334. // *Autoscaler.ServerResponse.Header or (if a response was returned at
  70335. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  70336. // to check whether the returned error was because
  70337. // http.StatusNotModified was returned.
  70338. func (c *RegionAutoscalersGetCall) Do(opts ...googleapi.CallOption) (*Autoscaler, error) {
  70339. gensupport.SetOptions(c.urlParams_, opts...)
  70340. res, err := c.doRequest("json")
  70341. if res != nil && res.StatusCode == http.StatusNotModified {
  70342. if res.Body != nil {
  70343. res.Body.Close()
  70344. }
  70345. return nil, &googleapi.Error{
  70346. Code: res.StatusCode,
  70347. Header: res.Header,
  70348. }
  70349. }
  70350. if err != nil {
  70351. return nil, err
  70352. }
  70353. defer googleapi.CloseBody(res)
  70354. if err := googleapi.CheckResponse(res); err != nil {
  70355. return nil, err
  70356. }
  70357. ret := &Autoscaler{
  70358. ServerResponse: googleapi.ServerResponse{
  70359. Header: res.Header,
  70360. HTTPStatusCode: res.StatusCode,
  70361. },
  70362. }
  70363. target := &ret
  70364. if err := gensupport.DecodeResponse(target, res); err != nil {
  70365. return nil, err
  70366. }
  70367. return ret, nil
  70368. // {
  70369. // "description": "Returns the specified autoscaler.",
  70370. // "httpMethod": "GET",
  70371. // "id": "compute.regionAutoscalers.get",
  70372. // "parameterOrder": [
  70373. // "project",
  70374. // "region",
  70375. // "autoscaler"
  70376. // ],
  70377. // "parameters": {
  70378. // "autoscaler": {
  70379. // "description": "Name of the autoscaler to return.",
  70380. // "location": "path",
  70381. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  70382. // "required": true,
  70383. // "type": "string"
  70384. // },
  70385. // "project": {
  70386. // "description": "Project ID for this request.",
  70387. // "location": "path",
  70388. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  70389. // "required": true,
  70390. // "type": "string"
  70391. // },
  70392. // "region": {
  70393. // "description": "Name of the region scoping this request.",
  70394. // "location": "path",
  70395. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  70396. // "required": true,
  70397. // "type": "string"
  70398. // }
  70399. // },
  70400. // "path": "{project}/regions/{region}/autoscalers/{autoscaler}",
  70401. // "response": {
  70402. // "$ref": "Autoscaler"
  70403. // },
  70404. // "scopes": [
  70405. // "https://www.googleapis.com/auth/cloud-platform",
  70406. // "https://www.googleapis.com/auth/compute",
  70407. // "https://www.googleapis.com/auth/compute.readonly"
  70408. // ]
  70409. // }
  70410. }
  70411. // method id "compute.regionAutoscalers.insert":
  70412. type RegionAutoscalersInsertCall struct {
  70413. s *Service
  70414. project string
  70415. region string
  70416. autoscaler *Autoscaler
  70417. urlParams_ gensupport.URLParams
  70418. ctx_ context.Context
  70419. header_ http.Header
  70420. }
  70421. // Insert: Creates an autoscaler in the specified project using the data
  70422. // included in the request.
  70423. func (r *RegionAutoscalersService) Insert(project string, region string, autoscaler *Autoscaler) *RegionAutoscalersInsertCall {
  70424. c := &RegionAutoscalersInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  70425. c.project = project
  70426. c.region = region
  70427. c.autoscaler = autoscaler
  70428. return c
  70429. }
  70430. // RequestId sets the optional parameter "requestId": An optional
  70431. // request ID to identify requests. Specify a unique request ID so that
  70432. // if you must retry your request, the server will know to ignore the
  70433. // request if it has already been completed.
  70434. //
  70435. // For example, consider a situation where you make an initial request
  70436. // and the request times out. If you make the request again with the
  70437. // same request ID, the server can check if original operation with the
  70438. // same request ID was received, and if so, will ignore the second
  70439. // request. This prevents clients from accidentally creating duplicate
  70440. // commitments.
  70441. //
  70442. // The request ID must be a valid UUID with the exception that zero UUID
  70443. // is not supported (00000000-0000-0000-0000-000000000000).
  70444. func (c *RegionAutoscalersInsertCall) RequestId(requestId string) *RegionAutoscalersInsertCall {
  70445. c.urlParams_.Set("requestId", requestId)
  70446. return c
  70447. }
  70448. // Fields allows partial responses to be retrieved. See
  70449. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  70450. // for more information.
  70451. func (c *RegionAutoscalersInsertCall) Fields(s ...googleapi.Field) *RegionAutoscalersInsertCall {
  70452. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  70453. return c
  70454. }
  70455. // Context sets the context to be used in this call's Do method. Any
  70456. // pending HTTP request will be aborted if the provided context is
  70457. // canceled.
  70458. func (c *RegionAutoscalersInsertCall) Context(ctx context.Context) *RegionAutoscalersInsertCall {
  70459. c.ctx_ = ctx
  70460. return c
  70461. }
  70462. // Header returns an http.Header that can be modified by the caller to
  70463. // add HTTP headers to the request.
  70464. func (c *RegionAutoscalersInsertCall) Header() http.Header {
  70465. if c.header_ == nil {
  70466. c.header_ = make(http.Header)
  70467. }
  70468. return c.header_
  70469. }
  70470. func (c *RegionAutoscalersInsertCall) doRequest(alt string) (*http.Response, error) {
  70471. reqHeaders := make(http.Header)
  70472. for k, v := range c.header_ {
  70473. reqHeaders[k] = v
  70474. }
  70475. reqHeaders.Set("User-Agent", c.s.userAgent())
  70476. var body io.Reader = nil
  70477. body, err := googleapi.WithoutDataWrapper.JSONReader(c.autoscaler)
  70478. if err != nil {
  70479. return nil, err
  70480. }
  70481. reqHeaders.Set("Content-Type", "application/json")
  70482. c.urlParams_.Set("alt", alt)
  70483. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/autoscalers")
  70484. urls += "?" + c.urlParams_.Encode()
  70485. req, _ := http.NewRequest("POST", urls, body)
  70486. req.Header = reqHeaders
  70487. googleapi.Expand(req.URL, map[string]string{
  70488. "project": c.project,
  70489. "region": c.region,
  70490. })
  70491. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  70492. }
  70493. // Do executes the "compute.regionAutoscalers.insert" call.
  70494. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  70495. // status code is an error. Response headers are in either
  70496. // *Operation.ServerResponse.Header or (if a response was returned at
  70497. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  70498. // to check whether the returned error was because
  70499. // http.StatusNotModified was returned.
  70500. func (c *RegionAutoscalersInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  70501. gensupport.SetOptions(c.urlParams_, opts...)
  70502. res, err := c.doRequest("json")
  70503. if res != nil && res.StatusCode == http.StatusNotModified {
  70504. if res.Body != nil {
  70505. res.Body.Close()
  70506. }
  70507. return nil, &googleapi.Error{
  70508. Code: res.StatusCode,
  70509. Header: res.Header,
  70510. }
  70511. }
  70512. if err != nil {
  70513. return nil, err
  70514. }
  70515. defer googleapi.CloseBody(res)
  70516. if err := googleapi.CheckResponse(res); err != nil {
  70517. return nil, err
  70518. }
  70519. ret := &Operation{
  70520. ServerResponse: googleapi.ServerResponse{
  70521. Header: res.Header,
  70522. HTTPStatusCode: res.StatusCode,
  70523. },
  70524. }
  70525. target := &ret
  70526. if err := gensupport.DecodeResponse(target, res); err != nil {
  70527. return nil, err
  70528. }
  70529. return ret, nil
  70530. // {
  70531. // "description": "Creates an autoscaler in the specified project using the data included in the request.",
  70532. // "httpMethod": "POST",
  70533. // "id": "compute.regionAutoscalers.insert",
  70534. // "parameterOrder": [
  70535. // "project",
  70536. // "region"
  70537. // ],
  70538. // "parameters": {
  70539. // "project": {
  70540. // "description": "Project ID for this request.",
  70541. // "location": "path",
  70542. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  70543. // "required": true,
  70544. // "type": "string"
  70545. // },
  70546. // "region": {
  70547. // "description": "Name of the region scoping this request.",
  70548. // "location": "path",
  70549. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  70550. // "required": true,
  70551. // "type": "string"
  70552. // },
  70553. // "requestId": {
  70554. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  70555. // "location": "query",
  70556. // "type": "string"
  70557. // }
  70558. // },
  70559. // "path": "{project}/regions/{region}/autoscalers",
  70560. // "request": {
  70561. // "$ref": "Autoscaler"
  70562. // },
  70563. // "response": {
  70564. // "$ref": "Operation"
  70565. // },
  70566. // "scopes": [
  70567. // "https://www.googleapis.com/auth/cloud-platform",
  70568. // "https://www.googleapis.com/auth/compute"
  70569. // ]
  70570. // }
  70571. }
  70572. // method id "compute.regionAutoscalers.list":
  70573. type RegionAutoscalersListCall struct {
  70574. s *Service
  70575. project string
  70576. region string
  70577. urlParams_ gensupport.URLParams
  70578. ifNoneMatch_ string
  70579. ctx_ context.Context
  70580. header_ http.Header
  70581. }
  70582. // List: Retrieves a list of autoscalers contained within the specified
  70583. // region.
  70584. func (r *RegionAutoscalersService) List(project string, region string) *RegionAutoscalersListCall {
  70585. c := &RegionAutoscalersListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  70586. c.project = project
  70587. c.region = region
  70588. return c
  70589. }
  70590. // Filter sets the optional parameter "filter": A filter expression that
  70591. // filters resources listed in the response. The expression must specify
  70592. // the field name, a comparison operator, and the value that you want to
  70593. // use for filtering. The value must be a string, a number, or a
  70594. // boolean. The comparison operator must be either =, !=, >, or <.
  70595. //
  70596. // For example, if you are filtering Compute Engine instances, you can
  70597. // exclude instances named example-instance by specifying name !=
  70598. // example-instance.
  70599. //
  70600. // You can also filter nested fields. For example, you could specify
  70601. // scheduling.automaticRestart = false to include instances only if they
  70602. // are not scheduled for automatic restarts. You can use filtering on
  70603. // nested fields to filter based on resource labels.
  70604. //
  70605. // To filter on multiple expressions, provide each separate expression
  70606. // within parentheses. For example, (scheduling.automaticRestart = true)
  70607. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  70608. // AND expression. However, you can include AND and OR expressions
  70609. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  70610. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  70611. // true).
  70612. func (c *RegionAutoscalersListCall) Filter(filter string) *RegionAutoscalersListCall {
  70613. c.urlParams_.Set("filter", filter)
  70614. return c
  70615. }
  70616. // MaxResults sets the optional parameter "maxResults": The maximum
  70617. // number of results per page that should be returned. If the number of
  70618. // available results is larger than maxResults, Compute Engine returns a
  70619. // nextPageToken that can be used to get the next page of results in
  70620. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  70621. // (Default: 500)
  70622. func (c *RegionAutoscalersListCall) MaxResults(maxResults int64) *RegionAutoscalersListCall {
  70623. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  70624. return c
  70625. }
  70626. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  70627. // a certain order. By default, results are returned in alphanumerical
  70628. // order based on the resource name.
  70629. //
  70630. // You can also sort results in descending order based on the creation
  70631. // timestamp using orderBy="creationTimestamp desc". This sorts results
  70632. // based on the creationTimestamp field in reverse chronological order
  70633. // (newest result first). Use this to sort resources like operations so
  70634. // that the newest operation is returned first.
  70635. //
  70636. // Currently, only sorting by name or creationTimestamp desc is
  70637. // supported.
  70638. func (c *RegionAutoscalersListCall) OrderBy(orderBy string) *RegionAutoscalersListCall {
  70639. c.urlParams_.Set("orderBy", orderBy)
  70640. return c
  70641. }
  70642. // PageToken sets the optional parameter "pageToken": Specifies a page
  70643. // token to use. Set pageToken to the nextPageToken returned by a
  70644. // previous list request to get the next page of results.
  70645. func (c *RegionAutoscalersListCall) PageToken(pageToken string) *RegionAutoscalersListCall {
  70646. c.urlParams_.Set("pageToken", pageToken)
  70647. return c
  70648. }
  70649. // Fields allows partial responses to be retrieved. See
  70650. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  70651. // for more information.
  70652. func (c *RegionAutoscalersListCall) Fields(s ...googleapi.Field) *RegionAutoscalersListCall {
  70653. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  70654. return c
  70655. }
  70656. // IfNoneMatch sets the optional parameter which makes the operation
  70657. // fail if the object's ETag matches the given value. This is useful for
  70658. // getting updates only after the object has changed since the last
  70659. // request. Use googleapi.IsNotModified to check whether the response
  70660. // error from Do is the result of In-None-Match.
  70661. func (c *RegionAutoscalersListCall) IfNoneMatch(entityTag string) *RegionAutoscalersListCall {
  70662. c.ifNoneMatch_ = entityTag
  70663. return c
  70664. }
  70665. // Context sets the context to be used in this call's Do method. Any
  70666. // pending HTTP request will be aborted if the provided context is
  70667. // canceled.
  70668. func (c *RegionAutoscalersListCall) Context(ctx context.Context) *RegionAutoscalersListCall {
  70669. c.ctx_ = ctx
  70670. return c
  70671. }
  70672. // Header returns an http.Header that can be modified by the caller to
  70673. // add HTTP headers to the request.
  70674. func (c *RegionAutoscalersListCall) Header() http.Header {
  70675. if c.header_ == nil {
  70676. c.header_ = make(http.Header)
  70677. }
  70678. return c.header_
  70679. }
  70680. func (c *RegionAutoscalersListCall) doRequest(alt string) (*http.Response, error) {
  70681. reqHeaders := make(http.Header)
  70682. for k, v := range c.header_ {
  70683. reqHeaders[k] = v
  70684. }
  70685. reqHeaders.Set("User-Agent", c.s.userAgent())
  70686. if c.ifNoneMatch_ != "" {
  70687. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  70688. }
  70689. var body io.Reader = nil
  70690. c.urlParams_.Set("alt", alt)
  70691. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/autoscalers")
  70692. urls += "?" + c.urlParams_.Encode()
  70693. req, _ := http.NewRequest("GET", urls, body)
  70694. req.Header = reqHeaders
  70695. googleapi.Expand(req.URL, map[string]string{
  70696. "project": c.project,
  70697. "region": c.region,
  70698. })
  70699. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  70700. }
  70701. // Do executes the "compute.regionAutoscalers.list" call.
  70702. // Exactly one of *RegionAutoscalerList or error will be non-nil. Any
  70703. // non-2xx status code is an error. Response headers are in either
  70704. // *RegionAutoscalerList.ServerResponse.Header or (if a response was
  70705. // returned at all) in error.(*googleapi.Error).Header. Use
  70706. // googleapi.IsNotModified to check whether the returned error was
  70707. // because http.StatusNotModified was returned.
  70708. func (c *RegionAutoscalersListCall) Do(opts ...googleapi.CallOption) (*RegionAutoscalerList, error) {
  70709. gensupport.SetOptions(c.urlParams_, opts...)
  70710. res, err := c.doRequest("json")
  70711. if res != nil && res.StatusCode == http.StatusNotModified {
  70712. if res.Body != nil {
  70713. res.Body.Close()
  70714. }
  70715. return nil, &googleapi.Error{
  70716. Code: res.StatusCode,
  70717. Header: res.Header,
  70718. }
  70719. }
  70720. if err != nil {
  70721. return nil, err
  70722. }
  70723. defer googleapi.CloseBody(res)
  70724. if err := googleapi.CheckResponse(res); err != nil {
  70725. return nil, err
  70726. }
  70727. ret := &RegionAutoscalerList{
  70728. ServerResponse: googleapi.ServerResponse{
  70729. Header: res.Header,
  70730. HTTPStatusCode: res.StatusCode,
  70731. },
  70732. }
  70733. target := &ret
  70734. if err := gensupport.DecodeResponse(target, res); err != nil {
  70735. return nil, err
  70736. }
  70737. return ret, nil
  70738. // {
  70739. // "description": "Retrieves a list of autoscalers contained within the specified region.",
  70740. // "httpMethod": "GET",
  70741. // "id": "compute.regionAutoscalers.list",
  70742. // "parameterOrder": [
  70743. // "project",
  70744. // "region"
  70745. // ],
  70746. // "parameters": {
  70747. // "filter": {
  70748. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  70749. // "location": "query",
  70750. // "type": "string"
  70751. // },
  70752. // "maxResults": {
  70753. // "default": "500",
  70754. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  70755. // "format": "uint32",
  70756. // "location": "query",
  70757. // "minimum": "0",
  70758. // "type": "integer"
  70759. // },
  70760. // "orderBy": {
  70761. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  70762. // "location": "query",
  70763. // "type": "string"
  70764. // },
  70765. // "pageToken": {
  70766. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  70767. // "location": "query",
  70768. // "type": "string"
  70769. // },
  70770. // "project": {
  70771. // "description": "Project ID for this request.",
  70772. // "location": "path",
  70773. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  70774. // "required": true,
  70775. // "type": "string"
  70776. // },
  70777. // "region": {
  70778. // "description": "Name of the region scoping this request.",
  70779. // "location": "path",
  70780. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  70781. // "required": true,
  70782. // "type": "string"
  70783. // }
  70784. // },
  70785. // "path": "{project}/regions/{region}/autoscalers",
  70786. // "response": {
  70787. // "$ref": "RegionAutoscalerList"
  70788. // },
  70789. // "scopes": [
  70790. // "https://www.googleapis.com/auth/cloud-platform",
  70791. // "https://www.googleapis.com/auth/compute",
  70792. // "https://www.googleapis.com/auth/compute.readonly"
  70793. // ]
  70794. // }
  70795. }
  70796. // Pages invokes f for each page of results.
  70797. // A non-nil error returned from f will halt the iteration.
  70798. // The provided context supersedes any context provided to the Context method.
  70799. func (c *RegionAutoscalersListCall) Pages(ctx context.Context, f func(*RegionAutoscalerList) error) error {
  70800. c.ctx_ = ctx
  70801. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  70802. for {
  70803. x, err := c.Do()
  70804. if err != nil {
  70805. return err
  70806. }
  70807. if err := f(x); err != nil {
  70808. return err
  70809. }
  70810. if x.NextPageToken == "" {
  70811. return nil
  70812. }
  70813. c.PageToken(x.NextPageToken)
  70814. }
  70815. }
  70816. // method id "compute.regionAutoscalers.patch":
  70817. type RegionAutoscalersPatchCall struct {
  70818. s *Service
  70819. project string
  70820. region string
  70821. autoscaler *Autoscaler
  70822. urlParams_ gensupport.URLParams
  70823. ctx_ context.Context
  70824. header_ http.Header
  70825. }
  70826. // Patch: Updates an autoscaler in the specified project using the data
  70827. // included in the request. This method supports PATCH semantics and
  70828. // uses the JSON merge patch format and processing rules.
  70829. func (r *RegionAutoscalersService) Patch(project string, region string, autoscaler *Autoscaler) *RegionAutoscalersPatchCall {
  70830. c := &RegionAutoscalersPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  70831. c.project = project
  70832. c.region = region
  70833. c.autoscaler = autoscaler
  70834. return c
  70835. }
  70836. // Autoscaler sets the optional parameter "autoscaler": Name of the
  70837. // autoscaler to patch.
  70838. func (c *RegionAutoscalersPatchCall) Autoscaler(autoscaler string) *RegionAutoscalersPatchCall {
  70839. c.urlParams_.Set("autoscaler", autoscaler)
  70840. return c
  70841. }
  70842. // RequestId sets the optional parameter "requestId": An optional
  70843. // request ID to identify requests. Specify a unique request ID so that
  70844. // if you must retry your request, the server will know to ignore the
  70845. // request if it has already been completed.
  70846. //
  70847. // For example, consider a situation where you make an initial request
  70848. // and the request times out. If you make the request again with the
  70849. // same request ID, the server can check if original operation with the
  70850. // same request ID was received, and if so, will ignore the second
  70851. // request. This prevents clients from accidentally creating duplicate
  70852. // commitments.
  70853. //
  70854. // The request ID must be a valid UUID with the exception that zero UUID
  70855. // is not supported (00000000-0000-0000-0000-000000000000).
  70856. func (c *RegionAutoscalersPatchCall) RequestId(requestId string) *RegionAutoscalersPatchCall {
  70857. c.urlParams_.Set("requestId", requestId)
  70858. return c
  70859. }
  70860. // Fields allows partial responses to be retrieved. See
  70861. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  70862. // for more information.
  70863. func (c *RegionAutoscalersPatchCall) Fields(s ...googleapi.Field) *RegionAutoscalersPatchCall {
  70864. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  70865. return c
  70866. }
  70867. // Context sets the context to be used in this call's Do method. Any
  70868. // pending HTTP request will be aborted if the provided context is
  70869. // canceled.
  70870. func (c *RegionAutoscalersPatchCall) Context(ctx context.Context) *RegionAutoscalersPatchCall {
  70871. c.ctx_ = ctx
  70872. return c
  70873. }
  70874. // Header returns an http.Header that can be modified by the caller to
  70875. // add HTTP headers to the request.
  70876. func (c *RegionAutoscalersPatchCall) Header() http.Header {
  70877. if c.header_ == nil {
  70878. c.header_ = make(http.Header)
  70879. }
  70880. return c.header_
  70881. }
  70882. func (c *RegionAutoscalersPatchCall) doRequest(alt string) (*http.Response, error) {
  70883. reqHeaders := make(http.Header)
  70884. for k, v := range c.header_ {
  70885. reqHeaders[k] = v
  70886. }
  70887. reqHeaders.Set("User-Agent", c.s.userAgent())
  70888. var body io.Reader = nil
  70889. body, err := googleapi.WithoutDataWrapper.JSONReader(c.autoscaler)
  70890. if err != nil {
  70891. return nil, err
  70892. }
  70893. reqHeaders.Set("Content-Type", "application/json")
  70894. c.urlParams_.Set("alt", alt)
  70895. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/autoscalers")
  70896. urls += "?" + c.urlParams_.Encode()
  70897. req, _ := http.NewRequest("PATCH", urls, body)
  70898. req.Header = reqHeaders
  70899. googleapi.Expand(req.URL, map[string]string{
  70900. "project": c.project,
  70901. "region": c.region,
  70902. })
  70903. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  70904. }
  70905. // Do executes the "compute.regionAutoscalers.patch" call.
  70906. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  70907. // status code is an error. Response headers are in either
  70908. // *Operation.ServerResponse.Header or (if a response was returned at
  70909. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  70910. // to check whether the returned error was because
  70911. // http.StatusNotModified was returned.
  70912. func (c *RegionAutoscalersPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  70913. gensupport.SetOptions(c.urlParams_, opts...)
  70914. res, err := c.doRequest("json")
  70915. if res != nil && res.StatusCode == http.StatusNotModified {
  70916. if res.Body != nil {
  70917. res.Body.Close()
  70918. }
  70919. return nil, &googleapi.Error{
  70920. Code: res.StatusCode,
  70921. Header: res.Header,
  70922. }
  70923. }
  70924. if err != nil {
  70925. return nil, err
  70926. }
  70927. defer googleapi.CloseBody(res)
  70928. if err := googleapi.CheckResponse(res); err != nil {
  70929. return nil, err
  70930. }
  70931. ret := &Operation{
  70932. ServerResponse: googleapi.ServerResponse{
  70933. Header: res.Header,
  70934. HTTPStatusCode: res.StatusCode,
  70935. },
  70936. }
  70937. target := &ret
  70938. if err := gensupport.DecodeResponse(target, res); err != nil {
  70939. return nil, err
  70940. }
  70941. return ret, nil
  70942. // {
  70943. // "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.",
  70944. // "httpMethod": "PATCH",
  70945. // "id": "compute.regionAutoscalers.patch",
  70946. // "parameterOrder": [
  70947. // "project",
  70948. // "region"
  70949. // ],
  70950. // "parameters": {
  70951. // "autoscaler": {
  70952. // "description": "Name of the autoscaler to patch.",
  70953. // "location": "query",
  70954. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  70955. // "type": "string"
  70956. // },
  70957. // "project": {
  70958. // "description": "Project ID for this request.",
  70959. // "location": "path",
  70960. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  70961. // "required": true,
  70962. // "type": "string"
  70963. // },
  70964. // "region": {
  70965. // "description": "Name of the region scoping this request.",
  70966. // "location": "path",
  70967. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  70968. // "required": true,
  70969. // "type": "string"
  70970. // },
  70971. // "requestId": {
  70972. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  70973. // "location": "query",
  70974. // "type": "string"
  70975. // }
  70976. // },
  70977. // "path": "{project}/regions/{region}/autoscalers",
  70978. // "request": {
  70979. // "$ref": "Autoscaler"
  70980. // },
  70981. // "response": {
  70982. // "$ref": "Operation"
  70983. // },
  70984. // "scopes": [
  70985. // "https://www.googleapis.com/auth/cloud-platform",
  70986. // "https://www.googleapis.com/auth/compute"
  70987. // ]
  70988. // }
  70989. }
  70990. // method id "compute.regionAutoscalers.testIamPermissions":
  70991. type RegionAutoscalersTestIamPermissionsCall struct {
  70992. s *Service
  70993. project string
  70994. region string
  70995. resource string
  70996. testpermissionsrequest *TestPermissionsRequest
  70997. urlParams_ gensupport.URLParams
  70998. ctx_ context.Context
  70999. header_ http.Header
  71000. }
  71001. // TestIamPermissions: Returns permissions that a caller has on the
  71002. // specified resource.
  71003. func (r *RegionAutoscalersService) TestIamPermissions(project string, region string, resource string, testpermissionsrequest *TestPermissionsRequest) *RegionAutoscalersTestIamPermissionsCall {
  71004. c := &RegionAutoscalersTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  71005. c.project = project
  71006. c.region = region
  71007. c.resource = resource
  71008. c.testpermissionsrequest = testpermissionsrequest
  71009. return c
  71010. }
  71011. // Fields allows partial responses to be retrieved. See
  71012. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  71013. // for more information.
  71014. func (c *RegionAutoscalersTestIamPermissionsCall) Fields(s ...googleapi.Field) *RegionAutoscalersTestIamPermissionsCall {
  71015. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  71016. return c
  71017. }
  71018. // Context sets the context to be used in this call's Do method. Any
  71019. // pending HTTP request will be aborted if the provided context is
  71020. // canceled.
  71021. func (c *RegionAutoscalersTestIamPermissionsCall) Context(ctx context.Context) *RegionAutoscalersTestIamPermissionsCall {
  71022. c.ctx_ = ctx
  71023. return c
  71024. }
  71025. // Header returns an http.Header that can be modified by the caller to
  71026. // add HTTP headers to the request.
  71027. func (c *RegionAutoscalersTestIamPermissionsCall) Header() http.Header {
  71028. if c.header_ == nil {
  71029. c.header_ = make(http.Header)
  71030. }
  71031. return c.header_
  71032. }
  71033. func (c *RegionAutoscalersTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  71034. reqHeaders := make(http.Header)
  71035. for k, v := range c.header_ {
  71036. reqHeaders[k] = v
  71037. }
  71038. reqHeaders.Set("User-Agent", c.s.userAgent())
  71039. var body io.Reader = nil
  71040. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  71041. if err != nil {
  71042. return nil, err
  71043. }
  71044. reqHeaders.Set("Content-Type", "application/json")
  71045. c.urlParams_.Set("alt", alt)
  71046. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/autoscalers/{resource}/testIamPermissions")
  71047. urls += "?" + c.urlParams_.Encode()
  71048. req, _ := http.NewRequest("POST", urls, body)
  71049. req.Header = reqHeaders
  71050. googleapi.Expand(req.URL, map[string]string{
  71051. "project": c.project,
  71052. "region": c.region,
  71053. "resource": c.resource,
  71054. })
  71055. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  71056. }
  71057. // Do executes the "compute.regionAutoscalers.testIamPermissions" call.
  71058. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  71059. // non-2xx status code is an error. Response headers are in either
  71060. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  71061. // returned at all) in error.(*googleapi.Error).Header. Use
  71062. // googleapi.IsNotModified to check whether the returned error was
  71063. // because http.StatusNotModified was returned.
  71064. func (c *RegionAutoscalersTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  71065. gensupport.SetOptions(c.urlParams_, opts...)
  71066. res, err := c.doRequest("json")
  71067. if res != nil && res.StatusCode == http.StatusNotModified {
  71068. if res.Body != nil {
  71069. res.Body.Close()
  71070. }
  71071. return nil, &googleapi.Error{
  71072. Code: res.StatusCode,
  71073. Header: res.Header,
  71074. }
  71075. }
  71076. if err != nil {
  71077. return nil, err
  71078. }
  71079. defer googleapi.CloseBody(res)
  71080. if err := googleapi.CheckResponse(res); err != nil {
  71081. return nil, err
  71082. }
  71083. ret := &TestPermissionsResponse{
  71084. ServerResponse: googleapi.ServerResponse{
  71085. Header: res.Header,
  71086. HTTPStatusCode: res.StatusCode,
  71087. },
  71088. }
  71089. target := &ret
  71090. if err := gensupport.DecodeResponse(target, res); err != nil {
  71091. return nil, err
  71092. }
  71093. return ret, nil
  71094. // {
  71095. // "description": "Returns permissions that a caller has on the specified resource.",
  71096. // "httpMethod": "POST",
  71097. // "id": "compute.regionAutoscalers.testIamPermissions",
  71098. // "parameterOrder": [
  71099. // "project",
  71100. // "region",
  71101. // "resource"
  71102. // ],
  71103. // "parameters": {
  71104. // "project": {
  71105. // "description": "Project ID for this request.",
  71106. // "location": "path",
  71107. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  71108. // "required": true,
  71109. // "type": "string"
  71110. // },
  71111. // "region": {
  71112. // "description": "The name of the region for this request.",
  71113. // "location": "path",
  71114. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  71115. // "required": true,
  71116. // "type": "string"
  71117. // },
  71118. // "resource": {
  71119. // "description": "Name of the resource for this request.",
  71120. // "location": "path",
  71121. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  71122. // "required": true,
  71123. // "type": "string"
  71124. // }
  71125. // },
  71126. // "path": "{project}/regions/{region}/autoscalers/{resource}/testIamPermissions",
  71127. // "request": {
  71128. // "$ref": "TestPermissionsRequest"
  71129. // },
  71130. // "response": {
  71131. // "$ref": "TestPermissionsResponse"
  71132. // },
  71133. // "scopes": [
  71134. // "https://www.googleapis.com/auth/cloud-platform",
  71135. // "https://www.googleapis.com/auth/compute",
  71136. // "https://www.googleapis.com/auth/compute.readonly"
  71137. // ]
  71138. // }
  71139. }
  71140. // method id "compute.regionAutoscalers.update":
  71141. type RegionAutoscalersUpdateCall struct {
  71142. s *Service
  71143. project string
  71144. region string
  71145. autoscaler *Autoscaler
  71146. urlParams_ gensupport.URLParams
  71147. ctx_ context.Context
  71148. header_ http.Header
  71149. }
  71150. // Update: Updates an autoscaler in the specified project using the data
  71151. // included in the request.
  71152. func (r *RegionAutoscalersService) Update(project string, region string, autoscaler *Autoscaler) *RegionAutoscalersUpdateCall {
  71153. c := &RegionAutoscalersUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  71154. c.project = project
  71155. c.region = region
  71156. c.autoscaler = autoscaler
  71157. return c
  71158. }
  71159. // Autoscaler sets the optional parameter "autoscaler": Name of the
  71160. // autoscaler to update.
  71161. func (c *RegionAutoscalersUpdateCall) Autoscaler(autoscaler string) *RegionAutoscalersUpdateCall {
  71162. c.urlParams_.Set("autoscaler", autoscaler)
  71163. return c
  71164. }
  71165. // RequestId sets the optional parameter "requestId": An optional
  71166. // request ID to identify requests. Specify a unique request ID so that
  71167. // if you must retry your request, the server will know to ignore the
  71168. // request if it has already been completed.
  71169. //
  71170. // For example, consider a situation where you make an initial request
  71171. // and the request times out. If you make the request again with the
  71172. // same request ID, the server can check if original operation with the
  71173. // same request ID was received, and if so, will ignore the second
  71174. // request. This prevents clients from accidentally creating duplicate
  71175. // commitments.
  71176. //
  71177. // The request ID must be a valid UUID with the exception that zero UUID
  71178. // is not supported (00000000-0000-0000-0000-000000000000).
  71179. func (c *RegionAutoscalersUpdateCall) RequestId(requestId string) *RegionAutoscalersUpdateCall {
  71180. c.urlParams_.Set("requestId", requestId)
  71181. return c
  71182. }
  71183. // Fields allows partial responses to be retrieved. See
  71184. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  71185. // for more information.
  71186. func (c *RegionAutoscalersUpdateCall) Fields(s ...googleapi.Field) *RegionAutoscalersUpdateCall {
  71187. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  71188. return c
  71189. }
  71190. // Context sets the context to be used in this call's Do method. Any
  71191. // pending HTTP request will be aborted if the provided context is
  71192. // canceled.
  71193. func (c *RegionAutoscalersUpdateCall) Context(ctx context.Context) *RegionAutoscalersUpdateCall {
  71194. c.ctx_ = ctx
  71195. return c
  71196. }
  71197. // Header returns an http.Header that can be modified by the caller to
  71198. // add HTTP headers to the request.
  71199. func (c *RegionAutoscalersUpdateCall) Header() http.Header {
  71200. if c.header_ == nil {
  71201. c.header_ = make(http.Header)
  71202. }
  71203. return c.header_
  71204. }
  71205. func (c *RegionAutoscalersUpdateCall) doRequest(alt string) (*http.Response, error) {
  71206. reqHeaders := make(http.Header)
  71207. for k, v := range c.header_ {
  71208. reqHeaders[k] = v
  71209. }
  71210. reqHeaders.Set("User-Agent", c.s.userAgent())
  71211. var body io.Reader = nil
  71212. body, err := googleapi.WithoutDataWrapper.JSONReader(c.autoscaler)
  71213. if err != nil {
  71214. return nil, err
  71215. }
  71216. reqHeaders.Set("Content-Type", "application/json")
  71217. c.urlParams_.Set("alt", alt)
  71218. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/autoscalers")
  71219. urls += "?" + c.urlParams_.Encode()
  71220. req, _ := http.NewRequest("PUT", urls, body)
  71221. req.Header = reqHeaders
  71222. googleapi.Expand(req.URL, map[string]string{
  71223. "project": c.project,
  71224. "region": c.region,
  71225. })
  71226. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  71227. }
  71228. // Do executes the "compute.regionAutoscalers.update" call.
  71229. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  71230. // status code is an error. Response headers are in either
  71231. // *Operation.ServerResponse.Header or (if a response was returned at
  71232. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  71233. // to check whether the returned error was because
  71234. // http.StatusNotModified was returned.
  71235. func (c *RegionAutoscalersUpdateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  71236. gensupport.SetOptions(c.urlParams_, opts...)
  71237. res, err := c.doRequest("json")
  71238. if res != nil && res.StatusCode == http.StatusNotModified {
  71239. if res.Body != nil {
  71240. res.Body.Close()
  71241. }
  71242. return nil, &googleapi.Error{
  71243. Code: res.StatusCode,
  71244. Header: res.Header,
  71245. }
  71246. }
  71247. if err != nil {
  71248. return nil, err
  71249. }
  71250. defer googleapi.CloseBody(res)
  71251. if err := googleapi.CheckResponse(res); err != nil {
  71252. return nil, err
  71253. }
  71254. ret := &Operation{
  71255. ServerResponse: googleapi.ServerResponse{
  71256. Header: res.Header,
  71257. HTTPStatusCode: res.StatusCode,
  71258. },
  71259. }
  71260. target := &ret
  71261. if err := gensupport.DecodeResponse(target, res); err != nil {
  71262. return nil, err
  71263. }
  71264. return ret, nil
  71265. // {
  71266. // "description": "Updates an autoscaler in the specified project using the data included in the request.",
  71267. // "httpMethod": "PUT",
  71268. // "id": "compute.regionAutoscalers.update",
  71269. // "parameterOrder": [
  71270. // "project",
  71271. // "region"
  71272. // ],
  71273. // "parameters": {
  71274. // "autoscaler": {
  71275. // "description": "Name of the autoscaler to update.",
  71276. // "location": "query",
  71277. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  71278. // "type": "string"
  71279. // },
  71280. // "project": {
  71281. // "description": "Project ID for this request.",
  71282. // "location": "path",
  71283. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  71284. // "required": true,
  71285. // "type": "string"
  71286. // },
  71287. // "region": {
  71288. // "description": "Name of the region scoping this request.",
  71289. // "location": "path",
  71290. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  71291. // "required": true,
  71292. // "type": "string"
  71293. // },
  71294. // "requestId": {
  71295. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  71296. // "location": "query",
  71297. // "type": "string"
  71298. // }
  71299. // },
  71300. // "path": "{project}/regions/{region}/autoscalers",
  71301. // "request": {
  71302. // "$ref": "Autoscaler"
  71303. // },
  71304. // "response": {
  71305. // "$ref": "Operation"
  71306. // },
  71307. // "scopes": [
  71308. // "https://www.googleapis.com/auth/cloud-platform",
  71309. // "https://www.googleapis.com/auth/compute"
  71310. // ]
  71311. // }
  71312. }
  71313. // method id "compute.regionBackendServices.delete":
  71314. type RegionBackendServicesDeleteCall struct {
  71315. s *Service
  71316. project string
  71317. region string
  71318. backendService string
  71319. urlParams_ gensupport.URLParams
  71320. ctx_ context.Context
  71321. header_ http.Header
  71322. }
  71323. // Delete: Deletes the specified regional BackendService resource.
  71324. func (r *RegionBackendServicesService) Delete(project string, region string, backendService string) *RegionBackendServicesDeleteCall {
  71325. c := &RegionBackendServicesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  71326. c.project = project
  71327. c.region = region
  71328. c.backendService = backendService
  71329. return c
  71330. }
  71331. // RequestId sets the optional parameter "requestId": An optional
  71332. // request ID to identify requests. Specify a unique request ID so that
  71333. // if you must retry your request, the server will know to ignore the
  71334. // request if it has already been completed.
  71335. //
  71336. // For example, consider a situation where you make an initial request
  71337. // and the request times out. If you make the request again with the
  71338. // same request ID, the server can check if original operation with the
  71339. // same request ID was received, and if so, will ignore the second
  71340. // request. This prevents clients from accidentally creating duplicate
  71341. // commitments.
  71342. //
  71343. // The request ID must be a valid UUID with the exception that zero UUID
  71344. // is not supported (00000000-0000-0000-0000-000000000000).
  71345. func (c *RegionBackendServicesDeleteCall) RequestId(requestId string) *RegionBackendServicesDeleteCall {
  71346. c.urlParams_.Set("requestId", requestId)
  71347. return c
  71348. }
  71349. // Fields allows partial responses to be retrieved. See
  71350. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  71351. // for more information.
  71352. func (c *RegionBackendServicesDeleteCall) Fields(s ...googleapi.Field) *RegionBackendServicesDeleteCall {
  71353. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  71354. return c
  71355. }
  71356. // Context sets the context to be used in this call's Do method. Any
  71357. // pending HTTP request will be aborted if the provided context is
  71358. // canceled.
  71359. func (c *RegionBackendServicesDeleteCall) Context(ctx context.Context) *RegionBackendServicesDeleteCall {
  71360. c.ctx_ = ctx
  71361. return c
  71362. }
  71363. // Header returns an http.Header that can be modified by the caller to
  71364. // add HTTP headers to the request.
  71365. func (c *RegionBackendServicesDeleteCall) Header() http.Header {
  71366. if c.header_ == nil {
  71367. c.header_ = make(http.Header)
  71368. }
  71369. return c.header_
  71370. }
  71371. func (c *RegionBackendServicesDeleteCall) doRequest(alt string) (*http.Response, error) {
  71372. reqHeaders := make(http.Header)
  71373. for k, v := range c.header_ {
  71374. reqHeaders[k] = v
  71375. }
  71376. reqHeaders.Set("User-Agent", c.s.userAgent())
  71377. var body io.Reader = nil
  71378. c.urlParams_.Set("alt", alt)
  71379. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/backendServices/{backendService}")
  71380. urls += "?" + c.urlParams_.Encode()
  71381. req, _ := http.NewRequest("DELETE", urls, body)
  71382. req.Header = reqHeaders
  71383. googleapi.Expand(req.URL, map[string]string{
  71384. "project": c.project,
  71385. "region": c.region,
  71386. "backendService": c.backendService,
  71387. })
  71388. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  71389. }
  71390. // Do executes the "compute.regionBackendServices.delete" call.
  71391. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  71392. // status code is an error. Response headers are in either
  71393. // *Operation.ServerResponse.Header or (if a response was returned at
  71394. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  71395. // to check whether the returned error was because
  71396. // http.StatusNotModified was returned.
  71397. func (c *RegionBackendServicesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  71398. gensupport.SetOptions(c.urlParams_, opts...)
  71399. res, err := c.doRequest("json")
  71400. if res != nil && res.StatusCode == http.StatusNotModified {
  71401. if res.Body != nil {
  71402. res.Body.Close()
  71403. }
  71404. return nil, &googleapi.Error{
  71405. Code: res.StatusCode,
  71406. Header: res.Header,
  71407. }
  71408. }
  71409. if err != nil {
  71410. return nil, err
  71411. }
  71412. defer googleapi.CloseBody(res)
  71413. if err := googleapi.CheckResponse(res); err != nil {
  71414. return nil, err
  71415. }
  71416. ret := &Operation{
  71417. ServerResponse: googleapi.ServerResponse{
  71418. Header: res.Header,
  71419. HTTPStatusCode: res.StatusCode,
  71420. },
  71421. }
  71422. target := &ret
  71423. if err := gensupport.DecodeResponse(target, res); err != nil {
  71424. return nil, err
  71425. }
  71426. return ret, nil
  71427. // {
  71428. // "description": "Deletes the specified regional BackendService resource.",
  71429. // "httpMethod": "DELETE",
  71430. // "id": "compute.regionBackendServices.delete",
  71431. // "parameterOrder": [
  71432. // "project",
  71433. // "region",
  71434. // "backendService"
  71435. // ],
  71436. // "parameters": {
  71437. // "backendService": {
  71438. // "description": "Name of the BackendService resource to delete.",
  71439. // "location": "path",
  71440. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  71441. // "required": true,
  71442. // "type": "string"
  71443. // },
  71444. // "project": {
  71445. // "description": "Project ID for this request.",
  71446. // "location": "path",
  71447. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  71448. // "required": true,
  71449. // "type": "string"
  71450. // },
  71451. // "region": {
  71452. // "description": "Name of the region scoping this request.",
  71453. // "location": "path",
  71454. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  71455. // "required": true,
  71456. // "type": "string"
  71457. // },
  71458. // "requestId": {
  71459. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  71460. // "location": "query",
  71461. // "type": "string"
  71462. // }
  71463. // },
  71464. // "path": "{project}/regions/{region}/backendServices/{backendService}",
  71465. // "response": {
  71466. // "$ref": "Operation"
  71467. // },
  71468. // "scopes": [
  71469. // "https://www.googleapis.com/auth/cloud-platform",
  71470. // "https://www.googleapis.com/auth/compute"
  71471. // ]
  71472. // }
  71473. }
  71474. // method id "compute.regionBackendServices.get":
  71475. type RegionBackendServicesGetCall struct {
  71476. s *Service
  71477. project string
  71478. region string
  71479. backendService string
  71480. urlParams_ gensupport.URLParams
  71481. ifNoneMatch_ string
  71482. ctx_ context.Context
  71483. header_ http.Header
  71484. }
  71485. // Get: Returns the specified regional BackendService resource.
  71486. func (r *RegionBackendServicesService) Get(project string, region string, backendService string) *RegionBackendServicesGetCall {
  71487. c := &RegionBackendServicesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  71488. c.project = project
  71489. c.region = region
  71490. c.backendService = backendService
  71491. return c
  71492. }
  71493. // Fields allows partial responses to be retrieved. See
  71494. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  71495. // for more information.
  71496. func (c *RegionBackendServicesGetCall) Fields(s ...googleapi.Field) *RegionBackendServicesGetCall {
  71497. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  71498. return c
  71499. }
  71500. // IfNoneMatch sets the optional parameter which makes the operation
  71501. // fail if the object's ETag matches the given value. This is useful for
  71502. // getting updates only after the object has changed since the last
  71503. // request. Use googleapi.IsNotModified to check whether the response
  71504. // error from Do is the result of In-None-Match.
  71505. func (c *RegionBackendServicesGetCall) IfNoneMatch(entityTag string) *RegionBackendServicesGetCall {
  71506. c.ifNoneMatch_ = entityTag
  71507. return c
  71508. }
  71509. // Context sets the context to be used in this call's Do method. Any
  71510. // pending HTTP request will be aborted if the provided context is
  71511. // canceled.
  71512. func (c *RegionBackendServicesGetCall) Context(ctx context.Context) *RegionBackendServicesGetCall {
  71513. c.ctx_ = ctx
  71514. return c
  71515. }
  71516. // Header returns an http.Header that can be modified by the caller to
  71517. // add HTTP headers to the request.
  71518. func (c *RegionBackendServicesGetCall) Header() http.Header {
  71519. if c.header_ == nil {
  71520. c.header_ = make(http.Header)
  71521. }
  71522. return c.header_
  71523. }
  71524. func (c *RegionBackendServicesGetCall) doRequest(alt string) (*http.Response, error) {
  71525. reqHeaders := make(http.Header)
  71526. for k, v := range c.header_ {
  71527. reqHeaders[k] = v
  71528. }
  71529. reqHeaders.Set("User-Agent", c.s.userAgent())
  71530. if c.ifNoneMatch_ != "" {
  71531. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  71532. }
  71533. var body io.Reader = nil
  71534. c.urlParams_.Set("alt", alt)
  71535. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/backendServices/{backendService}")
  71536. urls += "?" + c.urlParams_.Encode()
  71537. req, _ := http.NewRequest("GET", urls, body)
  71538. req.Header = reqHeaders
  71539. googleapi.Expand(req.URL, map[string]string{
  71540. "project": c.project,
  71541. "region": c.region,
  71542. "backendService": c.backendService,
  71543. })
  71544. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  71545. }
  71546. // Do executes the "compute.regionBackendServices.get" call.
  71547. // Exactly one of *BackendService or error will be non-nil. Any non-2xx
  71548. // status code is an error. Response headers are in either
  71549. // *BackendService.ServerResponse.Header or (if a response was returned
  71550. // at all) in error.(*googleapi.Error).Header. Use
  71551. // googleapi.IsNotModified to check whether the returned error was
  71552. // because http.StatusNotModified was returned.
  71553. func (c *RegionBackendServicesGetCall) Do(opts ...googleapi.CallOption) (*BackendService, error) {
  71554. gensupport.SetOptions(c.urlParams_, opts...)
  71555. res, err := c.doRequest("json")
  71556. if res != nil && res.StatusCode == http.StatusNotModified {
  71557. if res.Body != nil {
  71558. res.Body.Close()
  71559. }
  71560. return nil, &googleapi.Error{
  71561. Code: res.StatusCode,
  71562. Header: res.Header,
  71563. }
  71564. }
  71565. if err != nil {
  71566. return nil, err
  71567. }
  71568. defer googleapi.CloseBody(res)
  71569. if err := googleapi.CheckResponse(res); err != nil {
  71570. return nil, err
  71571. }
  71572. ret := &BackendService{
  71573. ServerResponse: googleapi.ServerResponse{
  71574. Header: res.Header,
  71575. HTTPStatusCode: res.StatusCode,
  71576. },
  71577. }
  71578. target := &ret
  71579. if err := gensupport.DecodeResponse(target, res); err != nil {
  71580. return nil, err
  71581. }
  71582. return ret, nil
  71583. // {
  71584. // "description": "Returns the specified regional BackendService resource.",
  71585. // "httpMethod": "GET",
  71586. // "id": "compute.regionBackendServices.get",
  71587. // "parameterOrder": [
  71588. // "project",
  71589. // "region",
  71590. // "backendService"
  71591. // ],
  71592. // "parameters": {
  71593. // "backendService": {
  71594. // "description": "Name of the BackendService resource to return.",
  71595. // "location": "path",
  71596. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  71597. // "required": true,
  71598. // "type": "string"
  71599. // },
  71600. // "project": {
  71601. // "description": "Project ID for this request.",
  71602. // "location": "path",
  71603. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  71604. // "required": true,
  71605. // "type": "string"
  71606. // },
  71607. // "region": {
  71608. // "description": "Name of the region scoping this request.",
  71609. // "location": "path",
  71610. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  71611. // "required": true,
  71612. // "type": "string"
  71613. // }
  71614. // },
  71615. // "path": "{project}/regions/{region}/backendServices/{backendService}",
  71616. // "response": {
  71617. // "$ref": "BackendService"
  71618. // },
  71619. // "scopes": [
  71620. // "https://www.googleapis.com/auth/cloud-platform",
  71621. // "https://www.googleapis.com/auth/compute",
  71622. // "https://www.googleapis.com/auth/compute.readonly"
  71623. // ]
  71624. // }
  71625. }
  71626. // method id "compute.regionBackendServices.getHealth":
  71627. type RegionBackendServicesGetHealthCall struct {
  71628. s *Service
  71629. project string
  71630. region string
  71631. backendService string
  71632. resourcegroupreference *ResourceGroupReference
  71633. urlParams_ gensupport.URLParams
  71634. ctx_ context.Context
  71635. header_ http.Header
  71636. }
  71637. // GetHealth: Gets the most recent health check results for this
  71638. // regional BackendService.
  71639. func (r *RegionBackendServicesService) GetHealth(project string, region string, backendService string, resourcegroupreference *ResourceGroupReference) *RegionBackendServicesGetHealthCall {
  71640. c := &RegionBackendServicesGetHealthCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  71641. c.project = project
  71642. c.region = region
  71643. c.backendService = backendService
  71644. c.resourcegroupreference = resourcegroupreference
  71645. return c
  71646. }
  71647. // Fields allows partial responses to be retrieved. See
  71648. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  71649. // for more information.
  71650. func (c *RegionBackendServicesGetHealthCall) Fields(s ...googleapi.Field) *RegionBackendServicesGetHealthCall {
  71651. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  71652. return c
  71653. }
  71654. // Context sets the context to be used in this call's Do method. Any
  71655. // pending HTTP request will be aborted if the provided context is
  71656. // canceled.
  71657. func (c *RegionBackendServicesGetHealthCall) Context(ctx context.Context) *RegionBackendServicesGetHealthCall {
  71658. c.ctx_ = ctx
  71659. return c
  71660. }
  71661. // Header returns an http.Header that can be modified by the caller to
  71662. // add HTTP headers to the request.
  71663. func (c *RegionBackendServicesGetHealthCall) Header() http.Header {
  71664. if c.header_ == nil {
  71665. c.header_ = make(http.Header)
  71666. }
  71667. return c.header_
  71668. }
  71669. func (c *RegionBackendServicesGetHealthCall) doRequest(alt string) (*http.Response, error) {
  71670. reqHeaders := make(http.Header)
  71671. for k, v := range c.header_ {
  71672. reqHeaders[k] = v
  71673. }
  71674. reqHeaders.Set("User-Agent", c.s.userAgent())
  71675. var body io.Reader = nil
  71676. body, err := googleapi.WithoutDataWrapper.JSONReader(c.resourcegroupreference)
  71677. if err != nil {
  71678. return nil, err
  71679. }
  71680. reqHeaders.Set("Content-Type", "application/json")
  71681. c.urlParams_.Set("alt", alt)
  71682. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/backendServices/{backendService}/getHealth")
  71683. urls += "?" + c.urlParams_.Encode()
  71684. req, _ := http.NewRequest("POST", urls, body)
  71685. req.Header = reqHeaders
  71686. googleapi.Expand(req.URL, map[string]string{
  71687. "project": c.project,
  71688. "region": c.region,
  71689. "backendService": c.backendService,
  71690. })
  71691. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  71692. }
  71693. // Do executes the "compute.regionBackendServices.getHealth" call.
  71694. // Exactly one of *BackendServiceGroupHealth or error will be non-nil.
  71695. // Any non-2xx status code is an error. Response headers are in either
  71696. // *BackendServiceGroupHealth.ServerResponse.Header or (if a response
  71697. // was returned at all) in error.(*googleapi.Error).Header. Use
  71698. // googleapi.IsNotModified to check whether the returned error was
  71699. // because http.StatusNotModified was returned.
  71700. func (c *RegionBackendServicesGetHealthCall) Do(opts ...googleapi.CallOption) (*BackendServiceGroupHealth, error) {
  71701. gensupport.SetOptions(c.urlParams_, opts...)
  71702. res, err := c.doRequest("json")
  71703. if res != nil && res.StatusCode == http.StatusNotModified {
  71704. if res.Body != nil {
  71705. res.Body.Close()
  71706. }
  71707. return nil, &googleapi.Error{
  71708. Code: res.StatusCode,
  71709. Header: res.Header,
  71710. }
  71711. }
  71712. if err != nil {
  71713. return nil, err
  71714. }
  71715. defer googleapi.CloseBody(res)
  71716. if err := googleapi.CheckResponse(res); err != nil {
  71717. return nil, err
  71718. }
  71719. ret := &BackendServiceGroupHealth{
  71720. ServerResponse: googleapi.ServerResponse{
  71721. Header: res.Header,
  71722. HTTPStatusCode: res.StatusCode,
  71723. },
  71724. }
  71725. target := &ret
  71726. if err := gensupport.DecodeResponse(target, res); err != nil {
  71727. return nil, err
  71728. }
  71729. return ret, nil
  71730. // {
  71731. // "description": "Gets the most recent health check results for this regional BackendService.",
  71732. // "httpMethod": "POST",
  71733. // "id": "compute.regionBackendServices.getHealth",
  71734. // "parameterOrder": [
  71735. // "project",
  71736. // "region",
  71737. // "backendService"
  71738. // ],
  71739. // "parameters": {
  71740. // "backendService": {
  71741. // "description": "Name of the BackendService resource for which to get health.",
  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. // "location": "path",
  71749. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  71750. // "required": true,
  71751. // "type": "string"
  71752. // },
  71753. // "region": {
  71754. // "description": "Name of the region scoping this request.",
  71755. // "location": "path",
  71756. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  71757. // "required": true,
  71758. // "type": "string"
  71759. // }
  71760. // },
  71761. // "path": "{project}/regions/{region}/backendServices/{backendService}/getHealth",
  71762. // "request": {
  71763. // "$ref": "ResourceGroupReference"
  71764. // },
  71765. // "response": {
  71766. // "$ref": "BackendServiceGroupHealth"
  71767. // },
  71768. // "scopes": [
  71769. // "https://www.googleapis.com/auth/cloud-platform",
  71770. // "https://www.googleapis.com/auth/compute",
  71771. // "https://www.googleapis.com/auth/compute.readonly"
  71772. // ]
  71773. // }
  71774. }
  71775. // method id "compute.regionBackendServices.insert":
  71776. type RegionBackendServicesInsertCall struct {
  71777. s *Service
  71778. project string
  71779. region string
  71780. backendservice *BackendService
  71781. urlParams_ gensupport.URLParams
  71782. ctx_ context.Context
  71783. header_ http.Header
  71784. }
  71785. // Insert: Creates a regional BackendService resource in the specified
  71786. // project using the data included in the request. There are several
  71787. // restrictions and guidelines to keep in mind when creating a regional
  71788. // backend service. Read Restrictions and Guidelines for more
  71789. // information.
  71790. func (r *RegionBackendServicesService) Insert(project string, region string, backendservice *BackendService) *RegionBackendServicesInsertCall {
  71791. c := &RegionBackendServicesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  71792. c.project = project
  71793. c.region = region
  71794. c.backendservice = backendservice
  71795. return c
  71796. }
  71797. // RequestId sets the optional parameter "requestId": An optional
  71798. // request ID to identify requests. Specify a unique request ID so that
  71799. // if you must retry your request, the server will know to ignore the
  71800. // request if it has already been completed.
  71801. //
  71802. // For example, consider a situation where you make an initial request
  71803. // and the request times out. If you make the request again with the
  71804. // same request ID, the server can check if original operation with the
  71805. // same request ID was received, and if so, will ignore the second
  71806. // request. This prevents clients from accidentally creating duplicate
  71807. // commitments.
  71808. //
  71809. // The request ID must be a valid UUID with the exception that zero UUID
  71810. // is not supported (00000000-0000-0000-0000-000000000000).
  71811. func (c *RegionBackendServicesInsertCall) RequestId(requestId string) *RegionBackendServicesInsertCall {
  71812. c.urlParams_.Set("requestId", requestId)
  71813. return c
  71814. }
  71815. // Fields allows partial responses to be retrieved. See
  71816. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  71817. // for more information.
  71818. func (c *RegionBackendServicesInsertCall) Fields(s ...googleapi.Field) *RegionBackendServicesInsertCall {
  71819. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  71820. return c
  71821. }
  71822. // Context sets the context to be used in this call's Do method. Any
  71823. // pending HTTP request will be aborted if the provided context is
  71824. // canceled.
  71825. func (c *RegionBackendServicesInsertCall) Context(ctx context.Context) *RegionBackendServicesInsertCall {
  71826. c.ctx_ = ctx
  71827. return c
  71828. }
  71829. // Header returns an http.Header that can be modified by the caller to
  71830. // add HTTP headers to the request.
  71831. func (c *RegionBackendServicesInsertCall) Header() http.Header {
  71832. if c.header_ == nil {
  71833. c.header_ = make(http.Header)
  71834. }
  71835. return c.header_
  71836. }
  71837. func (c *RegionBackendServicesInsertCall) doRequest(alt string) (*http.Response, error) {
  71838. reqHeaders := make(http.Header)
  71839. for k, v := range c.header_ {
  71840. reqHeaders[k] = v
  71841. }
  71842. reqHeaders.Set("User-Agent", c.s.userAgent())
  71843. var body io.Reader = nil
  71844. body, err := googleapi.WithoutDataWrapper.JSONReader(c.backendservice)
  71845. if err != nil {
  71846. return nil, err
  71847. }
  71848. reqHeaders.Set("Content-Type", "application/json")
  71849. c.urlParams_.Set("alt", alt)
  71850. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/backendServices")
  71851. urls += "?" + c.urlParams_.Encode()
  71852. req, _ := http.NewRequest("POST", urls, body)
  71853. req.Header = reqHeaders
  71854. googleapi.Expand(req.URL, map[string]string{
  71855. "project": c.project,
  71856. "region": c.region,
  71857. })
  71858. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  71859. }
  71860. // Do executes the "compute.regionBackendServices.insert" call.
  71861. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  71862. // status code is an error. Response headers are in either
  71863. // *Operation.ServerResponse.Header or (if a response was returned at
  71864. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  71865. // to check whether the returned error was because
  71866. // http.StatusNotModified was returned.
  71867. func (c *RegionBackendServicesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  71868. gensupport.SetOptions(c.urlParams_, opts...)
  71869. res, err := c.doRequest("json")
  71870. if res != nil && res.StatusCode == http.StatusNotModified {
  71871. if res.Body != nil {
  71872. res.Body.Close()
  71873. }
  71874. return nil, &googleapi.Error{
  71875. Code: res.StatusCode,
  71876. Header: res.Header,
  71877. }
  71878. }
  71879. if err != nil {
  71880. return nil, err
  71881. }
  71882. defer googleapi.CloseBody(res)
  71883. if err := googleapi.CheckResponse(res); err != nil {
  71884. return nil, err
  71885. }
  71886. ret := &Operation{
  71887. ServerResponse: googleapi.ServerResponse{
  71888. Header: res.Header,
  71889. HTTPStatusCode: res.StatusCode,
  71890. },
  71891. }
  71892. target := &ret
  71893. if err := gensupport.DecodeResponse(target, res); err != nil {
  71894. return nil, err
  71895. }
  71896. return ret, nil
  71897. // {
  71898. // "description": "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.",
  71899. // "httpMethod": "POST",
  71900. // "id": "compute.regionBackendServices.insert",
  71901. // "parameterOrder": [
  71902. // "project",
  71903. // "region"
  71904. // ],
  71905. // "parameters": {
  71906. // "project": {
  71907. // "description": "Project ID for this request.",
  71908. // "location": "path",
  71909. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  71910. // "required": true,
  71911. // "type": "string"
  71912. // },
  71913. // "region": {
  71914. // "description": "Name of the region scoping this request.",
  71915. // "location": "path",
  71916. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  71917. // "required": true,
  71918. // "type": "string"
  71919. // },
  71920. // "requestId": {
  71921. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  71922. // "location": "query",
  71923. // "type": "string"
  71924. // }
  71925. // },
  71926. // "path": "{project}/regions/{region}/backendServices",
  71927. // "request": {
  71928. // "$ref": "BackendService"
  71929. // },
  71930. // "response": {
  71931. // "$ref": "Operation"
  71932. // },
  71933. // "scopes": [
  71934. // "https://www.googleapis.com/auth/cloud-platform",
  71935. // "https://www.googleapis.com/auth/compute"
  71936. // ]
  71937. // }
  71938. }
  71939. // method id "compute.regionBackendServices.list":
  71940. type RegionBackendServicesListCall struct {
  71941. s *Service
  71942. project string
  71943. region string
  71944. urlParams_ gensupport.URLParams
  71945. ifNoneMatch_ string
  71946. ctx_ context.Context
  71947. header_ http.Header
  71948. }
  71949. // List: Retrieves the list of regional BackendService resources
  71950. // available to the specified project in the given region.
  71951. func (r *RegionBackendServicesService) List(project string, region string) *RegionBackendServicesListCall {
  71952. c := &RegionBackendServicesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  71953. c.project = project
  71954. c.region = region
  71955. return c
  71956. }
  71957. // Filter sets the optional parameter "filter": A filter expression that
  71958. // filters resources listed in the response. The expression must specify
  71959. // the field name, a comparison operator, and the value that you want to
  71960. // use for filtering. The value must be a string, a number, or a
  71961. // boolean. The comparison operator must be either =, !=, >, or <.
  71962. //
  71963. // For example, if you are filtering Compute Engine instances, you can
  71964. // exclude instances named example-instance by specifying name !=
  71965. // example-instance.
  71966. //
  71967. // You can also filter nested fields. For example, you could specify
  71968. // scheduling.automaticRestart = false to include instances only if they
  71969. // are not scheduled for automatic restarts. You can use filtering on
  71970. // nested fields to filter based on resource labels.
  71971. //
  71972. // To filter on multiple expressions, provide each separate expression
  71973. // within parentheses. For example, (scheduling.automaticRestart = true)
  71974. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  71975. // AND expression. However, you can include AND and OR expressions
  71976. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  71977. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  71978. // true).
  71979. func (c *RegionBackendServicesListCall) Filter(filter string) *RegionBackendServicesListCall {
  71980. c.urlParams_.Set("filter", filter)
  71981. return c
  71982. }
  71983. // MaxResults sets the optional parameter "maxResults": The maximum
  71984. // number of results per page that should be returned. If the number of
  71985. // available results is larger than maxResults, Compute Engine returns a
  71986. // nextPageToken that can be used to get the next page of results in
  71987. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  71988. // (Default: 500)
  71989. func (c *RegionBackendServicesListCall) MaxResults(maxResults int64) *RegionBackendServicesListCall {
  71990. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  71991. return c
  71992. }
  71993. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  71994. // a certain order. By default, results are returned in alphanumerical
  71995. // order based on the resource name.
  71996. //
  71997. // You can also sort results in descending order based on the creation
  71998. // timestamp using orderBy="creationTimestamp desc". This sorts results
  71999. // based on the creationTimestamp field in reverse chronological order
  72000. // (newest result first). Use this to sort resources like operations so
  72001. // that the newest operation is returned first.
  72002. //
  72003. // Currently, only sorting by name or creationTimestamp desc is
  72004. // supported.
  72005. func (c *RegionBackendServicesListCall) OrderBy(orderBy string) *RegionBackendServicesListCall {
  72006. c.urlParams_.Set("orderBy", orderBy)
  72007. return c
  72008. }
  72009. // PageToken sets the optional parameter "pageToken": Specifies a page
  72010. // token to use. Set pageToken to the nextPageToken returned by a
  72011. // previous list request to get the next page of results.
  72012. func (c *RegionBackendServicesListCall) PageToken(pageToken string) *RegionBackendServicesListCall {
  72013. c.urlParams_.Set("pageToken", pageToken)
  72014. return c
  72015. }
  72016. // Fields allows partial responses to be retrieved. See
  72017. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  72018. // for more information.
  72019. func (c *RegionBackendServicesListCall) Fields(s ...googleapi.Field) *RegionBackendServicesListCall {
  72020. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  72021. return c
  72022. }
  72023. // IfNoneMatch sets the optional parameter which makes the operation
  72024. // fail if the object's ETag matches the given value. This is useful for
  72025. // getting updates only after the object has changed since the last
  72026. // request. Use googleapi.IsNotModified to check whether the response
  72027. // error from Do is the result of In-None-Match.
  72028. func (c *RegionBackendServicesListCall) IfNoneMatch(entityTag string) *RegionBackendServicesListCall {
  72029. c.ifNoneMatch_ = entityTag
  72030. return c
  72031. }
  72032. // Context sets the context to be used in this call's Do method. Any
  72033. // pending HTTP request will be aborted if the provided context is
  72034. // canceled.
  72035. func (c *RegionBackendServicesListCall) Context(ctx context.Context) *RegionBackendServicesListCall {
  72036. c.ctx_ = ctx
  72037. return c
  72038. }
  72039. // Header returns an http.Header that can be modified by the caller to
  72040. // add HTTP headers to the request.
  72041. func (c *RegionBackendServicesListCall) Header() http.Header {
  72042. if c.header_ == nil {
  72043. c.header_ = make(http.Header)
  72044. }
  72045. return c.header_
  72046. }
  72047. func (c *RegionBackendServicesListCall) doRequest(alt string) (*http.Response, error) {
  72048. reqHeaders := make(http.Header)
  72049. for k, v := range c.header_ {
  72050. reqHeaders[k] = v
  72051. }
  72052. reqHeaders.Set("User-Agent", c.s.userAgent())
  72053. if c.ifNoneMatch_ != "" {
  72054. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  72055. }
  72056. var body io.Reader = nil
  72057. c.urlParams_.Set("alt", alt)
  72058. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/backendServices")
  72059. urls += "?" + c.urlParams_.Encode()
  72060. req, _ := http.NewRequest("GET", urls, body)
  72061. req.Header = reqHeaders
  72062. googleapi.Expand(req.URL, map[string]string{
  72063. "project": c.project,
  72064. "region": c.region,
  72065. })
  72066. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  72067. }
  72068. // Do executes the "compute.regionBackendServices.list" call.
  72069. // Exactly one of *BackendServiceList or error will be non-nil. Any
  72070. // non-2xx status code is an error. Response headers are in either
  72071. // *BackendServiceList.ServerResponse.Header or (if a response was
  72072. // returned at all) in error.(*googleapi.Error).Header. Use
  72073. // googleapi.IsNotModified to check whether the returned error was
  72074. // because http.StatusNotModified was returned.
  72075. func (c *RegionBackendServicesListCall) Do(opts ...googleapi.CallOption) (*BackendServiceList, error) {
  72076. gensupport.SetOptions(c.urlParams_, opts...)
  72077. res, err := c.doRequest("json")
  72078. if res != nil && res.StatusCode == http.StatusNotModified {
  72079. if res.Body != nil {
  72080. res.Body.Close()
  72081. }
  72082. return nil, &googleapi.Error{
  72083. Code: res.StatusCode,
  72084. Header: res.Header,
  72085. }
  72086. }
  72087. if err != nil {
  72088. return nil, err
  72089. }
  72090. defer googleapi.CloseBody(res)
  72091. if err := googleapi.CheckResponse(res); err != nil {
  72092. return nil, err
  72093. }
  72094. ret := &BackendServiceList{
  72095. ServerResponse: googleapi.ServerResponse{
  72096. Header: res.Header,
  72097. HTTPStatusCode: res.StatusCode,
  72098. },
  72099. }
  72100. target := &ret
  72101. if err := gensupport.DecodeResponse(target, res); err != nil {
  72102. return nil, err
  72103. }
  72104. return ret, nil
  72105. // {
  72106. // "description": "Retrieves the list of regional BackendService resources available to the specified project in the given region.",
  72107. // "httpMethod": "GET",
  72108. // "id": "compute.regionBackendServices.list",
  72109. // "parameterOrder": [
  72110. // "project",
  72111. // "region"
  72112. // ],
  72113. // "parameters": {
  72114. // "filter": {
  72115. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  72116. // "location": "query",
  72117. // "type": "string"
  72118. // },
  72119. // "maxResults": {
  72120. // "default": "500",
  72121. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  72122. // "format": "uint32",
  72123. // "location": "query",
  72124. // "minimum": "0",
  72125. // "type": "integer"
  72126. // },
  72127. // "orderBy": {
  72128. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  72129. // "location": "query",
  72130. // "type": "string"
  72131. // },
  72132. // "pageToken": {
  72133. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  72134. // "location": "query",
  72135. // "type": "string"
  72136. // },
  72137. // "project": {
  72138. // "description": "Project ID for this request.",
  72139. // "location": "path",
  72140. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  72141. // "required": true,
  72142. // "type": "string"
  72143. // },
  72144. // "region": {
  72145. // "description": "Name of the region scoping this request.",
  72146. // "location": "path",
  72147. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  72148. // "required": true,
  72149. // "type": "string"
  72150. // }
  72151. // },
  72152. // "path": "{project}/regions/{region}/backendServices",
  72153. // "response": {
  72154. // "$ref": "BackendServiceList"
  72155. // },
  72156. // "scopes": [
  72157. // "https://www.googleapis.com/auth/cloud-platform",
  72158. // "https://www.googleapis.com/auth/compute",
  72159. // "https://www.googleapis.com/auth/compute.readonly"
  72160. // ]
  72161. // }
  72162. }
  72163. // Pages invokes f for each page of results.
  72164. // A non-nil error returned from f will halt the iteration.
  72165. // The provided context supersedes any context provided to the Context method.
  72166. func (c *RegionBackendServicesListCall) Pages(ctx context.Context, f func(*BackendServiceList) error) error {
  72167. c.ctx_ = ctx
  72168. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  72169. for {
  72170. x, err := c.Do()
  72171. if err != nil {
  72172. return err
  72173. }
  72174. if err := f(x); err != nil {
  72175. return err
  72176. }
  72177. if x.NextPageToken == "" {
  72178. return nil
  72179. }
  72180. c.PageToken(x.NextPageToken)
  72181. }
  72182. }
  72183. // method id "compute.regionBackendServices.patch":
  72184. type RegionBackendServicesPatchCall struct {
  72185. s *Service
  72186. project string
  72187. region string
  72188. backendService string
  72189. backendservice *BackendService
  72190. urlParams_ gensupport.URLParams
  72191. ctx_ context.Context
  72192. header_ http.Header
  72193. }
  72194. // Patch: Updates the specified regional BackendService resource with
  72195. // the data included in the request. There are several restrictions and
  72196. // guidelines to keep in mind when updating a backend service. Read
  72197. // Restrictions and Guidelines for more information. This method
  72198. // supports PATCH semantics and uses the JSON merge patch format and
  72199. // processing rules.
  72200. func (r *RegionBackendServicesService) Patch(project string, region string, backendService string, backendservice *BackendService) *RegionBackendServicesPatchCall {
  72201. c := &RegionBackendServicesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  72202. c.project = project
  72203. c.region = region
  72204. c.backendService = backendService
  72205. c.backendservice = backendservice
  72206. return c
  72207. }
  72208. // RequestId sets the optional parameter "requestId": An optional
  72209. // request ID to identify requests. Specify a unique request ID so that
  72210. // if you must retry your request, the server will know to ignore the
  72211. // request if it has already been completed.
  72212. //
  72213. // For example, consider a situation where you make an initial request
  72214. // and the request times out. If you make the request again with the
  72215. // same request ID, the server can check if original operation with the
  72216. // same request ID was received, and if so, will ignore the second
  72217. // request. This prevents clients from accidentally creating duplicate
  72218. // commitments.
  72219. //
  72220. // The request ID must be a valid UUID with the exception that zero UUID
  72221. // is not supported (00000000-0000-0000-0000-000000000000).
  72222. func (c *RegionBackendServicesPatchCall) RequestId(requestId string) *RegionBackendServicesPatchCall {
  72223. c.urlParams_.Set("requestId", requestId)
  72224. return c
  72225. }
  72226. // Fields allows partial responses to be retrieved. See
  72227. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  72228. // for more information.
  72229. func (c *RegionBackendServicesPatchCall) Fields(s ...googleapi.Field) *RegionBackendServicesPatchCall {
  72230. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  72231. return c
  72232. }
  72233. // Context sets the context to be used in this call's Do method. Any
  72234. // pending HTTP request will be aborted if the provided context is
  72235. // canceled.
  72236. func (c *RegionBackendServicesPatchCall) Context(ctx context.Context) *RegionBackendServicesPatchCall {
  72237. c.ctx_ = ctx
  72238. return c
  72239. }
  72240. // Header returns an http.Header that can be modified by the caller to
  72241. // add HTTP headers to the request.
  72242. func (c *RegionBackendServicesPatchCall) Header() http.Header {
  72243. if c.header_ == nil {
  72244. c.header_ = make(http.Header)
  72245. }
  72246. return c.header_
  72247. }
  72248. func (c *RegionBackendServicesPatchCall) doRequest(alt string) (*http.Response, error) {
  72249. reqHeaders := make(http.Header)
  72250. for k, v := range c.header_ {
  72251. reqHeaders[k] = v
  72252. }
  72253. reqHeaders.Set("User-Agent", c.s.userAgent())
  72254. var body io.Reader = nil
  72255. body, err := googleapi.WithoutDataWrapper.JSONReader(c.backendservice)
  72256. if err != nil {
  72257. return nil, err
  72258. }
  72259. reqHeaders.Set("Content-Type", "application/json")
  72260. c.urlParams_.Set("alt", alt)
  72261. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/backendServices/{backendService}")
  72262. urls += "?" + c.urlParams_.Encode()
  72263. req, _ := http.NewRequest("PATCH", urls, body)
  72264. req.Header = reqHeaders
  72265. googleapi.Expand(req.URL, map[string]string{
  72266. "project": c.project,
  72267. "region": c.region,
  72268. "backendService": c.backendService,
  72269. })
  72270. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  72271. }
  72272. // Do executes the "compute.regionBackendServices.patch" call.
  72273. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  72274. // status code is an error. Response headers are in either
  72275. // *Operation.ServerResponse.Header or (if a response was returned at
  72276. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  72277. // to check whether the returned error was because
  72278. // http.StatusNotModified was returned.
  72279. func (c *RegionBackendServicesPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  72280. gensupport.SetOptions(c.urlParams_, opts...)
  72281. res, err := c.doRequest("json")
  72282. if res != nil && res.StatusCode == http.StatusNotModified {
  72283. if res.Body != nil {
  72284. res.Body.Close()
  72285. }
  72286. return nil, &googleapi.Error{
  72287. Code: res.StatusCode,
  72288. Header: res.Header,
  72289. }
  72290. }
  72291. if err != nil {
  72292. return nil, err
  72293. }
  72294. defer googleapi.CloseBody(res)
  72295. if err := googleapi.CheckResponse(res); err != nil {
  72296. return nil, err
  72297. }
  72298. ret := &Operation{
  72299. ServerResponse: googleapi.ServerResponse{
  72300. Header: res.Header,
  72301. HTTPStatusCode: res.StatusCode,
  72302. },
  72303. }
  72304. target := &ret
  72305. if err := gensupport.DecodeResponse(target, res); err != nil {
  72306. return nil, err
  72307. }
  72308. return ret, nil
  72309. // {
  72310. // "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.",
  72311. // "httpMethod": "PATCH",
  72312. // "id": "compute.regionBackendServices.patch",
  72313. // "parameterOrder": [
  72314. // "project",
  72315. // "region",
  72316. // "backendService"
  72317. // ],
  72318. // "parameters": {
  72319. // "backendService": {
  72320. // "description": "Name of the BackendService resource to patch.",
  72321. // "location": "path",
  72322. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  72323. // "required": true,
  72324. // "type": "string"
  72325. // },
  72326. // "project": {
  72327. // "description": "Project ID for this request.",
  72328. // "location": "path",
  72329. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  72330. // "required": true,
  72331. // "type": "string"
  72332. // },
  72333. // "region": {
  72334. // "description": "Name of the region scoping this request.",
  72335. // "location": "path",
  72336. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  72337. // "required": true,
  72338. // "type": "string"
  72339. // },
  72340. // "requestId": {
  72341. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  72342. // "location": "query",
  72343. // "type": "string"
  72344. // }
  72345. // },
  72346. // "path": "{project}/regions/{region}/backendServices/{backendService}",
  72347. // "request": {
  72348. // "$ref": "BackendService"
  72349. // },
  72350. // "response": {
  72351. // "$ref": "Operation"
  72352. // },
  72353. // "scopes": [
  72354. // "https://www.googleapis.com/auth/cloud-platform",
  72355. // "https://www.googleapis.com/auth/compute"
  72356. // ]
  72357. // }
  72358. }
  72359. // method id "compute.regionBackendServices.testIamPermissions":
  72360. type RegionBackendServicesTestIamPermissionsCall struct {
  72361. s *Service
  72362. project string
  72363. region string
  72364. resource string
  72365. testpermissionsrequest *TestPermissionsRequest
  72366. urlParams_ gensupport.URLParams
  72367. ctx_ context.Context
  72368. header_ http.Header
  72369. }
  72370. // TestIamPermissions: Returns permissions that a caller has on the
  72371. // specified resource.
  72372. func (r *RegionBackendServicesService) TestIamPermissions(project string, region string, resource string, testpermissionsrequest *TestPermissionsRequest) *RegionBackendServicesTestIamPermissionsCall {
  72373. c := &RegionBackendServicesTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  72374. c.project = project
  72375. c.region = region
  72376. c.resource = resource
  72377. c.testpermissionsrequest = testpermissionsrequest
  72378. return c
  72379. }
  72380. // Fields allows partial responses to be retrieved. See
  72381. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  72382. // for more information.
  72383. func (c *RegionBackendServicesTestIamPermissionsCall) Fields(s ...googleapi.Field) *RegionBackendServicesTestIamPermissionsCall {
  72384. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  72385. return c
  72386. }
  72387. // Context sets the context to be used in this call's Do method. Any
  72388. // pending HTTP request will be aborted if the provided context is
  72389. // canceled.
  72390. func (c *RegionBackendServicesTestIamPermissionsCall) Context(ctx context.Context) *RegionBackendServicesTestIamPermissionsCall {
  72391. c.ctx_ = ctx
  72392. return c
  72393. }
  72394. // Header returns an http.Header that can be modified by the caller to
  72395. // add HTTP headers to the request.
  72396. func (c *RegionBackendServicesTestIamPermissionsCall) Header() http.Header {
  72397. if c.header_ == nil {
  72398. c.header_ = make(http.Header)
  72399. }
  72400. return c.header_
  72401. }
  72402. func (c *RegionBackendServicesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  72403. reqHeaders := make(http.Header)
  72404. for k, v := range c.header_ {
  72405. reqHeaders[k] = v
  72406. }
  72407. reqHeaders.Set("User-Agent", c.s.userAgent())
  72408. var body io.Reader = nil
  72409. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  72410. if err != nil {
  72411. return nil, err
  72412. }
  72413. reqHeaders.Set("Content-Type", "application/json")
  72414. c.urlParams_.Set("alt", alt)
  72415. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/backendServices/{resource}/testIamPermissions")
  72416. urls += "?" + c.urlParams_.Encode()
  72417. req, _ := http.NewRequest("POST", urls, body)
  72418. req.Header = reqHeaders
  72419. googleapi.Expand(req.URL, map[string]string{
  72420. "project": c.project,
  72421. "region": c.region,
  72422. "resource": c.resource,
  72423. })
  72424. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  72425. }
  72426. // Do executes the "compute.regionBackendServices.testIamPermissions" call.
  72427. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  72428. // non-2xx status code is an error. Response headers are in either
  72429. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  72430. // returned at all) in error.(*googleapi.Error).Header. Use
  72431. // googleapi.IsNotModified to check whether the returned error was
  72432. // because http.StatusNotModified was returned.
  72433. func (c *RegionBackendServicesTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  72434. gensupport.SetOptions(c.urlParams_, opts...)
  72435. res, err := c.doRequest("json")
  72436. if res != nil && res.StatusCode == http.StatusNotModified {
  72437. if res.Body != nil {
  72438. res.Body.Close()
  72439. }
  72440. return nil, &googleapi.Error{
  72441. Code: res.StatusCode,
  72442. Header: res.Header,
  72443. }
  72444. }
  72445. if err != nil {
  72446. return nil, err
  72447. }
  72448. defer googleapi.CloseBody(res)
  72449. if err := googleapi.CheckResponse(res); err != nil {
  72450. return nil, err
  72451. }
  72452. ret := &TestPermissionsResponse{
  72453. ServerResponse: googleapi.ServerResponse{
  72454. Header: res.Header,
  72455. HTTPStatusCode: res.StatusCode,
  72456. },
  72457. }
  72458. target := &ret
  72459. if err := gensupport.DecodeResponse(target, res); err != nil {
  72460. return nil, err
  72461. }
  72462. return ret, nil
  72463. // {
  72464. // "description": "Returns permissions that a caller has on the specified resource.",
  72465. // "httpMethod": "POST",
  72466. // "id": "compute.regionBackendServices.testIamPermissions",
  72467. // "parameterOrder": [
  72468. // "project",
  72469. // "region",
  72470. // "resource"
  72471. // ],
  72472. // "parameters": {
  72473. // "project": {
  72474. // "description": "Project ID for this request.",
  72475. // "location": "path",
  72476. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  72477. // "required": true,
  72478. // "type": "string"
  72479. // },
  72480. // "region": {
  72481. // "description": "The name of the region for this request.",
  72482. // "location": "path",
  72483. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  72484. // "required": true,
  72485. // "type": "string"
  72486. // },
  72487. // "resource": {
  72488. // "description": "Name of the resource for this request.",
  72489. // "location": "path",
  72490. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  72491. // "required": true,
  72492. // "type": "string"
  72493. // }
  72494. // },
  72495. // "path": "{project}/regions/{region}/backendServices/{resource}/testIamPermissions",
  72496. // "request": {
  72497. // "$ref": "TestPermissionsRequest"
  72498. // },
  72499. // "response": {
  72500. // "$ref": "TestPermissionsResponse"
  72501. // },
  72502. // "scopes": [
  72503. // "https://www.googleapis.com/auth/cloud-platform",
  72504. // "https://www.googleapis.com/auth/compute",
  72505. // "https://www.googleapis.com/auth/compute.readonly"
  72506. // ]
  72507. // }
  72508. }
  72509. // method id "compute.regionBackendServices.update":
  72510. type RegionBackendServicesUpdateCall struct {
  72511. s *Service
  72512. project string
  72513. region string
  72514. backendService string
  72515. backendservice *BackendService
  72516. urlParams_ gensupport.URLParams
  72517. ctx_ context.Context
  72518. header_ http.Header
  72519. }
  72520. // Update: Updates the specified regional BackendService resource with
  72521. // the data included in the request. There are several restrictions and
  72522. // guidelines to keep in mind when updating a backend service. Read
  72523. // Restrictions and Guidelines for more information.
  72524. func (r *RegionBackendServicesService) Update(project string, region string, backendService string, backendservice *BackendService) *RegionBackendServicesUpdateCall {
  72525. c := &RegionBackendServicesUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  72526. c.project = project
  72527. c.region = region
  72528. c.backendService = backendService
  72529. c.backendservice = backendservice
  72530. return c
  72531. }
  72532. // RequestId sets the optional parameter "requestId": An optional
  72533. // request ID to identify requests. Specify a unique request ID so that
  72534. // if you must retry your request, the server will know to ignore the
  72535. // request if it has already been completed.
  72536. //
  72537. // For example, consider a situation where you make an initial request
  72538. // and the request times out. If you make the request again with the
  72539. // same request ID, the server can check if original operation with the
  72540. // same request ID was received, and if so, will ignore the second
  72541. // request. This prevents clients from accidentally creating duplicate
  72542. // commitments.
  72543. //
  72544. // The request ID must be a valid UUID with the exception that zero UUID
  72545. // is not supported (00000000-0000-0000-0000-000000000000).
  72546. func (c *RegionBackendServicesUpdateCall) RequestId(requestId string) *RegionBackendServicesUpdateCall {
  72547. c.urlParams_.Set("requestId", requestId)
  72548. return c
  72549. }
  72550. // Fields allows partial responses to be retrieved. See
  72551. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  72552. // for more information.
  72553. func (c *RegionBackendServicesUpdateCall) Fields(s ...googleapi.Field) *RegionBackendServicesUpdateCall {
  72554. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  72555. return c
  72556. }
  72557. // Context sets the context to be used in this call's Do method. Any
  72558. // pending HTTP request will be aborted if the provided context is
  72559. // canceled.
  72560. func (c *RegionBackendServicesUpdateCall) Context(ctx context.Context) *RegionBackendServicesUpdateCall {
  72561. c.ctx_ = ctx
  72562. return c
  72563. }
  72564. // Header returns an http.Header that can be modified by the caller to
  72565. // add HTTP headers to the request.
  72566. func (c *RegionBackendServicesUpdateCall) Header() http.Header {
  72567. if c.header_ == nil {
  72568. c.header_ = make(http.Header)
  72569. }
  72570. return c.header_
  72571. }
  72572. func (c *RegionBackendServicesUpdateCall) doRequest(alt string) (*http.Response, error) {
  72573. reqHeaders := make(http.Header)
  72574. for k, v := range c.header_ {
  72575. reqHeaders[k] = v
  72576. }
  72577. reqHeaders.Set("User-Agent", c.s.userAgent())
  72578. var body io.Reader = nil
  72579. body, err := googleapi.WithoutDataWrapper.JSONReader(c.backendservice)
  72580. if err != nil {
  72581. return nil, err
  72582. }
  72583. reqHeaders.Set("Content-Type", "application/json")
  72584. c.urlParams_.Set("alt", alt)
  72585. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/backendServices/{backendService}")
  72586. urls += "?" + c.urlParams_.Encode()
  72587. req, _ := http.NewRequest("PUT", urls, body)
  72588. req.Header = reqHeaders
  72589. googleapi.Expand(req.URL, map[string]string{
  72590. "project": c.project,
  72591. "region": c.region,
  72592. "backendService": c.backendService,
  72593. })
  72594. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  72595. }
  72596. // Do executes the "compute.regionBackendServices.update" call.
  72597. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  72598. // status code is an error. Response headers are in either
  72599. // *Operation.ServerResponse.Header or (if a response was returned at
  72600. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  72601. // to check whether the returned error was because
  72602. // http.StatusNotModified was returned.
  72603. func (c *RegionBackendServicesUpdateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  72604. gensupport.SetOptions(c.urlParams_, opts...)
  72605. res, err := c.doRequest("json")
  72606. if res != nil && res.StatusCode == http.StatusNotModified {
  72607. if res.Body != nil {
  72608. res.Body.Close()
  72609. }
  72610. return nil, &googleapi.Error{
  72611. Code: res.StatusCode,
  72612. Header: res.Header,
  72613. }
  72614. }
  72615. if err != nil {
  72616. return nil, err
  72617. }
  72618. defer googleapi.CloseBody(res)
  72619. if err := googleapi.CheckResponse(res); err != nil {
  72620. return nil, err
  72621. }
  72622. ret := &Operation{
  72623. ServerResponse: googleapi.ServerResponse{
  72624. Header: res.Header,
  72625. HTTPStatusCode: res.StatusCode,
  72626. },
  72627. }
  72628. target := &ret
  72629. if err := gensupport.DecodeResponse(target, res); err != nil {
  72630. return nil, err
  72631. }
  72632. return ret, nil
  72633. // {
  72634. // "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.",
  72635. // "httpMethod": "PUT",
  72636. // "id": "compute.regionBackendServices.update",
  72637. // "parameterOrder": [
  72638. // "project",
  72639. // "region",
  72640. // "backendService"
  72641. // ],
  72642. // "parameters": {
  72643. // "backendService": {
  72644. // "description": "Name of the BackendService resource to update.",
  72645. // "location": "path",
  72646. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  72647. // "required": true,
  72648. // "type": "string"
  72649. // },
  72650. // "project": {
  72651. // "description": "Project ID for this request.",
  72652. // "location": "path",
  72653. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  72654. // "required": true,
  72655. // "type": "string"
  72656. // },
  72657. // "region": {
  72658. // "description": "Name of the region scoping this request.",
  72659. // "location": "path",
  72660. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  72661. // "required": true,
  72662. // "type": "string"
  72663. // },
  72664. // "requestId": {
  72665. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  72666. // "location": "query",
  72667. // "type": "string"
  72668. // }
  72669. // },
  72670. // "path": "{project}/regions/{region}/backendServices/{backendService}",
  72671. // "request": {
  72672. // "$ref": "BackendService"
  72673. // },
  72674. // "response": {
  72675. // "$ref": "Operation"
  72676. // },
  72677. // "scopes": [
  72678. // "https://www.googleapis.com/auth/cloud-platform",
  72679. // "https://www.googleapis.com/auth/compute"
  72680. // ]
  72681. // }
  72682. }
  72683. // method id "compute.regionCommitments.aggregatedList":
  72684. type RegionCommitmentsAggregatedListCall struct {
  72685. s *Service
  72686. project string
  72687. urlParams_ gensupport.URLParams
  72688. ifNoneMatch_ string
  72689. ctx_ context.Context
  72690. header_ http.Header
  72691. }
  72692. // AggregatedList: Retrieves an aggregated list of commitments.
  72693. func (r *RegionCommitmentsService) AggregatedList(project string) *RegionCommitmentsAggregatedListCall {
  72694. c := &RegionCommitmentsAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  72695. c.project = project
  72696. return c
  72697. }
  72698. // Filter sets the optional parameter "filter": A filter expression that
  72699. // filters resources listed in the response. The expression must specify
  72700. // the field name, a comparison operator, and the value that you want to
  72701. // use for filtering. The value must be a string, a number, or a
  72702. // boolean. The comparison operator must be either =, !=, >, or <.
  72703. //
  72704. // For example, if you are filtering Compute Engine instances, you can
  72705. // exclude instances named example-instance by specifying name !=
  72706. // example-instance.
  72707. //
  72708. // You can also filter nested fields. For example, you could specify
  72709. // scheduling.automaticRestart = false to include instances only if they
  72710. // are not scheduled for automatic restarts. You can use filtering on
  72711. // nested fields to filter based on resource labels.
  72712. //
  72713. // To filter on multiple expressions, provide each separate expression
  72714. // within parentheses. For example, (scheduling.automaticRestart = true)
  72715. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  72716. // AND expression. However, you can include AND and OR expressions
  72717. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  72718. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  72719. // true).
  72720. func (c *RegionCommitmentsAggregatedListCall) Filter(filter string) *RegionCommitmentsAggregatedListCall {
  72721. c.urlParams_.Set("filter", filter)
  72722. return c
  72723. }
  72724. // MaxResults sets the optional parameter "maxResults": The maximum
  72725. // number of results per page that should be returned. If the number of
  72726. // available results is larger than maxResults, Compute Engine returns a
  72727. // nextPageToken that can be used to get the next page of results in
  72728. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  72729. // (Default: 500)
  72730. func (c *RegionCommitmentsAggregatedListCall) MaxResults(maxResults int64) *RegionCommitmentsAggregatedListCall {
  72731. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  72732. return c
  72733. }
  72734. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  72735. // a certain order. By default, results are returned in alphanumerical
  72736. // order based on the resource name.
  72737. //
  72738. // You can also sort results in descending order based on the creation
  72739. // timestamp using orderBy="creationTimestamp desc". This sorts results
  72740. // based on the creationTimestamp field in reverse chronological order
  72741. // (newest result first). Use this to sort resources like operations so
  72742. // that the newest operation is returned first.
  72743. //
  72744. // Currently, only sorting by name or creationTimestamp desc is
  72745. // supported.
  72746. func (c *RegionCommitmentsAggregatedListCall) OrderBy(orderBy string) *RegionCommitmentsAggregatedListCall {
  72747. c.urlParams_.Set("orderBy", orderBy)
  72748. return c
  72749. }
  72750. // PageToken sets the optional parameter "pageToken": Specifies a page
  72751. // token to use. Set pageToken to the nextPageToken returned by a
  72752. // previous list request to get the next page of results.
  72753. func (c *RegionCommitmentsAggregatedListCall) PageToken(pageToken string) *RegionCommitmentsAggregatedListCall {
  72754. c.urlParams_.Set("pageToken", pageToken)
  72755. return c
  72756. }
  72757. // Fields allows partial responses to be retrieved. See
  72758. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  72759. // for more information.
  72760. func (c *RegionCommitmentsAggregatedListCall) Fields(s ...googleapi.Field) *RegionCommitmentsAggregatedListCall {
  72761. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  72762. return c
  72763. }
  72764. // IfNoneMatch sets the optional parameter which makes the operation
  72765. // fail if the object's ETag matches the given value. This is useful for
  72766. // getting updates only after the object has changed since the last
  72767. // request. Use googleapi.IsNotModified to check whether the response
  72768. // error from Do is the result of In-None-Match.
  72769. func (c *RegionCommitmentsAggregatedListCall) IfNoneMatch(entityTag string) *RegionCommitmentsAggregatedListCall {
  72770. c.ifNoneMatch_ = entityTag
  72771. return c
  72772. }
  72773. // Context sets the context to be used in this call's Do method. Any
  72774. // pending HTTP request will be aborted if the provided context is
  72775. // canceled.
  72776. func (c *RegionCommitmentsAggregatedListCall) Context(ctx context.Context) *RegionCommitmentsAggregatedListCall {
  72777. c.ctx_ = ctx
  72778. return c
  72779. }
  72780. // Header returns an http.Header that can be modified by the caller to
  72781. // add HTTP headers to the request.
  72782. func (c *RegionCommitmentsAggregatedListCall) Header() http.Header {
  72783. if c.header_ == nil {
  72784. c.header_ = make(http.Header)
  72785. }
  72786. return c.header_
  72787. }
  72788. func (c *RegionCommitmentsAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  72789. reqHeaders := make(http.Header)
  72790. for k, v := range c.header_ {
  72791. reqHeaders[k] = v
  72792. }
  72793. reqHeaders.Set("User-Agent", c.s.userAgent())
  72794. if c.ifNoneMatch_ != "" {
  72795. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  72796. }
  72797. var body io.Reader = nil
  72798. c.urlParams_.Set("alt", alt)
  72799. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/commitments")
  72800. urls += "?" + c.urlParams_.Encode()
  72801. req, _ := http.NewRequest("GET", urls, body)
  72802. req.Header = reqHeaders
  72803. googleapi.Expand(req.URL, map[string]string{
  72804. "project": c.project,
  72805. })
  72806. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  72807. }
  72808. // Do executes the "compute.regionCommitments.aggregatedList" call.
  72809. // Exactly one of *CommitmentAggregatedList or error will be non-nil.
  72810. // Any non-2xx status code is an error. Response headers are in either
  72811. // *CommitmentAggregatedList.ServerResponse.Header or (if a response was
  72812. // returned at all) in error.(*googleapi.Error).Header. Use
  72813. // googleapi.IsNotModified to check whether the returned error was
  72814. // because http.StatusNotModified was returned.
  72815. func (c *RegionCommitmentsAggregatedListCall) Do(opts ...googleapi.CallOption) (*CommitmentAggregatedList, error) {
  72816. gensupport.SetOptions(c.urlParams_, opts...)
  72817. res, err := c.doRequest("json")
  72818. if res != nil && res.StatusCode == http.StatusNotModified {
  72819. if res.Body != nil {
  72820. res.Body.Close()
  72821. }
  72822. return nil, &googleapi.Error{
  72823. Code: res.StatusCode,
  72824. Header: res.Header,
  72825. }
  72826. }
  72827. if err != nil {
  72828. return nil, err
  72829. }
  72830. defer googleapi.CloseBody(res)
  72831. if err := googleapi.CheckResponse(res); err != nil {
  72832. return nil, err
  72833. }
  72834. ret := &CommitmentAggregatedList{
  72835. ServerResponse: googleapi.ServerResponse{
  72836. Header: res.Header,
  72837. HTTPStatusCode: res.StatusCode,
  72838. },
  72839. }
  72840. target := &ret
  72841. if err := gensupport.DecodeResponse(target, res); err != nil {
  72842. return nil, err
  72843. }
  72844. return ret, nil
  72845. // {
  72846. // "description": "Retrieves an aggregated list of commitments.",
  72847. // "httpMethod": "GET",
  72848. // "id": "compute.regionCommitments.aggregatedList",
  72849. // "parameterOrder": [
  72850. // "project"
  72851. // ],
  72852. // "parameters": {
  72853. // "filter": {
  72854. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  72855. // "location": "query",
  72856. // "type": "string"
  72857. // },
  72858. // "maxResults": {
  72859. // "default": "500",
  72860. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  72861. // "format": "uint32",
  72862. // "location": "query",
  72863. // "minimum": "0",
  72864. // "type": "integer"
  72865. // },
  72866. // "orderBy": {
  72867. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  72868. // "location": "query",
  72869. // "type": "string"
  72870. // },
  72871. // "pageToken": {
  72872. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  72873. // "location": "query",
  72874. // "type": "string"
  72875. // },
  72876. // "project": {
  72877. // "description": "Project ID for this request.",
  72878. // "location": "path",
  72879. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  72880. // "required": true,
  72881. // "type": "string"
  72882. // }
  72883. // },
  72884. // "path": "{project}/aggregated/commitments",
  72885. // "response": {
  72886. // "$ref": "CommitmentAggregatedList"
  72887. // },
  72888. // "scopes": [
  72889. // "https://www.googleapis.com/auth/cloud-platform",
  72890. // "https://www.googleapis.com/auth/compute",
  72891. // "https://www.googleapis.com/auth/compute.readonly"
  72892. // ]
  72893. // }
  72894. }
  72895. // Pages invokes f for each page of results.
  72896. // A non-nil error returned from f will halt the iteration.
  72897. // The provided context supersedes any context provided to the Context method.
  72898. func (c *RegionCommitmentsAggregatedListCall) Pages(ctx context.Context, f func(*CommitmentAggregatedList) error) error {
  72899. c.ctx_ = ctx
  72900. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  72901. for {
  72902. x, err := c.Do()
  72903. if err != nil {
  72904. return err
  72905. }
  72906. if err := f(x); err != nil {
  72907. return err
  72908. }
  72909. if x.NextPageToken == "" {
  72910. return nil
  72911. }
  72912. c.PageToken(x.NextPageToken)
  72913. }
  72914. }
  72915. // method id "compute.regionCommitments.get":
  72916. type RegionCommitmentsGetCall struct {
  72917. s *Service
  72918. project string
  72919. region string
  72920. commitment string
  72921. urlParams_ gensupport.URLParams
  72922. ifNoneMatch_ string
  72923. ctx_ context.Context
  72924. header_ http.Header
  72925. }
  72926. // Get: Returns the specified commitment resource. Gets a list of
  72927. // available commitments by making a list() request.
  72928. func (r *RegionCommitmentsService) Get(project string, region string, commitment string) *RegionCommitmentsGetCall {
  72929. c := &RegionCommitmentsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  72930. c.project = project
  72931. c.region = region
  72932. c.commitment = commitment
  72933. return c
  72934. }
  72935. // Fields allows partial responses to be retrieved. See
  72936. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  72937. // for more information.
  72938. func (c *RegionCommitmentsGetCall) Fields(s ...googleapi.Field) *RegionCommitmentsGetCall {
  72939. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  72940. return c
  72941. }
  72942. // IfNoneMatch sets the optional parameter which makes the operation
  72943. // fail if the object's ETag matches the given value. This is useful for
  72944. // getting updates only after the object has changed since the last
  72945. // request. Use googleapi.IsNotModified to check whether the response
  72946. // error from Do is the result of In-None-Match.
  72947. func (c *RegionCommitmentsGetCall) IfNoneMatch(entityTag string) *RegionCommitmentsGetCall {
  72948. c.ifNoneMatch_ = entityTag
  72949. return c
  72950. }
  72951. // Context sets the context to be used in this call's Do method. Any
  72952. // pending HTTP request will be aborted if the provided context is
  72953. // canceled.
  72954. func (c *RegionCommitmentsGetCall) Context(ctx context.Context) *RegionCommitmentsGetCall {
  72955. c.ctx_ = ctx
  72956. return c
  72957. }
  72958. // Header returns an http.Header that can be modified by the caller to
  72959. // add HTTP headers to the request.
  72960. func (c *RegionCommitmentsGetCall) Header() http.Header {
  72961. if c.header_ == nil {
  72962. c.header_ = make(http.Header)
  72963. }
  72964. return c.header_
  72965. }
  72966. func (c *RegionCommitmentsGetCall) doRequest(alt string) (*http.Response, error) {
  72967. reqHeaders := make(http.Header)
  72968. for k, v := range c.header_ {
  72969. reqHeaders[k] = v
  72970. }
  72971. reqHeaders.Set("User-Agent", c.s.userAgent())
  72972. if c.ifNoneMatch_ != "" {
  72973. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  72974. }
  72975. var body io.Reader = nil
  72976. c.urlParams_.Set("alt", alt)
  72977. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/commitments/{commitment}")
  72978. urls += "?" + c.urlParams_.Encode()
  72979. req, _ := http.NewRequest("GET", urls, body)
  72980. req.Header = reqHeaders
  72981. googleapi.Expand(req.URL, map[string]string{
  72982. "project": c.project,
  72983. "region": c.region,
  72984. "commitment": c.commitment,
  72985. })
  72986. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  72987. }
  72988. // Do executes the "compute.regionCommitments.get" call.
  72989. // Exactly one of *Commitment or error will be non-nil. Any non-2xx
  72990. // status code is an error. Response headers are in either
  72991. // *Commitment.ServerResponse.Header or (if a response was returned at
  72992. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  72993. // to check whether the returned error was because
  72994. // http.StatusNotModified was returned.
  72995. func (c *RegionCommitmentsGetCall) Do(opts ...googleapi.CallOption) (*Commitment, error) {
  72996. gensupport.SetOptions(c.urlParams_, opts...)
  72997. res, err := c.doRequest("json")
  72998. if res != nil && res.StatusCode == http.StatusNotModified {
  72999. if res.Body != nil {
  73000. res.Body.Close()
  73001. }
  73002. return nil, &googleapi.Error{
  73003. Code: res.StatusCode,
  73004. Header: res.Header,
  73005. }
  73006. }
  73007. if err != nil {
  73008. return nil, err
  73009. }
  73010. defer googleapi.CloseBody(res)
  73011. if err := googleapi.CheckResponse(res); err != nil {
  73012. return nil, err
  73013. }
  73014. ret := &Commitment{
  73015. ServerResponse: googleapi.ServerResponse{
  73016. Header: res.Header,
  73017. HTTPStatusCode: res.StatusCode,
  73018. },
  73019. }
  73020. target := &ret
  73021. if err := gensupport.DecodeResponse(target, res); err != nil {
  73022. return nil, err
  73023. }
  73024. return ret, nil
  73025. // {
  73026. // "description": "Returns the specified commitment resource. Gets a list of available commitments by making a list() request.",
  73027. // "httpMethod": "GET",
  73028. // "id": "compute.regionCommitments.get",
  73029. // "parameterOrder": [
  73030. // "project",
  73031. // "region",
  73032. // "commitment"
  73033. // ],
  73034. // "parameters": {
  73035. // "commitment": {
  73036. // "description": "Name of the commitment to return.",
  73037. // "location": "path",
  73038. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  73039. // "required": true,
  73040. // "type": "string"
  73041. // },
  73042. // "project": {
  73043. // "description": "Project ID for this request.",
  73044. // "location": "path",
  73045. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  73046. // "required": true,
  73047. // "type": "string"
  73048. // },
  73049. // "region": {
  73050. // "description": "Name of the region for this request.",
  73051. // "location": "path",
  73052. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  73053. // "required": true,
  73054. // "type": "string"
  73055. // }
  73056. // },
  73057. // "path": "{project}/regions/{region}/commitments/{commitment}",
  73058. // "response": {
  73059. // "$ref": "Commitment"
  73060. // },
  73061. // "scopes": [
  73062. // "https://www.googleapis.com/auth/cloud-platform",
  73063. // "https://www.googleapis.com/auth/compute",
  73064. // "https://www.googleapis.com/auth/compute.readonly"
  73065. // ]
  73066. // }
  73067. }
  73068. // method id "compute.regionCommitments.insert":
  73069. type RegionCommitmentsInsertCall struct {
  73070. s *Service
  73071. project string
  73072. region string
  73073. commitment *Commitment
  73074. urlParams_ gensupport.URLParams
  73075. ctx_ context.Context
  73076. header_ http.Header
  73077. }
  73078. // Insert: Creates a commitment in the specified project using the data
  73079. // included in the request.
  73080. func (r *RegionCommitmentsService) Insert(project string, region string, commitment *Commitment) *RegionCommitmentsInsertCall {
  73081. c := &RegionCommitmentsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  73082. c.project = project
  73083. c.region = region
  73084. c.commitment = commitment
  73085. return c
  73086. }
  73087. // RequestId sets the optional parameter "requestId": An optional
  73088. // request ID to identify requests. Specify a unique request ID so that
  73089. // if you must retry your request, the server will know to ignore the
  73090. // request if it has already been completed.
  73091. //
  73092. // For example, consider a situation where you make an initial request
  73093. // and the request times out. If you make the request again with the
  73094. // same request ID, the server can check if original operation with the
  73095. // same request ID was received, and if so, will ignore the second
  73096. // request. This prevents clients from accidentally creating duplicate
  73097. // commitments.
  73098. //
  73099. // The request ID must be a valid UUID with the exception that zero UUID
  73100. // is not supported (00000000-0000-0000-0000-000000000000).
  73101. func (c *RegionCommitmentsInsertCall) RequestId(requestId string) *RegionCommitmentsInsertCall {
  73102. c.urlParams_.Set("requestId", requestId)
  73103. return c
  73104. }
  73105. // Fields allows partial responses to be retrieved. See
  73106. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  73107. // for more information.
  73108. func (c *RegionCommitmentsInsertCall) Fields(s ...googleapi.Field) *RegionCommitmentsInsertCall {
  73109. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  73110. return c
  73111. }
  73112. // Context sets the context to be used in this call's Do method. Any
  73113. // pending HTTP request will be aborted if the provided context is
  73114. // canceled.
  73115. func (c *RegionCommitmentsInsertCall) Context(ctx context.Context) *RegionCommitmentsInsertCall {
  73116. c.ctx_ = ctx
  73117. return c
  73118. }
  73119. // Header returns an http.Header that can be modified by the caller to
  73120. // add HTTP headers to the request.
  73121. func (c *RegionCommitmentsInsertCall) Header() http.Header {
  73122. if c.header_ == nil {
  73123. c.header_ = make(http.Header)
  73124. }
  73125. return c.header_
  73126. }
  73127. func (c *RegionCommitmentsInsertCall) doRequest(alt string) (*http.Response, error) {
  73128. reqHeaders := make(http.Header)
  73129. for k, v := range c.header_ {
  73130. reqHeaders[k] = v
  73131. }
  73132. reqHeaders.Set("User-Agent", c.s.userAgent())
  73133. var body io.Reader = nil
  73134. body, err := googleapi.WithoutDataWrapper.JSONReader(c.commitment)
  73135. if err != nil {
  73136. return nil, err
  73137. }
  73138. reqHeaders.Set("Content-Type", "application/json")
  73139. c.urlParams_.Set("alt", alt)
  73140. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/commitments")
  73141. urls += "?" + c.urlParams_.Encode()
  73142. req, _ := http.NewRequest("POST", urls, body)
  73143. req.Header = reqHeaders
  73144. googleapi.Expand(req.URL, map[string]string{
  73145. "project": c.project,
  73146. "region": c.region,
  73147. })
  73148. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  73149. }
  73150. // Do executes the "compute.regionCommitments.insert" call.
  73151. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  73152. // status code is an error. Response headers are in either
  73153. // *Operation.ServerResponse.Header or (if a response was returned at
  73154. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  73155. // to check whether the returned error was because
  73156. // http.StatusNotModified was returned.
  73157. func (c *RegionCommitmentsInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  73158. gensupport.SetOptions(c.urlParams_, opts...)
  73159. res, err := c.doRequest("json")
  73160. if res != nil && res.StatusCode == http.StatusNotModified {
  73161. if res.Body != nil {
  73162. res.Body.Close()
  73163. }
  73164. return nil, &googleapi.Error{
  73165. Code: res.StatusCode,
  73166. Header: res.Header,
  73167. }
  73168. }
  73169. if err != nil {
  73170. return nil, err
  73171. }
  73172. defer googleapi.CloseBody(res)
  73173. if err := googleapi.CheckResponse(res); err != nil {
  73174. return nil, err
  73175. }
  73176. ret := &Operation{
  73177. ServerResponse: googleapi.ServerResponse{
  73178. Header: res.Header,
  73179. HTTPStatusCode: res.StatusCode,
  73180. },
  73181. }
  73182. target := &ret
  73183. if err := gensupport.DecodeResponse(target, res); err != nil {
  73184. return nil, err
  73185. }
  73186. return ret, nil
  73187. // {
  73188. // "description": "Creates a commitment in the specified project using the data included in the request.",
  73189. // "httpMethod": "POST",
  73190. // "id": "compute.regionCommitments.insert",
  73191. // "parameterOrder": [
  73192. // "project",
  73193. // "region"
  73194. // ],
  73195. // "parameters": {
  73196. // "project": {
  73197. // "description": "Project ID for this request.",
  73198. // "location": "path",
  73199. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  73200. // "required": true,
  73201. // "type": "string"
  73202. // },
  73203. // "region": {
  73204. // "description": "Name of the region for this request.",
  73205. // "location": "path",
  73206. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  73207. // "required": true,
  73208. // "type": "string"
  73209. // },
  73210. // "requestId": {
  73211. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  73212. // "location": "query",
  73213. // "type": "string"
  73214. // }
  73215. // },
  73216. // "path": "{project}/regions/{region}/commitments",
  73217. // "request": {
  73218. // "$ref": "Commitment"
  73219. // },
  73220. // "response": {
  73221. // "$ref": "Operation"
  73222. // },
  73223. // "scopes": [
  73224. // "https://www.googleapis.com/auth/cloud-platform",
  73225. // "https://www.googleapis.com/auth/compute"
  73226. // ]
  73227. // }
  73228. }
  73229. // method id "compute.regionCommitments.list":
  73230. type RegionCommitmentsListCall struct {
  73231. s *Service
  73232. project string
  73233. region string
  73234. urlParams_ gensupport.URLParams
  73235. ifNoneMatch_ string
  73236. ctx_ context.Context
  73237. header_ http.Header
  73238. }
  73239. // List: Retrieves a list of commitments contained within the specified
  73240. // region.
  73241. func (r *RegionCommitmentsService) List(project string, region string) *RegionCommitmentsListCall {
  73242. c := &RegionCommitmentsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  73243. c.project = project
  73244. c.region = region
  73245. return c
  73246. }
  73247. // Filter sets the optional parameter "filter": A filter expression that
  73248. // filters resources listed in the response. The expression must specify
  73249. // the field name, a comparison operator, and the value that you want to
  73250. // use for filtering. The value must be a string, a number, or a
  73251. // boolean. The comparison operator must be either =, !=, >, or <.
  73252. //
  73253. // For example, if you are filtering Compute Engine instances, you can
  73254. // exclude instances named example-instance by specifying name !=
  73255. // example-instance.
  73256. //
  73257. // You can also filter nested fields. For example, you could specify
  73258. // scheduling.automaticRestart = false to include instances only if they
  73259. // are not scheduled for automatic restarts. You can use filtering on
  73260. // nested fields to filter based on resource labels.
  73261. //
  73262. // To filter on multiple expressions, provide each separate expression
  73263. // within parentheses. For example, (scheduling.automaticRestart = true)
  73264. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  73265. // AND expression. However, you can include AND and OR expressions
  73266. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  73267. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  73268. // true).
  73269. func (c *RegionCommitmentsListCall) Filter(filter string) *RegionCommitmentsListCall {
  73270. c.urlParams_.Set("filter", filter)
  73271. return c
  73272. }
  73273. // MaxResults sets the optional parameter "maxResults": The maximum
  73274. // number of results per page that should be returned. If the number of
  73275. // available results is larger than maxResults, Compute Engine returns a
  73276. // nextPageToken that can be used to get the next page of results in
  73277. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  73278. // (Default: 500)
  73279. func (c *RegionCommitmentsListCall) MaxResults(maxResults int64) *RegionCommitmentsListCall {
  73280. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  73281. return c
  73282. }
  73283. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  73284. // a certain order. By default, results are returned in alphanumerical
  73285. // order based on the resource name.
  73286. //
  73287. // You can also sort results in descending order based on the creation
  73288. // timestamp using orderBy="creationTimestamp desc". This sorts results
  73289. // based on the creationTimestamp field in reverse chronological order
  73290. // (newest result first). Use this to sort resources like operations so
  73291. // that the newest operation is returned first.
  73292. //
  73293. // Currently, only sorting by name or creationTimestamp desc is
  73294. // supported.
  73295. func (c *RegionCommitmentsListCall) OrderBy(orderBy string) *RegionCommitmentsListCall {
  73296. c.urlParams_.Set("orderBy", orderBy)
  73297. return c
  73298. }
  73299. // PageToken sets the optional parameter "pageToken": Specifies a page
  73300. // token to use. Set pageToken to the nextPageToken returned by a
  73301. // previous list request to get the next page of results.
  73302. func (c *RegionCommitmentsListCall) PageToken(pageToken string) *RegionCommitmentsListCall {
  73303. c.urlParams_.Set("pageToken", pageToken)
  73304. return c
  73305. }
  73306. // Fields allows partial responses to be retrieved. See
  73307. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  73308. // for more information.
  73309. func (c *RegionCommitmentsListCall) Fields(s ...googleapi.Field) *RegionCommitmentsListCall {
  73310. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  73311. return c
  73312. }
  73313. // IfNoneMatch sets the optional parameter which makes the operation
  73314. // fail if the object's ETag matches the given value. This is useful for
  73315. // getting updates only after the object has changed since the last
  73316. // request. Use googleapi.IsNotModified to check whether the response
  73317. // error from Do is the result of In-None-Match.
  73318. func (c *RegionCommitmentsListCall) IfNoneMatch(entityTag string) *RegionCommitmentsListCall {
  73319. c.ifNoneMatch_ = entityTag
  73320. return c
  73321. }
  73322. // Context sets the context to be used in this call's Do method. Any
  73323. // pending HTTP request will be aborted if the provided context is
  73324. // canceled.
  73325. func (c *RegionCommitmentsListCall) Context(ctx context.Context) *RegionCommitmentsListCall {
  73326. c.ctx_ = ctx
  73327. return c
  73328. }
  73329. // Header returns an http.Header that can be modified by the caller to
  73330. // add HTTP headers to the request.
  73331. func (c *RegionCommitmentsListCall) Header() http.Header {
  73332. if c.header_ == nil {
  73333. c.header_ = make(http.Header)
  73334. }
  73335. return c.header_
  73336. }
  73337. func (c *RegionCommitmentsListCall) doRequest(alt string) (*http.Response, error) {
  73338. reqHeaders := make(http.Header)
  73339. for k, v := range c.header_ {
  73340. reqHeaders[k] = v
  73341. }
  73342. reqHeaders.Set("User-Agent", c.s.userAgent())
  73343. if c.ifNoneMatch_ != "" {
  73344. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  73345. }
  73346. var body io.Reader = nil
  73347. c.urlParams_.Set("alt", alt)
  73348. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/commitments")
  73349. urls += "?" + c.urlParams_.Encode()
  73350. req, _ := http.NewRequest("GET", urls, body)
  73351. req.Header = reqHeaders
  73352. googleapi.Expand(req.URL, map[string]string{
  73353. "project": c.project,
  73354. "region": c.region,
  73355. })
  73356. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  73357. }
  73358. // Do executes the "compute.regionCommitments.list" call.
  73359. // Exactly one of *CommitmentList or error will be non-nil. Any non-2xx
  73360. // status code is an error. Response headers are in either
  73361. // *CommitmentList.ServerResponse.Header or (if a response was returned
  73362. // at all) in error.(*googleapi.Error).Header. Use
  73363. // googleapi.IsNotModified to check whether the returned error was
  73364. // because http.StatusNotModified was returned.
  73365. func (c *RegionCommitmentsListCall) Do(opts ...googleapi.CallOption) (*CommitmentList, error) {
  73366. gensupport.SetOptions(c.urlParams_, opts...)
  73367. res, err := c.doRequest("json")
  73368. if res != nil && res.StatusCode == http.StatusNotModified {
  73369. if res.Body != nil {
  73370. res.Body.Close()
  73371. }
  73372. return nil, &googleapi.Error{
  73373. Code: res.StatusCode,
  73374. Header: res.Header,
  73375. }
  73376. }
  73377. if err != nil {
  73378. return nil, err
  73379. }
  73380. defer googleapi.CloseBody(res)
  73381. if err := googleapi.CheckResponse(res); err != nil {
  73382. return nil, err
  73383. }
  73384. ret := &CommitmentList{
  73385. ServerResponse: googleapi.ServerResponse{
  73386. Header: res.Header,
  73387. HTTPStatusCode: res.StatusCode,
  73388. },
  73389. }
  73390. target := &ret
  73391. if err := gensupport.DecodeResponse(target, res); err != nil {
  73392. return nil, err
  73393. }
  73394. return ret, nil
  73395. // {
  73396. // "description": "Retrieves a list of commitments contained within the specified region.",
  73397. // "httpMethod": "GET",
  73398. // "id": "compute.regionCommitments.list",
  73399. // "parameterOrder": [
  73400. // "project",
  73401. // "region"
  73402. // ],
  73403. // "parameters": {
  73404. // "filter": {
  73405. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  73406. // "location": "query",
  73407. // "type": "string"
  73408. // },
  73409. // "maxResults": {
  73410. // "default": "500",
  73411. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  73412. // "format": "uint32",
  73413. // "location": "query",
  73414. // "minimum": "0",
  73415. // "type": "integer"
  73416. // },
  73417. // "orderBy": {
  73418. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  73419. // "location": "query",
  73420. // "type": "string"
  73421. // },
  73422. // "pageToken": {
  73423. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  73424. // "location": "query",
  73425. // "type": "string"
  73426. // },
  73427. // "project": {
  73428. // "description": "Project ID for this request.",
  73429. // "location": "path",
  73430. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  73431. // "required": true,
  73432. // "type": "string"
  73433. // },
  73434. // "region": {
  73435. // "description": "Name of the region for this request.",
  73436. // "location": "path",
  73437. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  73438. // "required": true,
  73439. // "type": "string"
  73440. // }
  73441. // },
  73442. // "path": "{project}/regions/{region}/commitments",
  73443. // "response": {
  73444. // "$ref": "CommitmentList"
  73445. // },
  73446. // "scopes": [
  73447. // "https://www.googleapis.com/auth/cloud-platform",
  73448. // "https://www.googleapis.com/auth/compute",
  73449. // "https://www.googleapis.com/auth/compute.readonly"
  73450. // ]
  73451. // }
  73452. }
  73453. // Pages invokes f for each page of results.
  73454. // A non-nil error returned from f will halt the iteration.
  73455. // The provided context supersedes any context provided to the Context method.
  73456. func (c *RegionCommitmentsListCall) Pages(ctx context.Context, f func(*CommitmentList) error) error {
  73457. c.ctx_ = ctx
  73458. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  73459. for {
  73460. x, err := c.Do()
  73461. if err != nil {
  73462. return err
  73463. }
  73464. if err := f(x); err != nil {
  73465. return err
  73466. }
  73467. if x.NextPageToken == "" {
  73468. return nil
  73469. }
  73470. c.PageToken(x.NextPageToken)
  73471. }
  73472. }
  73473. // method id "compute.regionDiskTypes.get":
  73474. type RegionDiskTypesGetCall struct {
  73475. s *Service
  73476. project string
  73477. region string
  73478. diskType string
  73479. urlParams_ gensupport.URLParams
  73480. ifNoneMatch_ string
  73481. ctx_ context.Context
  73482. header_ http.Header
  73483. }
  73484. // Get: Returns the specified regional disk type. Gets a list of
  73485. // available disk types by making a list() request.
  73486. func (r *RegionDiskTypesService) Get(project string, region string, diskType string) *RegionDiskTypesGetCall {
  73487. c := &RegionDiskTypesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  73488. c.project = project
  73489. c.region = region
  73490. c.diskType = diskType
  73491. return c
  73492. }
  73493. // Fields allows partial responses to be retrieved. See
  73494. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  73495. // for more information.
  73496. func (c *RegionDiskTypesGetCall) Fields(s ...googleapi.Field) *RegionDiskTypesGetCall {
  73497. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  73498. return c
  73499. }
  73500. // IfNoneMatch sets the optional parameter which makes the operation
  73501. // fail if the object's ETag matches the given value. This is useful for
  73502. // getting updates only after the object has changed since the last
  73503. // request. Use googleapi.IsNotModified to check whether the response
  73504. // error from Do is the result of In-None-Match.
  73505. func (c *RegionDiskTypesGetCall) IfNoneMatch(entityTag string) *RegionDiskTypesGetCall {
  73506. c.ifNoneMatch_ = entityTag
  73507. return c
  73508. }
  73509. // Context sets the context to be used in this call's Do method. Any
  73510. // pending HTTP request will be aborted if the provided context is
  73511. // canceled.
  73512. func (c *RegionDiskTypesGetCall) Context(ctx context.Context) *RegionDiskTypesGetCall {
  73513. c.ctx_ = ctx
  73514. return c
  73515. }
  73516. // Header returns an http.Header that can be modified by the caller to
  73517. // add HTTP headers to the request.
  73518. func (c *RegionDiskTypesGetCall) Header() http.Header {
  73519. if c.header_ == nil {
  73520. c.header_ = make(http.Header)
  73521. }
  73522. return c.header_
  73523. }
  73524. func (c *RegionDiskTypesGetCall) doRequest(alt string) (*http.Response, error) {
  73525. reqHeaders := make(http.Header)
  73526. for k, v := range c.header_ {
  73527. reqHeaders[k] = v
  73528. }
  73529. reqHeaders.Set("User-Agent", c.s.userAgent())
  73530. if c.ifNoneMatch_ != "" {
  73531. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  73532. }
  73533. var body io.Reader = nil
  73534. c.urlParams_.Set("alt", alt)
  73535. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/diskTypes/{diskType}")
  73536. urls += "?" + c.urlParams_.Encode()
  73537. req, _ := http.NewRequest("GET", urls, body)
  73538. req.Header = reqHeaders
  73539. googleapi.Expand(req.URL, map[string]string{
  73540. "project": c.project,
  73541. "region": c.region,
  73542. "diskType": c.diskType,
  73543. })
  73544. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  73545. }
  73546. // Do executes the "compute.regionDiskTypes.get" call.
  73547. // Exactly one of *DiskType or error will be non-nil. Any non-2xx status
  73548. // code is an error. Response headers are in either
  73549. // *DiskType.ServerResponse.Header or (if a response was returned at
  73550. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  73551. // to check whether the returned error was because
  73552. // http.StatusNotModified was returned.
  73553. func (c *RegionDiskTypesGetCall) Do(opts ...googleapi.CallOption) (*DiskType, error) {
  73554. gensupport.SetOptions(c.urlParams_, opts...)
  73555. res, err := c.doRequest("json")
  73556. if res != nil && res.StatusCode == http.StatusNotModified {
  73557. if res.Body != nil {
  73558. res.Body.Close()
  73559. }
  73560. return nil, &googleapi.Error{
  73561. Code: res.StatusCode,
  73562. Header: res.Header,
  73563. }
  73564. }
  73565. if err != nil {
  73566. return nil, err
  73567. }
  73568. defer googleapi.CloseBody(res)
  73569. if err := googleapi.CheckResponse(res); err != nil {
  73570. return nil, err
  73571. }
  73572. ret := &DiskType{
  73573. ServerResponse: googleapi.ServerResponse{
  73574. Header: res.Header,
  73575. HTTPStatusCode: res.StatusCode,
  73576. },
  73577. }
  73578. target := &ret
  73579. if err := gensupport.DecodeResponse(target, res); err != nil {
  73580. return nil, err
  73581. }
  73582. return ret, nil
  73583. // {
  73584. // "description": "Returns the specified regional disk type. Gets a list of available disk types by making a list() request.",
  73585. // "httpMethod": "GET",
  73586. // "id": "compute.regionDiskTypes.get",
  73587. // "parameterOrder": [
  73588. // "project",
  73589. // "region",
  73590. // "diskType"
  73591. // ],
  73592. // "parameters": {
  73593. // "diskType": {
  73594. // "description": "Name of the disk type to return.",
  73595. // "location": "path",
  73596. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  73597. // "required": true,
  73598. // "type": "string"
  73599. // },
  73600. // "project": {
  73601. // "description": "Project ID for this request.",
  73602. // "location": "path",
  73603. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  73604. // "required": true,
  73605. // "type": "string"
  73606. // },
  73607. // "region": {
  73608. // "description": "The name of the region for this request.",
  73609. // "location": "path",
  73610. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  73611. // "required": true,
  73612. // "type": "string"
  73613. // }
  73614. // },
  73615. // "path": "{project}/regions/{region}/diskTypes/{diskType}",
  73616. // "response": {
  73617. // "$ref": "DiskType"
  73618. // },
  73619. // "scopes": [
  73620. // "https://www.googleapis.com/auth/cloud-platform",
  73621. // "https://www.googleapis.com/auth/compute",
  73622. // "https://www.googleapis.com/auth/compute.readonly"
  73623. // ]
  73624. // }
  73625. }
  73626. // method id "compute.regionDiskTypes.list":
  73627. type RegionDiskTypesListCall struct {
  73628. s *Service
  73629. project string
  73630. region string
  73631. urlParams_ gensupport.URLParams
  73632. ifNoneMatch_ string
  73633. ctx_ context.Context
  73634. header_ http.Header
  73635. }
  73636. // List: Retrieves a list of regional disk types available to the
  73637. // specified project.
  73638. func (r *RegionDiskTypesService) List(project string, region string) *RegionDiskTypesListCall {
  73639. c := &RegionDiskTypesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  73640. c.project = project
  73641. c.region = region
  73642. return c
  73643. }
  73644. // Filter sets the optional parameter "filter": A filter expression that
  73645. // filters resources listed in the response. The expression must specify
  73646. // the field name, a comparison operator, and the value that you want to
  73647. // use for filtering. The value must be a string, a number, or a
  73648. // boolean. The comparison operator must be either =, !=, >, or <.
  73649. //
  73650. // For example, if you are filtering Compute Engine instances, you can
  73651. // exclude instances named example-instance by specifying name !=
  73652. // example-instance.
  73653. //
  73654. // You can also filter nested fields. For example, you could specify
  73655. // scheduling.automaticRestart = false to include instances only if they
  73656. // are not scheduled for automatic restarts. You can use filtering on
  73657. // nested fields to filter based on resource labels.
  73658. //
  73659. // To filter on multiple expressions, provide each separate expression
  73660. // within parentheses. For example, (scheduling.automaticRestart = true)
  73661. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  73662. // AND expression. However, you can include AND and OR expressions
  73663. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  73664. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  73665. // true).
  73666. func (c *RegionDiskTypesListCall) Filter(filter string) *RegionDiskTypesListCall {
  73667. c.urlParams_.Set("filter", filter)
  73668. return c
  73669. }
  73670. // MaxResults sets the optional parameter "maxResults": The maximum
  73671. // number of results per page that should be returned. If the number of
  73672. // available results is larger than maxResults, Compute Engine returns a
  73673. // nextPageToken that can be used to get the next page of results in
  73674. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  73675. // (Default: 500)
  73676. func (c *RegionDiskTypesListCall) MaxResults(maxResults int64) *RegionDiskTypesListCall {
  73677. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  73678. return c
  73679. }
  73680. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  73681. // a certain order. By default, results are returned in alphanumerical
  73682. // order based on the resource name.
  73683. //
  73684. // You can also sort results in descending order based on the creation
  73685. // timestamp using orderBy="creationTimestamp desc". This sorts results
  73686. // based on the creationTimestamp field in reverse chronological order
  73687. // (newest result first). Use this to sort resources like operations so
  73688. // that the newest operation is returned first.
  73689. //
  73690. // Currently, only sorting by name or creationTimestamp desc is
  73691. // supported.
  73692. func (c *RegionDiskTypesListCall) OrderBy(orderBy string) *RegionDiskTypesListCall {
  73693. c.urlParams_.Set("orderBy", orderBy)
  73694. return c
  73695. }
  73696. // PageToken sets the optional parameter "pageToken": Specifies a page
  73697. // token to use. Set pageToken to the nextPageToken returned by a
  73698. // previous list request to get the next page of results.
  73699. func (c *RegionDiskTypesListCall) PageToken(pageToken string) *RegionDiskTypesListCall {
  73700. c.urlParams_.Set("pageToken", pageToken)
  73701. return c
  73702. }
  73703. // Fields allows partial responses to be retrieved. See
  73704. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  73705. // for more information.
  73706. func (c *RegionDiskTypesListCall) Fields(s ...googleapi.Field) *RegionDiskTypesListCall {
  73707. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  73708. return c
  73709. }
  73710. // IfNoneMatch sets the optional parameter which makes the operation
  73711. // fail if the object's ETag matches the given value. This is useful for
  73712. // getting updates only after the object has changed since the last
  73713. // request. Use googleapi.IsNotModified to check whether the response
  73714. // error from Do is the result of In-None-Match.
  73715. func (c *RegionDiskTypesListCall) IfNoneMatch(entityTag string) *RegionDiskTypesListCall {
  73716. c.ifNoneMatch_ = entityTag
  73717. return c
  73718. }
  73719. // Context sets the context to be used in this call's Do method. Any
  73720. // pending HTTP request will be aborted if the provided context is
  73721. // canceled.
  73722. func (c *RegionDiskTypesListCall) Context(ctx context.Context) *RegionDiskTypesListCall {
  73723. c.ctx_ = ctx
  73724. return c
  73725. }
  73726. // Header returns an http.Header that can be modified by the caller to
  73727. // add HTTP headers to the request.
  73728. func (c *RegionDiskTypesListCall) Header() http.Header {
  73729. if c.header_ == nil {
  73730. c.header_ = make(http.Header)
  73731. }
  73732. return c.header_
  73733. }
  73734. func (c *RegionDiskTypesListCall) doRequest(alt string) (*http.Response, error) {
  73735. reqHeaders := make(http.Header)
  73736. for k, v := range c.header_ {
  73737. reqHeaders[k] = v
  73738. }
  73739. reqHeaders.Set("User-Agent", c.s.userAgent())
  73740. if c.ifNoneMatch_ != "" {
  73741. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  73742. }
  73743. var body io.Reader = nil
  73744. c.urlParams_.Set("alt", alt)
  73745. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/diskTypes")
  73746. urls += "?" + c.urlParams_.Encode()
  73747. req, _ := http.NewRequest("GET", urls, body)
  73748. req.Header = reqHeaders
  73749. googleapi.Expand(req.URL, map[string]string{
  73750. "project": c.project,
  73751. "region": c.region,
  73752. })
  73753. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  73754. }
  73755. // Do executes the "compute.regionDiskTypes.list" call.
  73756. // Exactly one of *RegionDiskTypeList or error will be non-nil. Any
  73757. // non-2xx status code is an error. Response headers are in either
  73758. // *RegionDiskTypeList.ServerResponse.Header or (if a response was
  73759. // returned at all) in error.(*googleapi.Error).Header. Use
  73760. // googleapi.IsNotModified to check whether the returned error was
  73761. // because http.StatusNotModified was returned.
  73762. func (c *RegionDiskTypesListCall) Do(opts ...googleapi.CallOption) (*RegionDiskTypeList, error) {
  73763. gensupport.SetOptions(c.urlParams_, opts...)
  73764. res, err := c.doRequest("json")
  73765. if res != nil && res.StatusCode == http.StatusNotModified {
  73766. if res.Body != nil {
  73767. res.Body.Close()
  73768. }
  73769. return nil, &googleapi.Error{
  73770. Code: res.StatusCode,
  73771. Header: res.Header,
  73772. }
  73773. }
  73774. if err != nil {
  73775. return nil, err
  73776. }
  73777. defer googleapi.CloseBody(res)
  73778. if err := googleapi.CheckResponse(res); err != nil {
  73779. return nil, err
  73780. }
  73781. ret := &RegionDiskTypeList{
  73782. ServerResponse: googleapi.ServerResponse{
  73783. Header: res.Header,
  73784. HTTPStatusCode: res.StatusCode,
  73785. },
  73786. }
  73787. target := &ret
  73788. if err := gensupport.DecodeResponse(target, res); err != nil {
  73789. return nil, err
  73790. }
  73791. return ret, nil
  73792. // {
  73793. // "description": "Retrieves a list of regional disk types available to the specified project.",
  73794. // "httpMethod": "GET",
  73795. // "id": "compute.regionDiskTypes.list",
  73796. // "parameterOrder": [
  73797. // "project",
  73798. // "region"
  73799. // ],
  73800. // "parameters": {
  73801. // "filter": {
  73802. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  73803. // "location": "query",
  73804. // "type": "string"
  73805. // },
  73806. // "maxResults": {
  73807. // "default": "500",
  73808. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  73809. // "format": "uint32",
  73810. // "location": "query",
  73811. // "minimum": "0",
  73812. // "type": "integer"
  73813. // },
  73814. // "orderBy": {
  73815. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  73816. // "location": "query",
  73817. // "type": "string"
  73818. // },
  73819. // "pageToken": {
  73820. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  73821. // "location": "query",
  73822. // "type": "string"
  73823. // },
  73824. // "project": {
  73825. // "description": "Project ID for this request.",
  73826. // "location": "path",
  73827. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  73828. // "required": true,
  73829. // "type": "string"
  73830. // },
  73831. // "region": {
  73832. // "description": "The name of the region for this request.",
  73833. // "location": "path",
  73834. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  73835. // "required": true,
  73836. // "type": "string"
  73837. // }
  73838. // },
  73839. // "path": "{project}/regions/{region}/diskTypes",
  73840. // "response": {
  73841. // "$ref": "RegionDiskTypeList"
  73842. // },
  73843. // "scopes": [
  73844. // "https://www.googleapis.com/auth/cloud-platform",
  73845. // "https://www.googleapis.com/auth/compute",
  73846. // "https://www.googleapis.com/auth/compute.readonly"
  73847. // ]
  73848. // }
  73849. }
  73850. // Pages invokes f for each page of results.
  73851. // A non-nil error returned from f will halt the iteration.
  73852. // The provided context supersedes any context provided to the Context method.
  73853. func (c *RegionDiskTypesListCall) Pages(ctx context.Context, f func(*RegionDiskTypeList) error) error {
  73854. c.ctx_ = ctx
  73855. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  73856. for {
  73857. x, err := c.Do()
  73858. if err != nil {
  73859. return err
  73860. }
  73861. if err := f(x); err != nil {
  73862. return err
  73863. }
  73864. if x.NextPageToken == "" {
  73865. return nil
  73866. }
  73867. c.PageToken(x.NextPageToken)
  73868. }
  73869. }
  73870. // method id "compute.regionDisks.createSnapshot":
  73871. type RegionDisksCreateSnapshotCall struct {
  73872. s *Service
  73873. project string
  73874. region string
  73875. disk string
  73876. snapshot *Snapshot
  73877. urlParams_ gensupport.URLParams
  73878. ctx_ context.Context
  73879. header_ http.Header
  73880. }
  73881. // CreateSnapshot: Creates a snapshot of this regional disk.
  73882. func (r *RegionDisksService) CreateSnapshot(project string, region string, disk string, snapshot *Snapshot) *RegionDisksCreateSnapshotCall {
  73883. c := &RegionDisksCreateSnapshotCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  73884. c.project = project
  73885. c.region = region
  73886. c.disk = disk
  73887. c.snapshot = snapshot
  73888. return c
  73889. }
  73890. // RequestId sets the optional parameter "requestId": An optional
  73891. // request ID to identify requests. Specify a unique request ID so that
  73892. // if you must retry your request, the server will know to ignore the
  73893. // request if it has already been completed.
  73894. //
  73895. // For example, consider a situation where you make an initial request
  73896. // and the request times out. If you make the request again with the
  73897. // same request ID, the server can check if original operation with the
  73898. // same request ID was received, and if so, will ignore the second
  73899. // request. This prevents clients from accidentally creating duplicate
  73900. // commitments.
  73901. //
  73902. // The request ID must be a valid UUID with the exception that zero UUID
  73903. // is not supported (00000000-0000-0000-0000-000000000000).
  73904. func (c *RegionDisksCreateSnapshotCall) RequestId(requestId string) *RegionDisksCreateSnapshotCall {
  73905. c.urlParams_.Set("requestId", requestId)
  73906. return c
  73907. }
  73908. // Fields allows partial responses to be retrieved. See
  73909. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  73910. // for more information.
  73911. func (c *RegionDisksCreateSnapshotCall) Fields(s ...googleapi.Field) *RegionDisksCreateSnapshotCall {
  73912. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  73913. return c
  73914. }
  73915. // Context sets the context to be used in this call's Do method. Any
  73916. // pending HTTP request will be aborted if the provided context is
  73917. // canceled.
  73918. func (c *RegionDisksCreateSnapshotCall) Context(ctx context.Context) *RegionDisksCreateSnapshotCall {
  73919. c.ctx_ = ctx
  73920. return c
  73921. }
  73922. // Header returns an http.Header that can be modified by the caller to
  73923. // add HTTP headers to the request.
  73924. func (c *RegionDisksCreateSnapshotCall) Header() http.Header {
  73925. if c.header_ == nil {
  73926. c.header_ = make(http.Header)
  73927. }
  73928. return c.header_
  73929. }
  73930. func (c *RegionDisksCreateSnapshotCall) doRequest(alt string) (*http.Response, error) {
  73931. reqHeaders := make(http.Header)
  73932. for k, v := range c.header_ {
  73933. reqHeaders[k] = v
  73934. }
  73935. reqHeaders.Set("User-Agent", c.s.userAgent())
  73936. var body io.Reader = nil
  73937. body, err := googleapi.WithoutDataWrapper.JSONReader(c.snapshot)
  73938. if err != nil {
  73939. return nil, err
  73940. }
  73941. reqHeaders.Set("Content-Type", "application/json")
  73942. c.urlParams_.Set("alt", alt)
  73943. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/disks/{disk}/createSnapshot")
  73944. urls += "?" + c.urlParams_.Encode()
  73945. req, _ := http.NewRequest("POST", urls, body)
  73946. req.Header = reqHeaders
  73947. googleapi.Expand(req.URL, map[string]string{
  73948. "project": c.project,
  73949. "region": c.region,
  73950. "disk": c.disk,
  73951. })
  73952. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  73953. }
  73954. // Do executes the "compute.regionDisks.createSnapshot" call.
  73955. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  73956. // status code is an error. Response headers are in either
  73957. // *Operation.ServerResponse.Header or (if a response was returned at
  73958. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  73959. // to check whether the returned error was because
  73960. // http.StatusNotModified was returned.
  73961. func (c *RegionDisksCreateSnapshotCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  73962. gensupport.SetOptions(c.urlParams_, opts...)
  73963. res, err := c.doRequest("json")
  73964. if res != nil && res.StatusCode == http.StatusNotModified {
  73965. if res.Body != nil {
  73966. res.Body.Close()
  73967. }
  73968. return nil, &googleapi.Error{
  73969. Code: res.StatusCode,
  73970. Header: res.Header,
  73971. }
  73972. }
  73973. if err != nil {
  73974. return nil, err
  73975. }
  73976. defer googleapi.CloseBody(res)
  73977. if err := googleapi.CheckResponse(res); err != nil {
  73978. return nil, err
  73979. }
  73980. ret := &Operation{
  73981. ServerResponse: googleapi.ServerResponse{
  73982. Header: res.Header,
  73983. HTTPStatusCode: res.StatusCode,
  73984. },
  73985. }
  73986. target := &ret
  73987. if err := gensupport.DecodeResponse(target, res); err != nil {
  73988. return nil, err
  73989. }
  73990. return ret, nil
  73991. // {
  73992. // "description": "Creates a snapshot of this regional disk.",
  73993. // "httpMethod": "POST",
  73994. // "id": "compute.regionDisks.createSnapshot",
  73995. // "parameterOrder": [
  73996. // "project",
  73997. // "region",
  73998. // "disk"
  73999. // ],
  74000. // "parameters": {
  74001. // "disk": {
  74002. // "description": "Name of the regional persistent disk to snapshot.",
  74003. // "location": "path",
  74004. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  74005. // "required": true,
  74006. // "type": "string"
  74007. // },
  74008. // "project": {
  74009. // "description": "Project ID for this request.",
  74010. // "location": "path",
  74011. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  74012. // "required": true,
  74013. // "type": "string"
  74014. // },
  74015. // "region": {
  74016. // "description": "Name of the region for this request.",
  74017. // "location": "path",
  74018. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  74019. // "required": true,
  74020. // "type": "string"
  74021. // },
  74022. // "requestId": {
  74023. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  74024. // "location": "query",
  74025. // "type": "string"
  74026. // }
  74027. // },
  74028. // "path": "{project}/regions/{region}/disks/{disk}/createSnapshot",
  74029. // "request": {
  74030. // "$ref": "Snapshot"
  74031. // },
  74032. // "response": {
  74033. // "$ref": "Operation"
  74034. // },
  74035. // "scopes": [
  74036. // "https://www.googleapis.com/auth/cloud-platform",
  74037. // "https://www.googleapis.com/auth/compute"
  74038. // ]
  74039. // }
  74040. }
  74041. // method id "compute.regionDisks.delete":
  74042. type RegionDisksDeleteCall struct {
  74043. s *Service
  74044. project string
  74045. region string
  74046. disk string
  74047. urlParams_ gensupport.URLParams
  74048. ctx_ context.Context
  74049. header_ http.Header
  74050. }
  74051. // Delete: Deletes the specified regional persistent disk. Deleting a
  74052. // regional disk removes all the replicas of its data permanently and is
  74053. // irreversible. However, deleting a disk does not delete any snapshots
  74054. // previously made from the disk. You must separately delete snapshots.
  74055. func (r *RegionDisksService) Delete(project string, region string, disk string) *RegionDisksDeleteCall {
  74056. c := &RegionDisksDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  74057. c.project = project
  74058. c.region = region
  74059. c.disk = disk
  74060. return c
  74061. }
  74062. // RequestId sets the optional parameter "requestId": An optional
  74063. // request ID to identify requests. Specify a unique request ID so that
  74064. // if you must retry your request, the server will know to ignore the
  74065. // request if it has already been completed.
  74066. //
  74067. // For example, consider a situation where you make an initial request
  74068. // and the request times out. If you make the request again with the
  74069. // same request ID, the server can check if original operation with the
  74070. // same request ID was received, and if so, will ignore the second
  74071. // request. This prevents clients from accidentally creating duplicate
  74072. // commitments.
  74073. //
  74074. // The request ID must be a valid UUID with the exception that zero UUID
  74075. // is not supported (00000000-0000-0000-0000-000000000000).
  74076. func (c *RegionDisksDeleteCall) RequestId(requestId string) *RegionDisksDeleteCall {
  74077. c.urlParams_.Set("requestId", requestId)
  74078. return c
  74079. }
  74080. // Fields allows partial responses to be retrieved. See
  74081. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  74082. // for more information.
  74083. func (c *RegionDisksDeleteCall) Fields(s ...googleapi.Field) *RegionDisksDeleteCall {
  74084. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  74085. return c
  74086. }
  74087. // Context sets the context to be used in this call's Do method. Any
  74088. // pending HTTP request will be aborted if the provided context is
  74089. // canceled.
  74090. func (c *RegionDisksDeleteCall) Context(ctx context.Context) *RegionDisksDeleteCall {
  74091. c.ctx_ = ctx
  74092. return c
  74093. }
  74094. // Header returns an http.Header that can be modified by the caller to
  74095. // add HTTP headers to the request.
  74096. func (c *RegionDisksDeleteCall) Header() http.Header {
  74097. if c.header_ == nil {
  74098. c.header_ = make(http.Header)
  74099. }
  74100. return c.header_
  74101. }
  74102. func (c *RegionDisksDeleteCall) doRequest(alt string) (*http.Response, error) {
  74103. reqHeaders := make(http.Header)
  74104. for k, v := range c.header_ {
  74105. reqHeaders[k] = v
  74106. }
  74107. reqHeaders.Set("User-Agent", c.s.userAgent())
  74108. var body io.Reader = nil
  74109. c.urlParams_.Set("alt", alt)
  74110. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/disks/{disk}")
  74111. urls += "?" + c.urlParams_.Encode()
  74112. req, _ := http.NewRequest("DELETE", urls, body)
  74113. req.Header = reqHeaders
  74114. googleapi.Expand(req.URL, map[string]string{
  74115. "project": c.project,
  74116. "region": c.region,
  74117. "disk": c.disk,
  74118. })
  74119. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  74120. }
  74121. // Do executes the "compute.regionDisks.delete" call.
  74122. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  74123. // status code is an error. Response headers are in either
  74124. // *Operation.ServerResponse.Header or (if a response was returned at
  74125. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  74126. // to check whether the returned error was because
  74127. // http.StatusNotModified was returned.
  74128. func (c *RegionDisksDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  74129. gensupport.SetOptions(c.urlParams_, opts...)
  74130. res, err := c.doRequest("json")
  74131. if res != nil && res.StatusCode == http.StatusNotModified {
  74132. if res.Body != nil {
  74133. res.Body.Close()
  74134. }
  74135. return nil, &googleapi.Error{
  74136. Code: res.StatusCode,
  74137. Header: res.Header,
  74138. }
  74139. }
  74140. if err != nil {
  74141. return nil, err
  74142. }
  74143. defer googleapi.CloseBody(res)
  74144. if err := googleapi.CheckResponse(res); err != nil {
  74145. return nil, err
  74146. }
  74147. ret := &Operation{
  74148. ServerResponse: googleapi.ServerResponse{
  74149. Header: res.Header,
  74150. HTTPStatusCode: res.StatusCode,
  74151. },
  74152. }
  74153. target := &ret
  74154. if err := gensupport.DecodeResponse(target, res); err != nil {
  74155. return nil, err
  74156. }
  74157. return ret, nil
  74158. // {
  74159. // "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.",
  74160. // "httpMethod": "DELETE",
  74161. // "id": "compute.regionDisks.delete",
  74162. // "parameterOrder": [
  74163. // "project",
  74164. // "region",
  74165. // "disk"
  74166. // ],
  74167. // "parameters": {
  74168. // "disk": {
  74169. // "description": "Name of the regional persistent disk to delete.",
  74170. // "location": "path",
  74171. // "required": true,
  74172. // "type": "string"
  74173. // },
  74174. // "project": {
  74175. // "description": "Project ID for this request.",
  74176. // "location": "path",
  74177. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  74178. // "required": true,
  74179. // "type": "string"
  74180. // },
  74181. // "region": {
  74182. // "description": "Name of the region for this request.",
  74183. // "location": "path",
  74184. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  74185. // "required": true,
  74186. // "type": "string"
  74187. // },
  74188. // "requestId": {
  74189. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  74190. // "location": "query",
  74191. // "type": "string"
  74192. // }
  74193. // },
  74194. // "path": "{project}/regions/{region}/disks/{disk}",
  74195. // "response": {
  74196. // "$ref": "Operation"
  74197. // },
  74198. // "scopes": [
  74199. // "https://www.googleapis.com/auth/cloud-platform",
  74200. // "https://www.googleapis.com/auth/compute"
  74201. // ]
  74202. // }
  74203. }
  74204. // method id "compute.regionDisks.get":
  74205. type RegionDisksGetCall struct {
  74206. s *Service
  74207. project string
  74208. region string
  74209. disk string
  74210. urlParams_ gensupport.URLParams
  74211. ifNoneMatch_ string
  74212. ctx_ context.Context
  74213. header_ http.Header
  74214. }
  74215. // Get: Returns a specified regional persistent disk.
  74216. func (r *RegionDisksService) Get(project string, region string, disk string) *RegionDisksGetCall {
  74217. c := &RegionDisksGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  74218. c.project = project
  74219. c.region = region
  74220. c.disk = disk
  74221. return c
  74222. }
  74223. // Fields allows partial responses to be retrieved. See
  74224. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  74225. // for more information.
  74226. func (c *RegionDisksGetCall) Fields(s ...googleapi.Field) *RegionDisksGetCall {
  74227. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  74228. return c
  74229. }
  74230. // IfNoneMatch sets the optional parameter which makes the operation
  74231. // fail if the object's ETag matches the given value. This is useful for
  74232. // getting updates only after the object has changed since the last
  74233. // request. Use googleapi.IsNotModified to check whether the response
  74234. // error from Do is the result of In-None-Match.
  74235. func (c *RegionDisksGetCall) IfNoneMatch(entityTag string) *RegionDisksGetCall {
  74236. c.ifNoneMatch_ = entityTag
  74237. return c
  74238. }
  74239. // Context sets the context to be used in this call's Do method. Any
  74240. // pending HTTP request will be aborted if the provided context is
  74241. // canceled.
  74242. func (c *RegionDisksGetCall) Context(ctx context.Context) *RegionDisksGetCall {
  74243. c.ctx_ = ctx
  74244. return c
  74245. }
  74246. // Header returns an http.Header that can be modified by the caller to
  74247. // add HTTP headers to the request.
  74248. func (c *RegionDisksGetCall) Header() http.Header {
  74249. if c.header_ == nil {
  74250. c.header_ = make(http.Header)
  74251. }
  74252. return c.header_
  74253. }
  74254. func (c *RegionDisksGetCall) doRequest(alt string) (*http.Response, error) {
  74255. reqHeaders := make(http.Header)
  74256. for k, v := range c.header_ {
  74257. reqHeaders[k] = v
  74258. }
  74259. reqHeaders.Set("User-Agent", c.s.userAgent())
  74260. if c.ifNoneMatch_ != "" {
  74261. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  74262. }
  74263. var body io.Reader = nil
  74264. c.urlParams_.Set("alt", alt)
  74265. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/disks/{disk}")
  74266. urls += "?" + c.urlParams_.Encode()
  74267. req, _ := http.NewRequest("GET", urls, body)
  74268. req.Header = reqHeaders
  74269. googleapi.Expand(req.URL, map[string]string{
  74270. "project": c.project,
  74271. "region": c.region,
  74272. "disk": c.disk,
  74273. })
  74274. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  74275. }
  74276. // Do executes the "compute.regionDisks.get" call.
  74277. // Exactly one of *Disk or error will be non-nil. Any non-2xx status
  74278. // code is an error. Response headers are in either
  74279. // *Disk.ServerResponse.Header or (if a response was returned at all) in
  74280. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  74281. // whether the returned error was because http.StatusNotModified was
  74282. // returned.
  74283. func (c *RegionDisksGetCall) Do(opts ...googleapi.CallOption) (*Disk, error) {
  74284. gensupport.SetOptions(c.urlParams_, opts...)
  74285. res, err := c.doRequest("json")
  74286. if res != nil && res.StatusCode == http.StatusNotModified {
  74287. if res.Body != nil {
  74288. res.Body.Close()
  74289. }
  74290. return nil, &googleapi.Error{
  74291. Code: res.StatusCode,
  74292. Header: res.Header,
  74293. }
  74294. }
  74295. if err != nil {
  74296. return nil, err
  74297. }
  74298. defer googleapi.CloseBody(res)
  74299. if err := googleapi.CheckResponse(res); err != nil {
  74300. return nil, err
  74301. }
  74302. ret := &Disk{
  74303. ServerResponse: googleapi.ServerResponse{
  74304. Header: res.Header,
  74305. HTTPStatusCode: res.StatusCode,
  74306. },
  74307. }
  74308. target := &ret
  74309. if err := gensupport.DecodeResponse(target, res); err != nil {
  74310. return nil, err
  74311. }
  74312. return ret, nil
  74313. // {
  74314. // "description": "Returns a specified regional persistent disk.",
  74315. // "httpMethod": "GET",
  74316. // "id": "compute.regionDisks.get",
  74317. // "parameterOrder": [
  74318. // "project",
  74319. // "region",
  74320. // "disk"
  74321. // ],
  74322. // "parameters": {
  74323. // "disk": {
  74324. // "description": "Name of the regional persistent disk to return.",
  74325. // "location": "path",
  74326. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  74327. // "required": true,
  74328. // "type": "string"
  74329. // },
  74330. // "project": {
  74331. // "description": "Project ID for this request.",
  74332. // "location": "path",
  74333. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  74334. // "required": true,
  74335. // "type": "string"
  74336. // },
  74337. // "region": {
  74338. // "description": "Name of the region for this request.",
  74339. // "location": "path",
  74340. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  74341. // "required": true,
  74342. // "type": "string"
  74343. // }
  74344. // },
  74345. // "path": "{project}/regions/{region}/disks/{disk}",
  74346. // "response": {
  74347. // "$ref": "Disk"
  74348. // },
  74349. // "scopes": [
  74350. // "https://www.googleapis.com/auth/cloud-platform",
  74351. // "https://www.googleapis.com/auth/compute",
  74352. // "https://www.googleapis.com/auth/compute.readonly"
  74353. // ]
  74354. // }
  74355. }
  74356. // method id "compute.regionDisks.insert":
  74357. type RegionDisksInsertCall struct {
  74358. s *Service
  74359. project string
  74360. region string
  74361. disk *Disk
  74362. urlParams_ gensupport.URLParams
  74363. ctx_ context.Context
  74364. header_ http.Header
  74365. }
  74366. // Insert: Creates a persistent regional disk in the specified project
  74367. // using the data included in the request.
  74368. func (r *RegionDisksService) Insert(project string, region string, disk *Disk) *RegionDisksInsertCall {
  74369. c := &RegionDisksInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  74370. c.project = project
  74371. c.region = region
  74372. c.disk = disk
  74373. return c
  74374. }
  74375. // RequestId sets the optional parameter "requestId": An optional
  74376. // request ID to identify requests. Specify a unique request ID so that
  74377. // if you must retry your request, the server will know to ignore the
  74378. // request if it has already been completed.
  74379. //
  74380. // For example, consider a situation where you make an initial request
  74381. // and the request times out. If you make the request again with the
  74382. // same request ID, the server can check if original operation with the
  74383. // same request ID was received, and if so, will ignore the second
  74384. // request. This prevents clients from accidentally creating duplicate
  74385. // commitments.
  74386. //
  74387. // The request ID must be a valid UUID with the exception that zero UUID
  74388. // is not supported (00000000-0000-0000-0000-000000000000).
  74389. func (c *RegionDisksInsertCall) RequestId(requestId string) *RegionDisksInsertCall {
  74390. c.urlParams_.Set("requestId", requestId)
  74391. return c
  74392. }
  74393. // SourceImage sets the optional parameter "sourceImage": Source image
  74394. // to restore onto a disk.
  74395. func (c *RegionDisksInsertCall) SourceImage(sourceImage string) *RegionDisksInsertCall {
  74396. c.urlParams_.Set("sourceImage", sourceImage)
  74397. return c
  74398. }
  74399. // Fields allows partial responses to be retrieved. See
  74400. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  74401. // for more information.
  74402. func (c *RegionDisksInsertCall) Fields(s ...googleapi.Field) *RegionDisksInsertCall {
  74403. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  74404. return c
  74405. }
  74406. // Context sets the context to be used in this call's Do method. Any
  74407. // pending HTTP request will be aborted if the provided context is
  74408. // canceled.
  74409. func (c *RegionDisksInsertCall) Context(ctx context.Context) *RegionDisksInsertCall {
  74410. c.ctx_ = ctx
  74411. return c
  74412. }
  74413. // Header returns an http.Header that can be modified by the caller to
  74414. // add HTTP headers to the request.
  74415. func (c *RegionDisksInsertCall) Header() http.Header {
  74416. if c.header_ == nil {
  74417. c.header_ = make(http.Header)
  74418. }
  74419. return c.header_
  74420. }
  74421. func (c *RegionDisksInsertCall) doRequest(alt string) (*http.Response, error) {
  74422. reqHeaders := make(http.Header)
  74423. for k, v := range c.header_ {
  74424. reqHeaders[k] = v
  74425. }
  74426. reqHeaders.Set("User-Agent", c.s.userAgent())
  74427. var body io.Reader = nil
  74428. body, err := googleapi.WithoutDataWrapper.JSONReader(c.disk)
  74429. if err != nil {
  74430. return nil, err
  74431. }
  74432. reqHeaders.Set("Content-Type", "application/json")
  74433. c.urlParams_.Set("alt", alt)
  74434. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/disks")
  74435. urls += "?" + c.urlParams_.Encode()
  74436. req, _ := http.NewRequest("POST", urls, body)
  74437. req.Header = reqHeaders
  74438. googleapi.Expand(req.URL, map[string]string{
  74439. "project": c.project,
  74440. "region": c.region,
  74441. })
  74442. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  74443. }
  74444. // Do executes the "compute.regionDisks.insert" call.
  74445. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  74446. // status code is an error. Response headers are in either
  74447. // *Operation.ServerResponse.Header or (if a response was returned at
  74448. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  74449. // to check whether the returned error was because
  74450. // http.StatusNotModified was returned.
  74451. func (c *RegionDisksInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  74452. gensupport.SetOptions(c.urlParams_, opts...)
  74453. res, err := c.doRequest("json")
  74454. if res != nil && res.StatusCode == http.StatusNotModified {
  74455. if res.Body != nil {
  74456. res.Body.Close()
  74457. }
  74458. return nil, &googleapi.Error{
  74459. Code: res.StatusCode,
  74460. Header: res.Header,
  74461. }
  74462. }
  74463. if err != nil {
  74464. return nil, err
  74465. }
  74466. defer googleapi.CloseBody(res)
  74467. if err := googleapi.CheckResponse(res); err != nil {
  74468. return nil, err
  74469. }
  74470. ret := &Operation{
  74471. ServerResponse: googleapi.ServerResponse{
  74472. Header: res.Header,
  74473. HTTPStatusCode: res.StatusCode,
  74474. },
  74475. }
  74476. target := &ret
  74477. if err := gensupport.DecodeResponse(target, res); err != nil {
  74478. return nil, err
  74479. }
  74480. return ret, nil
  74481. // {
  74482. // "description": "Creates a persistent regional disk in the specified project using the data included in the request.",
  74483. // "httpMethod": "POST",
  74484. // "id": "compute.regionDisks.insert",
  74485. // "parameterOrder": [
  74486. // "project",
  74487. // "region"
  74488. // ],
  74489. // "parameters": {
  74490. // "project": {
  74491. // "description": "Project ID for this request.",
  74492. // "location": "path",
  74493. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  74494. // "required": true,
  74495. // "type": "string"
  74496. // },
  74497. // "region": {
  74498. // "description": "Name of the region for this request.",
  74499. // "location": "path",
  74500. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  74501. // "required": true,
  74502. // "type": "string"
  74503. // },
  74504. // "requestId": {
  74505. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  74506. // "location": "query",
  74507. // "type": "string"
  74508. // },
  74509. // "sourceImage": {
  74510. // "description": "Optional. Source image to restore onto a disk.",
  74511. // "location": "query",
  74512. // "type": "string"
  74513. // }
  74514. // },
  74515. // "path": "{project}/regions/{region}/disks",
  74516. // "request": {
  74517. // "$ref": "Disk"
  74518. // },
  74519. // "response": {
  74520. // "$ref": "Operation"
  74521. // },
  74522. // "scopes": [
  74523. // "https://www.googleapis.com/auth/cloud-platform",
  74524. // "https://www.googleapis.com/auth/compute"
  74525. // ]
  74526. // }
  74527. }
  74528. // method id "compute.regionDisks.list":
  74529. type RegionDisksListCall struct {
  74530. s *Service
  74531. project string
  74532. region string
  74533. urlParams_ gensupport.URLParams
  74534. ifNoneMatch_ string
  74535. ctx_ context.Context
  74536. header_ http.Header
  74537. }
  74538. // List: Retrieves the list of persistent disks contained within the
  74539. // specified region.
  74540. func (r *RegionDisksService) List(project string, region string) *RegionDisksListCall {
  74541. c := &RegionDisksListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  74542. c.project = project
  74543. c.region = region
  74544. return c
  74545. }
  74546. // Filter sets the optional parameter "filter": A filter expression that
  74547. // filters resources listed in the response. The expression must specify
  74548. // the field name, a comparison operator, and the value that you want to
  74549. // use for filtering. The value must be a string, a number, or a
  74550. // boolean. The comparison operator must be either =, !=, >, or <.
  74551. //
  74552. // For example, if you are filtering Compute Engine instances, you can
  74553. // exclude instances named example-instance by specifying name !=
  74554. // example-instance.
  74555. //
  74556. // You can also filter nested fields. For example, you could specify
  74557. // scheduling.automaticRestart = false to include instances only if they
  74558. // are not scheduled for automatic restarts. You can use filtering on
  74559. // nested fields to filter based on resource labels.
  74560. //
  74561. // To filter on multiple expressions, provide each separate expression
  74562. // within parentheses. For example, (scheduling.automaticRestart = true)
  74563. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  74564. // AND expression. However, you can include AND and OR expressions
  74565. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  74566. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  74567. // true).
  74568. func (c *RegionDisksListCall) Filter(filter string) *RegionDisksListCall {
  74569. c.urlParams_.Set("filter", filter)
  74570. return c
  74571. }
  74572. // MaxResults sets the optional parameter "maxResults": The maximum
  74573. // number of results per page that should be returned. If the number of
  74574. // available results is larger than maxResults, Compute Engine returns a
  74575. // nextPageToken that can be used to get the next page of results in
  74576. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  74577. // (Default: 500)
  74578. func (c *RegionDisksListCall) MaxResults(maxResults int64) *RegionDisksListCall {
  74579. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  74580. return c
  74581. }
  74582. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  74583. // a certain order. By default, results are returned in alphanumerical
  74584. // order based on the resource name.
  74585. //
  74586. // You can also sort results in descending order based on the creation
  74587. // timestamp using orderBy="creationTimestamp desc". This sorts results
  74588. // based on the creationTimestamp field in reverse chronological order
  74589. // (newest result first). Use this to sort resources like operations so
  74590. // that the newest operation is returned first.
  74591. //
  74592. // Currently, only sorting by name or creationTimestamp desc is
  74593. // supported.
  74594. func (c *RegionDisksListCall) OrderBy(orderBy string) *RegionDisksListCall {
  74595. c.urlParams_.Set("orderBy", orderBy)
  74596. return c
  74597. }
  74598. // PageToken sets the optional parameter "pageToken": Specifies a page
  74599. // token to use. Set pageToken to the nextPageToken returned by a
  74600. // previous list request to get the next page of results.
  74601. func (c *RegionDisksListCall) PageToken(pageToken string) *RegionDisksListCall {
  74602. c.urlParams_.Set("pageToken", pageToken)
  74603. return c
  74604. }
  74605. // Fields allows partial responses to be retrieved. See
  74606. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  74607. // for more information.
  74608. func (c *RegionDisksListCall) Fields(s ...googleapi.Field) *RegionDisksListCall {
  74609. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  74610. return c
  74611. }
  74612. // IfNoneMatch sets the optional parameter which makes the operation
  74613. // fail if the object's ETag matches the given value. This is useful for
  74614. // getting updates only after the object has changed since the last
  74615. // request. Use googleapi.IsNotModified to check whether the response
  74616. // error from Do is the result of In-None-Match.
  74617. func (c *RegionDisksListCall) IfNoneMatch(entityTag string) *RegionDisksListCall {
  74618. c.ifNoneMatch_ = entityTag
  74619. return c
  74620. }
  74621. // Context sets the context to be used in this call's Do method. Any
  74622. // pending HTTP request will be aborted if the provided context is
  74623. // canceled.
  74624. func (c *RegionDisksListCall) Context(ctx context.Context) *RegionDisksListCall {
  74625. c.ctx_ = ctx
  74626. return c
  74627. }
  74628. // Header returns an http.Header that can be modified by the caller to
  74629. // add HTTP headers to the request.
  74630. func (c *RegionDisksListCall) Header() http.Header {
  74631. if c.header_ == nil {
  74632. c.header_ = make(http.Header)
  74633. }
  74634. return c.header_
  74635. }
  74636. func (c *RegionDisksListCall) doRequest(alt string) (*http.Response, error) {
  74637. reqHeaders := make(http.Header)
  74638. for k, v := range c.header_ {
  74639. reqHeaders[k] = v
  74640. }
  74641. reqHeaders.Set("User-Agent", c.s.userAgent())
  74642. if c.ifNoneMatch_ != "" {
  74643. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  74644. }
  74645. var body io.Reader = nil
  74646. c.urlParams_.Set("alt", alt)
  74647. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/disks")
  74648. urls += "?" + c.urlParams_.Encode()
  74649. req, _ := http.NewRequest("GET", urls, body)
  74650. req.Header = reqHeaders
  74651. googleapi.Expand(req.URL, map[string]string{
  74652. "project": c.project,
  74653. "region": c.region,
  74654. })
  74655. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  74656. }
  74657. // Do executes the "compute.regionDisks.list" call.
  74658. // Exactly one of *DiskList or error will be non-nil. Any non-2xx status
  74659. // code is an error. Response headers are in either
  74660. // *DiskList.ServerResponse.Header or (if a response was returned at
  74661. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  74662. // to check whether the returned error was because
  74663. // http.StatusNotModified was returned.
  74664. func (c *RegionDisksListCall) Do(opts ...googleapi.CallOption) (*DiskList, error) {
  74665. gensupport.SetOptions(c.urlParams_, opts...)
  74666. res, err := c.doRequest("json")
  74667. if res != nil && res.StatusCode == http.StatusNotModified {
  74668. if res.Body != nil {
  74669. res.Body.Close()
  74670. }
  74671. return nil, &googleapi.Error{
  74672. Code: res.StatusCode,
  74673. Header: res.Header,
  74674. }
  74675. }
  74676. if err != nil {
  74677. return nil, err
  74678. }
  74679. defer googleapi.CloseBody(res)
  74680. if err := googleapi.CheckResponse(res); err != nil {
  74681. return nil, err
  74682. }
  74683. ret := &DiskList{
  74684. ServerResponse: googleapi.ServerResponse{
  74685. Header: res.Header,
  74686. HTTPStatusCode: res.StatusCode,
  74687. },
  74688. }
  74689. target := &ret
  74690. if err := gensupport.DecodeResponse(target, res); err != nil {
  74691. return nil, err
  74692. }
  74693. return ret, nil
  74694. // {
  74695. // "description": "Retrieves the list of persistent disks contained within the specified region.",
  74696. // "httpMethod": "GET",
  74697. // "id": "compute.regionDisks.list",
  74698. // "parameterOrder": [
  74699. // "project",
  74700. // "region"
  74701. // ],
  74702. // "parameters": {
  74703. // "filter": {
  74704. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  74705. // "location": "query",
  74706. // "type": "string"
  74707. // },
  74708. // "maxResults": {
  74709. // "default": "500",
  74710. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  74711. // "format": "uint32",
  74712. // "location": "query",
  74713. // "minimum": "0",
  74714. // "type": "integer"
  74715. // },
  74716. // "orderBy": {
  74717. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  74718. // "location": "query",
  74719. // "type": "string"
  74720. // },
  74721. // "pageToken": {
  74722. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  74723. // "location": "query",
  74724. // "type": "string"
  74725. // },
  74726. // "project": {
  74727. // "description": "Project ID for this request.",
  74728. // "location": "path",
  74729. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  74730. // "required": true,
  74731. // "type": "string"
  74732. // },
  74733. // "region": {
  74734. // "description": "Name of the region for this request.",
  74735. // "location": "path",
  74736. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  74737. // "required": true,
  74738. // "type": "string"
  74739. // }
  74740. // },
  74741. // "path": "{project}/regions/{region}/disks",
  74742. // "response": {
  74743. // "$ref": "DiskList"
  74744. // },
  74745. // "scopes": [
  74746. // "https://www.googleapis.com/auth/cloud-platform",
  74747. // "https://www.googleapis.com/auth/compute",
  74748. // "https://www.googleapis.com/auth/compute.readonly"
  74749. // ]
  74750. // }
  74751. }
  74752. // Pages invokes f for each page of results.
  74753. // A non-nil error returned from f will halt the iteration.
  74754. // The provided context supersedes any context provided to the Context method.
  74755. func (c *RegionDisksListCall) Pages(ctx context.Context, f func(*DiskList) error) error {
  74756. c.ctx_ = ctx
  74757. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  74758. for {
  74759. x, err := c.Do()
  74760. if err != nil {
  74761. return err
  74762. }
  74763. if err := f(x); err != nil {
  74764. return err
  74765. }
  74766. if x.NextPageToken == "" {
  74767. return nil
  74768. }
  74769. c.PageToken(x.NextPageToken)
  74770. }
  74771. }
  74772. // method id "compute.regionDisks.resize":
  74773. type RegionDisksResizeCall struct {
  74774. s *Service
  74775. project string
  74776. region string
  74777. disk string
  74778. regiondisksresizerequest *RegionDisksResizeRequest
  74779. urlParams_ gensupport.URLParams
  74780. ctx_ context.Context
  74781. header_ http.Header
  74782. }
  74783. // Resize: Resizes the specified regional persistent disk.
  74784. func (r *RegionDisksService) Resize(project string, region string, disk string, regiondisksresizerequest *RegionDisksResizeRequest) *RegionDisksResizeCall {
  74785. c := &RegionDisksResizeCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  74786. c.project = project
  74787. c.region = region
  74788. c.disk = disk
  74789. c.regiondisksresizerequest = regiondisksresizerequest
  74790. return c
  74791. }
  74792. // RequestId sets the optional parameter "requestId": An optional
  74793. // request ID to identify requests. Specify a unique request ID so that
  74794. // if you must retry your request, the server will know to ignore the
  74795. // request if it has already been completed.
  74796. //
  74797. // For example, consider a situation where you make an initial request
  74798. // and the request times out. If you make the request again with the
  74799. // same request ID, the server can check if original operation with the
  74800. // same request ID was received, and if so, will ignore the second
  74801. // request. This prevents clients from accidentally creating duplicate
  74802. // commitments.
  74803. //
  74804. // The request ID must be a valid UUID with the exception that zero UUID
  74805. // is not supported (00000000-0000-0000-0000-000000000000).
  74806. func (c *RegionDisksResizeCall) RequestId(requestId string) *RegionDisksResizeCall {
  74807. c.urlParams_.Set("requestId", requestId)
  74808. return c
  74809. }
  74810. // Fields allows partial responses to be retrieved. See
  74811. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  74812. // for more information.
  74813. func (c *RegionDisksResizeCall) Fields(s ...googleapi.Field) *RegionDisksResizeCall {
  74814. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  74815. return c
  74816. }
  74817. // Context sets the context to be used in this call's Do method. Any
  74818. // pending HTTP request will be aborted if the provided context is
  74819. // canceled.
  74820. func (c *RegionDisksResizeCall) Context(ctx context.Context) *RegionDisksResizeCall {
  74821. c.ctx_ = ctx
  74822. return c
  74823. }
  74824. // Header returns an http.Header that can be modified by the caller to
  74825. // add HTTP headers to the request.
  74826. func (c *RegionDisksResizeCall) Header() http.Header {
  74827. if c.header_ == nil {
  74828. c.header_ = make(http.Header)
  74829. }
  74830. return c.header_
  74831. }
  74832. func (c *RegionDisksResizeCall) doRequest(alt string) (*http.Response, error) {
  74833. reqHeaders := make(http.Header)
  74834. for k, v := range c.header_ {
  74835. reqHeaders[k] = v
  74836. }
  74837. reqHeaders.Set("User-Agent", c.s.userAgent())
  74838. var body io.Reader = nil
  74839. body, err := googleapi.WithoutDataWrapper.JSONReader(c.regiondisksresizerequest)
  74840. if err != nil {
  74841. return nil, err
  74842. }
  74843. reqHeaders.Set("Content-Type", "application/json")
  74844. c.urlParams_.Set("alt", alt)
  74845. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/disks/{disk}/resize")
  74846. urls += "?" + c.urlParams_.Encode()
  74847. req, _ := http.NewRequest("POST", urls, body)
  74848. req.Header = reqHeaders
  74849. googleapi.Expand(req.URL, map[string]string{
  74850. "project": c.project,
  74851. "region": c.region,
  74852. "disk": c.disk,
  74853. })
  74854. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  74855. }
  74856. // Do executes the "compute.regionDisks.resize" call.
  74857. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  74858. // status code is an error. Response headers are in either
  74859. // *Operation.ServerResponse.Header or (if a response was returned at
  74860. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  74861. // to check whether the returned error was because
  74862. // http.StatusNotModified was returned.
  74863. func (c *RegionDisksResizeCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  74864. gensupport.SetOptions(c.urlParams_, opts...)
  74865. res, err := c.doRequest("json")
  74866. if res != nil && res.StatusCode == http.StatusNotModified {
  74867. if res.Body != nil {
  74868. res.Body.Close()
  74869. }
  74870. return nil, &googleapi.Error{
  74871. Code: res.StatusCode,
  74872. Header: res.Header,
  74873. }
  74874. }
  74875. if err != nil {
  74876. return nil, err
  74877. }
  74878. defer googleapi.CloseBody(res)
  74879. if err := googleapi.CheckResponse(res); err != nil {
  74880. return nil, err
  74881. }
  74882. ret := &Operation{
  74883. ServerResponse: googleapi.ServerResponse{
  74884. Header: res.Header,
  74885. HTTPStatusCode: res.StatusCode,
  74886. },
  74887. }
  74888. target := &ret
  74889. if err := gensupport.DecodeResponse(target, res); err != nil {
  74890. return nil, err
  74891. }
  74892. return ret, nil
  74893. // {
  74894. // "description": "Resizes the specified regional persistent disk.",
  74895. // "httpMethod": "POST",
  74896. // "id": "compute.regionDisks.resize",
  74897. // "parameterOrder": [
  74898. // "project",
  74899. // "region",
  74900. // "disk"
  74901. // ],
  74902. // "parameters": {
  74903. // "disk": {
  74904. // "description": "Name of the regional persistent disk.",
  74905. // "location": "path",
  74906. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  74907. // "required": true,
  74908. // "type": "string"
  74909. // },
  74910. // "project": {
  74911. // "description": "The project ID for this request.",
  74912. // "location": "path",
  74913. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  74914. // "required": true,
  74915. // "type": "string"
  74916. // },
  74917. // "region": {
  74918. // "description": "Name of the region for this request.",
  74919. // "location": "path",
  74920. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  74921. // "required": true,
  74922. // "type": "string"
  74923. // },
  74924. // "requestId": {
  74925. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  74926. // "location": "query",
  74927. // "type": "string"
  74928. // }
  74929. // },
  74930. // "path": "{project}/regions/{region}/disks/{disk}/resize",
  74931. // "request": {
  74932. // "$ref": "RegionDisksResizeRequest"
  74933. // },
  74934. // "response": {
  74935. // "$ref": "Operation"
  74936. // },
  74937. // "scopes": [
  74938. // "https://www.googleapis.com/auth/cloud-platform",
  74939. // "https://www.googleapis.com/auth/compute"
  74940. // ]
  74941. // }
  74942. }
  74943. // method id "compute.regionDisks.setLabels":
  74944. type RegionDisksSetLabelsCall struct {
  74945. s *Service
  74946. project string
  74947. region string
  74948. resource string
  74949. regionsetlabelsrequest *RegionSetLabelsRequest
  74950. urlParams_ gensupport.URLParams
  74951. ctx_ context.Context
  74952. header_ http.Header
  74953. }
  74954. // SetLabels: Sets the labels on the target regional disk.
  74955. func (r *RegionDisksService) SetLabels(project string, region string, resource string, regionsetlabelsrequest *RegionSetLabelsRequest) *RegionDisksSetLabelsCall {
  74956. c := &RegionDisksSetLabelsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  74957. c.project = project
  74958. c.region = region
  74959. c.resource = resource
  74960. c.regionsetlabelsrequest = regionsetlabelsrequest
  74961. return c
  74962. }
  74963. // RequestId sets the optional parameter "requestId": An optional
  74964. // request ID to identify requests. Specify a unique request ID so that
  74965. // if you must retry your request, the server will know to ignore the
  74966. // request if it has already been completed.
  74967. //
  74968. // For example, consider a situation where you make an initial request
  74969. // and the request times out. If you make the request again with the
  74970. // same request ID, the server can check if original operation with the
  74971. // same request ID was received, and if so, will ignore the second
  74972. // request. This prevents clients from accidentally creating duplicate
  74973. // commitments.
  74974. //
  74975. // The request ID must be a valid UUID with the exception that zero UUID
  74976. // is not supported (00000000-0000-0000-0000-000000000000).
  74977. func (c *RegionDisksSetLabelsCall) RequestId(requestId string) *RegionDisksSetLabelsCall {
  74978. c.urlParams_.Set("requestId", requestId)
  74979. return c
  74980. }
  74981. // Fields allows partial responses to be retrieved. See
  74982. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  74983. // for more information.
  74984. func (c *RegionDisksSetLabelsCall) Fields(s ...googleapi.Field) *RegionDisksSetLabelsCall {
  74985. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  74986. return c
  74987. }
  74988. // Context sets the context to be used in this call's Do method. Any
  74989. // pending HTTP request will be aborted if the provided context is
  74990. // canceled.
  74991. func (c *RegionDisksSetLabelsCall) Context(ctx context.Context) *RegionDisksSetLabelsCall {
  74992. c.ctx_ = ctx
  74993. return c
  74994. }
  74995. // Header returns an http.Header that can be modified by the caller to
  74996. // add HTTP headers to the request.
  74997. func (c *RegionDisksSetLabelsCall) Header() http.Header {
  74998. if c.header_ == nil {
  74999. c.header_ = make(http.Header)
  75000. }
  75001. return c.header_
  75002. }
  75003. func (c *RegionDisksSetLabelsCall) doRequest(alt string) (*http.Response, error) {
  75004. reqHeaders := make(http.Header)
  75005. for k, v := range c.header_ {
  75006. reqHeaders[k] = v
  75007. }
  75008. reqHeaders.Set("User-Agent", c.s.userAgent())
  75009. var body io.Reader = nil
  75010. body, err := googleapi.WithoutDataWrapper.JSONReader(c.regionsetlabelsrequest)
  75011. if err != nil {
  75012. return nil, err
  75013. }
  75014. reqHeaders.Set("Content-Type", "application/json")
  75015. c.urlParams_.Set("alt", alt)
  75016. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/disks/{resource}/setLabels")
  75017. urls += "?" + c.urlParams_.Encode()
  75018. req, _ := http.NewRequest("POST", urls, body)
  75019. req.Header = reqHeaders
  75020. googleapi.Expand(req.URL, map[string]string{
  75021. "project": c.project,
  75022. "region": c.region,
  75023. "resource": c.resource,
  75024. })
  75025. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  75026. }
  75027. // Do executes the "compute.regionDisks.setLabels" call.
  75028. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  75029. // status code is an error. Response headers are in either
  75030. // *Operation.ServerResponse.Header or (if a response was returned at
  75031. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  75032. // to check whether the returned error was because
  75033. // http.StatusNotModified was returned.
  75034. func (c *RegionDisksSetLabelsCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  75035. gensupport.SetOptions(c.urlParams_, opts...)
  75036. res, err := c.doRequest("json")
  75037. if res != nil && res.StatusCode == http.StatusNotModified {
  75038. if res.Body != nil {
  75039. res.Body.Close()
  75040. }
  75041. return nil, &googleapi.Error{
  75042. Code: res.StatusCode,
  75043. Header: res.Header,
  75044. }
  75045. }
  75046. if err != nil {
  75047. return nil, err
  75048. }
  75049. defer googleapi.CloseBody(res)
  75050. if err := googleapi.CheckResponse(res); err != nil {
  75051. return nil, err
  75052. }
  75053. ret := &Operation{
  75054. ServerResponse: googleapi.ServerResponse{
  75055. Header: res.Header,
  75056. HTTPStatusCode: res.StatusCode,
  75057. },
  75058. }
  75059. target := &ret
  75060. if err := gensupport.DecodeResponse(target, res); err != nil {
  75061. return nil, err
  75062. }
  75063. return ret, nil
  75064. // {
  75065. // "description": "Sets the labels on the target regional disk.",
  75066. // "httpMethod": "POST",
  75067. // "id": "compute.regionDisks.setLabels",
  75068. // "parameterOrder": [
  75069. // "project",
  75070. // "region",
  75071. // "resource"
  75072. // ],
  75073. // "parameters": {
  75074. // "project": {
  75075. // "description": "Project ID for this request.",
  75076. // "location": "path",
  75077. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  75078. // "required": true,
  75079. // "type": "string"
  75080. // },
  75081. // "region": {
  75082. // "description": "The region for this request.",
  75083. // "location": "path",
  75084. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  75085. // "required": true,
  75086. // "type": "string"
  75087. // },
  75088. // "requestId": {
  75089. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  75090. // "location": "query",
  75091. // "type": "string"
  75092. // },
  75093. // "resource": {
  75094. // "description": "Name of the resource for this request.",
  75095. // "location": "path",
  75096. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  75097. // "required": true,
  75098. // "type": "string"
  75099. // }
  75100. // },
  75101. // "path": "{project}/regions/{region}/disks/{resource}/setLabels",
  75102. // "request": {
  75103. // "$ref": "RegionSetLabelsRequest"
  75104. // },
  75105. // "response": {
  75106. // "$ref": "Operation"
  75107. // },
  75108. // "scopes": [
  75109. // "https://www.googleapis.com/auth/cloud-platform",
  75110. // "https://www.googleapis.com/auth/compute"
  75111. // ]
  75112. // }
  75113. }
  75114. // method id "compute.regionDisks.testIamPermissions":
  75115. type RegionDisksTestIamPermissionsCall struct {
  75116. s *Service
  75117. project string
  75118. region string
  75119. resource string
  75120. testpermissionsrequest *TestPermissionsRequest
  75121. urlParams_ gensupport.URLParams
  75122. ctx_ context.Context
  75123. header_ http.Header
  75124. }
  75125. // TestIamPermissions: Returns permissions that a caller has on the
  75126. // specified resource.
  75127. func (r *RegionDisksService) TestIamPermissions(project string, region string, resource string, testpermissionsrequest *TestPermissionsRequest) *RegionDisksTestIamPermissionsCall {
  75128. c := &RegionDisksTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  75129. c.project = project
  75130. c.region = region
  75131. c.resource = resource
  75132. c.testpermissionsrequest = testpermissionsrequest
  75133. return c
  75134. }
  75135. // Fields allows partial responses to be retrieved. See
  75136. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  75137. // for more information.
  75138. func (c *RegionDisksTestIamPermissionsCall) Fields(s ...googleapi.Field) *RegionDisksTestIamPermissionsCall {
  75139. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  75140. return c
  75141. }
  75142. // Context sets the context to be used in this call's Do method. Any
  75143. // pending HTTP request will be aborted if the provided context is
  75144. // canceled.
  75145. func (c *RegionDisksTestIamPermissionsCall) Context(ctx context.Context) *RegionDisksTestIamPermissionsCall {
  75146. c.ctx_ = ctx
  75147. return c
  75148. }
  75149. // Header returns an http.Header that can be modified by the caller to
  75150. // add HTTP headers to the request.
  75151. func (c *RegionDisksTestIamPermissionsCall) Header() http.Header {
  75152. if c.header_ == nil {
  75153. c.header_ = make(http.Header)
  75154. }
  75155. return c.header_
  75156. }
  75157. func (c *RegionDisksTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  75158. reqHeaders := make(http.Header)
  75159. for k, v := range c.header_ {
  75160. reqHeaders[k] = v
  75161. }
  75162. reqHeaders.Set("User-Agent", c.s.userAgent())
  75163. var body io.Reader = nil
  75164. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  75165. if err != nil {
  75166. return nil, err
  75167. }
  75168. reqHeaders.Set("Content-Type", "application/json")
  75169. c.urlParams_.Set("alt", alt)
  75170. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/disks/{resource}/testIamPermissions")
  75171. urls += "?" + c.urlParams_.Encode()
  75172. req, _ := http.NewRequest("POST", urls, body)
  75173. req.Header = reqHeaders
  75174. googleapi.Expand(req.URL, map[string]string{
  75175. "project": c.project,
  75176. "region": c.region,
  75177. "resource": c.resource,
  75178. })
  75179. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  75180. }
  75181. // Do executes the "compute.regionDisks.testIamPermissions" call.
  75182. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  75183. // non-2xx status code is an error. Response headers are in either
  75184. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  75185. // returned at all) in error.(*googleapi.Error).Header. Use
  75186. // googleapi.IsNotModified to check whether the returned error was
  75187. // because http.StatusNotModified was returned.
  75188. func (c *RegionDisksTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  75189. gensupport.SetOptions(c.urlParams_, opts...)
  75190. res, err := c.doRequest("json")
  75191. if res != nil && res.StatusCode == http.StatusNotModified {
  75192. if res.Body != nil {
  75193. res.Body.Close()
  75194. }
  75195. return nil, &googleapi.Error{
  75196. Code: res.StatusCode,
  75197. Header: res.Header,
  75198. }
  75199. }
  75200. if err != nil {
  75201. return nil, err
  75202. }
  75203. defer googleapi.CloseBody(res)
  75204. if err := googleapi.CheckResponse(res); err != nil {
  75205. return nil, err
  75206. }
  75207. ret := &TestPermissionsResponse{
  75208. ServerResponse: googleapi.ServerResponse{
  75209. Header: res.Header,
  75210. HTTPStatusCode: res.StatusCode,
  75211. },
  75212. }
  75213. target := &ret
  75214. if err := gensupport.DecodeResponse(target, res); err != nil {
  75215. return nil, err
  75216. }
  75217. return ret, nil
  75218. // {
  75219. // "description": "Returns permissions that a caller has on the specified resource.",
  75220. // "httpMethod": "POST",
  75221. // "id": "compute.regionDisks.testIamPermissions",
  75222. // "parameterOrder": [
  75223. // "project",
  75224. // "region",
  75225. // "resource"
  75226. // ],
  75227. // "parameters": {
  75228. // "project": {
  75229. // "description": "Project ID for this request.",
  75230. // "location": "path",
  75231. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  75232. // "required": true,
  75233. // "type": "string"
  75234. // },
  75235. // "region": {
  75236. // "description": "The name of the region for this request.",
  75237. // "location": "path",
  75238. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  75239. // "required": true,
  75240. // "type": "string"
  75241. // },
  75242. // "resource": {
  75243. // "description": "Name of the resource for this request.",
  75244. // "location": "path",
  75245. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  75246. // "required": true,
  75247. // "type": "string"
  75248. // }
  75249. // },
  75250. // "path": "{project}/regions/{region}/disks/{resource}/testIamPermissions",
  75251. // "request": {
  75252. // "$ref": "TestPermissionsRequest"
  75253. // },
  75254. // "response": {
  75255. // "$ref": "TestPermissionsResponse"
  75256. // },
  75257. // "scopes": [
  75258. // "https://www.googleapis.com/auth/cloud-platform",
  75259. // "https://www.googleapis.com/auth/compute",
  75260. // "https://www.googleapis.com/auth/compute.readonly"
  75261. // ]
  75262. // }
  75263. }
  75264. // method id "compute.regionInstanceGroupManagers.abandonInstances":
  75265. type RegionInstanceGroupManagersAbandonInstancesCall struct {
  75266. s *Service
  75267. project string
  75268. region string
  75269. instanceGroupManager string
  75270. regioninstancegroupmanagersabandoninstancesrequest *RegionInstanceGroupManagersAbandonInstancesRequest
  75271. urlParams_ gensupport.URLParams
  75272. ctx_ context.Context
  75273. header_ http.Header
  75274. }
  75275. // AbandonInstances: Schedules a group action to remove the specified
  75276. // instances from the managed instance group. Abandoning an instance
  75277. // does not delete the instance, but it does remove the instance from
  75278. // any target pools that are applied by the managed instance group. This
  75279. // method reduces the targetSize of the managed instance group by the
  75280. // number of instances that you abandon. This operation is marked as
  75281. // DONE when the action is scheduled even if the instances have not yet
  75282. // been removed from the group. You must separately verify the status of
  75283. // the abandoning action with the listmanagedinstances method.
  75284. //
  75285. // If the group is part of a backend service that has enabled connection
  75286. // draining, it can take up to 60 seconds after the connection draining
  75287. // duration has elapsed before the VM instance is removed or
  75288. // deleted.
  75289. //
  75290. // You can specify a maximum of 1000 instances with this method per
  75291. // request.
  75292. func (r *RegionInstanceGroupManagersService) AbandonInstances(project string, region string, instanceGroupManager string, regioninstancegroupmanagersabandoninstancesrequest *RegionInstanceGroupManagersAbandonInstancesRequest) *RegionInstanceGroupManagersAbandonInstancesCall {
  75293. c := &RegionInstanceGroupManagersAbandonInstancesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  75294. c.project = project
  75295. c.region = region
  75296. c.instanceGroupManager = instanceGroupManager
  75297. c.regioninstancegroupmanagersabandoninstancesrequest = regioninstancegroupmanagersabandoninstancesrequest
  75298. return c
  75299. }
  75300. // RequestId sets the optional parameter "requestId": An optional
  75301. // request ID to identify requests. Specify a unique request ID so that
  75302. // if you must retry your request, the server will know to ignore the
  75303. // request if it has already been completed.
  75304. //
  75305. // For example, consider a situation where you make an initial request
  75306. // and the request times out. If you make the request again with the
  75307. // same request ID, the server can check if original operation with the
  75308. // same request ID was received, and if so, will ignore the second
  75309. // request. This prevents clients from accidentally creating duplicate
  75310. // commitments.
  75311. //
  75312. // The request ID must be a valid UUID with the exception that zero UUID
  75313. // is not supported (00000000-0000-0000-0000-000000000000).
  75314. func (c *RegionInstanceGroupManagersAbandonInstancesCall) RequestId(requestId string) *RegionInstanceGroupManagersAbandonInstancesCall {
  75315. c.urlParams_.Set("requestId", requestId)
  75316. return c
  75317. }
  75318. // Fields allows partial responses to be retrieved. See
  75319. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  75320. // for more information.
  75321. func (c *RegionInstanceGroupManagersAbandonInstancesCall) Fields(s ...googleapi.Field) *RegionInstanceGroupManagersAbandonInstancesCall {
  75322. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  75323. return c
  75324. }
  75325. // Context sets the context to be used in this call's Do method. Any
  75326. // pending HTTP request will be aborted if the provided context is
  75327. // canceled.
  75328. func (c *RegionInstanceGroupManagersAbandonInstancesCall) Context(ctx context.Context) *RegionInstanceGroupManagersAbandonInstancesCall {
  75329. c.ctx_ = ctx
  75330. return c
  75331. }
  75332. // Header returns an http.Header that can be modified by the caller to
  75333. // add HTTP headers to the request.
  75334. func (c *RegionInstanceGroupManagersAbandonInstancesCall) Header() http.Header {
  75335. if c.header_ == nil {
  75336. c.header_ = make(http.Header)
  75337. }
  75338. return c.header_
  75339. }
  75340. func (c *RegionInstanceGroupManagersAbandonInstancesCall) doRequest(alt string) (*http.Response, error) {
  75341. reqHeaders := make(http.Header)
  75342. for k, v := range c.header_ {
  75343. reqHeaders[k] = v
  75344. }
  75345. reqHeaders.Set("User-Agent", c.s.userAgent())
  75346. var body io.Reader = nil
  75347. body, err := googleapi.WithoutDataWrapper.JSONReader(c.regioninstancegroupmanagersabandoninstancesrequest)
  75348. if err != nil {
  75349. return nil, err
  75350. }
  75351. reqHeaders.Set("Content-Type", "application/json")
  75352. c.urlParams_.Set("alt", alt)
  75353. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/abandonInstances")
  75354. urls += "?" + c.urlParams_.Encode()
  75355. req, _ := http.NewRequest("POST", urls, body)
  75356. req.Header = reqHeaders
  75357. googleapi.Expand(req.URL, map[string]string{
  75358. "project": c.project,
  75359. "region": c.region,
  75360. "instanceGroupManager": c.instanceGroupManager,
  75361. })
  75362. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  75363. }
  75364. // Do executes the "compute.regionInstanceGroupManagers.abandonInstances" call.
  75365. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  75366. // status code is an error. Response headers are in either
  75367. // *Operation.ServerResponse.Header or (if a response was returned at
  75368. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  75369. // to check whether the returned error was because
  75370. // http.StatusNotModified was returned.
  75371. func (c *RegionInstanceGroupManagersAbandonInstancesCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  75372. gensupport.SetOptions(c.urlParams_, opts...)
  75373. res, err := c.doRequest("json")
  75374. if res != nil && res.StatusCode == http.StatusNotModified {
  75375. if res.Body != nil {
  75376. res.Body.Close()
  75377. }
  75378. return nil, &googleapi.Error{
  75379. Code: res.StatusCode,
  75380. Header: res.Header,
  75381. }
  75382. }
  75383. if err != nil {
  75384. return nil, err
  75385. }
  75386. defer googleapi.CloseBody(res)
  75387. if err := googleapi.CheckResponse(res); err != nil {
  75388. return nil, err
  75389. }
  75390. ret := &Operation{
  75391. ServerResponse: googleapi.ServerResponse{
  75392. Header: res.Header,
  75393. HTTPStatusCode: res.StatusCode,
  75394. },
  75395. }
  75396. target := &ret
  75397. if err := gensupport.DecodeResponse(target, res); err != nil {
  75398. return nil, err
  75399. }
  75400. return ret, nil
  75401. // {
  75402. // "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.",
  75403. // "httpMethod": "POST",
  75404. // "id": "compute.regionInstanceGroupManagers.abandonInstances",
  75405. // "parameterOrder": [
  75406. // "project",
  75407. // "region",
  75408. // "instanceGroupManager"
  75409. // ],
  75410. // "parameters": {
  75411. // "instanceGroupManager": {
  75412. // "description": "Name of the managed instance group.",
  75413. // "location": "path",
  75414. // "required": true,
  75415. // "type": "string"
  75416. // },
  75417. // "project": {
  75418. // "description": "Project ID for this request.",
  75419. // "location": "path",
  75420. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  75421. // "required": true,
  75422. // "type": "string"
  75423. // },
  75424. // "region": {
  75425. // "description": "Name of the region scoping this request.",
  75426. // "location": "path",
  75427. // "required": true,
  75428. // "type": "string"
  75429. // },
  75430. // "requestId": {
  75431. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  75432. // "location": "query",
  75433. // "type": "string"
  75434. // }
  75435. // },
  75436. // "path": "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/abandonInstances",
  75437. // "request": {
  75438. // "$ref": "RegionInstanceGroupManagersAbandonInstancesRequest"
  75439. // },
  75440. // "response": {
  75441. // "$ref": "Operation"
  75442. // },
  75443. // "scopes": [
  75444. // "https://www.googleapis.com/auth/cloud-platform",
  75445. // "https://www.googleapis.com/auth/compute"
  75446. // ]
  75447. // }
  75448. }
  75449. // method id "compute.regionInstanceGroupManagers.delete":
  75450. type RegionInstanceGroupManagersDeleteCall struct {
  75451. s *Service
  75452. project string
  75453. region string
  75454. instanceGroupManager string
  75455. urlParams_ gensupport.URLParams
  75456. ctx_ context.Context
  75457. header_ http.Header
  75458. }
  75459. // Delete: Deletes the specified managed instance group and all of the
  75460. // instances in that group.
  75461. func (r *RegionInstanceGroupManagersService) Delete(project string, region string, instanceGroupManager string) *RegionInstanceGroupManagersDeleteCall {
  75462. c := &RegionInstanceGroupManagersDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  75463. c.project = project
  75464. c.region = region
  75465. c.instanceGroupManager = instanceGroupManager
  75466. return c
  75467. }
  75468. // RequestId sets the optional parameter "requestId": An optional
  75469. // request ID to identify requests. Specify a unique request ID so that
  75470. // if you must retry your request, the server will know to ignore the
  75471. // request if it has already been completed.
  75472. //
  75473. // For example, consider a situation where you make an initial request
  75474. // and the request times out. If you make the request again with the
  75475. // same request ID, the server can check if original operation with the
  75476. // same request ID was received, and if so, will ignore the second
  75477. // request. This prevents clients from accidentally creating duplicate
  75478. // commitments.
  75479. //
  75480. // The request ID must be a valid UUID with the exception that zero UUID
  75481. // is not supported (00000000-0000-0000-0000-000000000000).
  75482. func (c *RegionInstanceGroupManagersDeleteCall) RequestId(requestId string) *RegionInstanceGroupManagersDeleteCall {
  75483. c.urlParams_.Set("requestId", requestId)
  75484. return c
  75485. }
  75486. // Fields allows partial responses to be retrieved. See
  75487. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  75488. // for more information.
  75489. func (c *RegionInstanceGroupManagersDeleteCall) Fields(s ...googleapi.Field) *RegionInstanceGroupManagersDeleteCall {
  75490. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  75491. return c
  75492. }
  75493. // Context sets the context to be used in this call's Do method. Any
  75494. // pending HTTP request will be aborted if the provided context is
  75495. // canceled.
  75496. func (c *RegionInstanceGroupManagersDeleteCall) Context(ctx context.Context) *RegionInstanceGroupManagersDeleteCall {
  75497. c.ctx_ = ctx
  75498. return c
  75499. }
  75500. // Header returns an http.Header that can be modified by the caller to
  75501. // add HTTP headers to the request.
  75502. func (c *RegionInstanceGroupManagersDeleteCall) Header() http.Header {
  75503. if c.header_ == nil {
  75504. c.header_ = make(http.Header)
  75505. }
  75506. return c.header_
  75507. }
  75508. func (c *RegionInstanceGroupManagersDeleteCall) doRequest(alt string) (*http.Response, error) {
  75509. reqHeaders := make(http.Header)
  75510. for k, v := range c.header_ {
  75511. reqHeaders[k] = v
  75512. }
  75513. reqHeaders.Set("User-Agent", c.s.userAgent())
  75514. var body io.Reader = nil
  75515. c.urlParams_.Set("alt", alt)
  75516. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}")
  75517. urls += "?" + c.urlParams_.Encode()
  75518. req, _ := http.NewRequest("DELETE", urls, body)
  75519. req.Header = reqHeaders
  75520. googleapi.Expand(req.URL, map[string]string{
  75521. "project": c.project,
  75522. "region": c.region,
  75523. "instanceGroupManager": c.instanceGroupManager,
  75524. })
  75525. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  75526. }
  75527. // Do executes the "compute.regionInstanceGroupManagers.delete" call.
  75528. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  75529. // status code is an error. Response headers are in either
  75530. // *Operation.ServerResponse.Header or (if a response was returned at
  75531. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  75532. // to check whether the returned error was because
  75533. // http.StatusNotModified was returned.
  75534. func (c *RegionInstanceGroupManagersDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  75535. gensupport.SetOptions(c.urlParams_, opts...)
  75536. res, err := c.doRequest("json")
  75537. if res != nil && res.StatusCode == http.StatusNotModified {
  75538. if res.Body != nil {
  75539. res.Body.Close()
  75540. }
  75541. return nil, &googleapi.Error{
  75542. Code: res.StatusCode,
  75543. Header: res.Header,
  75544. }
  75545. }
  75546. if err != nil {
  75547. return nil, err
  75548. }
  75549. defer googleapi.CloseBody(res)
  75550. if err := googleapi.CheckResponse(res); err != nil {
  75551. return nil, err
  75552. }
  75553. ret := &Operation{
  75554. ServerResponse: googleapi.ServerResponse{
  75555. Header: res.Header,
  75556. HTTPStatusCode: res.StatusCode,
  75557. },
  75558. }
  75559. target := &ret
  75560. if err := gensupport.DecodeResponse(target, res); err != nil {
  75561. return nil, err
  75562. }
  75563. return ret, nil
  75564. // {
  75565. // "description": "Deletes the specified managed instance group and all of the instances in that group.",
  75566. // "httpMethod": "DELETE",
  75567. // "id": "compute.regionInstanceGroupManagers.delete",
  75568. // "parameterOrder": [
  75569. // "project",
  75570. // "region",
  75571. // "instanceGroupManager"
  75572. // ],
  75573. // "parameters": {
  75574. // "instanceGroupManager": {
  75575. // "description": "Name of the managed instance group to delete.",
  75576. // "location": "path",
  75577. // "required": true,
  75578. // "type": "string"
  75579. // },
  75580. // "project": {
  75581. // "description": "Project ID for this request.",
  75582. // "location": "path",
  75583. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  75584. // "required": true,
  75585. // "type": "string"
  75586. // },
  75587. // "region": {
  75588. // "description": "Name of the region scoping this request.",
  75589. // "location": "path",
  75590. // "required": true,
  75591. // "type": "string"
  75592. // },
  75593. // "requestId": {
  75594. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  75595. // "location": "query",
  75596. // "type": "string"
  75597. // }
  75598. // },
  75599. // "path": "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}",
  75600. // "response": {
  75601. // "$ref": "Operation"
  75602. // },
  75603. // "scopes": [
  75604. // "https://www.googleapis.com/auth/cloud-platform",
  75605. // "https://www.googleapis.com/auth/compute"
  75606. // ]
  75607. // }
  75608. }
  75609. // method id "compute.regionInstanceGroupManagers.deleteInstances":
  75610. type RegionInstanceGroupManagersDeleteInstancesCall struct {
  75611. s *Service
  75612. project string
  75613. region string
  75614. instanceGroupManager string
  75615. regioninstancegroupmanagersdeleteinstancesrequest *RegionInstanceGroupManagersDeleteInstancesRequest
  75616. urlParams_ gensupport.URLParams
  75617. ctx_ context.Context
  75618. header_ http.Header
  75619. }
  75620. // DeleteInstances: Schedules a group action to delete the specified
  75621. // instances in the managed instance group. The instances are also
  75622. // removed from any target pools of which they were a member. This
  75623. // method reduces the targetSize of the managed instance group by the
  75624. // number of instances that you delete. This operation is marked as DONE
  75625. // when the action is scheduled even if the instances are still being
  75626. // deleted. You must separately verify the status of the deleting action
  75627. // with the listmanagedinstances method.
  75628. //
  75629. // If the group is part of a backend service that has enabled connection
  75630. // draining, it can take up to 60 seconds after the connection draining
  75631. // duration has elapsed before the VM instance is removed or
  75632. // deleted.
  75633. //
  75634. // You can specify a maximum of 1000 instances with this method per
  75635. // request.
  75636. func (r *RegionInstanceGroupManagersService) DeleteInstances(project string, region string, instanceGroupManager string, regioninstancegroupmanagersdeleteinstancesrequest *RegionInstanceGroupManagersDeleteInstancesRequest) *RegionInstanceGroupManagersDeleteInstancesCall {
  75637. c := &RegionInstanceGroupManagersDeleteInstancesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  75638. c.project = project
  75639. c.region = region
  75640. c.instanceGroupManager = instanceGroupManager
  75641. c.regioninstancegroupmanagersdeleteinstancesrequest = regioninstancegroupmanagersdeleteinstancesrequest
  75642. return c
  75643. }
  75644. // RequestId sets the optional parameter "requestId": An optional
  75645. // request ID to identify requests. Specify a unique request ID so that
  75646. // if you must retry your request, the server will know to ignore the
  75647. // request if it has already been completed.
  75648. //
  75649. // For example, consider a situation where you make an initial request
  75650. // and the request times out. If you make the request again with the
  75651. // same request ID, the server can check if original operation with the
  75652. // same request ID was received, and if so, will ignore the second
  75653. // request. This prevents clients from accidentally creating duplicate
  75654. // commitments.
  75655. //
  75656. // The request ID must be a valid UUID with the exception that zero UUID
  75657. // is not supported (00000000-0000-0000-0000-000000000000).
  75658. func (c *RegionInstanceGroupManagersDeleteInstancesCall) RequestId(requestId string) *RegionInstanceGroupManagersDeleteInstancesCall {
  75659. c.urlParams_.Set("requestId", requestId)
  75660. return c
  75661. }
  75662. // Fields allows partial responses to be retrieved. See
  75663. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  75664. // for more information.
  75665. func (c *RegionInstanceGroupManagersDeleteInstancesCall) Fields(s ...googleapi.Field) *RegionInstanceGroupManagersDeleteInstancesCall {
  75666. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  75667. return c
  75668. }
  75669. // Context sets the context to be used in this call's Do method. Any
  75670. // pending HTTP request will be aborted if the provided context is
  75671. // canceled.
  75672. func (c *RegionInstanceGroupManagersDeleteInstancesCall) Context(ctx context.Context) *RegionInstanceGroupManagersDeleteInstancesCall {
  75673. c.ctx_ = ctx
  75674. return c
  75675. }
  75676. // Header returns an http.Header that can be modified by the caller to
  75677. // add HTTP headers to the request.
  75678. func (c *RegionInstanceGroupManagersDeleteInstancesCall) Header() http.Header {
  75679. if c.header_ == nil {
  75680. c.header_ = make(http.Header)
  75681. }
  75682. return c.header_
  75683. }
  75684. func (c *RegionInstanceGroupManagersDeleteInstancesCall) doRequest(alt string) (*http.Response, error) {
  75685. reqHeaders := make(http.Header)
  75686. for k, v := range c.header_ {
  75687. reqHeaders[k] = v
  75688. }
  75689. reqHeaders.Set("User-Agent", c.s.userAgent())
  75690. var body io.Reader = nil
  75691. body, err := googleapi.WithoutDataWrapper.JSONReader(c.regioninstancegroupmanagersdeleteinstancesrequest)
  75692. if err != nil {
  75693. return nil, err
  75694. }
  75695. reqHeaders.Set("Content-Type", "application/json")
  75696. c.urlParams_.Set("alt", alt)
  75697. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/deleteInstances")
  75698. urls += "?" + c.urlParams_.Encode()
  75699. req, _ := http.NewRequest("POST", urls, body)
  75700. req.Header = reqHeaders
  75701. googleapi.Expand(req.URL, map[string]string{
  75702. "project": c.project,
  75703. "region": c.region,
  75704. "instanceGroupManager": c.instanceGroupManager,
  75705. })
  75706. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  75707. }
  75708. // Do executes the "compute.regionInstanceGroupManagers.deleteInstances" call.
  75709. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  75710. // status code is an error. Response headers are in either
  75711. // *Operation.ServerResponse.Header or (if a response was returned at
  75712. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  75713. // to check whether the returned error was because
  75714. // http.StatusNotModified was returned.
  75715. func (c *RegionInstanceGroupManagersDeleteInstancesCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  75716. gensupport.SetOptions(c.urlParams_, opts...)
  75717. res, err := c.doRequest("json")
  75718. if res != nil && res.StatusCode == http.StatusNotModified {
  75719. if res.Body != nil {
  75720. res.Body.Close()
  75721. }
  75722. return nil, &googleapi.Error{
  75723. Code: res.StatusCode,
  75724. Header: res.Header,
  75725. }
  75726. }
  75727. if err != nil {
  75728. return nil, err
  75729. }
  75730. defer googleapi.CloseBody(res)
  75731. if err := googleapi.CheckResponse(res); err != nil {
  75732. return nil, err
  75733. }
  75734. ret := &Operation{
  75735. ServerResponse: googleapi.ServerResponse{
  75736. Header: res.Header,
  75737. HTTPStatusCode: res.StatusCode,
  75738. },
  75739. }
  75740. target := &ret
  75741. if err := gensupport.DecodeResponse(target, res); err != nil {
  75742. return nil, err
  75743. }
  75744. return ret, nil
  75745. // {
  75746. // "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.",
  75747. // "httpMethod": "POST",
  75748. // "id": "compute.regionInstanceGroupManagers.deleteInstances",
  75749. // "parameterOrder": [
  75750. // "project",
  75751. // "region",
  75752. // "instanceGroupManager"
  75753. // ],
  75754. // "parameters": {
  75755. // "instanceGroupManager": {
  75756. // "description": "Name of the managed instance group.",
  75757. // "location": "path",
  75758. // "required": true,
  75759. // "type": "string"
  75760. // },
  75761. // "project": {
  75762. // "description": "Project ID for this request.",
  75763. // "location": "path",
  75764. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  75765. // "required": true,
  75766. // "type": "string"
  75767. // },
  75768. // "region": {
  75769. // "description": "Name of the region scoping this request.",
  75770. // "location": "path",
  75771. // "required": true,
  75772. // "type": "string"
  75773. // },
  75774. // "requestId": {
  75775. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  75776. // "location": "query",
  75777. // "type": "string"
  75778. // }
  75779. // },
  75780. // "path": "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/deleteInstances",
  75781. // "request": {
  75782. // "$ref": "RegionInstanceGroupManagersDeleteInstancesRequest"
  75783. // },
  75784. // "response": {
  75785. // "$ref": "Operation"
  75786. // },
  75787. // "scopes": [
  75788. // "https://www.googleapis.com/auth/cloud-platform",
  75789. // "https://www.googleapis.com/auth/compute"
  75790. // ]
  75791. // }
  75792. }
  75793. // method id "compute.regionInstanceGroupManagers.get":
  75794. type RegionInstanceGroupManagersGetCall struct {
  75795. s *Service
  75796. project string
  75797. region string
  75798. instanceGroupManager string
  75799. urlParams_ gensupport.URLParams
  75800. ifNoneMatch_ string
  75801. ctx_ context.Context
  75802. header_ http.Header
  75803. }
  75804. // Get: Returns all of the details about the specified managed instance
  75805. // group.
  75806. func (r *RegionInstanceGroupManagersService) Get(project string, region string, instanceGroupManager string) *RegionInstanceGroupManagersGetCall {
  75807. c := &RegionInstanceGroupManagersGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  75808. c.project = project
  75809. c.region = region
  75810. c.instanceGroupManager = instanceGroupManager
  75811. return c
  75812. }
  75813. // Fields allows partial responses to be retrieved. See
  75814. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  75815. // for more information.
  75816. func (c *RegionInstanceGroupManagersGetCall) Fields(s ...googleapi.Field) *RegionInstanceGroupManagersGetCall {
  75817. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  75818. return c
  75819. }
  75820. // IfNoneMatch sets the optional parameter which makes the operation
  75821. // fail if the object's ETag matches the given value. This is useful for
  75822. // getting updates only after the object has changed since the last
  75823. // request. Use googleapi.IsNotModified to check whether the response
  75824. // error from Do is the result of In-None-Match.
  75825. func (c *RegionInstanceGroupManagersGetCall) IfNoneMatch(entityTag string) *RegionInstanceGroupManagersGetCall {
  75826. c.ifNoneMatch_ = entityTag
  75827. return c
  75828. }
  75829. // Context sets the context to be used in this call's Do method. Any
  75830. // pending HTTP request will be aborted if the provided context is
  75831. // canceled.
  75832. func (c *RegionInstanceGroupManagersGetCall) Context(ctx context.Context) *RegionInstanceGroupManagersGetCall {
  75833. c.ctx_ = ctx
  75834. return c
  75835. }
  75836. // Header returns an http.Header that can be modified by the caller to
  75837. // add HTTP headers to the request.
  75838. func (c *RegionInstanceGroupManagersGetCall) Header() http.Header {
  75839. if c.header_ == nil {
  75840. c.header_ = make(http.Header)
  75841. }
  75842. return c.header_
  75843. }
  75844. func (c *RegionInstanceGroupManagersGetCall) doRequest(alt string) (*http.Response, error) {
  75845. reqHeaders := make(http.Header)
  75846. for k, v := range c.header_ {
  75847. reqHeaders[k] = v
  75848. }
  75849. reqHeaders.Set("User-Agent", c.s.userAgent())
  75850. if c.ifNoneMatch_ != "" {
  75851. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  75852. }
  75853. var body io.Reader = nil
  75854. c.urlParams_.Set("alt", alt)
  75855. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}")
  75856. urls += "?" + c.urlParams_.Encode()
  75857. req, _ := http.NewRequest("GET", urls, body)
  75858. req.Header = reqHeaders
  75859. googleapi.Expand(req.URL, map[string]string{
  75860. "project": c.project,
  75861. "region": c.region,
  75862. "instanceGroupManager": c.instanceGroupManager,
  75863. })
  75864. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  75865. }
  75866. // Do executes the "compute.regionInstanceGroupManagers.get" call.
  75867. // Exactly one of *InstanceGroupManager or error will be non-nil. Any
  75868. // non-2xx status code is an error. Response headers are in either
  75869. // *InstanceGroupManager.ServerResponse.Header or (if a response was
  75870. // returned at all) in error.(*googleapi.Error).Header. Use
  75871. // googleapi.IsNotModified to check whether the returned error was
  75872. // because http.StatusNotModified was returned.
  75873. func (c *RegionInstanceGroupManagersGetCall) Do(opts ...googleapi.CallOption) (*InstanceGroupManager, error) {
  75874. gensupport.SetOptions(c.urlParams_, opts...)
  75875. res, err := c.doRequest("json")
  75876. if res != nil && res.StatusCode == http.StatusNotModified {
  75877. if res.Body != nil {
  75878. res.Body.Close()
  75879. }
  75880. return nil, &googleapi.Error{
  75881. Code: res.StatusCode,
  75882. Header: res.Header,
  75883. }
  75884. }
  75885. if err != nil {
  75886. return nil, err
  75887. }
  75888. defer googleapi.CloseBody(res)
  75889. if err := googleapi.CheckResponse(res); err != nil {
  75890. return nil, err
  75891. }
  75892. ret := &InstanceGroupManager{
  75893. ServerResponse: googleapi.ServerResponse{
  75894. Header: res.Header,
  75895. HTTPStatusCode: res.StatusCode,
  75896. },
  75897. }
  75898. target := &ret
  75899. if err := gensupport.DecodeResponse(target, res); err != nil {
  75900. return nil, err
  75901. }
  75902. return ret, nil
  75903. // {
  75904. // "description": "Returns all of the details about the specified managed instance group.",
  75905. // "httpMethod": "GET",
  75906. // "id": "compute.regionInstanceGroupManagers.get",
  75907. // "parameterOrder": [
  75908. // "project",
  75909. // "region",
  75910. // "instanceGroupManager"
  75911. // ],
  75912. // "parameters": {
  75913. // "instanceGroupManager": {
  75914. // "description": "Name of the managed instance group to return.",
  75915. // "location": "path",
  75916. // "required": true,
  75917. // "type": "string"
  75918. // },
  75919. // "project": {
  75920. // "description": "Project ID for this request.",
  75921. // "location": "path",
  75922. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  75923. // "required": true,
  75924. // "type": "string"
  75925. // },
  75926. // "region": {
  75927. // "description": "Name of the region scoping this request.",
  75928. // "location": "path",
  75929. // "required": true,
  75930. // "type": "string"
  75931. // }
  75932. // },
  75933. // "path": "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}",
  75934. // "response": {
  75935. // "$ref": "InstanceGroupManager"
  75936. // },
  75937. // "scopes": [
  75938. // "https://www.googleapis.com/auth/cloud-platform",
  75939. // "https://www.googleapis.com/auth/compute",
  75940. // "https://www.googleapis.com/auth/compute.readonly"
  75941. // ]
  75942. // }
  75943. }
  75944. // method id "compute.regionInstanceGroupManagers.insert":
  75945. type RegionInstanceGroupManagersInsertCall struct {
  75946. s *Service
  75947. project string
  75948. region string
  75949. instancegroupmanager *InstanceGroupManager
  75950. urlParams_ gensupport.URLParams
  75951. ctx_ context.Context
  75952. header_ http.Header
  75953. }
  75954. // Insert: Creates a managed instance group using the information that
  75955. // you specify in the request. After the group is created, it schedules
  75956. // an action to create instances in the group using the specified
  75957. // instance template. This operation is marked as DONE when the group is
  75958. // created even if the instances in the group have not yet been created.
  75959. // You must separately verify the status of the individual instances
  75960. // with the listmanagedinstances method.
  75961. //
  75962. // A regional managed instance group can contain up to 2000 instances.
  75963. func (r *RegionInstanceGroupManagersService) Insert(project string, region string, instancegroupmanager *InstanceGroupManager) *RegionInstanceGroupManagersInsertCall {
  75964. c := &RegionInstanceGroupManagersInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  75965. c.project = project
  75966. c.region = region
  75967. c.instancegroupmanager = instancegroupmanager
  75968. return c
  75969. }
  75970. // RequestId sets the optional parameter "requestId": An optional
  75971. // request ID to identify requests. Specify a unique request ID so that
  75972. // if you must retry your request, the server will know to ignore the
  75973. // request if it has already been completed.
  75974. //
  75975. // For example, consider a situation where you make an initial request
  75976. // and the request times out. If you make the request again with the
  75977. // same request ID, the server can check if original operation with the
  75978. // same request ID was received, and if so, will ignore the second
  75979. // request. This prevents clients from accidentally creating duplicate
  75980. // commitments.
  75981. //
  75982. // The request ID must be a valid UUID with the exception that zero UUID
  75983. // is not supported (00000000-0000-0000-0000-000000000000).
  75984. func (c *RegionInstanceGroupManagersInsertCall) RequestId(requestId string) *RegionInstanceGroupManagersInsertCall {
  75985. c.urlParams_.Set("requestId", requestId)
  75986. return c
  75987. }
  75988. // Fields allows partial responses to be retrieved. See
  75989. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  75990. // for more information.
  75991. func (c *RegionInstanceGroupManagersInsertCall) Fields(s ...googleapi.Field) *RegionInstanceGroupManagersInsertCall {
  75992. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  75993. return c
  75994. }
  75995. // Context sets the context to be used in this call's Do method. Any
  75996. // pending HTTP request will be aborted if the provided context is
  75997. // canceled.
  75998. func (c *RegionInstanceGroupManagersInsertCall) Context(ctx context.Context) *RegionInstanceGroupManagersInsertCall {
  75999. c.ctx_ = ctx
  76000. return c
  76001. }
  76002. // Header returns an http.Header that can be modified by the caller to
  76003. // add HTTP headers to the request.
  76004. func (c *RegionInstanceGroupManagersInsertCall) Header() http.Header {
  76005. if c.header_ == nil {
  76006. c.header_ = make(http.Header)
  76007. }
  76008. return c.header_
  76009. }
  76010. func (c *RegionInstanceGroupManagersInsertCall) doRequest(alt string) (*http.Response, error) {
  76011. reqHeaders := make(http.Header)
  76012. for k, v := range c.header_ {
  76013. reqHeaders[k] = v
  76014. }
  76015. reqHeaders.Set("User-Agent", c.s.userAgent())
  76016. var body io.Reader = nil
  76017. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupmanager)
  76018. if err != nil {
  76019. return nil, err
  76020. }
  76021. reqHeaders.Set("Content-Type", "application/json")
  76022. c.urlParams_.Set("alt", alt)
  76023. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/instanceGroupManagers")
  76024. urls += "?" + c.urlParams_.Encode()
  76025. req, _ := http.NewRequest("POST", urls, body)
  76026. req.Header = reqHeaders
  76027. googleapi.Expand(req.URL, map[string]string{
  76028. "project": c.project,
  76029. "region": c.region,
  76030. })
  76031. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  76032. }
  76033. // Do executes the "compute.regionInstanceGroupManagers.insert" call.
  76034. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  76035. // status code is an error. Response headers are in either
  76036. // *Operation.ServerResponse.Header or (if a response was returned at
  76037. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  76038. // to check whether the returned error was because
  76039. // http.StatusNotModified was returned.
  76040. func (c *RegionInstanceGroupManagersInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  76041. gensupport.SetOptions(c.urlParams_, opts...)
  76042. res, err := c.doRequest("json")
  76043. if res != nil && res.StatusCode == http.StatusNotModified {
  76044. if res.Body != nil {
  76045. res.Body.Close()
  76046. }
  76047. return nil, &googleapi.Error{
  76048. Code: res.StatusCode,
  76049. Header: res.Header,
  76050. }
  76051. }
  76052. if err != nil {
  76053. return nil, err
  76054. }
  76055. defer googleapi.CloseBody(res)
  76056. if err := googleapi.CheckResponse(res); err != nil {
  76057. return nil, err
  76058. }
  76059. ret := &Operation{
  76060. ServerResponse: googleapi.ServerResponse{
  76061. Header: res.Header,
  76062. HTTPStatusCode: res.StatusCode,
  76063. },
  76064. }
  76065. target := &ret
  76066. if err := gensupport.DecodeResponse(target, res); err != nil {
  76067. return nil, err
  76068. }
  76069. return ret, nil
  76070. // {
  76071. // "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.",
  76072. // "httpMethod": "POST",
  76073. // "id": "compute.regionInstanceGroupManagers.insert",
  76074. // "parameterOrder": [
  76075. // "project",
  76076. // "region"
  76077. // ],
  76078. // "parameters": {
  76079. // "project": {
  76080. // "description": "Project ID for this request.",
  76081. // "location": "path",
  76082. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  76083. // "required": true,
  76084. // "type": "string"
  76085. // },
  76086. // "region": {
  76087. // "description": "Name of the region scoping this request.",
  76088. // "location": "path",
  76089. // "required": true,
  76090. // "type": "string"
  76091. // },
  76092. // "requestId": {
  76093. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  76094. // "location": "query",
  76095. // "type": "string"
  76096. // }
  76097. // },
  76098. // "path": "{project}/regions/{region}/instanceGroupManagers",
  76099. // "request": {
  76100. // "$ref": "InstanceGroupManager"
  76101. // },
  76102. // "response": {
  76103. // "$ref": "Operation"
  76104. // },
  76105. // "scopes": [
  76106. // "https://www.googleapis.com/auth/cloud-platform",
  76107. // "https://www.googleapis.com/auth/compute"
  76108. // ]
  76109. // }
  76110. }
  76111. // method id "compute.regionInstanceGroupManagers.list":
  76112. type RegionInstanceGroupManagersListCall struct {
  76113. s *Service
  76114. project string
  76115. region string
  76116. urlParams_ gensupport.URLParams
  76117. ifNoneMatch_ string
  76118. ctx_ context.Context
  76119. header_ http.Header
  76120. }
  76121. // List: Retrieves the list of managed instance groups that are
  76122. // contained within the specified region.
  76123. func (r *RegionInstanceGroupManagersService) List(project string, region string) *RegionInstanceGroupManagersListCall {
  76124. c := &RegionInstanceGroupManagersListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  76125. c.project = project
  76126. c.region = region
  76127. return c
  76128. }
  76129. // Filter sets the optional parameter "filter": A filter expression that
  76130. // filters resources listed in the response. The expression must specify
  76131. // the field name, a comparison operator, and the value that you want to
  76132. // use for filtering. The value must be a string, a number, or a
  76133. // boolean. The comparison operator must be either =, !=, >, or <.
  76134. //
  76135. // For example, if you are filtering Compute Engine instances, you can
  76136. // exclude instances named example-instance by specifying name !=
  76137. // example-instance.
  76138. //
  76139. // You can also filter nested fields. For example, you could specify
  76140. // scheduling.automaticRestart = false to include instances only if they
  76141. // are not scheduled for automatic restarts. You can use filtering on
  76142. // nested fields to filter based on resource labels.
  76143. //
  76144. // To filter on multiple expressions, provide each separate expression
  76145. // within parentheses. For example, (scheduling.automaticRestart = true)
  76146. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  76147. // AND expression. However, you can include AND and OR expressions
  76148. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  76149. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  76150. // true).
  76151. func (c *RegionInstanceGroupManagersListCall) Filter(filter string) *RegionInstanceGroupManagersListCall {
  76152. c.urlParams_.Set("filter", filter)
  76153. return c
  76154. }
  76155. // MaxResults sets the optional parameter "maxResults": The maximum
  76156. // number of results per page that should be returned. If the number of
  76157. // available results is larger than maxResults, Compute Engine returns a
  76158. // nextPageToken that can be used to get the next page of results in
  76159. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  76160. // (Default: 500)
  76161. func (c *RegionInstanceGroupManagersListCall) MaxResults(maxResults int64) *RegionInstanceGroupManagersListCall {
  76162. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  76163. return c
  76164. }
  76165. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  76166. // a certain order. By default, results are returned in alphanumerical
  76167. // order based on the resource name.
  76168. //
  76169. // You can also sort results in descending order based on the creation
  76170. // timestamp using orderBy="creationTimestamp desc". This sorts results
  76171. // based on the creationTimestamp field in reverse chronological order
  76172. // (newest result first). Use this to sort resources like operations so
  76173. // that the newest operation is returned first.
  76174. //
  76175. // Currently, only sorting by name or creationTimestamp desc is
  76176. // supported.
  76177. func (c *RegionInstanceGroupManagersListCall) OrderBy(orderBy string) *RegionInstanceGroupManagersListCall {
  76178. c.urlParams_.Set("orderBy", orderBy)
  76179. return c
  76180. }
  76181. // PageToken sets the optional parameter "pageToken": Specifies a page
  76182. // token to use. Set pageToken to the nextPageToken returned by a
  76183. // previous list request to get the next page of results.
  76184. func (c *RegionInstanceGroupManagersListCall) PageToken(pageToken string) *RegionInstanceGroupManagersListCall {
  76185. c.urlParams_.Set("pageToken", pageToken)
  76186. return c
  76187. }
  76188. // Fields allows partial responses to be retrieved. See
  76189. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  76190. // for more information.
  76191. func (c *RegionInstanceGroupManagersListCall) Fields(s ...googleapi.Field) *RegionInstanceGroupManagersListCall {
  76192. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  76193. return c
  76194. }
  76195. // IfNoneMatch sets the optional parameter which makes the operation
  76196. // fail if the object's ETag matches the given value. This is useful for
  76197. // getting updates only after the object has changed since the last
  76198. // request. Use googleapi.IsNotModified to check whether the response
  76199. // error from Do is the result of In-None-Match.
  76200. func (c *RegionInstanceGroupManagersListCall) IfNoneMatch(entityTag string) *RegionInstanceGroupManagersListCall {
  76201. c.ifNoneMatch_ = entityTag
  76202. return c
  76203. }
  76204. // Context sets the context to be used in this call's Do method. Any
  76205. // pending HTTP request will be aborted if the provided context is
  76206. // canceled.
  76207. func (c *RegionInstanceGroupManagersListCall) Context(ctx context.Context) *RegionInstanceGroupManagersListCall {
  76208. c.ctx_ = ctx
  76209. return c
  76210. }
  76211. // Header returns an http.Header that can be modified by the caller to
  76212. // add HTTP headers to the request.
  76213. func (c *RegionInstanceGroupManagersListCall) Header() http.Header {
  76214. if c.header_ == nil {
  76215. c.header_ = make(http.Header)
  76216. }
  76217. return c.header_
  76218. }
  76219. func (c *RegionInstanceGroupManagersListCall) doRequest(alt string) (*http.Response, error) {
  76220. reqHeaders := make(http.Header)
  76221. for k, v := range c.header_ {
  76222. reqHeaders[k] = v
  76223. }
  76224. reqHeaders.Set("User-Agent", c.s.userAgent())
  76225. if c.ifNoneMatch_ != "" {
  76226. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  76227. }
  76228. var body io.Reader = nil
  76229. c.urlParams_.Set("alt", alt)
  76230. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/instanceGroupManagers")
  76231. urls += "?" + c.urlParams_.Encode()
  76232. req, _ := http.NewRequest("GET", urls, body)
  76233. req.Header = reqHeaders
  76234. googleapi.Expand(req.URL, map[string]string{
  76235. "project": c.project,
  76236. "region": c.region,
  76237. })
  76238. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  76239. }
  76240. // Do executes the "compute.regionInstanceGroupManagers.list" call.
  76241. // Exactly one of *RegionInstanceGroupManagerList or error will be
  76242. // non-nil. Any non-2xx status code is an error. Response headers are in
  76243. // either *RegionInstanceGroupManagerList.ServerResponse.Header or (if a
  76244. // response was returned at all) in error.(*googleapi.Error).Header. Use
  76245. // googleapi.IsNotModified to check whether the returned error was
  76246. // because http.StatusNotModified was returned.
  76247. func (c *RegionInstanceGroupManagersListCall) Do(opts ...googleapi.CallOption) (*RegionInstanceGroupManagerList, error) {
  76248. gensupport.SetOptions(c.urlParams_, opts...)
  76249. res, err := c.doRequest("json")
  76250. if res != nil && res.StatusCode == http.StatusNotModified {
  76251. if res.Body != nil {
  76252. res.Body.Close()
  76253. }
  76254. return nil, &googleapi.Error{
  76255. Code: res.StatusCode,
  76256. Header: res.Header,
  76257. }
  76258. }
  76259. if err != nil {
  76260. return nil, err
  76261. }
  76262. defer googleapi.CloseBody(res)
  76263. if err := googleapi.CheckResponse(res); err != nil {
  76264. return nil, err
  76265. }
  76266. ret := &RegionInstanceGroupManagerList{
  76267. ServerResponse: googleapi.ServerResponse{
  76268. Header: res.Header,
  76269. HTTPStatusCode: res.StatusCode,
  76270. },
  76271. }
  76272. target := &ret
  76273. if err := gensupport.DecodeResponse(target, res); err != nil {
  76274. return nil, err
  76275. }
  76276. return ret, nil
  76277. // {
  76278. // "description": "Retrieves the list of managed instance groups that are contained within the specified region.",
  76279. // "httpMethod": "GET",
  76280. // "id": "compute.regionInstanceGroupManagers.list",
  76281. // "parameterOrder": [
  76282. // "project",
  76283. // "region"
  76284. // ],
  76285. // "parameters": {
  76286. // "filter": {
  76287. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  76288. // "location": "query",
  76289. // "type": "string"
  76290. // },
  76291. // "maxResults": {
  76292. // "default": "500",
  76293. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  76294. // "format": "uint32",
  76295. // "location": "query",
  76296. // "minimum": "0",
  76297. // "type": "integer"
  76298. // },
  76299. // "orderBy": {
  76300. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  76301. // "location": "query",
  76302. // "type": "string"
  76303. // },
  76304. // "pageToken": {
  76305. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  76306. // "location": "query",
  76307. // "type": "string"
  76308. // },
  76309. // "project": {
  76310. // "description": "Project ID for this request.",
  76311. // "location": "path",
  76312. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  76313. // "required": true,
  76314. // "type": "string"
  76315. // },
  76316. // "region": {
  76317. // "description": "Name of the region scoping this request.",
  76318. // "location": "path",
  76319. // "required": true,
  76320. // "type": "string"
  76321. // }
  76322. // },
  76323. // "path": "{project}/regions/{region}/instanceGroupManagers",
  76324. // "response": {
  76325. // "$ref": "RegionInstanceGroupManagerList"
  76326. // },
  76327. // "scopes": [
  76328. // "https://www.googleapis.com/auth/cloud-platform",
  76329. // "https://www.googleapis.com/auth/compute",
  76330. // "https://www.googleapis.com/auth/compute.readonly"
  76331. // ]
  76332. // }
  76333. }
  76334. // Pages invokes f for each page of results.
  76335. // A non-nil error returned from f will halt the iteration.
  76336. // The provided context supersedes any context provided to the Context method.
  76337. func (c *RegionInstanceGroupManagersListCall) Pages(ctx context.Context, f func(*RegionInstanceGroupManagerList) error) error {
  76338. c.ctx_ = ctx
  76339. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  76340. for {
  76341. x, err := c.Do()
  76342. if err != nil {
  76343. return err
  76344. }
  76345. if err := f(x); err != nil {
  76346. return err
  76347. }
  76348. if x.NextPageToken == "" {
  76349. return nil
  76350. }
  76351. c.PageToken(x.NextPageToken)
  76352. }
  76353. }
  76354. // method id "compute.regionInstanceGroupManagers.listManagedInstances":
  76355. type RegionInstanceGroupManagersListManagedInstancesCall struct {
  76356. s *Service
  76357. project string
  76358. region string
  76359. instanceGroupManager string
  76360. urlParams_ gensupport.URLParams
  76361. ctx_ context.Context
  76362. header_ http.Header
  76363. }
  76364. // ListManagedInstances: Lists the instances in the managed instance
  76365. // group and instances that are scheduled to be created. The list
  76366. // includes any current actions that the group has scheduled for its
  76367. // instances.
  76368. func (r *RegionInstanceGroupManagersService) ListManagedInstances(project string, region string, instanceGroupManager string) *RegionInstanceGroupManagersListManagedInstancesCall {
  76369. c := &RegionInstanceGroupManagersListManagedInstancesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  76370. c.project = project
  76371. c.region = region
  76372. c.instanceGroupManager = instanceGroupManager
  76373. return c
  76374. }
  76375. // Filter sets the optional parameter "filter":
  76376. func (c *RegionInstanceGroupManagersListManagedInstancesCall) Filter(filter string) *RegionInstanceGroupManagersListManagedInstancesCall {
  76377. c.urlParams_.Set("filter", filter)
  76378. return c
  76379. }
  76380. // MaxResults sets the optional parameter "maxResults":
  76381. func (c *RegionInstanceGroupManagersListManagedInstancesCall) MaxResults(maxResults int64) *RegionInstanceGroupManagersListManagedInstancesCall {
  76382. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  76383. return c
  76384. }
  76385. // OrderBy sets the optional parameter "order_by":
  76386. func (c *RegionInstanceGroupManagersListManagedInstancesCall) OrderBy(orderBy string) *RegionInstanceGroupManagersListManagedInstancesCall {
  76387. c.urlParams_.Set("order_by", orderBy)
  76388. return c
  76389. }
  76390. // PageToken sets the optional parameter "pageToken":
  76391. func (c *RegionInstanceGroupManagersListManagedInstancesCall) PageToken(pageToken string) *RegionInstanceGroupManagersListManagedInstancesCall {
  76392. c.urlParams_.Set("pageToken", pageToken)
  76393. return c
  76394. }
  76395. // Fields allows partial responses to be retrieved. See
  76396. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  76397. // for more information.
  76398. func (c *RegionInstanceGroupManagersListManagedInstancesCall) Fields(s ...googleapi.Field) *RegionInstanceGroupManagersListManagedInstancesCall {
  76399. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  76400. return c
  76401. }
  76402. // Context sets the context to be used in this call's Do method. Any
  76403. // pending HTTP request will be aborted if the provided context is
  76404. // canceled.
  76405. func (c *RegionInstanceGroupManagersListManagedInstancesCall) Context(ctx context.Context) *RegionInstanceGroupManagersListManagedInstancesCall {
  76406. c.ctx_ = ctx
  76407. return c
  76408. }
  76409. // Header returns an http.Header that can be modified by the caller to
  76410. // add HTTP headers to the request.
  76411. func (c *RegionInstanceGroupManagersListManagedInstancesCall) Header() http.Header {
  76412. if c.header_ == nil {
  76413. c.header_ = make(http.Header)
  76414. }
  76415. return c.header_
  76416. }
  76417. func (c *RegionInstanceGroupManagersListManagedInstancesCall) doRequest(alt string) (*http.Response, error) {
  76418. reqHeaders := make(http.Header)
  76419. for k, v := range c.header_ {
  76420. reqHeaders[k] = v
  76421. }
  76422. reqHeaders.Set("User-Agent", c.s.userAgent())
  76423. var body io.Reader = nil
  76424. c.urlParams_.Set("alt", alt)
  76425. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/listManagedInstances")
  76426. urls += "?" + c.urlParams_.Encode()
  76427. req, _ := http.NewRequest("POST", urls, body)
  76428. req.Header = reqHeaders
  76429. googleapi.Expand(req.URL, map[string]string{
  76430. "project": c.project,
  76431. "region": c.region,
  76432. "instanceGroupManager": c.instanceGroupManager,
  76433. })
  76434. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  76435. }
  76436. // Do executes the "compute.regionInstanceGroupManagers.listManagedInstances" call.
  76437. // Exactly one of *RegionInstanceGroupManagersListInstancesResponse or
  76438. // error will be non-nil. Any non-2xx status code is an error. Response
  76439. // headers are in either
  76440. // *RegionInstanceGroupManagersListInstancesResponse.ServerResponse.Heade
  76441. // r or (if a response was returned at all) in
  76442. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  76443. // whether the returned error was because http.StatusNotModified was
  76444. // returned.
  76445. func (c *RegionInstanceGroupManagersListManagedInstancesCall) Do(opts ...googleapi.CallOption) (*RegionInstanceGroupManagersListInstancesResponse, error) {
  76446. gensupport.SetOptions(c.urlParams_, opts...)
  76447. res, err := c.doRequest("json")
  76448. if res != nil && res.StatusCode == http.StatusNotModified {
  76449. if res.Body != nil {
  76450. res.Body.Close()
  76451. }
  76452. return nil, &googleapi.Error{
  76453. Code: res.StatusCode,
  76454. Header: res.Header,
  76455. }
  76456. }
  76457. if err != nil {
  76458. return nil, err
  76459. }
  76460. defer googleapi.CloseBody(res)
  76461. if err := googleapi.CheckResponse(res); err != nil {
  76462. return nil, err
  76463. }
  76464. ret := &RegionInstanceGroupManagersListInstancesResponse{
  76465. ServerResponse: googleapi.ServerResponse{
  76466. Header: res.Header,
  76467. HTTPStatusCode: res.StatusCode,
  76468. },
  76469. }
  76470. target := &ret
  76471. if err := gensupport.DecodeResponse(target, res); err != nil {
  76472. return nil, err
  76473. }
  76474. return ret, nil
  76475. // {
  76476. // "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.",
  76477. // "httpMethod": "POST",
  76478. // "id": "compute.regionInstanceGroupManagers.listManagedInstances",
  76479. // "parameterOrder": [
  76480. // "project",
  76481. // "region",
  76482. // "instanceGroupManager"
  76483. // ],
  76484. // "parameters": {
  76485. // "filter": {
  76486. // "location": "query",
  76487. // "type": "string"
  76488. // },
  76489. // "instanceGroupManager": {
  76490. // "description": "The name of the managed instance group.",
  76491. // "location": "path",
  76492. // "required": true,
  76493. // "type": "string"
  76494. // },
  76495. // "maxResults": {
  76496. // "default": "500",
  76497. // "format": "uint32",
  76498. // "location": "query",
  76499. // "minimum": "0",
  76500. // "type": "integer"
  76501. // },
  76502. // "order_by": {
  76503. // "location": "query",
  76504. // "type": "string"
  76505. // },
  76506. // "pageToken": {
  76507. // "location": "query",
  76508. // "type": "string"
  76509. // },
  76510. // "project": {
  76511. // "description": "Project ID for this request.",
  76512. // "location": "path",
  76513. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  76514. // "required": true,
  76515. // "type": "string"
  76516. // },
  76517. // "region": {
  76518. // "description": "Name of the region scoping this request.",
  76519. // "location": "path",
  76520. // "required": true,
  76521. // "type": "string"
  76522. // }
  76523. // },
  76524. // "path": "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/listManagedInstances",
  76525. // "response": {
  76526. // "$ref": "RegionInstanceGroupManagersListInstancesResponse"
  76527. // },
  76528. // "scopes": [
  76529. // "https://www.googleapis.com/auth/cloud-platform",
  76530. // "https://www.googleapis.com/auth/compute",
  76531. // "https://www.googleapis.com/auth/compute.readonly"
  76532. // ]
  76533. // }
  76534. }
  76535. // Pages invokes f for each page of results.
  76536. // A non-nil error returned from f will halt the iteration.
  76537. // The provided context supersedes any context provided to the Context method.
  76538. func (c *RegionInstanceGroupManagersListManagedInstancesCall) Pages(ctx context.Context, f func(*RegionInstanceGroupManagersListInstancesResponse) error) error {
  76539. c.ctx_ = ctx
  76540. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  76541. for {
  76542. x, err := c.Do()
  76543. if err != nil {
  76544. return err
  76545. }
  76546. if err := f(x); err != nil {
  76547. return err
  76548. }
  76549. if x.NextPageToken == "" {
  76550. return nil
  76551. }
  76552. c.PageToken(x.NextPageToken)
  76553. }
  76554. }
  76555. // method id "compute.regionInstanceGroupManagers.patch":
  76556. type RegionInstanceGroupManagersPatchCall struct {
  76557. s *Service
  76558. project string
  76559. region string
  76560. instanceGroupManager string
  76561. instancegroupmanager *InstanceGroupManager
  76562. urlParams_ gensupport.URLParams
  76563. ctx_ context.Context
  76564. header_ http.Header
  76565. }
  76566. // Patch: Updates a managed instance group using the information that
  76567. // you specify in the request. This operation is marked as DONE when the
  76568. // group is patched even if the instances in the group are still in the
  76569. // process of being patched. You must separately verify the status of
  76570. // the individual instances with the listmanagedinstances method. This
  76571. // method supports PATCH semantics and uses the JSON merge patch format
  76572. // and processing rules.
  76573. func (r *RegionInstanceGroupManagersService) Patch(project string, region string, instanceGroupManager string, instancegroupmanager *InstanceGroupManager) *RegionInstanceGroupManagersPatchCall {
  76574. c := &RegionInstanceGroupManagersPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  76575. c.project = project
  76576. c.region = region
  76577. c.instanceGroupManager = instanceGroupManager
  76578. c.instancegroupmanager = instancegroupmanager
  76579. return c
  76580. }
  76581. // RequestId sets the optional parameter "requestId": An optional
  76582. // request ID to identify requests. Specify a unique request ID so that
  76583. // if you must retry your request, the server will know to ignore the
  76584. // request if it has already been completed.
  76585. //
  76586. // For example, consider a situation where you make an initial request
  76587. // and the request times out. If you make the request again with the
  76588. // same request ID, the server can check if original operation with the
  76589. // same request ID was received, and if so, will ignore the second
  76590. // request. This prevents clients from accidentally creating duplicate
  76591. // commitments.
  76592. //
  76593. // The request ID must be a valid UUID with the exception that zero UUID
  76594. // is not supported (00000000-0000-0000-0000-000000000000).
  76595. func (c *RegionInstanceGroupManagersPatchCall) RequestId(requestId string) *RegionInstanceGroupManagersPatchCall {
  76596. c.urlParams_.Set("requestId", requestId)
  76597. return c
  76598. }
  76599. // Fields allows partial responses to be retrieved. See
  76600. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  76601. // for more information.
  76602. func (c *RegionInstanceGroupManagersPatchCall) Fields(s ...googleapi.Field) *RegionInstanceGroupManagersPatchCall {
  76603. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  76604. return c
  76605. }
  76606. // Context sets the context to be used in this call's Do method. Any
  76607. // pending HTTP request will be aborted if the provided context is
  76608. // canceled.
  76609. func (c *RegionInstanceGroupManagersPatchCall) Context(ctx context.Context) *RegionInstanceGroupManagersPatchCall {
  76610. c.ctx_ = ctx
  76611. return c
  76612. }
  76613. // Header returns an http.Header that can be modified by the caller to
  76614. // add HTTP headers to the request.
  76615. func (c *RegionInstanceGroupManagersPatchCall) Header() http.Header {
  76616. if c.header_ == nil {
  76617. c.header_ = make(http.Header)
  76618. }
  76619. return c.header_
  76620. }
  76621. func (c *RegionInstanceGroupManagersPatchCall) doRequest(alt string) (*http.Response, error) {
  76622. reqHeaders := make(http.Header)
  76623. for k, v := range c.header_ {
  76624. reqHeaders[k] = v
  76625. }
  76626. reqHeaders.Set("User-Agent", c.s.userAgent())
  76627. var body io.Reader = nil
  76628. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupmanager)
  76629. if err != nil {
  76630. return nil, err
  76631. }
  76632. reqHeaders.Set("Content-Type", "application/json")
  76633. c.urlParams_.Set("alt", alt)
  76634. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}")
  76635. urls += "?" + c.urlParams_.Encode()
  76636. req, _ := http.NewRequest("PATCH", urls, body)
  76637. req.Header = reqHeaders
  76638. googleapi.Expand(req.URL, map[string]string{
  76639. "project": c.project,
  76640. "region": c.region,
  76641. "instanceGroupManager": c.instanceGroupManager,
  76642. })
  76643. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  76644. }
  76645. // Do executes the "compute.regionInstanceGroupManagers.patch" call.
  76646. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  76647. // status code is an error. Response headers are in either
  76648. // *Operation.ServerResponse.Header or (if a response was returned at
  76649. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  76650. // to check whether the returned error was because
  76651. // http.StatusNotModified was returned.
  76652. func (c *RegionInstanceGroupManagersPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  76653. gensupport.SetOptions(c.urlParams_, opts...)
  76654. res, err := c.doRequest("json")
  76655. if res != nil && res.StatusCode == http.StatusNotModified {
  76656. if res.Body != nil {
  76657. res.Body.Close()
  76658. }
  76659. return nil, &googleapi.Error{
  76660. Code: res.StatusCode,
  76661. Header: res.Header,
  76662. }
  76663. }
  76664. if err != nil {
  76665. return nil, err
  76666. }
  76667. defer googleapi.CloseBody(res)
  76668. if err := googleapi.CheckResponse(res); err != nil {
  76669. return nil, err
  76670. }
  76671. ret := &Operation{
  76672. ServerResponse: googleapi.ServerResponse{
  76673. Header: res.Header,
  76674. HTTPStatusCode: res.StatusCode,
  76675. },
  76676. }
  76677. target := &ret
  76678. if err := gensupport.DecodeResponse(target, res); err != nil {
  76679. return nil, err
  76680. }
  76681. return ret, nil
  76682. // {
  76683. // "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.",
  76684. // "httpMethod": "PATCH",
  76685. // "id": "compute.regionInstanceGroupManagers.patch",
  76686. // "parameterOrder": [
  76687. // "project",
  76688. // "region",
  76689. // "instanceGroupManager"
  76690. // ],
  76691. // "parameters": {
  76692. // "instanceGroupManager": {
  76693. // "description": "The name of the instance group manager.",
  76694. // "location": "path",
  76695. // "required": true,
  76696. // "type": "string"
  76697. // },
  76698. // "project": {
  76699. // "description": "Project ID for this request.",
  76700. // "location": "path",
  76701. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  76702. // "required": true,
  76703. // "type": "string"
  76704. // },
  76705. // "region": {
  76706. // "description": "Name of the region scoping this request.",
  76707. // "location": "path",
  76708. // "required": true,
  76709. // "type": "string"
  76710. // },
  76711. // "requestId": {
  76712. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  76713. // "location": "query",
  76714. // "type": "string"
  76715. // }
  76716. // },
  76717. // "path": "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}",
  76718. // "request": {
  76719. // "$ref": "InstanceGroupManager"
  76720. // },
  76721. // "response": {
  76722. // "$ref": "Operation"
  76723. // },
  76724. // "scopes": [
  76725. // "https://www.googleapis.com/auth/cloud-platform",
  76726. // "https://www.googleapis.com/auth/compute"
  76727. // ]
  76728. // }
  76729. }
  76730. // method id "compute.regionInstanceGroupManagers.recreateInstances":
  76731. type RegionInstanceGroupManagersRecreateInstancesCall struct {
  76732. s *Service
  76733. project string
  76734. region string
  76735. instanceGroupManager string
  76736. regioninstancegroupmanagersrecreaterequest *RegionInstanceGroupManagersRecreateRequest
  76737. urlParams_ gensupport.URLParams
  76738. ctx_ context.Context
  76739. header_ http.Header
  76740. }
  76741. // RecreateInstances: Schedules a group action to recreate the specified
  76742. // instances in the managed instance group. The instances are deleted
  76743. // and recreated using the current instance template for the managed
  76744. // instance group. This operation is marked as DONE when the action is
  76745. // scheduled even if the instances have not yet been recreated. You must
  76746. // separately verify the status of the recreating action with the
  76747. // listmanagedinstances method.
  76748. //
  76749. // If the group is part of a backend service that has enabled connection
  76750. // draining, it can take up to 60 seconds after the connection draining
  76751. // duration has elapsed before the VM instance is removed or
  76752. // deleted.
  76753. //
  76754. // You can specify a maximum of 1000 instances with this method per
  76755. // request.
  76756. func (r *RegionInstanceGroupManagersService) RecreateInstances(project string, region string, instanceGroupManager string, regioninstancegroupmanagersrecreaterequest *RegionInstanceGroupManagersRecreateRequest) *RegionInstanceGroupManagersRecreateInstancesCall {
  76757. c := &RegionInstanceGroupManagersRecreateInstancesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  76758. c.project = project
  76759. c.region = region
  76760. c.instanceGroupManager = instanceGroupManager
  76761. c.regioninstancegroupmanagersrecreaterequest = regioninstancegroupmanagersrecreaterequest
  76762. return c
  76763. }
  76764. // RequestId sets the optional parameter "requestId": An optional
  76765. // request ID to identify requests. Specify a unique request ID so that
  76766. // if you must retry your request, the server will know to ignore the
  76767. // request if it has already been completed.
  76768. //
  76769. // For example, consider a situation where you make an initial request
  76770. // and the request times out. If you make the request again with the
  76771. // same request ID, the server can check if original operation with the
  76772. // same request ID was received, and if so, will ignore the second
  76773. // request. This prevents clients from accidentally creating duplicate
  76774. // commitments.
  76775. //
  76776. // The request ID must be a valid UUID with the exception that zero UUID
  76777. // is not supported (00000000-0000-0000-0000-000000000000).
  76778. func (c *RegionInstanceGroupManagersRecreateInstancesCall) RequestId(requestId string) *RegionInstanceGroupManagersRecreateInstancesCall {
  76779. c.urlParams_.Set("requestId", requestId)
  76780. return c
  76781. }
  76782. // Fields allows partial responses to be retrieved. See
  76783. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  76784. // for more information.
  76785. func (c *RegionInstanceGroupManagersRecreateInstancesCall) Fields(s ...googleapi.Field) *RegionInstanceGroupManagersRecreateInstancesCall {
  76786. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  76787. return c
  76788. }
  76789. // Context sets the context to be used in this call's Do method. Any
  76790. // pending HTTP request will be aborted if the provided context is
  76791. // canceled.
  76792. func (c *RegionInstanceGroupManagersRecreateInstancesCall) Context(ctx context.Context) *RegionInstanceGroupManagersRecreateInstancesCall {
  76793. c.ctx_ = ctx
  76794. return c
  76795. }
  76796. // Header returns an http.Header that can be modified by the caller to
  76797. // add HTTP headers to the request.
  76798. func (c *RegionInstanceGroupManagersRecreateInstancesCall) Header() http.Header {
  76799. if c.header_ == nil {
  76800. c.header_ = make(http.Header)
  76801. }
  76802. return c.header_
  76803. }
  76804. func (c *RegionInstanceGroupManagersRecreateInstancesCall) doRequest(alt string) (*http.Response, error) {
  76805. reqHeaders := make(http.Header)
  76806. for k, v := range c.header_ {
  76807. reqHeaders[k] = v
  76808. }
  76809. reqHeaders.Set("User-Agent", c.s.userAgent())
  76810. var body io.Reader = nil
  76811. body, err := googleapi.WithoutDataWrapper.JSONReader(c.regioninstancegroupmanagersrecreaterequest)
  76812. if err != nil {
  76813. return nil, err
  76814. }
  76815. reqHeaders.Set("Content-Type", "application/json")
  76816. c.urlParams_.Set("alt", alt)
  76817. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/recreateInstances")
  76818. urls += "?" + c.urlParams_.Encode()
  76819. req, _ := http.NewRequest("POST", urls, body)
  76820. req.Header = reqHeaders
  76821. googleapi.Expand(req.URL, map[string]string{
  76822. "project": c.project,
  76823. "region": c.region,
  76824. "instanceGroupManager": c.instanceGroupManager,
  76825. })
  76826. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  76827. }
  76828. // Do executes the "compute.regionInstanceGroupManagers.recreateInstances" call.
  76829. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  76830. // status code is an error. Response headers are in either
  76831. // *Operation.ServerResponse.Header or (if a response was returned at
  76832. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  76833. // to check whether the returned error was because
  76834. // http.StatusNotModified was returned.
  76835. func (c *RegionInstanceGroupManagersRecreateInstancesCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  76836. gensupport.SetOptions(c.urlParams_, opts...)
  76837. res, err := c.doRequest("json")
  76838. if res != nil && res.StatusCode == http.StatusNotModified {
  76839. if res.Body != nil {
  76840. res.Body.Close()
  76841. }
  76842. return nil, &googleapi.Error{
  76843. Code: res.StatusCode,
  76844. Header: res.Header,
  76845. }
  76846. }
  76847. if err != nil {
  76848. return nil, err
  76849. }
  76850. defer googleapi.CloseBody(res)
  76851. if err := googleapi.CheckResponse(res); err != nil {
  76852. return nil, err
  76853. }
  76854. ret := &Operation{
  76855. ServerResponse: googleapi.ServerResponse{
  76856. Header: res.Header,
  76857. HTTPStatusCode: res.StatusCode,
  76858. },
  76859. }
  76860. target := &ret
  76861. if err := gensupport.DecodeResponse(target, res); err != nil {
  76862. return nil, err
  76863. }
  76864. return ret, nil
  76865. // {
  76866. // "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.",
  76867. // "httpMethod": "POST",
  76868. // "id": "compute.regionInstanceGroupManagers.recreateInstances",
  76869. // "parameterOrder": [
  76870. // "project",
  76871. // "region",
  76872. // "instanceGroupManager"
  76873. // ],
  76874. // "parameters": {
  76875. // "instanceGroupManager": {
  76876. // "description": "Name of the managed instance group.",
  76877. // "location": "path",
  76878. // "required": true,
  76879. // "type": "string"
  76880. // },
  76881. // "project": {
  76882. // "description": "Project ID for this request.",
  76883. // "location": "path",
  76884. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  76885. // "required": true,
  76886. // "type": "string"
  76887. // },
  76888. // "region": {
  76889. // "description": "Name of the region scoping this request.",
  76890. // "location": "path",
  76891. // "required": true,
  76892. // "type": "string"
  76893. // },
  76894. // "requestId": {
  76895. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  76896. // "location": "query",
  76897. // "type": "string"
  76898. // }
  76899. // },
  76900. // "path": "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/recreateInstances",
  76901. // "request": {
  76902. // "$ref": "RegionInstanceGroupManagersRecreateRequest"
  76903. // },
  76904. // "response": {
  76905. // "$ref": "Operation"
  76906. // },
  76907. // "scopes": [
  76908. // "https://www.googleapis.com/auth/cloud-platform",
  76909. // "https://www.googleapis.com/auth/compute"
  76910. // ]
  76911. // }
  76912. }
  76913. // method id "compute.regionInstanceGroupManagers.resize":
  76914. type RegionInstanceGroupManagersResizeCall struct {
  76915. s *Service
  76916. project string
  76917. region string
  76918. instanceGroupManager string
  76919. urlParams_ gensupport.URLParams
  76920. ctx_ context.Context
  76921. header_ http.Header
  76922. }
  76923. // Resize: Changes the intended size for the managed instance group. If
  76924. // you increase the size, the group schedules actions to create new
  76925. // instances using the current instance template. If you decrease the
  76926. // size, the group schedules delete actions on one or more instances.
  76927. // The resize operation is marked DONE when the resize actions are
  76928. // scheduled even if the group has not yet added or deleted any
  76929. // instances. You must separately verify the status of the creating or
  76930. // deleting actions with the listmanagedinstances method.
  76931. //
  76932. // If the group is part of a backend service that has enabled connection
  76933. // draining, it can take up to 60 seconds after the connection draining
  76934. // duration has elapsed before the VM instance is removed or deleted.
  76935. func (r *RegionInstanceGroupManagersService) Resize(project string, region string, instanceGroupManager string, size int64) *RegionInstanceGroupManagersResizeCall {
  76936. c := &RegionInstanceGroupManagersResizeCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  76937. c.project = project
  76938. c.region = region
  76939. c.instanceGroupManager = instanceGroupManager
  76940. c.urlParams_.Set("size", fmt.Sprint(size))
  76941. return c
  76942. }
  76943. // RequestId sets the optional parameter "requestId": An optional
  76944. // request ID to identify requests. Specify a unique request ID so that
  76945. // if you must retry your request, the server will know to ignore the
  76946. // request if it has already been completed.
  76947. //
  76948. // For example, consider a situation where you make an initial request
  76949. // and the request times out. If you make the request again with the
  76950. // same request ID, the server can check if original operation with the
  76951. // same request ID was received, and if so, will ignore the second
  76952. // request. This prevents clients from accidentally creating duplicate
  76953. // commitments.
  76954. //
  76955. // The request ID must be a valid UUID with the exception that zero UUID
  76956. // is not supported (00000000-0000-0000-0000-000000000000).
  76957. func (c *RegionInstanceGroupManagersResizeCall) RequestId(requestId string) *RegionInstanceGroupManagersResizeCall {
  76958. c.urlParams_.Set("requestId", requestId)
  76959. return c
  76960. }
  76961. // Fields allows partial responses to be retrieved. See
  76962. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  76963. // for more information.
  76964. func (c *RegionInstanceGroupManagersResizeCall) Fields(s ...googleapi.Field) *RegionInstanceGroupManagersResizeCall {
  76965. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  76966. return c
  76967. }
  76968. // Context sets the context to be used in this call's Do method. Any
  76969. // pending HTTP request will be aborted if the provided context is
  76970. // canceled.
  76971. func (c *RegionInstanceGroupManagersResizeCall) Context(ctx context.Context) *RegionInstanceGroupManagersResizeCall {
  76972. c.ctx_ = ctx
  76973. return c
  76974. }
  76975. // Header returns an http.Header that can be modified by the caller to
  76976. // add HTTP headers to the request.
  76977. func (c *RegionInstanceGroupManagersResizeCall) Header() http.Header {
  76978. if c.header_ == nil {
  76979. c.header_ = make(http.Header)
  76980. }
  76981. return c.header_
  76982. }
  76983. func (c *RegionInstanceGroupManagersResizeCall) doRequest(alt string) (*http.Response, error) {
  76984. reqHeaders := make(http.Header)
  76985. for k, v := range c.header_ {
  76986. reqHeaders[k] = v
  76987. }
  76988. reqHeaders.Set("User-Agent", c.s.userAgent())
  76989. var body io.Reader = nil
  76990. c.urlParams_.Set("alt", alt)
  76991. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/resize")
  76992. urls += "?" + c.urlParams_.Encode()
  76993. req, _ := http.NewRequest("POST", urls, body)
  76994. req.Header = reqHeaders
  76995. googleapi.Expand(req.URL, map[string]string{
  76996. "project": c.project,
  76997. "region": c.region,
  76998. "instanceGroupManager": c.instanceGroupManager,
  76999. })
  77000. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  77001. }
  77002. // Do executes the "compute.regionInstanceGroupManagers.resize" call.
  77003. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  77004. // status code is an error. Response headers are in either
  77005. // *Operation.ServerResponse.Header or (if a response was returned at
  77006. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  77007. // to check whether the returned error was because
  77008. // http.StatusNotModified was returned.
  77009. func (c *RegionInstanceGroupManagersResizeCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  77010. gensupport.SetOptions(c.urlParams_, opts...)
  77011. res, err := c.doRequest("json")
  77012. if res != nil && res.StatusCode == http.StatusNotModified {
  77013. if res.Body != nil {
  77014. res.Body.Close()
  77015. }
  77016. return nil, &googleapi.Error{
  77017. Code: res.StatusCode,
  77018. Header: res.Header,
  77019. }
  77020. }
  77021. if err != nil {
  77022. return nil, err
  77023. }
  77024. defer googleapi.CloseBody(res)
  77025. if err := googleapi.CheckResponse(res); err != nil {
  77026. return nil, err
  77027. }
  77028. ret := &Operation{
  77029. ServerResponse: googleapi.ServerResponse{
  77030. Header: res.Header,
  77031. HTTPStatusCode: res.StatusCode,
  77032. },
  77033. }
  77034. target := &ret
  77035. if err := gensupport.DecodeResponse(target, res); err != nil {
  77036. return nil, err
  77037. }
  77038. return ret, nil
  77039. // {
  77040. // "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.",
  77041. // "httpMethod": "POST",
  77042. // "id": "compute.regionInstanceGroupManagers.resize",
  77043. // "parameterOrder": [
  77044. // "project",
  77045. // "region",
  77046. // "instanceGroupManager",
  77047. // "size"
  77048. // ],
  77049. // "parameters": {
  77050. // "instanceGroupManager": {
  77051. // "description": "Name of the managed instance group.",
  77052. // "location": "path",
  77053. // "required": true,
  77054. // "type": "string"
  77055. // },
  77056. // "project": {
  77057. // "description": "Project ID for this request.",
  77058. // "location": "path",
  77059. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  77060. // "required": true,
  77061. // "type": "string"
  77062. // },
  77063. // "region": {
  77064. // "description": "Name of the region scoping this request.",
  77065. // "location": "path",
  77066. // "required": true,
  77067. // "type": "string"
  77068. // },
  77069. // "requestId": {
  77070. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  77071. // "location": "query",
  77072. // "type": "string"
  77073. // },
  77074. // "size": {
  77075. // "description": "Number of instances that should exist in this instance group manager.",
  77076. // "format": "int32",
  77077. // "location": "query",
  77078. // "minimum": "0",
  77079. // "required": true,
  77080. // "type": "integer"
  77081. // }
  77082. // },
  77083. // "path": "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/resize",
  77084. // "response": {
  77085. // "$ref": "Operation"
  77086. // },
  77087. // "scopes": [
  77088. // "https://www.googleapis.com/auth/cloud-platform",
  77089. // "https://www.googleapis.com/auth/compute"
  77090. // ]
  77091. // }
  77092. }
  77093. // method id "compute.regionInstanceGroupManagers.setAutoHealingPolicies":
  77094. type RegionInstanceGroupManagersSetAutoHealingPoliciesCall struct {
  77095. s *Service
  77096. project string
  77097. region string
  77098. instanceGroupManager string
  77099. regioninstancegroupmanagerssetautohealingrequest *RegionInstanceGroupManagersSetAutoHealingRequest
  77100. urlParams_ gensupport.URLParams
  77101. ctx_ context.Context
  77102. header_ http.Header
  77103. }
  77104. // SetAutoHealingPolicies: Modifies the autohealing policy for the
  77105. // instances in this managed instance group.
  77106. func (r *RegionInstanceGroupManagersService) SetAutoHealingPolicies(project string, region string, instanceGroupManager string, regioninstancegroupmanagerssetautohealingrequest *RegionInstanceGroupManagersSetAutoHealingRequest) *RegionInstanceGroupManagersSetAutoHealingPoliciesCall {
  77107. c := &RegionInstanceGroupManagersSetAutoHealingPoliciesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  77108. c.project = project
  77109. c.region = region
  77110. c.instanceGroupManager = instanceGroupManager
  77111. c.regioninstancegroupmanagerssetautohealingrequest = regioninstancegroupmanagerssetautohealingrequest
  77112. return c
  77113. }
  77114. // RequestId sets the optional parameter "requestId": An optional
  77115. // request ID to identify requests. Specify a unique request ID so that
  77116. // if you must retry your request, the server will know to ignore the
  77117. // request if it has already been completed.
  77118. //
  77119. // For example, consider a situation where you make an initial request
  77120. // and the request times out. If you make the request again with the
  77121. // same request ID, the server can check if original operation with the
  77122. // same request ID was received, and if so, will ignore the second
  77123. // request. This prevents clients from accidentally creating duplicate
  77124. // commitments.
  77125. //
  77126. // The request ID must be a valid UUID with the exception that zero UUID
  77127. // is not supported (00000000-0000-0000-0000-000000000000).
  77128. func (c *RegionInstanceGroupManagersSetAutoHealingPoliciesCall) RequestId(requestId string) *RegionInstanceGroupManagersSetAutoHealingPoliciesCall {
  77129. c.urlParams_.Set("requestId", requestId)
  77130. return c
  77131. }
  77132. // Fields allows partial responses to be retrieved. See
  77133. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  77134. // for more information.
  77135. func (c *RegionInstanceGroupManagersSetAutoHealingPoliciesCall) Fields(s ...googleapi.Field) *RegionInstanceGroupManagersSetAutoHealingPoliciesCall {
  77136. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  77137. return c
  77138. }
  77139. // Context sets the context to be used in this call's Do method. Any
  77140. // pending HTTP request will be aborted if the provided context is
  77141. // canceled.
  77142. func (c *RegionInstanceGroupManagersSetAutoHealingPoliciesCall) Context(ctx context.Context) *RegionInstanceGroupManagersSetAutoHealingPoliciesCall {
  77143. c.ctx_ = ctx
  77144. return c
  77145. }
  77146. // Header returns an http.Header that can be modified by the caller to
  77147. // add HTTP headers to the request.
  77148. func (c *RegionInstanceGroupManagersSetAutoHealingPoliciesCall) Header() http.Header {
  77149. if c.header_ == nil {
  77150. c.header_ = make(http.Header)
  77151. }
  77152. return c.header_
  77153. }
  77154. func (c *RegionInstanceGroupManagersSetAutoHealingPoliciesCall) doRequest(alt string) (*http.Response, error) {
  77155. reqHeaders := make(http.Header)
  77156. for k, v := range c.header_ {
  77157. reqHeaders[k] = v
  77158. }
  77159. reqHeaders.Set("User-Agent", c.s.userAgent())
  77160. var body io.Reader = nil
  77161. body, err := googleapi.WithoutDataWrapper.JSONReader(c.regioninstancegroupmanagerssetautohealingrequest)
  77162. if err != nil {
  77163. return nil, err
  77164. }
  77165. reqHeaders.Set("Content-Type", "application/json")
  77166. c.urlParams_.Set("alt", alt)
  77167. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/setAutoHealingPolicies")
  77168. urls += "?" + c.urlParams_.Encode()
  77169. req, _ := http.NewRequest("POST", urls, body)
  77170. req.Header = reqHeaders
  77171. googleapi.Expand(req.URL, map[string]string{
  77172. "project": c.project,
  77173. "region": c.region,
  77174. "instanceGroupManager": c.instanceGroupManager,
  77175. })
  77176. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  77177. }
  77178. // Do executes the "compute.regionInstanceGroupManagers.setAutoHealingPolicies" call.
  77179. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  77180. // status code is an error. Response headers are in either
  77181. // *Operation.ServerResponse.Header or (if a response was returned at
  77182. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  77183. // to check whether the returned error was because
  77184. // http.StatusNotModified was returned.
  77185. func (c *RegionInstanceGroupManagersSetAutoHealingPoliciesCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  77186. gensupport.SetOptions(c.urlParams_, opts...)
  77187. res, err := c.doRequest("json")
  77188. if res != nil && res.StatusCode == http.StatusNotModified {
  77189. if res.Body != nil {
  77190. res.Body.Close()
  77191. }
  77192. return nil, &googleapi.Error{
  77193. Code: res.StatusCode,
  77194. Header: res.Header,
  77195. }
  77196. }
  77197. if err != nil {
  77198. return nil, err
  77199. }
  77200. defer googleapi.CloseBody(res)
  77201. if err := googleapi.CheckResponse(res); err != nil {
  77202. return nil, err
  77203. }
  77204. ret := &Operation{
  77205. ServerResponse: googleapi.ServerResponse{
  77206. Header: res.Header,
  77207. HTTPStatusCode: res.StatusCode,
  77208. },
  77209. }
  77210. target := &ret
  77211. if err := gensupport.DecodeResponse(target, res); err != nil {
  77212. return nil, err
  77213. }
  77214. return ret, nil
  77215. // {
  77216. // "description": "Modifies the autohealing policy for the instances in this managed instance group.",
  77217. // "httpMethod": "POST",
  77218. // "id": "compute.regionInstanceGroupManagers.setAutoHealingPolicies",
  77219. // "parameterOrder": [
  77220. // "project",
  77221. // "region",
  77222. // "instanceGroupManager"
  77223. // ],
  77224. // "parameters": {
  77225. // "instanceGroupManager": {
  77226. // "description": "Name of the managed instance group.",
  77227. // "location": "path",
  77228. // "required": true,
  77229. // "type": "string"
  77230. // },
  77231. // "project": {
  77232. // "description": "Project ID for this request.",
  77233. // "location": "path",
  77234. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  77235. // "required": true,
  77236. // "type": "string"
  77237. // },
  77238. // "region": {
  77239. // "description": "Name of the region scoping this request.",
  77240. // "location": "path",
  77241. // "required": true,
  77242. // "type": "string"
  77243. // },
  77244. // "requestId": {
  77245. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  77246. // "location": "query",
  77247. // "type": "string"
  77248. // }
  77249. // },
  77250. // "path": "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/setAutoHealingPolicies",
  77251. // "request": {
  77252. // "$ref": "RegionInstanceGroupManagersSetAutoHealingRequest"
  77253. // },
  77254. // "response": {
  77255. // "$ref": "Operation"
  77256. // },
  77257. // "scopes": [
  77258. // "https://www.googleapis.com/auth/cloud-platform",
  77259. // "https://www.googleapis.com/auth/compute"
  77260. // ]
  77261. // }
  77262. }
  77263. // method id "compute.regionInstanceGroupManagers.setInstanceTemplate":
  77264. type RegionInstanceGroupManagersSetInstanceTemplateCall struct {
  77265. s *Service
  77266. project string
  77267. region string
  77268. instanceGroupManager string
  77269. regioninstancegroupmanagerssettemplaterequest *RegionInstanceGroupManagersSetTemplateRequest
  77270. urlParams_ gensupport.URLParams
  77271. ctx_ context.Context
  77272. header_ http.Header
  77273. }
  77274. // SetInstanceTemplate: Sets the instance template to use when creating
  77275. // new instances or recreating instances in this group. Existing
  77276. // instances are not affected.
  77277. func (r *RegionInstanceGroupManagersService) SetInstanceTemplate(project string, region string, instanceGroupManager string, regioninstancegroupmanagerssettemplaterequest *RegionInstanceGroupManagersSetTemplateRequest) *RegionInstanceGroupManagersSetInstanceTemplateCall {
  77278. c := &RegionInstanceGroupManagersSetInstanceTemplateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  77279. c.project = project
  77280. c.region = region
  77281. c.instanceGroupManager = instanceGroupManager
  77282. c.regioninstancegroupmanagerssettemplaterequest = regioninstancegroupmanagerssettemplaterequest
  77283. return c
  77284. }
  77285. // RequestId sets the optional parameter "requestId": An optional
  77286. // request ID to identify requests. Specify a unique request ID so that
  77287. // if you must retry your request, the server will know to ignore the
  77288. // request if it has already been completed.
  77289. //
  77290. // For example, consider a situation where you make an initial request
  77291. // and the request times out. If you make the request again with the
  77292. // same request ID, the server can check if original operation with the
  77293. // same request ID was received, and if so, will ignore the second
  77294. // request. This prevents clients from accidentally creating duplicate
  77295. // commitments.
  77296. //
  77297. // The request ID must be a valid UUID with the exception that zero UUID
  77298. // is not supported (00000000-0000-0000-0000-000000000000).
  77299. func (c *RegionInstanceGroupManagersSetInstanceTemplateCall) RequestId(requestId string) *RegionInstanceGroupManagersSetInstanceTemplateCall {
  77300. c.urlParams_.Set("requestId", requestId)
  77301. return c
  77302. }
  77303. // Fields allows partial responses to be retrieved. See
  77304. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  77305. // for more information.
  77306. func (c *RegionInstanceGroupManagersSetInstanceTemplateCall) Fields(s ...googleapi.Field) *RegionInstanceGroupManagersSetInstanceTemplateCall {
  77307. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  77308. return c
  77309. }
  77310. // Context sets the context to be used in this call's Do method. Any
  77311. // pending HTTP request will be aborted if the provided context is
  77312. // canceled.
  77313. func (c *RegionInstanceGroupManagersSetInstanceTemplateCall) Context(ctx context.Context) *RegionInstanceGroupManagersSetInstanceTemplateCall {
  77314. c.ctx_ = ctx
  77315. return c
  77316. }
  77317. // Header returns an http.Header that can be modified by the caller to
  77318. // add HTTP headers to the request.
  77319. func (c *RegionInstanceGroupManagersSetInstanceTemplateCall) Header() http.Header {
  77320. if c.header_ == nil {
  77321. c.header_ = make(http.Header)
  77322. }
  77323. return c.header_
  77324. }
  77325. func (c *RegionInstanceGroupManagersSetInstanceTemplateCall) doRequest(alt string) (*http.Response, error) {
  77326. reqHeaders := make(http.Header)
  77327. for k, v := range c.header_ {
  77328. reqHeaders[k] = v
  77329. }
  77330. reqHeaders.Set("User-Agent", c.s.userAgent())
  77331. var body io.Reader = nil
  77332. body, err := googleapi.WithoutDataWrapper.JSONReader(c.regioninstancegroupmanagerssettemplaterequest)
  77333. if err != nil {
  77334. return nil, err
  77335. }
  77336. reqHeaders.Set("Content-Type", "application/json")
  77337. c.urlParams_.Set("alt", alt)
  77338. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/setInstanceTemplate")
  77339. urls += "?" + c.urlParams_.Encode()
  77340. req, _ := http.NewRequest("POST", urls, body)
  77341. req.Header = reqHeaders
  77342. googleapi.Expand(req.URL, map[string]string{
  77343. "project": c.project,
  77344. "region": c.region,
  77345. "instanceGroupManager": c.instanceGroupManager,
  77346. })
  77347. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  77348. }
  77349. // Do executes the "compute.regionInstanceGroupManagers.setInstanceTemplate" call.
  77350. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  77351. // status code is an error. Response headers are in either
  77352. // *Operation.ServerResponse.Header or (if a response was returned at
  77353. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  77354. // to check whether the returned error was because
  77355. // http.StatusNotModified was returned.
  77356. func (c *RegionInstanceGroupManagersSetInstanceTemplateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  77357. gensupport.SetOptions(c.urlParams_, opts...)
  77358. res, err := c.doRequest("json")
  77359. if res != nil && res.StatusCode == http.StatusNotModified {
  77360. if res.Body != nil {
  77361. res.Body.Close()
  77362. }
  77363. return nil, &googleapi.Error{
  77364. Code: res.StatusCode,
  77365. Header: res.Header,
  77366. }
  77367. }
  77368. if err != nil {
  77369. return nil, err
  77370. }
  77371. defer googleapi.CloseBody(res)
  77372. if err := googleapi.CheckResponse(res); err != nil {
  77373. return nil, err
  77374. }
  77375. ret := &Operation{
  77376. ServerResponse: googleapi.ServerResponse{
  77377. Header: res.Header,
  77378. HTTPStatusCode: res.StatusCode,
  77379. },
  77380. }
  77381. target := &ret
  77382. if err := gensupport.DecodeResponse(target, res); err != nil {
  77383. return nil, err
  77384. }
  77385. return ret, nil
  77386. // {
  77387. // "description": "Sets the instance template to use when creating new instances or recreating instances in this group. Existing instances are not affected.",
  77388. // "httpMethod": "POST",
  77389. // "id": "compute.regionInstanceGroupManagers.setInstanceTemplate",
  77390. // "parameterOrder": [
  77391. // "project",
  77392. // "region",
  77393. // "instanceGroupManager"
  77394. // ],
  77395. // "parameters": {
  77396. // "instanceGroupManager": {
  77397. // "description": "The name of the managed instance group.",
  77398. // "location": "path",
  77399. // "required": true,
  77400. // "type": "string"
  77401. // },
  77402. // "project": {
  77403. // "description": "Project ID for this request.",
  77404. // "location": "path",
  77405. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  77406. // "required": true,
  77407. // "type": "string"
  77408. // },
  77409. // "region": {
  77410. // "description": "Name of the region scoping this request.",
  77411. // "location": "path",
  77412. // "required": true,
  77413. // "type": "string"
  77414. // },
  77415. // "requestId": {
  77416. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  77417. // "location": "query",
  77418. // "type": "string"
  77419. // }
  77420. // },
  77421. // "path": "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/setInstanceTemplate",
  77422. // "request": {
  77423. // "$ref": "RegionInstanceGroupManagersSetTemplateRequest"
  77424. // },
  77425. // "response": {
  77426. // "$ref": "Operation"
  77427. // },
  77428. // "scopes": [
  77429. // "https://www.googleapis.com/auth/cloud-platform",
  77430. // "https://www.googleapis.com/auth/compute"
  77431. // ]
  77432. // }
  77433. }
  77434. // method id "compute.regionInstanceGroupManagers.setTargetPools":
  77435. type RegionInstanceGroupManagersSetTargetPoolsCall struct {
  77436. s *Service
  77437. project string
  77438. region string
  77439. instanceGroupManager string
  77440. regioninstancegroupmanagerssettargetpoolsrequest *RegionInstanceGroupManagersSetTargetPoolsRequest
  77441. urlParams_ gensupport.URLParams
  77442. ctx_ context.Context
  77443. header_ http.Header
  77444. }
  77445. // SetTargetPools: Modifies the target pools to which all new instances
  77446. // in this group are assigned. Existing instances in the group are not
  77447. // affected.
  77448. func (r *RegionInstanceGroupManagersService) SetTargetPools(project string, region string, instanceGroupManager string, regioninstancegroupmanagerssettargetpoolsrequest *RegionInstanceGroupManagersSetTargetPoolsRequest) *RegionInstanceGroupManagersSetTargetPoolsCall {
  77449. c := &RegionInstanceGroupManagersSetTargetPoolsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  77450. c.project = project
  77451. c.region = region
  77452. c.instanceGroupManager = instanceGroupManager
  77453. c.regioninstancegroupmanagerssettargetpoolsrequest = regioninstancegroupmanagerssettargetpoolsrequest
  77454. return c
  77455. }
  77456. // RequestId sets the optional parameter "requestId": An optional
  77457. // request ID to identify requests. Specify a unique request ID so that
  77458. // if you must retry your request, the server will know to ignore the
  77459. // request if it has already been completed.
  77460. //
  77461. // For example, consider a situation where you make an initial request
  77462. // and the request times out. If you make the request again with the
  77463. // same request ID, the server can check if original operation with the
  77464. // same request ID was received, and if so, will ignore the second
  77465. // request. This prevents clients from accidentally creating duplicate
  77466. // commitments.
  77467. //
  77468. // The request ID must be a valid UUID with the exception that zero UUID
  77469. // is not supported (00000000-0000-0000-0000-000000000000).
  77470. func (c *RegionInstanceGroupManagersSetTargetPoolsCall) RequestId(requestId string) *RegionInstanceGroupManagersSetTargetPoolsCall {
  77471. c.urlParams_.Set("requestId", requestId)
  77472. return c
  77473. }
  77474. // Fields allows partial responses to be retrieved. See
  77475. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  77476. // for more information.
  77477. func (c *RegionInstanceGroupManagersSetTargetPoolsCall) Fields(s ...googleapi.Field) *RegionInstanceGroupManagersSetTargetPoolsCall {
  77478. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  77479. return c
  77480. }
  77481. // Context sets the context to be used in this call's Do method. Any
  77482. // pending HTTP request will be aborted if the provided context is
  77483. // canceled.
  77484. func (c *RegionInstanceGroupManagersSetTargetPoolsCall) Context(ctx context.Context) *RegionInstanceGroupManagersSetTargetPoolsCall {
  77485. c.ctx_ = ctx
  77486. return c
  77487. }
  77488. // Header returns an http.Header that can be modified by the caller to
  77489. // add HTTP headers to the request.
  77490. func (c *RegionInstanceGroupManagersSetTargetPoolsCall) Header() http.Header {
  77491. if c.header_ == nil {
  77492. c.header_ = make(http.Header)
  77493. }
  77494. return c.header_
  77495. }
  77496. func (c *RegionInstanceGroupManagersSetTargetPoolsCall) doRequest(alt string) (*http.Response, error) {
  77497. reqHeaders := make(http.Header)
  77498. for k, v := range c.header_ {
  77499. reqHeaders[k] = v
  77500. }
  77501. reqHeaders.Set("User-Agent", c.s.userAgent())
  77502. var body io.Reader = nil
  77503. body, err := googleapi.WithoutDataWrapper.JSONReader(c.regioninstancegroupmanagerssettargetpoolsrequest)
  77504. if err != nil {
  77505. return nil, err
  77506. }
  77507. reqHeaders.Set("Content-Type", "application/json")
  77508. c.urlParams_.Set("alt", alt)
  77509. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/setTargetPools")
  77510. urls += "?" + c.urlParams_.Encode()
  77511. req, _ := http.NewRequest("POST", urls, body)
  77512. req.Header = reqHeaders
  77513. googleapi.Expand(req.URL, map[string]string{
  77514. "project": c.project,
  77515. "region": c.region,
  77516. "instanceGroupManager": c.instanceGroupManager,
  77517. })
  77518. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  77519. }
  77520. // Do executes the "compute.regionInstanceGroupManagers.setTargetPools" call.
  77521. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  77522. // status code is an error. Response headers are in either
  77523. // *Operation.ServerResponse.Header or (if a response was returned at
  77524. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  77525. // to check whether the returned error was because
  77526. // http.StatusNotModified was returned.
  77527. func (c *RegionInstanceGroupManagersSetTargetPoolsCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  77528. gensupport.SetOptions(c.urlParams_, opts...)
  77529. res, err := c.doRequest("json")
  77530. if res != nil && res.StatusCode == http.StatusNotModified {
  77531. if res.Body != nil {
  77532. res.Body.Close()
  77533. }
  77534. return nil, &googleapi.Error{
  77535. Code: res.StatusCode,
  77536. Header: res.Header,
  77537. }
  77538. }
  77539. if err != nil {
  77540. return nil, err
  77541. }
  77542. defer googleapi.CloseBody(res)
  77543. if err := googleapi.CheckResponse(res); err != nil {
  77544. return nil, err
  77545. }
  77546. ret := &Operation{
  77547. ServerResponse: googleapi.ServerResponse{
  77548. Header: res.Header,
  77549. HTTPStatusCode: res.StatusCode,
  77550. },
  77551. }
  77552. target := &ret
  77553. if err := gensupport.DecodeResponse(target, res); err != nil {
  77554. return nil, err
  77555. }
  77556. return ret, nil
  77557. // {
  77558. // "description": "Modifies the target pools to which all new instances in this group are assigned. Existing instances in the group are not affected.",
  77559. // "httpMethod": "POST",
  77560. // "id": "compute.regionInstanceGroupManagers.setTargetPools",
  77561. // "parameterOrder": [
  77562. // "project",
  77563. // "region",
  77564. // "instanceGroupManager"
  77565. // ],
  77566. // "parameters": {
  77567. // "instanceGroupManager": {
  77568. // "description": "Name of the managed instance group.",
  77569. // "location": "path",
  77570. // "required": true,
  77571. // "type": "string"
  77572. // },
  77573. // "project": {
  77574. // "description": "Project ID for this request.",
  77575. // "location": "path",
  77576. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  77577. // "required": true,
  77578. // "type": "string"
  77579. // },
  77580. // "region": {
  77581. // "description": "Name of the region scoping this request.",
  77582. // "location": "path",
  77583. // "required": true,
  77584. // "type": "string"
  77585. // },
  77586. // "requestId": {
  77587. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  77588. // "location": "query",
  77589. // "type": "string"
  77590. // }
  77591. // },
  77592. // "path": "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/setTargetPools",
  77593. // "request": {
  77594. // "$ref": "RegionInstanceGroupManagersSetTargetPoolsRequest"
  77595. // },
  77596. // "response": {
  77597. // "$ref": "Operation"
  77598. // },
  77599. // "scopes": [
  77600. // "https://www.googleapis.com/auth/cloud-platform",
  77601. // "https://www.googleapis.com/auth/compute"
  77602. // ]
  77603. // }
  77604. }
  77605. // method id "compute.regionInstanceGroupManagers.testIamPermissions":
  77606. type RegionInstanceGroupManagersTestIamPermissionsCall struct {
  77607. s *Service
  77608. project string
  77609. region string
  77610. resource string
  77611. testpermissionsrequest *TestPermissionsRequest
  77612. urlParams_ gensupport.URLParams
  77613. ctx_ context.Context
  77614. header_ http.Header
  77615. }
  77616. // TestIamPermissions: Returns permissions that a caller has on the
  77617. // specified resource.
  77618. func (r *RegionInstanceGroupManagersService) TestIamPermissions(project string, region string, resource string, testpermissionsrequest *TestPermissionsRequest) *RegionInstanceGroupManagersTestIamPermissionsCall {
  77619. c := &RegionInstanceGroupManagersTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  77620. c.project = project
  77621. c.region = region
  77622. c.resource = resource
  77623. c.testpermissionsrequest = testpermissionsrequest
  77624. return c
  77625. }
  77626. // Fields allows partial responses to be retrieved. See
  77627. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  77628. // for more information.
  77629. func (c *RegionInstanceGroupManagersTestIamPermissionsCall) Fields(s ...googleapi.Field) *RegionInstanceGroupManagersTestIamPermissionsCall {
  77630. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  77631. return c
  77632. }
  77633. // Context sets the context to be used in this call's Do method. Any
  77634. // pending HTTP request will be aborted if the provided context is
  77635. // canceled.
  77636. func (c *RegionInstanceGroupManagersTestIamPermissionsCall) Context(ctx context.Context) *RegionInstanceGroupManagersTestIamPermissionsCall {
  77637. c.ctx_ = ctx
  77638. return c
  77639. }
  77640. // Header returns an http.Header that can be modified by the caller to
  77641. // add HTTP headers to the request.
  77642. func (c *RegionInstanceGroupManagersTestIamPermissionsCall) Header() http.Header {
  77643. if c.header_ == nil {
  77644. c.header_ = make(http.Header)
  77645. }
  77646. return c.header_
  77647. }
  77648. func (c *RegionInstanceGroupManagersTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  77649. reqHeaders := make(http.Header)
  77650. for k, v := range c.header_ {
  77651. reqHeaders[k] = v
  77652. }
  77653. reqHeaders.Set("User-Agent", c.s.userAgent())
  77654. var body io.Reader = nil
  77655. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  77656. if err != nil {
  77657. return nil, err
  77658. }
  77659. reqHeaders.Set("Content-Type", "application/json")
  77660. c.urlParams_.Set("alt", alt)
  77661. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/instanceGroupManagers/{resource}/testIamPermissions")
  77662. urls += "?" + c.urlParams_.Encode()
  77663. req, _ := http.NewRequest("POST", urls, body)
  77664. req.Header = reqHeaders
  77665. googleapi.Expand(req.URL, map[string]string{
  77666. "project": c.project,
  77667. "region": c.region,
  77668. "resource": c.resource,
  77669. })
  77670. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  77671. }
  77672. // Do executes the "compute.regionInstanceGroupManagers.testIamPermissions" call.
  77673. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  77674. // non-2xx status code is an error. Response headers are in either
  77675. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  77676. // returned at all) in error.(*googleapi.Error).Header. Use
  77677. // googleapi.IsNotModified to check whether the returned error was
  77678. // because http.StatusNotModified was returned.
  77679. func (c *RegionInstanceGroupManagersTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  77680. gensupport.SetOptions(c.urlParams_, opts...)
  77681. res, err := c.doRequest("json")
  77682. if res != nil && res.StatusCode == http.StatusNotModified {
  77683. if res.Body != nil {
  77684. res.Body.Close()
  77685. }
  77686. return nil, &googleapi.Error{
  77687. Code: res.StatusCode,
  77688. Header: res.Header,
  77689. }
  77690. }
  77691. if err != nil {
  77692. return nil, err
  77693. }
  77694. defer googleapi.CloseBody(res)
  77695. if err := googleapi.CheckResponse(res); err != nil {
  77696. return nil, err
  77697. }
  77698. ret := &TestPermissionsResponse{
  77699. ServerResponse: googleapi.ServerResponse{
  77700. Header: res.Header,
  77701. HTTPStatusCode: res.StatusCode,
  77702. },
  77703. }
  77704. target := &ret
  77705. if err := gensupport.DecodeResponse(target, res); err != nil {
  77706. return nil, err
  77707. }
  77708. return ret, nil
  77709. // {
  77710. // "description": "Returns permissions that a caller has on the specified resource.",
  77711. // "httpMethod": "POST",
  77712. // "id": "compute.regionInstanceGroupManagers.testIamPermissions",
  77713. // "parameterOrder": [
  77714. // "project",
  77715. // "region",
  77716. // "resource"
  77717. // ],
  77718. // "parameters": {
  77719. // "project": {
  77720. // "description": "Project ID for this request.",
  77721. // "location": "path",
  77722. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  77723. // "required": true,
  77724. // "type": "string"
  77725. // },
  77726. // "region": {
  77727. // "description": "The name of the region for this request.",
  77728. // "location": "path",
  77729. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  77730. // "required": true,
  77731. // "type": "string"
  77732. // },
  77733. // "resource": {
  77734. // "description": "Name of the resource for this request.",
  77735. // "location": "path",
  77736. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  77737. // "required": true,
  77738. // "type": "string"
  77739. // }
  77740. // },
  77741. // "path": "{project}/regions/{region}/instanceGroupManagers/{resource}/testIamPermissions",
  77742. // "request": {
  77743. // "$ref": "TestPermissionsRequest"
  77744. // },
  77745. // "response": {
  77746. // "$ref": "TestPermissionsResponse"
  77747. // },
  77748. // "scopes": [
  77749. // "https://www.googleapis.com/auth/cloud-platform",
  77750. // "https://www.googleapis.com/auth/compute",
  77751. // "https://www.googleapis.com/auth/compute.readonly"
  77752. // ]
  77753. // }
  77754. }
  77755. // method id "compute.regionInstanceGroupManagers.update":
  77756. type RegionInstanceGroupManagersUpdateCall struct {
  77757. s *Service
  77758. project string
  77759. region string
  77760. instanceGroupManager string
  77761. instancegroupmanager *InstanceGroupManager
  77762. urlParams_ gensupport.URLParams
  77763. ctx_ context.Context
  77764. header_ http.Header
  77765. }
  77766. // Update: Updates a managed instance group using the information that
  77767. // you specify in the request. This operation is marked as DONE when the
  77768. // group is updated even if the instances in the group have not yet been
  77769. // updated. You must separately verify the status of the individual
  77770. // instances with the listmanagedinstances method.
  77771. func (r *RegionInstanceGroupManagersService) Update(project string, region string, instanceGroupManager string, instancegroupmanager *InstanceGroupManager) *RegionInstanceGroupManagersUpdateCall {
  77772. c := &RegionInstanceGroupManagersUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  77773. c.project = project
  77774. c.region = region
  77775. c.instanceGroupManager = instanceGroupManager
  77776. c.instancegroupmanager = instancegroupmanager
  77777. return c
  77778. }
  77779. // RequestId sets the optional parameter "requestId": An optional
  77780. // request ID to identify requests. Specify a unique request ID so that
  77781. // if you must retry your request, the server will know to ignore the
  77782. // request if it has already been completed.
  77783. //
  77784. // For example, consider a situation where you make an initial request
  77785. // and the request times out. If you make the request again with the
  77786. // same request ID, the server can check if original operation with the
  77787. // same request ID was received, and if so, will ignore the second
  77788. // request. This prevents clients from accidentally creating duplicate
  77789. // commitments.
  77790. //
  77791. // The request ID must be a valid UUID with the exception that zero UUID
  77792. // is not supported (00000000-0000-0000-0000-000000000000).
  77793. func (c *RegionInstanceGroupManagersUpdateCall) RequestId(requestId string) *RegionInstanceGroupManagersUpdateCall {
  77794. c.urlParams_.Set("requestId", requestId)
  77795. return c
  77796. }
  77797. // Fields allows partial responses to be retrieved. See
  77798. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  77799. // for more information.
  77800. func (c *RegionInstanceGroupManagersUpdateCall) Fields(s ...googleapi.Field) *RegionInstanceGroupManagersUpdateCall {
  77801. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  77802. return c
  77803. }
  77804. // Context sets the context to be used in this call's Do method. Any
  77805. // pending HTTP request will be aborted if the provided context is
  77806. // canceled.
  77807. func (c *RegionInstanceGroupManagersUpdateCall) Context(ctx context.Context) *RegionInstanceGroupManagersUpdateCall {
  77808. c.ctx_ = ctx
  77809. return c
  77810. }
  77811. // Header returns an http.Header that can be modified by the caller to
  77812. // add HTTP headers to the request.
  77813. func (c *RegionInstanceGroupManagersUpdateCall) Header() http.Header {
  77814. if c.header_ == nil {
  77815. c.header_ = make(http.Header)
  77816. }
  77817. return c.header_
  77818. }
  77819. func (c *RegionInstanceGroupManagersUpdateCall) doRequest(alt string) (*http.Response, error) {
  77820. reqHeaders := make(http.Header)
  77821. for k, v := range c.header_ {
  77822. reqHeaders[k] = v
  77823. }
  77824. reqHeaders.Set("User-Agent", c.s.userAgent())
  77825. var body io.Reader = nil
  77826. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupmanager)
  77827. if err != nil {
  77828. return nil, err
  77829. }
  77830. reqHeaders.Set("Content-Type", "application/json")
  77831. c.urlParams_.Set("alt", alt)
  77832. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}")
  77833. urls += "?" + c.urlParams_.Encode()
  77834. req, _ := http.NewRequest("PUT", urls, body)
  77835. req.Header = reqHeaders
  77836. googleapi.Expand(req.URL, map[string]string{
  77837. "project": c.project,
  77838. "region": c.region,
  77839. "instanceGroupManager": c.instanceGroupManager,
  77840. })
  77841. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  77842. }
  77843. // Do executes the "compute.regionInstanceGroupManagers.update" call.
  77844. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  77845. // status code is an error. Response headers are in either
  77846. // *Operation.ServerResponse.Header or (if a response was returned at
  77847. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  77848. // to check whether the returned error was because
  77849. // http.StatusNotModified was returned.
  77850. func (c *RegionInstanceGroupManagersUpdateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  77851. gensupport.SetOptions(c.urlParams_, opts...)
  77852. res, err := c.doRequest("json")
  77853. if res != nil && res.StatusCode == http.StatusNotModified {
  77854. if res.Body != nil {
  77855. res.Body.Close()
  77856. }
  77857. return nil, &googleapi.Error{
  77858. Code: res.StatusCode,
  77859. Header: res.Header,
  77860. }
  77861. }
  77862. if err != nil {
  77863. return nil, err
  77864. }
  77865. defer googleapi.CloseBody(res)
  77866. if err := googleapi.CheckResponse(res); err != nil {
  77867. return nil, err
  77868. }
  77869. ret := &Operation{
  77870. ServerResponse: googleapi.ServerResponse{
  77871. Header: res.Header,
  77872. HTTPStatusCode: res.StatusCode,
  77873. },
  77874. }
  77875. target := &ret
  77876. if err := gensupport.DecodeResponse(target, res); err != nil {
  77877. return nil, err
  77878. }
  77879. return ret, nil
  77880. // {
  77881. // "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.",
  77882. // "httpMethod": "PUT",
  77883. // "id": "compute.regionInstanceGroupManagers.update",
  77884. // "parameterOrder": [
  77885. // "project",
  77886. // "region",
  77887. // "instanceGroupManager"
  77888. // ],
  77889. // "parameters": {
  77890. // "instanceGroupManager": {
  77891. // "description": "The name of the instance group manager.",
  77892. // "location": "path",
  77893. // "required": true,
  77894. // "type": "string"
  77895. // },
  77896. // "project": {
  77897. // "description": "Project ID for this request.",
  77898. // "location": "path",
  77899. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  77900. // "required": true,
  77901. // "type": "string"
  77902. // },
  77903. // "region": {
  77904. // "description": "Name of the region scoping this request.",
  77905. // "location": "path",
  77906. // "required": true,
  77907. // "type": "string"
  77908. // },
  77909. // "requestId": {
  77910. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  77911. // "location": "query",
  77912. // "type": "string"
  77913. // }
  77914. // },
  77915. // "path": "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}",
  77916. // "request": {
  77917. // "$ref": "InstanceGroupManager"
  77918. // },
  77919. // "response": {
  77920. // "$ref": "Operation"
  77921. // },
  77922. // "scopes": [
  77923. // "https://www.googleapis.com/auth/cloud-platform",
  77924. // "https://www.googleapis.com/auth/compute"
  77925. // ]
  77926. // }
  77927. }
  77928. // method id "compute.regionInstanceGroups.get":
  77929. type RegionInstanceGroupsGetCall struct {
  77930. s *Service
  77931. project string
  77932. region string
  77933. instanceGroup string
  77934. urlParams_ gensupport.URLParams
  77935. ifNoneMatch_ string
  77936. ctx_ context.Context
  77937. header_ http.Header
  77938. }
  77939. // Get: Returns the specified instance group resource.
  77940. func (r *RegionInstanceGroupsService) Get(project string, region string, instanceGroup string) *RegionInstanceGroupsGetCall {
  77941. c := &RegionInstanceGroupsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  77942. c.project = project
  77943. c.region = region
  77944. c.instanceGroup = instanceGroup
  77945. return c
  77946. }
  77947. // Fields allows partial responses to be retrieved. See
  77948. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  77949. // for more information.
  77950. func (c *RegionInstanceGroupsGetCall) Fields(s ...googleapi.Field) *RegionInstanceGroupsGetCall {
  77951. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  77952. return c
  77953. }
  77954. // IfNoneMatch sets the optional parameter which makes the operation
  77955. // fail if the object's ETag matches the given value. This is useful for
  77956. // getting updates only after the object has changed since the last
  77957. // request. Use googleapi.IsNotModified to check whether the response
  77958. // error from Do is the result of In-None-Match.
  77959. func (c *RegionInstanceGroupsGetCall) IfNoneMatch(entityTag string) *RegionInstanceGroupsGetCall {
  77960. c.ifNoneMatch_ = entityTag
  77961. return c
  77962. }
  77963. // Context sets the context to be used in this call's Do method. Any
  77964. // pending HTTP request will be aborted if the provided context is
  77965. // canceled.
  77966. func (c *RegionInstanceGroupsGetCall) Context(ctx context.Context) *RegionInstanceGroupsGetCall {
  77967. c.ctx_ = ctx
  77968. return c
  77969. }
  77970. // Header returns an http.Header that can be modified by the caller to
  77971. // add HTTP headers to the request.
  77972. func (c *RegionInstanceGroupsGetCall) Header() http.Header {
  77973. if c.header_ == nil {
  77974. c.header_ = make(http.Header)
  77975. }
  77976. return c.header_
  77977. }
  77978. func (c *RegionInstanceGroupsGetCall) doRequest(alt string) (*http.Response, error) {
  77979. reqHeaders := make(http.Header)
  77980. for k, v := range c.header_ {
  77981. reqHeaders[k] = v
  77982. }
  77983. reqHeaders.Set("User-Agent", c.s.userAgent())
  77984. if c.ifNoneMatch_ != "" {
  77985. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  77986. }
  77987. var body io.Reader = nil
  77988. c.urlParams_.Set("alt", alt)
  77989. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/instanceGroups/{instanceGroup}")
  77990. urls += "?" + c.urlParams_.Encode()
  77991. req, _ := http.NewRequest("GET", urls, body)
  77992. req.Header = reqHeaders
  77993. googleapi.Expand(req.URL, map[string]string{
  77994. "project": c.project,
  77995. "region": c.region,
  77996. "instanceGroup": c.instanceGroup,
  77997. })
  77998. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  77999. }
  78000. // Do executes the "compute.regionInstanceGroups.get" call.
  78001. // Exactly one of *InstanceGroup or error will be non-nil. Any non-2xx
  78002. // status code is an error. Response headers are in either
  78003. // *InstanceGroup.ServerResponse.Header or (if a response was returned
  78004. // at all) in error.(*googleapi.Error).Header. Use
  78005. // googleapi.IsNotModified to check whether the returned error was
  78006. // because http.StatusNotModified was returned.
  78007. func (c *RegionInstanceGroupsGetCall) Do(opts ...googleapi.CallOption) (*InstanceGroup, error) {
  78008. gensupport.SetOptions(c.urlParams_, opts...)
  78009. res, err := c.doRequest("json")
  78010. if res != nil && res.StatusCode == http.StatusNotModified {
  78011. if res.Body != nil {
  78012. res.Body.Close()
  78013. }
  78014. return nil, &googleapi.Error{
  78015. Code: res.StatusCode,
  78016. Header: res.Header,
  78017. }
  78018. }
  78019. if err != nil {
  78020. return nil, err
  78021. }
  78022. defer googleapi.CloseBody(res)
  78023. if err := googleapi.CheckResponse(res); err != nil {
  78024. return nil, err
  78025. }
  78026. ret := &InstanceGroup{
  78027. ServerResponse: googleapi.ServerResponse{
  78028. Header: res.Header,
  78029. HTTPStatusCode: res.StatusCode,
  78030. },
  78031. }
  78032. target := &ret
  78033. if err := gensupport.DecodeResponse(target, res); err != nil {
  78034. return nil, err
  78035. }
  78036. return ret, nil
  78037. // {
  78038. // "description": "Returns the specified instance group resource.",
  78039. // "httpMethod": "GET",
  78040. // "id": "compute.regionInstanceGroups.get",
  78041. // "parameterOrder": [
  78042. // "project",
  78043. // "region",
  78044. // "instanceGroup"
  78045. // ],
  78046. // "parameters": {
  78047. // "instanceGroup": {
  78048. // "description": "Name of the instance group resource to return.",
  78049. // "location": "path",
  78050. // "required": true,
  78051. // "type": "string"
  78052. // },
  78053. // "project": {
  78054. // "description": "Project ID for this request.",
  78055. // "location": "path",
  78056. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  78057. // "required": true,
  78058. // "type": "string"
  78059. // },
  78060. // "region": {
  78061. // "description": "Name of the region scoping this request.",
  78062. // "location": "path",
  78063. // "required": true,
  78064. // "type": "string"
  78065. // }
  78066. // },
  78067. // "path": "{project}/regions/{region}/instanceGroups/{instanceGroup}",
  78068. // "response": {
  78069. // "$ref": "InstanceGroup"
  78070. // },
  78071. // "scopes": [
  78072. // "https://www.googleapis.com/auth/cloud-platform",
  78073. // "https://www.googleapis.com/auth/compute",
  78074. // "https://www.googleapis.com/auth/compute.readonly"
  78075. // ]
  78076. // }
  78077. }
  78078. // method id "compute.regionInstanceGroups.list":
  78079. type RegionInstanceGroupsListCall struct {
  78080. s *Service
  78081. project string
  78082. region string
  78083. urlParams_ gensupport.URLParams
  78084. ifNoneMatch_ string
  78085. ctx_ context.Context
  78086. header_ http.Header
  78087. }
  78088. // List: Retrieves the list of instance group resources contained within
  78089. // the specified region.
  78090. func (r *RegionInstanceGroupsService) List(project string, region string) *RegionInstanceGroupsListCall {
  78091. c := &RegionInstanceGroupsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  78092. c.project = project
  78093. c.region = region
  78094. return c
  78095. }
  78096. // Filter sets the optional parameter "filter": A filter expression that
  78097. // filters resources listed in the response. The expression must specify
  78098. // the field name, a comparison operator, and the value that you want to
  78099. // use for filtering. The value must be a string, a number, or a
  78100. // boolean. The comparison operator must be either =, !=, >, or <.
  78101. //
  78102. // For example, if you are filtering Compute Engine instances, you can
  78103. // exclude instances named example-instance by specifying name !=
  78104. // example-instance.
  78105. //
  78106. // You can also filter nested fields. For example, you could specify
  78107. // scheduling.automaticRestart = false to include instances only if they
  78108. // are not scheduled for automatic restarts. You can use filtering on
  78109. // nested fields to filter based on resource labels.
  78110. //
  78111. // To filter on multiple expressions, provide each separate expression
  78112. // within parentheses. For example, (scheduling.automaticRestart = true)
  78113. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  78114. // AND expression. However, you can include AND and OR expressions
  78115. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  78116. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  78117. // true).
  78118. func (c *RegionInstanceGroupsListCall) Filter(filter string) *RegionInstanceGroupsListCall {
  78119. c.urlParams_.Set("filter", filter)
  78120. return c
  78121. }
  78122. // MaxResults sets the optional parameter "maxResults": The maximum
  78123. // number of results per page that should be returned. If the number of
  78124. // available results is larger than maxResults, Compute Engine returns a
  78125. // nextPageToken that can be used to get the next page of results in
  78126. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  78127. // (Default: 500)
  78128. func (c *RegionInstanceGroupsListCall) MaxResults(maxResults int64) *RegionInstanceGroupsListCall {
  78129. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  78130. return c
  78131. }
  78132. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  78133. // a certain order. By default, results are returned in alphanumerical
  78134. // order based on the resource name.
  78135. //
  78136. // You can also sort results in descending order based on the creation
  78137. // timestamp using orderBy="creationTimestamp desc". This sorts results
  78138. // based on the creationTimestamp field in reverse chronological order
  78139. // (newest result first). Use this to sort resources like operations so
  78140. // that the newest operation is returned first.
  78141. //
  78142. // Currently, only sorting by name or creationTimestamp desc is
  78143. // supported.
  78144. func (c *RegionInstanceGroupsListCall) OrderBy(orderBy string) *RegionInstanceGroupsListCall {
  78145. c.urlParams_.Set("orderBy", orderBy)
  78146. return c
  78147. }
  78148. // PageToken sets the optional parameter "pageToken": Specifies a page
  78149. // token to use. Set pageToken to the nextPageToken returned by a
  78150. // previous list request to get the next page of results.
  78151. func (c *RegionInstanceGroupsListCall) PageToken(pageToken string) *RegionInstanceGroupsListCall {
  78152. c.urlParams_.Set("pageToken", pageToken)
  78153. return c
  78154. }
  78155. // Fields allows partial responses to be retrieved. See
  78156. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  78157. // for more information.
  78158. func (c *RegionInstanceGroupsListCall) Fields(s ...googleapi.Field) *RegionInstanceGroupsListCall {
  78159. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  78160. return c
  78161. }
  78162. // IfNoneMatch sets the optional parameter which makes the operation
  78163. // fail if the object's ETag matches the given value. This is useful for
  78164. // getting updates only after the object has changed since the last
  78165. // request. Use googleapi.IsNotModified to check whether the response
  78166. // error from Do is the result of In-None-Match.
  78167. func (c *RegionInstanceGroupsListCall) IfNoneMatch(entityTag string) *RegionInstanceGroupsListCall {
  78168. c.ifNoneMatch_ = entityTag
  78169. return c
  78170. }
  78171. // Context sets the context to be used in this call's Do method. Any
  78172. // pending HTTP request will be aborted if the provided context is
  78173. // canceled.
  78174. func (c *RegionInstanceGroupsListCall) Context(ctx context.Context) *RegionInstanceGroupsListCall {
  78175. c.ctx_ = ctx
  78176. return c
  78177. }
  78178. // Header returns an http.Header that can be modified by the caller to
  78179. // add HTTP headers to the request.
  78180. func (c *RegionInstanceGroupsListCall) Header() http.Header {
  78181. if c.header_ == nil {
  78182. c.header_ = make(http.Header)
  78183. }
  78184. return c.header_
  78185. }
  78186. func (c *RegionInstanceGroupsListCall) doRequest(alt string) (*http.Response, error) {
  78187. reqHeaders := make(http.Header)
  78188. for k, v := range c.header_ {
  78189. reqHeaders[k] = v
  78190. }
  78191. reqHeaders.Set("User-Agent", c.s.userAgent())
  78192. if c.ifNoneMatch_ != "" {
  78193. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  78194. }
  78195. var body io.Reader = nil
  78196. c.urlParams_.Set("alt", alt)
  78197. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/instanceGroups")
  78198. urls += "?" + c.urlParams_.Encode()
  78199. req, _ := http.NewRequest("GET", urls, body)
  78200. req.Header = reqHeaders
  78201. googleapi.Expand(req.URL, map[string]string{
  78202. "project": c.project,
  78203. "region": c.region,
  78204. })
  78205. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  78206. }
  78207. // Do executes the "compute.regionInstanceGroups.list" call.
  78208. // Exactly one of *RegionInstanceGroupList or error will be non-nil. Any
  78209. // non-2xx status code is an error. Response headers are in either
  78210. // *RegionInstanceGroupList.ServerResponse.Header or (if a response was
  78211. // returned at all) in error.(*googleapi.Error).Header. Use
  78212. // googleapi.IsNotModified to check whether the returned error was
  78213. // because http.StatusNotModified was returned.
  78214. func (c *RegionInstanceGroupsListCall) Do(opts ...googleapi.CallOption) (*RegionInstanceGroupList, error) {
  78215. gensupport.SetOptions(c.urlParams_, opts...)
  78216. res, err := c.doRequest("json")
  78217. if res != nil && res.StatusCode == http.StatusNotModified {
  78218. if res.Body != nil {
  78219. res.Body.Close()
  78220. }
  78221. return nil, &googleapi.Error{
  78222. Code: res.StatusCode,
  78223. Header: res.Header,
  78224. }
  78225. }
  78226. if err != nil {
  78227. return nil, err
  78228. }
  78229. defer googleapi.CloseBody(res)
  78230. if err := googleapi.CheckResponse(res); err != nil {
  78231. return nil, err
  78232. }
  78233. ret := &RegionInstanceGroupList{
  78234. ServerResponse: googleapi.ServerResponse{
  78235. Header: res.Header,
  78236. HTTPStatusCode: res.StatusCode,
  78237. },
  78238. }
  78239. target := &ret
  78240. if err := gensupport.DecodeResponse(target, res); err != nil {
  78241. return nil, err
  78242. }
  78243. return ret, nil
  78244. // {
  78245. // "description": "Retrieves the list of instance group resources contained within the specified region.",
  78246. // "httpMethod": "GET",
  78247. // "id": "compute.regionInstanceGroups.list",
  78248. // "parameterOrder": [
  78249. // "project",
  78250. // "region"
  78251. // ],
  78252. // "parameters": {
  78253. // "filter": {
  78254. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  78255. // "location": "query",
  78256. // "type": "string"
  78257. // },
  78258. // "maxResults": {
  78259. // "default": "500",
  78260. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  78261. // "format": "uint32",
  78262. // "location": "query",
  78263. // "minimum": "0",
  78264. // "type": "integer"
  78265. // },
  78266. // "orderBy": {
  78267. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  78268. // "location": "query",
  78269. // "type": "string"
  78270. // },
  78271. // "pageToken": {
  78272. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  78273. // "location": "query",
  78274. // "type": "string"
  78275. // },
  78276. // "project": {
  78277. // "description": "Project ID for this request.",
  78278. // "location": "path",
  78279. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  78280. // "required": true,
  78281. // "type": "string"
  78282. // },
  78283. // "region": {
  78284. // "description": "Name of the region scoping this request.",
  78285. // "location": "path",
  78286. // "required": true,
  78287. // "type": "string"
  78288. // }
  78289. // },
  78290. // "path": "{project}/regions/{region}/instanceGroups",
  78291. // "response": {
  78292. // "$ref": "RegionInstanceGroupList"
  78293. // },
  78294. // "scopes": [
  78295. // "https://www.googleapis.com/auth/cloud-platform",
  78296. // "https://www.googleapis.com/auth/compute",
  78297. // "https://www.googleapis.com/auth/compute.readonly"
  78298. // ]
  78299. // }
  78300. }
  78301. // Pages invokes f for each page of results.
  78302. // A non-nil error returned from f will halt the iteration.
  78303. // The provided context supersedes any context provided to the Context method.
  78304. func (c *RegionInstanceGroupsListCall) Pages(ctx context.Context, f func(*RegionInstanceGroupList) error) error {
  78305. c.ctx_ = ctx
  78306. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  78307. for {
  78308. x, err := c.Do()
  78309. if err != nil {
  78310. return err
  78311. }
  78312. if err := f(x); err != nil {
  78313. return err
  78314. }
  78315. if x.NextPageToken == "" {
  78316. return nil
  78317. }
  78318. c.PageToken(x.NextPageToken)
  78319. }
  78320. }
  78321. // method id "compute.regionInstanceGroups.listInstances":
  78322. type RegionInstanceGroupsListInstancesCall struct {
  78323. s *Service
  78324. project string
  78325. region string
  78326. instanceGroup string
  78327. regioninstancegroupslistinstancesrequest *RegionInstanceGroupsListInstancesRequest
  78328. urlParams_ gensupport.URLParams
  78329. ctx_ context.Context
  78330. header_ http.Header
  78331. }
  78332. // ListInstances: Lists the instances in the specified instance group
  78333. // and displays information about the named ports. Depending on the
  78334. // specified options, this method can list all instances or only the
  78335. // instances that are running.
  78336. func (r *RegionInstanceGroupsService) ListInstances(project string, region string, instanceGroup string, regioninstancegroupslistinstancesrequest *RegionInstanceGroupsListInstancesRequest) *RegionInstanceGroupsListInstancesCall {
  78337. c := &RegionInstanceGroupsListInstancesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  78338. c.project = project
  78339. c.region = region
  78340. c.instanceGroup = instanceGroup
  78341. c.regioninstancegroupslistinstancesrequest = regioninstancegroupslistinstancesrequest
  78342. return c
  78343. }
  78344. // Filter sets the optional parameter "filter": A filter expression that
  78345. // filters resources listed in the response. The expression must specify
  78346. // the field name, a comparison operator, and the value that you want to
  78347. // use for filtering. The value must be a string, a number, or a
  78348. // boolean. The comparison operator must be either =, !=, >, or <.
  78349. //
  78350. // For example, if you are filtering Compute Engine instances, you can
  78351. // exclude instances named example-instance by specifying name !=
  78352. // example-instance.
  78353. //
  78354. // You can also filter nested fields. For example, you could specify
  78355. // scheduling.automaticRestart = false to include instances only if they
  78356. // are not scheduled for automatic restarts. You can use filtering on
  78357. // nested fields to filter based on resource labels.
  78358. //
  78359. // To filter on multiple expressions, provide each separate expression
  78360. // within parentheses. For example, (scheduling.automaticRestart = true)
  78361. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  78362. // AND expression. However, you can include AND and OR expressions
  78363. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  78364. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  78365. // true).
  78366. func (c *RegionInstanceGroupsListInstancesCall) Filter(filter string) *RegionInstanceGroupsListInstancesCall {
  78367. c.urlParams_.Set("filter", filter)
  78368. return c
  78369. }
  78370. // MaxResults sets the optional parameter "maxResults": The maximum
  78371. // number of results per page that should be returned. If the number of
  78372. // available results is larger than maxResults, Compute Engine returns a
  78373. // nextPageToken that can be used to get the next page of results in
  78374. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  78375. // (Default: 500)
  78376. func (c *RegionInstanceGroupsListInstancesCall) MaxResults(maxResults int64) *RegionInstanceGroupsListInstancesCall {
  78377. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  78378. return c
  78379. }
  78380. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  78381. // a certain order. By default, results are returned in alphanumerical
  78382. // order based on the resource name.
  78383. //
  78384. // You can also sort results in descending order based on the creation
  78385. // timestamp using orderBy="creationTimestamp desc". This sorts results
  78386. // based on the creationTimestamp field in reverse chronological order
  78387. // (newest result first). Use this to sort resources like operations so
  78388. // that the newest operation is returned first.
  78389. //
  78390. // Currently, only sorting by name or creationTimestamp desc is
  78391. // supported.
  78392. func (c *RegionInstanceGroupsListInstancesCall) OrderBy(orderBy string) *RegionInstanceGroupsListInstancesCall {
  78393. c.urlParams_.Set("orderBy", orderBy)
  78394. return c
  78395. }
  78396. // PageToken sets the optional parameter "pageToken": Specifies a page
  78397. // token to use. Set pageToken to the nextPageToken returned by a
  78398. // previous list request to get the next page of results.
  78399. func (c *RegionInstanceGroupsListInstancesCall) PageToken(pageToken string) *RegionInstanceGroupsListInstancesCall {
  78400. c.urlParams_.Set("pageToken", pageToken)
  78401. return c
  78402. }
  78403. // Fields allows partial responses to be retrieved. See
  78404. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  78405. // for more information.
  78406. func (c *RegionInstanceGroupsListInstancesCall) Fields(s ...googleapi.Field) *RegionInstanceGroupsListInstancesCall {
  78407. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  78408. return c
  78409. }
  78410. // Context sets the context to be used in this call's Do method. Any
  78411. // pending HTTP request will be aborted if the provided context is
  78412. // canceled.
  78413. func (c *RegionInstanceGroupsListInstancesCall) Context(ctx context.Context) *RegionInstanceGroupsListInstancesCall {
  78414. c.ctx_ = ctx
  78415. return c
  78416. }
  78417. // Header returns an http.Header that can be modified by the caller to
  78418. // add HTTP headers to the request.
  78419. func (c *RegionInstanceGroupsListInstancesCall) Header() http.Header {
  78420. if c.header_ == nil {
  78421. c.header_ = make(http.Header)
  78422. }
  78423. return c.header_
  78424. }
  78425. func (c *RegionInstanceGroupsListInstancesCall) doRequest(alt string) (*http.Response, error) {
  78426. reqHeaders := make(http.Header)
  78427. for k, v := range c.header_ {
  78428. reqHeaders[k] = v
  78429. }
  78430. reqHeaders.Set("User-Agent", c.s.userAgent())
  78431. var body io.Reader = nil
  78432. body, err := googleapi.WithoutDataWrapper.JSONReader(c.regioninstancegroupslistinstancesrequest)
  78433. if err != nil {
  78434. return nil, err
  78435. }
  78436. reqHeaders.Set("Content-Type", "application/json")
  78437. c.urlParams_.Set("alt", alt)
  78438. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/instanceGroups/{instanceGroup}/listInstances")
  78439. urls += "?" + c.urlParams_.Encode()
  78440. req, _ := http.NewRequest("POST", urls, body)
  78441. req.Header = reqHeaders
  78442. googleapi.Expand(req.URL, map[string]string{
  78443. "project": c.project,
  78444. "region": c.region,
  78445. "instanceGroup": c.instanceGroup,
  78446. })
  78447. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  78448. }
  78449. // Do executes the "compute.regionInstanceGroups.listInstances" call.
  78450. // Exactly one of *RegionInstanceGroupsListInstances or error will be
  78451. // non-nil. Any non-2xx status code is an error. Response headers are in
  78452. // either *RegionInstanceGroupsListInstances.ServerResponse.Header or
  78453. // (if a response was returned at all) in
  78454. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  78455. // whether the returned error was because http.StatusNotModified was
  78456. // returned.
  78457. func (c *RegionInstanceGroupsListInstancesCall) Do(opts ...googleapi.CallOption) (*RegionInstanceGroupsListInstances, error) {
  78458. gensupport.SetOptions(c.urlParams_, opts...)
  78459. res, err := c.doRequest("json")
  78460. if res != nil && res.StatusCode == http.StatusNotModified {
  78461. if res.Body != nil {
  78462. res.Body.Close()
  78463. }
  78464. return nil, &googleapi.Error{
  78465. Code: res.StatusCode,
  78466. Header: res.Header,
  78467. }
  78468. }
  78469. if err != nil {
  78470. return nil, err
  78471. }
  78472. defer googleapi.CloseBody(res)
  78473. if err := googleapi.CheckResponse(res); err != nil {
  78474. return nil, err
  78475. }
  78476. ret := &RegionInstanceGroupsListInstances{
  78477. ServerResponse: googleapi.ServerResponse{
  78478. Header: res.Header,
  78479. HTTPStatusCode: res.StatusCode,
  78480. },
  78481. }
  78482. target := &ret
  78483. if err := gensupport.DecodeResponse(target, res); err != nil {
  78484. return nil, err
  78485. }
  78486. return ret, nil
  78487. // {
  78488. // "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.",
  78489. // "httpMethod": "POST",
  78490. // "id": "compute.regionInstanceGroups.listInstances",
  78491. // "parameterOrder": [
  78492. // "project",
  78493. // "region",
  78494. // "instanceGroup"
  78495. // ],
  78496. // "parameters": {
  78497. // "filter": {
  78498. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  78499. // "location": "query",
  78500. // "type": "string"
  78501. // },
  78502. // "instanceGroup": {
  78503. // "description": "Name of the regional instance group for which we want to list the instances.",
  78504. // "location": "path",
  78505. // "required": true,
  78506. // "type": "string"
  78507. // },
  78508. // "maxResults": {
  78509. // "default": "500",
  78510. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  78511. // "format": "uint32",
  78512. // "location": "query",
  78513. // "minimum": "0",
  78514. // "type": "integer"
  78515. // },
  78516. // "orderBy": {
  78517. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  78518. // "location": "query",
  78519. // "type": "string"
  78520. // },
  78521. // "pageToken": {
  78522. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  78523. // "location": "query",
  78524. // "type": "string"
  78525. // },
  78526. // "project": {
  78527. // "description": "Project ID for this request.",
  78528. // "location": "path",
  78529. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  78530. // "required": true,
  78531. // "type": "string"
  78532. // },
  78533. // "region": {
  78534. // "description": "Name of the region scoping this request.",
  78535. // "location": "path",
  78536. // "required": true,
  78537. // "type": "string"
  78538. // }
  78539. // },
  78540. // "path": "{project}/regions/{region}/instanceGroups/{instanceGroup}/listInstances",
  78541. // "request": {
  78542. // "$ref": "RegionInstanceGroupsListInstancesRequest"
  78543. // },
  78544. // "response": {
  78545. // "$ref": "RegionInstanceGroupsListInstances"
  78546. // },
  78547. // "scopes": [
  78548. // "https://www.googleapis.com/auth/cloud-platform",
  78549. // "https://www.googleapis.com/auth/compute",
  78550. // "https://www.googleapis.com/auth/compute.readonly"
  78551. // ]
  78552. // }
  78553. }
  78554. // Pages invokes f for each page of results.
  78555. // A non-nil error returned from f will halt the iteration.
  78556. // The provided context supersedes any context provided to the Context method.
  78557. func (c *RegionInstanceGroupsListInstancesCall) Pages(ctx context.Context, f func(*RegionInstanceGroupsListInstances) error) error {
  78558. c.ctx_ = ctx
  78559. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  78560. for {
  78561. x, err := c.Do()
  78562. if err != nil {
  78563. return err
  78564. }
  78565. if err := f(x); err != nil {
  78566. return err
  78567. }
  78568. if x.NextPageToken == "" {
  78569. return nil
  78570. }
  78571. c.PageToken(x.NextPageToken)
  78572. }
  78573. }
  78574. // method id "compute.regionInstanceGroups.setNamedPorts":
  78575. type RegionInstanceGroupsSetNamedPortsCall struct {
  78576. s *Service
  78577. project string
  78578. region string
  78579. instanceGroup string
  78580. regioninstancegroupssetnamedportsrequest *RegionInstanceGroupsSetNamedPortsRequest
  78581. urlParams_ gensupport.URLParams
  78582. ctx_ context.Context
  78583. header_ http.Header
  78584. }
  78585. // SetNamedPorts: Sets the named ports for the specified regional
  78586. // instance group.
  78587. func (r *RegionInstanceGroupsService) SetNamedPorts(project string, region string, instanceGroup string, regioninstancegroupssetnamedportsrequest *RegionInstanceGroupsSetNamedPortsRequest) *RegionInstanceGroupsSetNamedPortsCall {
  78588. c := &RegionInstanceGroupsSetNamedPortsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  78589. c.project = project
  78590. c.region = region
  78591. c.instanceGroup = instanceGroup
  78592. c.regioninstancegroupssetnamedportsrequest = regioninstancegroupssetnamedportsrequest
  78593. return c
  78594. }
  78595. // RequestId sets the optional parameter "requestId": An optional
  78596. // request ID to identify requests. Specify a unique request ID so that
  78597. // if you must retry your request, the server will know to ignore the
  78598. // request if it has already been completed.
  78599. //
  78600. // For example, consider a situation where you make an initial request
  78601. // and the request times out. If you make the request again with the
  78602. // same request ID, the server can check if original operation with the
  78603. // same request ID was received, and if so, will ignore the second
  78604. // request. This prevents clients from accidentally creating duplicate
  78605. // commitments.
  78606. //
  78607. // The request ID must be a valid UUID with the exception that zero UUID
  78608. // is not supported (00000000-0000-0000-0000-000000000000).
  78609. func (c *RegionInstanceGroupsSetNamedPortsCall) RequestId(requestId string) *RegionInstanceGroupsSetNamedPortsCall {
  78610. c.urlParams_.Set("requestId", requestId)
  78611. return c
  78612. }
  78613. // Fields allows partial responses to be retrieved. See
  78614. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  78615. // for more information.
  78616. func (c *RegionInstanceGroupsSetNamedPortsCall) Fields(s ...googleapi.Field) *RegionInstanceGroupsSetNamedPortsCall {
  78617. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  78618. return c
  78619. }
  78620. // Context sets the context to be used in this call's Do method. Any
  78621. // pending HTTP request will be aborted if the provided context is
  78622. // canceled.
  78623. func (c *RegionInstanceGroupsSetNamedPortsCall) Context(ctx context.Context) *RegionInstanceGroupsSetNamedPortsCall {
  78624. c.ctx_ = ctx
  78625. return c
  78626. }
  78627. // Header returns an http.Header that can be modified by the caller to
  78628. // add HTTP headers to the request.
  78629. func (c *RegionInstanceGroupsSetNamedPortsCall) Header() http.Header {
  78630. if c.header_ == nil {
  78631. c.header_ = make(http.Header)
  78632. }
  78633. return c.header_
  78634. }
  78635. func (c *RegionInstanceGroupsSetNamedPortsCall) doRequest(alt string) (*http.Response, error) {
  78636. reqHeaders := make(http.Header)
  78637. for k, v := range c.header_ {
  78638. reqHeaders[k] = v
  78639. }
  78640. reqHeaders.Set("User-Agent", c.s.userAgent())
  78641. var body io.Reader = nil
  78642. body, err := googleapi.WithoutDataWrapper.JSONReader(c.regioninstancegroupssetnamedportsrequest)
  78643. if err != nil {
  78644. return nil, err
  78645. }
  78646. reqHeaders.Set("Content-Type", "application/json")
  78647. c.urlParams_.Set("alt", alt)
  78648. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/instanceGroups/{instanceGroup}/setNamedPorts")
  78649. urls += "?" + c.urlParams_.Encode()
  78650. req, _ := http.NewRequest("POST", urls, body)
  78651. req.Header = reqHeaders
  78652. googleapi.Expand(req.URL, map[string]string{
  78653. "project": c.project,
  78654. "region": c.region,
  78655. "instanceGroup": c.instanceGroup,
  78656. })
  78657. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  78658. }
  78659. // Do executes the "compute.regionInstanceGroups.setNamedPorts" call.
  78660. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  78661. // status code is an error. Response headers are in either
  78662. // *Operation.ServerResponse.Header or (if a response was returned at
  78663. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  78664. // to check whether the returned error was because
  78665. // http.StatusNotModified was returned.
  78666. func (c *RegionInstanceGroupsSetNamedPortsCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  78667. gensupport.SetOptions(c.urlParams_, opts...)
  78668. res, err := c.doRequest("json")
  78669. if res != nil && res.StatusCode == http.StatusNotModified {
  78670. if res.Body != nil {
  78671. res.Body.Close()
  78672. }
  78673. return nil, &googleapi.Error{
  78674. Code: res.StatusCode,
  78675. Header: res.Header,
  78676. }
  78677. }
  78678. if err != nil {
  78679. return nil, err
  78680. }
  78681. defer googleapi.CloseBody(res)
  78682. if err := googleapi.CheckResponse(res); err != nil {
  78683. return nil, err
  78684. }
  78685. ret := &Operation{
  78686. ServerResponse: googleapi.ServerResponse{
  78687. Header: res.Header,
  78688. HTTPStatusCode: res.StatusCode,
  78689. },
  78690. }
  78691. target := &ret
  78692. if err := gensupport.DecodeResponse(target, res); err != nil {
  78693. return nil, err
  78694. }
  78695. return ret, nil
  78696. // {
  78697. // "description": "Sets the named ports for the specified regional instance group.",
  78698. // "httpMethod": "POST",
  78699. // "id": "compute.regionInstanceGroups.setNamedPorts",
  78700. // "parameterOrder": [
  78701. // "project",
  78702. // "region",
  78703. // "instanceGroup"
  78704. // ],
  78705. // "parameters": {
  78706. // "instanceGroup": {
  78707. // "description": "The name of the regional instance group where the named ports are updated.",
  78708. // "location": "path",
  78709. // "required": true,
  78710. // "type": "string"
  78711. // },
  78712. // "project": {
  78713. // "description": "Project ID for this request.",
  78714. // "location": "path",
  78715. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  78716. // "required": true,
  78717. // "type": "string"
  78718. // },
  78719. // "region": {
  78720. // "description": "Name of the region scoping this request.",
  78721. // "location": "path",
  78722. // "required": true,
  78723. // "type": "string"
  78724. // },
  78725. // "requestId": {
  78726. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  78727. // "location": "query",
  78728. // "type": "string"
  78729. // }
  78730. // },
  78731. // "path": "{project}/regions/{region}/instanceGroups/{instanceGroup}/setNamedPorts",
  78732. // "request": {
  78733. // "$ref": "RegionInstanceGroupsSetNamedPortsRequest"
  78734. // },
  78735. // "response": {
  78736. // "$ref": "Operation"
  78737. // },
  78738. // "scopes": [
  78739. // "https://www.googleapis.com/auth/cloud-platform",
  78740. // "https://www.googleapis.com/auth/compute"
  78741. // ]
  78742. // }
  78743. }
  78744. // method id "compute.regionInstanceGroups.testIamPermissions":
  78745. type RegionInstanceGroupsTestIamPermissionsCall struct {
  78746. s *Service
  78747. project string
  78748. region string
  78749. resource string
  78750. testpermissionsrequest *TestPermissionsRequest
  78751. urlParams_ gensupport.URLParams
  78752. ctx_ context.Context
  78753. header_ http.Header
  78754. }
  78755. // TestIamPermissions: Returns permissions that a caller has on the
  78756. // specified resource.
  78757. func (r *RegionInstanceGroupsService) TestIamPermissions(project string, region string, resource string, testpermissionsrequest *TestPermissionsRequest) *RegionInstanceGroupsTestIamPermissionsCall {
  78758. c := &RegionInstanceGroupsTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  78759. c.project = project
  78760. c.region = region
  78761. c.resource = resource
  78762. c.testpermissionsrequest = testpermissionsrequest
  78763. return c
  78764. }
  78765. // Fields allows partial responses to be retrieved. See
  78766. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  78767. // for more information.
  78768. func (c *RegionInstanceGroupsTestIamPermissionsCall) Fields(s ...googleapi.Field) *RegionInstanceGroupsTestIamPermissionsCall {
  78769. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  78770. return c
  78771. }
  78772. // Context sets the context to be used in this call's Do method. Any
  78773. // pending HTTP request will be aborted if the provided context is
  78774. // canceled.
  78775. func (c *RegionInstanceGroupsTestIamPermissionsCall) Context(ctx context.Context) *RegionInstanceGroupsTestIamPermissionsCall {
  78776. c.ctx_ = ctx
  78777. return c
  78778. }
  78779. // Header returns an http.Header that can be modified by the caller to
  78780. // add HTTP headers to the request.
  78781. func (c *RegionInstanceGroupsTestIamPermissionsCall) Header() http.Header {
  78782. if c.header_ == nil {
  78783. c.header_ = make(http.Header)
  78784. }
  78785. return c.header_
  78786. }
  78787. func (c *RegionInstanceGroupsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  78788. reqHeaders := make(http.Header)
  78789. for k, v := range c.header_ {
  78790. reqHeaders[k] = v
  78791. }
  78792. reqHeaders.Set("User-Agent", c.s.userAgent())
  78793. var body io.Reader = nil
  78794. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  78795. if err != nil {
  78796. return nil, err
  78797. }
  78798. reqHeaders.Set("Content-Type", "application/json")
  78799. c.urlParams_.Set("alt", alt)
  78800. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/instanceGroups/{resource}/testIamPermissions")
  78801. urls += "?" + c.urlParams_.Encode()
  78802. req, _ := http.NewRequest("POST", urls, body)
  78803. req.Header = reqHeaders
  78804. googleapi.Expand(req.URL, map[string]string{
  78805. "project": c.project,
  78806. "region": c.region,
  78807. "resource": c.resource,
  78808. })
  78809. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  78810. }
  78811. // Do executes the "compute.regionInstanceGroups.testIamPermissions" call.
  78812. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  78813. // non-2xx status code is an error. Response headers are in either
  78814. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  78815. // returned at all) in error.(*googleapi.Error).Header. Use
  78816. // googleapi.IsNotModified to check whether the returned error was
  78817. // because http.StatusNotModified was returned.
  78818. func (c *RegionInstanceGroupsTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  78819. gensupport.SetOptions(c.urlParams_, opts...)
  78820. res, err := c.doRequest("json")
  78821. if res != nil && res.StatusCode == http.StatusNotModified {
  78822. if res.Body != nil {
  78823. res.Body.Close()
  78824. }
  78825. return nil, &googleapi.Error{
  78826. Code: res.StatusCode,
  78827. Header: res.Header,
  78828. }
  78829. }
  78830. if err != nil {
  78831. return nil, err
  78832. }
  78833. defer googleapi.CloseBody(res)
  78834. if err := googleapi.CheckResponse(res); err != nil {
  78835. return nil, err
  78836. }
  78837. ret := &TestPermissionsResponse{
  78838. ServerResponse: googleapi.ServerResponse{
  78839. Header: res.Header,
  78840. HTTPStatusCode: res.StatusCode,
  78841. },
  78842. }
  78843. target := &ret
  78844. if err := gensupport.DecodeResponse(target, res); err != nil {
  78845. return nil, err
  78846. }
  78847. return ret, nil
  78848. // {
  78849. // "description": "Returns permissions that a caller has on the specified resource.",
  78850. // "httpMethod": "POST",
  78851. // "id": "compute.regionInstanceGroups.testIamPermissions",
  78852. // "parameterOrder": [
  78853. // "project",
  78854. // "region",
  78855. // "resource"
  78856. // ],
  78857. // "parameters": {
  78858. // "project": {
  78859. // "description": "Project ID for this request.",
  78860. // "location": "path",
  78861. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  78862. // "required": true,
  78863. // "type": "string"
  78864. // },
  78865. // "region": {
  78866. // "description": "The name of the region for this request.",
  78867. // "location": "path",
  78868. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  78869. // "required": true,
  78870. // "type": "string"
  78871. // },
  78872. // "resource": {
  78873. // "description": "Name of the resource for this request.",
  78874. // "location": "path",
  78875. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  78876. // "required": true,
  78877. // "type": "string"
  78878. // }
  78879. // },
  78880. // "path": "{project}/regions/{region}/instanceGroups/{resource}/testIamPermissions",
  78881. // "request": {
  78882. // "$ref": "TestPermissionsRequest"
  78883. // },
  78884. // "response": {
  78885. // "$ref": "TestPermissionsResponse"
  78886. // },
  78887. // "scopes": [
  78888. // "https://www.googleapis.com/auth/cloud-platform",
  78889. // "https://www.googleapis.com/auth/compute",
  78890. // "https://www.googleapis.com/auth/compute.readonly"
  78891. // ]
  78892. // }
  78893. }
  78894. // method id "compute.regionOperations.delete":
  78895. type RegionOperationsDeleteCall struct {
  78896. s *Service
  78897. project string
  78898. region string
  78899. operation string
  78900. urlParams_ gensupport.URLParams
  78901. ctx_ context.Context
  78902. header_ http.Header
  78903. }
  78904. // Delete: Deletes the specified region-specific Operations resource.
  78905. // For details, see https://cloud.google.com/compute/docs/reference/latest/regionOperations/delete
  78906. func (r *RegionOperationsService) Delete(project string, region string, operation string) *RegionOperationsDeleteCall {
  78907. c := &RegionOperationsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  78908. c.project = project
  78909. c.region = region
  78910. c.operation = operation
  78911. return c
  78912. }
  78913. // Fields allows partial responses to be retrieved. See
  78914. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  78915. // for more information.
  78916. func (c *RegionOperationsDeleteCall) Fields(s ...googleapi.Field) *RegionOperationsDeleteCall {
  78917. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  78918. return c
  78919. }
  78920. // Context sets the context to be used in this call's Do method. Any
  78921. // pending HTTP request will be aborted if the provided context is
  78922. // canceled.
  78923. func (c *RegionOperationsDeleteCall) Context(ctx context.Context) *RegionOperationsDeleteCall {
  78924. c.ctx_ = ctx
  78925. return c
  78926. }
  78927. // Header returns an http.Header that can be modified by the caller to
  78928. // add HTTP headers to the request.
  78929. func (c *RegionOperationsDeleteCall) Header() http.Header {
  78930. if c.header_ == nil {
  78931. c.header_ = make(http.Header)
  78932. }
  78933. return c.header_
  78934. }
  78935. func (c *RegionOperationsDeleteCall) doRequest(alt string) (*http.Response, error) {
  78936. reqHeaders := make(http.Header)
  78937. for k, v := range c.header_ {
  78938. reqHeaders[k] = v
  78939. }
  78940. reqHeaders.Set("User-Agent", c.s.userAgent())
  78941. var body io.Reader = nil
  78942. c.urlParams_.Set("alt", alt)
  78943. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/operations/{operation}")
  78944. urls += "?" + c.urlParams_.Encode()
  78945. req, _ := http.NewRequest("DELETE", urls, body)
  78946. req.Header = reqHeaders
  78947. googleapi.Expand(req.URL, map[string]string{
  78948. "project": c.project,
  78949. "region": c.region,
  78950. "operation": c.operation,
  78951. })
  78952. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  78953. }
  78954. // Do executes the "compute.regionOperations.delete" call.
  78955. func (c *RegionOperationsDeleteCall) Do(opts ...googleapi.CallOption) error {
  78956. gensupport.SetOptions(c.urlParams_, opts...)
  78957. res, err := c.doRequest("json")
  78958. if err != nil {
  78959. return err
  78960. }
  78961. defer googleapi.CloseBody(res)
  78962. if err := googleapi.CheckResponse(res); err != nil {
  78963. return err
  78964. }
  78965. return nil
  78966. // {
  78967. // "description": "Deletes the specified region-specific Operations resource.",
  78968. // "httpMethod": "DELETE",
  78969. // "id": "compute.regionOperations.delete",
  78970. // "parameterOrder": [
  78971. // "project",
  78972. // "region",
  78973. // "operation"
  78974. // ],
  78975. // "parameters": {
  78976. // "operation": {
  78977. // "description": "Name of the Operations resource to delete.",
  78978. // "location": "path",
  78979. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  78980. // "required": true,
  78981. // "type": "string"
  78982. // },
  78983. // "project": {
  78984. // "description": "Project ID for this request.",
  78985. // "location": "path",
  78986. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  78987. // "required": true,
  78988. // "type": "string"
  78989. // },
  78990. // "region": {
  78991. // "description": "Name of the region for this request.",
  78992. // "location": "path",
  78993. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  78994. // "required": true,
  78995. // "type": "string"
  78996. // }
  78997. // },
  78998. // "path": "{project}/regions/{region}/operations/{operation}",
  78999. // "scopes": [
  79000. // "https://www.googleapis.com/auth/cloud-platform",
  79001. // "https://www.googleapis.com/auth/compute"
  79002. // ]
  79003. // }
  79004. }
  79005. // method id "compute.regionOperations.get":
  79006. type RegionOperationsGetCall struct {
  79007. s *Service
  79008. project string
  79009. region string
  79010. operation string
  79011. urlParams_ gensupport.URLParams
  79012. ifNoneMatch_ string
  79013. ctx_ context.Context
  79014. header_ http.Header
  79015. }
  79016. // Get: Retrieves the specified region-specific Operations resource.
  79017. // For details, see https://cloud.google.com/compute/docs/reference/latest/regionOperations/get
  79018. func (r *RegionOperationsService) Get(project string, region string, operation string) *RegionOperationsGetCall {
  79019. c := &RegionOperationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  79020. c.project = project
  79021. c.region = region
  79022. c.operation = operation
  79023. return c
  79024. }
  79025. // Fields allows partial responses to be retrieved. See
  79026. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  79027. // for more information.
  79028. func (c *RegionOperationsGetCall) Fields(s ...googleapi.Field) *RegionOperationsGetCall {
  79029. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  79030. return c
  79031. }
  79032. // IfNoneMatch sets the optional parameter which makes the operation
  79033. // fail if the object's ETag matches the given value. This is useful for
  79034. // getting updates only after the object has changed since the last
  79035. // request. Use googleapi.IsNotModified to check whether the response
  79036. // error from Do is the result of In-None-Match.
  79037. func (c *RegionOperationsGetCall) IfNoneMatch(entityTag string) *RegionOperationsGetCall {
  79038. c.ifNoneMatch_ = entityTag
  79039. return c
  79040. }
  79041. // Context sets the context to be used in this call's Do method. Any
  79042. // pending HTTP request will be aborted if the provided context is
  79043. // canceled.
  79044. func (c *RegionOperationsGetCall) Context(ctx context.Context) *RegionOperationsGetCall {
  79045. c.ctx_ = ctx
  79046. return c
  79047. }
  79048. // Header returns an http.Header that can be modified by the caller to
  79049. // add HTTP headers to the request.
  79050. func (c *RegionOperationsGetCall) Header() http.Header {
  79051. if c.header_ == nil {
  79052. c.header_ = make(http.Header)
  79053. }
  79054. return c.header_
  79055. }
  79056. func (c *RegionOperationsGetCall) doRequest(alt string) (*http.Response, error) {
  79057. reqHeaders := make(http.Header)
  79058. for k, v := range c.header_ {
  79059. reqHeaders[k] = v
  79060. }
  79061. reqHeaders.Set("User-Agent", c.s.userAgent())
  79062. if c.ifNoneMatch_ != "" {
  79063. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  79064. }
  79065. var body io.Reader = nil
  79066. c.urlParams_.Set("alt", alt)
  79067. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/operations/{operation}")
  79068. urls += "?" + c.urlParams_.Encode()
  79069. req, _ := http.NewRequest("GET", urls, body)
  79070. req.Header = reqHeaders
  79071. googleapi.Expand(req.URL, map[string]string{
  79072. "project": c.project,
  79073. "region": c.region,
  79074. "operation": c.operation,
  79075. })
  79076. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  79077. }
  79078. // Do executes the "compute.regionOperations.get" call.
  79079. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  79080. // status code is an error. Response headers are in either
  79081. // *Operation.ServerResponse.Header or (if a response was returned at
  79082. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  79083. // to check whether the returned error was because
  79084. // http.StatusNotModified was returned.
  79085. func (c *RegionOperationsGetCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  79086. gensupport.SetOptions(c.urlParams_, opts...)
  79087. res, err := c.doRequest("json")
  79088. if res != nil && res.StatusCode == http.StatusNotModified {
  79089. if res.Body != nil {
  79090. res.Body.Close()
  79091. }
  79092. return nil, &googleapi.Error{
  79093. Code: res.StatusCode,
  79094. Header: res.Header,
  79095. }
  79096. }
  79097. if err != nil {
  79098. return nil, err
  79099. }
  79100. defer googleapi.CloseBody(res)
  79101. if err := googleapi.CheckResponse(res); err != nil {
  79102. return nil, err
  79103. }
  79104. ret := &Operation{
  79105. ServerResponse: googleapi.ServerResponse{
  79106. Header: res.Header,
  79107. HTTPStatusCode: res.StatusCode,
  79108. },
  79109. }
  79110. target := &ret
  79111. if err := gensupport.DecodeResponse(target, res); err != nil {
  79112. return nil, err
  79113. }
  79114. return ret, nil
  79115. // {
  79116. // "description": "Retrieves the specified region-specific Operations resource.",
  79117. // "httpMethod": "GET",
  79118. // "id": "compute.regionOperations.get",
  79119. // "parameterOrder": [
  79120. // "project",
  79121. // "region",
  79122. // "operation"
  79123. // ],
  79124. // "parameters": {
  79125. // "operation": {
  79126. // "description": "Name of the Operations resource to return.",
  79127. // "location": "path",
  79128. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  79129. // "required": true,
  79130. // "type": "string"
  79131. // },
  79132. // "project": {
  79133. // "description": "Project ID for this request.",
  79134. // "location": "path",
  79135. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  79136. // "required": true,
  79137. // "type": "string"
  79138. // },
  79139. // "region": {
  79140. // "description": "Name of the region for this request.",
  79141. // "location": "path",
  79142. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  79143. // "required": true,
  79144. // "type": "string"
  79145. // }
  79146. // },
  79147. // "path": "{project}/regions/{region}/operations/{operation}",
  79148. // "response": {
  79149. // "$ref": "Operation"
  79150. // },
  79151. // "scopes": [
  79152. // "https://www.googleapis.com/auth/cloud-platform",
  79153. // "https://www.googleapis.com/auth/compute",
  79154. // "https://www.googleapis.com/auth/compute.readonly"
  79155. // ]
  79156. // }
  79157. }
  79158. // method id "compute.regionOperations.list":
  79159. type RegionOperationsListCall struct {
  79160. s *Service
  79161. project string
  79162. region string
  79163. urlParams_ gensupport.URLParams
  79164. ifNoneMatch_ string
  79165. ctx_ context.Context
  79166. header_ http.Header
  79167. }
  79168. // List: Retrieves a list of Operation resources contained within the
  79169. // specified region.
  79170. // For details, see https://cloud.google.com/compute/docs/reference/latest/regionOperations/list
  79171. func (r *RegionOperationsService) List(project string, region string) *RegionOperationsListCall {
  79172. c := &RegionOperationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  79173. c.project = project
  79174. c.region = region
  79175. return c
  79176. }
  79177. // Filter sets the optional parameter "filter": A filter expression that
  79178. // filters resources listed in the response. The expression must specify
  79179. // the field name, a comparison operator, and the value that you want to
  79180. // use for filtering. The value must be a string, a number, or a
  79181. // boolean. The comparison operator must be either =, !=, >, or <.
  79182. //
  79183. // For example, if you are filtering Compute Engine instances, you can
  79184. // exclude instances named example-instance by specifying name !=
  79185. // example-instance.
  79186. //
  79187. // You can also filter nested fields. For example, you could specify
  79188. // scheduling.automaticRestart = false to include instances only if they
  79189. // are not scheduled for automatic restarts. You can use filtering on
  79190. // nested fields to filter based on resource labels.
  79191. //
  79192. // To filter on multiple expressions, provide each separate expression
  79193. // within parentheses. For example, (scheduling.automaticRestart = true)
  79194. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  79195. // AND expression. However, you can include AND and OR expressions
  79196. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  79197. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  79198. // true).
  79199. func (c *RegionOperationsListCall) Filter(filter string) *RegionOperationsListCall {
  79200. c.urlParams_.Set("filter", filter)
  79201. return c
  79202. }
  79203. // MaxResults sets the optional parameter "maxResults": The maximum
  79204. // number of results per page that should be returned. If the number of
  79205. // available results is larger than maxResults, Compute Engine returns a
  79206. // nextPageToken that can be used to get the next page of results in
  79207. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  79208. // (Default: 500)
  79209. func (c *RegionOperationsListCall) MaxResults(maxResults int64) *RegionOperationsListCall {
  79210. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  79211. return c
  79212. }
  79213. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  79214. // a certain order. By default, results are returned in alphanumerical
  79215. // order based on the resource name.
  79216. //
  79217. // You can also sort results in descending order based on the creation
  79218. // timestamp using orderBy="creationTimestamp desc". This sorts results
  79219. // based on the creationTimestamp field in reverse chronological order
  79220. // (newest result first). Use this to sort resources like operations so
  79221. // that the newest operation is returned first.
  79222. //
  79223. // Currently, only sorting by name or creationTimestamp desc is
  79224. // supported.
  79225. func (c *RegionOperationsListCall) OrderBy(orderBy string) *RegionOperationsListCall {
  79226. c.urlParams_.Set("orderBy", orderBy)
  79227. return c
  79228. }
  79229. // PageToken sets the optional parameter "pageToken": Specifies a page
  79230. // token to use. Set pageToken to the nextPageToken returned by a
  79231. // previous list request to get the next page of results.
  79232. func (c *RegionOperationsListCall) PageToken(pageToken string) *RegionOperationsListCall {
  79233. c.urlParams_.Set("pageToken", pageToken)
  79234. return c
  79235. }
  79236. // Fields allows partial responses to be retrieved. See
  79237. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  79238. // for more information.
  79239. func (c *RegionOperationsListCall) Fields(s ...googleapi.Field) *RegionOperationsListCall {
  79240. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  79241. return c
  79242. }
  79243. // IfNoneMatch sets the optional parameter which makes the operation
  79244. // fail if the object's ETag matches the given value. This is useful for
  79245. // getting updates only after the object has changed since the last
  79246. // request. Use googleapi.IsNotModified to check whether the response
  79247. // error from Do is the result of In-None-Match.
  79248. func (c *RegionOperationsListCall) IfNoneMatch(entityTag string) *RegionOperationsListCall {
  79249. c.ifNoneMatch_ = entityTag
  79250. return c
  79251. }
  79252. // Context sets the context to be used in this call's Do method. Any
  79253. // pending HTTP request will be aborted if the provided context is
  79254. // canceled.
  79255. func (c *RegionOperationsListCall) Context(ctx context.Context) *RegionOperationsListCall {
  79256. c.ctx_ = ctx
  79257. return c
  79258. }
  79259. // Header returns an http.Header that can be modified by the caller to
  79260. // add HTTP headers to the request.
  79261. func (c *RegionOperationsListCall) Header() http.Header {
  79262. if c.header_ == nil {
  79263. c.header_ = make(http.Header)
  79264. }
  79265. return c.header_
  79266. }
  79267. func (c *RegionOperationsListCall) doRequest(alt string) (*http.Response, error) {
  79268. reqHeaders := make(http.Header)
  79269. for k, v := range c.header_ {
  79270. reqHeaders[k] = v
  79271. }
  79272. reqHeaders.Set("User-Agent", c.s.userAgent())
  79273. if c.ifNoneMatch_ != "" {
  79274. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  79275. }
  79276. var body io.Reader = nil
  79277. c.urlParams_.Set("alt", alt)
  79278. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/operations")
  79279. urls += "?" + c.urlParams_.Encode()
  79280. req, _ := http.NewRequest("GET", urls, body)
  79281. req.Header = reqHeaders
  79282. googleapi.Expand(req.URL, map[string]string{
  79283. "project": c.project,
  79284. "region": c.region,
  79285. })
  79286. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  79287. }
  79288. // Do executes the "compute.regionOperations.list" call.
  79289. // Exactly one of *OperationList or error will be non-nil. Any non-2xx
  79290. // status code is an error. Response headers are in either
  79291. // *OperationList.ServerResponse.Header or (if a response was returned
  79292. // at all) in error.(*googleapi.Error).Header. Use
  79293. // googleapi.IsNotModified to check whether the returned error was
  79294. // because http.StatusNotModified was returned.
  79295. func (c *RegionOperationsListCall) Do(opts ...googleapi.CallOption) (*OperationList, error) {
  79296. gensupport.SetOptions(c.urlParams_, opts...)
  79297. res, err := c.doRequest("json")
  79298. if res != nil && res.StatusCode == http.StatusNotModified {
  79299. if res.Body != nil {
  79300. res.Body.Close()
  79301. }
  79302. return nil, &googleapi.Error{
  79303. Code: res.StatusCode,
  79304. Header: res.Header,
  79305. }
  79306. }
  79307. if err != nil {
  79308. return nil, err
  79309. }
  79310. defer googleapi.CloseBody(res)
  79311. if err := googleapi.CheckResponse(res); err != nil {
  79312. return nil, err
  79313. }
  79314. ret := &OperationList{
  79315. ServerResponse: googleapi.ServerResponse{
  79316. Header: res.Header,
  79317. HTTPStatusCode: res.StatusCode,
  79318. },
  79319. }
  79320. target := &ret
  79321. if err := gensupport.DecodeResponse(target, res); err != nil {
  79322. return nil, err
  79323. }
  79324. return ret, nil
  79325. // {
  79326. // "description": "Retrieves a list of Operation resources contained within the specified region.",
  79327. // "httpMethod": "GET",
  79328. // "id": "compute.regionOperations.list",
  79329. // "parameterOrder": [
  79330. // "project",
  79331. // "region"
  79332. // ],
  79333. // "parameters": {
  79334. // "filter": {
  79335. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  79336. // "location": "query",
  79337. // "type": "string"
  79338. // },
  79339. // "maxResults": {
  79340. // "default": "500",
  79341. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  79342. // "format": "uint32",
  79343. // "location": "query",
  79344. // "minimum": "0",
  79345. // "type": "integer"
  79346. // },
  79347. // "orderBy": {
  79348. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  79349. // "location": "query",
  79350. // "type": "string"
  79351. // },
  79352. // "pageToken": {
  79353. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  79354. // "location": "query",
  79355. // "type": "string"
  79356. // },
  79357. // "project": {
  79358. // "description": "Project ID for this request.",
  79359. // "location": "path",
  79360. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  79361. // "required": true,
  79362. // "type": "string"
  79363. // },
  79364. // "region": {
  79365. // "description": "Name of the region for this request.",
  79366. // "location": "path",
  79367. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  79368. // "required": true,
  79369. // "type": "string"
  79370. // }
  79371. // },
  79372. // "path": "{project}/regions/{region}/operations",
  79373. // "response": {
  79374. // "$ref": "OperationList"
  79375. // },
  79376. // "scopes": [
  79377. // "https://www.googleapis.com/auth/cloud-platform",
  79378. // "https://www.googleapis.com/auth/compute",
  79379. // "https://www.googleapis.com/auth/compute.readonly"
  79380. // ]
  79381. // }
  79382. }
  79383. // Pages invokes f for each page of results.
  79384. // A non-nil error returned from f will halt the iteration.
  79385. // The provided context supersedes any context provided to the Context method.
  79386. func (c *RegionOperationsListCall) Pages(ctx context.Context, f func(*OperationList) error) error {
  79387. c.ctx_ = ctx
  79388. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  79389. for {
  79390. x, err := c.Do()
  79391. if err != nil {
  79392. return err
  79393. }
  79394. if err := f(x); err != nil {
  79395. return err
  79396. }
  79397. if x.NextPageToken == "" {
  79398. return nil
  79399. }
  79400. c.PageToken(x.NextPageToken)
  79401. }
  79402. }
  79403. // method id "compute.regions.get":
  79404. type RegionsGetCall struct {
  79405. s *Service
  79406. project string
  79407. region string
  79408. urlParams_ gensupport.URLParams
  79409. ifNoneMatch_ string
  79410. ctx_ context.Context
  79411. header_ http.Header
  79412. }
  79413. // Get: Returns the specified Region resource. Gets a list of available
  79414. // regions by making a list() request.
  79415. // For details, see https://cloud.google.com/compute/docs/reference/latest/regions/get
  79416. func (r *RegionsService) Get(project string, region string) *RegionsGetCall {
  79417. c := &RegionsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  79418. c.project = project
  79419. c.region = region
  79420. return c
  79421. }
  79422. // Fields allows partial responses to be retrieved. See
  79423. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  79424. // for more information.
  79425. func (c *RegionsGetCall) Fields(s ...googleapi.Field) *RegionsGetCall {
  79426. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  79427. return c
  79428. }
  79429. // IfNoneMatch sets the optional parameter which makes the operation
  79430. // fail if the object's ETag matches the given value. This is useful for
  79431. // getting updates only after the object has changed since the last
  79432. // request. Use googleapi.IsNotModified to check whether the response
  79433. // error from Do is the result of In-None-Match.
  79434. func (c *RegionsGetCall) IfNoneMatch(entityTag string) *RegionsGetCall {
  79435. c.ifNoneMatch_ = entityTag
  79436. return c
  79437. }
  79438. // Context sets the context to be used in this call's Do method. Any
  79439. // pending HTTP request will be aborted if the provided context is
  79440. // canceled.
  79441. func (c *RegionsGetCall) Context(ctx context.Context) *RegionsGetCall {
  79442. c.ctx_ = ctx
  79443. return c
  79444. }
  79445. // Header returns an http.Header that can be modified by the caller to
  79446. // add HTTP headers to the request.
  79447. func (c *RegionsGetCall) Header() http.Header {
  79448. if c.header_ == nil {
  79449. c.header_ = make(http.Header)
  79450. }
  79451. return c.header_
  79452. }
  79453. func (c *RegionsGetCall) doRequest(alt string) (*http.Response, error) {
  79454. reqHeaders := make(http.Header)
  79455. for k, v := range c.header_ {
  79456. reqHeaders[k] = v
  79457. }
  79458. reqHeaders.Set("User-Agent", c.s.userAgent())
  79459. if c.ifNoneMatch_ != "" {
  79460. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  79461. }
  79462. var body io.Reader = nil
  79463. c.urlParams_.Set("alt", alt)
  79464. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}")
  79465. urls += "?" + c.urlParams_.Encode()
  79466. req, _ := http.NewRequest("GET", urls, body)
  79467. req.Header = reqHeaders
  79468. googleapi.Expand(req.URL, map[string]string{
  79469. "project": c.project,
  79470. "region": c.region,
  79471. })
  79472. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  79473. }
  79474. // Do executes the "compute.regions.get" call.
  79475. // Exactly one of *Region or error will be non-nil. Any non-2xx status
  79476. // code is an error. Response headers are in either
  79477. // *Region.ServerResponse.Header or (if a response was returned at all)
  79478. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  79479. // check whether the returned error was because http.StatusNotModified
  79480. // was returned.
  79481. func (c *RegionsGetCall) Do(opts ...googleapi.CallOption) (*Region, error) {
  79482. gensupport.SetOptions(c.urlParams_, opts...)
  79483. res, err := c.doRequest("json")
  79484. if res != nil && res.StatusCode == http.StatusNotModified {
  79485. if res.Body != nil {
  79486. res.Body.Close()
  79487. }
  79488. return nil, &googleapi.Error{
  79489. Code: res.StatusCode,
  79490. Header: res.Header,
  79491. }
  79492. }
  79493. if err != nil {
  79494. return nil, err
  79495. }
  79496. defer googleapi.CloseBody(res)
  79497. if err := googleapi.CheckResponse(res); err != nil {
  79498. return nil, err
  79499. }
  79500. ret := &Region{
  79501. ServerResponse: googleapi.ServerResponse{
  79502. Header: res.Header,
  79503. HTTPStatusCode: res.StatusCode,
  79504. },
  79505. }
  79506. target := &ret
  79507. if err := gensupport.DecodeResponse(target, res); err != nil {
  79508. return nil, err
  79509. }
  79510. return ret, nil
  79511. // {
  79512. // "description": "Returns the specified Region resource. Gets a list of available regions by making a list() request.",
  79513. // "httpMethod": "GET",
  79514. // "id": "compute.regions.get",
  79515. // "parameterOrder": [
  79516. // "project",
  79517. // "region"
  79518. // ],
  79519. // "parameters": {
  79520. // "project": {
  79521. // "description": "Project ID for this request.",
  79522. // "location": "path",
  79523. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  79524. // "required": true,
  79525. // "type": "string"
  79526. // },
  79527. // "region": {
  79528. // "description": "Name of the region resource to return.",
  79529. // "location": "path",
  79530. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  79531. // "required": true,
  79532. // "type": "string"
  79533. // }
  79534. // },
  79535. // "path": "{project}/regions/{region}",
  79536. // "response": {
  79537. // "$ref": "Region"
  79538. // },
  79539. // "scopes": [
  79540. // "https://www.googleapis.com/auth/cloud-platform",
  79541. // "https://www.googleapis.com/auth/compute",
  79542. // "https://www.googleapis.com/auth/compute.readonly"
  79543. // ]
  79544. // }
  79545. }
  79546. // method id "compute.regions.list":
  79547. type RegionsListCall struct {
  79548. s *Service
  79549. project string
  79550. urlParams_ gensupport.URLParams
  79551. ifNoneMatch_ string
  79552. ctx_ context.Context
  79553. header_ http.Header
  79554. }
  79555. // List: Retrieves the list of region resources available to the
  79556. // specified project.
  79557. // For details, see https://cloud.google.com/compute/docs/reference/latest/regions/list
  79558. func (r *RegionsService) List(project string) *RegionsListCall {
  79559. c := &RegionsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  79560. c.project = project
  79561. return c
  79562. }
  79563. // Filter sets the optional parameter "filter": A filter expression that
  79564. // filters resources listed in the response. The expression must specify
  79565. // the field name, a comparison operator, and the value that you want to
  79566. // use for filtering. The value must be a string, a number, or a
  79567. // boolean. The comparison operator must be either =, !=, >, or <.
  79568. //
  79569. // For example, if you are filtering Compute Engine instances, you can
  79570. // exclude instances named example-instance by specifying name !=
  79571. // example-instance.
  79572. //
  79573. // You can also filter nested fields. For example, you could specify
  79574. // scheduling.automaticRestart = false to include instances only if they
  79575. // are not scheduled for automatic restarts. You can use filtering on
  79576. // nested fields to filter based on resource labels.
  79577. //
  79578. // To filter on multiple expressions, provide each separate expression
  79579. // within parentheses. For example, (scheduling.automaticRestart = true)
  79580. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  79581. // AND expression. However, you can include AND and OR expressions
  79582. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  79583. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  79584. // true).
  79585. func (c *RegionsListCall) Filter(filter string) *RegionsListCall {
  79586. c.urlParams_.Set("filter", filter)
  79587. return c
  79588. }
  79589. // MaxResults sets the optional parameter "maxResults": The maximum
  79590. // number of results per page that should be returned. If the number of
  79591. // available results is larger than maxResults, Compute Engine returns a
  79592. // nextPageToken that can be used to get the next page of results in
  79593. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  79594. // (Default: 500)
  79595. func (c *RegionsListCall) MaxResults(maxResults int64) *RegionsListCall {
  79596. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  79597. return c
  79598. }
  79599. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  79600. // a certain order. By default, results are returned in alphanumerical
  79601. // order based on the resource name.
  79602. //
  79603. // You can also sort results in descending order based on the creation
  79604. // timestamp using orderBy="creationTimestamp desc". This sorts results
  79605. // based on the creationTimestamp field in reverse chronological order
  79606. // (newest result first). Use this to sort resources like operations so
  79607. // that the newest operation is returned first.
  79608. //
  79609. // Currently, only sorting by name or creationTimestamp desc is
  79610. // supported.
  79611. func (c *RegionsListCall) OrderBy(orderBy string) *RegionsListCall {
  79612. c.urlParams_.Set("orderBy", orderBy)
  79613. return c
  79614. }
  79615. // PageToken sets the optional parameter "pageToken": Specifies a page
  79616. // token to use. Set pageToken to the nextPageToken returned by a
  79617. // previous list request to get the next page of results.
  79618. func (c *RegionsListCall) PageToken(pageToken string) *RegionsListCall {
  79619. c.urlParams_.Set("pageToken", pageToken)
  79620. return c
  79621. }
  79622. // Fields allows partial responses to be retrieved. See
  79623. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  79624. // for more information.
  79625. func (c *RegionsListCall) Fields(s ...googleapi.Field) *RegionsListCall {
  79626. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  79627. return c
  79628. }
  79629. // IfNoneMatch sets the optional parameter which makes the operation
  79630. // fail if the object's ETag matches the given value. This is useful for
  79631. // getting updates only after the object has changed since the last
  79632. // request. Use googleapi.IsNotModified to check whether the response
  79633. // error from Do is the result of In-None-Match.
  79634. func (c *RegionsListCall) IfNoneMatch(entityTag string) *RegionsListCall {
  79635. c.ifNoneMatch_ = entityTag
  79636. return c
  79637. }
  79638. // Context sets the context to be used in this call's Do method. Any
  79639. // pending HTTP request will be aborted if the provided context is
  79640. // canceled.
  79641. func (c *RegionsListCall) Context(ctx context.Context) *RegionsListCall {
  79642. c.ctx_ = ctx
  79643. return c
  79644. }
  79645. // Header returns an http.Header that can be modified by the caller to
  79646. // add HTTP headers to the request.
  79647. func (c *RegionsListCall) Header() http.Header {
  79648. if c.header_ == nil {
  79649. c.header_ = make(http.Header)
  79650. }
  79651. return c.header_
  79652. }
  79653. func (c *RegionsListCall) doRequest(alt string) (*http.Response, error) {
  79654. reqHeaders := make(http.Header)
  79655. for k, v := range c.header_ {
  79656. reqHeaders[k] = v
  79657. }
  79658. reqHeaders.Set("User-Agent", c.s.userAgent())
  79659. if c.ifNoneMatch_ != "" {
  79660. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  79661. }
  79662. var body io.Reader = nil
  79663. c.urlParams_.Set("alt", alt)
  79664. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions")
  79665. urls += "?" + c.urlParams_.Encode()
  79666. req, _ := http.NewRequest("GET", urls, body)
  79667. req.Header = reqHeaders
  79668. googleapi.Expand(req.URL, map[string]string{
  79669. "project": c.project,
  79670. })
  79671. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  79672. }
  79673. // Do executes the "compute.regions.list" call.
  79674. // Exactly one of *RegionList or error will be non-nil. Any non-2xx
  79675. // status code is an error. Response headers are in either
  79676. // *RegionList.ServerResponse.Header or (if a response was returned at
  79677. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  79678. // to check whether the returned error was because
  79679. // http.StatusNotModified was returned.
  79680. func (c *RegionsListCall) Do(opts ...googleapi.CallOption) (*RegionList, error) {
  79681. gensupport.SetOptions(c.urlParams_, opts...)
  79682. res, err := c.doRequest("json")
  79683. if res != nil && res.StatusCode == http.StatusNotModified {
  79684. if res.Body != nil {
  79685. res.Body.Close()
  79686. }
  79687. return nil, &googleapi.Error{
  79688. Code: res.StatusCode,
  79689. Header: res.Header,
  79690. }
  79691. }
  79692. if err != nil {
  79693. return nil, err
  79694. }
  79695. defer googleapi.CloseBody(res)
  79696. if err := googleapi.CheckResponse(res); err != nil {
  79697. return nil, err
  79698. }
  79699. ret := &RegionList{
  79700. ServerResponse: googleapi.ServerResponse{
  79701. Header: res.Header,
  79702. HTTPStatusCode: res.StatusCode,
  79703. },
  79704. }
  79705. target := &ret
  79706. if err := gensupport.DecodeResponse(target, res); err != nil {
  79707. return nil, err
  79708. }
  79709. return ret, nil
  79710. // {
  79711. // "description": "Retrieves the list of region resources available to the specified project.",
  79712. // "httpMethod": "GET",
  79713. // "id": "compute.regions.list",
  79714. // "parameterOrder": [
  79715. // "project"
  79716. // ],
  79717. // "parameters": {
  79718. // "filter": {
  79719. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  79720. // "location": "query",
  79721. // "type": "string"
  79722. // },
  79723. // "maxResults": {
  79724. // "default": "500",
  79725. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  79726. // "format": "uint32",
  79727. // "location": "query",
  79728. // "minimum": "0",
  79729. // "type": "integer"
  79730. // },
  79731. // "orderBy": {
  79732. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  79733. // "location": "query",
  79734. // "type": "string"
  79735. // },
  79736. // "pageToken": {
  79737. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  79738. // "location": "query",
  79739. // "type": "string"
  79740. // },
  79741. // "project": {
  79742. // "description": "Project ID for this request.",
  79743. // "location": "path",
  79744. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  79745. // "required": true,
  79746. // "type": "string"
  79747. // }
  79748. // },
  79749. // "path": "{project}/regions",
  79750. // "response": {
  79751. // "$ref": "RegionList"
  79752. // },
  79753. // "scopes": [
  79754. // "https://www.googleapis.com/auth/cloud-platform",
  79755. // "https://www.googleapis.com/auth/compute",
  79756. // "https://www.googleapis.com/auth/compute.readonly"
  79757. // ]
  79758. // }
  79759. }
  79760. // Pages invokes f for each page of results.
  79761. // A non-nil error returned from f will halt the iteration.
  79762. // The provided context supersedes any context provided to the Context method.
  79763. func (c *RegionsListCall) Pages(ctx context.Context, f func(*RegionList) error) error {
  79764. c.ctx_ = ctx
  79765. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  79766. for {
  79767. x, err := c.Do()
  79768. if err != nil {
  79769. return err
  79770. }
  79771. if err := f(x); err != nil {
  79772. return err
  79773. }
  79774. if x.NextPageToken == "" {
  79775. return nil
  79776. }
  79777. c.PageToken(x.NextPageToken)
  79778. }
  79779. }
  79780. // method id "compute.routers.aggregatedList":
  79781. type RoutersAggregatedListCall struct {
  79782. s *Service
  79783. project string
  79784. urlParams_ gensupport.URLParams
  79785. ifNoneMatch_ string
  79786. ctx_ context.Context
  79787. header_ http.Header
  79788. }
  79789. // AggregatedList: Retrieves an aggregated list of routers.
  79790. func (r *RoutersService) AggregatedList(project string) *RoutersAggregatedListCall {
  79791. c := &RoutersAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  79792. c.project = project
  79793. return c
  79794. }
  79795. // Filter sets the optional parameter "filter": A filter expression that
  79796. // filters resources listed in the response. The expression must specify
  79797. // the field name, a comparison operator, and the value that you want to
  79798. // use for filtering. The value must be a string, a number, or a
  79799. // boolean. The comparison operator must be either =, !=, >, or <.
  79800. //
  79801. // For example, if you are filtering Compute Engine instances, you can
  79802. // exclude instances named example-instance by specifying name !=
  79803. // example-instance.
  79804. //
  79805. // You can also filter nested fields. For example, you could specify
  79806. // scheduling.automaticRestart = false to include instances only if they
  79807. // are not scheduled for automatic restarts. You can use filtering on
  79808. // nested fields to filter based on resource labels.
  79809. //
  79810. // To filter on multiple expressions, provide each separate expression
  79811. // within parentheses. For example, (scheduling.automaticRestart = true)
  79812. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  79813. // AND expression. However, you can include AND and OR expressions
  79814. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  79815. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  79816. // true).
  79817. func (c *RoutersAggregatedListCall) Filter(filter string) *RoutersAggregatedListCall {
  79818. c.urlParams_.Set("filter", filter)
  79819. return c
  79820. }
  79821. // MaxResults sets the optional parameter "maxResults": The maximum
  79822. // number of results per page that should be returned. If the number of
  79823. // available results is larger than maxResults, Compute Engine returns a
  79824. // nextPageToken that can be used to get the next page of results in
  79825. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  79826. // (Default: 500)
  79827. func (c *RoutersAggregatedListCall) MaxResults(maxResults int64) *RoutersAggregatedListCall {
  79828. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  79829. return c
  79830. }
  79831. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  79832. // a certain order. By default, results are returned in alphanumerical
  79833. // order based on the resource name.
  79834. //
  79835. // You can also sort results in descending order based on the creation
  79836. // timestamp using orderBy="creationTimestamp desc". This sorts results
  79837. // based on the creationTimestamp field in reverse chronological order
  79838. // (newest result first). Use this to sort resources like operations so
  79839. // that the newest operation is returned first.
  79840. //
  79841. // Currently, only sorting by name or creationTimestamp desc is
  79842. // supported.
  79843. func (c *RoutersAggregatedListCall) OrderBy(orderBy string) *RoutersAggregatedListCall {
  79844. c.urlParams_.Set("orderBy", orderBy)
  79845. return c
  79846. }
  79847. // PageToken sets the optional parameter "pageToken": Specifies a page
  79848. // token to use. Set pageToken to the nextPageToken returned by a
  79849. // previous list request to get the next page of results.
  79850. func (c *RoutersAggregatedListCall) PageToken(pageToken string) *RoutersAggregatedListCall {
  79851. c.urlParams_.Set("pageToken", pageToken)
  79852. return c
  79853. }
  79854. // Fields allows partial responses to be retrieved. See
  79855. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  79856. // for more information.
  79857. func (c *RoutersAggregatedListCall) Fields(s ...googleapi.Field) *RoutersAggregatedListCall {
  79858. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  79859. return c
  79860. }
  79861. // IfNoneMatch sets the optional parameter which makes the operation
  79862. // fail if the object's ETag matches the given value. This is useful for
  79863. // getting updates only after the object has changed since the last
  79864. // request. Use googleapi.IsNotModified to check whether the response
  79865. // error from Do is the result of In-None-Match.
  79866. func (c *RoutersAggregatedListCall) IfNoneMatch(entityTag string) *RoutersAggregatedListCall {
  79867. c.ifNoneMatch_ = entityTag
  79868. return c
  79869. }
  79870. // Context sets the context to be used in this call's Do method. Any
  79871. // pending HTTP request will be aborted if the provided context is
  79872. // canceled.
  79873. func (c *RoutersAggregatedListCall) Context(ctx context.Context) *RoutersAggregatedListCall {
  79874. c.ctx_ = ctx
  79875. return c
  79876. }
  79877. // Header returns an http.Header that can be modified by the caller to
  79878. // add HTTP headers to the request.
  79879. func (c *RoutersAggregatedListCall) Header() http.Header {
  79880. if c.header_ == nil {
  79881. c.header_ = make(http.Header)
  79882. }
  79883. return c.header_
  79884. }
  79885. func (c *RoutersAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  79886. reqHeaders := make(http.Header)
  79887. for k, v := range c.header_ {
  79888. reqHeaders[k] = v
  79889. }
  79890. reqHeaders.Set("User-Agent", c.s.userAgent())
  79891. if c.ifNoneMatch_ != "" {
  79892. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  79893. }
  79894. var body io.Reader = nil
  79895. c.urlParams_.Set("alt", alt)
  79896. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/routers")
  79897. urls += "?" + c.urlParams_.Encode()
  79898. req, _ := http.NewRequest("GET", urls, body)
  79899. req.Header = reqHeaders
  79900. googleapi.Expand(req.URL, map[string]string{
  79901. "project": c.project,
  79902. })
  79903. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  79904. }
  79905. // Do executes the "compute.routers.aggregatedList" call.
  79906. // Exactly one of *RouterAggregatedList or error will be non-nil. Any
  79907. // non-2xx status code is an error. Response headers are in either
  79908. // *RouterAggregatedList.ServerResponse.Header or (if a response was
  79909. // returned at all) in error.(*googleapi.Error).Header. Use
  79910. // googleapi.IsNotModified to check whether the returned error was
  79911. // because http.StatusNotModified was returned.
  79912. func (c *RoutersAggregatedListCall) Do(opts ...googleapi.CallOption) (*RouterAggregatedList, error) {
  79913. gensupport.SetOptions(c.urlParams_, opts...)
  79914. res, err := c.doRequest("json")
  79915. if res != nil && res.StatusCode == http.StatusNotModified {
  79916. if res.Body != nil {
  79917. res.Body.Close()
  79918. }
  79919. return nil, &googleapi.Error{
  79920. Code: res.StatusCode,
  79921. Header: res.Header,
  79922. }
  79923. }
  79924. if err != nil {
  79925. return nil, err
  79926. }
  79927. defer googleapi.CloseBody(res)
  79928. if err := googleapi.CheckResponse(res); err != nil {
  79929. return nil, err
  79930. }
  79931. ret := &RouterAggregatedList{
  79932. ServerResponse: googleapi.ServerResponse{
  79933. Header: res.Header,
  79934. HTTPStatusCode: res.StatusCode,
  79935. },
  79936. }
  79937. target := &ret
  79938. if err := gensupport.DecodeResponse(target, res); err != nil {
  79939. return nil, err
  79940. }
  79941. return ret, nil
  79942. // {
  79943. // "description": "Retrieves an aggregated list of routers.",
  79944. // "httpMethod": "GET",
  79945. // "id": "compute.routers.aggregatedList",
  79946. // "parameterOrder": [
  79947. // "project"
  79948. // ],
  79949. // "parameters": {
  79950. // "filter": {
  79951. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  79952. // "location": "query",
  79953. // "type": "string"
  79954. // },
  79955. // "maxResults": {
  79956. // "default": "500",
  79957. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  79958. // "format": "uint32",
  79959. // "location": "query",
  79960. // "minimum": "0",
  79961. // "type": "integer"
  79962. // },
  79963. // "orderBy": {
  79964. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  79965. // "location": "query",
  79966. // "type": "string"
  79967. // },
  79968. // "pageToken": {
  79969. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  79970. // "location": "query",
  79971. // "type": "string"
  79972. // },
  79973. // "project": {
  79974. // "description": "Project ID for this request.",
  79975. // "location": "path",
  79976. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  79977. // "required": true,
  79978. // "type": "string"
  79979. // }
  79980. // },
  79981. // "path": "{project}/aggregated/routers",
  79982. // "response": {
  79983. // "$ref": "RouterAggregatedList"
  79984. // },
  79985. // "scopes": [
  79986. // "https://www.googleapis.com/auth/cloud-platform",
  79987. // "https://www.googleapis.com/auth/compute",
  79988. // "https://www.googleapis.com/auth/compute.readonly"
  79989. // ]
  79990. // }
  79991. }
  79992. // Pages invokes f for each page of results.
  79993. // A non-nil error returned from f will halt the iteration.
  79994. // The provided context supersedes any context provided to the Context method.
  79995. func (c *RoutersAggregatedListCall) Pages(ctx context.Context, f func(*RouterAggregatedList) error) error {
  79996. c.ctx_ = ctx
  79997. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  79998. for {
  79999. x, err := c.Do()
  80000. if err != nil {
  80001. return err
  80002. }
  80003. if err := f(x); err != nil {
  80004. return err
  80005. }
  80006. if x.NextPageToken == "" {
  80007. return nil
  80008. }
  80009. c.PageToken(x.NextPageToken)
  80010. }
  80011. }
  80012. // method id "compute.routers.delete":
  80013. type RoutersDeleteCall struct {
  80014. s *Service
  80015. project string
  80016. region string
  80017. router string
  80018. urlParams_ gensupport.URLParams
  80019. ctx_ context.Context
  80020. header_ http.Header
  80021. }
  80022. // Delete: Deletes the specified Router resource.
  80023. func (r *RoutersService) Delete(project string, region string, router string) *RoutersDeleteCall {
  80024. c := &RoutersDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  80025. c.project = project
  80026. c.region = region
  80027. c.router = router
  80028. return c
  80029. }
  80030. // RequestId sets the optional parameter "requestId": An optional
  80031. // request ID to identify requests. Specify a unique request ID so that
  80032. // if you must retry your request, the server will know to ignore the
  80033. // request if it has already been completed.
  80034. //
  80035. // For example, consider a situation where you make an initial request
  80036. // and the request times out. If you make the request again with the
  80037. // same request ID, the server can check if original operation with the
  80038. // same request ID was received, and if so, will ignore the second
  80039. // request. This prevents clients from accidentally creating duplicate
  80040. // commitments.
  80041. //
  80042. // The request ID must be a valid UUID with the exception that zero UUID
  80043. // is not supported (00000000-0000-0000-0000-000000000000).
  80044. func (c *RoutersDeleteCall) RequestId(requestId string) *RoutersDeleteCall {
  80045. c.urlParams_.Set("requestId", requestId)
  80046. return c
  80047. }
  80048. // Fields allows partial responses to be retrieved. See
  80049. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  80050. // for more information.
  80051. func (c *RoutersDeleteCall) Fields(s ...googleapi.Field) *RoutersDeleteCall {
  80052. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  80053. return c
  80054. }
  80055. // Context sets the context to be used in this call's Do method. Any
  80056. // pending HTTP request will be aborted if the provided context is
  80057. // canceled.
  80058. func (c *RoutersDeleteCall) Context(ctx context.Context) *RoutersDeleteCall {
  80059. c.ctx_ = ctx
  80060. return c
  80061. }
  80062. // Header returns an http.Header that can be modified by the caller to
  80063. // add HTTP headers to the request.
  80064. func (c *RoutersDeleteCall) Header() http.Header {
  80065. if c.header_ == nil {
  80066. c.header_ = make(http.Header)
  80067. }
  80068. return c.header_
  80069. }
  80070. func (c *RoutersDeleteCall) doRequest(alt string) (*http.Response, error) {
  80071. reqHeaders := make(http.Header)
  80072. for k, v := range c.header_ {
  80073. reqHeaders[k] = v
  80074. }
  80075. reqHeaders.Set("User-Agent", c.s.userAgent())
  80076. var body io.Reader = nil
  80077. c.urlParams_.Set("alt", alt)
  80078. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/routers/{router}")
  80079. urls += "?" + c.urlParams_.Encode()
  80080. req, _ := http.NewRequest("DELETE", urls, body)
  80081. req.Header = reqHeaders
  80082. googleapi.Expand(req.URL, map[string]string{
  80083. "project": c.project,
  80084. "region": c.region,
  80085. "router": c.router,
  80086. })
  80087. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  80088. }
  80089. // Do executes the "compute.routers.delete" call.
  80090. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  80091. // status code is an error. Response headers are in either
  80092. // *Operation.ServerResponse.Header or (if a response was returned at
  80093. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  80094. // to check whether the returned error was because
  80095. // http.StatusNotModified was returned.
  80096. func (c *RoutersDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  80097. gensupport.SetOptions(c.urlParams_, opts...)
  80098. res, err := c.doRequest("json")
  80099. if res != nil && res.StatusCode == http.StatusNotModified {
  80100. if res.Body != nil {
  80101. res.Body.Close()
  80102. }
  80103. return nil, &googleapi.Error{
  80104. Code: res.StatusCode,
  80105. Header: res.Header,
  80106. }
  80107. }
  80108. if err != nil {
  80109. return nil, err
  80110. }
  80111. defer googleapi.CloseBody(res)
  80112. if err := googleapi.CheckResponse(res); err != nil {
  80113. return nil, err
  80114. }
  80115. ret := &Operation{
  80116. ServerResponse: googleapi.ServerResponse{
  80117. Header: res.Header,
  80118. HTTPStatusCode: res.StatusCode,
  80119. },
  80120. }
  80121. target := &ret
  80122. if err := gensupport.DecodeResponse(target, res); err != nil {
  80123. return nil, err
  80124. }
  80125. return ret, nil
  80126. // {
  80127. // "description": "Deletes the specified Router resource.",
  80128. // "httpMethod": "DELETE",
  80129. // "id": "compute.routers.delete",
  80130. // "parameterOrder": [
  80131. // "project",
  80132. // "region",
  80133. // "router"
  80134. // ],
  80135. // "parameters": {
  80136. // "project": {
  80137. // "description": "Project ID for this request.",
  80138. // "location": "path",
  80139. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  80140. // "required": true,
  80141. // "type": "string"
  80142. // },
  80143. // "region": {
  80144. // "description": "Name of the region for this request.",
  80145. // "location": "path",
  80146. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  80147. // "required": true,
  80148. // "type": "string"
  80149. // },
  80150. // "requestId": {
  80151. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  80152. // "location": "query",
  80153. // "type": "string"
  80154. // },
  80155. // "router": {
  80156. // "description": "Name of the Router resource to delete.",
  80157. // "location": "path",
  80158. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  80159. // "required": true,
  80160. // "type": "string"
  80161. // }
  80162. // },
  80163. // "path": "{project}/regions/{region}/routers/{router}",
  80164. // "response": {
  80165. // "$ref": "Operation"
  80166. // },
  80167. // "scopes": [
  80168. // "https://www.googleapis.com/auth/cloud-platform",
  80169. // "https://www.googleapis.com/auth/compute"
  80170. // ]
  80171. // }
  80172. }
  80173. // method id "compute.routers.get":
  80174. type RoutersGetCall struct {
  80175. s *Service
  80176. project string
  80177. region string
  80178. router string
  80179. urlParams_ gensupport.URLParams
  80180. ifNoneMatch_ string
  80181. ctx_ context.Context
  80182. header_ http.Header
  80183. }
  80184. // Get: Returns the specified Router resource. Gets a list of available
  80185. // routers by making a list() request.
  80186. func (r *RoutersService) Get(project string, region string, router string) *RoutersGetCall {
  80187. c := &RoutersGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  80188. c.project = project
  80189. c.region = region
  80190. c.router = router
  80191. return c
  80192. }
  80193. // Fields allows partial responses to be retrieved. See
  80194. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  80195. // for more information.
  80196. func (c *RoutersGetCall) Fields(s ...googleapi.Field) *RoutersGetCall {
  80197. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  80198. return c
  80199. }
  80200. // IfNoneMatch sets the optional parameter which makes the operation
  80201. // fail if the object's ETag matches the given value. This is useful for
  80202. // getting updates only after the object has changed since the last
  80203. // request. Use googleapi.IsNotModified to check whether the response
  80204. // error from Do is the result of In-None-Match.
  80205. func (c *RoutersGetCall) IfNoneMatch(entityTag string) *RoutersGetCall {
  80206. c.ifNoneMatch_ = entityTag
  80207. return c
  80208. }
  80209. // Context sets the context to be used in this call's Do method. Any
  80210. // pending HTTP request will be aborted if the provided context is
  80211. // canceled.
  80212. func (c *RoutersGetCall) Context(ctx context.Context) *RoutersGetCall {
  80213. c.ctx_ = ctx
  80214. return c
  80215. }
  80216. // Header returns an http.Header that can be modified by the caller to
  80217. // add HTTP headers to the request.
  80218. func (c *RoutersGetCall) Header() http.Header {
  80219. if c.header_ == nil {
  80220. c.header_ = make(http.Header)
  80221. }
  80222. return c.header_
  80223. }
  80224. func (c *RoutersGetCall) doRequest(alt string) (*http.Response, error) {
  80225. reqHeaders := make(http.Header)
  80226. for k, v := range c.header_ {
  80227. reqHeaders[k] = v
  80228. }
  80229. reqHeaders.Set("User-Agent", c.s.userAgent())
  80230. if c.ifNoneMatch_ != "" {
  80231. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  80232. }
  80233. var body io.Reader = nil
  80234. c.urlParams_.Set("alt", alt)
  80235. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/routers/{router}")
  80236. urls += "?" + c.urlParams_.Encode()
  80237. req, _ := http.NewRequest("GET", urls, body)
  80238. req.Header = reqHeaders
  80239. googleapi.Expand(req.URL, map[string]string{
  80240. "project": c.project,
  80241. "region": c.region,
  80242. "router": c.router,
  80243. })
  80244. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  80245. }
  80246. // Do executes the "compute.routers.get" call.
  80247. // Exactly one of *Router or error will be non-nil. Any non-2xx status
  80248. // code is an error. Response headers are in either
  80249. // *Router.ServerResponse.Header or (if a response was returned at all)
  80250. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  80251. // check whether the returned error was because http.StatusNotModified
  80252. // was returned.
  80253. func (c *RoutersGetCall) Do(opts ...googleapi.CallOption) (*Router, error) {
  80254. gensupport.SetOptions(c.urlParams_, opts...)
  80255. res, err := c.doRequest("json")
  80256. if res != nil && res.StatusCode == http.StatusNotModified {
  80257. if res.Body != nil {
  80258. res.Body.Close()
  80259. }
  80260. return nil, &googleapi.Error{
  80261. Code: res.StatusCode,
  80262. Header: res.Header,
  80263. }
  80264. }
  80265. if err != nil {
  80266. return nil, err
  80267. }
  80268. defer googleapi.CloseBody(res)
  80269. if err := googleapi.CheckResponse(res); err != nil {
  80270. return nil, err
  80271. }
  80272. ret := &Router{
  80273. ServerResponse: googleapi.ServerResponse{
  80274. Header: res.Header,
  80275. HTTPStatusCode: res.StatusCode,
  80276. },
  80277. }
  80278. target := &ret
  80279. if err := gensupport.DecodeResponse(target, res); err != nil {
  80280. return nil, err
  80281. }
  80282. return ret, nil
  80283. // {
  80284. // "description": "Returns the specified Router resource. Gets a list of available routers by making a list() request.",
  80285. // "httpMethod": "GET",
  80286. // "id": "compute.routers.get",
  80287. // "parameterOrder": [
  80288. // "project",
  80289. // "region",
  80290. // "router"
  80291. // ],
  80292. // "parameters": {
  80293. // "project": {
  80294. // "description": "Project ID for this request.",
  80295. // "location": "path",
  80296. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  80297. // "required": true,
  80298. // "type": "string"
  80299. // },
  80300. // "region": {
  80301. // "description": "Name of the region for this request.",
  80302. // "location": "path",
  80303. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  80304. // "required": true,
  80305. // "type": "string"
  80306. // },
  80307. // "router": {
  80308. // "description": "Name of the Router resource to return.",
  80309. // "location": "path",
  80310. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  80311. // "required": true,
  80312. // "type": "string"
  80313. // }
  80314. // },
  80315. // "path": "{project}/regions/{region}/routers/{router}",
  80316. // "response": {
  80317. // "$ref": "Router"
  80318. // },
  80319. // "scopes": [
  80320. // "https://www.googleapis.com/auth/cloud-platform",
  80321. // "https://www.googleapis.com/auth/compute",
  80322. // "https://www.googleapis.com/auth/compute.readonly"
  80323. // ]
  80324. // }
  80325. }
  80326. // method id "compute.routers.getRouterStatus":
  80327. type RoutersGetRouterStatusCall struct {
  80328. s *Service
  80329. project string
  80330. region string
  80331. router string
  80332. urlParams_ gensupport.URLParams
  80333. ifNoneMatch_ string
  80334. ctx_ context.Context
  80335. header_ http.Header
  80336. }
  80337. // GetRouterStatus: Retrieves runtime information of the specified
  80338. // router.
  80339. func (r *RoutersService) GetRouterStatus(project string, region string, router string) *RoutersGetRouterStatusCall {
  80340. c := &RoutersGetRouterStatusCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  80341. c.project = project
  80342. c.region = region
  80343. c.router = router
  80344. return c
  80345. }
  80346. // Fields allows partial responses to be retrieved. See
  80347. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  80348. // for more information.
  80349. func (c *RoutersGetRouterStatusCall) Fields(s ...googleapi.Field) *RoutersGetRouterStatusCall {
  80350. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  80351. return c
  80352. }
  80353. // IfNoneMatch sets the optional parameter which makes the operation
  80354. // fail if the object's ETag matches the given value. This is useful for
  80355. // getting updates only after the object has changed since the last
  80356. // request. Use googleapi.IsNotModified to check whether the response
  80357. // error from Do is the result of In-None-Match.
  80358. func (c *RoutersGetRouterStatusCall) IfNoneMatch(entityTag string) *RoutersGetRouterStatusCall {
  80359. c.ifNoneMatch_ = entityTag
  80360. return c
  80361. }
  80362. // Context sets the context to be used in this call's Do method. Any
  80363. // pending HTTP request will be aborted if the provided context is
  80364. // canceled.
  80365. func (c *RoutersGetRouterStatusCall) Context(ctx context.Context) *RoutersGetRouterStatusCall {
  80366. c.ctx_ = ctx
  80367. return c
  80368. }
  80369. // Header returns an http.Header that can be modified by the caller to
  80370. // add HTTP headers to the request.
  80371. func (c *RoutersGetRouterStatusCall) Header() http.Header {
  80372. if c.header_ == nil {
  80373. c.header_ = make(http.Header)
  80374. }
  80375. return c.header_
  80376. }
  80377. func (c *RoutersGetRouterStatusCall) doRequest(alt string) (*http.Response, error) {
  80378. reqHeaders := make(http.Header)
  80379. for k, v := range c.header_ {
  80380. reqHeaders[k] = v
  80381. }
  80382. reqHeaders.Set("User-Agent", c.s.userAgent())
  80383. if c.ifNoneMatch_ != "" {
  80384. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  80385. }
  80386. var body io.Reader = nil
  80387. c.urlParams_.Set("alt", alt)
  80388. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/routers/{router}/getRouterStatus")
  80389. urls += "?" + c.urlParams_.Encode()
  80390. req, _ := http.NewRequest("GET", urls, body)
  80391. req.Header = reqHeaders
  80392. googleapi.Expand(req.URL, map[string]string{
  80393. "project": c.project,
  80394. "region": c.region,
  80395. "router": c.router,
  80396. })
  80397. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  80398. }
  80399. // Do executes the "compute.routers.getRouterStatus" call.
  80400. // Exactly one of *RouterStatusResponse or error will be non-nil. Any
  80401. // non-2xx status code is an error. Response headers are in either
  80402. // *RouterStatusResponse.ServerResponse.Header or (if a response was
  80403. // returned at all) in error.(*googleapi.Error).Header. Use
  80404. // googleapi.IsNotModified to check whether the returned error was
  80405. // because http.StatusNotModified was returned.
  80406. func (c *RoutersGetRouterStatusCall) Do(opts ...googleapi.CallOption) (*RouterStatusResponse, error) {
  80407. gensupport.SetOptions(c.urlParams_, opts...)
  80408. res, err := c.doRequest("json")
  80409. if res != nil && res.StatusCode == http.StatusNotModified {
  80410. if res.Body != nil {
  80411. res.Body.Close()
  80412. }
  80413. return nil, &googleapi.Error{
  80414. Code: res.StatusCode,
  80415. Header: res.Header,
  80416. }
  80417. }
  80418. if err != nil {
  80419. return nil, err
  80420. }
  80421. defer googleapi.CloseBody(res)
  80422. if err := googleapi.CheckResponse(res); err != nil {
  80423. return nil, err
  80424. }
  80425. ret := &RouterStatusResponse{
  80426. ServerResponse: googleapi.ServerResponse{
  80427. Header: res.Header,
  80428. HTTPStatusCode: res.StatusCode,
  80429. },
  80430. }
  80431. target := &ret
  80432. if err := gensupport.DecodeResponse(target, res); err != nil {
  80433. return nil, err
  80434. }
  80435. return ret, nil
  80436. // {
  80437. // "description": "Retrieves runtime information of the specified router.",
  80438. // "httpMethod": "GET",
  80439. // "id": "compute.routers.getRouterStatus",
  80440. // "parameterOrder": [
  80441. // "project",
  80442. // "region",
  80443. // "router"
  80444. // ],
  80445. // "parameters": {
  80446. // "project": {
  80447. // "description": "Project ID for this request.",
  80448. // "location": "path",
  80449. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  80450. // "required": true,
  80451. // "type": "string"
  80452. // },
  80453. // "region": {
  80454. // "description": "Name of the region for this request.",
  80455. // "location": "path",
  80456. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  80457. // "required": true,
  80458. // "type": "string"
  80459. // },
  80460. // "router": {
  80461. // "description": "Name of the Router resource to query.",
  80462. // "location": "path",
  80463. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  80464. // "required": true,
  80465. // "type": "string"
  80466. // }
  80467. // },
  80468. // "path": "{project}/regions/{region}/routers/{router}/getRouterStatus",
  80469. // "response": {
  80470. // "$ref": "RouterStatusResponse"
  80471. // },
  80472. // "scopes": [
  80473. // "https://www.googleapis.com/auth/cloud-platform",
  80474. // "https://www.googleapis.com/auth/compute",
  80475. // "https://www.googleapis.com/auth/compute.readonly"
  80476. // ]
  80477. // }
  80478. }
  80479. // method id "compute.routers.insert":
  80480. type RoutersInsertCall struct {
  80481. s *Service
  80482. project string
  80483. region string
  80484. router *Router
  80485. urlParams_ gensupport.URLParams
  80486. ctx_ context.Context
  80487. header_ http.Header
  80488. }
  80489. // Insert: Creates a Router resource in the specified project and region
  80490. // using the data included in the request.
  80491. func (r *RoutersService) Insert(project string, region string, router *Router) *RoutersInsertCall {
  80492. c := &RoutersInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  80493. c.project = project
  80494. c.region = region
  80495. c.router = router
  80496. return c
  80497. }
  80498. // RequestId sets the optional parameter "requestId": An optional
  80499. // request ID to identify requests. Specify a unique request ID so that
  80500. // if you must retry your request, the server will know to ignore the
  80501. // request if it has already been completed.
  80502. //
  80503. // For example, consider a situation where you make an initial request
  80504. // and the request times out. If you make the request again with the
  80505. // same request ID, the server can check if original operation with the
  80506. // same request ID was received, and if so, will ignore the second
  80507. // request. This prevents clients from accidentally creating duplicate
  80508. // commitments.
  80509. //
  80510. // The request ID must be a valid UUID with the exception that zero UUID
  80511. // is not supported (00000000-0000-0000-0000-000000000000).
  80512. func (c *RoutersInsertCall) RequestId(requestId string) *RoutersInsertCall {
  80513. c.urlParams_.Set("requestId", requestId)
  80514. return c
  80515. }
  80516. // Fields allows partial responses to be retrieved. See
  80517. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  80518. // for more information.
  80519. func (c *RoutersInsertCall) Fields(s ...googleapi.Field) *RoutersInsertCall {
  80520. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  80521. return c
  80522. }
  80523. // Context sets the context to be used in this call's Do method. Any
  80524. // pending HTTP request will be aborted if the provided context is
  80525. // canceled.
  80526. func (c *RoutersInsertCall) Context(ctx context.Context) *RoutersInsertCall {
  80527. c.ctx_ = ctx
  80528. return c
  80529. }
  80530. // Header returns an http.Header that can be modified by the caller to
  80531. // add HTTP headers to the request.
  80532. func (c *RoutersInsertCall) Header() http.Header {
  80533. if c.header_ == nil {
  80534. c.header_ = make(http.Header)
  80535. }
  80536. return c.header_
  80537. }
  80538. func (c *RoutersInsertCall) doRequest(alt string) (*http.Response, error) {
  80539. reqHeaders := make(http.Header)
  80540. for k, v := range c.header_ {
  80541. reqHeaders[k] = v
  80542. }
  80543. reqHeaders.Set("User-Agent", c.s.userAgent())
  80544. var body io.Reader = nil
  80545. body, err := googleapi.WithoutDataWrapper.JSONReader(c.router)
  80546. if err != nil {
  80547. return nil, err
  80548. }
  80549. reqHeaders.Set("Content-Type", "application/json")
  80550. c.urlParams_.Set("alt", alt)
  80551. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/routers")
  80552. urls += "?" + c.urlParams_.Encode()
  80553. req, _ := http.NewRequest("POST", urls, body)
  80554. req.Header = reqHeaders
  80555. googleapi.Expand(req.URL, map[string]string{
  80556. "project": c.project,
  80557. "region": c.region,
  80558. })
  80559. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  80560. }
  80561. // Do executes the "compute.routers.insert" call.
  80562. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  80563. // status code is an error. Response headers are in either
  80564. // *Operation.ServerResponse.Header or (if a response was returned at
  80565. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  80566. // to check whether the returned error was because
  80567. // http.StatusNotModified was returned.
  80568. func (c *RoutersInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  80569. gensupport.SetOptions(c.urlParams_, opts...)
  80570. res, err := c.doRequest("json")
  80571. if res != nil && res.StatusCode == http.StatusNotModified {
  80572. if res.Body != nil {
  80573. res.Body.Close()
  80574. }
  80575. return nil, &googleapi.Error{
  80576. Code: res.StatusCode,
  80577. Header: res.Header,
  80578. }
  80579. }
  80580. if err != nil {
  80581. return nil, err
  80582. }
  80583. defer googleapi.CloseBody(res)
  80584. if err := googleapi.CheckResponse(res); err != nil {
  80585. return nil, err
  80586. }
  80587. ret := &Operation{
  80588. ServerResponse: googleapi.ServerResponse{
  80589. Header: res.Header,
  80590. HTTPStatusCode: res.StatusCode,
  80591. },
  80592. }
  80593. target := &ret
  80594. if err := gensupport.DecodeResponse(target, res); err != nil {
  80595. return nil, err
  80596. }
  80597. return ret, nil
  80598. // {
  80599. // "description": "Creates a Router resource in the specified project and region using the data included in the request.",
  80600. // "httpMethod": "POST",
  80601. // "id": "compute.routers.insert",
  80602. // "parameterOrder": [
  80603. // "project",
  80604. // "region"
  80605. // ],
  80606. // "parameters": {
  80607. // "project": {
  80608. // "description": "Project ID for this request.",
  80609. // "location": "path",
  80610. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  80611. // "required": true,
  80612. // "type": "string"
  80613. // },
  80614. // "region": {
  80615. // "description": "Name of the region for this request.",
  80616. // "location": "path",
  80617. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  80618. // "required": true,
  80619. // "type": "string"
  80620. // },
  80621. // "requestId": {
  80622. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  80623. // "location": "query",
  80624. // "type": "string"
  80625. // }
  80626. // },
  80627. // "path": "{project}/regions/{region}/routers",
  80628. // "request": {
  80629. // "$ref": "Router"
  80630. // },
  80631. // "response": {
  80632. // "$ref": "Operation"
  80633. // },
  80634. // "scopes": [
  80635. // "https://www.googleapis.com/auth/cloud-platform",
  80636. // "https://www.googleapis.com/auth/compute"
  80637. // ]
  80638. // }
  80639. }
  80640. // method id "compute.routers.list":
  80641. type RoutersListCall struct {
  80642. s *Service
  80643. project string
  80644. region string
  80645. urlParams_ gensupport.URLParams
  80646. ifNoneMatch_ string
  80647. ctx_ context.Context
  80648. header_ http.Header
  80649. }
  80650. // List: Retrieves a list of Router resources available to the specified
  80651. // project.
  80652. func (r *RoutersService) List(project string, region string) *RoutersListCall {
  80653. c := &RoutersListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  80654. c.project = project
  80655. c.region = region
  80656. return c
  80657. }
  80658. // Filter sets the optional parameter "filter": A filter expression that
  80659. // filters resources listed in the response. The expression must specify
  80660. // the field name, a comparison operator, and the value that you want to
  80661. // use for filtering. The value must be a string, a number, or a
  80662. // boolean. The comparison operator must be either =, !=, >, or <.
  80663. //
  80664. // For example, if you are filtering Compute Engine instances, you can
  80665. // exclude instances named example-instance by specifying name !=
  80666. // example-instance.
  80667. //
  80668. // You can also filter nested fields. For example, you could specify
  80669. // scheduling.automaticRestart = false to include instances only if they
  80670. // are not scheduled for automatic restarts. You can use filtering on
  80671. // nested fields to filter based on resource labels.
  80672. //
  80673. // To filter on multiple expressions, provide each separate expression
  80674. // within parentheses. For example, (scheduling.automaticRestart = true)
  80675. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  80676. // AND expression. However, you can include AND and OR expressions
  80677. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  80678. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  80679. // true).
  80680. func (c *RoutersListCall) Filter(filter string) *RoutersListCall {
  80681. c.urlParams_.Set("filter", filter)
  80682. return c
  80683. }
  80684. // MaxResults sets the optional parameter "maxResults": The maximum
  80685. // number of results per page that should be returned. If the number of
  80686. // available results is larger than maxResults, Compute Engine returns a
  80687. // nextPageToken that can be used to get the next page of results in
  80688. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  80689. // (Default: 500)
  80690. func (c *RoutersListCall) MaxResults(maxResults int64) *RoutersListCall {
  80691. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  80692. return c
  80693. }
  80694. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  80695. // a certain order. By default, results are returned in alphanumerical
  80696. // order based on the resource name.
  80697. //
  80698. // You can also sort results in descending order based on the creation
  80699. // timestamp using orderBy="creationTimestamp desc". This sorts results
  80700. // based on the creationTimestamp field in reverse chronological order
  80701. // (newest result first). Use this to sort resources like operations so
  80702. // that the newest operation is returned first.
  80703. //
  80704. // Currently, only sorting by name or creationTimestamp desc is
  80705. // supported.
  80706. func (c *RoutersListCall) OrderBy(orderBy string) *RoutersListCall {
  80707. c.urlParams_.Set("orderBy", orderBy)
  80708. return c
  80709. }
  80710. // PageToken sets the optional parameter "pageToken": Specifies a page
  80711. // token to use. Set pageToken to the nextPageToken returned by a
  80712. // previous list request to get the next page of results.
  80713. func (c *RoutersListCall) PageToken(pageToken string) *RoutersListCall {
  80714. c.urlParams_.Set("pageToken", pageToken)
  80715. return c
  80716. }
  80717. // Fields allows partial responses to be retrieved. See
  80718. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  80719. // for more information.
  80720. func (c *RoutersListCall) Fields(s ...googleapi.Field) *RoutersListCall {
  80721. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  80722. return c
  80723. }
  80724. // IfNoneMatch sets the optional parameter which makes the operation
  80725. // fail if the object's ETag matches the given value. This is useful for
  80726. // getting updates only after the object has changed since the last
  80727. // request. Use googleapi.IsNotModified to check whether the response
  80728. // error from Do is the result of In-None-Match.
  80729. func (c *RoutersListCall) IfNoneMatch(entityTag string) *RoutersListCall {
  80730. c.ifNoneMatch_ = entityTag
  80731. return c
  80732. }
  80733. // Context sets the context to be used in this call's Do method. Any
  80734. // pending HTTP request will be aborted if the provided context is
  80735. // canceled.
  80736. func (c *RoutersListCall) Context(ctx context.Context) *RoutersListCall {
  80737. c.ctx_ = ctx
  80738. return c
  80739. }
  80740. // Header returns an http.Header that can be modified by the caller to
  80741. // add HTTP headers to the request.
  80742. func (c *RoutersListCall) Header() http.Header {
  80743. if c.header_ == nil {
  80744. c.header_ = make(http.Header)
  80745. }
  80746. return c.header_
  80747. }
  80748. func (c *RoutersListCall) doRequest(alt string) (*http.Response, error) {
  80749. reqHeaders := make(http.Header)
  80750. for k, v := range c.header_ {
  80751. reqHeaders[k] = v
  80752. }
  80753. reqHeaders.Set("User-Agent", c.s.userAgent())
  80754. if c.ifNoneMatch_ != "" {
  80755. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  80756. }
  80757. var body io.Reader = nil
  80758. c.urlParams_.Set("alt", alt)
  80759. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/routers")
  80760. urls += "?" + c.urlParams_.Encode()
  80761. req, _ := http.NewRequest("GET", urls, body)
  80762. req.Header = reqHeaders
  80763. googleapi.Expand(req.URL, map[string]string{
  80764. "project": c.project,
  80765. "region": c.region,
  80766. })
  80767. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  80768. }
  80769. // Do executes the "compute.routers.list" call.
  80770. // Exactly one of *RouterList or error will be non-nil. Any non-2xx
  80771. // status code is an error. Response headers are in either
  80772. // *RouterList.ServerResponse.Header or (if a response was returned at
  80773. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  80774. // to check whether the returned error was because
  80775. // http.StatusNotModified was returned.
  80776. func (c *RoutersListCall) Do(opts ...googleapi.CallOption) (*RouterList, error) {
  80777. gensupport.SetOptions(c.urlParams_, opts...)
  80778. res, err := c.doRequest("json")
  80779. if res != nil && res.StatusCode == http.StatusNotModified {
  80780. if res.Body != nil {
  80781. res.Body.Close()
  80782. }
  80783. return nil, &googleapi.Error{
  80784. Code: res.StatusCode,
  80785. Header: res.Header,
  80786. }
  80787. }
  80788. if err != nil {
  80789. return nil, err
  80790. }
  80791. defer googleapi.CloseBody(res)
  80792. if err := googleapi.CheckResponse(res); err != nil {
  80793. return nil, err
  80794. }
  80795. ret := &RouterList{
  80796. ServerResponse: googleapi.ServerResponse{
  80797. Header: res.Header,
  80798. HTTPStatusCode: res.StatusCode,
  80799. },
  80800. }
  80801. target := &ret
  80802. if err := gensupport.DecodeResponse(target, res); err != nil {
  80803. return nil, err
  80804. }
  80805. return ret, nil
  80806. // {
  80807. // "description": "Retrieves a list of Router resources available to the specified project.",
  80808. // "httpMethod": "GET",
  80809. // "id": "compute.routers.list",
  80810. // "parameterOrder": [
  80811. // "project",
  80812. // "region"
  80813. // ],
  80814. // "parameters": {
  80815. // "filter": {
  80816. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  80817. // "location": "query",
  80818. // "type": "string"
  80819. // },
  80820. // "maxResults": {
  80821. // "default": "500",
  80822. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  80823. // "format": "uint32",
  80824. // "location": "query",
  80825. // "minimum": "0",
  80826. // "type": "integer"
  80827. // },
  80828. // "orderBy": {
  80829. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  80830. // "location": "query",
  80831. // "type": "string"
  80832. // },
  80833. // "pageToken": {
  80834. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  80835. // "location": "query",
  80836. // "type": "string"
  80837. // },
  80838. // "project": {
  80839. // "description": "Project ID for this request.",
  80840. // "location": "path",
  80841. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  80842. // "required": true,
  80843. // "type": "string"
  80844. // },
  80845. // "region": {
  80846. // "description": "Name of the region for this request.",
  80847. // "location": "path",
  80848. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  80849. // "required": true,
  80850. // "type": "string"
  80851. // }
  80852. // },
  80853. // "path": "{project}/regions/{region}/routers",
  80854. // "response": {
  80855. // "$ref": "RouterList"
  80856. // },
  80857. // "scopes": [
  80858. // "https://www.googleapis.com/auth/cloud-platform",
  80859. // "https://www.googleapis.com/auth/compute",
  80860. // "https://www.googleapis.com/auth/compute.readonly"
  80861. // ]
  80862. // }
  80863. }
  80864. // Pages invokes f for each page of results.
  80865. // A non-nil error returned from f will halt the iteration.
  80866. // The provided context supersedes any context provided to the Context method.
  80867. func (c *RoutersListCall) Pages(ctx context.Context, f func(*RouterList) error) error {
  80868. c.ctx_ = ctx
  80869. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  80870. for {
  80871. x, err := c.Do()
  80872. if err != nil {
  80873. return err
  80874. }
  80875. if err := f(x); err != nil {
  80876. return err
  80877. }
  80878. if x.NextPageToken == "" {
  80879. return nil
  80880. }
  80881. c.PageToken(x.NextPageToken)
  80882. }
  80883. }
  80884. // method id "compute.routers.patch":
  80885. type RoutersPatchCall struct {
  80886. s *Service
  80887. project string
  80888. region string
  80889. router string
  80890. router2 *Router
  80891. urlParams_ gensupport.URLParams
  80892. ctx_ context.Context
  80893. header_ http.Header
  80894. }
  80895. // Patch: Patches the specified Router resource with the data included
  80896. // in the request. This method supports PATCH semantics and uses JSON
  80897. // merge patch format and processing rules.
  80898. func (r *RoutersService) Patch(project string, region string, router string, router2 *Router) *RoutersPatchCall {
  80899. c := &RoutersPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  80900. c.project = project
  80901. c.region = region
  80902. c.router = router
  80903. c.router2 = router2
  80904. return c
  80905. }
  80906. // RequestId sets the optional parameter "requestId": An optional
  80907. // request ID to identify requests. Specify a unique request ID so that
  80908. // if you must retry your request, the server will know to ignore the
  80909. // request if it has already been completed.
  80910. //
  80911. // For example, consider a situation where you make an initial request
  80912. // and the request times out. If you make the request again with the
  80913. // same request ID, the server can check if original operation with the
  80914. // same request ID was received, and if so, will ignore the second
  80915. // request. This prevents clients from accidentally creating duplicate
  80916. // commitments.
  80917. //
  80918. // The request ID must be a valid UUID with the exception that zero UUID
  80919. // is not supported (00000000-0000-0000-0000-000000000000).
  80920. func (c *RoutersPatchCall) RequestId(requestId string) *RoutersPatchCall {
  80921. c.urlParams_.Set("requestId", requestId)
  80922. return c
  80923. }
  80924. // Fields allows partial responses to be retrieved. See
  80925. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  80926. // for more information.
  80927. func (c *RoutersPatchCall) Fields(s ...googleapi.Field) *RoutersPatchCall {
  80928. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  80929. return c
  80930. }
  80931. // Context sets the context to be used in this call's Do method. Any
  80932. // pending HTTP request will be aborted if the provided context is
  80933. // canceled.
  80934. func (c *RoutersPatchCall) Context(ctx context.Context) *RoutersPatchCall {
  80935. c.ctx_ = ctx
  80936. return c
  80937. }
  80938. // Header returns an http.Header that can be modified by the caller to
  80939. // add HTTP headers to the request.
  80940. func (c *RoutersPatchCall) Header() http.Header {
  80941. if c.header_ == nil {
  80942. c.header_ = make(http.Header)
  80943. }
  80944. return c.header_
  80945. }
  80946. func (c *RoutersPatchCall) doRequest(alt string) (*http.Response, error) {
  80947. reqHeaders := make(http.Header)
  80948. for k, v := range c.header_ {
  80949. reqHeaders[k] = v
  80950. }
  80951. reqHeaders.Set("User-Agent", c.s.userAgent())
  80952. var body io.Reader = nil
  80953. body, err := googleapi.WithoutDataWrapper.JSONReader(c.router2)
  80954. if err != nil {
  80955. return nil, err
  80956. }
  80957. reqHeaders.Set("Content-Type", "application/json")
  80958. c.urlParams_.Set("alt", alt)
  80959. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/routers/{router}")
  80960. urls += "?" + c.urlParams_.Encode()
  80961. req, _ := http.NewRequest("PATCH", urls, body)
  80962. req.Header = reqHeaders
  80963. googleapi.Expand(req.URL, map[string]string{
  80964. "project": c.project,
  80965. "region": c.region,
  80966. "router": c.router,
  80967. })
  80968. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  80969. }
  80970. // Do executes the "compute.routers.patch" call.
  80971. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  80972. // status code is an error. Response headers are in either
  80973. // *Operation.ServerResponse.Header or (if a response was returned at
  80974. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  80975. // to check whether the returned error was because
  80976. // http.StatusNotModified was returned.
  80977. func (c *RoutersPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  80978. gensupport.SetOptions(c.urlParams_, opts...)
  80979. res, err := c.doRequest("json")
  80980. if res != nil && res.StatusCode == http.StatusNotModified {
  80981. if res.Body != nil {
  80982. res.Body.Close()
  80983. }
  80984. return nil, &googleapi.Error{
  80985. Code: res.StatusCode,
  80986. Header: res.Header,
  80987. }
  80988. }
  80989. if err != nil {
  80990. return nil, err
  80991. }
  80992. defer googleapi.CloseBody(res)
  80993. if err := googleapi.CheckResponse(res); err != nil {
  80994. return nil, err
  80995. }
  80996. ret := &Operation{
  80997. ServerResponse: googleapi.ServerResponse{
  80998. Header: res.Header,
  80999. HTTPStatusCode: res.StatusCode,
  81000. },
  81001. }
  81002. target := &ret
  81003. if err := gensupport.DecodeResponse(target, res); err != nil {
  81004. return nil, err
  81005. }
  81006. return ret, nil
  81007. // {
  81008. // "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.",
  81009. // "httpMethod": "PATCH",
  81010. // "id": "compute.routers.patch",
  81011. // "parameterOrder": [
  81012. // "project",
  81013. // "region",
  81014. // "router"
  81015. // ],
  81016. // "parameters": {
  81017. // "project": {
  81018. // "description": "Project ID for this request.",
  81019. // "location": "path",
  81020. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  81021. // "required": true,
  81022. // "type": "string"
  81023. // },
  81024. // "region": {
  81025. // "description": "Name of the region for this request.",
  81026. // "location": "path",
  81027. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  81028. // "required": true,
  81029. // "type": "string"
  81030. // },
  81031. // "requestId": {
  81032. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  81033. // "location": "query",
  81034. // "type": "string"
  81035. // },
  81036. // "router": {
  81037. // "description": "Name of the Router resource to patch.",
  81038. // "location": "path",
  81039. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  81040. // "required": true,
  81041. // "type": "string"
  81042. // }
  81043. // },
  81044. // "path": "{project}/regions/{region}/routers/{router}",
  81045. // "request": {
  81046. // "$ref": "Router"
  81047. // },
  81048. // "response": {
  81049. // "$ref": "Operation"
  81050. // },
  81051. // "scopes": [
  81052. // "https://www.googleapis.com/auth/cloud-platform",
  81053. // "https://www.googleapis.com/auth/compute"
  81054. // ]
  81055. // }
  81056. }
  81057. // method id "compute.routers.preview":
  81058. type RoutersPreviewCall struct {
  81059. s *Service
  81060. project string
  81061. region string
  81062. router string
  81063. router2 *Router
  81064. urlParams_ gensupport.URLParams
  81065. ctx_ context.Context
  81066. header_ http.Header
  81067. }
  81068. // Preview: Preview fields auto-generated during router create and
  81069. // update operations. Calling this method does NOT create or update the
  81070. // router.
  81071. func (r *RoutersService) Preview(project string, region string, router string, router2 *Router) *RoutersPreviewCall {
  81072. c := &RoutersPreviewCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  81073. c.project = project
  81074. c.region = region
  81075. c.router = router
  81076. c.router2 = router2
  81077. return c
  81078. }
  81079. // Fields allows partial responses to be retrieved. See
  81080. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  81081. // for more information.
  81082. func (c *RoutersPreviewCall) Fields(s ...googleapi.Field) *RoutersPreviewCall {
  81083. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  81084. return c
  81085. }
  81086. // Context sets the context to be used in this call's Do method. Any
  81087. // pending HTTP request will be aborted if the provided context is
  81088. // canceled.
  81089. func (c *RoutersPreviewCall) Context(ctx context.Context) *RoutersPreviewCall {
  81090. c.ctx_ = ctx
  81091. return c
  81092. }
  81093. // Header returns an http.Header that can be modified by the caller to
  81094. // add HTTP headers to the request.
  81095. func (c *RoutersPreviewCall) Header() http.Header {
  81096. if c.header_ == nil {
  81097. c.header_ = make(http.Header)
  81098. }
  81099. return c.header_
  81100. }
  81101. func (c *RoutersPreviewCall) doRequest(alt string) (*http.Response, error) {
  81102. reqHeaders := make(http.Header)
  81103. for k, v := range c.header_ {
  81104. reqHeaders[k] = v
  81105. }
  81106. reqHeaders.Set("User-Agent", c.s.userAgent())
  81107. var body io.Reader = nil
  81108. body, err := googleapi.WithoutDataWrapper.JSONReader(c.router2)
  81109. if err != nil {
  81110. return nil, err
  81111. }
  81112. reqHeaders.Set("Content-Type", "application/json")
  81113. c.urlParams_.Set("alt", alt)
  81114. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/routers/{router}/preview")
  81115. urls += "?" + c.urlParams_.Encode()
  81116. req, _ := http.NewRequest("POST", urls, body)
  81117. req.Header = reqHeaders
  81118. googleapi.Expand(req.URL, map[string]string{
  81119. "project": c.project,
  81120. "region": c.region,
  81121. "router": c.router,
  81122. })
  81123. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  81124. }
  81125. // Do executes the "compute.routers.preview" call.
  81126. // Exactly one of *RoutersPreviewResponse or error will be non-nil. Any
  81127. // non-2xx status code is an error. Response headers are in either
  81128. // *RoutersPreviewResponse.ServerResponse.Header or (if a response was
  81129. // returned at all) in error.(*googleapi.Error).Header. Use
  81130. // googleapi.IsNotModified to check whether the returned error was
  81131. // because http.StatusNotModified was returned.
  81132. func (c *RoutersPreviewCall) Do(opts ...googleapi.CallOption) (*RoutersPreviewResponse, error) {
  81133. gensupport.SetOptions(c.urlParams_, opts...)
  81134. res, err := c.doRequest("json")
  81135. if res != nil && res.StatusCode == http.StatusNotModified {
  81136. if res.Body != nil {
  81137. res.Body.Close()
  81138. }
  81139. return nil, &googleapi.Error{
  81140. Code: res.StatusCode,
  81141. Header: res.Header,
  81142. }
  81143. }
  81144. if err != nil {
  81145. return nil, err
  81146. }
  81147. defer googleapi.CloseBody(res)
  81148. if err := googleapi.CheckResponse(res); err != nil {
  81149. return nil, err
  81150. }
  81151. ret := &RoutersPreviewResponse{
  81152. ServerResponse: googleapi.ServerResponse{
  81153. Header: res.Header,
  81154. HTTPStatusCode: res.StatusCode,
  81155. },
  81156. }
  81157. target := &ret
  81158. if err := gensupport.DecodeResponse(target, res); err != nil {
  81159. return nil, err
  81160. }
  81161. return ret, nil
  81162. // {
  81163. // "description": "Preview fields auto-generated during router create and update operations. Calling this method does NOT create or update the router.",
  81164. // "httpMethod": "POST",
  81165. // "id": "compute.routers.preview",
  81166. // "parameterOrder": [
  81167. // "project",
  81168. // "region",
  81169. // "router"
  81170. // ],
  81171. // "parameters": {
  81172. // "project": {
  81173. // "description": "Project ID for this request.",
  81174. // "location": "path",
  81175. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  81176. // "required": true,
  81177. // "type": "string"
  81178. // },
  81179. // "region": {
  81180. // "description": "Name of the region for this request.",
  81181. // "location": "path",
  81182. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  81183. // "required": true,
  81184. // "type": "string"
  81185. // },
  81186. // "router": {
  81187. // "description": "Name of the Router resource to query.",
  81188. // "location": "path",
  81189. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  81190. // "required": true,
  81191. // "type": "string"
  81192. // }
  81193. // },
  81194. // "path": "{project}/regions/{region}/routers/{router}/preview",
  81195. // "request": {
  81196. // "$ref": "Router"
  81197. // },
  81198. // "response": {
  81199. // "$ref": "RoutersPreviewResponse"
  81200. // },
  81201. // "scopes": [
  81202. // "https://www.googleapis.com/auth/cloud-platform",
  81203. // "https://www.googleapis.com/auth/compute",
  81204. // "https://www.googleapis.com/auth/compute.readonly"
  81205. // ]
  81206. // }
  81207. }
  81208. // method id "compute.routers.testIamPermissions":
  81209. type RoutersTestIamPermissionsCall struct {
  81210. s *Service
  81211. project string
  81212. region string
  81213. resource string
  81214. testpermissionsrequest *TestPermissionsRequest
  81215. urlParams_ gensupport.URLParams
  81216. ctx_ context.Context
  81217. header_ http.Header
  81218. }
  81219. // TestIamPermissions: Returns permissions that a caller has on the
  81220. // specified resource.
  81221. func (r *RoutersService) TestIamPermissions(project string, region string, resource string, testpermissionsrequest *TestPermissionsRequest) *RoutersTestIamPermissionsCall {
  81222. c := &RoutersTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  81223. c.project = project
  81224. c.region = region
  81225. c.resource = resource
  81226. c.testpermissionsrequest = testpermissionsrequest
  81227. return c
  81228. }
  81229. // Fields allows partial responses to be retrieved. See
  81230. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  81231. // for more information.
  81232. func (c *RoutersTestIamPermissionsCall) Fields(s ...googleapi.Field) *RoutersTestIamPermissionsCall {
  81233. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  81234. return c
  81235. }
  81236. // Context sets the context to be used in this call's Do method. Any
  81237. // pending HTTP request will be aborted if the provided context is
  81238. // canceled.
  81239. func (c *RoutersTestIamPermissionsCall) Context(ctx context.Context) *RoutersTestIamPermissionsCall {
  81240. c.ctx_ = ctx
  81241. return c
  81242. }
  81243. // Header returns an http.Header that can be modified by the caller to
  81244. // add HTTP headers to the request.
  81245. func (c *RoutersTestIamPermissionsCall) Header() http.Header {
  81246. if c.header_ == nil {
  81247. c.header_ = make(http.Header)
  81248. }
  81249. return c.header_
  81250. }
  81251. func (c *RoutersTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  81252. reqHeaders := make(http.Header)
  81253. for k, v := range c.header_ {
  81254. reqHeaders[k] = v
  81255. }
  81256. reqHeaders.Set("User-Agent", c.s.userAgent())
  81257. var body io.Reader = nil
  81258. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  81259. if err != nil {
  81260. return nil, err
  81261. }
  81262. reqHeaders.Set("Content-Type", "application/json")
  81263. c.urlParams_.Set("alt", alt)
  81264. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/routers/{resource}/testIamPermissions")
  81265. urls += "?" + c.urlParams_.Encode()
  81266. req, _ := http.NewRequest("POST", urls, body)
  81267. req.Header = reqHeaders
  81268. googleapi.Expand(req.URL, map[string]string{
  81269. "project": c.project,
  81270. "region": c.region,
  81271. "resource": c.resource,
  81272. })
  81273. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  81274. }
  81275. // Do executes the "compute.routers.testIamPermissions" call.
  81276. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  81277. // non-2xx status code is an error. Response headers are in either
  81278. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  81279. // returned at all) in error.(*googleapi.Error).Header. Use
  81280. // googleapi.IsNotModified to check whether the returned error was
  81281. // because http.StatusNotModified was returned.
  81282. func (c *RoutersTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  81283. gensupport.SetOptions(c.urlParams_, opts...)
  81284. res, err := c.doRequest("json")
  81285. if res != nil && res.StatusCode == http.StatusNotModified {
  81286. if res.Body != nil {
  81287. res.Body.Close()
  81288. }
  81289. return nil, &googleapi.Error{
  81290. Code: res.StatusCode,
  81291. Header: res.Header,
  81292. }
  81293. }
  81294. if err != nil {
  81295. return nil, err
  81296. }
  81297. defer googleapi.CloseBody(res)
  81298. if err := googleapi.CheckResponse(res); err != nil {
  81299. return nil, err
  81300. }
  81301. ret := &TestPermissionsResponse{
  81302. ServerResponse: googleapi.ServerResponse{
  81303. Header: res.Header,
  81304. HTTPStatusCode: res.StatusCode,
  81305. },
  81306. }
  81307. target := &ret
  81308. if err := gensupport.DecodeResponse(target, res); err != nil {
  81309. return nil, err
  81310. }
  81311. return ret, nil
  81312. // {
  81313. // "description": "Returns permissions that a caller has on the specified resource.",
  81314. // "httpMethod": "POST",
  81315. // "id": "compute.routers.testIamPermissions",
  81316. // "parameterOrder": [
  81317. // "project",
  81318. // "region",
  81319. // "resource"
  81320. // ],
  81321. // "parameters": {
  81322. // "project": {
  81323. // "description": "Project ID for this request.",
  81324. // "location": "path",
  81325. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  81326. // "required": true,
  81327. // "type": "string"
  81328. // },
  81329. // "region": {
  81330. // "description": "The name of the region for this request.",
  81331. // "location": "path",
  81332. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  81333. // "required": true,
  81334. // "type": "string"
  81335. // },
  81336. // "resource": {
  81337. // "description": "Name of the resource for this request.",
  81338. // "location": "path",
  81339. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  81340. // "required": true,
  81341. // "type": "string"
  81342. // }
  81343. // },
  81344. // "path": "{project}/regions/{region}/routers/{resource}/testIamPermissions",
  81345. // "request": {
  81346. // "$ref": "TestPermissionsRequest"
  81347. // },
  81348. // "response": {
  81349. // "$ref": "TestPermissionsResponse"
  81350. // },
  81351. // "scopes": [
  81352. // "https://www.googleapis.com/auth/cloud-platform",
  81353. // "https://www.googleapis.com/auth/compute",
  81354. // "https://www.googleapis.com/auth/compute.readonly"
  81355. // ]
  81356. // }
  81357. }
  81358. // method id "compute.routers.update":
  81359. type RoutersUpdateCall struct {
  81360. s *Service
  81361. project string
  81362. region string
  81363. router string
  81364. router2 *Router
  81365. urlParams_ gensupport.URLParams
  81366. ctx_ context.Context
  81367. header_ http.Header
  81368. }
  81369. // Update: Updates the specified Router resource with the data included
  81370. // in the request.
  81371. func (r *RoutersService) Update(project string, region string, router string, router2 *Router) *RoutersUpdateCall {
  81372. c := &RoutersUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  81373. c.project = project
  81374. c.region = region
  81375. c.router = router
  81376. c.router2 = router2
  81377. return c
  81378. }
  81379. // RequestId sets the optional parameter "requestId": An optional
  81380. // request ID to identify requests. Specify a unique request ID so that
  81381. // if you must retry your request, the server will know to ignore the
  81382. // request if it has already been completed.
  81383. //
  81384. // For example, consider a situation where you make an initial request
  81385. // and the request times out. If you make the request again with the
  81386. // same request ID, the server can check if original operation with the
  81387. // same request ID was received, and if so, will ignore the second
  81388. // request. This prevents clients from accidentally creating duplicate
  81389. // commitments.
  81390. //
  81391. // The request ID must be a valid UUID with the exception that zero UUID
  81392. // is not supported (00000000-0000-0000-0000-000000000000).
  81393. func (c *RoutersUpdateCall) RequestId(requestId string) *RoutersUpdateCall {
  81394. c.urlParams_.Set("requestId", requestId)
  81395. return c
  81396. }
  81397. // Fields allows partial responses to be retrieved. See
  81398. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  81399. // for more information.
  81400. func (c *RoutersUpdateCall) Fields(s ...googleapi.Field) *RoutersUpdateCall {
  81401. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  81402. return c
  81403. }
  81404. // Context sets the context to be used in this call's Do method. Any
  81405. // pending HTTP request will be aborted if the provided context is
  81406. // canceled.
  81407. func (c *RoutersUpdateCall) Context(ctx context.Context) *RoutersUpdateCall {
  81408. c.ctx_ = ctx
  81409. return c
  81410. }
  81411. // Header returns an http.Header that can be modified by the caller to
  81412. // add HTTP headers to the request.
  81413. func (c *RoutersUpdateCall) Header() http.Header {
  81414. if c.header_ == nil {
  81415. c.header_ = make(http.Header)
  81416. }
  81417. return c.header_
  81418. }
  81419. func (c *RoutersUpdateCall) doRequest(alt string) (*http.Response, error) {
  81420. reqHeaders := make(http.Header)
  81421. for k, v := range c.header_ {
  81422. reqHeaders[k] = v
  81423. }
  81424. reqHeaders.Set("User-Agent", c.s.userAgent())
  81425. var body io.Reader = nil
  81426. body, err := googleapi.WithoutDataWrapper.JSONReader(c.router2)
  81427. if err != nil {
  81428. return nil, err
  81429. }
  81430. reqHeaders.Set("Content-Type", "application/json")
  81431. c.urlParams_.Set("alt", alt)
  81432. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/routers/{router}")
  81433. urls += "?" + c.urlParams_.Encode()
  81434. req, _ := http.NewRequest("PUT", urls, body)
  81435. req.Header = reqHeaders
  81436. googleapi.Expand(req.URL, map[string]string{
  81437. "project": c.project,
  81438. "region": c.region,
  81439. "router": c.router,
  81440. })
  81441. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  81442. }
  81443. // Do executes the "compute.routers.update" call.
  81444. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  81445. // status code is an error. Response headers are in either
  81446. // *Operation.ServerResponse.Header or (if a response was returned at
  81447. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  81448. // to check whether the returned error was because
  81449. // http.StatusNotModified was returned.
  81450. func (c *RoutersUpdateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  81451. gensupport.SetOptions(c.urlParams_, opts...)
  81452. res, err := c.doRequest("json")
  81453. if res != nil && res.StatusCode == http.StatusNotModified {
  81454. if res.Body != nil {
  81455. res.Body.Close()
  81456. }
  81457. return nil, &googleapi.Error{
  81458. Code: res.StatusCode,
  81459. Header: res.Header,
  81460. }
  81461. }
  81462. if err != nil {
  81463. return nil, err
  81464. }
  81465. defer googleapi.CloseBody(res)
  81466. if err := googleapi.CheckResponse(res); err != nil {
  81467. return nil, err
  81468. }
  81469. ret := &Operation{
  81470. ServerResponse: googleapi.ServerResponse{
  81471. Header: res.Header,
  81472. HTTPStatusCode: res.StatusCode,
  81473. },
  81474. }
  81475. target := &ret
  81476. if err := gensupport.DecodeResponse(target, res); err != nil {
  81477. return nil, err
  81478. }
  81479. return ret, nil
  81480. // {
  81481. // "description": "Updates the specified Router resource with the data included in the request.",
  81482. // "httpMethod": "PUT",
  81483. // "id": "compute.routers.update",
  81484. // "parameterOrder": [
  81485. // "project",
  81486. // "region",
  81487. // "router"
  81488. // ],
  81489. // "parameters": {
  81490. // "project": {
  81491. // "description": "Project ID for this request.",
  81492. // "location": "path",
  81493. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  81494. // "required": true,
  81495. // "type": "string"
  81496. // },
  81497. // "region": {
  81498. // "description": "Name of the region for this request.",
  81499. // "location": "path",
  81500. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  81501. // "required": true,
  81502. // "type": "string"
  81503. // },
  81504. // "requestId": {
  81505. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  81506. // "location": "query",
  81507. // "type": "string"
  81508. // },
  81509. // "router": {
  81510. // "description": "Name of the Router resource to update.",
  81511. // "location": "path",
  81512. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  81513. // "required": true,
  81514. // "type": "string"
  81515. // }
  81516. // },
  81517. // "path": "{project}/regions/{region}/routers/{router}",
  81518. // "request": {
  81519. // "$ref": "Router"
  81520. // },
  81521. // "response": {
  81522. // "$ref": "Operation"
  81523. // },
  81524. // "scopes": [
  81525. // "https://www.googleapis.com/auth/cloud-platform",
  81526. // "https://www.googleapis.com/auth/compute"
  81527. // ]
  81528. // }
  81529. }
  81530. // method id "compute.routes.delete":
  81531. type RoutesDeleteCall struct {
  81532. s *Service
  81533. project string
  81534. route string
  81535. urlParams_ gensupport.URLParams
  81536. ctx_ context.Context
  81537. header_ http.Header
  81538. }
  81539. // Delete: Deletes the specified Route resource.
  81540. // For details, see https://cloud.google.com/compute/docs/reference/latest/routes/delete
  81541. func (r *RoutesService) Delete(project string, route string) *RoutesDeleteCall {
  81542. c := &RoutesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  81543. c.project = project
  81544. c.route = route
  81545. return c
  81546. }
  81547. // RequestId sets the optional parameter "requestId": An optional
  81548. // request ID to identify requests. Specify a unique request ID so that
  81549. // if you must retry your request, the server will know to ignore the
  81550. // request if it has already been completed.
  81551. //
  81552. // For example, consider a situation where you make an initial request
  81553. // and the request times out. If you make the request again with the
  81554. // same request ID, the server can check if original operation with the
  81555. // same request ID was received, and if so, will ignore the second
  81556. // request. This prevents clients from accidentally creating duplicate
  81557. // commitments.
  81558. //
  81559. // The request ID must be a valid UUID with the exception that zero UUID
  81560. // is not supported (00000000-0000-0000-0000-000000000000).
  81561. func (c *RoutesDeleteCall) RequestId(requestId string) *RoutesDeleteCall {
  81562. c.urlParams_.Set("requestId", requestId)
  81563. return c
  81564. }
  81565. // Fields allows partial responses to be retrieved. See
  81566. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  81567. // for more information.
  81568. func (c *RoutesDeleteCall) Fields(s ...googleapi.Field) *RoutesDeleteCall {
  81569. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  81570. return c
  81571. }
  81572. // Context sets the context to be used in this call's Do method. Any
  81573. // pending HTTP request will be aborted if the provided context is
  81574. // canceled.
  81575. func (c *RoutesDeleteCall) Context(ctx context.Context) *RoutesDeleteCall {
  81576. c.ctx_ = ctx
  81577. return c
  81578. }
  81579. // Header returns an http.Header that can be modified by the caller to
  81580. // add HTTP headers to the request.
  81581. func (c *RoutesDeleteCall) Header() http.Header {
  81582. if c.header_ == nil {
  81583. c.header_ = make(http.Header)
  81584. }
  81585. return c.header_
  81586. }
  81587. func (c *RoutesDeleteCall) doRequest(alt string) (*http.Response, error) {
  81588. reqHeaders := make(http.Header)
  81589. for k, v := range c.header_ {
  81590. reqHeaders[k] = v
  81591. }
  81592. reqHeaders.Set("User-Agent", c.s.userAgent())
  81593. var body io.Reader = nil
  81594. c.urlParams_.Set("alt", alt)
  81595. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/routes/{route}")
  81596. urls += "?" + c.urlParams_.Encode()
  81597. req, _ := http.NewRequest("DELETE", urls, body)
  81598. req.Header = reqHeaders
  81599. googleapi.Expand(req.URL, map[string]string{
  81600. "project": c.project,
  81601. "route": c.route,
  81602. })
  81603. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  81604. }
  81605. // Do executes the "compute.routes.delete" call.
  81606. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  81607. // status code is an error. Response headers are in either
  81608. // *Operation.ServerResponse.Header or (if a response was returned at
  81609. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  81610. // to check whether the returned error was because
  81611. // http.StatusNotModified was returned.
  81612. func (c *RoutesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  81613. gensupport.SetOptions(c.urlParams_, opts...)
  81614. res, err := c.doRequest("json")
  81615. if res != nil && res.StatusCode == http.StatusNotModified {
  81616. if res.Body != nil {
  81617. res.Body.Close()
  81618. }
  81619. return nil, &googleapi.Error{
  81620. Code: res.StatusCode,
  81621. Header: res.Header,
  81622. }
  81623. }
  81624. if err != nil {
  81625. return nil, err
  81626. }
  81627. defer googleapi.CloseBody(res)
  81628. if err := googleapi.CheckResponse(res); err != nil {
  81629. return nil, err
  81630. }
  81631. ret := &Operation{
  81632. ServerResponse: googleapi.ServerResponse{
  81633. Header: res.Header,
  81634. HTTPStatusCode: res.StatusCode,
  81635. },
  81636. }
  81637. target := &ret
  81638. if err := gensupport.DecodeResponse(target, res); err != nil {
  81639. return nil, err
  81640. }
  81641. return ret, nil
  81642. // {
  81643. // "description": "Deletes the specified Route resource.",
  81644. // "httpMethod": "DELETE",
  81645. // "id": "compute.routes.delete",
  81646. // "parameterOrder": [
  81647. // "project",
  81648. // "route"
  81649. // ],
  81650. // "parameters": {
  81651. // "project": {
  81652. // "description": "Project ID for this request.",
  81653. // "location": "path",
  81654. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  81655. // "required": true,
  81656. // "type": "string"
  81657. // },
  81658. // "requestId": {
  81659. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  81660. // "location": "query",
  81661. // "type": "string"
  81662. // },
  81663. // "route": {
  81664. // "description": "Name of the Route resource to delete.",
  81665. // "location": "path",
  81666. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  81667. // "required": true,
  81668. // "type": "string"
  81669. // }
  81670. // },
  81671. // "path": "{project}/global/routes/{route}",
  81672. // "response": {
  81673. // "$ref": "Operation"
  81674. // },
  81675. // "scopes": [
  81676. // "https://www.googleapis.com/auth/cloud-platform",
  81677. // "https://www.googleapis.com/auth/compute"
  81678. // ]
  81679. // }
  81680. }
  81681. // method id "compute.routes.get":
  81682. type RoutesGetCall struct {
  81683. s *Service
  81684. project string
  81685. route string
  81686. urlParams_ gensupport.URLParams
  81687. ifNoneMatch_ string
  81688. ctx_ context.Context
  81689. header_ http.Header
  81690. }
  81691. // Get: Returns the specified Route resource. Gets a list of available
  81692. // routes by making a list() request.
  81693. // For details, see https://cloud.google.com/compute/docs/reference/latest/routes/get
  81694. func (r *RoutesService) Get(project string, route string) *RoutesGetCall {
  81695. c := &RoutesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  81696. c.project = project
  81697. c.route = route
  81698. return c
  81699. }
  81700. // Fields allows partial responses to be retrieved. See
  81701. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  81702. // for more information.
  81703. func (c *RoutesGetCall) Fields(s ...googleapi.Field) *RoutesGetCall {
  81704. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  81705. return c
  81706. }
  81707. // IfNoneMatch sets the optional parameter which makes the operation
  81708. // fail if the object's ETag matches the given value. This is useful for
  81709. // getting updates only after the object has changed since the last
  81710. // request. Use googleapi.IsNotModified to check whether the response
  81711. // error from Do is the result of In-None-Match.
  81712. func (c *RoutesGetCall) IfNoneMatch(entityTag string) *RoutesGetCall {
  81713. c.ifNoneMatch_ = entityTag
  81714. return c
  81715. }
  81716. // Context sets the context to be used in this call's Do method. Any
  81717. // pending HTTP request will be aborted if the provided context is
  81718. // canceled.
  81719. func (c *RoutesGetCall) Context(ctx context.Context) *RoutesGetCall {
  81720. c.ctx_ = ctx
  81721. return c
  81722. }
  81723. // Header returns an http.Header that can be modified by the caller to
  81724. // add HTTP headers to the request.
  81725. func (c *RoutesGetCall) Header() http.Header {
  81726. if c.header_ == nil {
  81727. c.header_ = make(http.Header)
  81728. }
  81729. return c.header_
  81730. }
  81731. func (c *RoutesGetCall) doRequest(alt string) (*http.Response, error) {
  81732. reqHeaders := make(http.Header)
  81733. for k, v := range c.header_ {
  81734. reqHeaders[k] = v
  81735. }
  81736. reqHeaders.Set("User-Agent", c.s.userAgent())
  81737. if c.ifNoneMatch_ != "" {
  81738. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  81739. }
  81740. var body io.Reader = nil
  81741. c.urlParams_.Set("alt", alt)
  81742. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/routes/{route}")
  81743. urls += "?" + c.urlParams_.Encode()
  81744. req, _ := http.NewRequest("GET", urls, body)
  81745. req.Header = reqHeaders
  81746. googleapi.Expand(req.URL, map[string]string{
  81747. "project": c.project,
  81748. "route": c.route,
  81749. })
  81750. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  81751. }
  81752. // Do executes the "compute.routes.get" call.
  81753. // Exactly one of *Route or error will be non-nil. Any non-2xx status
  81754. // code is an error. Response headers are in either
  81755. // *Route.ServerResponse.Header or (if a response was returned at all)
  81756. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  81757. // check whether the returned error was because http.StatusNotModified
  81758. // was returned.
  81759. func (c *RoutesGetCall) Do(opts ...googleapi.CallOption) (*Route, error) {
  81760. gensupport.SetOptions(c.urlParams_, opts...)
  81761. res, err := c.doRequest("json")
  81762. if res != nil && res.StatusCode == http.StatusNotModified {
  81763. if res.Body != nil {
  81764. res.Body.Close()
  81765. }
  81766. return nil, &googleapi.Error{
  81767. Code: res.StatusCode,
  81768. Header: res.Header,
  81769. }
  81770. }
  81771. if err != nil {
  81772. return nil, err
  81773. }
  81774. defer googleapi.CloseBody(res)
  81775. if err := googleapi.CheckResponse(res); err != nil {
  81776. return nil, err
  81777. }
  81778. ret := &Route{
  81779. ServerResponse: googleapi.ServerResponse{
  81780. Header: res.Header,
  81781. HTTPStatusCode: res.StatusCode,
  81782. },
  81783. }
  81784. target := &ret
  81785. if err := gensupport.DecodeResponse(target, res); err != nil {
  81786. return nil, err
  81787. }
  81788. return ret, nil
  81789. // {
  81790. // "description": "Returns the specified Route resource. Gets a list of available routes by making a list() request.",
  81791. // "httpMethod": "GET",
  81792. // "id": "compute.routes.get",
  81793. // "parameterOrder": [
  81794. // "project",
  81795. // "route"
  81796. // ],
  81797. // "parameters": {
  81798. // "project": {
  81799. // "description": "Project ID for this request.",
  81800. // "location": "path",
  81801. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  81802. // "required": true,
  81803. // "type": "string"
  81804. // },
  81805. // "route": {
  81806. // "description": "Name of the Route resource to return.",
  81807. // "location": "path",
  81808. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  81809. // "required": true,
  81810. // "type": "string"
  81811. // }
  81812. // },
  81813. // "path": "{project}/global/routes/{route}",
  81814. // "response": {
  81815. // "$ref": "Route"
  81816. // },
  81817. // "scopes": [
  81818. // "https://www.googleapis.com/auth/cloud-platform",
  81819. // "https://www.googleapis.com/auth/compute",
  81820. // "https://www.googleapis.com/auth/compute.readonly"
  81821. // ]
  81822. // }
  81823. }
  81824. // method id "compute.routes.insert":
  81825. type RoutesInsertCall struct {
  81826. s *Service
  81827. project string
  81828. route *Route
  81829. urlParams_ gensupport.URLParams
  81830. ctx_ context.Context
  81831. header_ http.Header
  81832. }
  81833. // Insert: Creates a Route resource in the specified project using the
  81834. // data included in the request.
  81835. // For details, see https://cloud.google.com/compute/docs/reference/latest/routes/insert
  81836. func (r *RoutesService) Insert(project string, route *Route) *RoutesInsertCall {
  81837. c := &RoutesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  81838. c.project = project
  81839. c.route = route
  81840. return c
  81841. }
  81842. // RequestId sets the optional parameter "requestId": An optional
  81843. // request ID to identify requests. Specify a unique request ID so that
  81844. // if you must retry your request, the server will know to ignore the
  81845. // request if it has already been completed.
  81846. //
  81847. // For example, consider a situation where you make an initial request
  81848. // and the request times out. If you make the request again with the
  81849. // same request ID, the server can check if original operation with the
  81850. // same request ID was received, and if so, will ignore the second
  81851. // request. This prevents clients from accidentally creating duplicate
  81852. // commitments.
  81853. //
  81854. // The request ID must be a valid UUID with the exception that zero UUID
  81855. // is not supported (00000000-0000-0000-0000-000000000000).
  81856. func (c *RoutesInsertCall) RequestId(requestId string) *RoutesInsertCall {
  81857. c.urlParams_.Set("requestId", requestId)
  81858. return c
  81859. }
  81860. // Fields allows partial responses to be retrieved. See
  81861. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  81862. // for more information.
  81863. func (c *RoutesInsertCall) Fields(s ...googleapi.Field) *RoutesInsertCall {
  81864. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  81865. return c
  81866. }
  81867. // Context sets the context to be used in this call's Do method. Any
  81868. // pending HTTP request will be aborted if the provided context is
  81869. // canceled.
  81870. func (c *RoutesInsertCall) Context(ctx context.Context) *RoutesInsertCall {
  81871. c.ctx_ = ctx
  81872. return c
  81873. }
  81874. // Header returns an http.Header that can be modified by the caller to
  81875. // add HTTP headers to the request.
  81876. func (c *RoutesInsertCall) Header() http.Header {
  81877. if c.header_ == nil {
  81878. c.header_ = make(http.Header)
  81879. }
  81880. return c.header_
  81881. }
  81882. func (c *RoutesInsertCall) doRequest(alt string) (*http.Response, error) {
  81883. reqHeaders := make(http.Header)
  81884. for k, v := range c.header_ {
  81885. reqHeaders[k] = v
  81886. }
  81887. reqHeaders.Set("User-Agent", c.s.userAgent())
  81888. var body io.Reader = nil
  81889. body, err := googleapi.WithoutDataWrapper.JSONReader(c.route)
  81890. if err != nil {
  81891. return nil, err
  81892. }
  81893. reqHeaders.Set("Content-Type", "application/json")
  81894. c.urlParams_.Set("alt", alt)
  81895. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/routes")
  81896. urls += "?" + c.urlParams_.Encode()
  81897. req, _ := http.NewRequest("POST", urls, body)
  81898. req.Header = reqHeaders
  81899. googleapi.Expand(req.URL, map[string]string{
  81900. "project": c.project,
  81901. })
  81902. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  81903. }
  81904. // Do executes the "compute.routes.insert" call.
  81905. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  81906. // status code is an error. Response headers are in either
  81907. // *Operation.ServerResponse.Header or (if a response was returned at
  81908. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  81909. // to check whether the returned error was because
  81910. // http.StatusNotModified was returned.
  81911. func (c *RoutesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  81912. gensupport.SetOptions(c.urlParams_, opts...)
  81913. res, err := c.doRequest("json")
  81914. if res != nil && res.StatusCode == http.StatusNotModified {
  81915. if res.Body != nil {
  81916. res.Body.Close()
  81917. }
  81918. return nil, &googleapi.Error{
  81919. Code: res.StatusCode,
  81920. Header: res.Header,
  81921. }
  81922. }
  81923. if err != nil {
  81924. return nil, err
  81925. }
  81926. defer googleapi.CloseBody(res)
  81927. if err := googleapi.CheckResponse(res); err != nil {
  81928. return nil, err
  81929. }
  81930. ret := &Operation{
  81931. ServerResponse: googleapi.ServerResponse{
  81932. Header: res.Header,
  81933. HTTPStatusCode: res.StatusCode,
  81934. },
  81935. }
  81936. target := &ret
  81937. if err := gensupport.DecodeResponse(target, res); err != nil {
  81938. return nil, err
  81939. }
  81940. return ret, nil
  81941. // {
  81942. // "description": "Creates a Route resource in the specified project using the data included in the request.",
  81943. // "httpMethod": "POST",
  81944. // "id": "compute.routes.insert",
  81945. // "parameterOrder": [
  81946. // "project"
  81947. // ],
  81948. // "parameters": {
  81949. // "project": {
  81950. // "description": "Project ID for this request.",
  81951. // "location": "path",
  81952. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  81953. // "required": true,
  81954. // "type": "string"
  81955. // },
  81956. // "requestId": {
  81957. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  81958. // "location": "query",
  81959. // "type": "string"
  81960. // }
  81961. // },
  81962. // "path": "{project}/global/routes",
  81963. // "request": {
  81964. // "$ref": "Route"
  81965. // },
  81966. // "response": {
  81967. // "$ref": "Operation"
  81968. // },
  81969. // "scopes": [
  81970. // "https://www.googleapis.com/auth/cloud-platform",
  81971. // "https://www.googleapis.com/auth/compute"
  81972. // ]
  81973. // }
  81974. }
  81975. // method id "compute.routes.list":
  81976. type RoutesListCall struct {
  81977. s *Service
  81978. project string
  81979. urlParams_ gensupport.URLParams
  81980. ifNoneMatch_ string
  81981. ctx_ context.Context
  81982. header_ http.Header
  81983. }
  81984. // List: Retrieves the list of Route resources available to the
  81985. // specified project.
  81986. // For details, see https://cloud.google.com/compute/docs/reference/latest/routes/list
  81987. func (r *RoutesService) List(project string) *RoutesListCall {
  81988. c := &RoutesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  81989. c.project = project
  81990. return c
  81991. }
  81992. // Filter sets the optional parameter "filter": A filter expression that
  81993. // filters resources listed in the response. The expression must specify
  81994. // the field name, a comparison operator, and the value that you want to
  81995. // use for filtering. The value must be a string, a number, or a
  81996. // boolean. The comparison operator must be either =, !=, >, or <.
  81997. //
  81998. // For example, if you are filtering Compute Engine instances, you can
  81999. // exclude instances named example-instance by specifying name !=
  82000. // example-instance.
  82001. //
  82002. // You can also filter nested fields. For example, you could specify
  82003. // scheduling.automaticRestart = false to include instances only if they
  82004. // are not scheduled for automatic restarts. You can use filtering on
  82005. // nested fields to filter based on resource labels.
  82006. //
  82007. // To filter on multiple expressions, provide each separate expression
  82008. // within parentheses. For example, (scheduling.automaticRestart = true)
  82009. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  82010. // AND expression. However, you can include AND and OR expressions
  82011. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  82012. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  82013. // true).
  82014. func (c *RoutesListCall) Filter(filter string) *RoutesListCall {
  82015. c.urlParams_.Set("filter", filter)
  82016. return c
  82017. }
  82018. // MaxResults sets the optional parameter "maxResults": The maximum
  82019. // number of results per page that should be returned. If the number of
  82020. // available results is larger than maxResults, Compute Engine returns a
  82021. // nextPageToken that can be used to get the next page of results in
  82022. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  82023. // (Default: 500)
  82024. func (c *RoutesListCall) MaxResults(maxResults int64) *RoutesListCall {
  82025. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  82026. return c
  82027. }
  82028. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  82029. // a certain order. By default, results are returned in alphanumerical
  82030. // order based on the resource name.
  82031. //
  82032. // You can also sort results in descending order based on the creation
  82033. // timestamp using orderBy="creationTimestamp desc". This sorts results
  82034. // based on the creationTimestamp field in reverse chronological order
  82035. // (newest result first). Use this to sort resources like operations so
  82036. // that the newest operation is returned first.
  82037. //
  82038. // Currently, only sorting by name or creationTimestamp desc is
  82039. // supported.
  82040. func (c *RoutesListCall) OrderBy(orderBy string) *RoutesListCall {
  82041. c.urlParams_.Set("orderBy", orderBy)
  82042. return c
  82043. }
  82044. // PageToken sets the optional parameter "pageToken": Specifies a page
  82045. // token to use. Set pageToken to the nextPageToken returned by a
  82046. // previous list request to get the next page of results.
  82047. func (c *RoutesListCall) PageToken(pageToken string) *RoutesListCall {
  82048. c.urlParams_.Set("pageToken", pageToken)
  82049. return c
  82050. }
  82051. // Fields allows partial responses to be retrieved. See
  82052. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  82053. // for more information.
  82054. func (c *RoutesListCall) Fields(s ...googleapi.Field) *RoutesListCall {
  82055. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  82056. return c
  82057. }
  82058. // IfNoneMatch sets the optional parameter which makes the operation
  82059. // fail if the object's ETag matches the given value. This is useful for
  82060. // getting updates only after the object has changed since the last
  82061. // request. Use googleapi.IsNotModified to check whether the response
  82062. // error from Do is the result of In-None-Match.
  82063. func (c *RoutesListCall) IfNoneMatch(entityTag string) *RoutesListCall {
  82064. c.ifNoneMatch_ = entityTag
  82065. return c
  82066. }
  82067. // Context sets the context to be used in this call's Do method. Any
  82068. // pending HTTP request will be aborted if the provided context is
  82069. // canceled.
  82070. func (c *RoutesListCall) Context(ctx context.Context) *RoutesListCall {
  82071. c.ctx_ = ctx
  82072. return c
  82073. }
  82074. // Header returns an http.Header that can be modified by the caller to
  82075. // add HTTP headers to the request.
  82076. func (c *RoutesListCall) Header() http.Header {
  82077. if c.header_ == nil {
  82078. c.header_ = make(http.Header)
  82079. }
  82080. return c.header_
  82081. }
  82082. func (c *RoutesListCall) doRequest(alt string) (*http.Response, error) {
  82083. reqHeaders := make(http.Header)
  82084. for k, v := range c.header_ {
  82085. reqHeaders[k] = v
  82086. }
  82087. reqHeaders.Set("User-Agent", c.s.userAgent())
  82088. if c.ifNoneMatch_ != "" {
  82089. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  82090. }
  82091. var body io.Reader = nil
  82092. c.urlParams_.Set("alt", alt)
  82093. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/routes")
  82094. urls += "?" + c.urlParams_.Encode()
  82095. req, _ := http.NewRequest("GET", urls, body)
  82096. req.Header = reqHeaders
  82097. googleapi.Expand(req.URL, map[string]string{
  82098. "project": c.project,
  82099. })
  82100. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  82101. }
  82102. // Do executes the "compute.routes.list" call.
  82103. // Exactly one of *RouteList or error will be non-nil. Any non-2xx
  82104. // status code is an error. Response headers are in either
  82105. // *RouteList.ServerResponse.Header or (if a response was returned at
  82106. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  82107. // to check whether the returned error was because
  82108. // http.StatusNotModified was returned.
  82109. func (c *RoutesListCall) Do(opts ...googleapi.CallOption) (*RouteList, error) {
  82110. gensupport.SetOptions(c.urlParams_, opts...)
  82111. res, err := c.doRequest("json")
  82112. if res != nil && res.StatusCode == http.StatusNotModified {
  82113. if res.Body != nil {
  82114. res.Body.Close()
  82115. }
  82116. return nil, &googleapi.Error{
  82117. Code: res.StatusCode,
  82118. Header: res.Header,
  82119. }
  82120. }
  82121. if err != nil {
  82122. return nil, err
  82123. }
  82124. defer googleapi.CloseBody(res)
  82125. if err := googleapi.CheckResponse(res); err != nil {
  82126. return nil, err
  82127. }
  82128. ret := &RouteList{
  82129. ServerResponse: googleapi.ServerResponse{
  82130. Header: res.Header,
  82131. HTTPStatusCode: res.StatusCode,
  82132. },
  82133. }
  82134. target := &ret
  82135. if err := gensupport.DecodeResponse(target, res); err != nil {
  82136. return nil, err
  82137. }
  82138. return ret, nil
  82139. // {
  82140. // "description": "Retrieves the list of Route resources available to the specified project.",
  82141. // "httpMethod": "GET",
  82142. // "id": "compute.routes.list",
  82143. // "parameterOrder": [
  82144. // "project"
  82145. // ],
  82146. // "parameters": {
  82147. // "filter": {
  82148. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  82149. // "location": "query",
  82150. // "type": "string"
  82151. // },
  82152. // "maxResults": {
  82153. // "default": "500",
  82154. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  82155. // "format": "uint32",
  82156. // "location": "query",
  82157. // "minimum": "0",
  82158. // "type": "integer"
  82159. // },
  82160. // "orderBy": {
  82161. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  82162. // "location": "query",
  82163. // "type": "string"
  82164. // },
  82165. // "pageToken": {
  82166. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  82167. // "location": "query",
  82168. // "type": "string"
  82169. // },
  82170. // "project": {
  82171. // "description": "Project ID for this request.",
  82172. // "location": "path",
  82173. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  82174. // "required": true,
  82175. // "type": "string"
  82176. // }
  82177. // },
  82178. // "path": "{project}/global/routes",
  82179. // "response": {
  82180. // "$ref": "RouteList"
  82181. // },
  82182. // "scopes": [
  82183. // "https://www.googleapis.com/auth/cloud-platform",
  82184. // "https://www.googleapis.com/auth/compute",
  82185. // "https://www.googleapis.com/auth/compute.readonly"
  82186. // ]
  82187. // }
  82188. }
  82189. // Pages invokes f for each page of results.
  82190. // A non-nil error returned from f will halt the iteration.
  82191. // The provided context supersedes any context provided to the Context method.
  82192. func (c *RoutesListCall) Pages(ctx context.Context, f func(*RouteList) error) error {
  82193. c.ctx_ = ctx
  82194. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  82195. for {
  82196. x, err := c.Do()
  82197. if err != nil {
  82198. return err
  82199. }
  82200. if err := f(x); err != nil {
  82201. return err
  82202. }
  82203. if x.NextPageToken == "" {
  82204. return nil
  82205. }
  82206. c.PageToken(x.NextPageToken)
  82207. }
  82208. }
  82209. // method id "compute.routes.testIamPermissions":
  82210. type RoutesTestIamPermissionsCall struct {
  82211. s *Service
  82212. project string
  82213. resource string
  82214. testpermissionsrequest *TestPermissionsRequest
  82215. urlParams_ gensupport.URLParams
  82216. ctx_ context.Context
  82217. header_ http.Header
  82218. }
  82219. // TestIamPermissions: Returns permissions that a caller has on the
  82220. // specified resource.
  82221. func (r *RoutesService) TestIamPermissions(project string, resource string, testpermissionsrequest *TestPermissionsRequest) *RoutesTestIamPermissionsCall {
  82222. c := &RoutesTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  82223. c.project = project
  82224. c.resource = resource
  82225. c.testpermissionsrequest = testpermissionsrequest
  82226. return c
  82227. }
  82228. // Fields allows partial responses to be retrieved. See
  82229. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  82230. // for more information.
  82231. func (c *RoutesTestIamPermissionsCall) Fields(s ...googleapi.Field) *RoutesTestIamPermissionsCall {
  82232. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  82233. return c
  82234. }
  82235. // Context sets the context to be used in this call's Do method. Any
  82236. // pending HTTP request will be aborted if the provided context is
  82237. // canceled.
  82238. func (c *RoutesTestIamPermissionsCall) Context(ctx context.Context) *RoutesTestIamPermissionsCall {
  82239. c.ctx_ = ctx
  82240. return c
  82241. }
  82242. // Header returns an http.Header that can be modified by the caller to
  82243. // add HTTP headers to the request.
  82244. func (c *RoutesTestIamPermissionsCall) Header() http.Header {
  82245. if c.header_ == nil {
  82246. c.header_ = make(http.Header)
  82247. }
  82248. return c.header_
  82249. }
  82250. func (c *RoutesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  82251. reqHeaders := make(http.Header)
  82252. for k, v := range c.header_ {
  82253. reqHeaders[k] = v
  82254. }
  82255. reqHeaders.Set("User-Agent", c.s.userAgent())
  82256. var body io.Reader = nil
  82257. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  82258. if err != nil {
  82259. return nil, err
  82260. }
  82261. reqHeaders.Set("Content-Type", "application/json")
  82262. c.urlParams_.Set("alt", alt)
  82263. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/routes/{resource}/testIamPermissions")
  82264. urls += "?" + c.urlParams_.Encode()
  82265. req, _ := http.NewRequest("POST", urls, body)
  82266. req.Header = reqHeaders
  82267. googleapi.Expand(req.URL, map[string]string{
  82268. "project": c.project,
  82269. "resource": c.resource,
  82270. })
  82271. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  82272. }
  82273. // Do executes the "compute.routes.testIamPermissions" call.
  82274. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  82275. // non-2xx status code is an error. Response headers are in either
  82276. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  82277. // returned at all) in error.(*googleapi.Error).Header. Use
  82278. // googleapi.IsNotModified to check whether the returned error was
  82279. // because http.StatusNotModified was returned.
  82280. func (c *RoutesTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  82281. gensupport.SetOptions(c.urlParams_, opts...)
  82282. res, err := c.doRequest("json")
  82283. if res != nil && res.StatusCode == http.StatusNotModified {
  82284. if res.Body != nil {
  82285. res.Body.Close()
  82286. }
  82287. return nil, &googleapi.Error{
  82288. Code: res.StatusCode,
  82289. Header: res.Header,
  82290. }
  82291. }
  82292. if err != nil {
  82293. return nil, err
  82294. }
  82295. defer googleapi.CloseBody(res)
  82296. if err := googleapi.CheckResponse(res); err != nil {
  82297. return nil, err
  82298. }
  82299. ret := &TestPermissionsResponse{
  82300. ServerResponse: googleapi.ServerResponse{
  82301. Header: res.Header,
  82302. HTTPStatusCode: res.StatusCode,
  82303. },
  82304. }
  82305. target := &ret
  82306. if err := gensupport.DecodeResponse(target, res); err != nil {
  82307. return nil, err
  82308. }
  82309. return ret, nil
  82310. // {
  82311. // "description": "Returns permissions that a caller has on the specified resource.",
  82312. // "httpMethod": "POST",
  82313. // "id": "compute.routes.testIamPermissions",
  82314. // "parameterOrder": [
  82315. // "project",
  82316. // "resource"
  82317. // ],
  82318. // "parameters": {
  82319. // "project": {
  82320. // "description": "Project ID for this request.",
  82321. // "location": "path",
  82322. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  82323. // "required": true,
  82324. // "type": "string"
  82325. // },
  82326. // "resource": {
  82327. // "description": "Name of the resource for this request.",
  82328. // "location": "path",
  82329. // "pattern": "(?:[-a-z0-9_]{0,62}[a-z0-9])?",
  82330. // "required": true,
  82331. // "type": "string"
  82332. // }
  82333. // },
  82334. // "path": "{project}/global/routes/{resource}/testIamPermissions",
  82335. // "request": {
  82336. // "$ref": "TestPermissionsRequest"
  82337. // },
  82338. // "response": {
  82339. // "$ref": "TestPermissionsResponse"
  82340. // },
  82341. // "scopes": [
  82342. // "https://www.googleapis.com/auth/cloud-platform",
  82343. // "https://www.googleapis.com/auth/compute",
  82344. // "https://www.googleapis.com/auth/compute.readonly"
  82345. // ]
  82346. // }
  82347. }
  82348. // method id "compute.securityPolicies.addRule":
  82349. type SecurityPoliciesAddRuleCall struct {
  82350. s *Service
  82351. project string
  82352. securityPolicy string
  82353. securitypolicyrule *SecurityPolicyRule
  82354. urlParams_ gensupport.URLParams
  82355. ctx_ context.Context
  82356. header_ http.Header
  82357. }
  82358. // AddRule: Inserts a rule into a security policy.
  82359. func (r *SecurityPoliciesService) AddRule(project string, securityPolicy string, securitypolicyrule *SecurityPolicyRule) *SecurityPoliciesAddRuleCall {
  82360. c := &SecurityPoliciesAddRuleCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  82361. c.project = project
  82362. c.securityPolicy = securityPolicy
  82363. c.securitypolicyrule = securitypolicyrule
  82364. return c
  82365. }
  82366. // Fields allows partial responses to be retrieved. See
  82367. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  82368. // for more information.
  82369. func (c *SecurityPoliciesAddRuleCall) Fields(s ...googleapi.Field) *SecurityPoliciesAddRuleCall {
  82370. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  82371. return c
  82372. }
  82373. // Context sets the context to be used in this call's Do method. Any
  82374. // pending HTTP request will be aborted if the provided context is
  82375. // canceled.
  82376. func (c *SecurityPoliciesAddRuleCall) Context(ctx context.Context) *SecurityPoliciesAddRuleCall {
  82377. c.ctx_ = ctx
  82378. return c
  82379. }
  82380. // Header returns an http.Header that can be modified by the caller to
  82381. // add HTTP headers to the request.
  82382. func (c *SecurityPoliciesAddRuleCall) Header() http.Header {
  82383. if c.header_ == nil {
  82384. c.header_ = make(http.Header)
  82385. }
  82386. return c.header_
  82387. }
  82388. func (c *SecurityPoliciesAddRuleCall) doRequest(alt string) (*http.Response, error) {
  82389. reqHeaders := make(http.Header)
  82390. for k, v := range c.header_ {
  82391. reqHeaders[k] = v
  82392. }
  82393. reqHeaders.Set("User-Agent", c.s.userAgent())
  82394. var body io.Reader = nil
  82395. body, err := googleapi.WithoutDataWrapper.JSONReader(c.securitypolicyrule)
  82396. if err != nil {
  82397. return nil, err
  82398. }
  82399. reqHeaders.Set("Content-Type", "application/json")
  82400. c.urlParams_.Set("alt", alt)
  82401. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/securityPolicies/{securityPolicy}/addRule")
  82402. urls += "?" + c.urlParams_.Encode()
  82403. req, _ := http.NewRequest("POST", urls, body)
  82404. req.Header = reqHeaders
  82405. googleapi.Expand(req.URL, map[string]string{
  82406. "project": c.project,
  82407. "securityPolicy": c.securityPolicy,
  82408. })
  82409. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  82410. }
  82411. // Do executes the "compute.securityPolicies.addRule" call.
  82412. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  82413. // status code is an error. Response headers are in either
  82414. // *Operation.ServerResponse.Header or (if a response was returned at
  82415. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  82416. // to check whether the returned error was because
  82417. // http.StatusNotModified was returned.
  82418. func (c *SecurityPoliciesAddRuleCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  82419. gensupport.SetOptions(c.urlParams_, opts...)
  82420. res, err := c.doRequest("json")
  82421. if res != nil && res.StatusCode == http.StatusNotModified {
  82422. if res.Body != nil {
  82423. res.Body.Close()
  82424. }
  82425. return nil, &googleapi.Error{
  82426. Code: res.StatusCode,
  82427. Header: res.Header,
  82428. }
  82429. }
  82430. if err != nil {
  82431. return nil, err
  82432. }
  82433. defer googleapi.CloseBody(res)
  82434. if err := googleapi.CheckResponse(res); err != nil {
  82435. return nil, err
  82436. }
  82437. ret := &Operation{
  82438. ServerResponse: googleapi.ServerResponse{
  82439. Header: res.Header,
  82440. HTTPStatusCode: res.StatusCode,
  82441. },
  82442. }
  82443. target := &ret
  82444. if err := gensupport.DecodeResponse(target, res); err != nil {
  82445. return nil, err
  82446. }
  82447. return ret, nil
  82448. // {
  82449. // "description": "Inserts a rule into a security policy.",
  82450. // "httpMethod": "POST",
  82451. // "id": "compute.securityPolicies.addRule",
  82452. // "parameterOrder": [
  82453. // "project",
  82454. // "securityPolicy"
  82455. // ],
  82456. // "parameters": {
  82457. // "project": {
  82458. // "description": "Project ID for this request.",
  82459. // "location": "path",
  82460. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  82461. // "required": true,
  82462. // "type": "string"
  82463. // },
  82464. // "securityPolicy": {
  82465. // "description": "Name of the security policy to update.",
  82466. // "location": "path",
  82467. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  82468. // "required": true,
  82469. // "type": "string"
  82470. // }
  82471. // },
  82472. // "path": "{project}/global/securityPolicies/{securityPolicy}/addRule",
  82473. // "request": {
  82474. // "$ref": "SecurityPolicyRule"
  82475. // },
  82476. // "response": {
  82477. // "$ref": "Operation"
  82478. // },
  82479. // "scopes": [
  82480. // "https://www.googleapis.com/auth/cloud-platform",
  82481. // "https://www.googleapis.com/auth/compute"
  82482. // ]
  82483. // }
  82484. }
  82485. // method id "compute.securityPolicies.delete":
  82486. type SecurityPoliciesDeleteCall struct {
  82487. s *Service
  82488. project string
  82489. securityPolicy string
  82490. urlParams_ gensupport.URLParams
  82491. ctx_ context.Context
  82492. header_ http.Header
  82493. }
  82494. // Delete: Deletes the specified policy.
  82495. func (r *SecurityPoliciesService) Delete(project string, securityPolicy string) *SecurityPoliciesDeleteCall {
  82496. c := &SecurityPoliciesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  82497. c.project = project
  82498. c.securityPolicy = securityPolicy
  82499. return c
  82500. }
  82501. // RequestId sets the optional parameter "requestId": An optional
  82502. // request ID to identify requests. Specify a unique request ID so that
  82503. // if you must retry your request, the server will know to ignore the
  82504. // request if it has already been completed.
  82505. //
  82506. // For example, consider a situation where you make an initial request
  82507. // and the request times out. If you make the request again with the
  82508. // same request ID, the server can check if original operation with the
  82509. // same request ID was received, and if so, will ignore the second
  82510. // request. This prevents clients from accidentally creating duplicate
  82511. // commitments.
  82512. //
  82513. // The request ID must be a valid UUID with the exception that zero UUID
  82514. // is not supported (00000000-0000-0000-0000-000000000000).
  82515. func (c *SecurityPoliciesDeleteCall) RequestId(requestId string) *SecurityPoliciesDeleteCall {
  82516. c.urlParams_.Set("requestId", requestId)
  82517. return c
  82518. }
  82519. // Fields allows partial responses to be retrieved. See
  82520. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  82521. // for more information.
  82522. func (c *SecurityPoliciesDeleteCall) Fields(s ...googleapi.Field) *SecurityPoliciesDeleteCall {
  82523. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  82524. return c
  82525. }
  82526. // Context sets the context to be used in this call's Do method. Any
  82527. // pending HTTP request will be aborted if the provided context is
  82528. // canceled.
  82529. func (c *SecurityPoliciesDeleteCall) Context(ctx context.Context) *SecurityPoliciesDeleteCall {
  82530. c.ctx_ = ctx
  82531. return c
  82532. }
  82533. // Header returns an http.Header that can be modified by the caller to
  82534. // add HTTP headers to the request.
  82535. func (c *SecurityPoliciesDeleteCall) Header() http.Header {
  82536. if c.header_ == nil {
  82537. c.header_ = make(http.Header)
  82538. }
  82539. return c.header_
  82540. }
  82541. func (c *SecurityPoliciesDeleteCall) doRequest(alt string) (*http.Response, error) {
  82542. reqHeaders := make(http.Header)
  82543. for k, v := range c.header_ {
  82544. reqHeaders[k] = v
  82545. }
  82546. reqHeaders.Set("User-Agent", c.s.userAgent())
  82547. var body io.Reader = nil
  82548. c.urlParams_.Set("alt", alt)
  82549. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/securityPolicies/{securityPolicy}")
  82550. urls += "?" + c.urlParams_.Encode()
  82551. req, _ := http.NewRequest("DELETE", urls, body)
  82552. req.Header = reqHeaders
  82553. googleapi.Expand(req.URL, map[string]string{
  82554. "project": c.project,
  82555. "securityPolicy": c.securityPolicy,
  82556. })
  82557. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  82558. }
  82559. // Do executes the "compute.securityPolicies.delete" call.
  82560. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  82561. // status code is an error. Response headers are in either
  82562. // *Operation.ServerResponse.Header or (if a response was returned at
  82563. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  82564. // to check whether the returned error was because
  82565. // http.StatusNotModified was returned.
  82566. func (c *SecurityPoliciesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  82567. gensupport.SetOptions(c.urlParams_, opts...)
  82568. res, err := c.doRequest("json")
  82569. if res != nil && res.StatusCode == http.StatusNotModified {
  82570. if res.Body != nil {
  82571. res.Body.Close()
  82572. }
  82573. return nil, &googleapi.Error{
  82574. Code: res.StatusCode,
  82575. Header: res.Header,
  82576. }
  82577. }
  82578. if err != nil {
  82579. return nil, err
  82580. }
  82581. defer googleapi.CloseBody(res)
  82582. if err := googleapi.CheckResponse(res); err != nil {
  82583. return nil, err
  82584. }
  82585. ret := &Operation{
  82586. ServerResponse: googleapi.ServerResponse{
  82587. Header: res.Header,
  82588. HTTPStatusCode: res.StatusCode,
  82589. },
  82590. }
  82591. target := &ret
  82592. if err := gensupport.DecodeResponse(target, res); err != nil {
  82593. return nil, err
  82594. }
  82595. return ret, nil
  82596. // {
  82597. // "description": "Deletes the specified policy.",
  82598. // "httpMethod": "DELETE",
  82599. // "id": "compute.securityPolicies.delete",
  82600. // "parameterOrder": [
  82601. // "project",
  82602. // "securityPolicy"
  82603. // ],
  82604. // "parameters": {
  82605. // "project": {
  82606. // "description": "Project ID for this request.",
  82607. // "location": "path",
  82608. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  82609. // "required": true,
  82610. // "type": "string"
  82611. // },
  82612. // "requestId": {
  82613. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  82614. // "location": "query",
  82615. // "type": "string"
  82616. // },
  82617. // "securityPolicy": {
  82618. // "description": "Name of the security policy to delete.",
  82619. // "location": "path",
  82620. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  82621. // "required": true,
  82622. // "type": "string"
  82623. // }
  82624. // },
  82625. // "path": "{project}/global/securityPolicies/{securityPolicy}",
  82626. // "response": {
  82627. // "$ref": "Operation"
  82628. // },
  82629. // "scopes": [
  82630. // "https://www.googleapis.com/auth/cloud-platform",
  82631. // "https://www.googleapis.com/auth/compute"
  82632. // ]
  82633. // }
  82634. }
  82635. // method id "compute.securityPolicies.get":
  82636. type SecurityPoliciesGetCall struct {
  82637. s *Service
  82638. project string
  82639. securityPolicy string
  82640. urlParams_ gensupport.URLParams
  82641. ifNoneMatch_ string
  82642. ctx_ context.Context
  82643. header_ http.Header
  82644. }
  82645. // Get: List all of the ordered rules present in a single specified
  82646. // policy.
  82647. func (r *SecurityPoliciesService) Get(project string, securityPolicy string) *SecurityPoliciesGetCall {
  82648. c := &SecurityPoliciesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  82649. c.project = project
  82650. c.securityPolicy = securityPolicy
  82651. return c
  82652. }
  82653. // Fields allows partial responses to be retrieved. See
  82654. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  82655. // for more information.
  82656. func (c *SecurityPoliciesGetCall) Fields(s ...googleapi.Field) *SecurityPoliciesGetCall {
  82657. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  82658. return c
  82659. }
  82660. // IfNoneMatch sets the optional parameter which makes the operation
  82661. // fail if the object's ETag matches the given value. This is useful for
  82662. // getting updates only after the object has changed since the last
  82663. // request. Use googleapi.IsNotModified to check whether the response
  82664. // error from Do is the result of In-None-Match.
  82665. func (c *SecurityPoliciesGetCall) IfNoneMatch(entityTag string) *SecurityPoliciesGetCall {
  82666. c.ifNoneMatch_ = entityTag
  82667. return c
  82668. }
  82669. // Context sets the context to be used in this call's Do method. Any
  82670. // pending HTTP request will be aborted if the provided context is
  82671. // canceled.
  82672. func (c *SecurityPoliciesGetCall) Context(ctx context.Context) *SecurityPoliciesGetCall {
  82673. c.ctx_ = ctx
  82674. return c
  82675. }
  82676. // Header returns an http.Header that can be modified by the caller to
  82677. // add HTTP headers to the request.
  82678. func (c *SecurityPoliciesGetCall) Header() http.Header {
  82679. if c.header_ == nil {
  82680. c.header_ = make(http.Header)
  82681. }
  82682. return c.header_
  82683. }
  82684. func (c *SecurityPoliciesGetCall) doRequest(alt string) (*http.Response, error) {
  82685. reqHeaders := make(http.Header)
  82686. for k, v := range c.header_ {
  82687. reqHeaders[k] = v
  82688. }
  82689. reqHeaders.Set("User-Agent", c.s.userAgent())
  82690. if c.ifNoneMatch_ != "" {
  82691. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  82692. }
  82693. var body io.Reader = nil
  82694. c.urlParams_.Set("alt", alt)
  82695. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/securityPolicies/{securityPolicy}")
  82696. urls += "?" + c.urlParams_.Encode()
  82697. req, _ := http.NewRequest("GET", urls, body)
  82698. req.Header = reqHeaders
  82699. googleapi.Expand(req.URL, map[string]string{
  82700. "project": c.project,
  82701. "securityPolicy": c.securityPolicy,
  82702. })
  82703. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  82704. }
  82705. // Do executes the "compute.securityPolicies.get" call.
  82706. // Exactly one of *SecurityPolicy or error will be non-nil. Any non-2xx
  82707. // status code is an error. Response headers are in either
  82708. // *SecurityPolicy.ServerResponse.Header or (if a response was returned
  82709. // at all) in error.(*googleapi.Error).Header. Use
  82710. // googleapi.IsNotModified to check whether the returned error was
  82711. // because http.StatusNotModified was returned.
  82712. func (c *SecurityPoliciesGetCall) Do(opts ...googleapi.CallOption) (*SecurityPolicy, error) {
  82713. gensupport.SetOptions(c.urlParams_, opts...)
  82714. res, err := c.doRequest("json")
  82715. if res != nil && res.StatusCode == http.StatusNotModified {
  82716. if res.Body != nil {
  82717. res.Body.Close()
  82718. }
  82719. return nil, &googleapi.Error{
  82720. Code: res.StatusCode,
  82721. Header: res.Header,
  82722. }
  82723. }
  82724. if err != nil {
  82725. return nil, err
  82726. }
  82727. defer googleapi.CloseBody(res)
  82728. if err := googleapi.CheckResponse(res); err != nil {
  82729. return nil, err
  82730. }
  82731. ret := &SecurityPolicy{
  82732. ServerResponse: googleapi.ServerResponse{
  82733. Header: res.Header,
  82734. HTTPStatusCode: res.StatusCode,
  82735. },
  82736. }
  82737. target := &ret
  82738. if err := gensupport.DecodeResponse(target, res); err != nil {
  82739. return nil, err
  82740. }
  82741. return ret, nil
  82742. // {
  82743. // "description": "List all of the ordered rules present in a single specified policy.",
  82744. // "httpMethod": "GET",
  82745. // "id": "compute.securityPolicies.get",
  82746. // "parameterOrder": [
  82747. // "project",
  82748. // "securityPolicy"
  82749. // ],
  82750. // "parameters": {
  82751. // "project": {
  82752. // "description": "Project ID for this request.",
  82753. // "location": "path",
  82754. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  82755. // "required": true,
  82756. // "type": "string"
  82757. // },
  82758. // "securityPolicy": {
  82759. // "description": "Name of the security policy to get.",
  82760. // "location": "path",
  82761. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  82762. // "required": true,
  82763. // "type": "string"
  82764. // }
  82765. // },
  82766. // "path": "{project}/global/securityPolicies/{securityPolicy}",
  82767. // "response": {
  82768. // "$ref": "SecurityPolicy"
  82769. // },
  82770. // "scopes": [
  82771. // "https://www.googleapis.com/auth/cloud-platform",
  82772. // "https://www.googleapis.com/auth/compute",
  82773. // "https://www.googleapis.com/auth/compute.readonly"
  82774. // ]
  82775. // }
  82776. }
  82777. // method id "compute.securityPolicies.getRule":
  82778. type SecurityPoliciesGetRuleCall struct {
  82779. s *Service
  82780. project string
  82781. securityPolicy string
  82782. urlParams_ gensupport.URLParams
  82783. ifNoneMatch_ string
  82784. ctx_ context.Context
  82785. header_ http.Header
  82786. }
  82787. // GetRule: Gets a rule at the specified priority.
  82788. func (r *SecurityPoliciesService) GetRule(project string, securityPolicy string) *SecurityPoliciesGetRuleCall {
  82789. c := &SecurityPoliciesGetRuleCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  82790. c.project = project
  82791. c.securityPolicy = securityPolicy
  82792. return c
  82793. }
  82794. // Priority sets the optional parameter "priority": The priority of the
  82795. // rule to get from the security policy.
  82796. func (c *SecurityPoliciesGetRuleCall) Priority(priority int64) *SecurityPoliciesGetRuleCall {
  82797. c.urlParams_.Set("priority", fmt.Sprint(priority))
  82798. return c
  82799. }
  82800. // Fields allows partial responses to be retrieved. See
  82801. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  82802. // for more information.
  82803. func (c *SecurityPoliciesGetRuleCall) Fields(s ...googleapi.Field) *SecurityPoliciesGetRuleCall {
  82804. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  82805. return c
  82806. }
  82807. // IfNoneMatch sets the optional parameter which makes the operation
  82808. // fail if the object's ETag matches the given value. This is useful for
  82809. // getting updates only after the object has changed since the last
  82810. // request. Use googleapi.IsNotModified to check whether the response
  82811. // error from Do is the result of In-None-Match.
  82812. func (c *SecurityPoliciesGetRuleCall) IfNoneMatch(entityTag string) *SecurityPoliciesGetRuleCall {
  82813. c.ifNoneMatch_ = entityTag
  82814. return c
  82815. }
  82816. // Context sets the context to be used in this call's Do method. Any
  82817. // pending HTTP request will be aborted if the provided context is
  82818. // canceled.
  82819. func (c *SecurityPoliciesGetRuleCall) Context(ctx context.Context) *SecurityPoliciesGetRuleCall {
  82820. c.ctx_ = ctx
  82821. return c
  82822. }
  82823. // Header returns an http.Header that can be modified by the caller to
  82824. // add HTTP headers to the request.
  82825. func (c *SecurityPoliciesGetRuleCall) Header() http.Header {
  82826. if c.header_ == nil {
  82827. c.header_ = make(http.Header)
  82828. }
  82829. return c.header_
  82830. }
  82831. func (c *SecurityPoliciesGetRuleCall) doRequest(alt string) (*http.Response, error) {
  82832. reqHeaders := make(http.Header)
  82833. for k, v := range c.header_ {
  82834. reqHeaders[k] = v
  82835. }
  82836. reqHeaders.Set("User-Agent", c.s.userAgent())
  82837. if c.ifNoneMatch_ != "" {
  82838. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  82839. }
  82840. var body io.Reader = nil
  82841. c.urlParams_.Set("alt", alt)
  82842. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/securityPolicies/{securityPolicy}/getRule")
  82843. urls += "?" + c.urlParams_.Encode()
  82844. req, _ := http.NewRequest("GET", urls, body)
  82845. req.Header = reqHeaders
  82846. googleapi.Expand(req.URL, map[string]string{
  82847. "project": c.project,
  82848. "securityPolicy": c.securityPolicy,
  82849. })
  82850. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  82851. }
  82852. // Do executes the "compute.securityPolicies.getRule" call.
  82853. // Exactly one of *SecurityPolicyRule or error will be non-nil. Any
  82854. // non-2xx status code is an error. Response headers are in either
  82855. // *SecurityPolicyRule.ServerResponse.Header or (if a response was
  82856. // returned at all) in error.(*googleapi.Error).Header. Use
  82857. // googleapi.IsNotModified to check whether the returned error was
  82858. // because http.StatusNotModified was returned.
  82859. func (c *SecurityPoliciesGetRuleCall) Do(opts ...googleapi.CallOption) (*SecurityPolicyRule, error) {
  82860. gensupport.SetOptions(c.urlParams_, opts...)
  82861. res, err := c.doRequest("json")
  82862. if res != nil && res.StatusCode == http.StatusNotModified {
  82863. if res.Body != nil {
  82864. res.Body.Close()
  82865. }
  82866. return nil, &googleapi.Error{
  82867. Code: res.StatusCode,
  82868. Header: res.Header,
  82869. }
  82870. }
  82871. if err != nil {
  82872. return nil, err
  82873. }
  82874. defer googleapi.CloseBody(res)
  82875. if err := googleapi.CheckResponse(res); err != nil {
  82876. return nil, err
  82877. }
  82878. ret := &SecurityPolicyRule{
  82879. ServerResponse: googleapi.ServerResponse{
  82880. Header: res.Header,
  82881. HTTPStatusCode: res.StatusCode,
  82882. },
  82883. }
  82884. target := &ret
  82885. if err := gensupport.DecodeResponse(target, res); err != nil {
  82886. return nil, err
  82887. }
  82888. return ret, nil
  82889. // {
  82890. // "description": "Gets a rule at the specified priority.",
  82891. // "httpMethod": "GET",
  82892. // "id": "compute.securityPolicies.getRule",
  82893. // "parameterOrder": [
  82894. // "project",
  82895. // "securityPolicy"
  82896. // ],
  82897. // "parameters": {
  82898. // "priority": {
  82899. // "description": "The priority of the rule to get from the security policy.",
  82900. // "format": "int32",
  82901. // "location": "query",
  82902. // "type": "integer"
  82903. // },
  82904. // "project": {
  82905. // "description": "Project ID for this request.",
  82906. // "location": "path",
  82907. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  82908. // "required": true,
  82909. // "type": "string"
  82910. // },
  82911. // "securityPolicy": {
  82912. // "description": "Name of the security policy to which the queried rule belongs.",
  82913. // "location": "path",
  82914. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  82915. // "required": true,
  82916. // "type": "string"
  82917. // }
  82918. // },
  82919. // "path": "{project}/global/securityPolicies/{securityPolicy}/getRule",
  82920. // "response": {
  82921. // "$ref": "SecurityPolicyRule"
  82922. // },
  82923. // "scopes": [
  82924. // "https://www.googleapis.com/auth/cloud-platform",
  82925. // "https://www.googleapis.com/auth/compute",
  82926. // "https://www.googleapis.com/auth/compute.readonly"
  82927. // ]
  82928. // }
  82929. }
  82930. // method id "compute.securityPolicies.insert":
  82931. type SecurityPoliciesInsertCall struct {
  82932. s *Service
  82933. project string
  82934. securitypolicy *SecurityPolicy
  82935. urlParams_ gensupport.URLParams
  82936. ctx_ context.Context
  82937. header_ http.Header
  82938. }
  82939. // Insert: Creates a new policy in the specified project using the data
  82940. // included in the request.
  82941. func (r *SecurityPoliciesService) Insert(project string, securitypolicy *SecurityPolicy) *SecurityPoliciesInsertCall {
  82942. c := &SecurityPoliciesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  82943. c.project = project
  82944. c.securitypolicy = securitypolicy
  82945. return c
  82946. }
  82947. // RequestId sets the optional parameter "requestId": An optional
  82948. // request ID to identify requests. Specify a unique request ID so that
  82949. // if you must retry your request, the server will know to ignore the
  82950. // request if it has already been completed.
  82951. //
  82952. // For example, consider a situation where you make an initial request
  82953. // and the request times out. If you make the request again with the
  82954. // same request ID, the server can check if original operation with the
  82955. // same request ID was received, and if so, will ignore the second
  82956. // request. This prevents clients from accidentally creating duplicate
  82957. // commitments.
  82958. //
  82959. // The request ID must be a valid UUID with the exception that zero UUID
  82960. // is not supported (00000000-0000-0000-0000-000000000000).
  82961. func (c *SecurityPoliciesInsertCall) RequestId(requestId string) *SecurityPoliciesInsertCall {
  82962. c.urlParams_.Set("requestId", requestId)
  82963. return c
  82964. }
  82965. // Fields allows partial responses to be retrieved. See
  82966. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  82967. // for more information.
  82968. func (c *SecurityPoliciesInsertCall) Fields(s ...googleapi.Field) *SecurityPoliciesInsertCall {
  82969. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  82970. return c
  82971. }
  82972. // Context sets the context to be used in this call's Do method. Any
  82973. // pending HTTP request will be aborted if the provided context is
  82974. // canceled.
  82975. func (c *SecurityPoliciesInsertCall) Context(ctx context.Context) *SecurityPoliciesInsertCall {
  82976. c.ctx_ = ctx
  82977. return c
  82978. }
  82979. // Header returns an http.Header that can be modified by the caller to
  82980. // add HTTP headers to the request.
  82981. func (c *SecurityPoliciesInsertCall) Header() http.Header {
  82982. if c.header_ == nil {
  82983. c.header_ = make(http.Header)
  82984. }
  82985. return c.header_
  82986. }
  82987. func (c *SecurityPoliciesInsertCall) doRequest(alt string) (*http.Response, error) {
  82988. reqHeaders := make(http.Header)
  82989. for k, v := range c.header_ {
  82990. reqHeaders[k] = v
  82991. }
  82992. reqHeaders.Set("User-Agent", c.s.userAgent())
  82993. var body io.Reader = nil
  82994. body, err := googleapi.WithoutDataWrapper.JSONReader(c.securitypolicy)
  82995. if err != nil {
  82996. return nil, err
  82997. }
  82998. reqHeaders.Set("Content-Type", "application/json")
  82999. c.urlParams_.Set("alt", alt)
  83000. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/securityPolicies")
  83001. urls += "?" + c.urlParams_.Encode()
  83002. req, _ := http.NewRequest("POST", urls, body)
  83003. req.Header = reqHeaders
  83004. googleapi.Expand(req.URL, map[string]string{
  83005. "project": c.project,
  83006. })
  83007. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  83008. }
  83009. // Do executes the "compute.securityPolicies.insert" call.
  83010. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  83011. // status code is an error. Response headers are in either
  83012. // *Operation.ServerResponse.Header or (if a response was returned at
  83013. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  83014. // to check whether the returned error was because
  83015. // http.StatusNotModified was returned.
  83016. func (c *SecurityPoliciesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  83017. gensupport.SetOptions(c.urlParams_, opts...)
  83018. res, err := c.doRequest("json")
  83019. if res != nil && res.StatusCode == http.StatusNotModified {
  83020. if res.Body != nil {
  83021. res.Body.Close()
  83022. }
  83023. return nil, &googleapi.Error{
  83024. Code: res.StatusCode,
  83025. Header: res.Header,
  83026. }
  83027. }
  83028. if err != nil {
  83029. return nil, err
  83030. }
  83031. defer googleapi.CloseBody(res)
  83032. if err := googleapi.CheckResponse(res); err != nil {
  83033. return nil, err
  83034. }
  83035. ret := &Operation{
  83036. ServerResponse: googleapi.ServerResponse{
  83037. Header: res.Header,
  83038. HTTPStatusCode: res.StatusCode,
  83039. },
  83040. }
  83041. target := &ret
  83042. if err := gensupport.DecodeResponse(target, res); err != nil {
  83043. return nil, err
  83044. }
  83045. return ret, nil
  83046. // {
  83047. // "description": "Creates a new policy in the specified project using the data included in the request.",
  83048. // "httpMethod": "POST",
  83049. // "id": "compute.securityPolicies.insert",
  83050. // "parameterOrder": [
  83051. // "project"
  83052. // ],
  83053. // "parameters": {
  83054. // "project": {
  83055. // "description": "Project ID for this request.",
  83056. // "location": "path",
  83057. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  83058. // "required": true,
  83059. // "type": "string"
  83060. // },
  83061. // "requestId": {
  83062. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  83063. // "location": "query",
  83064. // "type": "string"
  83065. // }
  83066. // },
  83067. // "path": "{project}/global/securityPolicies",
  83068. // "request": {
  83069. // "$ref": "SecurityPolicy"
  83070. // },
  83071. // "response": {
  83072. // "$ref": "Operation"
  83073. // },
  83074. // "scopes": [
  83075. // "https://www.googleapis.com/auth/cloud-platform",
  83076. // "https://www.googleapis.com/auth/compute"
  83077. // ]
  83078. // }
  83079. }
  83080. // method id "compute.securityPolicies.list":
  83081. type SecurityPoliciesListCall struct {
  83082. s *Service
  83083. project string
  83084. urlParams_ gensupport.URLParams
  83085. ifNoneMatch_ string
  83086. ctx_ context.Context
  83087. header_ http.Header
  83088. }
  83089. // List: List all the policies that have been configured for the
  83090. // specified project.
  83091. func (r *SecurityPoliciesService) List(project string) *SecurityPoliciesListCall {
  83092. c := &SecurityPoliciesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  83093. c.project = project
  83094. return c
  83095. }
  83096. // Filter sets the optional parameter "filter": A filter expression that
  83097. // filters resources listed in the response. The expression must specify
  83098. // the field name, a comparison operator, and the value that you want to
  83099. // use for filtering. The value must be a string, a number, or a
  83100. // boolean. The comparison operator must be either =, !=, >, or <.
  83101. //
  83102. // For example, if you are filtering Compute Engine instances, you can
  83103. // exclude instances named example-instance by specifying name !=
  83104. // example-instance.
  83105. //
  83106. // You can also filter nested fields. For example, you could specify
  83107. // scheduling.automaticRestart = false to include instances only if they
  83108. // are not scheduled for automatic restarts. You can use filtering on
  83109. // nested fields to filter based on resource labels.
  83110. //
  83111. // To filter on multiple expressions, provide each separate expression
  83112. // within parentheses. For example, (scheduling.automaticRestart = true)
  83113. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  83114. // AND expression. However, you can include AND and OR expressions
  83115. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  83116. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  83117. // true).
  83118. func (c *SecurityPoliciesListCall) Filter(filter string) *SecurityPoliciesListCall {
  83119. c.urlParams_.Set("filter", filter)
  83120. return c
  83121. }
  83122. // MaxResults sets the optional parameter "maxResults": The maximum
  83123. // number of results per page that should be returned. If the number of
  83124. // available results is larger than maxResults, Compute Engine returns a
  83125. // nextPageToken that can be used to get the next page of results in
  83126. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  83127. // (Default: 500)
  83128. func (c *SecurityPoliciesListCall) MaxResults(maxResults int64) *SecurityPoliciesListCall {
  83129. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  83130. return c
  83131. }
  83132. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  83133. // a certain order. By default, results are returned in alphanumerical
  83134. // order based on the resource name.
  83135. //
  83136. // You can also sort results in descending order based on the creation
  83137. // timestamp using orderBy="creationTimestamp desc". This sorts results
  83138. // based on the creationTimestamp field in reverse chronological order
  83139. // (newest result first). Use this to sort resources like operations so
  83140. // that the newest operation is returned first.
  83141. //
  83142. // Currently, only sorting by name or creationTimestamp desc is
  83143. // supported.
  83144. func (c *SecurityPoliciesListCall) OrderBy(orderBy string) *SecurityPoliciesListCall {
  83145. c.urlParams_.Set("orderBy", orderBy)
  83146. return c
  83147. }
  83148. // PageToken sets the optional parameter "pageToken": Specifies a page
  83149. // token to use. Set pageToken to the nextPageToken returned by a
  83150. // previous list request to get the next page of results.
  83151. func (c *SecurityPoliciesListCall) PageToken(pageToken string) *SecurityPoliciesListCall {
  83152. c.urlParams_.Set("pageToken", pageToken)
  83153. return c
  83154. }
  83155. // Fields allows partial responses to be retrieved. See
  83156. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  83157. // for more information.
  83158. func (c *SecurityPoliciesListCall) Fields(s ...googleapi.Field) *SecurityPoliciesListCall {
  83159. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  83160. return c
  83161. }
  83162. // IfNoneMatch sets the optional parameter which makes the operation
  83163. // fail if the object's ETag matches the given value. This is useful for
  83164. // getting updates only after the object has changed since the last
  83165. // request. Use googleapi.IsNotModified to check whether the response
  83166. // error from Do is the result of In-None-Match.
  83167. func (c *SecurityPoliciesListCall) IfNoneMatch(entityTag string) *SecurityPoliciesListCall {
  83168. c.ifNoneMatch_ = entityTag
  83169. return c
  83170. }
  83171. // Context sets the context to be used in this call's Do method. Any
  83172. // pending HTTP request will be aborted if the provided context is
  83173. // canceled.
  83174. func (c *SecurityPoliciesListCall) Context(ctx context.Context) *SecurityPoliciesListCall {
  83175. c.ctx_ = ctx
  83176. return c
  83177. }
  83178. // Header returns an http.Header that can be modified by the caller to
  83179. // add HTTP headers to the request.
  83180. func (c *SecurityPoliciesListCall) Header() http.Header {
  83181. if c.header_ == nil {
  83182. c.header_ = make(http.Header)
  83183. }
  83184. return c.header_
  83185. }
  83186. func (c *SecurityPoliciesListCall) doRequest(alt string) (*http.Response, error) {
  83187. reqHeaders := make(http.Header)
  83188. for k, v := range c.header_ {
  83189. reqHeaders[k] = v
  83190. }
  83191. reqHeaders.Set("User-Agent", c.s.userAgent())
  83192. if c.ifNoneMatch_ != "" {
  83193. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  83194. }
  83195. var body io.Reader = nil
  83196. c.urlParams_.Set("alt", alt)
  83197. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/securityPolicies")
  83198. urls += "?" + c.urlParams_.Encode()
  83199. req, _ := http.NewRequest("GET", urls, body)
  83200. req.Header = reqHeaders
  83201. googleapi.Expand(req.URL, map[string]string{
  83202. "project": c.project,
  83203. })
  83204. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  83205. }
  83206. // Do executes the "compute.securityPolicies.list" call.
  83207. // Exactly one of *SecurityPolicyList or error will be non-nil. Any
  83208. // non-2xx status code is an error. Response headers are in either
  83209. // *SecurityPolicyList.ServerResponse.Header or (if a response was
  83210. // returned at all) in error.(*googleapi.Error).Header. Use
  83211. // googleapi.IsNotModified to check whether the returned error was
  83212. // because http.StatusNotModified was returned.
  83213. func (c *SecurityPoliciesListCall) Do(opts ...googleapi.CallOption) (*SecurityPolicyList, error) {
  83214. gensupport.SetOptions(c.urlParams_, opts...)
  83215. res, err := c.doRequest("json")
  83216. if res != nil && res.StatusCode == http.StatusNotModified {
  83217. if res.Body != nil {
  83218. res.Body.Close()
  83219. }
  83220. return nil, &googleapi.Error{
  83221. Code: res.StatusCode,
  83222. Header: res.Header,
  83223. }
  83224. }
  83225. if err != nil {
  83226. return nil, err
  83227. }
  83228. defer googleapi.CloseBody(res)
  83229. if err := googleapi.CheckResponse(res); err != nil {
  83230. return nil, err
  83231. }
  83232. ret := &SecurityPolicyList{
  83233. ServerResponse: googleapi.ServerResponse{
  83234. Header: res.Header,
  83235. HTTPStatusCode: res.StatusCode,
  83236. },
  83237. }
  83238. target := &ret
  83239. if err := gensupport.DecodeResponse(target, res); err != nil {
  83240. return nil, err
  83241. }
  83242. return ret, nil
  83243. // {
  83244. // "description": "List all the policies that have been configured for the specified project.",
  83245. // "httpMethod": "GET",
  83246. // "id": "compute.securityPolicies.list",
  83247. // "parameterOrder": [
  83248. // "project"
  83249. // ],
  83250. // "parameters": {
  83251. // "filter": {
  83252. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  83253. // "location": "query",
  83254. // "type": "string"
  83255. // },
  83256. // "maxResults": {
  83257. // "default": "500",
  83258. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  83259. // "format": "uint32",
  83260. // "location": "query",
  83261. // "minimum": "0",
  83262. // "type": "integer"
  83263. // },
  83264. // "orderBy": {
  83265. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  83266. // "location": "query",
  83267. // "type": "string"
  83268. // },
  83269. // "pageToken": {
  83270. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  83271. // "location": "query",
  83272. // "type": "string"
  83273. // },
  83274. // "project": {
  83275. // "description": "Project ID for this request.",
  83276. // "location": "path",
  83277. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  83278. // "required": true,
  83279. // "type": "string"
  83280. // }
  83281. // },
  83282. // "path": "{project}/global/securityPolicies",
  83283. // "response": {
  83284. // "$ref": "SecurityPolicyList"
  83285. // },
  83286. // "scopes": [
  83287. // "https://www.googleapis.com/auth/cloud-platform",
  83288. // "https://www.googleapis.com/auth/compute",
  83289. // "https://www.googleapis.com/auth/compute.readonly"
  83290. // ]
  83291. // }
  83292. }
  83293. // Pages invokes f for each page of results.
  83294. // A non-nil error returned from f will halt the iteration.
  83295. // The provided context supersedes any context provided to the Context method.
  83296. func (c *SecurityPoliciesListCall) Pages(ctx context.Context, f func(*SecurityPolicyList) error) error {
  83297. c.ctx_ = ctx
  83298. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  83299. for {
  83300. x, err := c.Do()
  83301. if err != nil {
  83302. return err
  83303. }
  83304. if err := f(x); err != nil {
  83305. return err
  83306. }
  83307. if x.NextPageToken == "" {
  83308. return nil
  83309. }
  83310. c.PageToken(x.NextPageToken)
  83311. }
  83312. }
  83313. // method id "compute.securityPolicies.listPreconfiguredExpressionSets":
  83314. type SecurityPoliciesListPreconfiguredExpressionSetsCall struct {
  83315. s *Service
  83316. project string
  83317. urlParams_ gensupport.URLParams
  83318. ifNoneMatch_ string
  83319. ctx_ context.Context
  83320. header_ http.Header
  83321. }
  83322. // ListPreconfiguredExpressionSets: Gets the current list of
  83323. // preconfigured Web Application Firewall (WAF) expressions.
  83324. func (r *SecurityPoliciesService) ListPreconfiguredExpressionSets(project string) *SecurityPoliciesListPreconfiguredExpressionSetsCall {
  83325. c := &SecurityPoliciesListPreconfiguredExpressionSetsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  83326. c.project = project
  83327. return c
  83328. }
  83329. // Filter sets the optional parameter "filter": A filter expression that
  83330. // filters resources listed in the response. The expression must specify
  83331. // the field name, a comparison operator, and the value that you want to
  83332. // use for filtering. The value must be a string, a number, or a
  83333. // boolean. The comparison operator must be either =, !=, >, or <.
  83334. //
  83335. // For example, if you are filtering Compute Engine instances, you can
  83336. // exclude instances named example-instance by specifying name !=
  83337. // example-instance.
  83338. //
  83339. // You can also filter nested fields. For example, you could specify
  83340. // scheduling.automaticRestart = false to include instances only if they
  83341. // are not scheduled for automatic restarts. You can use filtering on
  83342. // nested fields to filter based on resource labels.
  83343. //
  83344. // To filter on multiple expressions, provide each separate expression
  83345. // within parentheses. For example, (scheduling.automaticRestart = true)
  83346. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  83347. // AND expression. However, you can include AND and OR expressions
  83348. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  83349. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  83350. // true).
  83351. func (c *SecurityPoliciesListPreconfiguredExpressionSetsCall) Filter(filter string) *SecurityPoliciesListPreconfiguredExpressionSetsCall {
  83352. c.urlParams_.Set("filter", filter)
  83353. return c
  83354. }
  83355. // MaxResults sets the optional parameter "maxResults": The maximum
  83356. // number of results per page that should be returned. If the number of
  83357. // available results is larger than maxResults, Compute Engine returns a
  83358. // nextPageToken that can be used to get the next page of results in
  83359. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  83360. // (Default: 500)
  83361. func (c *SecurityPoliciesListPreconfiguredExpressionSetsCall) MaxResults(maxResults int64) *SecurityPoliciesListPreconfiguredExpressionSetsCall {
  83362. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  83363. return c
  83364. }
  83365. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  83366. // a certain order. By default, results are returned in alphanumerical
  83367. // order based on the resource name.
  83368. //
  83369. // You can also sort results in descending order based on the creation
  83370. // timestamp using orderBy="creationTimestamp desc". This sorts results
  83371. // based on the creationTimestamp field in reverse chronological order
  83372. // (newest result first). Use this to sort resources like operations so
  83373. // that the newest operation is returned first.
  83374. //
  83375. // Currently, only sorting by name or creationTimestamp desc is
  83376. // supported.
  83377. func (c *SecurityPoliciesListPreconfiguredExpressionSetsCall) OrderBy(orderBy string) *SecurityPoliciesListPreconfiguredExpressionSetsCall {
  83378. c.urlParams_.Set("orderBy", orderBy)
  83379. return c
  83380. }
  83381. // PageToken sets the optional parameter "pageToken": Specifies a page
  83382. // token to use. Set pageToken to the nextPageToken returned by a
  83383. // previous list request to get the next page of results.
  83384. func (c *SecurityPoliciesListPreconfiguredExpressionSetsCall) PageToken(pageToken string) *SecurityPoliciesListPreconfiguredExpressionSetsCall {
  83385. c.urlParams_.Set("pageToken", pageToken)
  83386. return c
  83387. }
  83388. // Fields allows partial responses to be retrieved. See
  83389. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  83390. // for more information.
  83391. func (c *SecurityPoliciesListPreconfiguredExpressionSetsCall) Fields(s ...googleapi.Field) *SecurityPoliciesListPreconfiguredExpressionSetsCall {
  83392. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  83393. return c
  83394. }
  83395. // IfNoneMatch sets the optional parameter which makes the operation
  83396. // fail if the object's ETag matches the given value. This is useful for
  83397. // getting updates only after the object has changed since the last
  83398. // request. Use googleapi.IsNotModified to check whether the response
  83399. // error from Do is the result of In-None-Match.
  83400. func (c *SecurityPoliciesListPreconfiguredExpressionSetsCall) IfNoneMatch(entityTag string) *SecurityPoliciesListPreconfiguredExpressionSetsCall {
  83401. c.ifNoneMatch_ = entityTag
  83402. return c
  83403. }
  83404. // Context sets the context to be used in this call's Do method. Any
  83405. // pending HTTP request will be aborted if the provided context is
  83406. // canceled.
  83407. func (c *SecurityPoliciesListPreconfiguredExpressionSetsCall) Context(ctx context.Context) *SecurityPoliciesListPreconfiguredExpressionSetsCall {
  83408. c.ctx_ = ctx
  83409. return c
  83410. }
  83411. // Header returns an http.Header that can be modified by the caller to
  83412. // add HTTP headers to the request.
  83413. func (c *SecurityPoliciesListPreconfiguredExpressionSetsCall) Header() http.Header {
  83414. if c.header_ == nil {
  83415. c.header_ = make(http.Header)
  83416. }
  83417. return c.header_
  83418. }
  83419. func (c *SecurityPoliciesListPreconfiguredExpressionSetsCall) doRequest(alt string) (*http.Response, error) {
  83420. reqHeaders := make(http.Header)
  83421. for k, v := range c.header_ {
  83422. reqHeaders[k] = v
  83423. }
  83424. reqHeaders.Set("User-Agent", c.s.userAgent())
  83425. if c.ifNoneMatch_ != "" {
  83426. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  83427. }
  83428. var body io.Reader = nil
  83429. c.urlParams_.Set("alt", alt)
  83430. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/securityPolicies/listPreconfiguredExpressionSets")
  83431. urls += "?" + c.urlParams_.Encode()
  83432. req, _ := http.NewRequest("GET", urls, body)
  83433. req.Header = reqHeaders
  83434. googleapi.Expand(req.URL, map[string]string{
  83435. "project": c.project,
  83436. })
  83437. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  83438. }
  83439. // Do executes the "compute.securityPolicies.listPreconfiguredExpressionSets" call.
  83440. // Exactly one of
  83441. // *SecurityPoliciesListPreconfiguredExpressionSetsResponse or error
  83442. // will be non-nil. Any non-2xx status code is an error. Response
  83443. // headers are in either
  83444. // *SecurityPoliciesListPreconfiguredExpressionSetsResponse.ServerRespons
  83445. // e.Header or (if a response was returned at all) in
  83446. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  83447. // whether the returned error was because http.StatusNotModified was
  83448. // returned.
  83449. func (c *SecurityPoliciesListPreconfiguredExpressionSetsCall) Do(opts ...googleapi.CallOption) (*SecurityPoliciesListPreconfiguredExpressionSetsResponse, error) {
  83450. gensupport.SetOptions(c.urlParams_, opts...)
  83451. res, err := c.doRequest("json")
  83452. if res != nil && res.StatusCode == http.StatusNotModified {
  83453. if res.Body != nil {
  83454. res.Body.Close()
  83455. }
  83456. return nil, &googleapi.Error{
  83457. Code: res.StatusCode,
  83458. Header: res.Header,
  83459. }
  83460. }
  83461. if err != nil {
  83462. return nil, err
  83463. }
  83464. defer googleapi.CloseBody(res)
  83465. if err := googleapi.CheckResponse(res); err != nil {
  83466. return nil, err
  83467. }
  83468. ret := &SecurityPoliciesListPreconfiguredExpressionSetsResponse{
  83469. ServerResponse: googleapi.ServerResponse{
  83470. Header: res.Header,
  83471. HTTPStatusCode: res.StatusCode,
  83472. },
  83473. }
  83474. target := &ret
  83475. if err := gensupport.DecodeResponse(target, res); err != nil {
  83476. return nil, err
  83477. }
  83478. return ret, nil
  83479. // {
  83480. // "description": "Gets the current list of preconfigured Web Application Firewall (WAF) expressions.",
  83481. // "httpMethod": "GET",
  83482. // "id": "compute.securityPolicies.listPreconfiguredExpressionSets",
  83483. // "parameterOrder": [
  83484. // "project"
  83485. // ],
  83486. // "parameters": {
  83487. // "filter": {
  83488. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  83489. // "location": "query",
  83490. // "type": "string"
  83491. // },
  83492. // "maxResults": {
  83493. // "default": "500",
  83494. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  83495. // "format": "uint32",
  83496. // "location": "query",
  83497. // "minimum": "0",
  83498. // "type": "integer"
  83499. // },
  83500. // "orderBy": {
  83501. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  83502. // "location": "query",
  83503. // "type": "string"
  83504. // },
  83505. // "pageToken": {
  83506. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  83507. // "location": "query",
  83508. // "type": "string"
  83509. // },
  83510. // "project": {
  83511. // "description": "Project ID for this request.",
  83512. // "location": "path",
  83513. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  83514. // "required": true,
  83515. // "type": "string"
  83516. // }
  83517. // },
  83518. // "path": "{project}/global/securityPolicies/listPreconfiguredExpressionSets",
  83519. // "response": {
  83520. // "$ref": "SecurityPoliciesListPreconfiguredExpressionSetsResponse"
  83521. // },
  83522. // "scopes": [
  83523. // "https://www.googleapis.com/auth/cloud-platform",
  83524. // "https://www.googleapis.com/auth/compute"
  83525. // ]
  83526. // }
  83527. }
  83528. // method id "compute.securityPolicies.patch":
  83529. type SecurityPoliciesPatchCall struct {
  83530. s *Service
  83531. project string
  83532. securityPolicy string
  83533. securitypolicy *SecurityPolicy
  83534. urlParams_ gensupport.URLParams
  83535. ctx_ context.Context
  83536. header_ http.Header
  83537. }
  83538. // Patch: Patches the specified policy with the data included in the
  83539. // request.
  83540. func (r *SecurityPoliciesService) Patch(project string, securityPolicy string, securitypolicy *SecurityPolicy) *SecurityPoliciesPatchCall {
  83541. c := &SecurityPoliciesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  83542. c.project = project
  83543. c.securityPolicy = securityPolicy
  83544. c.securitypolicy = securitypolicy
  83545. return c
  83546. }
  83547. // RequestId sets the optional parameter "requestId": An optional
  83548. // request ID to identify requests. Specify a unique request ID so that
  83549. // if you must retry your request, the server will know to ignore the
  83550. // request if it has already been completed.
  83551. //
  83552. // For example, consider a situation where you make an initial request
  83553. // and the request times out. If you make the request again with the
  83554. // same request ID, the server can check if original operation with the
  83555. // same request ID was received, and if so, will ignore the second
  83556. // request. This prevents clients from accidentally creating duplicate
  83557. // commitments.
  83558. //
  83559. // The request ID must be a valid UUID with the exception that zero UUID
  83560. // is not supported (00000000-0000-0000-0000-000000000000).
  83561. func (c *SecurityPoliciesPatchCall) RequestId(requestId string) *SecurityPoliciesPatchCall {
  83562. c.urlParams_.Set("requestId", requestId)
  83563. return c
  83564. }
  83565. // Fields allows partial responses to be retrieved. See
  83566. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  83567. // for more information.
  83568. func (c *SecurityPoliciesPatchCall) Fields(s ...googleapi.Field) *SecurityPoliciesPatchCall {
  83569. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  83570. return c
  83571. }
  83572. // Context sets the context to be used in this call's Do method. Any
  83573. // pending HTTP request will be aborted if the provided context is
  83574. // canceled.
  83575. func (c *SecurityPoliciesPatchCall) Context(ctx context.Context) *SecurityPoliciesPatchCall {
  83576. c.ctx_ = ctx
  83577. return c
  83578. }
  83579. // Header returns an http.Header that can be modified by the caller to
  83580. // add HTTP headers to the request.
  83581. func (c *SecurityPoliciesPatchCall) Header() http.Header {
  83582. if c.header_ == nil {
  83583. c.header_ = make(http.Header)
  83584. }
  83585. return c.header_
  83586. }
  83587. func (c *SecurityPoliciesPatchCall) doRequest(alt string) (*http.Response, error) {
  83588. reqHeaders := make(http.Header)
  83589. for k, v := range c.header_ {
  83590. reqHeaders[k] = v
  83591. }
  83592. reqHeaders.Set("User-Agent", c.s.userAgent())
  83593. var body io.Reader = nil
  83594. body, err := googleapi.WithoutDataWrapper.JSONReader(c.securitypolicy)
  83595. if err != nil {
  83596. return nil, err
  83597. }
  83598. reqHeaders.Set("Content-Type", "application/json")
  83599. c.urlParams_.Set("alt", alt)
  83600. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/securityPolicies/{securityPolicy}")
  83601. urls += "?" + c.urlParams_.Encode()
  83602. req, _ := http.NewRequest("PATCH", urls, body)
  83603. req.Header = reqHeaders
  83604. googleapi.Expand(req.URL, map[string]string{
  83605. "project": c.project,
  83606. "securityPolicy": c.securityPolicy,
  83607. })
  83608. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  83609. }
  83610. // Do executes the "compute.securityPolicies.patch" call.
  83611. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  83612. // status code is an error. Response headers are in either
  83613. // *Operation.ServerResponse.Header or (if a response was returned at
  83614. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  83615. // to check whether the returned error was because
  83616. // http.StatusNotModified was returned.
  83617. func (c *SecurityPoliciesPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  83618. gensupport.SetOptions(c.urlParams_, opts...)
  83619. res, err := c.doRequest("json")
  83620. if res != nil && res.StatusCode == http.StatusNotModified {
  83621. if res.Body != nil {
  83622. res.Body.Close()
  83623. }
  83624. return nil, &googleapi.Error{
  83625. Code: res.StatusCode,
  83626. Header: res.Header,
  83627. }
  83628. }
  83629. if err != nil {
  83630. return nil, err
  83631. }
  83632. defer googleapi.CloseBody(res)
  83633. if err := googleapi.CheckResponse(res); err != nil {
  83634. return nil, err
  83635. }
  83636. ret := &Operation{
  83637. ServerResponse: googleapi.ServerResponse{
  83638. Header: res.Header,
  83639. HTTPStatusCode: res.StatusCode,
  83640. },
  83641. }
  83642. target := &ret
  83643. if err := gensupport.DecodeResponse(target, res); err != nil {
  83644. return nil, err
  83645. }
  83646. return ret, nil
  83647. // {
  83648. // "description": "Patches the specified policy with the data included in the request.",
  83649. // "httpMethod": "PATCH",
  83650. // "id": "compute.securityPolicies.patch",
  83651. // "parameterOrder": [
  83652. // "project",
  83653. // "securityPolicy"
  83654. // ],
  83655. // "parameters": {
  83656. // "project": {
  83657. // "description": "Project ID for this request.",
  83658. // "location": "path",
  83659. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  83660. // "required": true,
  83661. // "type": "string"
  83662. // },
  83663. // "requestId": {
  83664. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  83665. // "location": "query",
  83666. // "type": "string"
  83667. // },
  83668. // "securityPolicy": {
  83669. // "description": "Name of the security policy to update.",
  83670. // "location": "path",
  83671. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  83672. // "required": true,
  83673. // "type": "string"
  83674. // }
  83675. // },
  83676. // "path": "{project}/global/securityPolicies/{securityPolicy}",
  83677. // "request": {
  83678. // "$ref": "SecurityPolicy"
  83679. // },
  83680. // "response": {
  83681. // "$ref": "Operation"
  83682. // },
  83683. // "scopes": [
  83684. // "https://www.googleapis.com/auth/cloud-platform",
  83685. // "https://www.googleapis.com/auth/compute"
  83686. // ]
  83687. // }
  83688. }
  83689. // method id "compute.securityPolicies.patchRule":
  83690. type SecurityPoliciesPatchRuleCall struct {
  83691. s *Service
  83692. project string
  83693. securityPolicy string
  83694. securitypolicyrule *SecurityPolicyRule
  83695. urlParams_ gensupport.URLParams
  83696. ctx_ context.Context
  83697. header_ http.Header
  83698. }
  83699. // PatchRule: Patches a rule at the specified priority.
  83700. func (r *SecurityPoliciesService) PatchRule(project string, securityPolicy string, securitypolicyrule *SecurityPolicyRule) *SecurityPoliciesPatchRuleCall {
  83701. c := &SecurityPoliciesPatchRuleCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  83702. c.project = project
  83703. c.securityPolicy = securityPolicy
  83704. c.securitypolicyrule = securitypolicyrule
  83705. return c
  83706. }
  83707. // Priority sets the optional parameter "priority": The priority of the
  83708. // rule to patch.
  83709. func (c *SecurityPoliciesPatchRuleCall) Priority(priority int64) *SecurityPoliciesPatchRuleCall {
  83710. c.urlParams_.Set("priority", fmt.Sprint(priority))
  83711. return c
  83712. }
  83713. // Fields allows partial responses to be retrieved. See
  83714. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  83715. // for more information.
  83716. func (c *SecurityPoliciesPatchRuleCall) Fields(s ...googleapi.Field) *SecurityPoliciesPatchRuleCall {
  83717. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  83718. return c
  83719. }
  83720. // Context sets the context to be used in this call's Do method. Any
  83721. // pending HTTP request will be aborted if the provided context is
  83722. // canceled.
  83723. func (c *SecurityPoliciesPatchRuleCall) Context(ctx context.Context) *SecurityPoliciesPatchRuleCall {
  83724. c.ctx_ = ctx
  83725. return c
  83726. }
  83727. // Header returns an http.Header that can be modified by the caller to
  83728. // add HTTP headers to the request.
  83729. func (c *SecurityPoliciesPatchRuleCall) Header() http.Header {
  83730. if c.header_ == nil {
  83731. c.header_ = make(http.Header)
  83732. }
  83733. return c.header_
  83734. }
  83735. func (c *SecurityPoliciesPatchRuleCall) doRequest(alt string) (*http.Response, error) {
  83736. reqHeaders := make(http.Header)
  83737. for k, v := range c.header_ {
  83738. reqHeaders[k] = v
  83739. }
  83740. reqHeaders.Set("User-Agent", c.s.userAgent())
  83741. var body io.Reader = nil
  83742. body, err := googleapi.WithoutDataWrapper.JSONReader(c.securitypolicyrule)
  83743. if err != nil {
  83744. return nil, err
  83745. }
  83746. reqHeaders.Set("Content-Type", "application/json")
  83747. c.urlParams_.Set("alt", alt)
  83748. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/securityPolicies/{securityPolicy}/patchRule")
  83749. urls += "?" + c.urlParams_.Encode()
  83750. req, _ := http.NewRequest("POST", urls, body)
  83751. req.Header = reqHeaders
  83752. googleapi.Expand(req.URL, map[string]string{
  83753. "project": c.project,
  83754. "securityPolicy": c.securityPolicy,
  83755. })
  83756. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  83757. }
  83758. // Do executes the "compute.securityPolicies.patchRule" call.
  83759. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  83760. // status code is an error. Response headers are in either
  83761. // *Operation.ServerResponse.Header or (if a response was returned at
  83762. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  83763. // to check whether the returned error was because
  83764. // http.StatusNotModified was returned.
  83765. func (c *SecurityPoliciesPatchRuleCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  83766. gensupport.SetOptions(c.urlParams_, opts...)
  83767. res, err := c.doRequest("json")
  83768. if res != nil && res.StatusCode == http.StatusNotModified {
  83769. if res.Body != nil {
  83770. res.Body.Close()
  83771. }
  83772. return nil, &googleapi.Error{
  83773. Code: res.StatusCode,
  83774. Header: res.Header,
  83775. }
  83776. }
  83777. if err != nil {
  83778. return nil, err
  83779. }
  83780. defer googleapi.CloseBody(res)
  83781. if err := googleapi.CheckResponse(res); err != nil {
  83782. return nil, err
  83783. }
  83784. ret := &Operation{
  83785. ServerResponse: googleapi.ServerResponse{
  83786. Header: res.Header,
  83787. HTTPStatusCode: res.StatusCode,
  83788. },
  83789. }
  83790. target := &ret
  83791. if err := gensupport.DecodeResponse(target, res); err != nil {
  83792. return nil, err
  83793. }
  83794. return ret, nil
  83795. // {
  83796. // "description": "Patches a rule at the specified priority.",
  83797. // "httpMethod": "POST",
  83798. // "id": "compute.securityPolicies.patchRule",
  83799. // "parameterOrder": [
  83800. // "project",
  83801. // "securityPolicy"
  83802. // ],
  83803. // "parameters": {
  83804. // "priority": {
  83805. // "description": "The priority of the rule to patch.",
  83806. // "format": "int32",
  83807. // "location": "query",
  83808. // "type": "integer"
  83809. // },
  83810. // "project": {
  83811. // "description": "Project ID for this request.",
  83812. // "location": "path",
  83813. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  83814. // "required": true,
  83815. // "type": "string"
  83816. // },
  83817. // "securityPolicy": {
  83818. // "description": "Name of the security policy to update.",
  83819. // "location": "path",
  83820. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  83821. // "required": true,
  83822. // "type": "string"
  83823. // }
  83824. // },
  83825. // "path": "{project}/global/securityPolicies/{securityPolicy}/patchRule",
  83826. // "request": {
  83827. // "$ref": "SecurityPolicyRule"
  83828. // },
  83829. // "response": {
  83830. // "$ref": "Operation"
  83831. // },
  83832. // "scopes": [
  83833. // "https://www.googleapis.com/auth/cloud-platform",
  83834. // "https://www.googleapis.com/auth/compute"
  83835. // ]
  83836. // }
  83837. }
  83838. // method id "compute.securityPolicies.removeRule":
  83839. type SecurityPoliciesRemoveRuleCall struct {
  83840. s *Service
  83841. project string
  83842. securityPolicy string
  83843. urlParams_ gensupport.URLParams
  83844. ctx_ context.Context
  83845. header_ http.Header
  83846. }
  83847. // RemoveRule: Deletes a rule at the specified priority.
  83848. func (r *SecurityPoliciesService) RemoveRule(project string, securityPolicy string) *SecurityPoliciesRemoveRuleCall {
  83849. c := &SecurityPoliciesRemoveRuleCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  83850. c.project = project
  83851. c.securityPolicy = securityPolicy
  83852. return c
  83853. }
  83854. // Priority sets the optional parameter "priority": The priority of the
  83855. // rule to remove from the security policy.
  83856. func (c *SecurityPoliciesRemoveRuleCall) Priority(priority int64) *SecurityPoliciesRemoveRuleCall {
  83857. c.urlParams_.Set("priority", fmt.Sprint(priority))
  83858. return c
  83859. }
  83860. // Fields allows partial responses to be retrieved. See
  83861. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  83862. // for more information.
  83863. func (c *SecurityPoliciesRemoveRuleCall) Fields(s ...googleapi.Field) *SecurityPoliciesRemoveRuleCall {
  83864. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  83865. return c
  83866. }
  83867. // Context sets the context to be used in this call's Do method. Any
  83868. // pending HTTP request will be aborted if the provided context is
  83869. // canceled.
  83870. func (c *SecurityPoliciesRemoveRuleCall) Context(ctx context.Context) *SecurityPoliciesRemoveRuleCall {
  83871. c.ctx_ = ctx
  83872. return c
  83873. }
  83874. // Header returns an http.Header that can be modified by the caller to
  83875. // add HTTP headers to the request.
  83876. func (c *SecurityPoliciesRemoveRuleCall) Header() http.Header {
  83877. if c.header_ == nil {
  83878. c.header_ = make(http.Header)
  83879. }
  83880. return c.header_
  83881. }
  83882. func (c *SecurityPoliciesRemoveRuleCall) doRequest(alt string) (*http.Response, error) {
  83883. reqHeaders := make(http.Header)
  83884. for k, v := range c.header_ {
  83885. reqHeaders[k] = v
  83886. }
  83887. reqHeaders.Set("User-Agent", c.s.userAgent())
  83888. var body io.Reader = nil
  83889. c.urlParams_.Set("alt", alt)
  83890. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/securityPolicies/{securityPolicy}/removeRule")
  83891. urls += "?" + c.urlParams_.Encode()
  83892. req, _ := http.NewRequest("POST", urls, body)
  83893. req.Header = reqHeaders
  83894. googleapi.Expand(req.URL, map[string]string{
  83895. "project": c.project,
  83896. "securityPolicy": c.securityPolicy,
  83897. })
  83898. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  83899. }
  83900. // Do executes the "compute.securityPolicies.removeRule" call.
  83901. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  83902. // status code is an error. Response headers are in either
  83903. // *Operation.ServerResponse.Header or (if a response was returned at
  83904. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  83905. // to check whether the returned error was because
  83906. // http.StatusNotModified was returned.
  83907. func (c *SecurityPoliciesRemoveRuleCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  83908. gensupport.SetOptions(c.urlParams_, opts...)
  83909. res, err := c.doRequest("json")
  83910. if res != nil && res.StatusCode == http.StatusNotModified {
  83911. if res.Body != nil {
  83912. res.Body.Close()
  83913. }
  83914. return nil, &googleapi.Error{
  83915. Code: res.StatusCode,
  83916. Header: res.Header,
  83917. }
  83918. }
  83919. if err != nil {
  83920. return nil, err
  83921. }
  83922. defer googleapi.CloseBody(res)
  83923. if err := googleapi.CheckResponse(res); err != nil {
  83924. return nil, err
  83925. }
  83926. ret := &Operation{
  83927. ServerResponse: googleapi.ServerResponse{
  83928. Header: res.Header,
  83929. HTTPStatusCode: res.StatusCode,
  83930. },
  83931. }
  83932. target := &ret
  83933. if err := gensupport.DecodeResponse(target, res); err != nil {
  83934. return nil, err
  83935. }
  83936. return ret, nil
  83937. // {
  83938. // "description": "Deletes a rule at the specified priority.",
  83939. // "httpMethod": "POST",
  83940. // "id": "compute.securityPolicies.removeRule",
  83941. // "parameterOrder": [
  83942. // "project",
  83943. // "securityPolicy"
  83944. // ],
  83945. // "parameters": {
  83946. // "priority": {
  83947. // "description": "The priority of the rule to remove from the security policy.",
  83948. // "format": "int32",
  83949. // "location": "query",
  83950. // "type": "integer"
  83951. // },
  83952. // "project": {
  83953. // "description": "Project ID for this request.",
  83954. // "location": "path",
  83955. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  83956. // "required": true,
  83957. // "type": "string"
  83958. // },
  83959. // "securityPolicy": {
  83960. // "description": "Name of the security policy to update.",
  83961. // "location": "path",
  83962. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  83963. // "required": true,
  83964. // "type": "string"
  83965. // }
  83966. // },
  83967. // "path": "{project}/global/securityPolicies/{securityPolicy}/removeRule",
  83968. // "response": {
  83969. // "$ref": "Operation"
  83970. // },
  83971. // "scopes": [
  83972. // "https://www.googleapis.com/auth/cloud-platform",
  83973. // "https://www.googleapis.com/auth/compute"
  83974. // ]
  83975. // }
  83976. }
  83977. // method id "compute.securityPolicies.testIamPermissions":
  83978. type SecurityPoliciesTestIamPermissionsCall struct {
  83979. s *Service
  83980. project string
  83981. resource string
  83982. testpermissionsrequest *TestPermissionsRequest
  83983. urlParams_ gensupport.URLParams
  83984. ctx_ context.Context
  83985. header_ http.Header
  83986. }
  83987. // TestIamPermissions: Returns permissions that a caller has on the
  83988. // specified resource.
  83989. func (r *SecurityPoliciesService) TestIamPermissions(project string, resource string, testpermissionsrequest *TestPermissionsRequest) *SecurityPoliciesTestIamPermissionsCall {
  83990. c := &SecurityPoliciesTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  83991. c.project = project
  83992. c.resource = resource
  83993. c.testpermissionsrequest = testpermissionsrequest
  83994. return c
  83995. }
  83996. // Fields allows partial responses to be retrieved. See
  83997. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  83998. // for more information.
  83999. func (c *SecurityPoliciesTestIamPermissionsCall) Fields(s ...googleapi.Field) *SecurityPoliciesTestIamPermissionsCall {
  84000. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  84001. return c
  84002. }
  84003. // Context sets the context to be used in this call's Do method. Any
  84004. // pending HTTP request will be aborted if the provided context is
  84005. // canceled.
  84006. func (c *SecurityPoliciesTestIamPermissionsCall) Context(ctx context.Context) *SecurityPoliciesTestIamPermissionsCall {
  84007. c.ctx_ = ctx
  84008. return c
  84009. }
  84010. // Header returns an http.Header that can be modified by the caller to
  84011. // add HTTP headers to the request.
  84012. func (c *SecurityPoliciesTestIamPermissionsCall) Header() http.Header {
  84013. if c.header_ == nil {
  84014. c.header_ = make(http.Header)
  84015. }
  84016. return c.header_
  84017. }
  84018. func (c *SecurityPoliciesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  84019. reqHeaders := make(http.Header)
  84020. for k, v := range c.header_ {
  84021. reqHeaders[k] = v
  84022. }
  84023. reqHeaders.Set("User-Agent", c.s.userAgent())
  84024. var body io.Reader = nil
  84025. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  84026. if err != nil {
  84027. return nil, err
  84028. }
  84029. reqHeaders.Set("Content-Type", "application/json")
  84030. c.urlParams_.Set("alt", alt)
  84031. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/securityPolicies/{resource}/testIamPermissions")
  84032. urls += "?" + c.urlParams_.Encode()
  84033. req, _ := http.NewRequest("POST", urls, body)
  84034. req.Header = reqHeaders
  84035. googleapi.Expand(req.URL, map[string]string{
  84036. "project": c.project,
  84037. "resource": c.resource,
  84038. })
  84039. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  84040. }
  84041. // Do executes the "compute.securityPolicies.testIamPermissions" call.
  84042. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  84043. // non-2xx status code is an error. Response headers are in either
  84044. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  84045. // returned at all) in error.(*googleapi.Error).Header. Use
  84046. // googleapi.IsNotModified to check whether the returned error was
  84047. // because http.StatusNotModified was returned.
  84048. func (c *SecurityPoliciesTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  84049. gensupport.SetOptions(c.urlParams_, opts...)
  84050. res, err := c.doRequest("json")
  84051. if res != nil && res.StatusCode == http.StatusNotModified {
  84052. if res.Body != nil {
  84053. res.Body.Close()
  84054. }
  84055. return nil, &googleapi.Error{
  84056. Code: res.StatusCode,
  84057. Header: res.Header,
  84058. }
  84059. }
  84060. if err != nil {
  84061. return nil, err
  84062. }
  84063. defer googleapi.CloseBody(res)
  84064. if err := googleapi.CheckResponse(res); err != nil {
  84065. return nil, err
  84066. }
  84067. ret := &TestPermissionsResponse{
  84068. ServerResponse: googleapi.ServerResponse{
  84069. Header: res.Header,
  84070. HTTPStatusCode: res.StatusCode,
  84071. },
  84072. }
  84073. target := &ret
  84074. if err := gensupport.DecodeResponse(target, res); err != nil {
  84075. return nil, err
  84076. }
  84077. return ret, nil
  84078. // {
  84079. // "description": "Returns permissions that a caller has on the specified resource.",
  84080. // "httpMethod": "POST",
  84081. // "id": "compute.securityPolicies.testIamPermissions",
  84082. // "parameterOrder": [
  84083. // "project",
  84084. // "resource"
  84085. // ],
  84086. // "parameters": {
  84087. // "project": {
  84088. // "description": "Project ID for this request.",
  84089. // "location": "path",
  84090. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  84091. // "required": true,
  84092. // "type": "string"
  84093. // },
  84094. // "resource": {
  84095. // "description": "Name of the resource for this request.",
  84096. // "location": "path",
  84097. // "pattern": "(?:[-a-z0-9_]{0,62}[a-z0-9])?",
  84098. // "required": true,
  84099. // "type": "string"
  84100. // }
  84101. // },
  84102. // "path": "{project}/global/securityPolicies/{resource}/testIamPermissions",
  84103. // "request": {
  84104. // "$ref": "TestPermissionsRequest"
  84105. // },
  84106. // "response": {
  84107. // "$ref": "TestPermissionsResponse"
  84108. // },
  84109. // "scopes": [
  84110. // "https://www.googleapis.com/auth/cloud-platform",
  84111. // "https://www.googleapis.com/auth/compute",
  84112. // "https://www.googleapis.com/auth/compute.readonly"
  84113. // ]
  84114. // }
  84115. }
  84116. // method id "compute.snapshots.delete":
  84117. type SnapshotsDeleteCall struct {
  84118. s *Service
  84119. project string
  84120. snapshot string
  84121. urlParams_ gensupport.URLParams
  84122. ctx_ context.Context
  84123. header_ http.Header
  84124. }
  84125. // Delete: Deletes the specified Snapshot resource. Keep in mind that
  84126. // deleting a single snapshot might not necessarily delete all the data
  84127. // on that snapshot. If any data on the snapshot that is marked for
  84128. // deletion is needed for subsequent snapshots, the data will be moved
  84129. // to the next corresponding snapshot.
  84130. //
  84131. // For more information, see Deleting snaphots.
  84132. // For details, see https://cloud.google.com/compute/docs/reference/latest/snapshots/delete
  84133. func (r *SnapshotsService) Delete(project string, snapshot string) *SnapshotsDeleteCall {
  84134. c := &SnapshotsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  84135. c.project = project
  84136. c.snapshot = snapshot
  84137. return c
  84138. }
  84139. // RequestId sets the optional parameter "requestId": An optional
  84140. // request ID to identify requests. Specify a unique request ID so that
  84141. // if you must retry your request, the server will know to ignore the
  84142. // request if it has already been completed.
  84143. //
  84144. // For example, consider a situation where you make an initial request
  84145. // and the request times out. If you make the request again with the
  84146. // same request ID, the server can check if original operation with the
  84147. // same request ID was received, and if so, will ignore the second
  84148. // request. This prevents clients from accidentally creating duplicate
  84149. // commitments.
  84150. //
  84151. // The request ID must be a valid UUID with the exception that zero UUID
  84152. // is not supported (00000000-0000-0000-0000-000000000000).
  84153. func (c *SnapshotsDeleteCall) RequestId(requestId string) *SnapshotsDeleteCall {
  84154. c.urlParams_.Set("requestId", requestId)
  84155. return c
  84156. }
  84157. // Fields allows partial responses to be retrieved. See
  84158. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  84159. // for more information.
  84160. func (c *SnapshotsDeleteCall) Fields(s ...googleapi.Field) *SnapshotsDeleteCall {
  84161. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  84162. return c
  84163. }
  84164. // Context sets the context to be used in this call's Do method. Any
  84165. // pending HTTP request will be aborted if the provided context is
  84166. // canceled.
  84167. func (c *SnapshotsDeleteCall) Context(ctx context.Context) *SnapshotsDeleteCall {
  84168. c.ctx_ = ctx
  84169. return c
  84170. }
  84171. // Header returns an http.Header that can be modified by the caller to
  84172. // add HTTP headers to the request.
  84173. func (c *SnapshotsDeleteCall) Header() http.Header {
  84174. if c.header_ == nil {
  84175. c.header_ = make(http.Header)
  84176. }
  84177. return c.header_
  84178. }
  84179. func (c *SnapshotsDeleteCall) doRequest(alt string) (*http.Response, error) {
  84180. reqHeaders := make(http.Header)
  84181. for k, v := range c.header_ {
  84182. reqHeaders[k] = v
  84183. }
  84184. reqHeaders.Set("User-Agent", c.s.userAgent())
  84185. var body io.Reader = nil
  84186. c.urlParams_.Set("alt", alt)
  84187. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/snapshots/{snapshot}")
  84188. urls += "?" + c.urlParams_.Encode()
  84189. req, _ := http.NewRequest("DELETE", urls, body)
  84190. req.Header = reqHeaders
  84191. googleapi.Expand(req.URL, map[string]string{
  84192. "project": c.project,
  84193. "snapshot": c.snapshot,
  84194. })
  84195. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  84196. }
  84197. // Do executes the "compute.snapshots.delete" call.
  84198. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  84199. // status code is an error. Response headers are in either
  84200. // *Operation.ServerResponse.Header or (if a response was returned at
  84201. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  84202. // to check whether the returned error was because
  84203. // http.StatusNotModified was returned.
  84204. func (c *SnapshotsDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  84205. gensupport.SetOptions(c.urlParams_, opts...)
  84206. res, err := c.doRequest("json")
  84207. if res != nil && res.StatusCode == http.StatusNotModified {
  84208. if res.Body != nil {
  84209. res.Body.Close()
  84210. }
  84211. return nil, &googleapi.Error{
  84212. Code: res.StatusCode,
  84213. Header: res.Header,
  84214. }
  84215. }
  84216. if err != nil {
  84217. return nil, err
  84218. }
  84219. defer googleapi.CloseBody(res)
  84220. if err := googleapi.CheckResponse(res); err != nil {
  84221. return nil, err
  84222. }
  84223. ret := &Operation{
  84224. ServerResponse: googleapi.ServerResponse{
  84225. Header: res.Header,
  84226. HTTPStatusCode: res.StatusCode,
  84227. },
  84228. }
  84229. target := &ret
  84230. if err := gensupport.DecodeResponse(target, res); err != nil {
  84231. return nil, err
  84232. }
  84233. return ret, nil
  84234. // {
  84235. // "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.",
  84236. // "httpMethod": "DELETE",
  84237. // "id": "compute.snapshots.delete",
  84238. // "parameterOrder": [
  84239. // "project",
  84240. // "snapshot"
  84241. // ],
  84242. // "parameters": {
  84243. // "project": {
  84244. // "description": "Project ID for this request.",
  84245. // "location": "path",
  84246. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  84247. // "required": true,
  84248. // "type": "string"
  84249. // },
  84250. // "requestId": {
  84251. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  84252. // "location": "query",
  84253. // "type": "string"
  84254. // },
  84255. // "snapshot": {
  84256. // "description": "Name of the Snapshot resource to delete.",
  84257. // "location": "path",
  84258. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  84259. // "required": true,
  84260. // "type": "string"
  84261. // }
  84262. // },
  84263. // "path": "{project}/global/snapshots/{snapshot}",
  84264. // "response": {
  84265. // "$ref": "Operation"
  84266. // },
  84267. // "scopes": [
  84268. // "https://www.googleapis.com/auth/cloud-platform",
  84269. // "https://www.googleapis.com/auth/compute"
  84270. // ]
  84271. // }
  84272. }
  84273. // method id "compute.snapshots.get":
  84274. type SnapshotsGetCall struct {
  84275. s *Service
  84276. project string
  84277. snapshot string
  84278. urlParams_ gensupport.URLParams
  84279. ifNoneMatch_ string
  84280. ctx_ context.Context
  84281. header_ http.Header
  84282. }
  84283. // Get: Returns the specified Snapshot resource. Gets a list of
  84284. // available snapshots by making a list() request.
  84285. // For details, see https://cloud.google.com/compute/docs/reference/latest/snapshots/get
  84286. func (r *SnapshotsService) Get(project string, snapshot string) *SnapshotsGetCall {
  84287. c := &SnapshotsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  84288. c.project = project
  84289. c.snapshot = snapshot
  84290. return c
  84291. }
  84292. // Fields allows partial responses to be retrieved. See
  84293. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  84294. // for more information.
  84295. func (c *SnapshotsGetCall) Fields(s ...googleapi.Field) *SnapshotsGetCall {
  84296. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  84297. return c
  84298. }
  84299. // IfNoneMatch sets the optional parameter which makes the operation
  84300. // fail if the object's ETag matches the given value. This is useful for
  84301. // getting updates only after the object has changed since the last
  84302. // request. Use googleapi.IsNotModified to check whether the response
  84303. // error from Do is the result of In-None-Match.
  84304. func (c *SnapshotsGetCall) IfNoneMatch(entityTag string) *SnapshotsGetCall {
  84305. c.ifNoneMatch_ = entityTag
  84306. return c
  84307. }
  84308. // Context sets the context to be used in this call's Do method. Any
  84309. // pending HTTP request will be aborted if the provided context is
  84310. // canceled.
  84311. func (c *SnapshotsGetCall) Context(ctx context.Context) *SnapshotsGetCall {
  84312. c.ctx_ = ctx
  84313. return c
  84314. }
  84315. // Header returns an http.Header that can be modified by the caller to
  84316. // add HTTP headers to the request.
  84317. func (c *SnapshotsGetCall) Header() http.Header {
  84318. if c.header_ == nil {
  84319. c.header_ = make(http.Header)
  84320. }
  84321. return c.header_
  84322. }
  84323. func (c *SnapshotsGetCall) doRequest(alt string) (*http.Response, error) {
  84324. reqHeaders := make(http.Header)
  84325. for k, v := range c.header_ {
  84326. reqHeaders[k] = v
  84327. }
  84328. reqHeaders.Set("User-Agent", c.s.userAgent())
  84329. if c.ifNoneMatch_ != "" {
  84330. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  84331. }
  84332. var body io.Reader = nil
  84333. c.urlParams_.Set("alt", alt)
  84334. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/snapshots/{snapshot}")
  84335. urls += "?" + c.urlParams_.Encode()
  84336. req, _ := http.NewRequest("GET", urls, body)
  84337. req.Header = reqHeaders
  84338. googleapi.Expand(req.URL, map[string]string{
  84339. "project": c.project,
  84340. "snapshot": c.snapshot,
  84341. })
  84342. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  84343. }
  84344. // Do executes the "compute.snapshots.get" call.
  84345. // Exactly one of *Snapshot or error will be non-nil. Any non-2xx status
  84346. // code is an error. Response headers are in either
  84347. // *Snapshot.ServerResponse.Header or (if a response was returned at
  84348. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  84349. // to check whether the returned error was because
  84350. // http.StatusNotModified was returned.
  84351. func (c *SnapshotsGetCall) Do(opts ...googleapi.CallOption) (*Snapshot, error) {
  84352. gensupport.SetOptions(c.urlParams_, opts...)
  84353. res, err := c.doRequest("json")
  84354. if res != nil && res.StatusCode == http.StatusNotModified {
  84355. if res.Body != nil {
  84356. res.Body.Close()
  84357. }
  84358. return nil, &googleapi.Error{
  84359. Code: res.StatusCode,
  84360. Header: res.Header,
  84361. }
  84362. }
  84363. if err != nil {
  84364. return nil, err
  84365. }
  84366. defer googleapi.CloseBody(res)
  84367. if err := googleapi.CheckResponse(res); err != nil {
  84368. return nil, err
  84369. }
  84370. ret := &Snapshot{
  84371. ServerResponse: googleapi.ServerResponse{
  84372. Header: res.Header,
  84373. HTTPStatusCode: res.StatusCode,
  84374. },
  84375. }
  84376. target := &ret
  84377. if err := gensupport.DecodeResponse(target, res); err != nil {
  84378. return nil, err
  84379. }
  84380. return ret, nil
  84381. // {
  84382. // "description": "Returns the specified Snapshot resource. Gets a list of available snapshots by making a list() request.",
  84383. // "httpMethod": "GET",
  84384. // "id": "compute.snapshots.get",
  84385. // "parameterOrder": [
  84386. // "project",
  84387. // "snapshot"
  84388. // ],
  84389. // "parameters": {
  84390. // "project": {
  84391. // "description": "Project ID for this request.",
  84392. // "location": "path",
  84393. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  84394. // "required": true,
  84395. // "type": "string"
  84396. // },
  84397. // "snapshot": {
  84398. // "description": "Name of the Snapshot resource to return.",
  84399. // "location": "path",
  84400. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  84401. // "required": true,
  84402. // "type": "string"
  84403. // }
  84404. // },
  84405. // "path": "{project}/global/snapshots/{snapshot}",
  84406. // "response": {
  84407. // "$ref": "Snapshot"
  84408. // },
  84409. // "scopes": [
  84410. // "https://www.googleapis.com/auth/cloud-platform",
  84411. // "https://www.googleapis.com/auth/compute",
  84412. // "https://www.googleapis.com/auth/compute.readonly"
  84413. // ]
  84414. // }
  84415. }
  84416. // method id "compute.snapshots.list":
  84417. type SnapshotsListCall struct {
  84418. s *Service
  84419. project string
  84420. urlParams_ gensupport.URLParams
  84421. ifNoneMatch_ string
  84422. ctx_ context.Context
  84423. header_ http.Header
  84424. }
  84425. // List: Retrieves the list of Snapshot resources contained within the
  84426. // specified project.
  84427. // For details, see https://cloud.google.com/compute/docs/reference/latest/snapshots/list
  84428. func (r *SnapshotsService) List(project string) *SnapshotsListCall {
  84429. c := &SnapshotsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  84430. c.project = project
  84431. return c
  84432. }
  84433. // Filter sets the optional parameter "filter": A filter expression that
  84434. // filters resources listed in the response. The expression must specify
  84435. // the field name, a comparison operator, and the value that you want to
  84436. // use for filtering. The value must be a string, a number, or a
  84437. // boolean. The comparison operator must be either =, !=, >, or <.
  84438. //
  84439. // For example, if you are filtering Compute Engine instances, you can
  84440. // exclude instances named example-instance by specifying name !=
  84441. // example-instance.
  84442. //
  84443. // You can also filter nested fields. For example, you could specify
  84444. // scheduling.automaticRestart = false to include instances only if they
  84445. // are not scheduled for automatic restarts. You can use filtering on
  84446. // nested fields to filter based on resource labels.
  84447. //
  84448. // To filter on multiple expressions, provide each separate expression
  84449. // within parentheses. For example, (scheduling.automaticRestart = true)
  84450. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  84451. // AND expression. However, you can include AND and OR expressions
  84452. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  84453. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  84454. // true).
  84455. func (c *SnapshotsListCall) Filter(filter string) *SnapshotsListCall {
  84456. c.urlParams_.Set("filter", filter)
  84457. return c
  84458. }
  84459. // MaxResults sets the optional parameter "maxResults": The maximum
  84460. // number of results per page that should be returned. If the number of
  84461. // available results is larger than maxResults, Compute Engine returns a
  84462. // nextPageToken that can be used to get the next page of results in
  84463. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  84464. // (Default: 500)
  84465. func (c *SnapshotsListCall) MaxResults(maxResults int64) *SnapshotsListCall {
  84466. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  84467. return c
  84468. }
  84469. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  84470. // a certain order. By default, results are returned in alphanumerical
  84471. // order based on the resource name.
  84472. //
  84473. // You can also sort results in descending order based on the creation
  84474. // timestamp using orderBy="creationTimestamp desc". This sorts results
  84475. // based on the creationTimestamp field in reverse chronological order
  84476. // (newest result first). Use this to sort resources like operations so
  84477. // that the newest operation is returned first.
  84478. //
  84479. // Currently, only sorting by name or creationTimestamp desc is
  84480. // supported.
  84481. func (c *SnapshotsListCall) OrderBy(orderBy string) *SnapshotsListCall {
  84482. c.urlParams_.Set("orderBy", orderBy)
  84483. return c
  84484. }
  84485. // PageToken sets the optional parameter "pageToken": Specifies a page
  84486. // token to use. Set pageToken to the nextPageToken returned by a
  84487. // previous list request to get the next page of results.
  84488. func (c *SnapshotsListCall) PageToken(pageToken string) *SnapshotsListCall {
  84489. c.urlParams_.Set("pageToken", pageToken)
  84490. return c
  84491. }
  84492. // Fields allows partial responses to be retrieved. See
  84493. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  84494. // for more information.
  84495. func (c *SnapshotsListCall) Fields(s ...googleapi.Field) *SnapshotsListCall {
  84496. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  84497. return c
  84498. }
  84499. // IfNoneMatch sets the optional parameter which makes the operation
  84500. // fail if the object's ETag matches the given value. This is useful for
  84501. // getting updates only after the object has changed since the last
  84502. // request. Use googleapi.IsNotModified to check whether the response
  84503. // error from Do is the result of In-None-Match.
  84504. func (c *SnapshotsListCall) IfNoneMatch(entityTag string) *SnapshotsListCall {
  84505. c.ifNoneMatch_ = entityTag
  84506. return c
  84507. }
  84508. // Context sets the context to be used in this call's Do method. Any
  84509. // pending HTTP request will be aborted if the provided context is
  84510. // canceled.
  84511. func (c *SnapshotsListCall) Context(ctx context.Context) *SnapshotsListCall {
  84512. c.ctx_ = ctx
  84513. return c
  84514. }
  84515. // Header returns an http.Header that can be modified by the caller to
  84516. // add HTTP headers to the request.
  84517. func (c *SnapshotsListCall) Header() http.Header {
  84518. if c.header_ == nil {
  84519. c.header_ = make(http.Header)
  84520. }
  84521. return c.header_
  84522. }
  84523. func (c *SnapshotsListCall) doRequest(alt string) (*http.Response, error) {
  84524. reqHeaders := make(http.Header)
  84525. for k, v := range c.header_ {
  84526. reqHeaders[k] = v
  84527. }
  84528. reqHeaders.Set("User-Agent", c.s.userAgent())
  84529. if c.ifNoneMatch_ != "" {
  84530. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  84531. }
  84532. var body io.Reader = nil
  84533. c.urlParams_.Set("alt", alt)
  84534. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/snapshots")
  84535. urls += "?" + c.urlParams_.Encode()
  84536. req, _ := http.NewRequest("GET", urls, body)
  84537. req.Header = reqHeaders
  84538. googleapi.Expand(req.URL, map[string]string{
  84539. "project": c.project,
  84540. })
  84541. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  84542. }
  84543. // Do executes the "compute.snapshots.list" call.
  84544. // Exactly one of *SnapshotList or error will be non-nil. Any non-2xx
  84545. // status code is an error. Response headers are in either
  84546. // *SnapshotList.ServerResponse.Header or (if a response was returned at
  84547. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  84548. // to check whether the returned error was because
  84549. // http.StatusNotModified was returned.
  84550. func (c *SnapshotsListCall) Do(opts ...googleapi.CallOption) (*SnapshotList, error) {
  84551. gensupport.SetOptions(c.urlParams_, opts...)
  84552. res, err := c.doRequest("json")
  84553. if res != nil && res.StatusCode == http.StatusNotModified {
  84554. if res.Body != nil {
  84555. res.Body.Close()
  84556. }
  84557. return nil, &googleapi.Error{
  84558. Code: res.StatusCode,
  84559. Header: res.Header,
  84560. }
  84561. }
  84562. if err != nil {
  84563. return nil, err
  84564. }
  84565. defer googleapi.CloseBody(res)
  84566. if err := googleapi.CheckResponse(res); err != nil {
  84567. return nil, err
  84568. }
  84569. ret := &SnapshotList{
  84570. ServerResponse: googleapi.ServerResponse{
  84571. Header: res.Header,
  84572. HTTPStatusCode: res.StatusCode,
  84573. },
  84574. }
  84575. target := &ret
  84576. if err := gensupport.DecodeResponse(target, res); err != nil {
  84577. return nil, err
  84578. }
  84579. return ret, nil
  84580. // {
  84581. // "description": "Retrieves the list of Snapshot resources contained within the specified project.",
  84582. // "httpMethod": "GET",
  84583. // "id": "compute.snapshots.list",
  84584. // "parameterOrder": [
  84585. // "project"
  84586. // ],
  84587. // "parameters": {
  84588. // "filter": {
  84589. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  84590. // "location": "query",
  84591. // "type": "string"
  84592. // },
  84593. // "maxResults": {
  84594. // "default": "500",
  84595. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  84596. // "format": "uint32",
  84597. // "location": "query",
  84598. // "minimum": "0",
  84599. // "type": "integer"
  84600. // },
  84601. // "orderBy": {
  84602. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  84603. // "location": "query",
  84604. // "type": "string"
  84605. // },
  84606. // "pageToken": {
  84607. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  84608. // "location": "query",
  84609. // "type": "string"
  84610. // },
  84611. // "project": {
  84612. // "description": "Project ID for this request.",
  84613. // "location": "path",
  84614. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  84615. // "required": true,
  84616. // "type": "string"
  84617. // }
  84618. // },
  84619. // "path": "{project}/global/snapshots",
  84620. // "response": {
  84621. // "$ref": "SnapshotList"
  84622. // },
  84623. // "scopes": [
  84624. // "https://www.googleapis.com/auth/cloud-platform",
  84625. // "https://www.googleapis.com/auth/compute",
  84626. // "https://www.googleapis.com/auth/compute.readonly"
  84627. // ]
  84628. // }
  84629. }
  84630. // Pages invokes f for each page of results.
  84631. // A non-nil error returned from f will halt the iteration.
  84632. // The provided context supersedes any context provided to the Context method.
  84633. func (c *SnapshotsListCall) Pages(ctx context.Context, f func(*SnapshotList) error) error {
  84634. c.ctx_ = ctx
  84635. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  84636. for {
  84637. x, err := c.Do()
  84638. if err != nil {
  84639. return err
  84640. }
  84641. if err := f(x); err != nil {
  84642. return err
  84643. }
  84644. if x.NextPageToken == "" {
  84645. return nil
  84646. }
  84647. c.PageToken(x.NextPageToken)
  84648. }
  84649. }
  84650. // method id "compute.snapshots.setLabels":
  84651. type SnapshotsSetLabelsCall struct {
  84652. s *Service
  84653. project string
  84654. resource string
  84655. globalsetlabelsrequest *GlobalSetLabelsRequest
  84656. urlParams_ gensupport.URLParams
  84657. ctx_ context.Context
  84658. header_ http.Header
  84659. }
  84660. // SetLabels: Sets the labels on a snapshot. To learn more about labels,
  84661. // read the Labeling Resources documentation.
  84662. func (r *SnapshotsService) SetLabels(project string, resource string, globalsetlabelsrequest *GlobalSetLabelsRequest) *SnapshotsSetLabelsCall {
  84663. c := &SnapshotsSetLabelsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  84664. c.project = project
  84665. c.resource = resource
  84666. c.globalsetlabelsrequest = globalsetlabelsrequest
  84667. return c
  84668. }
  84669. // Fields allows partial responses to be retrieved. See
  84670. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  84671. // for more information.
  84672. func (c *SnapshotsSetLabelsCall) Fields(s ...googleapi.Field) *SnapshotsSetLabelsCall {
  84673. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  84674. return c
  84675. }
  84676. // Context sets the context to be used in this call's Do method. Any
  84677. // pending HTTP request will be aborted if the provided context is
  84678. // canceled.
  84679. func (c *SnapshotsSetLabelsCall) Context(ctx context.Context) *SnapshotsSetLabelsCall {
  84680. c.ctx_ = ctx
  84681. return c
  84682. }
  84683. // Header returns an http.Header that can be modified by the caller to
  84684. // add HTTP headers to the request.
  84685. func (c *SnapshotsSetLabelsCall) Header() http.Header {
  84686. if c.header_ == nil {
  84687. c.header_ = make(http.Header)
  84688. }
  84689. return c.header_
  84690. }
  84691. func (c *SnapshotsSetLabelsCall) doRequest(alt string) (*http.Response, error) {
  84692. reqHeaders := make(http.Header)
  84693. for k, v := range c.header_ {
  84694. reqHeaders[k] = v
  84695. }
  84696. reqHeaders.Set("User-Agent", c.s.userAgent())
  84697. var body io.Reader = nil
  84698. body, err := googleapi.WithoutDataWrapper.JSONReader(c.globalsetlabelsrequest)
  84699. if err != nil {
  84700. return nil, err
  84701. }
  84702. reqHeaders.Set("Content-Type", "application/json")
  84703. c.urlParams_.Set("alt", alt)
  84704. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/snapshots/{resource}/setLabels")
  84705. urls += "?" + c.urlParams_.Encode()
  84706. req, _ := http.NewRequest("POST", urls, body)
  84707. req.Header = reqHeaders
  84708. googleapi.Expand(req.URL, map[string]string{
  84709. "project": c.project,
  84710. "resource": c.resource,
  84711. })
  84712. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  84713. }
  84714. // Do executes the "compute.snapshots.setLabels" call.
  84715. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  84716. // status code is an error. Response headers are in either
  84717. // *Operation.ServerResponse.Header or (if a response was returned at
  84718. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  84719. // to check whether the returned error was because
  84720. // http.StatusNotModified was returned.
  84721. func (c *SnapshotsSetLabelsCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  84722. gensupport.SetOptions(c.urlParams_, opts...)
  84723. res, err := c.doRequest("json")
  84724. if res != nil && res.StatusCode == http.StatusNotModified {
  84725. if res.Body != nil {
  84726. res.Body.Close()
  84727. }
  84728. return nil, &googleapi.Error{
  84729. Code: res.StatusCode,
  84730. Header: res.Header,
  84731. }
  84732. }
  84733. if err != nil {
  84734. return nil, err
  84735. }
  84736. defer googleapi.CloseBody(res)
  84737. if err := googleapi.CheckResponse(res); err != nil {
  84738. return nil, err
  84739. }
  84740. ret := &Operation{
  84741. ServerResponse: googleapi.ServerResponse{
  84742. Header: res.Header,
  84743. HTTPStatusCode: res.StatusCode,
  84744. },
  84745. }
  84746. target := &ret
  84747. if err := gensupport.DecodeResponse(target, res); err != nil {
  84748. return nil, err
  84749. }
  84750. return ret, nil
  84751. // {
  84752. // "description": "Sets the labels on a snapshot. To learn more about labels, read the Labeling Resources documentation.",
  84753. // "httpMethod": "POST",
  84754. // "id": "compute.snapshots.setLabels",
  84755. // "parameterOrder": [
  84756. // "project",
  84757. // "resource"
  84758. // ],
  84759. // "parameters": {
  84760. // "project": {
  84761. // "description": "Project ID for this request.",
  84762. // "location": "path",
  84763. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  84764. // "required": true,
  84765. // "type": "string"
  84766. // },
  84767. // "resource": {
  84768. // "description": "Name of the resource for this request.",
  84769. // "location": "path",
  84770. // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?",
  84771. // "required": true,
  84772. // "type": "string"
  84773. // }
  84774. // },
  84775. // "path": "{project}/global/snapshots/{resource}/setLabels",
  84776. // "request": {
  84777. // "$ref": "GlobalSetLabelsRequest"
  84778. // },
  84779. // "response": {
  84780. // "$ref": "Operation"
  84781. // },
  84782. // "scopes": [
  84783. // "https://www.googleapis.com/auth/cloud-platform",
  84784. // "https://www.googleapis.com/auth/compute"
  84785. // ]
  84786. // }
  84787. }
  84788. // method id "compute.snapshots.testIamPermissions":
  84789. type SnapshotsTestIamPermissionsCall struct {
  84790. s *Service
  84791. project string
  84792. resource string
  84793. testpermissionsrequest *TestPermissionsRequest
  84794. urlParams_ gensupport.URLParams
  84795. ctx_ context.Context
  84796. header_ http.Header
  84797. }
  84798. // TestIamPermissions: Returns permissions that a caller has on the
  84799. // specified resource.
  84800. func (r *SnapshotsService) TestIamPermissions(project string, resource string, testpermissionsrequest *TestPermissionsRequest) *SnapshotsTestIamPermissionsCall {
  84801. c := &SnapshotsTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  84802. c.project = project
  84803. c.resource = resource
  84804. c.testpermissionsrequest = testpermissionsrequest
  84805. return c
  84806. }
  84807. // Fields allows partial responses to be retrieved. See
  84808. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  84809. // for more information.
  84810. func (c *SnapshotsTestIamPermissionsCall) Fields(s ...googleapi.Field) *SnapshotsTestIamPermissionsCall {
  84811. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  84812. return c
  84813. }
  84814. // Context sets the context to be used in this call's Do method. Any
  84815. // pending HTTP request will be aborted if the provided context is
  84816. // canceled.
  84817. func (c *SnapshotsTestIamPermissionsCall) Context(ctx context.Context) *SnapshotsTestIamPermissionsCall {
  84818. c.ctx_ = ctx
  84819. return c
  84820. }
  84821. // Header returns an http.Header that can be modified by the caller to
  84822. // add HTTP headers to the request.
  84823. func (c *SnapshotsTestIamPermissionsCall) Header() http.Header {
  84824. if c.header_ == nil {
  84825. c.header_ = make(http.Header)
  84826. }
  84827. return c.header_
  84828. }
  84829. func (c *SnapshotsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  84830. reqHeaders := make(http.Header)
  84831. for k, v := range c.header_ {
  84832. reqHeaders[k] = v
  84833. }
  84834. reqHeaders.Set("User-Agent", c.s.userAgent())
  84835. var body io.Reader = nil
  84836. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  84837. if err != nil {
  84838. return nil, err
  84839. }
  84840. reqHeaders.Set("Content-Type", "application/json")
  84841. c.urlParams_.Set("alt", alt)
  84842. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/snapshots/{resource}/testIamPermissions")
  84843. urls += "?" + c.urlParams_.Encode()
  84844. req, _ := http.NewRequest("POST", urls, body)
  84845. req.Header = reqHeaders
  84846. googleapi.Expand(req.URL, map[string]string{
  84847. "project": c.project,
  84848. "resource": c.resource,
  84849. })
  84850. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  84851. }
  84852. // Do executes the "compute.snapshots.testIamPermissions" call.
  84853. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  84854. // non-2xx status code is an error. Response headers are in either
  84855. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  84856. // returned at all) in error.(*googleapi.Error).Header. Use
  84857. // googleapi.IsNotModified to check whether the returned error was
  84858. // because http.StatusNotModified was returned.
  84859. func (c *SnapshotsTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  84860. gensupport.SetOptions(c.urlParams_, opts...)
  84861. res, err := c.doRequest("json")
  84862. if res != nil && res.StatusCode == http.StatusNotModified {
  84863. if res.Body != nil {
  84864. res.Body.Close()
  84865. }
  84866. return nil, &googleapi.Error{
  84867. Code: res.StatusCode,
  84868. Header: res.Header,
  84869. }
  84870. }
  84871. if err != nil {
  84872. return nil, err
  84873. }
  84874. defer googleapi.CloseBody(res)
  84875. if err := googleapi.CheckResponse(res); err != nil {
  84876. return nil, err
  84877. }
  84878. ret := &TestPermissionsResponse{
  84879. ServerResponse: googleapi.ServerResponse{
  84880. Header: res.Header,
  84881. HTTPStatusCode: res.StatusCode,
  84882. },
  84883. }
  84884. target := &ret
  84885. if err := gensupport.DecodeResponse(target, res); err != nil {
  84886. return nil, err
  84887. }
  84888. return ret, nil
  84889. // {
  84890. // "description": "Returns permissions that a caller has on the specified resource.",
  84891. // "httpMethod": "POST",
  84892. // "id": "compute.snapshots.testIamPermissions",
  84893. // "parameterOrder": [
  84894. // "project",
  84895. // "resource"
  84896. // ],
  84897. // "parameters": {
  84898. // "project": {
  84899. // "description": "Project ID for this request.",
  84900. // "location": "path",
  84901. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  84902. // "required": true,
  84903. // "type": "string"
  84904. // },
  84905. // "resource": {
  84906. // "description": "Name of the resource for this request.",
  84907. // "location": "path",
  84908. // "pattern": "(?:[-a-z0-9_]{0,62}[a-z0-9])?",
  84909. // "required": true,
  84910. // "type": "string"
  84911. // }
  84912. // },
  84913. // "path": "{project}/global/snapshots/{resource}/testIamPermissions",
  84914. // "request": {
  84915. // "$ref": "TestPermissionsRequest"
  84916. // },
  84917. // "response": {
  84918. // "$ref": "TestPermissionsResponse"
  84919. // },
  84920. // "scopes": [
  84921. // "https://www.googleapis.com/auth/cloud-platform",
  84922. // "https://www.googleapis.com/auth/compute",
  84923. // "https://www.googleapis.com/auth/compute.readonly"
  84924. // ]
  84925. // }
  84926. }
  84927. // method id "compute.sslCertificates.delete":
  84928. type SslCertificatesDeleteCall struct {
  84929. s *Service
  84930. project string
  84931. sslCertificate string
  84932. urlParams_ gensupport.URLParams
  84933. ctx_ context.Context
  84934. header_ http.Header
  84935. }
  84936. // Delete: Deletes the specified SslCertificate resource.
  84937. func (r *SslCertificatesService) Delete(project string, sslCertificate string) *SslCertificatesDeleteCall {
  84938. c := &SslCertificatesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  84939. c.project = project
  84940. c.sslCertificate = sslCertificate
  84941. return c
  84942. }
  84943. // RequestId sets the optional parameter "requestId": An optional
  84944. // request ID to identify requests. Specify a unique request ID so that
  84945. // if you must retry your request, the server will know to ignore the
  84946. // request if it has already been completed.
  84947. //
  84948. // For example, consider a situation where you make an initial request
  84949. // and the request times out. If you make the request again with the
  84950. // same request ID, the server can check if original operation with the
  84951. // same request ID was received, and if so, will ignore the second
  84952. // request. This prevents clients from accidentally creating duplicate
  84953. // commitments.
  84954. //
  84955. // The request ID must be a valid UUID with the exception that zero UUID
  84956. // is not supported (00000000-0000-0000-0000-000000000000).
  84957. func (c *SslCertificatesDeleteCall) RequestId(requestId string) *SslCertificatesDeleteCall {
  84958. c.urlParams_.Set("requestId", requestId)
  84959. return c
  84960. }
  84961. // Fields allows partial responses to be retrieved. See
  84962. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  84963. // for more information.
  84964. func (c *SslCertificatesDeleteCall) Fields(s ...googleapi.Field) *SslCertificatesDeleteCall {
  84965. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  84966. return c
  84967. }
  84968. // Context sets the context to be used in this call's Do method. Any
  84969. // pending HTTP request will be aborted if the provided context is
  84970. // canceled.
  84971. func (c *SslCertificatesDeleteCall) Context(ctx context.Context) *SslCertificatesDeleteCall {
  84972. c.ctx_ = ctx
  84973. return c
  84974. }
  84975. // Header returns an http.Header that can be modified by the caller to
  84976. // add HTTP headers to the request.
  84977. func (c *SslCertificatesDeleteCall) Header() http.Header {
  84978. if c.header_ == nil {
  84979. c.header_ = make(http.Header)
  84980. }
  84981. return c.header_
  84982. }
  84983. func (c *SslCertificatesDeleteCall) doRequest(alt string) (*http.Response, error) {
  84984. reqHeaders := make(http.Header)
  84985. for k, v := range c.header_ {
  84986. reqHeaders[k] = v
  84987. }
  84988. reqHeaders.Set("User-Agent", c.s.userAgent())
  84989. var body io.Reader = nil
  84990. c.urlParams_.Set("alt", alt)
  84991. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/sslCertificates/{sslCertificate}")
  84992. urls += "?" + c.urlParams_.Encode()
  84993. req, _ := http.NewRequest("DELETE", urls, body)
  84994. req.Header = reqHeaders
  84995. googleapi.Expand(req.URL, map[string]string{
  84996. "project": c.project,
  84997. "sslCertificate": c.sslCertificate,
  84998. })
  84999. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  85000. }
  85001. // Do executes the "compute.sslCertificates.delete" call.
  85002. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  85003. // status code is an error. Response headers are in either
  85004. // *Operation.ServerResponse.Header or (if a response was returned at
  85005. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  85006. // to check whether the returned error was because
  85007. // http.StatusNotModified was returned.
  85008. func (c *SslCertificatesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  85009. gensupport.SetOptions(c.urlParams_, opts...)
  85010. res, err := c.doRequest("json")
  85011. if res != nil && res.StatusCode == http.StatusNotModified {
  85012. if res.Body != nil {
  85013. res.Body.Close()
  85014. }
  85015. return nil, &googleapi.Error{
  85016. Code: res.StatusCode,
  85017. Header: res.Header,
  85018. }
  85019. }
  85020. if err != nil {
  85021. return nil, err
  85022. }
  85023. defer googleapi.CloseBody(res)
  85024. if err := googleapi.CheckResponse(res); err != nil {
  85025. return nil, err
  85026. }
  85027. ret := &Operation{
  85028. ServerResponse: googleapi.ServerResponse{
  85029. Header: res.Header,
  85030. HTTPStatusCode: res.StatusCode,
  85031. },
  85032. }
  85033. target := &ret
  85034. if err := gensupport.DecodeResponse(target, res); err != nil {
  85035. return nil, err
  85036. }
  85037. return ret, nil
  85038. // {
  85039. // "description": "Deletes the specified SslCertificate resource.",
  85040. // "httpMethod": "DELETE",
  85041. // "id": "compute.sslCertificates.delete",
  85042. // "parameterOrder": [
  85043. // "project",
  85044. // "sslCertificate"
  85045. // ],
  85046. // "parameters": {
  85047. // "project": {
  85048. // "description": "Project ID for this request.",
  85049. // "location": "path",
  85050. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  85051. // "required": true,
  85052. // "type": "string"
  85053. // },
  85054. // "requestId": {
  85055. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  85056. // "location": "query",
  85057. // "type": "string"
  85058. // },
  85059. // "sslCertificate": {
  85060. // "description": "Name of the SslCertificate resource to delete.",
  85061. // "location": "path",
  85062. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  85063. // "required": true,
  85064. // "type": "string"
  85065. // }
  85066. // },
  85067. // "path": "{project}/global/sslCertificates/{sslCertificate}",
  85068. // "response": {
  85069. // "$ref": "Operation"
  85070. // },
  85071. // "scopes": [
  85072. // "https://www.googleapis.com/auth/cloud-platform",
  85073. // "https://www.googleapis.com/auth/compute"
  85074. // ]
  85075. // }
  85076. }
  85077. // method id "compute.sslCertificates.get":
  85078. type SslCertificatesGetCall struct {
  85079. s *Service
  85080. project string
  85081. sslCertificate string
  85082. urlParams_ gensupport.URLParams
  85083. ifNoneMatch_ string
  85084. ctx_ context.Context
  85085. header_ http.Header
  85086. }
  85087. // Get: Returns the specified SslCertificate resource. Gets a list of
  85088. // available SSL certificates by making a list() request.
  85089. func (r *SslCertificatesService) Get(project string, sslCertificate string) *SslCertificatesGetCall {
  85090. c := &SslCertificatesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  85091. c.project = project
  85092. c.sslCertificate = sslCertificate
  85093. return c
  85094. }
  85095. // Fields allows partial responses to be retrieved. See
  85096. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  85097. // for more information.
  85098. func (c *SslCertificatesGetCall) Fields(s ...googleapi.Field) *SslCertificatesGetCall {
  85099. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  85100. return c
  85101. }
  85102. // IfNoneMatch sets the optional parameter which makes the operation
  85103. // fail if the object's ETag matches the given value. This is useful for
  85104. // getting updates only after the object has changed since the last
  85105. // request. Use googleapi.IsNotModified to check whether the response
  85106. // error from Do is the result of In-None-Match.
  85107. func (c *SslCertificatesGetCall) IfNoneMatch(entityTag string) *SslCertificatesGetCall {
  85108. c.ifNoneMatch_ = entityTag
  85109. return c
  85110. }
  85111. // Context sets the context to be used in this call's Do method. Any
  85112. // pending HTTP request will be aborted if the provided context is
  85113. // canceled.
  85114. func (c *SslCertificatesGetCall) Context(ctx context.Context) *SslCertificatesGetCall {
  85115. c.ctx_ = ctx
  85116. return c
  85117. }
  85118. // Header returns an http.Header that can be modified by the caller to
  85119. // add HTTP headers to the request.
  85120. func (c *SslCertificatesGetCall) Header() http.Header {
  85121. if c.header_ == nil {
  85122. c.header_ = make(http.Header)
  85123. }
  85124. return c.header_
  85125. }
  85126. func (c *SslCertificatesGetCall) doRequest(alt string) (*http.Response, error) {
  85127. reqHeaders := make(http.Header)
  85128. for k, v := range c.header_ {
  85129. reqHeaders[k] = v
  85130. }
  85131. reqHeaders.Set("User-Agent", c.s.userAgent())
  85132. if c.ifNoneMatch_ != "" {
  85133. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  85134. }
  85135. var body io.Reader = nil
  85136. c.urlParams_.Set("alt", alt)
  85137. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/sslCertificates/{sslCertificate}")
  85138. urls += "?" + c.urlParams_.Encode()
  85139. req, _ := http.NewRequest("GET", urls, body)
  85140. req.Header = reqHeaders
  85141. googleapi.Expand(req.URL, map[string]string{
  85142. "project": c.project,
  85143. "sslCertificate": c.sslCertificate,
  85144. })
  85145. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  85146. }
  85147. // Do executes the "compute.sslCertificates.get" call.
  85148. // Exactly one of *SslCertificate or error will be non-nil. Any non-2xx
  85149. // status code is an error. Response headers are in either
  85150. // *SslCertificate.ServerResponse.Header or (if a response was returned
  85151. // at all) in error.(*googleapi.Error).Header. Use
  85152. // googleapi.IsNotModified to check whether the returned error was
  85153. // because http.StatusNotModified was returned.
  85154. func (c *SslCertificatesGetCall) Do(opts ...googleapi.CallOption) (*SslCertificate, error) {
  85155. gensupport.SetOptions(c.urlParams_, opts...)
  85156. res, err := c.doRequest("json")
  85157. if res != nil && res.StatusCode == http.StatusNotModified {
  85158. if res.Body != nil {
  85159. res.Body.Close()
  85160. }
  85161. return nil, &googleapi.Error{
  85162. Code: res.StatusCode,
  85163. Header: res.Header,
  85164. }
  85165. }
  85166. if err != nil {
  85167. return nil, err
  85168. }
  85169. defer googleapi.CloseBody(res)
  85170. if err := googleapi.CheckResponse(res); err != nil {
  85171. return nil, err
  85172. }
  85173. ret := &SslCertificate{
  85174. ServerResponse: googleapi.ServerResponse{
  85175. Header: res.Header,
  85176. HTTPStatusCode: res.StatusCode,
  85177. },
  85178. }
  85179. target := &ret
  85180. if err := gensupport.DecodeResponse(target, res); err != nil {
  85181. return nil, err
  85182. }
  85183. return ret, nil
  85184. // {
  85185. // "description": "Returns the specified SslCertificate resource. Gets a list of available SSL certificates by making a list() request.",
  85186. // "httpMethod": "GET",
  85187. // "id": "compute.sslCertificates.get",
  85188. // "parameterOrder": [
  85189. // "project",
  85190. // "sslCertificate"
  85191. // ],
  85192. // "parameters": {
  85193. // "project": {
  85194. // "description": "Project ID for this request.",
  85195. // "location": "path",
  85196. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  85197. // "required": true,
  85198. // "type": "string"
  85199. // },
  85200. // "sslCertificate": {
  85201. // "description": "Name of the SslCertificate resource to return.",
  85202. // "location": "path",
  85203. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  85204. // "required": true,
  85205. // "type": "string"
  85206. // }
  85207. // },
  85208. // "path": "{project}/global/sslCertificates/{sslCertificate}",
  85209. // "response": {
  85210. // "$ref": "SslCertificate"
  85211. // },
  85212. // "scopes": [
  85213. // "https://www.googleapis.com/auth/cloud-platform",
  85214. // "https://www.googleapis.com/auth/compute",
  85215. // "https://www.googleapis.com/auth/compute.readonly"
  85216. // ]
  85217. // }
  85218. }
  85219. // method id "compute.sslCertificates.insert":
  85220. type SslCertificatesInsertCall struct {
  85221. s *Service
  85222. project string
  85223. sslcertificate *SslCertificate
  85224. urlParams_ gensupport.URLParams
  85225. ctx_ context.Context
  85226. header_ http.Header
  85227. }
  85228. // Insert: Creates a SslCertificate resource in the specified project
  85229. // using the data included in the request.
  85230. func (r *SslCertificatesService) Insert(project string, sslcertificate *SslCertificate) *SslCertificatesInsertCall {
  85231. c := &SslCertificatesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  85232. c.project = project
  85233. c.sslcertificate = sslcertificate
  85234. return c
  85235. }
  85236. // RequestId sets the optional parameter "requestId": An optional
  85237. // request ID to identify requests. Specify a unique request ID so that
  85238. // if you must retry your request, the server will know to ignore the
  85239. // request if it has already been completed.
  85240. //
  85241. // For example, consider a situation where you make an initial request
  85242. // and the request times out. If you make the request again with the
  85243. // same request ID, the server can check if original operation with the
  85244. // same request ID was received, and if so, will ignore the second
  85245. // request. This prevents clients from accidentally creating duplicate
  85246. // commitments.
  85247. //
  85248. // The request ID must be a valid UUID with the exception that zero UUID
  85249. // is not supported (00000000-0000-0000-0000-000000000000).
  85250. func (c *SslCertificatesInsertCall) RequestId(requestId string) *SslCertificatesInsertCall {
  85251. c.urlParams_.Set("requestId", requestId)
  85252. return c
  85253. }
  85254. // Fields allows partial responses to be retrieved. See
  85255. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  85256. // for more information.
  85257. func (c *SslCertificatesInsertCall) Fields(s ...googleapi.Field) *SslCertificatesInsertCall {
  85258. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  85259. return c
  85260. }
  85261. // Context sets the context to be used in this call's Do method. Any
  85262. // pending HTTP request will be aborted if the provided context is
  85263. // canceled.
  85264. func (c *SslCertificatesInsertCall) Context(ctx context.Context) *SslCertificatesInsertCall {
  85265. c.ctx_ = ctx
  85266. return c
  85267. }
  85268. // Header returns an http.Header that can be modified by the caller to
  85269. // add HTTP headers to the request.
  85270. func (c *SslCertificatesInsertCall) Header() http.Header {
  85271. if c.header_ == nil {
  85272. c.header_ = make(http.Header)
  85273. }
  85274. return c.header_
  85275. }
  85276. func (c *SslCertificatesInsertCall) doRequest(alt string) (*http.Response, error) {
  85277. reqHeaders := make(http.Header)
  85278. for k, v := range c.header_ {
  85279. reqHeaders[k] = v
  85280. }
  85281. reqHeaders.Set("User-Agent", c.s.userAgent())
  85282. var body io.Reader = nil
  85283. body, err := googleapi.WithoutDataWrapper.JSONReader(c.sslcertificate)
  85284. if err != nil {
  85285. return nil, err
  85286. }
  85287. reqHeaders.Set("Content-Type", "application/json")
  85288. c.urlParams_.Set("alt", alt)
  85289. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/sslCertificates")
  85290. urls += "?" + c.urlParams_.Encode()
  85291. req, _ := http.NewRequest("POST", urls, body)
  85292. req.Header = reqHeaders
  85293. googleapi.Expand(req.URL, map[string]string{
  85294. "project": c.project,
  85295. })
  85296. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  85297. }
  85298. // Do executes the "compute.sslCertificates.insert" call.
  85299. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  85300. // status code is an error. Response headers are in either
  85301. // *Operation.ServerResponse.Header or (if a response was returned at
  85302. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  85303. // to check whether the returned error was because
  85304. // http.StatusNotModified was returned.
  85305. func (c *SslCertificatesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  85306. gensupport.SetOptions(c.urlParams_, opts...)
  85307. res, err := c.doRequest("json")
  85308. if res != nil && res.StatusCode == http.StatusNotModified {
  85309. if res.Body != nil {
  85310. res.Body.Close()
  85311. }
  85312. return nil, &googleapi.Error{
  85313. Code: res.StatusCode,
  85314. Header: res.Header,
  85315. }
  85316. }
  85317. if err != nil {
  85318. return nil, err
  85319. }
  85320. defer googleapi.CloseBody(res)
  85321. if err := googleapi.CheckResponse(res); err != nil {
  85322. return nil, err
  85323. }
  85324. ret := &Operation{
  85325. ServerResponse: googleapi.ServerResponse{
  85326. Header: res.Header,
  85327. HTTPStatusCode: res.StatusCode,
  85328. },
  85329. }
  85330. target := &ret
  85331. if err := gensupport.DecodeResponse(target, res); err != nil {
  85332. return nil, err
  85333. }
  85334. return ret, nil
  85335. // {
  85336. // "description": "Creates a SslCertificate resource in the specified project using the data included in the request.",
  85337. // "httpMethod": "POST",
  85338. // "id": "compute.sslCertificates.insert",
  85339. // "parameterOrder": [
  85340. // "project"
  85341. // ],
  85342. // "parameters": {
  85343. // "project": {
  85344. // "description": "Project ID for this request.",
  85345. // "location": "path",
  85346. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  85347. // "required": true,
  85348. // "type": "string"
  85349. // },
  85350. // "requestId": {
  85351. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  85352. // "location": "query",
  85353. // "type": "string"
  85354. // }
  85355. // },
  85356. // "path": "{project}/global/sslCertificates",
  85357. // "request": {
  85358. // "$ref": "SslCertificate"
  85359. // },
  85360. // "response": {
  85361. // "$ref": "Operation"
  85362. // },
  85363. // "scopes": [
  85364. // "https://www.googleapis.com/auth/cloud-platform",
  85365. // "https://www.googleapis.com/auth/compute"
  85366. // ]
  85367. // }
  85368. }
  85369. // method id "compute.sslCertificates.list":
  85370. type SslCertificatesListCall struct {
  85371. s *Service
  85372. project string
  85373. urlParams_ gensupport.URLParams
  85374. ifNoneMatch_ string
  85375. ctx_ context.Context
  85376. header_ http.Header
  85377. }
  85378. // List: Retrieves the list of SslCertificate resources available to the
  85379. // specified project.
  85380. func (r *SslCertificatesService) List(project string) *SslCertificatesListCall {
  85381. c := &SslCertificatesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  85382. c.project = project
  85383. return c
  85384. }
  85385. // Filter sets the optional parameter "filter": A filter expression that
  85386. // filters resources listed in the response. The expression must specify
  85387. // the field name, a comparison operator, and the value that you want to
  85388. // use for filtering. The value must be a string, a number, or a
  85389. // boolean. The comparison operator must be either =, !=, >, or <.
  85390. //
  85391. // For example, if you are filtering Compute Engine instances, you can
  85392. // exclude instances named example-instance by specifying name !=
  85393. // example-instance.
  85394. //
  85395. // You can also filter nested fields. For example, you could specify
  85396. // scheduling.automaticRestart = false to include instances only if they
  85397. // are not scheduled for automatic restarts. You can use filtering on
  85398. // nested fields to filter based on resource labels.
  85399. //
  85400. // To filter on multiple expressions, provide each separate expression
  85401. // within parentheses. For example, (scheduling.automaticRestart = true)
  85402. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  85403. // AND expression. However, you can include AND and OR expressions
  85404. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  85405. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  85406. // true).
  85407. func (c *SslCertificatesListCall) Filter(filter string) *SslCertificatesListCall {
  85408. c.urlParams_.Set("filter", filter)
  85409. return c
  85410. }
  85411. // MaxResults sets the optional parameter "maxResults": The maximum
  85412. // number of results per page that should be returned. If the number of
  85413. // available results is larger than maxResults, Compute Engine returns a
  85414. // nextPageToken that can be used to get the next page of results in
  85415. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  85416. // (Default: 500)
  85417. func (c *SslCertificatesListCall) MaxResults(maxResults int64) *SslCertificatesListCall {
  85418. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  85419. return c
  85420. }
  85421. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  85422. // a certain order. By default, results are returned in alphanumerical
  85423. // order based on the resource name.
  85424. //
  85425. // You can also sort results in descending order based on the creation
  85426. // timestamp using orderBy="creationTimestamp desc". This sorts results
  85427. // based on the creationTimestamp field in reverse chronological order
  85428. // (newest result first). Use this to sort resources like operations so
  85429. // that the newest operation is returned first.
  85430. //
  85431. // Currently, only sorting by name or creationTimestamp desc is
  85432. // supported.
  85433. func (c *SslCertificatesListCall) OrderBy(orderBy string) *SslCertificatesListCall {
  85434. c.urlParams_.Set("orderBy", orderBy)
  85435. return c
  85436. }
  85437. // PageToken sets the optional parameter "pageToken": Specifies a page
  85438. // token to use. Set pageToken to the nextPageToken returned by a
  85439. // previous list request to get the next page of results.
  85440. func (c *SslCertificatesListCall) PageToken(pageToken string) *SslCertificatesListCall {
  85441. c.urlParams_.Set("pageToken", pageToken)
  85442. return c
  85443. }
  85444. // Fields allows partial responses to be retrieved. See
  85445. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  85446. // for more information.
  85447. func (c *SslCertificatesListCall) Fields(s ...googleapi.Field) *SslCertificatesListCall {
  85448. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  85449. return c
  85450. }
  85451. // IfNoneMatch sets the optional parameter which makes the operation
  85452. // fail if the object's ETag matches the given value. This is useful for
  85453. // getting updates only after the object has changed since the last
  85454. // request. Use googleapi.IsNotModified to check whether the response
  85455. // error from Do is the result of In-None-Match.
  85456. func (c *SslCertificatesListCall) IfNoneMatch(entityTag string) *SslCertificatesListCall {
  85457. c.ifNoneMatch_ = entityTag
  85458. return c
  85459. }
  85460. // Context sets the context to be used in this call's Do method. Any
  85461. // pending HTTP request will be aborted if the provided context is
  85462. // canceled.
  85463. func (c *SslCertificatesListCall) Context(ctx context.Context) *SslCertificatesListCall {
  85464. c.ctx_ = ctx
  85465. return c
  85466. }
  85467. // Header returns an http.Header that can be modified by the caller to
  85468. // add HTTP headers to the request.
  85469. func (c *SslCertificatesListCall) Header() http.Header {
  85470. if c.header_ == nil {
  85471. c.header_ = make(http.Header)
  85472. }
  85473. return c.header_
  85474. }
  85475. func (c *SslCertificatesListCall) doRequest(alt string) (*http.Response, error) {
  85476. reqHeaders := make(http.Header)
  85477. for k, v := range c.header_ {
  85478. reqHeaders[k] = v
  85479. }
  85480. reqHeaders.Set("User-Agent", c.s.userAgent())
  85481. if c.ifNoneMatch_ != "" {
  85482. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  85483. }
  85484. var body io.Reader = nil
  85485. c.urlParams_.Set("alt", alt)
  85486. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/sslCertificates")
  85487. urls += "?" + c.urlParams_.Encode()
  85488. req, _ := http.NewRequest("GET", urls, body)
  85489. req.Header = reqHeaders
  85490. googleapi.Expand(req.URL, map[string]string{
  85491. "project": c.project,
  85492. })
  85493. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  85494. }
  85495. // Do executes the "compute.sslCertificates.list" call.
  85496. // Exactly one of *SslCertificateList or error will be non-nil. Any
  85497. // non-2xx status code is an error. Response headers are in either
  85498. // *SslCertificateList.ServerResponse.Header or (if a response was
  85499. // returned at all) in error.(*googleapi.Error).Header. Use
  85500. // googleapi.IsNotModified to check whether the returned error was
  85501. // because http.StatusNotModified was returned.
  85502. func (c *SslCertificatesListCall) Do(opts ...googleapi.CallOption) (*SslCertificateList, error) {
  85503. gensupport.SetOptions(c.urlParams_, opts...)
  85504. res, err := c.doRequest("json")
  85505. if res != nil && res.StatusCode == http.StatusNotModified {
  85506. if res.Body != nil {
  85507. res.Body.Close()
  85508. }
  85509. return nil, &googleapi.Error{
  85510. Code: res.StatusCode,
  85511. Header: res.Header,
  85512. }
  85513. }
  85514. if err != nil {
  85515. return nil, err
  85516. }
  85517. defer googleapi.CloseBody(res)
  85518. if err := googleapi.CheckResponse(res); err != nil {
  85519. return nil, err
  85520. }
  85521. ret := &SslCertificateList{
  85522. ServerResponse: googleapi.ServerResponse{
  85523. Header: res.Header,
  85524. HTTPStatusCode: res.StatusCode,
  85525. },
  85526. }
  85527. target := &ret
  85528. if err := gensupport.DecodeResponse(target, res); err != nil {
  85529. return nil, err
  85530. }
  85531. return ret, nil
  85532. // {
  85533. // "description": "Retrieves the list of SslCertificate resources available to the specified project.",
  85534. // "httpMethod": "GET",
  85535. // "id": "compute.sslCertificates.list",
  85536. // "parameterOrder": [
  85537. // "project"
  85538. // ],
  85539. // "parameters": {
  85540. // "filter": {
  85541. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  85542. // "location": "query",
  85543. // "type": "string"
  85544. // },
  85545. // "maxResults": {
  85546. // "default": "500",
  85547. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  85548. // "format": "uint32",
  85549. // "location": "query",
  85550. // "minimum": "0",
  85551. // "type": "integer"
  85552. // },
  85553. // "orderBy": {
  85554. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  85555. // "location": "query",
  85556. // "type": "string"
  85557. // },
  85558. // "pageToken": {
  85559. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  85560. // "location": "query",
  85561. // "type": "string"
  85562. // },
  85563. // "project": {
  85564. // "description": "Project ID for this request.",
  85565. // "location": "path",
  85566. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  85567. // "required": true,
  85568. // "type": "string"
  85569. // }
  85570. // },
  85571. // "path": "{project}/global/sslCertificates",
  85572. // "response": {
  85573. // "$ref": "SslCertificateList"
  85574. // },
  85575. // "scopes": [
  85576. // "https://www.googleapis.com/auth/cloud-platform",
  85577. // "https://www.googleapis.com/auth/compute",
  85578. // "https://www.googleapis.com/auth/compute.readonly"
  85579. // ]
  85580. // }
  85581. }
  85582. // Pages invokes f for each page of results.
  85583. // A non-nil error returned from f will halt the iteration.
  85584. // The provided context supersedes any context provided to the Context method.
  85585. func (c *SslCertificatesListCall) Pages(ctx context.Context, f func(*SslCertificateList) error) error {
  85586. c.ctx_ = ctx
  85587. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  85588. for {
  85589. x, err := c.Do()
  85590. if err != nil {
  85591. return err
  85592. }
  85593. if err := f(x); err != nil {
  85594. return err
  85595. }
  85596. if x.NextPageToken == "" {
  85597. return nil
  85598. }
  85599. c.PageToken(x.NextPageToken)
  85600. }
  85601. }
  85602. // method id "compute.sslCertificates.testIamPermissions":
  85603. type SslCertificatesTestIamPermissionsCall struct {
  85604. s *Service
  85605. project string
  85606. resource string
  85607. testpermissionsrequest *TestPermissionsRequest
  85608. urlParams_ gensupport.URLParams
  85609. ctx_ context.Context
  85610. header_ http.Header
  85611. }
  85612. // TestIamPermissions: Returns permissions that a caller has on the
  85613. // specified resource.
  85614. func (r *SslCertificatesService) TestIamPermissions(project string, resource string, testpermissionsrequest *TestPermissionsRequest) *SslCertificatesTestIamPermissionsCall {
  85615. c := &SslCertificatesTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  85616. c.project = project
  85617. c.resource = resource
  85618. c.testpermissionsrequest = testpermissionsrequest
  85619. return c
  85620. }
  85621. // Fields allows partial responses to be retrieved. See
  85622. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  85623. // for more information.
  85624. func (c *SslCertificatesTestIamPermissionsCall) Fields(s ...googleapi.Field) *SslCertificatesTestIamPermissionsCall {
  85625. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  85626. return c
  85627. }
  85628. // Context sets the context to be used in this call's Do method. Any
  85629. // pending HTTP request will be aborted if the provided context is
  85630. // canceled.
  85631. func (c *SslCertificatesTestIamPermissionsCall) Context(ctx context.Context) *SslCertificatesTestIamPermissionsCall {
  85632. c.ctx_ = ctx
  85633. return c
  85634. }
  85635. // Header returns an http.Header that can be modified by the caller to
  85636. // add HTTP headers to the request.
  85637. func (c *SslCertificatesTestIamPermissionsCall) Header() http.Header {
  85638. if c.header_ == nil {
  85639. c.header_ = make(http.Header)
  85640. }
  85641. return c.header_
  85642. }
  85643. func (c *SslCertificatesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  85644. reqHeaders := make(http.Header)
  85645. for k, v := range c.header_ {
  85646. reqHeaders[k] = v
  85647. }
  85648. reqHeaders.Set("User-Agent", c.s.userAgent())
  85649. var body io.Reader = nil
  85650. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  85651. if err != nil {
  85652. return nil, err
  85653. }
  85654. reqHeaders.Set("Content-Type", "application/json")
  85655. c.urlParams_.Set("alt", alt)
  85656. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/sslCertificates/{resource}/testIamPermissions")
  85657. urls += "?" + c.urlParams_.Encode()
  85658. req, _ := http.NewRequest("POST", urls, body)
  85659. req.Header = reqHeaders
  85660. googleapi.Expand(req.URL, map[string]string{
  85661. "project": c.project,
  85662. "resource": c.resource,
  85663. })
  85664. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  85665. }
  85666. // Do executes the "compute.sslCertificates.testIamPermissions" call.
  85667. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  85668. // non-2xx status code is an error. Response headers are in either
  85669. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  85670. // returned at all) in error.(*googleapi.Error).Header. Use
  85671. // googleapi.IsNotModified to check whether the returned error was
  85672. // because http.StatusNotModified was returned.
  85673. func (c *SslCertificatesTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  85674. gensupport.SetOptions(c.urlParams_, opts...)
  85675. res, err := c.doRequest("json")
  85676. if res != nil && res.StatusCode == http.StatusNotModified {
  85677. if res.Body != nil {
  85678. res.Body.Close()
  85679. }
  85680. return nil, &googleapi.Error{
  85681. Code: res.StatusCode,
  85682. Header: res.Header,
  85683. }
  85684. }
  85685. if err != nil {
  85686. return nil, err
  85687. }
  85688. defer googleapi.CloseBody(res)
  85689. if err := googleapi.CheckResponse(res); err != nil {
  85690. return nil, err
  85691. }
  85692. ret := &TestPermissionsResponse{
  85693. ServerResponse: googleapi.ServerResponse{
  85694. Header: res.Header,
  85695. HTTPStatusCode: res.StatusCode,
  85696. },
  85697. }
  85698. target := &ret
  85699. if err := gensupport.DecodeResponse(target, res); err != nil {
  85700. return nil, err
  85701. }
  85702. return ret, nil
  85703. // {
  85704. // "description": "Returns permissions that a caller has on the specified resource.",
  85705. // "httpMethod": "POST",
  85706. // "id": "compute.sslCertificates.testIamPermissions",
  85707. // "parameterOrder": [
  85708. // "project",
  85709. // "resource"
  85710. // ],
  85711. // "parameters": {
  85712. // "project": {
  85713. // "description": "Project ID for this request.",
  85714. // "location": "path",
  85715. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  85716. // "required": true,
  85717. // "type": "string"
  85718. // },
  85719. // "resource": {
  85720. // "description": "Name of the resource for this request.",
  85721. // "location": "path",
  85722. // "pattern": "(?:[-a-z0-9_]{0,62}[a-z0-9])?",
  85723. // "required": true,
  85724. // "type": "string"
  85725. // }
  85726. // },
  85727. // "path": "{project}/global/sslCertificates/{resource}/testIamPermissions",
  85728. // "request": {
  85729. // "$ref": "TestPermissionsRequest"
  85730. // },
  85731. // "response": {
  85732. // "$ref": "TestPermissionsResponse"
  85733. // },
  85734. // "scopes": [
  85735. // "https://www.googleapis.com/auth/cloud-platform",
  85736. // "https://www.googleapis.com/auth/compute",
  85737. // "https://www.googleapis.com/auth/compute.readonly"
  85738. // ]
  85739. // }
  85740. }
  85741. // method id "compute.sslPolicies.delete":
  85742. type SslPoliciesDeleteCall struct {
  85743. s *Service
  85744. project string
  85745. sslPolicy string
  85746. urlParams_ gensupport.URLParams
  85747. ctx_ context.Context
  85748. header_ http.Header
  85749. }
  85750. // Delete: Deletes the specified SSL policy. The SSL policy resource can
  85751. // be deleted only if it is not in use by any TargetHttpsProxy or
  85752. // TargetSslProxy resources.
  85753. func (r *SslPoliciesService) Delete(project string, sslPolicy string) *SslPoliciesDeleteCall {
  85754. c := &SslPoliciesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  85755. c.project = project
  85756. c.sslPolicy = sslPolicy
  85757. return c
  85758. }
  85759. // RequestId sets the optional parameter "requestId": An optional
  85760. // request ID to identify requests. Specify a unique request ID so that
  85761. // if you must retry your request, the server will know to ignore the
  85762. // request if it has already been completed.
  85763. //
  85764. // For example, consider a situation where you make an initial request
  85765. // and the request times out. If you make the request again with the
  85766. // same request ID, the server can check if original operation with the
  85767. // same request ID was received, and if so, will ignore the second
  85768. // request. This prevents clients from accidentally creating duplicate
  85769. // commitments.
  85770. //
  85771. // The request ID must be a valid UUID with the exception that zero UUID
  85772. // is not supported (00000000-0000-0000-0000-000000000000).
  85773. func (c *SslPoliciesDeleteCall) RequestId(requestId string) *SslPoliciesDeleteCall {
  85774. c.urlParams_.Set("requestId", requestId)
  85775. return c
  85776. }
  85777. // Fields allows partial responses to be retrieved. See
  85778. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  85779. // for more information.
  85780. func (c *SslPoliciesDeleteCall) Fields(s ...googleapi.Field) *SslPoliciesDeleteCall {
  85781. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  85782. return c
  85783. }
  85784. // Context sets the context to be used in this call's Do method. Any
  85785. // pending HTTP request will be aborted if the provided context is
  85786. // canceled.
  85787. func (c *SslPoliciesDeleteCall) Context(ctx context.Context) *SslPoliciesDeleteCall {
  85788. c.ctx_ = ctx
  85789. return c
  85790. }
  85791. // Header returns an http.Header that can be modified by the caller to
  85792. // add HTTP headers to the request.
  85793. func (c *SslPoliciesDeleteCall) Header() http.Header {
  85794. if c.header_ == nil {
  85795. c.header_ = make(http.Header)
  85796. }
  85797. return c.header_
  85798. }
  85799. func (c *SslPoliciesDeleteCall) doRequest(alt string) (*http.Response, error) {
  85800. reqHeaders := make(http.Header)
  85801. for k, v := range c.header_ {
  85802. reqHeaders[k] = v
  85803. }
  85804. reqHeaders.Set("User-Agent", c.s.userAgent())
  85805. var body io.Reader = nil
  85806. c.urlParams_.Set("alt", alt)
  85807. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/sslPolicies/{sslPolicy}")
  85808. urls += "?" + c.urlParams_.Encode()
  85809. req, _ := http.NewRequest("DELETE", urls, body)
  85810. req.Header = reqHeaders
  85811. googleapi.Expand(req.URL, map[string]string{
  85812. "project": c.project,
  85813. "sslPolicy": c.sslPolicy,
  85814. })
  85815. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  85816. }
  85817. // Do executes the "compute.sslPolicies.delete" call.
  85818. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  85819. // status code is an error. Response headers are in either
  85820. // *Operation.ServerResponse.Header or (if a response was returned at
  85821. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  85822. // to check whether the returned error was because
  85823. // http.StatusNotModified was returned.
  85824. func (c *SslPoliciesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  85825. gensupport.SetOptions(c.urlParams_, opts...)
  85826. res, err := c.doRequest("json")
  85827. if res != nil && res.StatusCode == http.StatusNotModified {
  85828. if res.Body != nil {
  85829. res.Body.Close()
  85830. }
  85831. return nil, &googleapi.Error{
  85832. Code: res.StatusCode,
  85833. Header: res.Header,
  85834. }
  85835. }
  85836. if err != nil {
  85837. return nil, err
  85838. }
  85839. defer googleapi.CloseBody(res)
  85840. if err := googleapi.CheckResponse(res); err != nil {
  85841. return nil, err
  85842. }
  85843. ret := &Operation{
  85844. ServerResponse: googleapi.ServerResponse{
  85845. Header: res.Header,
  85846. HTTPStatusCode: res.StatusCode,
  85847. },
  85848. }
  85849. target := &ret
  85850. if err := gensupport.DecodeResponse(target, res); err != nil {
  85851. return nil, err
  85852. }
  85853. return ret, nil
  85854. // {
  85855. // "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.",
  85856. // "httpMethod": "DELETE",
  85857. // "id": "compute.sslPolicies.delete",
  85858. // "parameterOrder": [
  85859. // "project",
  85860. // "sslPolicy"
  85861. // ],
  85862. // "parameters": {
  85863. // "project": {
  85864. // "description": "Project ID for this request.",
  85865. // "location": "path",
  85866. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  85867. // "required": true,
  85868. // "type": "string"
  85869. // },
  85870. // "requestId": {
  85871. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  85872. // "location": "query",
  85873. // "type": "string"
  85874. // },
  85875. // "sslPolicy": {
  85876. // "description": "Name of the SSL policy to delete. The name must be 1-63 characters long, and comply with RFC1035.",
  85877. // "location": "path",
  85878. // "required": true,
  85879. // "type": "string"
  85880. // }
  85881. // },
  85882. // "path": "{project}/global/sslPolicies/{sslPolicy}",
  85883. // "response": {
  85884. // "$ref": "Operation"
  85885. // },
  85886. // "scopes": [
  85887. // "https://www.googleapis.com/auth/cloud-platform",
  85888. // "https://www.googleapis.com/auth/compute"
  85889. // ]
  85890. // }
  85891. }
  85892. // method id "compute.sslPolicies.get":
  85893. type SslPoliciesGetCall struct {
  85894. s *Service
  85895. project string
  85896. sslPolicy string
  85897. urlParams_ gensupport.URLParams
  85898. ifNoneMatch_ string
  85899. ctx_ context.Context
  85900. header_ http.Header
  85901. }
  85902. // Get: Lists all of the ordered rules present in a single specified
  85903. // policy.
  85904. func (r *SslPoliciesService) Get(project string, sslPolicy string) *SslPoliciesGetCall {
  85905. c := &SslPoliciesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  85906. c.project = project
  85907. c.sslPolicy = sslPolicy
  85908. return c
  85909. }
  85910. // Fields allows partial responses to be retrieved. See
  85911. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  85912. // for more information.
  85913. func (c *SslPoliciesGetCall) Fields(s ...googleapi.Field) *SslPoliciesGetCall {
  85914. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  85915. return c
  85916. }
  85917. // IfNoneMatch sets the optional parameter which makes the operation
  85918. // fail if the object's ETag matches the given value. This is useful for
  85919. // getting updates only after the object has changed since the last
  85920. // request. Use googleapi.IsNotModified to check whether the response
  85921. // error from Do is the result of In-None-Match.
  85922. func (c *SslPoliciesGetCall) IfNoneMatch(entityTag string) *SslPoliciesGetCall {
  85923. c.ifNoneMatch_ = entityTag
  85924. return c
  85925. }
  85926. // Context sets the context to be used in this call's Do method. Any
  85927. // pending HTTP request will be aborted if the provided context is
  85928. // canceled.
  85929. func (c *SslPoliciesGetCall) Context(ctx context.Context) *SslPoliciesGetCall {
  85930. c.ctx_ = ctx
  85931. return c
  85932. }
  85933. // Header returns an http.Header that can be modified by the caller to
  85934. // add HTTP headers to the request.
  85935. func (c *SslPoliciesGetCall) Header() http.Header {
  85936. if c.header_ == nil {
  85937. c.header_ = make(http.Header)
  85938. }
  85939. return c.header_
  85940. }
  85941. func (c *SslPoliciesGetCall) doRequest(alt string) (*http.Response, error) {
  85942. reqHeaders := make(http.Header)
  85943. for k, v := range c.header_ {
  85944. reqHeaders[k] = v
  85945. }
  85946. reqHeaders.Set("User-Agent", c.s.userAgent())
  85947. if c.ifNoneMatch_ != "" {
  85948. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  85949. }
  85950. var body io.Reader = nil
  85951. c.urlParams_.Set("alt", alt)
  85952. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/sslPolicies/{sslPolicy}")
  85953. urls += "?" + c.urlParams_.Encode()
  85954. req, _ := http.NewRequest("GET", urls, body)
  85955. req.Header = reqHeaders
  85956. googleapi.Expand(req.URL, map[string]string{
  85957. "project": c.project,
  85958. "sslPolicy": c.sslPolicy,
  85959. })
  85960. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  85961. }
  85962. // Do executes the "compute.sslPolicies.get" call.
  85963. // Exactly one of *SslPolicy or error will be non-nil. Any non-2xx
  85964. // status code is an error. Response headers are in either
  85965. // *SslPolicy.ServerResponse.Header or (if a response was returned at
  85966. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  85967. // to check whether the returned error was because
  85968. // http.StatusNotModified was returned.
  85969. func (c *SslPoliciesGetCall) Do(opts ...googleapi.CallOption) (*SslPolicy, error) {
  85970. gensupport.SetOptions(c.urlParams_, opts...)
  85971. res, err := c.doRequest("json")
  85972. if res != nil && res.StatusCode == http.StatusNotModified {
  85973. if res.Body != nil {
  85974. res.Body.Close()
  85975. }
  85976. return nil, &googleapi.Error{
  85977. Code: res.StatusCode,
  85978. Header: res.Header,
  85979. }
  85980. }
  85981. if err != nil {
  85982. return nil, err
  85983. }
  85984. defer googleapi.CloseBody(res)
  85985. if err := googleapi.CheckResponse(res); err != nil {
  85986. return nil, err
  85987. }
  85988. ret := &SslPolicy{
  85989. ServerResponse: googleapi.ServerResponse{
  85990. Header: res.Header,
  85991. HTTPStatusCode: res.StatusCode,
  85992. },
  85993. }
  85994. target := &ret
  85995. if err := gensupport.DecodeResponse(target, res); err != nil {
  85996. return nil, err
  85997. }
  85998. return ret, nil
  85999. // {
  86000. // "description": "Lists all of the ordered rules present in a single specified policy.",
  86001. // "httpMethod": "GET",
  86002. // "id": "compute.sslPolicies.get",
  86003. // "parameterOrder": [
  86004. // "project",
  86005. // "sslPolicy"
  86006. // ],
  86007. // "parameters": {
  86008. // "project": {
  86009. // "description": "Project ID for this request.",
  86010. // "location": "path",
  86011. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  86012. // "required": true,
  86013. // "type": "string"
  86014. // },
  86015. // "sslPolicy": {
  86016. // "description": "Name of the SSL policy to update. The name must be 1-63 characters long, and comply with RFC1035.",
  86017. // "location": "path",
  86018. // "required": true,
  86019. // "type": "string"
  86020. // }
  86021. // },
  86022. // "path": "{project}/global/sslPolicies/{sslPolicy}",
  86023. // "response": {
  86024. // "$ref": "SslPolicy"
  86025. // },
  86026. // "scopes": [
  86027. // "https://www.googleapis.com/auth/cloud-platform",
  86028. // "https://www.googleapis.com/auth/compute",
  86029. // "https://www.googleapis.com/auth/compute.readonly"
  86030. // ]
  86031. // }
  86032. }
  86033. // method id "compute.sslPolicies.insert":
  86034. type SslPoliciesInsertCall struct {
  86035. s *Service
  86036. project string
  86037. sslpolicy *SslPolicy
  86038. urlParams_ gensupport.URLParams
  86039. ctx_ context.Context
  86040. header_ http.Header
  86041. }
  86042. // Insert: Returns the specified SSL policy resource. Gets a list of
  86043. // available SSL policies by making a list() request.
  86044. func (r *SslPoliciesService) Insert(project string, sslpolicy *SslPolicy) *SslPoliciesInsertCall {
  86045. c := &SslPoliciesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  86046. c.project = project
  86047. c.sslpolicy = sslpolicy
  86048. return c
  86049. }
  86050. // RequestId sets the optional parameter "requestId": An optional
  86051. // request ID to identify requests. Specify a unique request ID so that
  86052. // if you must retry your request, the server will know to ignore the
  86053. // request if it has already been completed.
  86054. //
  86055. // For example, consider a situation where you make an initial request
  86056. // and the request times out. If you make the request again with the
  86057. // same request ID, the server can check if original operation with the
  86058. // same request ID was received, and if so, will ignore the second
  86059. // request. This prevents clients from accidentally creating duplicate
  86060. // commitments.
  86061. //
  86062. // The request ID must be a valid UUID with the exception that zero UUID
  86063. // is not supported (00000000-0000-0000-0000-000000000000).
  86064. func (c *SslPoliciesInsertCall) RequestId(requestId string) *SslPoliciesInsertCall {
  86065. c.urlParams_.Set("requestId", requestId)
  86066. return c
  86067. }
  86068. // Fields allows partial responses to be retrieved. See
  86069. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  86070. // for more information.
  86071. func (c *SslPoliciesInsertCall) Fields(s ...googleapi.Field) *SslPoliciesInsertCall {
  86072. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  86073. return c
  86074. }
  86075. // Context sets the context to be used in this call's Do method. Any
  86076. // pending HTTP request will be aborted if the provided context is
  86077. // canceled.
  86078. func (c *SslPoliciesInsertCall) Context(ctx context.Context) *SslPoliciesInsertCall {
  86079. c.ctx_ = ctx
  86080. return c
  86081. }
  86082. // Header returns an http.Header that can be modified by the caller to
  86083. // add HTTP headers to the request.
  86084. func (c *SslPoliciesInsertCall) Header() http.Header {
  86085. if c.header_ == nil {
  86086. c.header_ = make(http.Header)
  86087. }
  86088. return c.header_
  86089. }
  86090. func (c *SslPoliciesInsertCall) doRequest(alt string) (*http.Response, error) {
  86091. reqHeaders := make(http.Header)
  86092. for k, v := range c.header_ {
  86093. reqHeaders[k] = v
  86094. }
  86095. reqHeaders.Set("User-Agent", c.s.userAgent())
  86096. var body io.Reader = nil
  86097. body, err := googleapi.WithoutDataWrapper.JSONReader(c.sslpolicy)
  86098. if err != nil {
  86099. return nil, err
  86100. }
  86101. reqHeaders.Set("Content-Type", "application/json")
  86102. c.urlParams_.Set("alt", alt)
  86103. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/sslPolicies")
  86104. urls += "?" + c.urlParams_.Encode()
  86105. req, _ := http.NewRequest("POST", urls, body)
  86106. req.Header = reqHeaders
  86107. googleapi.Expand(req.URL, map[string]string{
  86108. "project": c.project,
  86109. })
  86110. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  86111. }
  86112. // Do executes the "compute.sslPolicies.insert" call.
  86113. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  86114. // status code is an error. Response headers are in either
  86115. // *Operation.ServerResponse.Header or (if a response was returned at
  86116. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  86117. // to check whether the returned error was because
  86118. // http.StatusNotModified was returned.
  86119. func (c *SslPoliciesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  86120. gensupport.SetOptions(c.urlParams_, opts...)
  86121. res, err := c.doRequest("json")
  86122. if res != nil && res.StatusCode == http.StatusNotModified {
  86123. if res.Body != nil {
  86124. res.Body.Close()
  86125. }
  86126. return nil, &googleapi.Error{
  86127. Code: res.StatusCode,
  86128. Header: res.Header,
  86129. }
  86130. }
  86131. if err != nil {
  86132. return nil, err
  86133. }
  86134. defer googleapi.CloseBody(res)
  86135. if err := googleapi.CheckResponse(res); err != nil {
  86136. return nil, err
  86137. }
  86138. ret := &Operation{
  86139. ServerResponse: googleapi.ServerResponse{
  86140. Header: res.Header,
  86141. HTTPStatusCode: res.StatusCode,
  86142. },
  86143. }
  86144. target := &ret
  86145. if err := gensupport.DecodeResponse(target, res); err != nil {
  86146. return nil, err
  86147. }
  86148. return ret, nil
  86149. // {
  86150. // "description": "Returns the specified SSL policy resource. Gets a list of available SSL policies by making a list() request.",
  86151. // "httpMethod": "POST",
  86152. // "id": "compute.sslPolicies.insert",
  86153. // "parameterOrder": [
  86154. // "project"
  86155. // ],
  86156. // "parameters": {
  86157. // "project": {
  86158. // "description": "Project ID for this request.",
  86159. // "location": "path",
  86160. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  86161. // "required": true,
  86162. // "type": "string"
  86163. // },
  86164. // "requestId": {
  86165. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  86166. // "location": "query",
  86167. // "type": "string"
  86168. // }
  86169. // },
  86170. // "path": "{project}/global/sslPolicies",
  86171. // "request": {
  86172. // "$ref": "SslPolicy"
  86173. // },
  86174. // "response": {
  86175. // "$ref": "Operation"
  86176. // },
  86177. // "scopes": [
  86178. // "https://www.googleapis.com/auth/cloud-platform",
  86179. // "https://www.googleapis.com/auth/compute"
  86180. // ]
  86181. // }
  86182. }
  86183. // method id "compute.sslPolicies.list":
  86184. type SslPoliciesListCall struct {
  86185. s *Service
  86186. project string
  86187. urlParams_ gensupport.URLParams
  86188. ifNoneMatch_ string
  86189. ctx_ context.Context
  86190. header_ http.Header
  86191. }
  86192. // List: Lists all the SSL policies that have been configured for the
  86193. // specified project.
  86194. func (r *SslPoliciesService) List(project string) *SslPoliciesListCall {
  86195. c := &SslPoliciesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  86196. c.project = project
  86197. return c
  86198. }
  86199. // Filter sets the optional parameter "filter": A filter expression that
  86200. // filters resources listed in the response. The expression must specify
  86201. // the field name, a comparison operator, and the value that you want to
  86202. // use for filtering. The value must be a string, a number, or a
  86203. // boolean. The comparison operator must be either =, !=, >, or <.
  86204. //
  86205. // For example, if you are filtering Compute Engine instances, you can
  86206. // exclude instances named example-instance by specifying name !=
  86207. // example-instance.
  86208. //
  86209. // You can also filter nested fields. For example, you could specify
  86210. // scheduling.automaticRestart = false to include instances only if they
  86211. // are not scheduled for automatic restarts. You can use filtering on
  86212. // nested fields to filter based on resource labels.
  86213. //
  86214. // To filter on multiple expressions, provide each separate expression
  86215. // within parentheses. For example, (scheduling.automaticRestart = true)
  86216. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  86217. // AND expression. However, you can include AND and OR expressions
  86218. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  86219. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  86220. // true).
  86221. func (c *SslPoliciesListCall) Filter(filter string) *SslPoliciesListCall {
  86222. c.urlParams_.Set("filter", filter)
  86223. return c
  86224. }
  86225. // MaxResults sets the optional parameter "maxResults": The maximum
  86226. // number of results per page that should be returned. If the number of
  86227. // available results is larger than maxResults, Compute Engine returns a
  86228. // nextPageToken that can be used to get the next page of results in
  86229. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  86230. // (Default: 500)
  86231. func (c *SslPoliciesListCall) MaxResults(maxResults int64) *SslPoliciesListCall {
  86232. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  86233. return c
  86234. }
  86235. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  86236. // a certain order. By default, results are returned in alphanumerical
  86237. // order based on the resource name.
  86238. //
  86239. // You can also sort results in descending order based on the creation
  86240. // timestamp using orderBy="creationTimestamp desc". This sorts results
  86241. // based on the creationTimestamp field in reverse chronological order
  86242. // (newest result first). Use this to sort resources like operations so
  86243. // that the newest operation is returned first.
  86244. //
  86245. // Currently, only sorting by name or creationTimestamp desc is
  86246. // supported.
  86247. func (c *SslPoliciesListCall) OrderBy(orderBy string) *SslPoliciesListCall {
  86248. c.urlParams_.Set("orderBy", orderBy)
  86249. return c
  86250. }
  86251. // PageToken sets the optional parameter "pageToken": Specifies a page
  86252. // token to use. Set pageToken to the nextPageToken returned by a
  86253. // previous list request to get the next page of results.
  86254. func (c *SslPoliciesListCall) PageToken(pageToken string) *SslPoliciesListCall {
  86255. c.urlParams_.Set("pageToken", pageToken)
  86256. return c
  86257. }
  86258. // Fields allows partial responses to be retrieved. See
  86259. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  86260. // for more information.
  86261. func (c *SslPoliciesListCall) Fields(s ...googleapi.Field) *SslPoliciesListCall {
  86262. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  86263. return c
  86264. }
  86265. // IfNoneMatch sets the optional parameter which makes the operation
  86266. // fail if the object's ETag matches the given value. This is useful for
  86267. // getting updates only after the object has changed since the last
  86268. // request. Use googleapi.IsNotModified to check whether the response
  86269. // error from Do is the result of In-None-Match.
  86270. func (c *SslPoliciesListCall) IfNoneMatch(entityTag string) *SslPoliciesListCall {
  86271. c.ifNoneMatch_ = entityTag
  86272. return c
  86273. }
  86274. // Context sets the context to be used in this call's Do method. Any
  86275. // pending HTTP request will be aborted if the provided context is
  86276. // canceled.
  86277. func (c *SslPoliciesListCall) Context(ctx context.Context) *SslPoliciesListCall {
  86278. c.ctx_ = ctx
  86279. return c
  86280. }
  86281. // Header returns an http.Header that can be modified by the caller to
  86282. // add HTTP headers to the request.
  86283. func (c *SslPoliciesListCall) Header() http.Header {
  86284. if c.header_ == nil {
  86285. c.header_ = make(http.Header)
  86286. }
  86287. return c.header_
  86288. }
  86289. func (c *SslPoliciesListCall) doRequest(alt string) (*http.Response, error) {
  86290. reqHeaders := make(http.Header)
  86291. for k, v := range c.header_ {
  86292. reqHeaders[k] = v
  86293. }
  86294. reqHeaders.Set("User-Agent", c.s.userAgent())
  86295. if c.ifNoneMatch_ != "" {
  86296. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  86297. }
  86298. var body io.Reader = nil
  86299. c.urlParams_.Set("alt", alt)
  86300. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/sslPolicies")
  86301. urls += "?" + c.urlParams_.Encode()
  86302. req, _ := http.NewRequest("GET", urls, body)
  86303. req.Header = reqHeaders
  86304. googleapi.Expand(req.URL, map[string]string{
  86305. "project": c.project,
  86306. })
  86307. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  86308. }
  86309. // Do executes the "compute.sslPolicies.list" call.
  86310. // Exactly one of *SslPoliciesList or error will be non-nil. Any non-2xx
  86311. // status code is an error. Response headers are in either
  86312. // *SslPoliciesList.ServerResponse.Header or (if a response was returned
  86313. // at all) in error.(*googleapi.Error).Header. Use
  86314. // googleapi.IsNotModified to check whether the returned error was
  86315. // because http.StatusNotModified was returned.
  86316. func (c *SslPoliciesListCall) Do(opts ...googleapi.CallOption) (*SslPoliciesList, error) {
  86317. gensupport.SetOptions(c.urlParams_, opts...)
  86318. res, err := c.doRequest("json")
  86319. if res != nil && res.StatusCode == http.StatusNotModified {
  86320. if res.Body != nil {
  86321. res.Body.Close()
  86322. }
  86323. return nil, &googleapi.Error{
  86324. Code: res.StatusCode,
  86325. Header: res.Header,
  86326. }
  86327. }
  86328. if err != nil {
  86329. return nil, err
  86330. }
  86331. defer googleapi.CloseBody(res)
  86332. if err := googleapi.CheckResponse(res); err != nil {
  86333. return nil, err
  86334. }
  86335. ret := &SslPoliciesList{
  86336. ServerResponse: googleapi.ServerResponse{
  86337. Header: res.Header,
  86338. HTTPStatusCode: res.StatusCode,
  86339. },
  86340. }
  86341. target := &ret
  86342. if err := gensupport.DecodeResponse(target, res); err != nil {
  86343. return nil, err
  86344. }
  86345. return ret, nil
  86346. // {
  86347. // "description": "Lists all the SSL policies that have been configured for the specified project.",
  86348. // "httpMethod": "GET",
  86349. // "id": "compute.sslPolicies.list",
  86350. // "parameterOrder": [
  86351. // "project"
  86352. // ],
  86353. // "parameters": {
  86354. // "filter": {
  86355. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  86356. // "location": "query",
  86357. // "type": "string"
  86358. // },
  86359. // "maxResults": {
  86360. // "default": "500",
  86361. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  86362. // "format": "uint32",
  86363. // "location": "query",
  86364. // "minimum": "0",
  86365. // "type": "integer"
  86366. // },
  86367. // "orderBy": {
  86368. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  86369. // "location": "query",
  86370. // "type": "string"
  86371. // },
  86372. // "pageToken": {
  86373. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  86374. // "location": "query",
  86375. // "type": "string"
  86376. // },
  86377. // "project": {
  86378. // "description": "Project ID for this request.",
  86379. // "location": "path",
  86380. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  86381. // "required": true,
  86382. // "type": "string"
  86383. // }
  86384. // },
  86385. // "path": "{project}/global/sslPolicies",
  86386. // "response": {
  86387. // "$ref": "SslPoliciesList"
  86388. // },
  86389. // "scopes": [
  86390. // "https://www.googleapis.com/auth/cloud-platform",
  86391. // "https://www.googleapis.com/auth/compute",
  86392. // "https://www.googleapis.com/auth/compute.readonly"
  86393. // ]
  86394. // }
  86395. }
  86396. // Pages invokes f for each page of results.
  86397. // A non-nil error returned from f will halt the iteration.
  86398. // The provided context supersedes any context provided to the Context method.
  86399. func (c *SslPoliciesListCall) Pages(ctx context.Context, f func(*SslPoliciesList) error) error {
  86400. c.ctx_ = ctx
  86401. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  86402. for {
  86403. x, err := c.Do()
  86404. if err != nil {
  86405. return err
  86406. }
  86407. if err := f(x); err != nil {
  86408. return err
  86409. }
  86410. if x.NextPageToken == "" {
  86411. return nil
  86412. }
  86413. c.PageToken(x.NextPageToken)
  86414. }
  86415. }
  86416. // method id "compute.sslPolicies.listAvailableFeatures":
  86417. type SslPoliciesListAvailableFeaturesCall struct {
  86418. s *Service
  86419. project string
  86420. urlParams_ gensupport.URLParams
  86421. ifNoneMatch_ string
  86422. ctx_ context.Context
  86423. header_ http.Header
  86424. }
  86425. // ListAvailableFeatures: Lists all features that can be specified in
  86426. // the SSL policy when using custom profile.
  86427. func (r *SslPoliciesService) ListAvailableFeatures(project string) *SslPoliciesListAvailableFeaturesCall {
  86428. c := &SslPoliciesListAvailableFeaturesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  86429. c.project = project
  86430. return c
  86431. }
  86432. // Filter sets the optional parameter "filter": A filter expression that
  86433. // filters resources listed in the response. The expression must specify
  86434. // the field name, a comparison operator, and the value that you want to
  86435. // use for filtering. The value must be a string, a number, or a
  86436. // boolean. The comparison operator must be either =, !=, >, or <.
  86437. //
  86438. // For example, if you are filtering Compute Engine instances, you can
  86439. // exclude instances named example-instance by specifying name !=
  86440. // example-instance.
  86441. //
  86442. // You can also filter nested fields. For example, you could specify
  86443. // scheduling.automaticRestart = false to include instances only if they
  86444. // are not scheduled for automatic restarts. You can use filtering on
  86445. // nested fields to filter based on resource labels.
  86446. //
  86447. // To filter on multiple expressions, provide each separate expression
  86448. // within parentheses. For example, (scheduling.automaticRestart = true)
  86449. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  86450. // AND expression. However, you can include AND and OR expressions
  86451. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  86452. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  86453. // true).
  86454. func (c *SslPoliciesListAvailableFeaturesCall) Filter(filter string) *SslPoliciesListAvailableFeaturesCall {
  86455. c.urlParams_.Set("filter", filter)
  86456. return c
  86457. }
  86458. // MaxResults sets the optional parameter "maxResults": The maximum
  86459. // number of results per page that should be returned. If the number of
  86460. // available results is larger than maxResults, Compute Engine returns a
  86461. // nextPageToken that can be used to get the next page of results in
  86462. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  86463. // (Default: 500)
  86464. func (c *SslPoliciesListAvailableFeaturesCall) MaxResults(maxResults int64) *SslPoliciesListAvailableFeaturesCall {
  86465. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  86466. return c
  86467. }
  86468. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  86469. // a certain order. By default, results are returned in alphanumerical
  86470. // order based on the resource name.
  86471. //
  86472. // You can also sort results in descending order based on the creation
  86473. // timestamp using orderBy="creationTimestamp desc". This sorts results
  86474. // based on the creationTimestamp field in reverse chronological order
  86475. // (newest result first). Use this to sort resources like operations so
  86476. // that the newest operation is returned first.
  86477. //
  86478. // Currently, only sorting by name or creationTimestamp desc is
  86479. // supported.
  86480. func (c *SslPoliciesListAvailableFeaturesCall) OrderBy(orderBy string) *SslPoliciesListAvailableFeaturesCall {
  86481. c.urlParams_.Set("orderBy", orderBy)
  86482. return c
  86483. }
  86484. // PageToken sets the optional parameter "pageToken": Specifies a page
  86485. // token to use. Set pageToken to the nextPageToken returned by a
  86486. // previous list request to get the next page of results.
  86487. func (c *SslPoliciesListAvailableFeaturesCall) PageToken(pageToken string) *SslPoliciesListAvailableFeaturesCall {
  86488. c.urlParams_.Set("pageToken", pageToken)
  86489. return c
  86490. }
  86491. // Fields allows partial responses to be retrieved. See
  86492. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  86493. // for more information.
  86494. func (c *SslPoliciesListAvailableFeaturesCall) Fields(s ...googleapi.Field) *SslPoliciesListAvailableFeaturesCall {
  86495. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  86496. return c
  86497. }
  86498. // IfNoneMatch sets the optional parameter which makes the operation
  86499. // fail if the object's ETag matches the given value. This is useful for
  86500. // getting updates only after the object has changed since the last
  86501. // request. Use googleapi.IsNotModified to check whether the response
  86502. // error from Do is the result of In-None-Match.
  86503. func (c *SslPoliciesListAvailableFeaturesCall) IfNoneMatch(entityTag string) *SslPoliciesListAvailableFeaturesCall {
  86504. c.ifNoneMatch_ = entityTag
  86505. return c
  86506. }
  86507. // Context sets the context to be used in this call's Do method. Any
  86508. // pending HTTP request will be aborted if the provided context is
  86509. // canceled.
  86510. func (c *SslPoliciesListAvailableFeaturesCall) Context(ctx context.Context) *SslPoliciesListAvailableFeaturesCall {
  86511. c.ctx_ = ctx
  86512. return c
  86513. }
  86514. // Header returns an http.Header that can be modified by the caller to
  86515. // add HTTP headers to the request.
  86516. func (c *SslPoliciesListAvailableFeaturesCall) Header() http.Header {
  86517. if c.header_ == nil {
  86518. c.header_ = make(http.Header)
  86519. }
  86520. return c.header_
  86521. }
  86522. func (c *SslPoliciesListAvailableFeaturesCall) doRequest(alt string) (*http.Response, error) {
  86523. reqHeaders := make(http.Header)
  86524. for k, v := range c.header_ {
  86525. reqHeaders[k] = v
  86526. }
  86527. reqHeaders.Set("User-Agent", c.s.userAgent())
  86528. if c.ifNoneMatch_ != "" {
  86529. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  86530. }
  86531. var body io.Reader = nil
  86532. c.urlParams_.Set("alt", alt)
  86533. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/sslPolicies/listAvailableFeatures")
  86534. urls += "?" + c.urlParams_.Encode()
  86535. req, _ := http.NewRequest("GET", urls, body)
  86536. req.Header = reqHeaders
  86537. googleapi.Expand(req.URL, map[string]string{
  86538. "project": c.project,
  86539. })
  86540. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  86541. }
  86542. // Do executes the "compute.sslPolicies.listAvailableFeatures" call.
  86543. // Exactly one of *SslPoliciesListAvailableFeaturesResponse or error
  86544. // will be non-nil. Any non-2xx status code is an error. Response
  86545. // headers are in either
  86546. // *SslPoliciesListAvailableFeaturesResponse.ServerResponse.Header or
  86547. // (if a response was returned at all) in
  86548. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  86549. // whether the returned error was because http.StatusNotModified was
  86550. // returned.
  86551. func (c *SslPoliciesListAvailableFeaturesCall) Do(opts ...googleapi.CallOption) (*SslPoliciesListAvailableFeaturesResponse, error) {
  86552. gensupport.SetOptions(c.urlParams_, opts...)
  86553. res, err := c.doRequest("json")
  86554. if res != nil && res.StatusCode == http.StatusNotModified {
  86555. if res.Body != nil {
  86556. res.Body.Close()
  86557. }
  86558. return nil, &googleapi.Error{
  86559. Code: res.StatusCode,
  86560. Header: res.Header,
  86561. }
  86562. }
  86563. if err != nil {
  86564. return nil, err
  86565. }
  86566. defer googleapi.CloseBody(res)
  86567. if err := googleapi.CheckResponse(res); err != nil {
  86568. return nil, err
  86569. }
  86570. ret := &SslPoliciesListAvailableFeaturesResponse{
  86571. ServerResponse: googleapi.ServerResponse{
  86572. Header: res.Header,
  86573. HTTPStatusCode: res.StatusCode,
  86574. },
  86575. }
  86576. target := &ret
  86577. if err := gensupport.DecodeResponse(target, res); err != nil {
  86578. return nil, err
  86579. }
  86580. return ret, nil
  86581. // {
  86582. // "description": "Lists all features that can be specified in the SSL policy when using custom profile.",
  86583. // "httpMethod": "GET",
  86584. // "id": "compute.sslPolicies.listAvailableFeatures",
  86585. // "parameterOrder": [
  86586. // "project"
  86587. // ],
  86588. // "parameters": {
  86589. // "filter": {
  86590. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  86591. // "location": "query",
  86592. // "type": "string"
  86593. // },
  86594. // "maxResults": {
  86595. // "default": "500",
  86596. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  86597. // "format": "uint32",
  86598. // "location": "query",
  86599. // "minimum": "0",
  86600. // "type": "integer"
  86601. // },
  86602. // "orderBy": {
  86603. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  86604. // "location": "query",
  86605. // "type": "string"
  86606. // },
  86607. // "pageToken": {
  86608. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  86609. // "location": "query",
  86610. // "type": "string"
  86611. // },
  86612. // "project": {
  86613. // "description": "Project ID for this request.",
  86614. // "location": "path",
  86615. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  86616. // "required": true,
  86617. // "type": "string"
  86618. // }
  86619. // },
  86620. // "path": "{project}/global/sslPolicies/listAvailableFeatures",
  86621. // "response": {
  86622. // "$ref": "SslPoliciesListAvailableFeaturesResponse"
  86623. // },
  86624. // "scopes": [
  86625. // "https://www.googleapis.com/auth/cloud-platform",
  86626. // "https://www.googleapis.com/auth/compute",
  86627. // "https://www.googleapis.com/auth/compute.readonly"
  86628. // ]
  86629. // }
  86630. }
  86631. // method id "compute.sslPolicies.patch":
  86632. type SslPoliciesPatchCall struct {
  86633. s *Service
  86634. project string
  86635. sslPolicy string
  86636. sslpolicy *SslPolicy
  86637. urlParams_ gensupport.URLParams
  86638. ctx_ context.Context
  86639. header_ http.Header
  86640. }
  86641. // Patch: Patches the specified SSL policy with the data included in the
  86642. // request.
  86643. func (r *SslPoliciesService) Patch(project string, sslPolicy string, sslpolicy *SslPolicy) *SslPoliciesPatchCall {
  86644. c := &SslPoliciesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  86645. c.project = project
  86646. c.sslPolicy = sslPolicy
  86647. c.sslpolicy = sslpolicy
  86648. return c
  86649. }
  86650. // RequestId sets the optional parameter "requestId": An optional
  86651. // request ID to identify requests. Specify a unique request ID so that
  86652. // if you must retry your request, the server will know to ignore the
  86653. // request if it has already been completed.
  86654. //
  86655. // For example, consider a situation where you make an initial request
  86656. // and the request times out. If you make the request again with the
  86657. // same request ID, the server can check if original operation with the
  86658. // same request ID was received, and if so, will ignore the second
  86659. // request. This prevents clients from accidentally creating duplicate
  86660. // commitments.
  86661. //
  86662. // The request ID must be a valid UUID with the exception that zero UUID
  86663. // is not supported (00000000-0000-0000-0000-000000000000).
  86664. func (c *SslPoliciesPatchCall) RequestId(requestId string) *SslPoliciesPatchCall {
  86665. c.urlParams_.Set("requestId", requestId)
  86666. return c
  86667. }
  86668. // Fields allows partial responses to be retrieved. See
  86669. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  86670. // for more information.
  86671. func (c *SslPoliciesPatchCall) Fields(s ...googleapi.Field) *SslPoliciesPatchCall {
  86672. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  86673. return c
  86674. }
  86675. // Context sets the context to be used in this call's Do method. Any
  86676. // pending HTTP request will be aborted if the provided context is
  86677. // canceled.
  86678. func (c *SslPoliciesPatchCall) Context(ctx context.Context) *SslPoliciesPatchCall {
  86679. c.ctx_ = ctx
  86680. return c
  86681. }
  86682. // Header returns an http.Header that can be modified by the caller to
  86683. // add HTTP headers to the request.
  86684. func (c *SslPoliciesPatchCall) Header() http.Header {
  86685. if c.header_ == nil {
  86686. c.header_ = make(http.Header)
  86687. }
  86688. return c.header_
  86689. }
  86690. func (c *SslPoliciesPatchCall) doRequest(alt string) (*http.Response, error) {
  86691. reqHeaders := make(http.Header)
  86692. for k, v := range c.header_ {
  86693. reqHeaders[k] = v
  86694. }
  86695. reqHeaders.Set("User-Agent", c.s.userAgent())
  86696. var body io.Reader = nil
  86697. body, err := googleapi.WithoutDataWrapper.JSONReader(c.sslpolicy)
  86698. if err != nil {
  86699. return nil, err
  86700. }
  86701. reqHeaders.Set("Content-Type", "application/json")
  86702. c.urlParams_.Set("alt", alt)
  86703. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/sslPolicies/{sslPolicy}")
  86704. urls += "?" + c.urlParams_.Encode()
  86705. req, _ := http.NewRequest("PATCH", urls, body)
  86706. req.Header = reqHeaders
  86707. googleapi.Expand(req.URL, map[string]string{
  86708. "project": c.project,
  86709. "sslPolicy": c.sslPolicy,
  86710. })
  86711. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  86712. }
  86713. // Do executes the "compute.sslPolicies.patch" call.
  86714. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  86715. // status code is an error. Response headers are in either
  86716. // *Operation.ServerResponse.Header or (if a response was returned at
  86717. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  86718. // to check whether the returned error was because
  86719. // http.StatusNotModified was returned.
  86720. func (c *SslPoliciesPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  86721. gensupport.SetOptions(c.urlParams_, opts...)
  86722. res, err := c.doRequest("json")
  86723. if res != nil && res.StatusCode == http.StatusNotModified {
  86724. if res.Body != nil {
  86725. res.Body.Close()
  86726. }
  86727. return nil, &googleapi.Error{
  86728. Code: res.StatusCode,
  86729. Header: res.Header,
  86730. }
  86731. }
  86732. if err != nil {
  86733. return nil, err
  86734. }
  86735. defer googleapi.CloseBody(res)
  86736. if err := googleapi.CheckResponse(res); err != nil {
  86737. return nil, err
  86738. }
  86739. ret := &Operation{
  86740. ServerResponse: googleapi.ServerResponse{
  86741. Header: res.Header,
  86742. HTTPStatusCode: res.StatusCode,
  86743. },
  86744. }
  86745. target := &ret
  86746. if err := gensupport.DecodeResponse(target, res); err != nil {
  86747. return nil, err
  86748. }
  86749. return ret, nil
  86750. // {
  86751. // "description": "Patches the specified SSL policy with the data included in the request.",
  86752. // "httpMethod": "PATCH",
  86753. // "id": "compute.sslPolicies.patch",
  86754. // "parameterOrder": [
  86755. // "project",
  86756. // "sslPolicy"
  86757. // ],
  86758. // "parameters": {
  86759. // "project": {
  86760. // "description": "Project ID for this request.",
  86761. // "location": "path",
  86762. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  86763. // "required": true,
  86764. // "type": "string"
  86765. // },
  86766. // "requestId": {
  86767. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  86768. // "location": "query",
  86769. // "type": "string"
  86770. // },
  86771. // "sslPolicy": {
  86772. // "description": "Name of the SSL policy to update. The name must be 1-63 characters long, and comply with RFC1035.",
  86773. // "location": "path",
  86774. // "required": true,
  86775. // "type": "string"
  86776. // }
  86777. // },
  86778. // "path": "{project}/global/sslPolicies/{sslPolicy}",
  86779. // "request": {
  86780. // "$ref": "SslPolicy"
  86781. // },
  86782. // "response": {
  86783. // "$ref": "Operation"
  86784. // },
  86785. // "scopes": [
  86786. // "https://www.googleapis.com/auth/cloud-platform",
  86787. // "https://www.googleapis.com/auth/compute"
  86788. // ]
  86789. // }
  86790. }
  86791. // method id "compute.sslPolicies.testIamPermissions":
  86792. type SslPoliciesTestIamPermissionsCall struct {
  86793. s *Service
  86794. project string
  86795. resource string
  86796. testpermissionsrequest *TestPermissionsRequest
  86797. urlParams_ gensupport.URLParams
  86798. ctx_ context.Context
  86799. header_ http.Header
  86800. }
  86801. // TestIamPermissions: Returns permissions that a caller has on the
  86802. // specified resource.
  86803. func (r *SslPoliciesService) TestIamPermissions(project string, resource string, testpermissionsrequest *TestPermissionsRequest) *SslPoliciesTestIamPermissionsCall {
  86804. c := &SslPoliciesTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  86805. c.project = project
  86806. c.resource = resource
  86807. c.testpermissionsrequest = testpermissionsrequest
  86808. return c
  86809. }
  86810. // Fields allows partial responses to be retrieved. See
  86811. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  86812. // for more information.
  86813. func (c *SslPoliciesTestIamPermissionsCall) Fields(s ...googleapi.Field) *SslPoliciesTestIamPermissionsCall {
  86814. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  86815. return c
  86816. }
  86817. // Context sets the context to be used in this call's Do method. Any
  86818. // pending HTTP request will be aborted if the provided context is
  86819. // canceled.
  86820. func (c *SslPoliciesTestIamPermissionsCall) Context(ctx context.Context) *SslPoliciesTestIamPermissionsCall {
  86821. c.ctx_ = ctx
  86822. return c
  86823. }
  86824. // Header returns an http.Header that can be modified by the caller to
  86825. // add HTTP headers to the request.
  86826. func (c *SslPoliciesTestIamPermissionsCall) Header() http.Header {
  86827. if c.header_ == nil {
  86828. c.header_ = make(http.Header)
  86829. }
  86830. return c.header_
  86831. }
  86832. func (c *SslPoliciesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  86833. reqHeaders := make(http.Header)
  86834. for k, v := range c.header_ {
  86835. reqHeaders[k] = v
  86836. }
  86837. reqHeaders.Set("User-Agent", c.s.userAgent())
  86838. var body io.Reader = nil
  86839. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  86840. if err != nil {
  86841. return nil, err
  86842. }
  86843. reqHeaders.Set("Content-Type", "application/json")
  86844. c.urlParams_.Set("alt", alt)
  86845. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/sslPolicies/{resource}/testIamPermissions")
  86846. urls += "?" + c.urlParams_.Encode()
  86847. req, _ := http.NewRequest("POST", urls, body)
  86848. req.Header = reqHeaders
  86849. googleapi.Expand(req.URL, map[string]string{
  86850. "project": c.project,
  86851. "resource": c.resource,
  86852. })
  86853. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  86854. }
  86855. // Do executes the "compute.sslPolicies.testIamPermissions" call.
  86856. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  86857. // non-2xx status code is an error. Response headers are in either
  86858. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  86859. // returned at all) in error.(*googleapi.Error).Header. Use
  86860. // googleapi.IsNotModified to check whether the returned error was
  86861. // because http.StatusNotModified was returned.
  86862. func (c *SslPoliciesTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  86863. gensupport.SetOptions(c.urlParams_, opts...)
  86864. res, err := c.doRequest("json")
  86865. if res != nil && res.StatusCode == http.StatusNotModified {
  86866. if res.Body != nil {
  86867. res.Body.Close()
  86868. }
  86869. return nil, &googleapi.Error{
  86870. Code: res.StatusCode,
  86871. Header: res.Header,
  86872. }
  86873. }
  86874. if err != nil {
  86875. return nil, err
  86876. }
  86877. defer googleapi.CloseBody(res)
  86878. if err := googleapi.CheckResponse(res); err != nil {
  86879. return nil, err
  86880. }
  86881. ret := &TestPermissionsResponse{
  86882. ServerResponse: googleapi.ServerResponse{
  86883. Header: res.Header,
  86884. HTTPStatusCode: res.StatusCode,
  86885. },
  86886. }
  86887. target := &ret
  86888. if err := gensupport.DecodeResponse(target, res); err != nil {
  86889. return nil, err
  86890. }
  86891. return ret, nil
  86892. // {
  86893. // "description": "Returns permissions that a caller has on the specified resource.",
  86894. // "httpMethod": "POST",
  86895. // "id": "compute.sslPolicies.testIamPermissions",
  86896. // "parameterOrder": [
  86897. // "project",
  86898. // "resource"
  86899. // ],
  86900. // "parameters": {
  86901. // "project": {
  86902. // "description": "Project ID for this request.",
  86903. // "location": "path",
  86904. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  86905. // "required": true,
  86906. // "type": "string"
  86907. // },
  86908. // "resource": {
  86909. // "description": "Name of the resource for this request.",
  86910. // "location": "path",
  86911. // "pattern": "(?:[-a-z0-9_]{0,62}[a-z0-9])?",
  86912. // "required": true,
  86913. // "type": "string"
  86914. // }
  86915. // },
  86916. // "path": "{project}/global/sslPolicies/{resource}/testIamPermissions",
  86917. // "request": {
  86918. // "$ref": "TestPermissionsRequest"
  86919. // },
  86920. // "response": {
  86921. // "$ref": "TestPermissionsResponse"
  86922. // },
  86923. // "scopes": [
  86924. // "https://www.googleapis.com/auth/cloud-platform",
  86925. // "https://www.googleapis.com/auth/compute",
  86926. // "https://www.googleapis.com/auth/compute.readonly"
  86927. // ]
  86928. // }
  86929. }
  86930. // method id "compute.subnetworks.aggregatedList":
  86931. type SubnetworksAggregatedListCall struct {
  86932. s *Service
  86933. project string
  86934. urlParams_ gensupport.URLParams
  86935. ifNoneMatch_ string
  86936. ctx_ context.Context
  86937. header_ http.Header
  86938. }
  86939. // AggregatedList: Retrieves an aggregated list of subnetworks.
  86940. func (r *SubnetworksService) AggregatedList(project string) *SubnetworksAggregatedListCall {
  86941. c := &SubnetworksAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  86942. c.project = project
  86943. return c
  86944. }
  86945. // Filter sets the optional parameter "filter": A filter expression that
  86946. // filters resources listed in the response. The expression must specify
  86947. // the field name, a comparison operator, and the value that you want to
  86948. // use for filtering. The value must be a string, a number, or a
  86949. // boolean. The comparison operator must be either =, !=, >, or <.
  86950. //
  86951. // For example, if you are filtering Compute Engine instances, you can
  86952. // exclude instances named example-instance by specifying name !=
  86953. // example-instance.
  86954. //
  86955. // You can also filter nested fields. For example, you could specify
  86956. // scheduling.automaticRestart = false to include instances only if they
  86957. // are not scheduled for automatic restarts. You can use filtering on
  86958. // nested fields to filter based on resource labels.
  86959. //
  86960. // To filter on multiple expressions, provide each separate expression
  86961. // within parentheses. For example, (scheduling.automaticRestart = true)
  86962. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  86963. // AND expression. However, you can include AND and OR expressions
  86964. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  86965. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  86966. // true).
  86967. func (c *SubnetworksAggregatedListCall) Filter(filter string) *SubnetworksAggregatedListCall {
  86968. c.urlParams_.Set("filter", filter)
  86969. return c
  86970. }
  86971. // MaxResults sets the optional parameter "maxResults": The maximum
  86972. // number of results per page that should be returned. If the number of
  86973. // available results is larger than maxResults, Compute Engine returns a
  86974. // nextPageToken that can be used to get the next page of results in
  86975. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  86976. // (Default: 500)
  86977. func (c *SubnetworksAggregatedListCall) MaxResults(maxResults int64) *SubnetworksAggregatedListCall {
  86978. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  86979. return c
  86980. }
  86981. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  86982. // a certain order. By default, results are returned in alphanumerical
  86983. // order based on the resource name.
  86984. //
  86985. // You can also sort results in descending order based on the creation
  86986. // timestamp using orderBy="creationTimestamp desc". This sorts results
  86987. // based on the creationTimestamp field in reverse chronological order
  86988. // (newest result first). Use this to sort resources like operations so
  86989. // that the newest operation is returned first.
  86990. //
  86991. // Currently, only sorting by name or creationTimestamp desc is
  86992. // supported.
  86993. func (c *SubnetworksAggregatedListCall) OrderBy(orderBy string) *SubnetworksAggregatedListCall {
  86994. c.urlParams_.Set("orderBy", orderBy)
  86995. return c
  86996. }
  86997. // PageToken sets the optional parameter "pageToken": Specifies a page
  86998. // token to use. Set pageToken to the nextPageToken returned by a
  86999. // previous list request to get the next page of results.
  87000. func (c *SubnetworksAggregatedListCall) PageToken(pageToken string) *SubnetworksAggregatedListCall {
  87001. c.urlParams_.Set("pageToken", pageToken)
  87002. return c
  87003. }
  87004. // Fields allows partial responses to be retrieved. See
  87005. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  87006. // for more information.
  87007. func (c *SubnetworksAggregatedListCall) Fields(s ...googleapi.Field) *SubnetworksAggregatedListCall {
  87008. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  87009. return c
  87010. }
  87011. // IfNoneMatch sets the optional parameter which makes the operation
  87012. // fail if the object's ETag matches the given value. This is useful for
  87013. // getting updates only after the object has changed since the last
  87014. // request. Use googleapi.IsNotModified to check whether the response
  87015. // error from Do is the result of In-None-Match.
  87016. func (c *SubnetworksAggregatedListCall) IfNoneMatch(entityTag string) *SubnetworksAggregatedListCall {
  87017. c.ifNoneMatch_ = entityTag
  87018. return c
  87019. }
  87020. // Context sets the context to be used in this call's Do method. Any
  87021. // pending HTTP request will be aborted if the provided context is
  87022. // canceled.
  87023. func (c *SubnetworksAggregatedListCall) Context(ctx context.Context) *SubnetworksAggregatedListCall {
  87024. c.ctx_ = ctx
  87025. return c
  87026. }
  87027. // Header returns an http.Header that can be modified by the caller to
  87028. // add HTTP headers to the request.
  87029. func (c *SubnetworksAggregatedListCall) Header() http.Header {
  87030. if c.header_ == nil {
  87031. c.header_ = make(http.Header)
  87032. }
  87033. return c.header_
  87034. }
  87035. func (c *SubnetworksAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  87036. reqHeaders := make(http.Header)
  87037. for k, v := range c.header_ {
  87038. reqHeaders[k] = v
  87039. }
  87040. reqHeaders.Set("User-Agent", c.s.userAgent())
  87041. if c.ifNoneMatch_ != "" {
  87042. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  87043. }
  87044. var body io.Reader = nil
  87045. c.urlParams_.Set("alt", alt)
  87046. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/subnetworks")
  87047. urls += "?" + c.urlParams_.Encode()
  87048. req, _ := http.NewRequest("GET", urls, body)
  87049. req.Header = reqHeaders
  87050. googleapi.Expand(req.URL, map[string]string{
  87051. "project": c.project,
  87052. })
  87053. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  87054. }
  87055. // Do executes the "compute.subnetworks.aggregatedList" call.
  87056. // Exactly one of *SubnetworkAggregatedList or error will be non-nil.
  87057. // Any non-2xx status code is an error. Response headers are in either
  87058. // *SubnetworkAggregatedList.ServerResponse.Header or (if a response was
  87059. // returned at all) in error.(*googleapi.Error).Header. Use
  87060. // googleapi.IsNotModified to check whether the returned error was
  87061. // because http.StatusNotModified was returned.
  87062. func (c *SubnetworksAggregatedListCall) Do(opts ...googleapi.CallOption) (*SubnetworkAggregatedList, error) {
  87063. gensupport.SetOptions(c.urlParams_, opts...)
  87064. res, err := c.doRequest("json")
  87065. if res != nil && res.StatusCode == http.StatusNotModified {
  87066. if res.Body != nil {
  87067. res.Body.Close()
  87068. }
  87069. return nil, &googleapi.Error{
  87070. Code: res.StatusCode,
  87071. Header: res.Header,
  87072. }
  87073. }
  87074. if err != nil {
  87075. return nil, err
  87076. }
  87077. defer googleapi.CloseBody(res)
  87078. if err := googleapi.CheckResponse(res); err != nil {
  87079. return nil, err
  87080. }
  87081. ret := &SubnetworkAggregatedList{
  87082. ServerResponse: googleapi.ServerResponse{
  87083. Header: res.Header,
  87084. HTTPStatusCode: res.StatusCode,
  87085. },
  87086. }
  87087. target := &ret
  87088. if err := gensupport.DecodeResponse(target, res); err != nil {
  87089. return nil, err
  87090. }
  87091. return ret, nil
  87092. // {
  87093. // "description": "Retrieves an aggregated list of subnetworks.",
  87094. // "httpMethod": "GET",
  87095. // "id": "compute.subnetworks.aggregatedList",
  87096. // "parameterOrder": [
  87097. // "project"
  87098. // ],
  87099. // "parameters": {
  87100. // "filter": {
  87101. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  87102. // "location": "query",
  87103. // "type": "string"
  87104. // },
  87105. // "maxResults": {
  87106. // "default": "500",
  87107. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  87108. // "format": "uint32",
  87109. // "location": "query",
  87110. // "minimum": "0",
  87111. // "type": "integer"
  87112. // },
  87113. // "orderBy": {
  87114. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  87115. // "location": "query",
  87116. // "type": "string"
  87117. // },
  87118. // "pageToken": {
  87119. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  87120. // "location": "query",
  87121. // "type": "string"
  87122. // },
  87123. // "project": {
  87124. // "description": "Project ID for this request.",
  87125. // "location": "path",
  87126. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  87127. // "required": true,
  87128. // "type": "string"
  87129. // }
  87130. // },
  87131. // "path": "{project}/aggregated/subnetworks",
  87132. // "response": {
  87133. // "$ref": "SubnetworkAggregatedList"
  87134. // },
  87135. // "scopes": [
  87136. // "https://www.googleapis.com/auth/cloud-platform",
  87137. // "https://www.googleapis.com/auth/compute",
  87138. // "https://www.googleapis.com/auth/compute.readonly"
  87139. // ]
  87140. // }
  87141. }
  87142. // Pages invokes f for each page of results.
  87143. // A non-nil error returned from f will halt the iteration.
  87144. // The provided context supersedes any context provided to the Context method.
  87145. func (c *SubnetworksAggregatedListCall) Pages(ctx context.Context, f func(*SubnetworkAggregatedList) error) error {
  87146. c.ctx_ = ctx
  87147. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  87148. for {
  87149. x, err := c.Do()
  87150. if err != nil {
  87151. return err
  87152. }
  87153. if err := f(x); err != nil {
  87154. return err
  87155. }
  87156. if x.NextPageToken == "" {
  87157. return nil
  87158. }
  87159. c.PageToken(x.NextPageToken)
  87160. }
  87161. }
  87162. // method id "compute.subnetworks.delete":
  87163. type SubnetworksDeleteCall struct {
  87164. s *Service
  87165. project string
  87166. region string
  87167. subnetwork string
  87168. urlParams_ gensupport.URLParams
  87169. ctx_ context.Context
  87170. header_ http.Header
  87171. }
  87172. // Delete: Deletes the specified subnetwork.
  87173. func (r *SubnetworksService) Delete(project string, region string, subnetwork string) *SubnetworksDeleteCall {
  87174. c := &SubnetworksDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  87175. c.project = project
  87176. c.region = region
  87177. c.subnetwork = subnetwork
  87178. return c
  87179. }
  87180. // RequestId sets the optional parameter "requestId": An optional
  87181. // request ID to identify requests. Specify a unique request ID so that
  87182. // if you must retry your request, the server will know to ignore the
  87183. // request if it has already been completed.
  87184. //
  87185. // For example, consider a situation where you make an initial request
  87186. // and the request times out. If you make the request again with the
  87187. // same request ID, the server can check if original operation with the
  87188. // same request ID was received, and if so, will ignore the second
  87189. // request. This prevents clients from accidentally creating duplicate
  87190. // commitments.
  87191. //
  87192. // The request ID must be a valid UUID with the exception that zero UUID
  87193. // is not supported (00000000-0000-0000-0000-000000000000).
  87194. func (c *SubnetworksDeleteCall) RequestId(requestId string) *SubnetworksDeleteCall {
  87195. c.urlParams_.Set("requestId", requestId)
  87196. return c
  87197. }
  87198. // Fields allows partial responses to be retrieved. See
  87199. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  87200. // for more information.
  87201. func (c *SubnetworksDeleteCall) Fields(s ...googleapi.Field) *SubnetworksDeleteCall {
  87202. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  87203. return c
  87204. }
  87205. // Context sets the context to be used in this call's Do method. Any
  87206. // pending HTTP request will be aborted if the provided context is
  87207. // canceled.
  87208. func (c *SubnetworksDeleteCall) Context(ctx context.Context) *SubnetworksDeleteCall {
  87209. c.ctx_ = ctx
  87210. return c
  87211. }
  87212. // Header returns an http.Header that can be modified by the caller to
  87213. // add HTTP headers to the request.
  87214. func (c *SubnetworksDeleteCall) Header() http.Header {
  87215. if c.header_ == nil {
  87216. c.header_ = make(http.Header)
  87217. }
  87218. return c.header_
  87219. }
  87220. func (c *SubnetworksDeleteCall) doRequest(alt string) (*http.Response, error) {
  87221. reqHeaders := make(http.Header)
  87222. for k, v := range c.header_ {
  87223. reqHeaders[k] = v
  87224. }
  87225. reqHeaders.Set("User-Agent", c.s.userAgent())
  87226. var body io.Reader = nil
  87227. c.urlParams_.Set("alt", alt)
  87228. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/subnetworks/{subnetwork}")
  87229. urls += "?" + c.urlParams_.Encode()
  87230. req, _ := http.NewRequest("DELETE", urls, body)
  87231. req.Header = reqHeaders
  87232. googleapi.Expand(req.URL, map[string]string{
  87233. "project": c.project,
  87234. "region": c.region,
  87235. "subnetwork": c.subnetwork,
  87236. })
  87237. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  87238. }
  87239. // Do executes the "compute.subnetworks.delete" call.
  87240. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  87241. // status code is an error. Response headers are in either
  87242. // *Operation.ServerResponse.Header or (if a response was returned at
  87243. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  87244. // to check whether the returned error was because
  87245. // http.StatusNotModified was returned.
  87246. func (c *SubnetworksDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  87247. gensupport.SetOptions(c.urlParams_, opts...)
  87248. res, err := c.doRequest("json")
  87249. if res != nil && res.StatusCode == http.StatusNotModified {
  87250. if res.Body != nil {
  87251. res.Body.Close()
  87252. }
  87253. return nil, &googleapi.Error{
  87254. Code: res.StatusCode,
  87255. Header: res.Header,
  87256. }
  87257. }
  87258. if err != nil {
  87259. return nil, err
  87260. }
  87261. defer googleapi.CloseBody(res)
  87262. if err := googleapi.CheckResponse(res); err != nil {
  87263. return nil, err
  87264. }
  87265. ret := &Operation{
  87266. ServerResponse: googleapi.ServerResponse{
  87267. Header: res.Header,
  87268. HTTPStatusCode: res.StatusCode,
  87269. },
  87270. }
  87271. target := &ret
  87272. if err := gensupport.DecodeResponse(target, res); err != nil {
  87273. return nil, err
  87274. }
  87275. return ret, nil
  87276. // {
  87277. // "description": "Deletes the specified subnetwork.",
  87278. // "httpMethod": "DELETE",
  87279. // "id": "compute.subnetworks.delete",
  87280. // "parameterOrder": [
  87281. // "project",
  87282. // "region",
  87283. // "subnetwork"
  87284. // ],
  87285. // "parameters": {
  87286. // "project": {
  87287. // "description": "Project ID for this request.",
  87288. // "location": "path",
  87289. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  87290. // "required": true,
  87291. // "type": "string"
  87292. // },
  87293. // "region": {
  87294. // "description": "Name of the region scoping this request.",
  87295. // "location": "path",
  87296. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  87297. // "required": true,
  87298. // "type": "string"
  87299. // },
  87300. // "requestId": {
  87301. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  87302. // "location": "query",
  87303. // "type": "string"
  87304. // },
  87305. // "subnetwork": {
  87306. // "description": "Name of the Subnetwork resource to delete.",
  87307. // "location": "path",
  87308. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  87309. // "required": true,
  87310. // "type": "string"
  87311. // }
  87312. // },
  87313. // "path": "{project}/regions/{region}/subnetworks/{subnetwork}",
  87314. // "response": {
  87315. // "$ref": "Operation"
  87316. // },
  87317. // "scopes": [
  87318. // "https://www.googleapis.com/auth/cloud-platform",
  87319. // "https://www.googleapis.com/auth/compute"
  87320. // ]
  87321. // }
  87322. }
  87323. // method id "compute.subnetworks.expandIpCidrRange":
  87324. type SubnetworksExpandIpCidrRangeCall struct {
  87325. s *Service
  87326. project string
  87327. region string
  87328. subnetwork string
  87329. subnetworksexpandipcidrrangerequest *SubnetworksExpandIpCidrRangeRequest
  87330. urlParams_ gensupport.URLParams
  87331. ctx_ context.Context
  87332. header_ http.Header
  87333. }
  87334. // ExpandIpCidrRange: Expands the IP CIDR range of the subnetwork to a
  87335. // specified value.
  87336. func (r *SubnetworksService) ExpandIpCidrRange(project string, region string, subnetwork string, subnetworksexpandipcidrrangerequest *SubnetworksExpandIpCidrRangeRequest) *SubnetworksExpandIpCidrRangeCall {
  87337. c := &SubnetworksExpandIpCidrRangeCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  87338. c.project = project
  87339. c.region = region
  87340. c.subnetwork = subnetwork
  87341. c.subnetworksexpandipcidrrangerequest = subnetworksexpandipcidrrangerequest
  87342. return c
  87343. }
  87344. // RequestId sets the optional parameter "requestId": An optional
  87345. // request ID to identify requests. Specify a unique request ID so that
  87346. // if you must retry your request, the server will know to ignore the
  87347. // request if it has already been completed.
  87348. //
  87349. // For example, consider a situation where you make an initial request
  87350. // and the request times out. If you make the request again with the
  87351. // same request ID, the server can check if original operation with the
  87352. // same request ID was received, and if so, will ignore the second
  87353. // request. This prevents clients from accidentally creating duplicate
  87354. // commitments.
  87355. //
  87356. // The request ID must be a valid UUID with the exception that zero UUID
  87357. // is not supported (00000000-0000-0000-0000-000000000000).
  87358. func (c *SubnetworksExpandIpCidrRangeCall) RequestId(requestId string) *SubnetworksExpandIpCidrRangeCall {
  87359. c.urlParams_.Set("requestId", requestId)
  87360. return c
  87361. }
  87362. // Fields allows partial responses to be retrieved. See
  87363. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  87364. // for more information.
  87365. func (c *SubnetworksExpandIpCidrRangeCall) Fields(s ...googleapi.Field) *SubnetworksExpandIpCidrRangeCall {
  87366. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  87367. return c
  87368. }
  87369. // Context sets the context to be used in this call's Do method. Any
  87370. // pending HTTP request will be aborted if the provided context is
  87371. // canceled.
  87372. func (c *SubnetworksExpandIpCidrRangeCall) Context(ctx context.Context) *SubnetworksExpandIpCidrRangeCall {
  87373. c.ctx_ = ctx
  87374. return c
  87375. }
  87376. // Header returns an http.Header that can be modified by the caller to
  87377. // add HTTP headers to the request.
  87378. func (c *SubnetworksExpandIpCidrRangeCall) Header() http.Header {
  87379. if c.header_ == nil {
  87380. c.header_ = make(http.Header)
  87381. }
  87382. return c.header_
  87383. }
  87384. func (c *SubnetworksExpandIpCidrRangeCall) doRequest(alt string) (*http.Response, error) {
  87385. reqHeaders := make(http.Header)
  87386. for k, v := range c.header_ {
  87387. reqHeaders[k] = v
  87388. }
  87389. reqHeaders.Set("User-Agent", c.s.userAgent())
  87390. var body io.Reader = nil
  87391. body, err := googleapi.WithoutDataWrapper.JSONReader(c.subnetworksexpandipcidrrangerequest)
  87392. if err != nil {
  87393. return nil, err
  87394. }
  87395. reqHeaders.Set("Content-Type", "application/json")
  87396. c.urlParams_.Set("alt", alt)
  87397. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/subnetworks/{subnetwork}/expandIpCidrRange")
  87398. urls += "?" + c.urlParams_.Encode()
  87399. req, _ := http.NewRequest("POST", urls, body)
  87400. req.Header = reqHeaders
  87401. googleapi.Expand(req.URL, map[string]string{
  87402. "project": c.project,
  87403. "region": c.region,
  87404. "subnetwork": c.subnetwork,
  87405. })
  87406. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  87407. }
  87408. // Do executes the "compute.subnetworks.expandIpCidrRange" call.
  87409. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  87410. // status code is an error. Response headers are in either
  87411. // *Operation.ServerResponse.Header or (if a response was returned at
  87412. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  87413. // to check whether the returned error was because
  87414. // http.StatusNotModified was returned.
  87415. func (c *SubnetworksExpandIpCidrRangeCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  87416. gensupport.SetOptions(c.urlParams_, opts...)
  87417. res, err := c.doRequest("json")
  87418. if res != nil && res.StatusCode == http.StatusNotModified {
  87419. if res.Body != nil {
  87420. res.Body.Close()
  87421. }
  87422. return nil, &googleapi.Error{
  87423. Code: res.StatusCode,
  87424. Header: res.Header,
  87425. }
  87426. }
  87427. if err != nil {
  87428. return nil, err
  87429. }
  87430. defer googleapi.CloseBody(res)
  87431. if err := googleapi.CheckResponse(res); err != nil {
  87432. return nil, err
  87433. }
  87434. ret := &Operation{
  87435. ServerResponse: googleapi.ServerResponse{
  87436. Header: res.Header,
  87437. HTTPStatusCode: res.StatusCode,
  87438. },
  87439. }
  87440. target := &ret
  87441. if err := gensupport.DecodeResponse(target, res); err != nil {
  87442. return nil, err
  87443. }
  87444. return ret, nil
  87445. // {
  87446. // "description": "Expands the IP CIDR range of the subnetwork to a specified value.",
  87447. // "httpMethod": "POST",
  87448. // "id": "compute.subnetworks.expandIpCidrRange",
  87449. // "parameterOrder": [
  87450. // "project",
  87451. // "region",
  87452. // "subnetwork"
  87453. // ],
  87454. // "parameters": {
  87455. // "project": {
  87456. // "description": "Project ID for this request.",
  87457. // "location": "path",
  87458. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  87459. // "required": true,
  87460. // "type": "string"
  87461. // },
  87462. // "region": {
  87463. // "description": "Name of the region scoping this request.",
  87464. // "location": "path",
  87465. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  87466. // "required": true,
  87467. // "type": "string"
  87468. // },
  87469. // "requestId": {
  87470. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  87471. // "location": "query",
  87472. // "type": "string"
  87473. // },
  87474. // "subnetwork": {
  87475. // "description": "Name of the Subnetwork resource to update.",
  87476. // "location": "path",
  87477. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  87478. // "required": true,
  87479. // "type": "string"
  87480. // }
  87481. // },
  87482. // "path": "{project}/regions/{region}/subnetworks/{subnetwork}/expandIpCidrRange",
  87483. // "request": {
  87484. // "$ref": "SubnetworksExpandIpCidrRangeRequest"
  87485. // },
  87486. // "response": {
  87487. // "$ref": "Operation"
  87488. // },
  87489. // "scopes": [
  87490. // "https://www.googleapis.com/auth/cloud-platform",
  87491. // "https://www.googleapis.com/auth/compute"
  87492. // ]
  87493. // }
  87494. }
  87495. // method id "compute.subnetworks.get":
  87496. type SubnetworksGetCall struct {
  87497. s *Service
  87498. project string
  87499. region string
  87500. subnetwork string
  87501. urlParams_ gensupport.URLParams
  87502. ifNoneMatch_ string
  87503. ctx_ context.Context
  87504. header_ http.Header
  87505. }
  87506. // Get: Returns the specified subnetwork. Gets a list of available
  87507. // subnetworks list() request.
  87508. func (r *SubnetworksService) Get(project string, region string, subnetwork string) *SubnetworksGetCall {
  87509. c := &SubnetworksGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  87510. c.project = project
  87511. c.region = region
  87512. c.subnetwork = subnetwork
  87513. return c
  87514. }
  87515. // Fields allows partial responses to be retrieved. See
  87516. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  87517. // for more information.
  87518. func (c *SubnetworksGetCall) Fields(s ...googleapi.Field) *SubnetworksGetCall {
  87519. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  87520. return c
  87521. }
  87522. // IfNoneMatch sets the optional parameter which makes the operation
  87523. // fail if the object's ETag matches the given value. This is useful for
  87524. // getting updates only after the object has changed since the last
  87525. // request. Use googleapi.IsNotModified to check whether the response
  87526. // error from Do is the result of In-None-Match.
  87527. func (c *SubnetworksGetCall) IfNoneMatch(entityTag string) *SubnetworksGetCall {
  87528. c.ifNoneMatch_ = entityTag
  87529. return c
  87530. }
  87531. // Context sets the context to be used in this call's Do method. Any
  87532. // pending HTTP request will be aborted if the provided context is
  87533. // canceled.
  87534. func (c *SubnetworksGetCall) Context(ctx context.Context) *SubnetworksGetCall {
  87535. c.ctx_ = ctx
  87536. return c
  87537. }
  87538. // Header returns an http.Header that can be modified by the caller to
  87539. // add HTTP headers to the request.
  87540. func (c *SubnetworksGetCall) Header() http.Header {
  87541. if c.header_ == nil {
  87542. c.header_ = make(http.Header)
  87543. }
  87544. return c.header_
  87545. }
  87546. func (c *SubnetworksGetCall) doRequest(alt string) (*http.Response, error) {
  87547. reqHeaders := make(http.Header)
  87548. for k, v := range c.header_ {
  87549. reqHeaders[k] = v
  87550. }
  87551. reqHeaders.Set("User-Agent", c.s.userAgent())
  87552. if c.ifNoneMatch_ != "" {
  87553. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  87554. }
  87555. var body io.Reader = nil
  87556. c.urlParams_.Set("alt", alt)
  87557. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/subnetworks/{subnetwork}")
  87558. urls += "?" + c.urlParams_.Encode()
  87559. req, _ := http.NewRequest("GET", urls, body)
  87560. req.Header = reqHeaders
  87561. googleapi.Expand(req.URL, map[string]string{
  87562. "project": c.project,
  87563. "region": c.region,
  87564. "subnetwork": c.subnetwork,
  87565. })
  87566. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  87567. }
  87568. // Do executes the "compute.subnetworks.get" call.
  87569. // Exactly one of *Subnetwork or error will be non-nil. Any non-2xx
  87570. // status code is an error. Response headers are in either
  87571. // *Subnetwork.ServerResponse.Header or (if a response was returned at
  87572. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  87573. // to check whether the returned error was because
  87574. // http.StatusNotModified was returned.
  87575. func (c *SubnetworksGetCall) Do(opts ...googleapi.CallOption) (*Subnetwork, error) {
  87576. gensupport.SetOptions(c.urlParams_, opts...)
  87577. res, err := c.doRequest("json")
  87578. if res != nil && res.StatusCode == http.StatusNotModified {
  87579. if res.Body != nil {
  87580. res.Body.Close()
  87581. }
  87582. return nil, &googleapi.Error{
  87583. Code: res.StatusCode,
  87584. Header: res.Header,
  87585. }
  87586. }
  87587. if err != nil {
  87588. return nil, err
  87589. }
  87590. defer googleapi.CloseBody(res)
  87591. if err := googleapi.CheckResponse(res); err != nil {
  87592. return nil, err
  87593. }
  87594. ret := &Subnetwork{
  87595. ServerResponse: googleapi.ServerResponse{
  87596. Header: res.Header,
  87597. HTTPStatusCode: res.StatusCode,
  87598. },
  87599. }
  87600. target := &ret
  87601. if err := gensupport.DecodeResponse(target, res); err != nil {
  87602. return nil, err
  87603. }
  87604. return ret, nil
  87605. // {
  87606. // "description": "Returns the specified subnetwork. Gets a list of available subnetworks list() request.",
  87607. // "httpMethod": "GET",
  87608. // "id": "compute.subnetworks.get",
  87609. // "parameterOrder": [
  87610. // "project",
  87611. // "region",
  87612. // "subnetwork"
  87613. // ],
  87614. // "parameters": {
  87615. // "project": {
  87616. // "description": "Project ID for this request.",
  87617. // "location": "path",
  87618. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  87619. // "required": true,
  87620. // "type": "string"
  87621. // },
  87622. // "region": {
  87623. // "description": "Name of the region scoping this request.",
  87624. // "location": "path",
  87625. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  87626. // "required": true,
  87627. // "type": "string"
  87628. // },
  87629. // "subnetwork": {
  87630. // "description": "Name of the Subnetwork resource to return.",
  87631. // "location": "path",
  87632. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  87633. // "required": true,
  87634. // "type": "string"
  87635. // }
  87636. // },
  87637. // "path": "{project}/regions/{region}/subnetworks/{subnetwork}",
  87638. // "response": {
  87639. // "$ref": "Subnetwork"
  87640. // },
  87641. // "scopes": [
  87642. // "https://www.googleapis.com/auth/cloud-platform",
  87643. // "https://www.googleapis.com/auth/compute",
  87644. // "https://www.googleapis.com/auth/compute.readonly"
  87645. // ]
  87646. // }
  87647. }
  87648. // method id "compute.subnetworks.getIamPolicy":
  87649. type SubnetworksGetIamPolicyCall struct {
  87650. s *Service
  87651. project string
  87652. region string
  87653. resource string
  87654. urlParams_ gensupport.URLParams
  87655. ifNoneMatch_ string
  87656. ctx_ context.Context
  87657. header_ http.Header
  87658. }
  87659. // GetIamPolicy: Gets the access control policy for a resource. May be
  87660. // empty if no such policy or resource exists.
  87661. func (r *SubnetworksService) GetIamPolicy(project string, region string, resource string) *SubnetworksGetIamPolicyCall {
  87662. c := &SubnetworksGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  87663. c.project = project
  87664. c.region = region
  87665. c.resource = resource
  87666. return c
  87667. }
  87668. // Fields allows partial responses to be retrieved. See
  87669. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  87670. // for more information.
  87671. func (c *SubnetworksGetIamPolicyCall) Fields(s ...googleapi.Field) *SubnetworksGetIamPolicyCall {
  87672. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  87673. return c
  87674. }
  87675. // IfNoneMatch sets the optional parameter which makes the operation
  87676. // fail if the object's ETag matches the given value. This is useful for
  87677. // getting updates only after the object has changed since the last
  87678. // request. Use googleapi.IsNotModified to check whether the response
  87679. // error from Do is the result of In-None-Match.
  87680. func (c *SubnetworksGetIamPolicyCall) IfNoneMatch(entityTag string) *SubnetworksGetIamPolicyCall {
  87681. c.ifNoneMatch_ = entityTag
  87682. return c
  87683. }
  87684. // Context sets the context to be used in this call's Do method. Any
  87685. // pending HTTP request will be aborted if the provided context is
  87686. // canceled.
  87687. func (c *SubnetworksGetIamPolicyCall) Context(ctx context.Context) *SubnetworksGetIamPolicyCall {
  87688. c.ctx_ = ctx
  87689. return c
  87690. }
  87691. // Header returns an http.Header that can be modified by the caller to
  87692. // add HTTP headers to the request.
  87693. func (c *SubnetworksGetIamPolicyCall) Header() http.Header {
  87694. if c.header_ == nil {
  87695. c.header_ = make(http.Header)
  87696. }
  87697. return c.header_
  87698. }
  87699. func (c *SubnetworksGetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  87700. reqHeaders := make(http.Header)
  87701. for k, v := range c.header_ {
  87702. reqHeaders[k] = v
  87703. }
  87704. reqHeaders.Set("User-Agent", c.s.userAgent())
  87705. if c.ifNoneMatch_ != "" {
  87706. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  87707. }
  87708. var body io.Reader = nil
  87709. c.urlParams_.Set("alt", alt)
  87710. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/subnetworks/{resource}/getIamPolicy")
  87711. urls += "?" + c.urlParams_.Encode()
  87712. req, _ := http.NewRequest("GET", urls, body)
  87713. req.Header = reqHeaders
  87714. googleapi.Expand(req.URL, map[string]string{
  87715. "project": c.project,
  87716. "region": c.region,
  87717. "resource": c.resource,
  87718. })
  87719. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  87720. }
  87721. // Do executes the "compute.subnetworks.getIamPolicy" call.
  87722. // Exactly one of *Policy or error will be non-nil. Any non-2xx status
  87723. // code is an error. Response headers are in either
  87724. // *Policy.ServerResponse.Header or (if a response was returned at all)
  87725. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  87726. // check whether the returned error was because http.StatusNotModified
  87727. // was returned.
  87728. func (c *SubnetworksGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  87729. gensupport.SetOptions(c.urlParams_, opts...)
  87730. res, err := c.doRequest("json")
  87731. if res != nil && res.StatusCode == http.StatusNotModified {
  87732. if res.Body != nil {
  87733. res.Body.Close()
  87734. }
  87735. return nil, &googleapi.Error{
  87736. Code: res.StatusCode,
  87737. Header: res.Header,
  87738. }
  87739. }
  87740. if err != nil {
  87741. return nil, err
  87742. }
  87743. defer googleapi.CloseBody(res)
  87744. if err := googleapi.CheckResponse(res); err != nil {
  87745. return nil, err
  87746. }
  87747. ret := &Policy{
  87748. ServerResponse: googleapi.ServerResponse{
  87749. Header: res.Header,
  87750. HTTPStatusCode: res.StatusCode,
  87751. },
  87752. }
  87753. target := &ret
  87754. if err := gensupport.DecodeResponse(target, res); err != nil {
  87755. return nil, err
  87756. }
  87757. return ret, nil
  87758. // {
  87759. // "description": "Gets the access control policy for a resource. May be empty if no such policy or resource exists.",
  87760. // "httpMethod": "GET",
  87761. // "id": "compute.subnetworks.getIamPolicy",
  87762. // "parameterOrder": [
  87763. // "project",
  87764. // "region",
  87765. // "resource"
  87766. // ],
  87767. // "parameters": {
  87768. // "project": {
  87769. // "description": "Project ID for this request.",
  87770. // "location": "path",
  87771. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  87772. // "required": true,
  87773. // "type": "string"
  87774. // },
  87775. // "region": {
  87776. // "description": "The name of the region for this request.",
  87777. // "location": "path",
  87778. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  87779. // "required": true,
  87780. // "type": "string"
  87781. // },
  87782. // "resource": {
  87783. // "description": "Name of the resource for this request.",
  87784. // "location": "path",
  87785. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  87786. // "required": true,
  87787. // "type": "string"
  87788. // }
  87789. // },
  87790. // "path": "{project}/regions/{region}/subnetworks/{resource}/getIamPolicy",
  87791. // "response": {
  87792. // "$ref": "Policy"
  87793. // },
  87794. // "scopes": [
  87795. // "https://www.googleapis.com/auth/cloud-platform",
  87796. // "https://www.googleapis.com/auth/compute",
  87797. // "https://www.googleapis.com/auth/compute.readonly"
  87798. // ]
  87799. // }
  87800. }
  87801. // method id "compute.subnetworks.insert":
  87802. type SubnetworksInsertCall struct {
  87803. s *Service
  87804. project string
  87805. region string
  87806. subnetwork *Subnetwork
  87807. urlParams_ gensupport.URLParams
  87808. ctx_ context.Context
  87809. header_ http.Header
  87810. }
  87811. // Insert: Creates a subnetwork in the specified project using the data
  87812. // included in the request.
  87813. func (r *SubnetworksService) Insert(project string, region string, subnetwork *Subnetwork) *SubnetworksInsertCall {
  87814. c := &SubnetworksInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  87815. c.project = project
  87816. c.region = region
  87817. c.subnetwork = subnetwork
  87818. return c
  87819. }
  87820. // RequestId sets the optional parameter "requestId": An optional
  87821. // request ID to identify requests. Specify a unique request ID so that
  87822. // if you must retry your request, the server will know to ignore the
  87823. // request if it has already been completed.
  87824. //
  87825. // For example, consider a situation where you make an initial request
  87826. // and the request times out. If you make the request again with the
  87827. // same request ID, the server can check if original operation with the
  87828. // same request ID was received, and if so, will ignore the second
  87829. // request. This prevents clients from accidentally creating duplicate
  87830. // commitments.
  87831. //
  87832. // The request ID must be a valid UUID with the exception that zero UUID
  87833. // is not supported (00000000-0000-0000-0000-000000000000).
  87834. func (c *SubnetworksInsertCall) RequestId(requestId string) *SubnetworksInsertCall {
  87835. c.urlParams_.Set("requestId", requestId)
  87836. return c
  87837. }
  87838. // Fields allows partial responses to be retrieved. See
  87839. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  87840. // for more information.
  87841. func (c *SubnetworksInsertCall) Fields(s ...googleapi.Field) *SubnetworksInsertCall {
  87842. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  87843. return c
  87844. }
  87845. // Context sets the context to be used in this call's Do method. Any
  87846. // pending HTTP request will be aborted if the provided context is
  87847. // canceled.
  87848. func (c *SubnetworksInsertCall) Context(ctx context.Context) *SubnetworksInsertCall {
  87849. c.ctx_ = ctx
  87850. return c
  87851. }
  87852. // Header returns an http.Header that can be modified by the caller to
  87853. // add HTTP headers to the request.
  87854. func (c *SubnetworksInsertCall) Header() http.Header {
  87855. if c.header_ == nil {
  87856. c.header_ = make(http.Header)
  87857. }
  87858. return c.header_
  87859. }
  87860. func (c *SubnetworksInsertCall) doRequest(alt string) (*http.Response, error) {
  87861. reqHeaders := make(http.Header)
  87862. for k, v := range c.header_ {
  87863. reqHeaders[k] = v
  87864. }
  87865. reqHeaders.Set("User-Agent", c.s.userAgent())
  87866. var body io.Reader = nil
  87867. body, err := googleapi.WithoutDataWrapper.JSONReader(c.subnetwork)
  87868. if err != nil {
  87869. return nil, err
  87870. }
  87871. reqHeaders.Set("Content-Type", "application/json")
  87872. c.urlParams_.Set("alt", alt)
  87873. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/subnetworks")
  87874. urls += "?" + c.urlParams_.Encode()
  87875. req, _ := http.NewRequest("POST", urls, body)
  87876. req.Header = reqHeaders
  87877. googleapi.Expand(req.URL, map[string]string{
  87878. "project": c.project,
  87879. "region": c.region,
  87880. })
  87881. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  87882. }
  87883. // Do executes the "compute.subnetworks.insert" call.
  87884. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  87885. // status code is an error. Response headers are in either
  87886. // *Operation.ServerResponse.Header or (if a response was returned at
  87887. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  87888. // to check whether the returned error was because
  87889. // http.StatusNotModified was returned.
  87890. func (c *SubnetworksInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  87891. gensupport.SetOptions(c.urlParams_, opts...)
  87892. res, err := c.doRequest("json")
  87893. if res != nil && res.StatusCode == http.StatusNotModified {
  87894. if res.Body != nil {
  87895. res.Body.Close()
  87896. }
  87897. return nil, &googleapi.Error{
  87898. Code: res.StatusCode,
  87899. Header: res.Header,
  87900. }
  87901. }
  87902. if err != nil {
  87903. return nil, err
  87904. }
  87905. defer googleapi.CloseBody(res)
  87906. if err := googleapi.CheckResponse(res); err != nil {
  87907. return nil, err
  87908. }
  87909. ret := &Operation{
  87910. ServerResponse: googleapi.ServerResponse{
  87911. Header: res.Header,
  87912. HTTPStatusCode: res.StatusCode,
  87913. },
  87914. }
  87915. target := &ret
  87916. if err := gensupport.DecodeResponse(target, res); err != nil {
  87917. return nil, err
  87918. }
  87919. return ret, nil
  87920. // {
  87921. // "description": "Creates a subnetwork in the specified project using the data included in the request.",
  87922. // "httpMethod": "POST",
  87923. // "id": "compute.subnetworks.insert",
  87924. // "parameterOrder": [
  87925. // "project",
  87926. // "region"
  87927. // ],
  87928. // "parameters": {
  87929. // "project": {
  87930. // "description": "Project ID for this request.",
  87931. // "location": "path",
  87932. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  87933. // "required": true,
  87934. // "type": "string"
  87935. // },
  87936. // "region": {
  87937. // "description": "Name of the region scoping this request.",
  87938. // "location": "path",
  87939. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  87940. // "required": true,
  87941. // "type": "string"
  87942. // },
  87943. // "requestId": {
  87944. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  87945. // "location": "query",
  87946. // "type": "string"
  87947. // }
  87948. // },
  87949. // "path": "{project}/regions/{region}/subnetworks",
  87950. // "request": {
  87951. // "$ref": "Subnetwork"
  87952. // },
  87953. // "response": {
  87954. // "$ref": "Operation"
  87955. // },
  87956. // "scopes": [
  87957. // "https://www.googleapis.com/auth/cloud-platform",
  87958. // "https://www.googleapis.com/auth/compute"
  87959. // ]
  87960. // }
  87961. }
  87962. // method id "compute.subnetworks.list":
  87963. type SubnetworksListCall struct {
  87964. s *Service
  87965. project string
  87966. region string
  87967. urlParams_ gensupport.URLParams
  87968. ifNoneMatch_ string
  87969. ctx_ context.Context
  87970. header_ http.Header
  87971. }
  87972. // List: Retrieves a list of subnetworks available to the specified
  87973. // project.
  87974. func (r *SubnetworksService) List(project string, region string) *SubnetworksListCall {
  87975. c := &SubnetworksListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  87976. c.project = project
  87977. c.region = region
  87978. return c
  87979. }
  87980. // Filter sets the optional parameter "filter": A filter expression that
  87981. // filters resources listed in the response. The expression must specify
  87982. // the field name, a comparison operator, and the value that you want to
  87983. // use for filtering. The value must be a string, a number, or a
  87984. // boolean. The comparison operator must be either =, !=, >, or <.
  87985. //
  87986. // For example, if you are filtering Compute Engine instances, you can
  87987. // exclude instances named example-instance by specifying name !=
  87988. // example-instance.
  87989. //
  87990. // You can also filter nested fields. For example, you could specify
  87991. // scheduling.automaticRestart = false to include instances only if they
  87992. // are not scheduled for automatic restarts. You can use filtering on
  87993. // nested fields to filter based on resource labels.
  87994. //
  87995. // To filter on multiple expressions, provide each separate expression
  87996. // within parentheses. For example, (scheduling.automaticRestart = true)
  87997. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  87998. // AND expression. However, you can include AND and OR expressions
  87999. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  88000. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  88001. // true).
  88002. func (c *SubnetworksListCall) Filter(filter string) *SubnetworksListCall {
  88003. c.urlParams_.Set("filter", filter)
  88004. return c
  88005. }
  88006. // MaxResults sets the optional parameter "maxResults": The maximum
  88007. // number of results per page that should be returned. If the number of
  88008. // available results is larger than maxResults, Compute Engine returns a
  88009. // nextPageToken that can be used to get the next page of results in
  88010. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  88011. // (Default: 500)
  88012. func (c *SubnetworksListCall) MaxResults(maxResults int64) *SubnetworksListCall {
  88013. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  88014. return c
  88015. }
  88016. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  88017. // a certain order. By default, results are returned in alphanumerical
  88018. // order based on the resource name.
  88019. //
  88020. // You can also sort results in descending order based on the creation
  88021. // timestamp using orderBy="creationTimestamp desc". This sorts results
  88022. // based on the creationTimestamp field in reverse chronological order
  88023. // (newest result first). Use this to sort resources like operations so
  88024. // that the newest operation is returned first.
  88025. //
  88026. // Currently, only sorting by name or creationTimestamp desc is
  88027. // supported.
  88028. func (c *SubnetworksListCall) OrderBy(orderBy string) *SubnetworksListCall {
  88029. c.urlParams_.Set("orderBy", orderBy)
  88030. return c
  88031. }
  88032. // PageToken sets the optional parameter "pageToken": Specifies a page
  88033. // token to use. Set pageToken to the nextPageToken returned by a
  88034. // previous list request to get the next page of results.
  88035. func (c *SubnetworksListCall) PageToken(pageToken string) *SubnetworksListCall {
  88036. c.urlParams_.Set("pageToken", pageToken)
  88037. return c
  88038. }
  88039. // Fields allows partial responses to be retrieved. See
  88040. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  88041. // for more information.
  88042. func (c *SubnetworksListCall) Fields(s ...googleapi.Field) *SubnetworksListCall {
  88043. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  88044. return c
  88045. }
  88046. // IfNoneMatch sets the optional parameter which makes the operation
  88047. // fail if the object's ETag matches the given value. This is useful for
  88048. // getting updates only after the object has changed since the last
  88049. // request. Use googleapi.IsNotModified to check whether the response
  88050. // error from Do is the result of In-None-Match.
  88051. func (c *SubnetworksListCall) IfNoneMatch(entityTag string) *SubnetworksListCall {
  88052. c.ifNoneMatch_ = entityTag
  88053. return c
  88054. }
  88055. // Context sets the context to be used in this call's Do method. Any
  88056. // pending HTTP request will be aborted if the provided context is
  88057. // canceled.
  88058. func (c *SubnetworksListCall) Context(ctx context.Context) *SubnetworksListCall {
  88059. c.ctx_ = ctx
  88060. return c
  88061. }
  88062. // Header returns an http.Header that can be modified by the caller to
  88063. // add HTTP headers to the request.
  88064. func (c *SubnetworksListCall) Header() http.Header {
  88065. if c.header_ == nil {
  88066. c.header_ = make(http.Header)
  88067. }
  88068. return c.header_
  88069. }
  88070. func (c *SubnetworksListCall) doRequest(alt string) (*http.Response, error) {
  88071. reqHeaders := make(http.Header)
  88072. for k, v := range c.header_ {
  88073. reqHeaders[k] = v
  88074. }
  88075. reqHeaders.Set("User-Agent", c.s.userAgent())
  88076. if c.ifNoneMatch_ != "" {
  88077. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  88078. }
  88079. var body io.Reader = nil
  88080. c.urlParams_.Set("alt", alt)
  88081. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/subnetworks")
  88082. urls += "?" + c.urlParams_.Encode()
  88083. req, _ := http.NewRequest("GET", urls, body)
  88084. req.Header = reqHeaders
  88085. googleapi.Expand(req.URL, map[string]string{
  88086. "project": c.project,
  88087. "region": c.region,
  88088. })
  88089. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  88090. }
  88091. // Do executes the "compute.subnetworks.list" call.
  88092. // Exactly one of *SubnetworkList or error will be non-nil. Any non-2xx
  88093. // status code is an error. Response headers are in either
  88094. // *SubnetworkList.ServerResponse.Header or (if a response was returned
  88095. // at all) in error.(*googleapi.Error).Header. Use
  88096. // googleapi.IsNotModified to check whether the returned error was
  88097. // because http.StatusNotModified was returned.
  88098. func (c *SubnetworksListCall) Do(opts ...googleapi.CallOption) (*SubnetworkList, error) {
  88099. gensupport.SetOptions(c.urlParams_, opts...)
  88100. res, err := c.doRequest("json")
  88101. if res != nil && res.StatusCode == http.StatusNotModified {
  88102. if res.Body != nil {
  88103. res.Body.Close()
  88104. }
  88105. return nil, &googleapi.Error{
  88106. Code: res.StatusCode,
  88107. Header: res.Header,
  88108. }
  88109. }
  88110. if err != nil {
  88111. return nil, err
  88112. }
  88113. defer googleapi.CloseBody(res)
  88114. if err := googleapi.CheckResponse(res); err != nil {
  88115. return nil, err
  88116. }
  88117. ret := &SubnetworkList{
  88118. ServerResponse: googleapi.ServerResponse{
  88119. Header: res.Header,
  88120. HTTPStatusCode: res.StatusCode,
  88121. },
  88122. }
  88123. target := &ret
  88124. if err := gensupport.DecodeResponse(target, res); err != nil {
  88125. return nil, err
  88126. }
  88127. return ret, nil
  88128. // {
  88129. // "description": "Retrieves a list of subnetworks available to the specified project.",
  88130. // "httpMethod": "GET",
  88131. // "id": "compute.subnetworks.list",
  88132. // "parameterOrder": [
  88133. // "project",
  88134. // "region"
  88135. // ],
  88136. // "parameters": {
  88137. // "filter": {
  88138. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  88139. // "location": "query",
  88140. // "type": "string"
  88141. // },
  88142. // "maxResults": {
  88143. // "default": "500",
  88144. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  88145. // "format": "uint32",
  88146. // "location": "query",
  88147. // "minimum": "0",
  88148. // "type": "integer"
  88149. // },
  88150. // "orderBy": {
  88151. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  88152. // "location": "query",
  88153. // "type": "string"
  88154. // },
  88155. // "pageToken": {
  88156. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  88157. // "location": "query",
  88158. // "type": "string"
  88159. // },
  88160. // "project": {
  88161. // "description": "Project ID for this request.",
  88162. // "location": "path",
  88163. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  88164. // "required": true,
  88165. // "type": "string"
  88166. // },
  88167. // "region": {
  88168. // "description": "Name of the region scoping this request.",
  88169. // "location": "path",
  88170. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  88171. // "required": true,
  88172. // "type": "string"
  88173. // }
  88174. // },
  88175. // "path": "{project}/regions/{region}/subnetworks",
  88176. // "response": {
  88177. // "$ref": "SubnetworkList"
  88178. // },
  88179. // "scopes": [
  88180. // "https://www.googleapis.com/auth/cloud-platform",
  88181. // "https://www.googleapis.com/auth/compute",
  88182. // "https://www.googleapis.com/auth/compute.readonly"
  88183. // ]
  88184. // }
  88185. }
  88186. // Pages invokes f for each page of results.
  88187. // A non-nil error returned from f will halt the iteration.
  88188. // The provided context supersedes any context provided to the Context method.
  88189. func (c *SubnetworksListCall) Pages(ctx context.Context, f func(*SubnetworkList) error) error {
  88190. c.ctx_ = ctx
  88191. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  88192. for {
  88193. x, err := c.Do()
  88194. if err != nil {
  88195. return err
  88196. }
  88197. if err := f(x); err != nil {
  88198. return err
  88199. }
  88200. if x.NextPageToken == "" {
  88201. return nil
  88202. }
  88203. c.PageToken(x.NextPageToken)
  88204. }
  88205. }
  88206. // method id "compute.subnetworks.listUsable":
  88207. type SubnetworksListUsableCall struct {
  88208. s *Service
  88209. project string
  88210. urlParams_ gensupport.URLParams
  88211. ifNoneMatch_ string
  88212. ctx_ context.Context
  88213. header_ http.Header
  88214. }
  88215. // ListUsable: Retrieves an aggregated list of usable subnetworks.
  88216. func (r *SubnetworksService) ListUsable(project string) *SubnetworksListUsableCall {
  88217. c := &SubnetworksListUsableCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  88218. c.project = project
  88219. return c
  88220. }
  88221. // Filter sets the optional parameter "filter": A filter expression that
  88222. // filters resources listed in the response. The expression must specify
  88223. // the field name, a comparison operator, and the value that you want to
  88224. // use for filtering. The value must be a string, a number, or a
  88225. // boolean. The comparison operator must be either =, !=, >, or <.
  88226. //
  88227. // For example, if you are filtering Compute Engine instances, you can
  88228. // exclude instances named example-instance by specifying name !=
  88229. // example-instance.
  88230. //
  88231. // You can also filter nested fields. For example, you could specify
  88232. // scheduling.automaticRestart = false to include instances only if they
  88233. // are not scheduled for automatic restarts. You can use filtering on
  88234. // nested fields to filter based on resource labels.
  88235. //
  88236. // To filter on multiple expressions, provide each separate expression
  88237. // within parentheses. For example, (scheduling.automaticRestart = true)
  88238. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  88239. // AND expression. However, you can include AND and OR expressions
  88240. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  88241. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  88242. // true).
  88243. func (c *SubnetworksListUsableCall) Filter(filter string) *SubnetworksListUsableCall {
  88244. c.urlParams_.Set("filter", filter)
  88245. return c
  88246. }
  88247. // MaxResults sets the optional parameter "maxResults": The maximum
  88248. // number of results per page that should be returned. If the number of
  88249. // available results is larger than maxResults, Compute Engine returns a
  88250. // nextPageToken that can be used to get the next page of results in
  88251. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  88252. // (Default: 500)
  88253. func (c *SubnetworksListUsableCall) MaxResults(maxResults int64) *SubnetworksListUsableCall {
  88254. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  88255. return c
  88256. }
  88257. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  88258. // a certain order. By default, results are returned in alphanumerical
  88259. // order based on the resource name.
  88260. //
  88261. // You can also sort results in descending order based on the creation
  88262. // timestamp using orderBy="creationTimestamp desc". This sorts results
  88263. // based on the creationTimestamp field in reverse chronological order
  88264. // (newest result first). Use this to sort resources like operations so
  88265. // that the newest operation is returned first.
  88266. //
  88267. // Currently, only sorting by name or creationTimestamp desc is
  88268. // supported.
  88269. func (c *SubnetworksListUsableCall) OrderBy(orderBy string) *SubnetworksListUsableCall {
  88270. c.urlParams_.Set("orderBy", orderBy)
  88271. return c
  88272. }
  88273. // PageToken sets the optional parameter "pageToken": Specifies a page
  88274. // token to use. Set pageToken to the nextPageToken returned by a
  88275. // previous list request to get the next page of results.
  88276. func (c *SubnetworksListUsableCall) PageToken(pageToken string) *SubnetworksListUsableCall {
  88277. c.urlParams_.Set("pageToken", pageToken)
  88278. return c
  88279. }
  88280. // Fields allows partial responses to be retrieved. See
  88281. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  88282. // for more information.
  88283. func (c *SubnetworksListUsableCall) Fields(s ...googleapi.Field) *SubnetworksListUsableCall {
  88284. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  88285. return c
  88286. }
  88287. // IfNoneMatch sets the optional parameter which makes the operation
  88288. // fail if the object's ETag matches the given value. This is useful for
  88289. // getting updates only after the object has changed since the last
  88290. // request. Use googleapi.IsNotModified to check whether the response
  88291. // error from Do is the result of In-None-Match.
  88292. func (c *SubnetworksListUsableCall) IfNoneMatch(entityTag string) *SubnetworksListUsableCall {
  88293. c.ifNoneMatch_ = entityTag
  88294. return c
  88295. }
  88296. // Context sets the context to be used in this call's Do method. Any
  88297. // pending HTTP request will be aborted if the provided context is
  88298. // canceled.
  88299. func (c *SubnetworksListUsableCall) Context(ctx context.Context) *SubnetworksListUsableCall {
  88300. c.ctx_ = ctx
  88301. return c
  88302. }
  88303. // Header returns an http.Header that can be modified by the caller to
  88304. // add HTTP headers to the request.
  88305. func (c *SubnetworksListUsableCall) Header() http.Header {
  88306. if c.header_ == nil {
  88307. c.header_ = make(http.Header)
  88308. }
  88309. return c.header_
  88310. }
  88311. func (c *SubnetworksListUsableCall) doRequest(alt string) (*http.Response, error) {
  88312. reqHeaders := make(http.Header)
  88313. for k, v := range c.header_ {
  88314. reqHeaders[k] = v
  88315. }
  88316. reqHeaders.Set("User-Agent", c.s.userAgent())
  88317. if c.ifNoneMatch_ != "" {
  88318. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  88319. }
  88320. var body io.Reader = nil
  88321. c.urlParams_.Set("alt", alt)
  88322. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/subnetworks/listUsable")
  88323. urls += "?" + c.urlParams_.Encode()
  88324. req, _ := http.NewRequest("GET", urls, body)
  88325. req.Header = reqHeaders
  88326. googleapi.Expand(req.URL, map[string]string{
  88327. "project": c.project,
  88328. })
  88329. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  88330. }
  88331. // Do executes the "compute.subnetworks.listUsable" call.
  88332. // Exactly one of *UsableSubnetworksAggregatedList or error will be
  88333. // non-nil. Any non-2xx status code is an error. Response headers are in
  88334. // either *UsableSubnetworksAggregatedList.ServerResponse.Header or (if
  88335. // a response was returned at all) in error.(*googleapi.Error).Header.
  88336. // Use googleapi.IsNotModified to check whether the returned error was
  88337. // because http.StatusNotModified was returned.
  88338. func (c *SubnetworksListUsableCall) Do(opts ...googleapi.CallOption) (*UsableSubnetworksAggregatedList, error) {
  88339. gensupport.SetOptions(c.urlParams_, opts...)
  88340. res, err := c.doRequest("json")
  88341. if res != nil && res.StatusCode == http.StatusNotModified {
  88342. if res.Body != nil {
  88343. res.Body.Close()
  88344. }
  88345. return nil, &googleapi.Error{
  88346. Code: res.StatusCode,
  88347. Header: res.Header,
  88348. }
  88349. }
  88350. if err != nil {
  88351. return nil, err
  88352. }
  88353. defer googleapi.CloseBody(res)
  88354. if err := googleapi.CheckResponse(res); err != nil {
  88355. return nil, err
  88356. }
  88357. ret := &UsableSubnetworksAggregatedList{
  88358. ServerResponse: googleapi.ServerResponse{
  88359. Header: res.Header,
  88360. HTTPStatusCode: res.StatusCode,
  88361. },
  88362. }
  88363. target := &ret
  88364. if err := gensupport.DecodeResponse(target, res); err != nil {
  88365. return nil, err
  88366. }
  88367. return ret, nil
  88368. // {
  88369. // "description": "Retrieves an aggregated list of usable subnetworks.",
  88370. // "httpMethod": "GET",
  88371. // "id": "compute.subnetworks.listUsable",
  88372. // "parameterOrder": [
  88373. // "project"
  88374. // ],
  88375. // "parameters": {
  88376. // "filter": {
  88377. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  88378. // "location": "query",
  88379. // "type": "string"
  88380. // },
  88381. // "maxResults": {
  88382. // "default": "500",
  88383. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  88384. // "format": "uint32",
  88385. // "location": "query",
  88386. // "minimum": "0",
  88387. // "type": "integer"
  88388. // },
  88389. // "orderBy": {
  88390. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  88391. // "location": "query",
  88392. // "type": "string"
  88393. // },
  88394. // "pageToken": {
  88395. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  88396. // "location": "query",
  88397. // "type": "string"
  88398. // },
  88399. // "project": {
  88400. // "description": "Project ID for this request.",
  88401. // "location": "path",
  88402. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  88403. // "required": true,
  88404. // "type": "string"
  88405. // }
  88406. // },
  88407. // "path": "{project}/aggregated/subnetworks/listUsable",
  88408. // "response": {
  88409. // "$ref": "UsableSubnetworksAggregatedList"
  88410. // },
  88411. // "scopes": [
  88412. // "https://www.googleapis.com/auth/cloud-platform",
  88413. // "https://www.googleapis.com/auth/compute",
  88414. // "https://www.googleapis.com/auth/compute.readonly"
  88415. // ]
  88416. // }
  88417. }
  88418. // Pages invokes f for each page of results.
  88419. // A non-nil error returned from f will halt the iteration.
  88420. // The provided context supersedes any context provided to the Context method.
  88421. func (c *SubnetworksListUsableCall) Pages(ctx context.Context, f func(*UsableSubnetworksAggregatedList) error) error {
  88422. c.ctx_ = ctx
  88423. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  88424. for {
  88425. x, err := c.Do()
  88426. if err != nil {
  88427. return err
  88428. }
  88429. if err := f(x); err != nil {
  88430. return err
  88431. }
  88432. if x.NextPageToken == "" {
  88433. return nil
  88434. }
  88435. c.PageToken(x.NextPageToken)
  88436. }
  88437. }
  88438. // method id "compute.subnetworks.patch":
  88439. type SubnetworksPatchCall struct {
  88440. s *Service
  88441. project string
  88442. region string
  88443. subnetwork string
  88444. subnetwork2 *Subnetwork
  88445. urlParams_ gensupport.URLParams
  88446. ctx_ context.Context
  88447. header_ http.Header
  88448. }
  88449. // Patch: Patches the specified subnetwork with the data included in the
  88450. // request. Only the following fields within the subnetwork resource can
  88451. // be specified in the request: secondary_ip_range,
  88452. // allow_subnet_cidr_routes_overlap and role. It is also mandatory to
  88453. // specify the current fingeprint of the subnetwork resource being
  88454. // patched.
  88455. func (r *SubnetworksService) Patch(project string, region string, subnetwork string, subnetwork2 *Subnetwork) *SubnetworksPatchCall {
  88456. c := &SubnetworksPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  88457. c.project = project
  88458. c.region = region
  88459. c.subnetwork = subnetwork
  88460. c.subnetwork2 = subnetwork2
  88461. return c
  88462. }
  88463. // RequestId sets the optional parameter "requestId": An optional
  88464. // request ID to identify requests. Specify a unique request ID so that
  88465. // if you must retry your request, the server will know to ignore the
  88466. // request if it has already been completed.
  88467. //
  88468. // For example, consider a situation where you make an initial request
  88469. // and the request times out. If you make the request again with the
  88470. // same request ID, the server can check if original operation with the
  88471. // same request ID was received, and if so, will ignore the second
  88472. // request. This prevents clients from accidentally creating duplicate
  88473. // commitments.
  88474. //
  88475. // The request ID must be a valid UUID with the exception that zero UUID
  88476. // is not supported (00000000-0000-0000-0000-000000000000).
  88477. func (c *SubnetworksPatchCall) RequestId(requestId string) *SubnetworksPatchCall {
  88478. c.urlParams_.Set("requestId", requestId)
  88479. return c
  88480. }
  88481. // Fields allows partial responses to be retrieved. See
  88482. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  88483. // for more information.
  88484. func (c *SubnetworksPatchCall) Fields(s ...googleapi.Field) *SubnetworksPatchCall {
  88485. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  88486. return c
  88487. }
  88488. // Context sets the context to be used in this call's Do method. Any
  88489. // pending HTTP request will be aborted if the provided context is
  88490. // canceled.
  88491. func (c *SubnetworksPatchCall) Context(ctx context.Context) *SubnetworksPatchCall {
  88492. c.ctx_ = ctx
  88493. return c
  88494. }
  88495. // Header returns an http.Header that can be modified by the caller to
  88496. // add HTTP headers to the request.
  88497. func (c *SubnetworksPatchCall) Header() http.Header {
  88498. if c.header_ == nil {
  88499. c.header_ = make(http.Header)
  88500. }
  88501. return c.header_
  88502. }
  88503. func (c *SubnetworksPatchCall) doRequest(alt string) (*http.Response, error) {
  88504. reqHeaders := make(http.Header)
  88505. for k, v := range c.header_ {
  88506. reqHeaders[k] = v
  88507. }
  88508. reqHeaders.Set("User-Agent", c.s.userAgent())
  88509. var body io.Reader = nil
  88510. body, err := googleapi.WithoutDataWrapper.JSONReader(c.subnetwork2)
  88511. if err != nil {
  88512. return nil, err
  88513. }
  88514. reqHeaders.Set("Content-Type", "application/json")
  88515. c.urlParams_.Set("alt", alt)
  88516. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/subnetworks/{subnetwork}")
  88517. urls += "?" + c.urlParams_.Encode()
  88518. req, _ := http.NewRequest("PATCH", urls, body)
  88519. req.Header = reqHeaders
  88520. googleapi.Expand(req.URL, map[string]string{
  88521. "project": c.project,
  88522. "region": c.region,
  88523. "subnetwork": c.subnetwork,
  88524. })
  88525. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  88526. }
  88527. // Do executes the "compute.subnetworks.patch" call.
  88528. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  88529. // status code is an error. Response headers are in either
  88530. // *Operation.ServerResponse.Header or (if a response was returned at
  88531. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  88532. // to check whether the returned error was because
  88533. // http.StatusNotModified was returned.
  88534. func (c *SubnetworksPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  88535. gensupport.SetOptions(c.urlParams_, opts...)
  88536. res, err := c.doRequest("json")
  88537. if res != nil && res.StatusCode == http.StatusNotModified {
  88538. if res.Body != nil {
  88539. res.Body.Close()
  88540. }
  88541. return nil, &googleapi.Error{
  88542. Code: res.StatusCode,
  88543. Header: res.Header,
  88544. }
  88545. }
  88546. if err != nil {
  88547. return nil, err
  88548. }
  88549. defer googleapi.CloseBody(res)
  88550. if err := googleapi.CheckResponse(res); err != nil {
  88551. return nil, err
  88552. }
  88553. ret := &Operation{
  88554. ServerResponse: googleapi.ServerResponse{
  88555. Header: res.Header,
  88556. HTTPStatusCode: res.StatusCode,
  88557. },
  88558. }
  88559. target := &ret
  88560. if err := gensupport.DecodeResponse(target, res); err != nil {
  88561. return nil, err
  88562. }
  88563. return ret, nil
  88564. // {
  88565. // "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.",
  88566. // "httpMethod": "PATCH",
  88567. // "id": "compute.subnetworks.patch",
  88568. // "parameterOrder": [
  88569. // "project",
  88570. // "region",
  88571. // "subnetwork"
  88572. // ],
  88573. // "parameters": {
  88574. // "project": {
  88575. // "description": "Project ID for this request.",
  88576. // "location": "path",
  88577. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  88578. // "required": true,
  88579. // "type": "string"
  88580. // },
  88581. // "region": {
  88582. // "description": "Name of the region scoping this request.",
  88583. // "location": "path",
  88584. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  88585. // "required": true,
  88586. // "type": "string"
  88587. // },
  88588. // "requestId": {
  88589. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  88590. // "location": "query",
  88591. // "type": "string"
  88592. // },
  88593. // "subnetwork": {
  88594. // "description": "Name of the Subnetwork resource to patch.",
  88595. // "location": "path",
  88596. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  88597. // "required": true,
  88598. // "type": "string"
  88599. // }
  88600. // },
  88601. // "path": "{project}/regions/{region}/subnetworks/{subnetwork}",
  88602. // "request": {
  88603. // "$ref": "Subnetwork"
  88604. // },
  88605. // "response": {
  88606. // "$ref": "Operation"
  88607. // },
  88608. // "scopes": [
  88609. // "https://www.googleapis.com/auth/cloud-platform",
  88610. // "https://www.googleapis.com/auth/compute"
  88611. // ]
  88612. // }
  88613. }
  88614. // method id "compute.subnetworks.setIamPolicy":
  88615. type SubnetworksSetIamPolicyCall struct {
  88616. s *Service
  88617. project string
  88618. region string
  88619. resource string
  88620. regionsetpolicyrequest *RegionSetPolicyRequest
  88621. urlParams_ gensupport.URLParams
  88622. ctx_ context.Context
  88623. header_ http.Header
  88624. }
  88625. // SetIamPolicy: Sets the access control policy on the specified
  88626. // resource. Replaces any existing policy.
  88627. func (r *SubnetworksService) SetIamPolicy(project string, region string, resource string, regionsetpolicyrequest *RegionSetPolicyRequest) *SubnetworksSetIamPolicyCall {
  88628. c := &SubnetworksSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  88629. c.project = project
  88630. c.region = region
  88631. c.resource = resource
  88632. c.regionsetpolicyrequest = regionsetpolicyrequest
  88633. return c
  88634. }
  88635. // Fields allows partial responses to be retrieved. See
  88636. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  88637. // for more information.
  88638. func (c *SubnetworksSetIamPolicyCall) Fields(s ...googleapi.Field) *SubnetworksSetIamPolicyCall {
  88639. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  88640. return c
  88641. }
  88642. // Context sets the context to be used in this call's Do method. Any
  88643. // pending HTTP request will be aborted if the provided context is
  88644. // canceled.
  88645. func (c *SubnetworksSetIamPolicyCall) Context(ctx context.Context) *SubnetworksSetIamPolicyCall {
  88646. c.ctx_ = ctx
  88647. return c
  88648. }
  88649. // Header returns an http.Header that can be modified by the caller to
  88650. // add HTTP headers to the request.
  88651. func (c *SubnetworksSetIamPolicyCall) Header() http.Header {
  88652. if c.header_ == nil {
  88653. c.header_ = make(http.Header)
  88654. }
  88655. return c.header_
  88656. }
  88657. func (c *SubnetworksSetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  88658. reqHeaders := make(http.Header)
  88659. for k, v := range c.header_ {
  88660. reqHeaders[k] = v
  88661. }
  88662. reqHeaders.Set("User-Agent", c.s.userAgent())
  88663. var body io.Reader = nil
  88664. body, err := googleapi.WithoutDataWrapper.JSONReader(c.regionsetpolicyrequest)
  88665. if err != nil {
  88666. return nil, err
  88667. }
  88668. reqHeaders.Set("Content-Type", "application/json")
  88669. c.urlParams_.Set("alt", alt)
  88670. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/subnetworks/{resource}/setIamPolicy")
  88671. urls += "?" + c.urlParams_.Encode()
  88672. req, _ := http.NewRequest("POST", urls, body)
  88673. req.Header = reqHeaders
  88674. googleapi.Expand(req.URL, map[string]string{
  88675. "project": c.project,
  88676. "region": c.region,
  88677. "resource": c.resource,
  88678. })
  88679. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  88680. }
  88681. // Do executes the "compute.subnetworks.setIamPolicy" call.
  88682. // Exactly one of *Policy or error will be non-nil. Any non-2xx status
  88683. // code is an error. Response headers are in either
  88684. // *Policy.ServerResponse.Header or (if a response was returned at all)
  88685. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  88686. // check whether the returned error was because http.StatusNotModified
  88687. // was returned.
  88688. func (c *SubnetworksSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  88689. gensupport.SetOptions(c.urlParams_, opts...)
  88690. res, err := c.doRequest("json")
  88691. if res != nil && res.StatusCode == http.StatusNotModified {
  88692. if res.Body != nil {
  88693. res.Body.Close()
  88694. }
  88695. return nil, &googleapi.Error{
  88696. Code: res.StatusCode,
  88697. Header: res.Header,
  88698. }
  88699. }
  88700. if err != nil {
  88701. return nil, err
  88702. }
  88703. defer googleapi.CloseBody(res)
  88704. if err := googleapi.CheckResponse(res); err != nil {
  88705. return nil, err
  88706. }
  88707. ret := &Policy{
  88708. ServerResponse: googleapi.ServerResponse{
  88709. Header: res.Header,
  88710. HTTPStatusCode: res.StatusCode,
  88711. },
  88712. }
  88713. target := &ret
  88714. if err := gensupport.DecodeResponse(target, res); err != nil {
  88715. return nil, err
  88716. }
  88717. return ret, nil
  88718. // {
  88719. // "description": "Sets the access control policy on the specified resource. Replaces any existing policy.",
  88720. // "httpMethod": "POST",
  88721. // "id": "compute.subnetworks.setIamPolicy",
  88722. // "parameterOrder": [
  88723. // "project",
  88724. // "region",
  88725. // "resource"
  88726. // ],
  88727. // "parameters": {
  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": "The name of the region for 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. // "resource": {
  88743. // "description": "Name of the resource for this request.",
  88744. // "location": "path",
  88745. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  88746. // "required": true,
  88747. // "type": "string"
  88748. // }
  88749. // },
  88750. // "path": "{project}/regions/{region}/subnetworks/{resource}/setIamPolicy",
  88751. // "request": {
  88752. // "$ref": "RegionSetPolicyRequest"
  88753. // },
  88754. // "response": {
  88755. // "$ref": "Policy"
  88756. // },
  88757. // "scopes": [
  88758. // "https://www.googleapis.com/auth/cloud-platform",
  88759. // "https://www.googleapis.com/auth/compute"
  88760. // ]
  88761. // }
  88762. }
  88763. // method id "compute.subnetworks.setPrivateIpGoogleAccess":
  88764. type SubnetworksSetPrivateIpGoogleAccessCall struct {
  88765. s *Service
  88766. project string
  88767. region string
  88768. subnetwork string
  88769. subnetworkssetprivateipgoogleaccessrequest *SubnetworksSetPrivateIpGoogleAccessRequest
  88770. urlParams_ gensupport.URLParams
  88771. ctx_ context.Context
  88772. header_ http.Header
  88773. }
  88774. // SetPrivateIpGoogleAccess: Set whether VMs in this subnet can access
  88775. // Google services without assigning external IP addresses through
  88776. // Private Google Access.
  88777. func (r *SubnetworksService) SetPrivateIpGoogleAccess(project string, region string, subnetwork string, subnetworkssetprivateipgoogleaccessrequest *SubnetworksSetPrivateIpGoogleAccessRequest) *SubnetworksSetPrivateIpGoogleAccessCall {
  88778. c := &SubnetworksSetPrivateIpGoogleAccessCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  88779. c.project = project
  88780. c.region = region
  88781. c.subnetwork = subnetwork
  88782. c.subnetworkssetprivateipgoogleaccessrequest = subnetworkssetprivateipgoogleaccessrequest
  88783. return c
  88784. }
  88785. // RequestId sets the optional parameter "requestId": An optional
  88786. // request ID to identify requests. Specify a unique request ID so that
  88787. // if you must retry your request, the server will know to ignore the
  88788. // request if it has already been completed.
  88789. //
  88790. // For example, consider a situation where you make an initial request
  88791. // and the request times out. If you make the request again with the
  88792. // same request ID, the server can check if original operation with the
  88793. // same request ID was received, and if so, will ignore the second
  88794. // request. This prevents clients from accidentally creating duplicate
  88795. // commitments.
  88796. //
  88797. // The request ID must be a valid UUID with the exception that zero UUID
  88798. // is not supported (00000000-0000-0000-0000-000000000000).
  88799. func (c *SubnetworksSetPrivateIpGoogleAccessCall) RequestId(requestId string) *SubnetworksSetPrivateIpGoogleAccessCall {
  88800. c.urlParams_.Set("requestId", requestId)
  88801. return c
  88802. }
  88803. // Fields allows partial responses to be retrieved. See
  88804. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  88805. // for more information.
  88806. func (c *SubnetworksSetPrivateIpGoogleAccessCall) Fields(s ...googleapi.Field) *SubnetworksSetPrivateIpGoogleAccessCall {
  88807. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  88808. return c
  88809. }
  88810. // Context sets the context to be used in this call's Do method. Any
  88811. // pending HTTP request will be aborted if the provided context is
  88812. // canceled.
  88813. func (c *SubnetworksSetPrivateIpGoogleAccessCall) Context(ctx context.Context) *SubnetworksSetPrivateIpGoogleAccessCall {
  88814. c.ctx_ = ctx
  88815. return c
  88816. }
  88817. // Header returns an http.Header that can be modified by the caller to
  88818. // add HTTP headers to the request.
  88819. func (c *SubnetworksSetPrivateIpGoogleAccessCall) Header() http.Header {
  88820. if c.header_ == nil {
  88821. c.header_ = make(http.Header)
  88822. }
  88823. return c.header_
  88824. }
  88825. func (c *SubnetworksSetPrivateIpGoogleAccessCall) doRequest(alt string) (*http.Response, error) {
  88826. reqHeaders := make(http.Header)
  88827. for k, v := range c.header_ {
  88828. reqHeaders[k] = v
  88829. }
  88830. reqHeaders.Set("User-Agent", c.s.userAgent())
  88831. var body io.Reader = nil
  88832. body, err := googleapi.WithoutDataWrapper.JSONReader(c.subnetworkssetprivateipgoogleaccessrequest)
  88833. if err != nil {
  88834. return nil, err
  88835. }
  88836. reqHeaders.Set("Content-Type", "application/json")
  88837. c.urlParams_.Set("alt", alt)
  88838. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/subnetworks/{subnetwork}/setPrivateIpGoogleAccess")
  88839. urls += "?" + c.urlParams_.Encode()
  88840. req, _ := http.NewRequest("POST", urls, body)
  88841. req.Header = reqHeaders
  88842. googleapi.Expand(req.URL, map[string]string{
  88843. "project": c.project,
  88844. "region": c.region,
  88845. "subnetwork": c.subnetwork,
  88846. })
  88847. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  88848. }
  88849. // Do executes the "compute.subnetworks.setPrivateIpGoogleAccess" call.
  88850. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  88851. // status code is an error. Response headers are in either
  88852. // *Operation.ServerResponse.Header or (if a response was returned at
  88853. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  88854. // to check whether the returned error was because
  88855. // http.StatusNotModified was returned.
  88856. func (c *SubnetworksSetPrivateIpGoogleAccessCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  88857. gensupport.SetOptions(c.urlParams_, opts...)
  88858. res, err := c.doRequest("json")
  88859. if res != nil && res.StatusCode == http.StatusNotModified {
  88860. if res.Body != nil {
  88861. res.Body.Close()
  88862. }
  88863. return nil, &googleapi.Error{
  88864. Code: res.StatusCode,
  88865. Header: res.Header,
  88866. }
  88867. }
  88868. if err != nil {
  88869. return nil, err
  88870. }
  88871. defer googleapi.CloseBody(res)
  88872. if err := googleapi.CheckResponse(res); err != nil {
  88873. return nil, err
  88874. }
  88875. ret := &Operation{
  88876. ServerResponse: googleapi.ServerResponse{
  88877. Header: res.Header,
  88878. HTTPStatusCode: res.StatusCode,
  88879. },
  88880. }
  88881. target := &ret
  88882. if err := gensupport.DecodeResponse(target, res); err != nil {
  88883. return nil, err
  88884. }
  88885. return ret, nil
  88886. // {
  88887. // "description": "Set whether VMs in this subnet can access Google services without assigning external IP addresses through Private Google Access.",
  88888. // "httpMethod": "POST",
  88889. // "id": "compute.subnetworks.setPrivateIpGoogleAccess",
  88890. // "parameterOrder": [
  88891. // "project",
  88892. // "region",
  88893. // "subnetwork"
  88894. // ],
  88895. // "parameters": {
  88896. // "project": {
  88897. // "description": "Project ID for this request.",
  88898. // "location": "path",
  88899. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  88900. // "required": true,
  88901. // "type": "string"
  88902. // },
  88903. // "region": {
  88904. // "description": "Name of the region scoping this request.",
  88905. // "location": "path",
  88906. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  88907. // "required": true,
  88908. // "type": "string"
  88909. // },
  88910. // "requestId": {
  88911. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  88912. // "location": "query",
  88913. // "type": "string"
  88914. // },
  88915. // "subnetwork": {
  88916. // "description": "Name of the Subnetwork resource.",
  88917. // "location": "path",
  88918. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  88919. // "required": true,
  88920. // "type": "string"
  88921. // }
  88922. // },
  88923. // "path": "{project}/regions/{region}/subnetworks/{subnetwork}/setPrivateIpGoogleAccess",
  88924. // "request": {
  88925. // "$ref": "SubnetworksSetPrivateIpGoogleAccessRequest"
  88926. // },
  88927. // "response": {
  88928. // "$ref": "Operation"
  88929. // },
  88930. // "scopes": [
  88931. // "https://www.googleapis.com/auth/cloud-platform",
  88932. // "https://www.googleapis.com/auth/compute"
  88933. // ]
  88934. // }
  88935. }
  88936. // method id "compute.subnetworks.testIamPermissions":
  88937. type SubnetworksTestIamPermissionsCall struct {
  88938. s *Service
  88939. project string
  88940. region string
  88941. resource string
  88942. testpermissionsrequest *TestPermissionsRequest
  88943. urlParams_ gensupport.URLParams
  88944. ctx_ context.Context
  88945. header_ http.Header
  88946. }
  88947. // TestIamPermissions: Returns permissions that a caller has on the
  88948. // specified resource.
  88949. func (r *SubnetworksService) TestIamPermissions(project string, region string, resource string, testpermissionsrequest *TestPermissionsRequest) *SubnetworksTestIamPermissionsCall {
  88950. c := &SubnetworksTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  88951. c.project = project
  88952. c.region = region
  88953. c.resource = resource
  88954. c.testpermissionsrequest = testpermissionsrequest
  88955. return c
  88956. }
  88957. // Fields allows partial responses to be retrieved. See
  88958. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  88959. // for more information.
  88960. func (c *SubnetworksTestIamPermissionsCall) Fields(s ...googleapi.Field) *SubnetworksTestIamPermissionsCall {
  88961. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  88962. return c
  88963. }
  88964. // Context sets the context to be used in this call's Do method. Any
  88965. // pending HTTP request will be aborted if the provided context is
  88966. // canceled.
  88967. func (c *SubnetworksTestIamPermissionsCall) Context(ctx context.Context) *SubnetworksTestIamPermissionsCall {
  88968. c.ctx_ = ctx
  88969. return c
  88970. }
  88971. // Header returns an http.Header that can be modified by the caller to
  88972. // add HTTP headers to the request.
  88973. func (c *SubnetworksTestIamPermissionsCall) Header() http.Header {
  88974. if c.header_ == nil {
  88975. c.header_ = make(http.Header)
  88976. }
  88977. return c.header_
  88978. }
  88979. func (c *SubnetworksTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  88980. reqHeaders := make(http.Header)
  88981. for k, v := range c.header_ {
  88982. reqHeaders[k] = v
  88983. }
  88984. reqHeaders.Set("User-Agent", c.s.userAgent())
  88985. var body io.Reader = nil
  88986. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  88987. if err != nil {
  88988. return nil, err
  88989. }
  88990. reqHeaders.Set("Content-Type", "application/json")
  88991. c.urlParams_.Set("alt", alt)
  88992. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/subnetworks/{resource}/testIamPermissions")
  88993. urls += "?" + c.urlParams_.Encode()
  88994. req, _ := http.NewRequest("POST", urls, body)
  88995. req.Header = reqHeaders
  88996. googleapi.Expand(req.URL, map[string]string{
  88997. "project": c.project,
  88998. "region": c.region,
  88999. "resource": c.resource,
  89000. })
  89001. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  89002. }
  89003. // Do executes the "compute.subnetworks.testIamPermissions" call.
  89004. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  89005. // non-2xx status code is an error. Response headers are in either
  89006. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  89007. // returned at all) in error.(*googleapi.Error).Header. Use
  89008. // googleapi.IsNotModified to check whether the returned error was
  89009. // because http.StatusNotModified was returned.
  89010. func (c *SubnetworksTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  89011. gensupport.SetOptions(c.urlParams_, opts...)
  89012. res, err := c.doRequest("json")
  89013. if res != nil && res.StatusCode == http.StatusNotModified {
  89014. if res.Body != nil {
  89015. res.Body.Close()
  89016. }
  89017. return nil, &googleapi.Error{
  89018. Code: res.StatusCode,
  89019. Header: res.Header,
  89020. }
  89021. }
  89022. if err != nil {
  89023. return nil, err
  89024. }
  89025. defer googleapi.CloseBody(res)
  89026. if err := googleapi.CheckResponse(res); err != nil {
  89027. return nil, err
  89028. }
  89029. ret := &TestPermissionsResponse{
  89030. ServerResponse: googleapi.ServerResponse{
  89031. Header: res.Header,
  89032. HTTPStatusCode: res.StatusCode,
  89033. },
  89034. }
  89035. target := &ret
  89036. if err := gensupport.DecodeResponse(target, res); err != nil {
  89037. return nil, err
  89038. }
  89039. return ret, nil
  89040. // {
  89041. // "description": "Returns permissions that a caller has on the specified resource.",
  89042. // "httpMethod": "POST",
  89043. // "id": "compute.subnetworks.testIamPermissions",
  89044. // "parameterOrder": [
  89045. // "project",
  89046. // "region",
  89047. // "resource"
  89048. // ],
  89049. // "parameters": {
  89050. // "project": {
  89051. // "description": "Project ID for this request.",
  89052. // "location": "path",
  89053. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  89054. // "required": true,
  89055. // "type": "string"
  89056. // },
  89057. // "region": {
  89058. // "description": "The name of the region for this request.",
  89059. // "location": "path",
  89060. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  89061. // "required": true,
  89062. // "type": "string"
  89063. // },
  89064. // "resource": {
  89065. // "description": "Name of the resource for this request.",
  89066. // "location": "path",
  89067. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  89068. // "required": true,
  89069. // "type": "string"
  89070. // }
  89071. // },
  89072. // "path": "{project}/regions/{region}/subnetworks/{resource}/testIamPermissions",
  89073. // "request": {
  89074. // "$ref": "TestPermissionsRequest"
  89075. // },
  89076. // "response": {
  89077. // "$ref": "TestPermissionsResponse"
  89078. // },
  89079. // "scopes": [
  89080. // "https://www.googleapis.com/auth/cloud-platform",
  89081. // "https://www.googleapis.com/auth/compute",
  89082. // "https://www.googleapis.com/auth/compute.readonly"
  89083. // ]
  89084. // }
  89085. }
  89086. // method id "compute.targetHttpProxies.delete":
  89087. type TargetHttpProxiesDeleteCall struct {
  89088. s *Service
  89089. project string
  89090. targetHttpProxy string
  89091. urlParams_ gensupport.URLParams
  89092. ctx_ context.Context
  89093. header_ http.Header
  89094. }
  89095. // Delete: Deletes the specified TargetHttpProxy resource.
  89096. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetHttpProxies/delete
  89097. func (r *TargetHttpProxiesService) Delete(project string, targetHttpProxy string) *TargetHttpProxiesDeleteCall {
  89098. c := &TargetHttpProxiesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  89099. c.project = project
  89100. c.targetHttpProxy = targetHttpProxy
  89101. return c
  89102. }
  89103. // RequestId sets the optional parameter "requestId": An optional
  89104. // request ID to identify requests. Specify a unique request ID so that
  89105. // if you must retry your request, the server will know to ignore the
  89106. // request if it has already been completed.
  89107. //
  89108. // For example, consider a situation where you make an initial request
  89109. // and the request times out. If you make the request again with the
  89110. // same request ID, the server can check if original operation with the
  89111. // same request ID was received, and if so, will ignore the second
  89112. // request. This prevents clients from accidentally creating duplicate
  89113. // commitments.
  89114. //
  89115. // The request ID must be a valid UUID with the exception that zero UUID
  89116. // is not supported (00000000-0000-0000-0000-000000000000).
  89117. func (c *TargetHttpProxiesDeleteCall) RequestId(requestId string) *TargetHttpProxiesDeleteCall {
  89118. c.urlParams_.Set("requestId", requestId)
  89119. return c
  89120. }
  89121. // Fields allows partial responses to be retrieved. See
  89122. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  89123. // for more information.
  89124. func (c *TargetHttpProxiesDeleteCall) Fields(s ...googleapi.Field) *TargetHttpProxiesDeleteCall {
  89125. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  89126. return c
  89127. }
  89128. // Context sets the context to be used in this call's Do method. Any
  89129. // pending HTTP request will be aborted if the provided context is
  89130. // canceled.
  89131. func (c *TargetHttpProxiesDeleteCall) Context(ctx context.Context) *TargetHttpProxiesDeleteCall {
  89132. c.ctx_ = ctx
  89133. return c
  89134. }
  89135. // Header returns an http.Header that can be modified by the caller to
  89136. // add HTTP headers to the request.
  89137. func (c *TargetHttpProxiesDeleteCall) Header() http.Header {
  89138. if c.header_ == nil {
  89139. c.header_ = make(http.Header)
  89140. }
  89141. return c.header_
  89142. }
  89143. func (c *TargetHttpProxiesDeleteCall) doRequest(alt string) (*http.Response, error) {
  89144. reqHeaders := make(http.Header)
  89145. for k, v := range c.header_ {
  89146. reqHeaders[k] = v
  89147. }
  89148. reqHeaders.Set("User-Agent", c.s.userAgent())
  89149. var body io.Reader = nil
  89150. c.urlParams_.Set("alt", alt)
  89151. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetHttpProxies/{targetHttpProxy}")
  89152. urls += "?" + c.urlParams_.Encode()
  89153. req, _ := http.NewRequest("DELETE", urls, body)
  89154. req.Header = reqHeaders
  89155. googleapi.Expand(req.URL, map[string]string{
  89156. "project": c.project,
  89157. "targetHttpProxy": c.targetHttpProxy,
  89158. })
  89159. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  89160. }
  89161. // Do executes the "compute.targetHttpProxies.delete" call.
  89162. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  89163. // status code is an error. Response headers are in either
  89164. // *Operation.ServerResponse.Header or (if a response was returned at
  89165. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  89166. // to check whether the returned error was because
  89167. // http.StatusNotModified was returned.
  89168. func (c *TargetHttpProxiesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  89169. gensupport.SetOptions(c.urlParams_, opts...)
  89170. res, err := c.doRequest("json")
  89171. if res != nil && res.StatusCode == http.StatusNotModified {
  89172. if res.Body != nil {
  89173. res.Body.Close()
  89174. }
  89175. return nil, &googleapi.Error{
  89176. Code: res.StatusCode,
  89177. Header: res.Header,
  89178. }
  89179. }
  89180. if err != nil {
  89181. return nil, err
  89182. }
  89183. defer googleapi.CloseBody(res)
  89184. if err := googleapi.CheckResponse(res); err != nil {
  89185. return nil, err
  89186. }
  89187. ret := &Operation{
  89188. ServerResponse: googleapi.ServerResponse{
  89189. Header: res.Header,
  89190. HTTPStatusCode: res.StatusCode,
  89191. },
  89192. }
  89193. target := &ret
  89194. if err := gensupport.DecodeResponse(target, res); err != nil {
  89195. return nil, err
  89196. }
  89197. return ret, nil
  89198. // {
  89199. // "description": "Deletes the specified TargetHttpProxy resource.",
  89200. // "httpMethod": "DELETE",
  89201. // "id": "compute.targetHttpProxies.delete",
  89202. // "parameterOrder": [
  89203. // "project",
  89204. // "targetHttpProxy"
  89205. // ],
  89206. // "parameters": {
  89207. // "project": {
  89208. // "description": "Project ID for this request.",
  89209. // "location": "path",
  89210. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  89211. // "required": true,
  89212. // "type": "string"
  89213. // },
  89214. // "requestId": {
  89215. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  89216. // "location": "query",
  89217. // "type": "string"
  89218. // },
  89219. // "targetHttpProxy": {
  89220. // "description": "Name of the TargetHttpProxy resource to delete.",
  89221. // "location": "path",
  89222. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  89223. // "required": true,
  89224. // "type": "string"
  89225. // }
  89226. // },
  89227. // "path": "{project}/global/targetHttpProxies/{targetHttpProxy}",
  89228. // "response": {
  89229. // "$ref": "Operation"
  89230. // },
  89231. // "scopes": [
  89232. // "https://www.googleapis.com/auth/cloud-platform",
  89233. // "https://www.googleapis.com/auth/compute"
  89234. // ]
  89235. // }
  89236. }
  89237. // method id "compute.targetHttpProxies.get":
  89238. type TargetHttpProxiesGetCall struct {
  89239. s *Service
  89240. project string
  89241. targetHttpProxy string
  89242. urlParams_ gensupport.URLParams
  89243. ifNoneMatch_ string
  89244. ctx_ context.Context
  89245. header_ http.Header
  89246. }
  89247. // Get: Returns the specified TargetHttpProxy resource. Gets a list of
  89248. // available target HTTP proxies by making a list() request.
  89249. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetHttpProxies/get
  89250. func (r *TargetHttpProxiesService) Get(project string, targetHttpProxy string) *TargetHttpProxiesGetCall {
  89251. c := &TargetHttpProxiesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  89252. c.project = project
  89253. c.targetHttpProxy = targetHttpProxy
  89254. return c
  89255. }
  89256. // Fields allows partial responses to be retrieved. See
  89257. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  89258. // for more information.
  89259. func (c *TargetHttpProxiesGetCall) Fields(s ...googleapi.Field) *TargetHttpProxiesGetCall {
  89260. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  89261. return c
  89262. }
  89263. // IfNoneMatch sets the optional parameter which makes the operation
  89264. // fail if the object's ETag matches the given value. This is useful for
  89265. // getting updates only after the object has changed since the last
  89266. // request. Use googleapi.IsNotModified to check whether the response
  89267. // error from Do is the result of In-None-Match.
  89268. func (c *TargetHttpProxiesGetCall) IfNoneMatch(entityTag string) *TargetHttpProxiesGetCall {
  89269. c.ifNoneMatch_ = entityTag
  89270. return c
  89271. }
  89272. // Context sets the context to be used in this call's Do method. Any
  89273. // pending HTTP request will be aborted if the provided context is
  89274. // canceled.
  89275. func (c *TargetHttpProxiesGetCall) Context(ctx context.Context) *TargetHttpProxiesGetCall {
  89276. c.ctx_ = ctx
  89277. return c
  89278. }
  89279. // Header returns an http.Header that can be modified by the caller to
  89280. // add HTTP headers to the request.
  89281. func (c *TargetHttpProxiesGetCall) Header() http.Header {
  89282. if c.header_ == nil {
  89283. c.header_ = make(http.Header)
  89284. }
  89285. return c.header_
  89286. }
  89287. func (c *TargetHttpProxiesGetCall) doRequest(alt string) (*http.Response, error) {
  89288. reqHeaders := make(http.Header)
  89289. for k, v := range c.header_ {
  89290. reqHeaders[k] = v
  89291. }
  89292. reqHeaders.Set("User-Agent", c.s.userAgent())
  89293. if c.ifNoneMatch_ != "" {
  89294. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  89295. }
  89296. var body io.Reader = nil
  89297. c.urlParams_.Set("alt", alt)
  89298. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetHttpProxies/{targetHttpProxy}")
  89299. urls += "?" + c.urlParams_.Encode()
  89300. req, _ := http.NewRequest("GET", urls, body)
  89301. req.Header = reqHeaders
  89302. googleapi.Expand(req.URL, map[string]string{
  89303. "project": c.project,
  89304. "targetHttpProxy": c.targetHttpProxy,
  89305. })
  89306. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  89307. }
  89308. // Do executes the "compute.targetHttpProxies.get" call.
  89309. // Exactly one of *TargetHttpProxy or error will be non-nil. Any non-2xx
  89310. // status code is an error. Response headers are in either
  89311. // *TargetHttpProxy.ServerResponse.Header or (if a response was returned
  89312. // at all) in error.(*googleapi.Error).Header. Use
  89313. // googleapi.IsNotModified to check whether the returned error was
  89314. // because http.StatusNotModified was returned.
  89315. func (c *TargetHttpProxiesGetCall) Do(opts ...googleapi.CallOption) (*TargetHttpProxy, error) {
  89316. gensupport.SetOptions(c.urlParams_, opts...)
  89317. res, err := c.doRequest("json")
  89318. if res != nil && res.StatusCode == http.StatusNotModified {
  89319. if res.Body != nil {
  89320. res.Body.Close()
  89321. }
  89322. return nil, &googleapi.Error{
  89323. Code: res.StatusCode,
  89324. Header: res.Header,
  89325. }
  89326. }
  89327. if err != nil {
  89328. return nil, err
  89329. }
  89330. defer googleapi.CloseBody(res)
  89331. if err := googleapi.CheckResponse(res); err != nil {
  89332. return nil, err
  89333. }
  89334. ret := &TargetHttpProxy{
  89335. ServerResponse: googleapi.ServerResponse{
  89336. Header: res.Header,
  89337. HTTPStatusCode: res.StatusCode,
  89338. },
  89339. }
  89340. target := &ret
  89341. if err := gensupport.DecodeResponse(target, res); err != nil {
  89342. return nil, err
  89343. }
  89344. return ret, nil
  89345. // {
  89346. // "description": "Returns the specified TargetHttpProxy resource. Gets a list of available target HTTP proxies by making a list() request.",
  89347. // "httpMethod": "GET",
  89348. // "id": "compute.targetHttpProxies.get",
  89349. // "parameterOrder": [
  89350. // "project",
  89351. // "targetHttpProxy"
  89352. // ],
  89353. // "parameters": {
  89354. // "project": {
  89355. // "description": "Project ID for this request.",
  89356. // "location": "path",
  89357. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  89358. // "required": true,
  89359. // "type": "string"
  89360. // },
  89361. // "targetHttpProxy": {
  89362. // "description": "Name of the TargetHttpProxy resource to return.",
  89363. // "location": "path",
  89364. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  89365. // "required": true,
  89366. // "type": "string"
  89367. // }
  89368. // },
  89369. // "path": "{project}/global/targetHttpProxies/{targetHttpProxy}",
  89370. // "response": {
  89371. // "$ref": "TargetHttpProxy"
  89372. // },
  89373. // "scopes": [
  89374. // "https://www.googleapis.com/auth/cloud-platform",
  89375. // "https://www.googleapis.com/auth/compute",
  89376. // "https://www.googleapis.com/auth/compute.readonly"
  89377. // ]
  89378. // }
  89379. }
  89380. // method id "compute.targetHttpProxies.insert":
  89381. type TargetHttpProxiesInsertCall struct {
  89382. s *Service
  89383. project string
  89384. targethttpproxy *TargetHttpProxy
  89385. urlParams_ gensupport.URLParams
  89386. ctx_ context.Context
  89387. header_ http.Header
  89388. }
  89389. // Insert: Creates a TargetHttpProxy resource in the specified project
  89390. // using the data included in the request.
  89391. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetHttpProxies/insert
  89392. func (r *TargetHttpProxiesService) Insert(project string, targethttpproxy *TargetHttpProxy) *TargetHttpProxiesInsertCall {
  89393. c := &TargetHttpProxiesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  89394. c.project = project
  89395. c.targethttpproxy = targethttpproxy
  89396. return c
  89397. }
  89398. // RequestId sets the optional parameter "requestId": An optional
  89399. // request ID to identify requests. Specify a unique request ID so that
  89400. // if you must retry your request, the server will know to ignore the
  89401. // request if it has already been completed.
  89402. //
  89403. // For example, consider a situation where you make an initial request
  89404. // and the request times out. If you make the request again with the
  89405. // same request ID, the server can check if original operation with the
  89406. // same request ID was received, and if so, will ignore the second
  89407. // request. This prevents clients from accidentally creating duplicate
  89408. // commitments.
  89409. //
  89410. // The request ID must be a valid UUID with the exception that zero UUID
  89411. // is not supported (00000000-0000-0000-0000-000000000000).
  89412. func (c *TargetHttpProxiesInsertCall) RequestId(requestId string) *TargetHttpProxiesInsertCall {
  89413. c.urlParams_.Set("requestId", requestId)
  89414. return c
  89415. }
  89416. // Fields allows partial responses to be retrieved. See
  89417. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  89418. // for more information.
  89419. func (c *TargetHttpProxiesInsertCall) Fields(s ...googleapi.Field) *TargetHttpProxiesInsertCall {
  89420. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  89421. return c
  89422. }
  89423. // Context sets the context to be used in this call's Do method. Any
  89424. // pending HTTP request will be aborted if the provided context is
  89425. // canceled.
  89426. func (c *TargetHttpProxiesInsertCall) Context(ctx context.Context) *TargetHttpProxiesInsertCall {
  89427. c.ctx_ = ctx
  89428. return c
  89429. }
  89430. // Header returns an http.Header that can be modified by the caller to
  89431. // add HTTP headers to the request.
  89432. func (c *TargetHttpProxiesInsertCall) Header() http.Header {
  89433. if c.header_ == nil {
  89434. c.header_ = make(http.Header)
  89435. }
  89436. return c.header_
  89437. }
  89438. func (c *TargetHttpProxiesInsertCall) doRequest(alt string) (*http.Response, error) {
  89439. reqHeaders := make(http.Header)
  89440. for k, v := range c.header_ {
  89441. reqHeaders[k] = v
  89442. }
  89443. reqHeaders.Set("User-Agent", c.s.userAgent())
  89444. var body io.Reader = nil
  89445. body, err := googleapi.WithoutDataWrapper.JSONReader(c.targethttpproxy)
  89446. if err != nil {
  89447. return nil, err
  89448. }
  89449. reqHeaders.Set("Content-Type", "application/json")
  89450. c.urlParams_.Set("alt", alt)
  89451. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetHttpProxies")
  89452. urls += "?" + c.urlParams_.Encode()
  89453. req, _ := http.NewRequest("POST", urls, body)
  89454. req.Header = reqHeaders
  89455. googleapi.Expand(req.URL, map[string]string{
  89456. "project": c.project,
  89457. })
  89458. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  89459. }
  89460. // Do executes the "compute.targetHttpProxies.insert" call.
  89461. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  89462. // status code is an error. Response headers are in either
  89463. // *Operation.ServerResponse.Header or (if a response was returned at
  89464. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  89465. // to check whether the returned error was because
  89466. // http.StatusNotModified was returned.
  89467. func (c *TargetHttpProxiesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  89468. gensupport.SetOptions(c.urlParams_, opts...)
  89469. res, err := c.doRequest("json")
  89470. if res != nil && res.StatusCode == http.StatusNotModified {
  89471. if res.Body != nil {
  89472. res.Body.Close()
  89473. }
  89474. return nil, &googleapi.Error{
  89475. Code: res.StatusCode,
  89476. Header: res.Header,
  89477. }
  89478. }
  89479. if err != nil {
  89480. return nil, err
  89481. }
  89482. defer googleapi.CloseBody(res)
  89483. if err := googleapi.CheckResponse(res); err != nil {
  89484. return nil, err
  89485. }
  89486. ret := &Operation{
  89487. ServerResponse: googleapi.ServerResponse{
  89488. Header: res.Header,
  89489. HTTPStatusCode: res.StatusCode,
  89490. },
  89491. }
  89492. target := &ret
  89493. if err := gensupport.DecodeResponse(target, res); err != nil {
  89494. return nil, err
  89495. }
  89496. return ret, nil
  89497. // {
  89498. // "description": "Creates a TargetHttpProxy resource in the specified project using the data included in the request.",
  89499. // "httpMethod": "POST",
  89500. // "id": "compute.targetHttpProxies.insert",
  89501. // "parameterOrder": [
  89502. // "project"
  89503. // ],
  89504. // "parameters": {
  89505. // "project": {
  89506. // "description": "Project ID for this request.",
  89507. // "location": "path",
  89508. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  89509. // "required": true,
  89510. // "type": "string"
  89511. // },
  89512. // "requestId": {
  89513. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  89514. // "location": "query",
  89515. // "type": "string"
  89516. // }
  89517. // },
  89518. // "path": "{project}/global/targetHttpProxies",
  89519. // "request": {
  89520. // "$ref": "TargetHttpProxy"
  89521. // },
  89522. // "response": {
  89523. // "$ref": "Operation"
  89524. // },
  89525. // "scopes": [
  89526. // "https://www.googleapis.com/auth/cloud-platform",
  89527. // "https://www.googleapis.com/auth/compute"
  89528. // ]
  89529. // }
  89530. }
  89531. // method id "compute.targetHttpProxies.list":
  89532. type TargetHttpProxiesListCall struct {
  89533. s *Service
  89534. project string
  89535. urlParams_ gensupport.URLParams
  89536. ifNoneMatch_ string
  89537. ctx_ context.Context
  89538. header_ http.Header
  89539. }
  89540. // List: Retrieves the list of TargetHttpProxy resources available to
  89541. // the specified project.
  89542. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetHttpProxies/list
  89543. func (r *TargetHttpProxiesService) List(project string) *TargetHttpProxiesListCall {
  89544. c := &TargetHttpProxiesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  89545. c.project = project
  89546. return c
  89547. }
  89548. // Filter sets the optional parameter "filter": A filter expression that
  89549. // filters resources listed in the response. The expression must specify
  89550. // the field name, a comparison operator, and the value that you want to
  89551. // use for filtering. The value must be a string, a number, or a
  89552. // boolean. The comparison operator must be either =, !=, >, or <.
  89553. //
  89554. // For example, if you are filtering Compute Engine instances, you can
  89555. // exclude instances named example-instance by specifying name !=
  89556. // example-instance.
  89557. //
  89558. // You can also filter nested fields. For example, you could specify
  89559. // scheduling.automaticRestart = false to include instances only if they
  89560. // are not scheduled for automatic restarts. You can use filtering on
  89561. // nested fields to filter based on resource labels.
  89562. //
  89563. // To filter on multiple expressions, provide each separate expression
  89564. // within parentheses. For example, (scheduling.automaticRestart = true)
  89565. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  89566. // AND expression. However, you can include AND and OR expressions
  89567. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  89568. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  89569. // true).
  89570. func (c *TargetHttpProxiesListCall) Filter(filter string) *TargetHttpProxiesListCall {
  89571. c.urlParams_.Set("filter", filter)
  89572. return c
  89573. }
  89574. // MaxResults sets the optional parameter "maxResults": The maximum
  89575. // number of results per page that should be returned. If the number of
  89576. // available results is larger than maxResults, Compute Engine returns a
  89577. // nextPageToken that can be used to get the next page of results in
  89578. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  89579. // (Default: 500)
  89580. func (c *TargetHttpProxiesListCall) MaxResults(maxResults int64) *TargetHttpProxiesListCall {
  89581. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  89582. return c
  89583. }
  89584. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  89585. // a certain order. By default, results are returned in alphanumerical
  89586. // order based on the resource name.
  89587. //
  89588. // You can also sort results in descending order based on the creation
  89589. // timestamp using orderBy="creationTimestamp desc". This sorts results
  89590. // based on the creationTimestamp field in reverse chronological order
  89591. // (newest result first). Use this to sort resources like operations so
  89592. // that the newest operation is returned first.
  89593. //
  89594. // Currently, only sorting by name or creationTimestamp desc is
  89595. // supported.
  89596. func (c *TargetHttpProxiesListCall) OrderBy(orderBy string) *TargetHttpProxiesListCall {
  89597. c.urlParams_.Set("orderBy", orderBy)
  89598. return c
  89599. }
  89600. // PageToken sets the optional parameter "pageToken": Specifies a page
  89601. // token to use. Set pageToken to the nextPageToken returned by a
  89602. // previous list request to get the next page of results.
  89603. func (c *TargetHttpProxiesListCall) PageToken(pageToken string) *TargetHttpProxiesListCall {
  89604. c.urlParams_.Set("pageToken", pageToken)
  89605. return c
  89606. }
  89607. // Fields allows partial responses to be retrieved. See
  89608. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  89609. // for more information.
  89610. func (c *TargetHttpProxiesListCall) Fields(s ...googleapi.Field) *TargetHttpProxiesListCall {
  89611. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  89612. return c
  89613. }
  89614. // IfNoneMatch sets the optional parameter which makes the operation
  89615. // fail if the object's ETag matches the given value. This is useful for
  89616. // getting updates only after the object has changed since the last
  89617. // request. Use googleapi.IsNotModified to check whether the response
  89618. // error from Do is the result of In-None-Match.
  89619. func (c *TargetHttpProxiesListCall) IfNoneMatch(entityTag string) *TargetHttpProxiesListCall {
  89620. c.ifNoneMatch_ = entityTag
  89621. return c
  89622. }
  89623. // Context sets the context to be used in this call's Do method. Any
  89624. // pending HTTP request will be aborted if the provided context is
  89625. // canceled.
  89626. func (c *TargetHttpProxiesListCall) Context(ctx context.Context) *TargetHttpProxiesListCall {
  89627. c.ctx_ = ctx
  89628. return c
  89629. }
  89630. // Header returns an http.Header that can be modified by the caller to
  89631. // add HTTP headers to the request.
  89632. func (c *TargetHttpProxiesListCall) Header() http.Header {
  89633. if c.header_ == nil {
  89634. c.header_ = make(http.Header)
  89635. }
  89636. return c.header_
  89637. }
  89638. func (c *TargetHttpProxiesListCall) doRequest(alt string) (*http.Response, error) {
  89639. reqHeaders := make(http.Header)
  89640. for k, v := range c.header_ {
  89641. reqHeaders[k] = v
  89642. }
  89643. reqHeaders.Set("User-Agent", c.s.userAgent())
  89644. if c.ifNoneMatch_ != "" {
  89645. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  89646. }
  89647. var body io.Reader = nil
  89648. c.urlParams_.Set("alt", alt)
  89649. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetHttpProxies")
  89650. urls += "?" + c.urlParams_.Encode()
  89651. req, _ := http.NewRequest("GET", urls, body)
  89652. req.Header = reqHeaders
  89653. googleapi.Expand(req.URL, map[string]string{
  89654. "project": c.project,
  89655. })
  89656. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  89657. }
  89658. // Do executes the "compute.targetHttpProxies.list" call.
  89659. // Exactly one of *TargetHttpProxyList or error will be non-nil. Any
  89660. // non-2xx status code is an error. Response headers are in either
  89661. // *TargetHttpProxyList.ServerResponse.Header or (if a response was
  89662. // returned at all) in error.(*googleapi.Error).Header. Use
  89663. // googleapi.IsNotModified to check whether the returned error was
  89664. // because http.StatusNotModified was returned.
  89665. func (c *TargetHttpProxiesListCall) Do(opts ...googleapi.CallOption) (*TargetHttpProxyList, error) {
  89666. gensupport.SetOptions(c.urlParams_, opts...)
  89667. res, err := c.doRequest("json")
  89668. if res != nil && res.StatusCode == http.StatusNotModified {
  89669. if res.Body != nil {
  89670. res.Body.Close()
  89671. }
  89672. return nil, &googleapi.Error{
  89673. Code: res.StatusCode,
  89674. Header: res.Header,
  89675. }
  89676. }
  89677. if err != nil {
  89678. return nil, err
  89679. }
  89680. defer googleapi.CloseBody(res)
  89681. if err := googleapi.CheckResponse(res); err != nil {
  89682. return nil, err
  89683. }
  89684. ret := &TargetHttpProxyList{
  89685. ServerResponse: googleapi.ServerResponse{
  89686. Header: res.Header,
  89687. HTTPStatusCode: res.StatusCode,
  89688. },
  89689. }
  89690. target := &ret
  89691. if err := gensupport.DecodeResponse(target, res); err != nil {
  89692. return nil, err
  89693. }
  89694. return ret, nil
  89695. // {
  89696. // "description": "Retrieves the list of TargetHttpProxy resources available to the specified project.",
  89697. // "httpMethod": "GET",
  89698. // "id": "compute.targetHttpProxies.list",
  89699. // "parameterOrder": [
  89700. // "project"
  89701. // ],
  89702. // "parameters": {
  89703. // "filter": {
  89704. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  89705. // "location": "query",
  89706. // "type": "string"
  89707. // },
  89708. // "maxResults": {
  89709. // "default": "500",
  89710. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  89711. // "format": "uint32",
  89712. // "location": "query",
  89713. // "minimum": "0",
  89714. // "type": "integer"
  89715. // },
  89716. // "orderBy": {
  89717. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  89718. // "location": "query",
  89719. // "type": "string"
  89720. // },
  89721. // "pageToken": {
  89722. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  89723. // "location": "query",
  89724. // "type": "string"
  89725. // },
  89726. // "project": {
  89727. // "description": "Project ID for this request.",
  89728. // "location": "path",
  89729. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  89730. // "required": true,
  89731. // "type": "string"
  89732. // }
  89733. // },
  89734. // "path": "{project}/global/targetHttpProxies",
  89735. // "response": {
  89736. // "$ref": "TargetHttpProxyList"
  89737. // },
  89738. // "scopes": [
  89739. // "https://www.googleapis.com/auth/cloud-platform",
  89740. // "https://www.googleapis.com/auth/compute",
  89741. // "https://www.googleapis.com/auth/compute.readonly"
  89742. // ]
  89743. // }
  89744. }
  89745. // Pages invokes f for each page of results.
  89746. // A non-nil error returned from f will halt the iteration.
  89747. // The provided context supersedes any context provided to the Context method.
  89748. func (c *TargetHttpProxiesListCall) Pages(ctx context.Context, f func(*TargetHttpProxyList) error) error {
  89749. c.ctx_ = ctx
  89750. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  89751. for {
  89752. x, err := c.Do()
  89753. if err != nil {
  89754. return err
  89755. }
  89756. if err := f(x); err != nil {
  89757. return err
  89758. }
  89759. if x.NextPageToken == "" {
  89760. return nil
  89761. }
  89762. c.PageToken(x.NextPageToken)
  89763. }
  89764. }
  89765. // method id "compute.targetHttpProxies.setUrlMap":
  89766. type TargetHttpProxiesSetUrlMapCall struct {
  89767. s *Service
  89768. project string
  89769. targetHttpProxy string
  89770. urlmapreference *UrlMapReference
  89771. urlParams_ gensupport.URLParams
  89772. ctx_ context.Context
  89773. header_ http.Header
  89774. }
  89775. // SetUrlMap: Changes the URL map for TargetHttpProxy.
  89776. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetHttpProxies/setUrlMap
  89777. func (r *TargetHttpProxiesService) SetUrlMap(project string, targetHttpProxy string, urlmapreference *UrlMapReference) *TargetHttpProxiesSetUrlMapCall {
  89778. c := &TargetHttpProxiesSetUrlMapCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  89779. c.project = project
  89780. c.targetHttpProxy = targetHttpProxy
  89781. c.urlmapreference = urlmapreference
  89782. return c
  89783. }
  89784. // RequestId sets the optional parameter "requestId": An optional
  89785. // request ID to identify requests. Specify a unique request ID so that
  89786. // if you must retry your request, the server will know to ignore the
  89787. // request if it has already been completed.
  89788. //
  89789. // For example, consider a situation where you make an initial request
  89790. // and the request times out. If you make the request again with the
  89791. // same request ID, the server can check if original operation with the
  89792. // same request ID was received, and if so, will ignore the second
  89793. // request. This prevents clients from accidentally creating duplicate
  89794. // commitments.
  89795. //
  89796. // The request ID must be a valid UUID with the exception that zero UUID
  89797. // is not supported (00000000-0000-0000-0000-000000000000).
  89798. func (c *TargetHttpProxiesSetUrlMapCall) RequestId(requestId string) *TargetHttpProxiesSetUrlMapCall {
  89799. c.urlParams_.Set("requestId", requestId)
  89800. return c
  89801. }
  89802. // Fields allows partial responses to be retrieved. See
  89803. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  89804. // for more information.
  89805. func (c *TargetHttpProxiesSetUrlMapCall) Fields(s ...googleapi.Field) *TargetHttpProxiesSetUrlMapCall {
  89806. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  89807. return c
  89808. }
  89809. // Context sets the context to be used in this call's Do method. Any
  89810. // pending HTTP request will be aborted if the provided context is
  89811. // canceled.
  89812. func (c *TargetHttpProxiesSetUrlMapCall) Context(ctx context.Context) *TargetHttpProxiesSetUrlMapCall {
  89813. c.ctx_ = ctx
  89814. return c
  89815. }
  89816. // Header returns an http.Header that can be modified by the caller to
  89817. // add HTTP headers to the request.
  89818. func (c *TargetHttpProxiesSetUrlMapCall) Header() http.Header {
  89819. if c.header_ == nil {
  89820. c.header_ = make(http.Header)
  89821. }
  89822. return c.header_
  89823. }
  89824. func (c *TargetHttpProxiesSetUrlMapCall) doRequest(alt string) (*http.Response, error) {
  89825. reqHeaders := make(http.Header)
  89826. for k, v := range c.header_ {
  89827. reqHeaders[k] = v
  89828. }
  89829. reqHeaders.Set("User-Agent", c.s.userAgent())
  89830. var body io.Reader = nil
  89831. body, err := googleapi.WithoutDataWrapper.JSONReader(c.urlmapreference)
  89832. if err != nil {
  89833. return nil, err
  89834. }
  89835. reqHeaders.Set("Content-Type", "application/json")
  89836. c.urlParams_.Set("alt", alt)
  89837. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/targetHttpProxies/{targetHttpProxy}/setUrlMap")
  89838. urls += "?" + c.urlParams_.Encode()
  89839. req, _ := http.NewRequest("POST", urls, body)
  89840. req.Header = reqHeaders
  89841. googleapi.Expand(req.URL, map[string]string{
  89842. "project": c.project,
  89843. "targetHttpProxy": c.targetHttpProxy,
  89844. })
  89845. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  89846. }
  89847. // Do executes the "compute.targetHttpProxies.setUrlMap" call.
  89848. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  89849. // status code is an error. Response headers are in either
  89850. // *Operation.ServerResponse.Header or (if a response was returned at
  89851. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  89852. // to check whether the returned error was because
  89853. // http.StatusNotModified was returned.
  89854. func (c *TargetHttpProxiesSetUrlMapCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  89855. gensupport.SetOptions(c.urlParams_, opts...)
  89856. res, err := c.doRequest("json")
  89857. if res != nil && res.StatusCode == http.StatusNotModified {
  89858. if res.Body != nil {
  89859. res.Body.Close()
  89860. }
  89861. return nil, &googleapi.Error{
  89862. Code: res.StatusCode,
  89863. Header: res.Header,
  89864. }
  89865. }
  89866. if err != nil {
  89867. return nil, err
  89868. }
  89869. defer googleapi.CloseBody(res)
  89870. if err := googleapi.CheckResponse(res); err != nil {
  89871. return nil, err
  89872. }
  89873. ret := &Operation{
  89874. ServerResponse: googleapi.ServerResponse{
  89875. Header: res.Header,
  89876. HTTPStatusCode: res.StatusCode,
  89877. },
  89878. }
  89879. target := &ret
  89880. if err := gensupport.DecodeResponse(target, res); err != nil {
  89881. return nil, err
  89882. }
  89883. return ret, nil
  89884. // {
  89885. // "description": "Changes the URL map for TargetHttpProxy.",
  89886. // "httpMethod": "POST",
  89887. // "id": "compute.targetHttpProxies.setUrlMap",
  89888. // "parameterOrder": [
  89889. // "project",
  89890. // "targetHttpProxy"
  89891. // ],
  89892. // "parameters": {
  89893. // "project": {
  89894. // "description": "Project ID for this request.",
  89895. // "location": "path",
  89896. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  89897. // "required": true,
  89898. // "type": "string"
  89899. // },
  89900. // "requestId": {
  89901. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  89902. // "location": "query",
  89903. // "type": "string"
  89904. // },
  89905. // "targetHttpProxy": {
  89906. // "description": "Name of the TargetHttpProxy to set a URL map for.",
  89907. // "location": "path",
  89908. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  89909. // "required": true,
  89910. // "type": "string"
  89911. // }
  89912. // },
  89913. // "path": "{project}/targetHttpProxies/{targetHttpProxy}/setUrlMap",
  89914. // "request": {
  89915. // "$ref": "UrlMapReference"
  89916. // },
  89917. // "response": {
  89918. // "$ref": "Operation"
  89919. // },
  89920. // "scopes": [
  89921. // "https://www.googleapis.com/auth/cloud-platform",
  89922. // "https://www.googleapis.com/auth/compute"
  89923. // ]
  89924. // }
  89925. }
  89926. // method id "compute.targetHttpProxies.testIamPermissions":
  89927. type TargetHttpProxiesTestIamPermissionsCall struct {
  89928. s *Service
  89929. project string
  89930. resource string
  89931. testpermissionsrequest *TestPermissionsRequest
  89932. urlParams_ gensupport.URLParams
  89933. ctx_ context.Context
  89934. header_ http.Header
  89935. }
  89936. // TestIamPermissions: Returns permissions that a caller has on the
  89937. // specified resource.
  89938. func (r *TargetHttpProxiesService) TestIamPermissions(project string, resource string, testpermissionsrequest *TestPermissionsRequest) *TargetHttpProxiesTestIamPermissionsCall {
  89939. c := &TargetHttpProxiesTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  89940. c.project = project
  89941. c.resource = resource
  89942. c.testpermissionsrequest = testpermissionsrequest
  89943. return c
  89944. }
  89945. // Fields allows partial responses to be retrieved. See
  89946. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  89947. // for more information.
  89948. func (c *TargetHttpProxiesTestIamPermissionsCall) Fields(s ...googleapi.Field) *TargetHttpProxiesTestIamPermissionsCall {
  89949. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  89950. return c
  89951. }
  89952. // Context sets the context to be used in this call's Do method. Any
  89953. // pending HTTP request will be aborted if the provided context is
  89954. // canceled.
  89955. func (c *TargetHttpProxiesTestIamPermissionsCall) Context(ctx context.Context) *TargetHttpProxiesTestIamPermissionsCall {
  89956. c.ctx_ = ctx
  89957. return c
  89958. }
  89959. // Header returns an http.Header that can be modified by the caller to
  89960. // add HTTP headers to the request.
  89961. func (c *TargetHttpProxiesTestIamPermissionsCall) Header() http.Header {
  89962. if c.header_ == nil {
  89963. c.header_ = make(http.Header)
  89964. }
  89965. return c.header_
  89966. }
  89967. func (c *TargetHttpProxiesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  89968. reqHeaders := make(http.Header)
  89969. for k, v := range c.header_ {
  89970. reqHeaders[k] = v
  89971. }
  89972. reqHeaders.Set("User-Agent", c.s.userAgent())
  89973. var body io.Reader = nil
  89974. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  89975. if err != nil {
  89976. return nil, err
  89977. }
  89978. reqHeaders.Set("Content-Type", "application/json")
  89979. c.urlParams_.Set("alt", alt)
  89980. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetHttpProxies/{resource}/testIamPermissions")
  89981. urls += "?" + c.urlParams_.Encode()
  89982. req, _ := http.NewRequest("POST", urls, body)
  89983. req.Header = reqHeaders
  89984. googleapi.Expand(req.URL, map[string]string{
  89985. "project": c.project,
  89986. "resource": c.resource,
  89987. })
  89988. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  89989. }
  89990. // Do executes the "compute.targetHttpProxies.testIamPermissions" call.
  89991. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  89992. // non-2xx status code is an error. Response headers are in either
  89993. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  89994. // returned at all) in error.(*googleapi.Error).Header. Use
  89995. // googleapi.IsNotModified to check whether the returned error was
  89996. // because http.StatusNotModified was returned.
  89997. func (c *TargetHttpProxiesTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  89998. gensupport.SetOptions(c.urlParams_, opts...)
  89999. res, err := c.doRequest("json")
  90000. if res != nil && res.StatusCode == http.StatusNotModified {
  90001. if res.Body != nil {
  90002. res.Body.Close()
  90003. }
  90004. return nil, &googleapi.Error{
  90005. Code: res.StatusCode,
  90006. Header: res.Header,
  90007. }
  90008. }
  90009. if err != nil {
  90010. return nil, err
  90011. }
  90012. defer googleapi.CloseBody(res)
  90013. if err := googleapi.CheckResponse(res); err != nil {
  90014. return nil, err
  90015. }
  90016. ret := &TestPermissionsResponse{
  90017. ServerResponse: googleapi.ServerResponse{
  90018. Header: res.Header,
  90019. HTTPStatusCode: res.StatusCode,
  90020. },
  90021. }
  90022. target := &ret
  90023. if err := gensupport.DecodeResponse(target, res); err != nil {
  90024. return nil, err
  90025. }
  90026. return ret, nil
  90027. // {
  90028. // "description": "Returns permissions that a caller has on the specified resource.",
  90029. // "httpMethod": "POST",
  90030. // "id": "compute.targetHttpProxies.testIamPermissions",
  90031. // "parameterOrder": [
  90032. // "project",
  90033. // "resource"
  90034. // ],
  90035. // "parameters": {
  90036. // "project": {
  90037. // "description": "Project ID for this request.",
  90038. // "location": "path",
  90039. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  90040. // "required": true,
  90041. // "type": "string"
  90042. // },
  90043. // "resource": {
  90044. // "description": "Name of the resource for this request.",
  90045. // "location": "path",
  90046. // "pattern": "(?:[-a-z0-9_]{0,62}[a-z0-9])?",
  90047. // "required": true,
  90048. // "type": "string"
  90049. // }
  90050. // },
  90051. // "path": "{project}/global/targetHttpProxies/{resource}/testIamPermissions",
  90052. // "request": {
  90053. // "$ref": "TestPermissionsRequest"
  90054. // },
  90055. // "response": {
  90056. // "$ref": "TestPermissionsResponse"
  90057. // },
  90058. // "scopes": [
  90059. // "https://www.googleapis.com/auth/cloud-platform",
  90060. // "https://www.googleapis.com/auth/compute",
  90061. // "https://www.googleapis.com/auth/compute.readonly"
  90062. // ]
  90063. // }
  90064. }
  90065. // method id "compute.targetHttpsProxies.delete":
  90066. type TargetHttpsProxiesDeleteCall struct {
  90067. s *Service
  90068. project string
  90069. targetHttpsProxy string
  90070. urlParams_ gensupport.URLParams
  90071. ctx_ context.Context
  90072. header_ http.Header
  90073. }
  90074. // Delete: Deletes the specified TargetHttpsProxy resource.
  90075. func (r *TargetHttpsProxiesService) Delete(project string, targetHttpsProxy string) *TargetHttpsProxiesDeleteCall {
  90076. c := &TargetHttpsProxiesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  90077. c.project = project
  90078. c.targetHttpsProxy = targetHttpsProxy
  90079. return c
  90080. }
  90081. // RequestId sets the optional parameter "requestId": An optional
  90082. // request ID to identify requests. Specify a unique request ID so that
  90083. // if you must retry your request, the server will know to ignore the
  90084. // request if it has already been completed.
  90085. //
  90086. // For example, consider a situation where you make an initial request
  90087. // and the request times out. If you make the request again with the
  90088. // same request ID, the server can check if original operation with the
  90089. // same request ID was received, and if so, will ignore the second
  90090. // request. This prevents clients from accidentally creating duplicate
  90091. // commitments.
  90092. //
  90093. // The request ID must be a valid UUID with the exception that zero UUID
  90094. // is not supported (00000000-0000-0000-0000-000000000000).
  90095. func (c *TargetHttpsProxiesDeleteCall) RequestId(requestId string) *TargetHttpsProxiesDeleteCall {
  90096. c.urlParams_.Set("requestId", requestId)
  90097. return c
  90098. }
  90099. // Fields allows partial responses to be retrieved. See
  90100. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  90101. // for more information.
  90102. func (c *TargetHttpsProxiesDeleteCall) Fields(s ...googleapi.Field) *TargetHttpsProxiesDeleteCall {
  90103. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  90104. return c
  90105. }
  90106. // Context sets the context to be used in this call's Do method. Any
  90107. // pending HTTP request will be aborted if the provided context is
  90108. // canceled.
  90109. func (c *TargetHttpsProxiesDeleteCall) Context(ctx context.Context) *TargetHttpsProxiesDeleteCall {
  90110. c.ctx_ = ctx
  90111. return c
  90112. }
  90113. // Header returns an http.Header that can be modified by the caller to
  90114. // add HTTP headers to the request.
  90115. func (c *TargetHttpsProxiesDeleteCall) Header() http.Header {
  90116. if c.header_ == nil {
  90117. c.header_ = make(http.Header)
  90118. }
  90119. return c.header_
  90120. }
  90121. func (c *TargetHttpsProxiesDeleteCall) doRequest(alt string) (*http.Response, error) {
  90122. reqHeaders := make(http.Header)
  90123. for k, v := range c.header_ {
  90124. reqHeaders[k] = v
  90125. }
  90126. reqHeaders.Set("User-Agent", c.s.userAgent())
  90127. var body io.Reader = nil
  90128. c.urlParams_.Set("alt", alt)
  90129. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetHttpsProxies/{targetHttpsProxy}")
  90130. urls += "?" + c.urlParams_.Encode()
  90131. req, _ := http.NewRequest("DELETE", urls, body)
  90132. req.Header = reqHeaders
  90133. googleapi.Expand(req.URL, map[string]string{
  90134. "project": c.project,
  90135. "targetHttpsProxy": c.targetHttpsProxy,
  90136. })
  90137. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  90138. }
  90139. // Do executes the "compute.targetHttpsProxies.delete" call.
  90140. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  90141. // status code is an error. Response headers are in either
  90142. // *Operation.ServerResponse.Header or (if a response was returned at
  90143. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  90144. // to check whether the returned error was because
  90145. // http.StatusNotModified was returned.
  90146. func (c *TargetHttpsProxiesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  90147. gensupport.SetOptions(c.urlParams_, opts...)
  90148. res, err := c.doRequest("json")
  90149. if res != nil && res.StatusCode == http.StatusNotModified {
  90150. if res.Body != nil {
  90151. res.Body.Close()
  90152. }
  90153. return nil, &googleapi.Error{
  90154. Code: res.StatusCode,
  90155. Header: res.Header,
  90156. }
  90157. }
  90158. if err != nil {
  90159. return nil, err
  90160. }
  90161. defer googleapi.CloseBody(res)
  90162. if err := googleapi.CheckResponse(res); err != nil {
  90163. return nil, err
  90164. }
  90165. ret := &Operation{
  90166. ServerResponse: googleapi.ServerResponse{
  90167. Header: res.Header,
  90168. HTTPStatusCode: res.StatusCode,
  90169. },
  90170. }
  90171. target := &ret
  90172. if err := gensupport.DecodeResponse(target, res); err != nil {
  90173. return nil, err
  90174. }
  90175. return ret, nil
  90176. // {
  90177. // "description": "Deletes the specified TargetHttpsProxy resource.",
  90178. // "httpMethod": "DELETE",
  90179. // "id": "compute.targetHttpsProxies.delete",
  90180. // "parameterOrder": [
  90181. // "project",
  90182. // "targetHttpsProxy"
  90183. // ],
  90184. // "parameters": {
  90185. // "project": {
  90186. // "description": "Project ID for this request.",
  90187. // "location": "path",
  90188. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  90189. // "required": true,
  90190. // "type": "string"
  90191. // },
  90192. // "requestId": {
  90193. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  90194. // "location": "query",
  90195. // "type": "string"
  90196. // },
  90197. // "targetHttpsProxy": {
  90198. // "description": "Name of the TargetHttpsProxy resource to delete.",
  90199. // "location": "path",
  90200. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  90201. // "required": true,
  90202. // "type": "string"
  90203. // }
  90204. // },
  90205. // "path": "{project}/global/targetHttpsProxies/{targetHttpsProxy}",
  90206. // "response": {
  90207. // "$ref": "Operation"
  90208. // },
  90209. // "scopes": [
  90210. // "https://www.googleapis.com/auth/cloud-platform",
  90211. // "https://www.googleapis.com/auth/compute"
  90212. // ]
  90213. // }
  90214. }
  90215. // method id "compute.targetHttpsProxies.get":
  90216. type TargetHttpsProxiesGetCall struct {
  90217. s *Service
  90218. project string
  90219. targetHttpsProxy string
  90220. urlParams_ gensupport.URLParams
  90221. ifNoneMatch_ string
  90222. ctx_ context.Context
  90223. header_ http.Header
  90224. }
  90225. // Get: Returns the specified TargetHttpsProxy resource. Gets a list of
  90226. // available target HTTPS proxies by making a list() request.
  90227. func (r *TargetHttpsProxiesService) Get(project string, targetHttpsProxy string) *TargetHttpsProxiesGetCall {
  90228. c := &TargetHttpsProxiesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  90229. c.project = project
  90230. c.targetHttpsProxy = targetHttpsProxy
  90231. return c
  90232. }
  90233. // Fields allows partial responses to be retrieved. See
  90234. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  90235. // for more information.
  90236. func (c *TargetHttpsProxiesGetCall) Fields(s ...googleapi.Field) *TargetHttpsProxiesGetCall {
  90237. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  90238. return c
  90239. }
  90240. // IfNoneMatch sets the optional parameter which makes the operation
  90241. // fail if the object's ETag matches the given value. This is useful for
  90242. // getting updates only after the object has changed since the last
  90243. // request. Use googleapi.IsNotModified to check whether the response
  90244. // error from Do is the result of In-None-Match.
  90245. func (c *TargetHttpsProxiesGetCall) IfNoneMatch(entityTag string) *TargetHttpsProxiesGetCall {
  90246. c.ifNoneMatch_ = entityTag
  90247. return c
  90248. }
  90249. // Context sets the context to be used in this call's Do method. Any
  90250. // pending HTTP request will be aborted if the provided context is
  90251. // canceled.
  90252. func (c *TargetHttpsProxiesGetCall) Context(ctx context.Context) *TargetHttpsProxiesGetCall {
  90253. c.ctx_ = ctx
  90254. return c
  90255. }
  90256. // Header returns an http.Header that can be modified by the caller to
  90257. // add HTTP headers to the request.
  90258. func (c *TargetHttpsProxiesGetCall) Header() http.Header {
  90259. if c.header_ == nil {
  90260. c.header_ = make(http.Header)
  90261. }
  90262. return c.header_
  90263. }
  90264. func (c *TargetHttpsProxiesGetCall) doRequest(alt string) (*http.Response, error) {
  90265. reqHeaders := make(http.Header)
  90266. for k, v := range c.header_ {
  90267. reqHeaders[k] = v
  90268. }
  90269. reqHeaders.Set("User-Agent", c.s.userAgent())
  90270. if c.ifNoneMatch_ != "" {
  90271. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  90272. }
  90273. var body io.Reader = nil
  90274. c.urlParams_.Set("alt", alt)
  90275. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetHttpsProxies/{targetHttpsProxy}")
  90276. urls += "?" + c.urlParams_.Encode()
  90277. req, _ := http.NewRequest("GET", urls, body)
  90278. req.Header = reqHeaders
  90279. googleapi.Expand(req.URL, map[string]string{
  90280. "project": c.project,
  90281. "targetHttpsProxy": c.targetHttpsProxy,
  90282. })
  90283. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  90284. }
  90285. // Do executes the "compute.targetHttpsProxies.get" call.
  90286. // Exactly one of *TargetHttpsProxy or error will be non-nil. Any
  90287. // non-2xx status code is an error. Response headers are in either
  90288. // *TargetHttpsProxy.ServerResponse.Header or (if a response was
  90289. // returned at all) in error.(*googleapi.Error).Header. Use
  90290. // googleapi.IsNotModified to check whether the returned error was
  90291. // because http.StatusNotModified was returned.
  90292. func (c *TargetHttpsProxiesGetCall) Do(opts ...googleapi.CallOption) (*TargetHttpsProxy, error) {
  90293. gensupport.SetOptions(c.urlParams_, opts...)
  90294. res, err := c.doRequest("json")
  90295. if res != nil && res.StatusCode == http.StatusNotModified {
  90296. if res.Body != nil {
  90297. res.Body.Close()
  90298. }
  90299. return nil, &googleapi.Error{
  90300. Code: res.StatusCode,
  90301. Header: res.Header,
  90302. }
  90303. }
  90304. if err != nil {
  90305. return nil, err
  90306. }
  90307. defer googleapi.CloseBody(res)
  90308. if err := googleapi.CheckResponse(res); err != nil {
  90309. return nil, err
  90310. }
  90311. ret := &TargetHttpsProxy{
  90312. ServerResponse: googleapi.ServerResponse{
  90313. Header: res.Header,
  90314. HTTPStatusCode: res.StatusCode,
  90315. },
  90316. }
  90317. target := &ret
  90318. if err := gensupport.DecodeResponse(target, res); err != nil {
  90319. return nil, err
  90320. }
  90321. return ret, nil
  90322. // {
  90323. // "description": "Returns the specified TargetHttpsProxy resource. Gets a list of available target HTTPS proxies by making a list() request.",
  90324. // "httpMethod": "GET",
  90325. // "id": "compute.targetHttpsProxies.get",
  90326. // "parameterOrder": [
  90327. // "project",
  90328. // "targetHttpsProxy"
  90329. // ],
  90330. // "parameters": {
  90331. // "project": {
  90332. // "description": "Project ID for this request.",
  90333. // "location": "path",
  90334. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  90335. // "required": true,
  90336. // "type": "string"
  90337. // },
  90338. // "targetHttpsProxy": {
  90339. // "description": "Name of the TargetHttpsProxy resource to return.",
  90340. // "location": "path",
  90341. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  90342. // "required": true,
  90343. // "type": "string"
  90344. // }
  90345. // },
  90346. // "path": "{project}/global/targetHttpsProxies/{targetHttpsProxy}",
  90347. // "response": {
  90348. // "$ref": "TargetHttpsProxy"
  90349. // },
  90350. // "scopes": [
  90351. // "https://www.googleapis.com/auth/cloud-platform",
  90352. // "https://www.googleapis.com/auth/compute",
  90353. // "https://www.googleapis.com/auth/compute.readonly"
  90354. // ]
  90355. // }
  90356. }
  90357. // method id "compute.targetHttpsProxies.insert":
  90358. type TargetHttpsProxiesInsertCall struct {
  90359. s *Service
  90360. project string
  90361. targethttpsproxy *TargetHttpsProxy
  90362. urlParams_ gensupport.URLParams
  90363. ctx_ context.Context
  90364. header_ http.Header
  90365. }
  90366. // Insert: Creates a TargetHttpsProxy resource in the specified project
  90367. // using the data included in the request.
  90368. func (r *TargetHttpsProxiesService) Insert(project string, targethttpsproxy *TargetHttpsProxy) *TargetHttpsProxiesInsertCall {
  90369. c := &TargetHttpsProxiesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  90370. c.project = project
  90371. c.targethttpsproxy = targethttpsproxy
  90372. return c
  90373. }
  90374. // RequestId sets the optional parameter "requestId": An optional
  90375. // request ID to identify requests. Specify a unique request ID so that
  90376. // if you must retry your request, the server will know to ignore the
  90377. // request if it has already been completed.
  90378. //
  90379. // For example, consider a situation where you make an initial request
  90380. // and the request times out. If you make the request again with the
  90381. // same request ID, the server can check if original operation with the
  90382. // same request ID was received, and if so, will ignore the second
  90383. // request. This prevents clients from accidentally creating duplicate
  90384. // commitments.
  90385. //
  90386. // The request ID must be a valid UUID with the exception that zero UUID
  90387. // is not supported (00000000-0000-0000-0000-000000000000).
  90388. func (c *TargetHttpsProxiesInsertCall) RequestId(requestId string) *TargetHttpsProxiesInsertCall {
  90389. c.urlParams_.Set("requestId", requestId)
  90390. return c
  90391. }
  90392. // Fields allows partial responses to be retrieved. See
  90393. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  90394. // for more information.
  90395. func (c *TargetHttpsProxiesInsertCall) Fields(s ...googleapi.Field) *TargetHttpsProxiesInsertCall {
  90396. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  90397. return c
  90398. }
  90399. // Context sets the context to be used in this call's Do method. Any
  90400. // pending HTTP request will be aborted if the provided context is
  90401. // canceled.
  90402. func (c *TargetHttpsProxiesInsertCall) Context(ctx context.Context) *TargetHttpsProxiesInsertCall {
  90403. c.ctx_ = ctx
  90404. return c
  90405. }
  90406. // Header returns an http.Header that can be modified by the caller to
  90407. // add HTTP headers to the request.
  90408. func (c *TargetHttpsProxiesInsertCall) Header() http.Header {
  90409. if c.header_ == nil {
  90410. c.header_ = make(http.Header)
  90411. }
  90412. return c.header_
  90413. }
  90414. func (c *TargetHttpsProxiesInsertCall) doRequest(alt string) (*http.Response, error) {
  90415. reqHeaders := make(http.Header)
  90416. for k, v := range c.header_ {
  90417. reqHeaders[k] = v
  90418. }
  90419. reqHeaders.Set("User-Agent", c.s.userAgent())
  90420. var body io.Reader = nil
  90421. body, err := googleapi.WithoutDataWrapper.JSONReader(c.targethttpsproxy)
  90422. if err != nil {
  90423. return nil, err
  90424. }
  90425. reqHeaders.Set("Content-Type", "application/json")
  90426. c.urlParams_.Set("alt", alt)
  90427. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetHttpsProxies")
  90428. urls += "?" + c.urlParams_.Encode()
  90429. req, _ := http.NewRequest("POST", urls, body)
  90430. req.Header = reqHeaders
  90431. googleapi.Expand(req.URL, map[string]string{
  90432. "project": c.project,
  90433. })
  90434. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  90435. }
  90436. // Do executes the "compute.targetHttpsProxies.insert" call.
  90437. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  90438. // status code is an error. Response headers are in either
  90439. // *Operation.ServerResponse.Header or (if a response was returned at
  90440. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  90441. // to check whether the returned error was because
  90442. // http.StatusNotModified was returned.
  90443. func (c *TargetHttpsProxiesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  90444. gensupport.SetOptions(c.urlParams_, opts...)
  90445. res, err := c.doRequest("json")
  90446. if res != nil && res.StatusCode == http.StatusNotModified {
  90447. if res.Body != nil {
  90448. res.Body.Close()
  90449. }
  90450. return nil, &googleapi.Error{
  90451. Code: res.StatusCode,
  90452. Header: res.Header,
  90453. }
  90454. }
  90455. if err != nil {
  90456. return nil, err
  90457. }
  90458. defer googleapi.CloseBody(res)
  90459. if err := googleapi.CheckResponse(res); err != nil {
  90460. return nil, err
  90461. }
  90462. ret := &Operation{
  90463. ServerResponse: googleapi.ServerResponse{
  90464. Header: res.Header,
  90465. HTTPStatusCode: res.StatusCode,
  90466. },
  90467. }
  90468. target := &ret
  90469. if err := gensupport.DecodeResponse(target, res); err != nil {
  90470. return nil, err
  90471. }
  90472. return ret, nil
  90473. // {
  90474. // "description": "Creates a TargetHttpsProxy resource in the specified project using the data included in the request.",
  90475. // "httpMethod": "POST",
  90476. // "id": "compute.targetHttpsProxies.insert",
  90477. // "parameterOrder": [
  90478. // "project"
  90479. // ],
  90480. // "parameters": {
  90481. // "project": {
  90482. // "description": "Project ID for this request.",
  90483. // "location": "path",
  90484. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  90485. // "required": true,
  90486. // "type": "string"
  90487. // },
  90488. // "requestId": {
  90489. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  90490. // "location": "query",
  90491. // "type": "string"
  90492. // }
  90493. // },
  90494. // "path": "{project}/global/targetHttpsProxies",
  90495. // "request": {
  90496. // "$ref": "TargetHttpsProxy"
  90497. // },
  90498. // "response": {
  90499. // "$ref": "Operation"
  90500. // },
  90501. // "scopes": [
  90502. // "https://www.googleapis.com/auth/cloud-platform",
  90503. // "https://www.googleapis.com/auth/compute"
  90504. // ]
  90505. // }
  90506. }
  90507. // method id "compute.targetHttpsProxies.list":
  90508. type TargetHttpsProxiesListCall struct {
  90509. s *Service
  90510. project string
  90511. urlParams_ gensupport.URLParams
  90512. ifNoneMatch_ string
  90513. ctx_ context.Context
  90514. header_ http.Header
  90515. }
  90516. // List: Retrieves the list of TargetHttpsProxy resources available to
  90517. // the specified project.
  90518. func (r *TargetHttpsProxiesService) List(project string) *TargetHttpsProxiesListCall {
  90519. c := &TargetHttpsProxiesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  90520. c.project = project
  90521. return c
  90522. }
  90523. // Filter sets the optional parameter "filter": A filter expression that
  90524. // filters resources listed in the response. The expression must specify
  90525. // the field name, a comparison operator, and the value that you want to
  90526. // use for filtering. The value must be a string, a number, or a
  90527. // boolean. The comparison operator must be either =, !=, >, or <.
  90528. //
  90529. // For example, if you are filtering Compute Engine instances, you can
  90530. // exclude instances named example-instance by specifying name !=
  90531. // example-instance.
  90532. //
  90533. // You can also filter nested fields. For example, you could specify
  90534. // scheduling.automaticRestart = false to include instances only if they
  90535. // are not scheduled for automatic restarts. You can use filtering on
  90536. // nested fields to filter based on resource labels.
  90537. //
  90538. // To filter on multiple expressions, provide each separate expression
  90539. // within parentheses. For example, (scheduling.automaticRestart = true)
  90540. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  90541. // AND expression. However, you can include AND and OR expressions
  90542. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  90543. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  90544. // true).
  90545. func (c *TargetHttpsProxiesListCall) Filter(filter string) *TargetHttpsProxiesListCall {
  90546. c.urlParams_.Set("filter", filter)
  90547. return c
  90548. }
  90549. // MaxResults sets the optional parameter "maxResults": The maximum
  90550. // number of results per page that should be returned. If the number of
  90551. // available results is larger than maxResults, Compute Engine returns a
  90552. // nextPageToken that can be used to get the next page of results in
  90553. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  90554. // (Default: 500)
  90555. func (c *TargetHttpsProxiesListCall) MaxResults(maxResults int64) *TargetHttpsProxiesListCall {
  90556. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  90557. return c
  90558. }
  90559. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  90560. // a certain order. By default, results are returned in alphanumerical
  90561. // order based on the resource name.
  90562. //
  90563. // You can also sort results in descending order based on the creation
  90564. // timestamp using orderBy="creationTimestamp desc". This sorts results
  90565. // based on the creationTimestamp field in reverse chronological order
  90566. // (newest result first). Use this to sort resources like operations so
  90567. // that the newest operation is returned first.
  90568. //
  90569. // Currently, only sorting by name or creationTimestamp desc is
  90570. // supported.
  90571. func (c *TargetHttpsProxiesListCall) OrderBy(orderBy string) *TargetHttpsProxiesListCall {
  90572. c.urlParams_.Set("orderBy", orderBy)
  90573. return c
  90574. }
  90575. // PageToken sets the optional parameter "pageToken": Specifies a page
  90576. // token to use. Set pageToken to the nextPageToken returned by a
  90577. // previous list request to get the next page of results.
  90578. func (c *TargetHttpsProxiesListCall) PageToken(pageToken string) *TargetHttpsProxiesListCall {
  90579. c.urlParams_.Set("pageToken", pageToken)
  90580. return c
  90581. }
  90582. // Fields allows partial responses to be retrieved. See
  90583. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  90584. // for more information.
  90585. func (c *TargetHttpsProxiesListCall) Fields(s ...googleapi.Field) *TargetHttpsProxiesListCall {
  90586. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  90587. return c
  90588. }
  90589. // IfNoneMatch sets the optional parameter which makes the operation
  90590. // fail if the object's ETag matches the given value. This is useful for
  90591. // getting updates only after the object has changed since the last
  90592. // request. Use googleapi.IsNotModified to check whether the response
  90593. // error from Do is the result of In-None-Match.
  90594. func (c *TargetHttpsProxiesListCall) IfNoneMatch(entityTag string) *TargetHttpsProxiesListCall {
  90595. c.ifNoneMatch_ = entityTag
  90596. return c
  90597. }
  90598. // Context sets the context to be used in this call's Do method. Any
  90599. // pending HTTP request will be aborted if the provided context is
  90600. // canceled.
  90601. func (c *TargetHttpsProxiesListCall) Context(ctx context.Context) *TargetHttpsProxiesListCall {
  90602. c.ctx_ = ctx
  90603. return c
  90604. }
  90605. // Header returns an http.Header that can be modified by the caller to
  90606. // add HTTP headers to the request.
  90607. func (c *TargetHttpsProxiesListCall) Header() http.Header {
  90608. if c.header_ == nil {
  90609. c.header_ = make(http.Header)
  90610. }
  90611. return c.header_
  90612. }
  90613. func (c *TargetHttpsProxiesListCall) doRequest(alt string) (*http.Response, error) {
  90614. reqHeaders := make(http.Header)
  90615. for k, v := range c.header_ {
  90616. reqHeaders[k] = v
  90617. }
  90618. reqHeaders.Set("User-Agent", c.s.userAgent())
  90619. if c.ifNoneMatch_ != "" {
  90620. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  90621. }
  90622. var body io.Reader = nil
  90623. c.urlParams_.Set("alt", alt)
  90624. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetHttpsProxies")
  90625. urls += "?" + c.urlParams_.Encode()
  90626. req, _ := http.NewRequest("GET", urls, body)
  90627. req.Header = reqHeaders
  90628. googleapi.Expand(req.URL, map[string]string{
  90629. "project": c.project,
  90630. })
  90631. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  90632. }
  90633. // Do executes the "compute.targetHttpsProxies.list" call.
  90634. // Exactly one of *TargetHttpsProxyList or error will be non-nil. Any
  90635. // non-2xx status code is an error. Response headers are in either
  90636. // *TargetHttpsProxyList.ServerResponse.Header or (if a response was
  90637. // returned at all) in error.(*googleapi.Error).Header. Use
  90638. // googleapi.IsNotModified to check whether the returned error was
  90639. // because http.StatusNotModified was returned.
  90640. func (c *TargetHttpsProxiesListCall) Do(opts ...googleapi.CallOption) (*TargetHttpsProxyList, error) {
  90641. gensupport.SetOptions(c.urlParams_, opts...)
  90642. res, err := c.doRequest("json")
  90643. if res != nil && res.StatusCode == http.StatusNotModified {
  90644. if res.Body != nil {
  90645. res.Body.Close()
  90646. }
  90647. return nil, &googleapi.Error{
  90648. Code: res.StatusCode,
  90649. Header: res.Header,
  90650. }
  90651. }
  90652. if err != nil {
  90653. return nil, err
  90654. }
  90655. defer googleapi.CloseBody(res)
  90656. if err := googleapi.CheckResponse(res); err != nil {
  90657. return nil, err
  90658. }
  90659. ret := &TargetHttpsProxyList{
  90660. ServerResponse: googleapi.ServerResponse{
  90661. Header: res.Header,
  90662. HTTPStatusCode: res.StatusCode,
  90663. },
  90664. }
  90665. target := &ret
  90666. if err := gensupport.DecodeResponse(target, res); err != nil {
  90667. return nil, err
  90668. }
  90669. return ret, nil
  90670. // {
  90671. // "description": "Retrieves the list of TargetHttpsProxy resources available to the specified project.",
  90672. // "httpMethod": "GET",
  90673. // "id": "compute.targetHttpsProxies.list",
  90674. // "parameterOrder": [
  90675. // "project"
  90676. // ],
  90677. // "parameters": {
  90678. // "filter": {
  90679. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  90680. // "location": "query",
  90681. // "type": "string"
  90682. // },
  90683. // "maxResults": {
  90684. // "default": "500",
  90685. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  90686. // "format": "uint32",
  90687. // "location": "query",
  90688. // "minimum": "0",
  90689. // "type": "integer"
  90690. // },
  90691. // "orderBy": {
  90692. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  90693. // "location": "query",
  90694. // "type": "string"
  90695. // },
  90696. // "pageToken": {
  90697. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  90698. // "location": "query",
  90699. // "type": "string"
  90700. // },
  90701. // "project": {
  90702. // "description": "Project ID for this request.",
  90703. // "location": "path",
  90704. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  90705. // "required": true,
  90706. // "type": "string"
  90707. // }
  90708. // },
  90709. // "path": "{project}/global/targetHttpsProxies",
  90710. // "response": {
  90711. // "$ref": "TargetHttpsProxyList"
  90712. // },
  90713. // "scopes": [
  90714. // "https://www.googleapis.com/auth/cloud-platform",
  90715. // "https://www.googleapis.com/auth/compute",
  90716. // "https://www.googleapis.com/auth/compute.readonly"
  90717. // ]
  90718. // }
  90719. }
  90720. // Pages invokes f for each page of results.
  90721. // A non-nil error returned from f will halt the iteration.
  90722. // The provided context supersedes any context provided to the Context method.
  90723. func (c *TargetHttpsProxiesListCall) Pages(ctx context.Context, f func(*TargetHttpsProxyList) error) error {
  90724. c.ctx_ = ctx
  90725. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  90726. for {
  90727. x, err := c.Do()
  90728. if err != nil {
  90729. return err
  90730. }
  90731. if err := f(x); err != nil {
  90732. return err
  90733. }
  90734. if x.NextPageToken == "" {
  90735. return nil
  90736. }
  90737. c.PageToken(x.NextPageToken)
  90738. }
  90739. }
  90740. // method id "compute.targetHttpsProxies.setQuicOverride":
  90741. type TargetHttpsProxiesSetQuicOverrideCall struct {
  90742. s *Service
  90743. project string
  90744. targetHttpsProxy string
  90745. targethttpsproxiessetquicoverriderequest *TargetHttpsProxiesSetQuicOverrideRequest
  90746. urlParams_ gensupport.URLParams
  90747. ctx_ context.Context
  90748. header_ http.Header
  90749. }
  90750. // SetQuicOverride: Sets the QUIC override policy for TargetHttpsProxy.
  90751. func (r *TargetHttpsProxiesService) SetQuicOverride(project string, targetHttpsProxy string, targethttpsproxiessetquicoverriderequest *TargetHttpsProxiesSetQuicOverrideRequest) *TargetHttpsProxiesSetQuicOverrideCall {
  90752. c := &TargetHttpsProxiesSetQuicOverrideCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  90753. c.project = project
  90754. c.targetHttpsProxy = targetHttpsProxy
  90755. c.targethttpsproxiessetquicoverriderequest = targethttpsproxiessetquicoverriderequest
  90756. return c
  90757. }
  90758. // RequestId sets the optional parameter "requestId": An optional
  90759. // request ID to identify requests. Specify a unique request ID so that
  90760. // if you must retry your request, the server will know to ignore the
  90761. // request if it has already been completed.
  90762. //
  90763. // For example, consider a situation where you make an initial request
  90764. // and the request times out. If you make the request again with the
  90765. // same request ID, the server can check if original operation with the
  90766. // same request ID was received, and if so, will ignore the second
  90767. // request. This prevents clients from accidentally creating duplicate
  90768. // commitments.
  90769. //
  90770. // The request ID must be a valid UUID with the exception that zero UUID
  90771. // is not supported (00000000-0000-0000-0000-000000000000).
  90772. func (c *TargetHttpsProxiesSetQuicOverrideCall) RequestId(requestId string) *TargetHttpsProxiesSetQuicOverrideCall {
  90773. c.urlParams_.Set("requestId", requestId)
  90774. return c
  90775. }
  90776. // Fields allows partial responses to be retrieved. See
  90777. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  90778. // for more information.
  90779. func (c *TargetHttpsProxiesSetQuicOverrideCall) Fields(s ...googleapi.Field) *TargetHttpsProxiesSetQuicOverrideCall {
  90780. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  90781. return c
  90782. }
  90783. // Context sets the context to be used in this call's Do method. Any
  90784. // pending HTTP request will be aborted if the provided context is
  90785. // canceled.
  90786. func (c *TargetHttpsProxiesSetQuicOverrideCall) Context(ctx context.Context) *TargetHttpsProxiesSetQuicOverrideCall {
  90787. c.ctx_ = ctx
  90788. return c
  90789. }
  90790. // Header returns an http.Header that can be modified by the caller to
  90791. // add HTTP headers to the request.
  90792. func (c *TargetHttpsProxiesSetQuicOverrideCall) Header() http.Header {
  90793. if c.header_ == nil {
  90794. c.header_ = make(http.Header)
  90795. }
  90796. return c.header_
  90797. }
  90798. func (c *TargetHttpsProxiesSetQuicOverrideCall) doRequest(alt string) (*http.Response, error) {
  90799. reqHeaders := make(http.Header)
  90800. for k, v := range c.header_ {
  90801. reqHeaders[k] = v
  90802. }
  90803. reqHeaders.Set("User-Agent", c.s.userAgent())
  90804. var body io.Reader = nil
  90805. body, err := googleapi.WithoutDataWrapper.JSONReader(c.targethttpsproxiessetquicoverriderequest)
  90806. if err != nil {
  90807. return nil, err
  90808. }
  90809. reqHeaders.Set("Content-Type", "application/json")
  90810. c.urlParams_.Set("alt", alt)
  90811. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetHttpsProxies/{targetHttpsProxy}/setQuicOverride")
  90812. urls += "?" + c.urlParams_.Encode()
  90813. req, _ := http.NewRequest("POST", urls, body)
  90814. req.Header = reqHeaders
  90815. googleapi.Expand(req.URL, map[string]string{
  90816. "project": c.project,
  90817. "targetHttpsProxy": c.targetHttpsProxy,
  90818. })
  90819. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  90820. }
  90821. // Do executes the "compute.targetHttpsProxies.setQuicOverride" call.
  90822. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  90823. // status code is an error. Response headers are in either
  90824. // *Operation.ServerResponse.Header or (if a response was returned at
  90825. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  90826. // to check whether the returned error was because
  90827. // http.StatusNotModified was returned.
  90828. func (c *TargetHttpsProxiesSetQuicOverrideCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  90829. gensupport.SetOptions(c.urlParams_, opts...)
  90830. res, err := c.doRequest("json")
  90831. if res != nil && res.StatusCode == http.StatusNotModified {
  90832. if res.Body != nil {
  90833. res.Body.Close()
  90834. }
  90835. return nil, &googleapi.Error{
  90836. Code: res.StatusCode,
  90837. Header: res.Header,
  90838. }
  90839. }
  90840. if err != nil {
  90841. return nil, err
  90842. }
  90843. defer googleapi.CloseBody(res)
  90844. if err := googleapi.CheckResponse(res); err != nil {
  90845. return nil, err
  90846. }
  90847. ret := &Operation{
  90848. ServerResponse: googleapi.ServerResponse{
  90849. Header: res.Header,
  90850. HTTPStatusCode: res.StatusCode,
  90851. },
  90852. }
  90853. target := &ret
  90854. if err := gensupport.DecodeResponse(target, res); err != nil {
  90855. return nil, err
  90856. }
  90857. return ret, nil
  90858. // {
  90859. // "description": "Sets the QUIC override policy for TargetHttpsProxy.",
  90860. // "httpMethod": "POST",
  90861. // "id": "compute.targetHttpsProxies.setQuicOverride",
  90862. // "parameterOrder": [
  90863. // "project",
  90864. // "targetHttpsProxy"
  90865. // ],
  90866. // "parameters": {
  90867. // "project": {
  90868. // "description": "Project ID for this request.",
  90869. // "location": "path",
  90870. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  90871. // "required": true,
  90872. // "type": "string"
  90873. // },
  90874. // "requestId": {
  90875. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  90876. // "location": "query",
  90877. // "type": "string"
  90878. // },
  90879. // "targetHttpsProxy": {
  90880. // "description": "Name of the TargetHttpsProxy resource to set the QUIC override policy for. The name should conform to RFC1035.",
  90881. // "location": "path",
  90882. // "required": true,
  90883. // "type": "string"
  90884. // }
  90885. // },
  90886. // "path": "{project}/global/targetHttpsProxies/{targetHttpsProxy}/setQuicOverride",
  90887. // "request": {
  90888. // "$ref": "TargetHttpsProxiesSetQuicOverrideRequest"
  90889. // },
  90890. // "response": {
  90891. // "$ref": "Operation"
  90892. // },
  90893. // "scopes": [
  90894. // "https://www.googleapis.com/auth/cloud-platform",
  90895. // "https://www.googleapis.com/auth/compute"
  90896. // ]
  90897. // }
  90898. }
  90899. // method id "compute.targetHttpsProxies.setSslCertificates":
  90900. type TargetHttpsProxiesSetSslCertificatesCall struct {
  90901. s *Service
  90902. project string
  90903. targetHttpsProxy string
  90904. targethttpsproxiessetsslcertificatesrequest *TargetHttpsProxiesSetSslCertificatesRequest
  90905. urlParams_ gensupport.URLParams
  90906. ctx_ context.Context
  90907. header_ http.Header
  90908. }
  90909. // SetSslCertificates: Replaces SslCertificates for TargetHttpsProxy.
  90910. func (r *TargetHttpsProxiesService) SetSslCertificates(project string, targetHttpsProxy string, targethttpsproxiessetsslcertificatesrequest *TargetHttpsProxiesSetSslCertificatesRequest) *TargetHttpsProxiesSetSslCertificatesCall {
  90911. c := &TargetHttpsProxiesSetSslCertificatesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  90912. c.project = project
  90913. c.targetHttpsProxy = targetHttpsProxy
  90914. c.targethttpsproxiessetsslcertificatesrequest = targethttpsproxiessetsslcertificatesrequest
  90915. return c
  90916. }
  90917. // RequestId sets the optional parameter "requestId": An optional
  90918. // request ID to identify requests. Specify a unique request ID so that
  90919. // if you must retry your request, the server will know to ignore the
  90920. // request if it has already been completed.
  90921. //
  90922. // For example, consider a situation where you make an initial request
  90923. // and the request times out. If you make the request again with the
  90924. // same request ID, the server can check if original operation with the
  90925. // same request ID was received, and if so, will ignore the second
  90926. // request. This prevents clients from accidentally creating duplicate
  90927. // commitments.
  90928. //
  90929. // The request ID must be a valid UUID with the exception that zero UUID
  90930. // is not supported (00000000-0000-0000-0000-000000000000).
  90931. func (c *TargetHttpsProxiesSetSslCertificatesCall) RequestId(requestId string) *TargetHttpsProxiesSetSslCertificatesCall {
  90932. c.urlParams_.Set("requestId", requestId)
  90933. return c
  90934. }
  90935. // Fields allows partial responses to be retrieved. See
  90936. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  90937. // for more information.
  90938. func (c *TargetHttpsProxiesSetSslCertificatesCall) Fields(s ...googleapi.Field) *TargetHttpsProxiesSetSslCertificatesCall {
  90939. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  90940. return c
  90941. }
  90942. // Context sets the context to be used in this call's Do method. Any
  90943. // pending HTTP request will be aborted if the provided context is
  90944. // canceled.
  90945. func (c *TargetHttpsProxiesSetSslCertificatesCall) Context(ctx context.Context) *TargetHttpsProxiesSetSslCertificatesCall {
  90946. c.ctx_ = ctx
  90947. return c
  90948. }
  90949. // Header returns an http.Header that can be modified by the caller to
  90950. // add HTTP headers to the request.
  90951. func (c *TargetHttpsProxiesSetSslCertificatesCall) Header() http.Header {
  90952. if c.header_ == nil {
  90953. c.header_ = make(http.Header)
  90954. }
  90955. return c.header_
  90956. }
  90957. func (c *TargetHttpsProxiesSetSslCertificatesCall) doRequest(alt string) (*http.Response, error) {
  90958. reqHeaders := make(http.Header)
  90959. for k, v := range c.header_ {
  90960. reqHeaders[k] = v
  90961. }
  90962. reqHeaders.Set("User-Agent", c.s.userAgent())
  90963. var body io.Reader = nil
  90964. body, err := googleapi.WithoutDataWrapper.JSONReader(c.targethttpsproxiessetsslcertificatesrequest)
  90965. if err != nil {
  90966. return nil, err
  90967. }
  90968. reqHeaders.Set("Content-Type", "application/json")
  90969. c.urlParams_.Set("alt", alt)
  90970. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/targetHttpsProxies/{targetHttpsProxy}/setSslCertificates")
  90971. urls += "?" + c.urlParams_.Encode()
  90972. req, _ := http.NewRequest("POST", urls, body)
  90973. req.Header = reqHeaders
  90974. googleapi.Expand(req.URL, map[string]string{
  90975. "project": c.project,
  90976. "targetHttpsProxy": c.targetHttpsProxy,
  90977. })
  90978. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  90979. }
  90980. // Do executes the "compute.targetHttpsProxies.setSslCertificates" call.
  90981. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  90982. // status code is an error. Response headers are in either
  90983. // *Operation.ServerResponse.Header or (if a response was returned at
  90984. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  90985. // to check whether the returned error was because
  90986. // http.StatusNotModified was returned.
  90987. func (c *TargetHttpsProxiesSetSslCertificatesCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  90988. gensupport.SetOptions(c.urlParams_, opts...)
  90989. res, err := c.doRequest("json")
  90990. if res != nil && res.StatusCode == http.StatusNotModified {
  90991. if res.Body != nil {
  90992. res.Body.Close()
  90993. }
  90994. return nil, &googleapi.Error{
  90995. Code: res.StatusCode,
  90996. Header: res.Header,
  90997. }
  90998. }
  90999. if err != nil {
  91000. return nil, err
  91001. }
  91002. defer googleapi.CloseBody(res)
  91003. if err := googleapi.CheckResponse(res); err != nil {
  91004. return nil, err
  91005. }
  91006. ret := &Operation{
  91007. ServerResponse: googleapi.ServerResponse{
  91008. Header: res.Header,
  91009. HTTPStatusCode: res.StatusCode,
  91010. },
  91011. }
  91012. target := &ret
  91013. if err := gensupport.DecodeResponse(target, res); err != nil {
  91014. return nil, err
  91015. }
  91016. return ret, nil
  91017. // {
  91018. // "description": "Replaces SslCertificates for TargetHttpsProxy.",
  91019. // "httpMethod": "POST",
  91020. // "id": "compute.targetHttpsProxies.setSslCertificates",
  91021. // "parameterOrder": [
  91022. // "project",
  91023. // "targetHttpsProxy"
  91024. // ],
  91025. // "parameters": {
  91026. // "project": {
  91027. // "description": "Project ID for this request.",
  91028. // "location": "path",
  91029. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  91030. // "required": true,
  91031. // "type": "string"
  91032. // },
  91033. // "requestId": {
  91034. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  91035. // "location": "query",
  91036. // "type": "string"
  91037. // },
  91038. // "targetHttpsProxy": {
  91039. // "description": "Name of the TargetHttpsProxy resource to set an SslCertificates resource for.",
  91040. // "location": "path",
  91041. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  91042. // "required": true,
  91043. // "type": "string"
  91044. // }
  91045. // },
  91046. // "path": "{project}/targetHttpsProxies/{targetHttpsProxy}/setSslCertificates",
  91047. // "request": {
  91048. // "$ref": "TargetHttpsProxiesSetSslCertificatesRequest"
  91049. // },
  91050. // "response": {
  91051. // "$ref": "Operation"
  91052. // },
  91053. // "scopes": [
  91054. // "https://www.googleapis.com/auth/cloud-platform",
  91055. // "https://www.googleapis.com/auth/compute"
  91056. // ]
  91057. // }
  91058. }
  91059. // method id "compute.targetHttpsProxies.setSslPolicy":
  91060. type TargetHttpsProxiesSetSslPolicyCall struct {
  91061. s *Service
  91062. project string
  91063. targetHttpsProxy string
  91064. sslpolicyreference *SslPolicyReference
  91065. urlParams_ gensupport.URLParams
  91066. ctx_ context.Context
  91067. header_ http.Header
  91068. }
  91069. // SetSslPolicy: Sets the SSL policy for TargetHttpsProxy. The SSL
  91070. // policy specifies the server-side support for SSL features. This
  91071. // affects connections between clients and the HTTPS proxy load
  91072. // balancer. They do not affect the connection between the load balancer
  91073. // and the backends.
  91074. func (r *TargetHttpsProxiesService) SetSslPolicy(project string, targetHttpsProxy string, sslpolicyreference *SslPolicyReference) *TargetHttpsProxiesSetSslPolicyCall {
  91075. c := &TargetHttpsProxiesSetSslPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  91076. c.project = project
  91077. c.targetHttpsProxy = targetHttpsProxy
  91078. c.sslpolicyreference = sslpolicyreference
  91079. return c
  91080. }
  91081. // RequestId sets the optional parameter "requestId": An optional
  91082. // request ID to identify requests. Specify a unique request ID so that
  91083. // if you must retry your request, the server will know to ignore the
  91084. // request if it has already been completed.
  91085. //
  91086. // For example, consider a situation where you make an initial request
  91087. // and the request times out. If you make the request again with the
  91088. // same request ID, the server can check if original operation with the
  91089. // same request ID was received, and if so, will ignore the second
  91090. // request. This prevents clients from accidentally creating duplicate
  91091. // commitments.
  91092. //
  91093. // The request ID must be a valid UUID with the exception that zero UUID
  91094. // is not supported (00000000-0000-0000-0000-000000000000).
  91095. func (c *TargetHttpsProxiesSetSslPolicyCall) RequestId(requestId string) *TargetHttpsProxiesSetSslPolicyCall {
  91096. c.urlParams_.Set("requestId", requestId)
  91097. return c
  91098. }
  91099. // Fields allows partial responses to be retrieved. See
  91100. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  91101. // for more information.
  91102. func (c *TargetHttpsProxiesSetSslPolicyCall) Fields(s ...googleapi.Field) *TargetHttpsProxiesSetSslPolicyCall {
  91103. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  91104. return c
  91105. }
  91106. // Context sets the context to be used in this call's Do method. Any
  91107. // pending HTTP request will be aborted if the provided context is
  91108. // canceled.
  91109. func (c *TargetHttpsProxiesSetSslPolicyCall) Context(ctx context.Context) *TargetHttpsProxiesSetSslPolicyCall {
  91110. c.ctx_ = ctx
  91111. return c
  91112. }
  91113. // Header returns an http.Header that can be modified by the caller to
  91114. // add HTTP headers to the request.
  91115. func (c *TargetHttpsProxiesSetSslPolicyCall) Header() http.Header {
  91116. if c.header_ == nil {
  91117. c.header_ = make(http.Header)
  91118. }
  91119. return c.header_
  91120. }
  91121. func (c *TargetHttpsProxiesSetSslPolicyCall) doRequest(alt string) (*http.Response, error) {
  91122. reqHeaders := make(http.Header)
  91123. for k, v := range c.header_ {
  91124. reqHeaders[k] = v
  91125. }
  91126. reqHeaders.Set("User-Agent", c.s.userAgent())
  91127. var body io.Reader = nil
  91128. body, err := googleapi.WithoutDataWrapper.JSONReader(c.sslpolicyreference)
  91129. if err != nil {
  91130. return nil, err
  91131. }
  91132. reqHeaders.Set("Content-Type", "application/json")
  91133. c.urlParams_.Set("alt", alt)
  91134. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetHttpsProxies/{targetHttpsProxy}/setSslPolicy")
  91135. urls += "?" + c.urlParams_.Encode()
  91136. req, _ := http.NewRequest("POST", urls, body)
  91137. req.Header = reqHeaders
  91138. googleapi.Expand(req.URL, map[string]string{
  91139. "project": c.project,
  91140. "targetHttpsProxy": c.targetHttpsProxy,
  91141. })
  91142. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  91143. }
  91144. // Do executes the "compute.targetHttpsProxies.setSslPolicy" call.
  91145. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  91146. // status code is an error. Response headers are in either
  91147. // *Operation.ServerResponse.Header or (if a response was returned at
  91148. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  91149. // to check whether the returned error was because
  91150. // http.StatusNotModified was returned.
  91151. func (c *TargetHttpsProxiesSetSslPolicyCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  91152. gensupport.SetOptions(c.urlParams_, opts...)
  91153. res, err := c.doRequest("json")
  91154. if res != nil && res.StatusCode == http.StatusNotModified {
  91155. if res.Body != nil {
  91156. res.Body.Close()
  91157. }
  91158. return nil, &googleapi.Error{
  91159. Code: res.StatusCode,
  91160. Header: res.Header,
  91161. }
  91162. }
  91163. if err != nil {
  91164. return nil, err
  91165. }
  91166. defer googleapi.CloseBody(res)
  91167. if err := googleapi.CheckResponse(res); err != nil {
  91168. return nil, err
  91169. }
  91170. ret := &Operation{
  91171. ServerResponse: googleapi.ServerResponse{
  91172. Header: res.Header,
  91173. HTTPStatusCode: res.StatusCode,
  91174. },
  91175. }
  91176. target := &ret
  91177. if err := gensupport.DecodeResponse(target, res); err != nil {
  91178. return nil, err
  91179. }
  91180. return ret, nil
  91181. // {
  91182. // "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.",
  91183. // "httpMethod": "POST",
  91184. // "id": "compute.targetHttpsProxies.setSslPolicy",
  91185. // "parameterOrder": [
  91186. // "project",
  91187. // "targetHttpsProxy"
  91188. // ],
  91189. // "parameters": {
  91190. // "project": {
  91191. // "description": "Project ID for this request.",
  91192. // "location": "path",
  91193. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  91194. // "required": true,
  91195. // "type": "string"
  91196. // },
  91197. // "requestId": {
  91198. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  91199. // "location": "query",
  91200. // "type": "string"
  91201. // },
  91202. // "targetHttpsProxy": {
  91203. // "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.",
  91204. // "location": "path",
  91205. // "required": true,
  91206. // "type": "string"
  91207. // }
  91208. // },
  91209. // "path": "{project}/global/targetHttpsProxies/{targetHttpsProxy}/setSslPolicy",
  91210. // "request": {
  91211. // "$ref": "SslPolicyReference"
  91212. // },
  91213. // "response": {
  91214. // "$ref": "Operation"
  91215. // },
  91216. // "scopes": [
  91217. // "https://www.googleapis.com/auth/cloud-platform",
  91218. // "https://www.googleapis.com/auth/compute"
  91219. // ]
  91220. // }
  91221. }
  91222. // method id "compute.targetHttpsProxies.setUrlMap":
  91223. type TargetHttpsProxiesSetUrlMapCall struct {
  91224. s *Service
  91225. project string
  91226. targetHttpsProxy string
  91227. urlmapreference *UrlMapReference
  91228. urlParams_ gensupport.URLParams
  91229. ctx_ context.Context
  91230. header_ http.Header
  91231. }
  91232. // SetUrlMap: Changes the URL map for TargetHttpsProxy.
  91233. func (r *TargetHttpsProxiesService) SetUrlMap(project string, targetHttpsProxy string, urlmapreference *UrlMapReference) *TargetHttpsProxiesSetUrlMapCall {
  91234. c := &TargetHttpsProxiesSetUrlMapCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  91235. c.project = project
  91236. c.targetHttpsProxy = targetHttpsProxy
  91237. c.urlmapreference = urlmapreference
  91238. return c
  91239. }
  91240. // RequestId sets the optional parameter "requestId": An optional
  91241. // request ID to identify requests. Specify a unique request ID so that
  91242. // if you must retry your request, the server will know to ignore the
  91243. // request if it has already been completed.
  91244. //
  91245. // For example, consider a situation where you make an initial request
  91246. // and the request times out. If you make the request again with the
  91247. // same request ID, the server can check if original operation with the
  91248. // same request ID was received, and if so, will ignore the second
  91249. // request. This prevents clients from accidentally creating duplicate
  91250. // commitments.
  91251. //
  91252. // The request ID must be a valid UUID with the exception that zero UUID
  91253. // is not supported (00000000-0000-0000-0000-000000000000).
  91254. func (c *TargetHttpsProxiesSetUrlMapCall) RequestId(requestId string) *TargetHttpsProxiesSetUrlMapCall {
  91255. c.urlParams_.Set("requestId", requestId)
  91256. return c
  91257. }
  91258. // Fields allows partial responses to be retrieved. See
  91259. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  91260. // for more information.
  91261. func (c *TargetHttpsProxiesSetUrlMapCall) Fields(s ...googleapi.Field) *TargetHttpsProxiesSetUrlMapCall {
  91262. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  91263. return c
  91264. }
  91265. // Context sets the context to be used in this call's Do method. Any
  91266. // pending HTTP request will be aborted if the provided context is
  91267. // canceled.
  91268. func (c *TargetHttpsProxiesSetUrlMapCall) Context(ctx context.Context) *TargetHttpsProxiesSetUrlMapCall {
  91269. c.ctx_ = ctx
  91270. return c
  91271. }
  91272. // Header returns an http.Header that can be modified by the caller to
  91273. // add HTTP headers to the request.
  91274. func (c *TargetHttpsProxiesSetUrlMapCall) Header() http.Header {
  91275. if c.header_ == nil {
  91276. c.header_ = make(http.Header)
  91277. }
  91278. return c.header_
  91279. }
  91280. func (c *TargetHttpsProxiesSetUrlMapCall) doRequest(alt string) (*http.Response, error) {
  91281. reqHeaders := make(http.Header)
  91282. for k, v := range c.header_ {
  91283. reqHeaders[k] = v
  91284. }
  91285. reqHeaders.Set("User-Agent", c.s.userAgent())
  91286. var body io.Reader = nil
  91287. body, err := googleapi.WithoutDataWrapper.JSONReader(c.urlmapreference)
  91288. if err != nil {
  91289. return nil, err
  91290. }
  91291. reqHeaders.Set("Content-Type", "application/json")
  91292. c.urlParams_.Set("alt", alt)
  91293. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/targetHttpsProxies/{targetHttpsProxy}/setUrlMap")
  91294. urls += "?" + c.urlParams_.Encode()
  91295. req, _ := http.NewRequest("POST", urls, body)
  91296. req.Header = reqHeaders
  91297. googleapi.Expand(req.URL, map[string]string{
  91298. "project": c.project,
  91299. "targetHttpsProxy": c.targetHttpsProxy,
  91300. })
  91301. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  91302. }
  91303. // Do executes the "compute.targetHttpsProxies.setUrlMap" call.
  91304. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  91305. // status code is an error. Response headers are in either
  91306. // *Operation.ServerResponse.Header or (if a response was returned at
  91307. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  91308. // to check whether the returned error was because
  91309. // http.StatusNotModified was returned.
  91310. func (c *TargetHttpsProxiesSetUrlMapCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  91311. gensupport.SetOptions(c.urlParams_, opts...)
  91312. res, err := c.doRequest("json")
  91313. if res != nil && res.StatusCode == http.StatusNotModified {
  91314. if res.Body != nil {
  91315. res.Body.Close()
  91316. }
  91317. return nil, &googleapi.Error{
  91318. Code: res.StatusCode,
  91319. Header: res.Header,
  91320. }
  91321. }
  91322. if err != nil {
  91323. return nil, err
  91324. }
  91325. defer googleapi.CloseBody(res)
  91326. if err := googleapi.CheckResponse(res); err != nil {
  91327. return nil, err
  91328. }
  91329. ret := &Operation{
  91330. ServerResponse: googleapi.ServerResponse{
  91331. Header: res.Header,
  91332. HTTPStatusCode: res.StatusCode,
  91333. },
  91334. }
  91335. target := &ret
  91336. if err := gensupport.DecodeResponse(target, res); err != nil {
  91337. return nil, err
  91338. }
  91339. return ret, nil
  91340. // {
  91341. // "description": "Changes the URL map for TargetHttpsProxy.",
  91342. // "httpMethod": "POST",
  91343. // "id": "compute.targetHttpsProxies.setUrlMap",
  91344. // "parameterOrder": [
  91345. // "project",
  91346. // "targetHttpsProxy"
  91347. // ],
  91348. // "parameters": {
  91349. // "project": {
  91350. // "description": "Project ID for this request.",
  91351. // "location": "path",
  91352. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  91353. // "required": true,
  91354. // "type": "string"
  91355. // },
  91356. // "requestId": {
  91357. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  91358. // "location": "query",
  91359. // "type": "string"
  91360. // },
  91361. // "targetHttpsProxy": {
  91362. // "description": "Name of the TargetHttpsProxy resource whose URL map is to be set.",
  91363. // "location": "path",
  91364. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  91365. // "required": true,
  91366. // "type": "string"
  91367. // }
  91368. // },
  91369. // "path": "{project}/targetHttpsProxies/{targetHttpsProxy}/setUrlMap",
  91370. // "request": {
  91371. // "$ref": "UrlMapReference"
  91372. // },
  91373. // "response": {
  91374. // "$ref": "Operation"
  91375. // },
  91376. // "scopes": [
  91377. // "https://www.googleapis.com/auth/cloud-platform",
  91378. // "https://www.googleapis.com/auth/compute"
  91379. // ]
  91380. // }
  91381. }
  91382. // method id "compute.targetHttpsProxies.testIamPermissions":
  91383. type TargetHttpsProxiesTestIamPermissionsCall struct {
  91384. s *Service
  91385. project string
  91386. resource string
  91387. testpermissionsrequest *TestPermissionsRequest
  91388. urlParams_ gensupport.URLParams
  91389. ctx_ context.Context
  91390. header_ http.Header
  91391. }
  91392. // TestIamPermissions: Returns permissions that a caller has on the
  91393. // specified resource.
  91394. func (r *TargetHttpsProxiesService) TestIamPermissions(project string, resource string, testpermissionsrequest *TestPermissionsRequest) *TargetHttpsProxiesTestIamPermissionsCall {
  91395. c := &TargetHttpsProxiesTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  91396. c.project = project
  91397. c.resource = resource
  91398. c.testpermissionsrequest = testpermissionsrequest
  91399. return c
  91400. }
  91401. // Fields allows partial responses to be retrieved. See
  91402. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  91403. // for more information.
  91404. func (c *TargetHttpsProxiesTestIamPermissionsCall) Fields(s ...googleapi.Field) *TargetHttpsProxiesTestIamPermissionsCall {
  91405. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  91406. return c
  91407. }
  91408. // Context sets the context to be used in this call's Do method. Any
  91409. // pending HTTP request will be aborted if the provided context is
  91410. // canceled.
  91411. func (c *TargetHttpsProxiesTestIamPermissionsCall) Context(ctx context.Context) *TargetHttpsProxiesTestIamPermissionsCall {
  91412. c.ctx_ = ctx
  91413. return c
  91414. }
  91415. // Header returns an http.Header that can be modified by the caller to
  91416. // add HTTP headers to the request.
  91417. func (c *TargetHttpsProxiesTestIamPermissionsCall) Header() http.Header {
  91418. if c.header_ == nil {
  91419. c.header_ = make(http.Header)
  91420. }
  91421. return c.header_
  91422. }
  91423. func (c *TargetHttpsProxiesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  91424. reqHeaders := make(http.Header)
  91425. for k, v := range c.header_ {
  91426. reqHeaders[k] = v
  91427. }
  91428. reqHeaders.Set("User-Agent", c.s.userAgent())
  91429. var body io.Reader = nil
  91430. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  91431. if err != nil {
  91432. return nil, err
  91433. }
  91434. reqHeaders.Set("Content-Type", "application/json")
  91435. c.urlParams_.Set("alt", alt)
  91436. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetHttpsProxies/{resource}/testIamPermissions")
  91437. urls += "?" + c.urlParams_.Encode()
  91438. req, _ := http.NewRequest("POST", urls, body)
  91439. req.Header = reqHeaders
  91440. googleapi.Expand(req.URL, map[string]string{
  91441. "project": c.project,
  91442. "resource": c.resource,
  91443. })
  91444. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  91445. }
  91446. // Do executes the "compute.targetHttpsProxies.testIamPermissions" call.
  91447. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  91448. // non-2xx status code is an error. Response headers are in either
  91449. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  91450. // returned at all) in error.(*googleapi.Error).Header. Use
  91451. // googleapi.IsNotModified to check whether the returned error was
  91452. // because http.StatusNotModified was returned.
  91453. func (c *TargetHttpsProxiesTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  91454. gensupport.SetOptions(c.urlParams_, opts...)
  91455. res, err := c.doRequest("json")
  91456. if res != nil && res.StatusCode == http.StatusNotModified {
  91457. if res.Body != nil {
  91458. res.Body.Close()
  91459. }
  91460. return nil, &googleapi.Error{
  91461. Code: res.StatusCode,
  91462. Header: res.Header,
  91463. }
  91464. }
  91465. if err != nil {
  91466. return nil, err
  91467. }
  91468. defer googleapi.CloseBody(res)
  91469. if err := googleapi.CheckResponse(res); err != nil {
  91470. return nil, err
  91471. }
  91472. ret := &TestPermissionsResponse{
  91473. ServerResponse: googleapi.ServerResponse{
  91474. Header: res.Header,
  91475. HTTPStatusCode: res.StatusCode,
  91476. },
  91477. }
  91478. target := &ret
  91479. if err := gensupport.DecodeResponse(target, res); err != nil {
  91480. return nil, err
  91481. }
  91482. return ret, nil
  91483. // {
  91484. // "description": "Returns permissions that a caller has on the specified resource.",
  91485. // "httpMethod": "POST",
  91486. // "id": "compute.targetHttpsProxies.testIamPermissions",
  91487. // "parameterOrder": [
  91488. // "project",
  91489. // "resource"
  91490. // ],
  91491. // "parameters": {
  91492. // "project": {
  91493. // "description": "Project ID for this request.",
  91494. // "location": "path",
  91495. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  91496. // "required": true,
  91497. // "type": "string"
  91498. // },
  91499. // "resource": {
  91500. // "description": "Name of the resource for this request.",
  91501. // "location": "path",
  91502. // "pattern": "(?:[-a-z0-9_]{0,62}[a-z0-9])?",
  91503. // "required": true,
  91504. // "type": "string"
  91505. // }
  91506. // },
  91507. // "path": "{project}/global/targetHttpsProxies/{resource}/testIamPermissions",
  91508. // "request": {
  91509. // "$ref": "TestPermissionsRequest"
  91510. // },
  91511. // "response": {
  91512. // "$ref": "TestPermissionsResponse"
  91513. // },
  91514. // "scopes": [
  91515. // "https://www.googleapis.com/auth/cloud-platform",
  91516. // "https://www.googleapis.com/auth/compute",
  91517. // "https://www.googleapis.com/auth/compute.readonly"
  91518. // ]
  91519. // }
  91520. }
  91521. // method id "compute.targetInstances.aggregatedList":
  91522. type TargetInstancesAggregatedListCall struct {
  91523. s *Service
  91524. project string
  91525. urlParams_ gensupport.URLParams
  91526. ifNoneMatch_ string
  91527. ctx_ context.Context
  91528. header_ http.Header
  91529. }
  91530. // AggregatedList: Retrieves an aggregated list of target instances.
  91531. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetInstances/aggregatedList
  91532. func (r *TargetInstancesService) AggregatedList(project string) *TargetInstancesAggregatedListCall {
  91533. c := &TargetInstancesAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  91534. c.project = project
  91535. return c
  91536. }
  91537. // Filter sets the optional parameter "filter": A filter expression that
  91538. // filters resources listed in the response. The expression must specify
  91539. // the field name, a comparison operator, and the value that you want to
  91540. // use for filtering. The value must be a string, a number, or a
  91541. // boolean. The comparison operator must be either =, !=, >, or <.
  91542. //
  91543. // For example, if you are filtering Compute Engine instances, you can
  91544. // exclude instances named example-instance by specifying name !=
  91545. // example-instance.
  91546. //
  91547. // You can also filter nested fields. For example, you could specify
  91548. // scheduling.automaticRestart = false to include instances only if they
  91549. // are not scheduled for automatic restarts. You can use filtering on
  91550. // nested fields to filter based on resource labels.
  91551. //
  91552. // To filter on multiple expressions, provide each separate expression
  91553. // within parentheses. For example, (scheduling.automaticRestart = true)
  91554. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  91555. // AND expression. However, you can include AND and OR expressions
  91556. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  91557. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  91558. // true).
  91559. func (c *TargetInstancesAggregatedListCall) Filter(filter string) *TargetInstancesAggregatedListCall {
  91560. c.urlParams_.Set("filter", filter)
  91561. return c
  91562. }
  91563. // MaxResults sets the optional parameter "maxResults": The maximum
  91564. // number of results per page that should be returned. If the number of
  91565. // available results is larger than maxResults, Compute Engine returns a
  91566. // nextPageToken that can be used to get the next page of results in
  91567. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  91568. // (Default: 500)
  91569. func (c *TargetInstancesAggregatedListCall) MaxResults(maxResults int64) *TargetInstancesAggregatedListCall {
  91570. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  91571. return c
  91572. }
  91573. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  91574. // a certain order. By default, results are returned in alphanumerical
  91575. // order based on the resource name.
  91576. //
  91577. // You can also sort results in descending order based on the creation
  91578. // timestamp using orderBy="creationTimestamp desc". This sorts results
  91579. // based on the creationTimestamp field in reverse chronological order
  91580. // (newest result first). Use this to sort resources like operations so
  91581. // that the newest operation is returned first.
  91582. //
  91583. // Currently, only sorting by name or creationTimestamp desc is
  91584. // supported.
  91585. func (c *TargetInstancesAggregatedListCall) OrderBy(orderBy string) *TargetInstancesAggregatedListCall {
  91586. c.urlParams_.Set("orderBy", orderBy)
  91587. return c
  91588. }
  91589. // PageToken sets the optional parameter "pageToken": Specifies a page
  91590. // token to use. Set pageToken to the nextPageToken returned by a
  91591. // previous list request to get the next page of results.
  91592. func (c *TargetInstancesAggregatedListCall) PageToken(pageToken string) *TargetInstancesAggregatedListCall {
  91593. c.urlParams_.Set("pageToken", pageToken)
  91594. return c
  91595. }
  91596. // Fields allows partial responses to be retrieved. See
  91597. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  91598. // for more information.
  91599. func (c *TargetInstancesAggregatedListCall) Fields(s ...googleapi.Field) *TargetInstancesAggregatedListCall {
  91600. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  91601. return c
  91602. }
  91603. // IfNoneMatch sets the optional parameter which makes the operation
  91604. // fail if the object's ETag matches the given value. This is useful for
  91605. // getting updates only after the object has changed since the last
  91606. // request. Use googleapi.IsNotModified to check whether the response
  91607. // error from Do is the result of In-None-Match.
  91608. func (c *TargetInstancesAggregatedListCall) IfNoneMatch(entityTag string) *TargetInstancesAggregatedListCall {
  91609. c.ifNoneMatch_ = entityTag
  91610. return c
  91611. }
  91612. // Context sets the context to be used in this call's Do method. Any
  91613. // pending HTTP request will be aborted if the provided context is
  91614. // canceled.
  91615. func (c *TargetInstancesAggregatedListCall) Context(ctx context.Context) *TargetInstancesAggregatedListCall {
  91616. c.ctx_ = ctx
  91617. return c
  91618. }
  91619. // Header returns an http.Header that can be modified by the caller to
  91620. // add HTTP headers to the request.
  91621. func (c *TargetInstancesAggregatedListCall) Header() http.Header {
  91622. if c.header_ == nil {
  91623. c.header_ = make(http.Header)
  91624. }
  91625. return c.header_
  91626. }
  91627. func (c *TargetInstancesAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  91628. reqHeaders := make(http.Header)
  91629. for k, v := range c.header_ {
  91630. reqHeaders[k] = v
  91631. }
  91632. reqHeaders.Set("User-Agent", c.s.userAgent())
  91633. if c.ifNoneMatch_ != "" {
  91634. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  91635. }
  91636. var body io.Reader = nil
  91637. c.urlParams_.Set("alt", alt)
  91638. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/targetInstances")
  91639. urls += "?" + c.urlParams_.Encode()
  91640. req, _ := http.NewRequest("GET", urls, body)
  91641. req.Header = reqHeaders
  91642. googleapi.Expand(req.URL, map[string]string{
  91643. "project": c.project,
  91644. })
  91645. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  91646. }
  91647. // Do executes the "compute.targetInstances.aggregatedList" call.
  91648. // Exactly one of *TargetInstanceAggregatedList or error will be
  91649. // non-nil. Any non-2xx status code is an error. Response headers are in
  91650. // either *TargetInstanceAggregatedList.ServerResponse.Header or (if a
  91651. // response was returned at all) in error.(*googleapi.Error).Header. Use
  91652. // googleapi.IsNotModified to check whether the returned error was
  91653. // because http.StatusNotModified was returned.
  91654. func (c *TargetInstancesAggregatedListCall) Do(opts ...googleapi.CallOption) (*TargetInstanceAggregatedList, error) {
  91655. gensupport.SetOptions(c.urlParams_, opts...)
  91656. res, err := c.doRequest("json")
  91657. if res != nil && res.StatusCode == http.StatusNotModified {
  91658. if res.Body != nil {
  91659. res.Body.Close()
  91660. }
  91661. return nil, &googleapi.Error{
  91662. Code: res.StatusCode,
  91663. Header: res.Header,
  91664. }
  91665. }
  91666. if err != nil {
  91667. return nil, err
  91668. }
  91669. defer googleapi.CloseBody(res)
  91670. if err := googleapi.CheckResponse(res); err != nil {
  91671. return nil, err
  91672. }
  91673. ret := &TargetInstanceAggregatedList{
  91674. ServerResponse: googleapi.ServerResponse{
  91675. Header: res.Header,
  91676. HTTPStatusCode: res.StatusCode,
  91677. },
  91678. }
  91679. target := &ret
  91680. if err := gensupport.DecodeResponse(target, res); err != nil {
  91681. return nil, err
  91682. }
  91683. return ret, nil
  91684. // {
  91685. // "description": "Retrieves an aggregated list of target instances.",
  91686. // "httpMethod": "GET",
  91687. // "id": "compute.targetInstances.aggregatedList",
  91688. // "parameterOrder": [
  91689. // "project"
  91690. // ],
  91691. // "parameters": {
  91692. // "filter": {
  91693. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  91694. // "location": "query",
  91695. // "type": "string"
  91696. // },
  91697. // "maxResults": {
  91698. // "default": "500",
  91699. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  91700. // "format": "uint32",
  91701. // "location": "query",
  91702. // "minimum": "0",
  91703. // "type": "integer"
  91704. // },
  91705. // "orderBy": {
  91706. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  91707. // "location": "query",
  91708. // "type": "string"
  91709. // },
  91710. // "pageToken": {
  91711. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  91712. // "location": "query",
  91713. // "type": "string"
  91714. // },
  91715. // "project": {
  91716. // "description": "Project ID for this request.",
  91717. // "location": "path",
  91718. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  91719. // "required": true,
  91720. // "type": "string"
  91721. // }
  91722. // },
  91723. // "path": "{project}/aggregated/targetInstances",
  91724. // "response": {
  91725. // "$ref": "TargetInstanceAggregatedList"
  91726. // },
  91727. // "scopes": [
  91728. // "https://www.googleapis.com/auth/cloud-platform",
  91729. // "https://www.googleapis.com/auth/compute",
  91730. // "https://www.googleapis.com/auth/compute.readonly"
  91731. // ]
  91732. // }
  91733. }
  91734. // Pages invokes f for each page of results.
  91735. // A non-nil error returned from f will halt the iteration.
  91736. // The provided context supersedes any context provided to the Context method.
  91737. func (c *TargetInstancesAggregatedListCall) Pages(ctx context.Context, f func(*TargetInstanceAggregatedList) error) error {
  91738. c.ctx_ = ctx
  91739. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  91740. for {
  91741. x, err := c.Do()
  91742. if err != nil {
  91743. return err
  91744. }
  91745. if err := f(x); err != nil {
  91746. return err
  91747. }
  91748. if x.NextPageToken == "" {
  91749. return nil
  91750. }
  91751. c.PageToken(x.NextPageToken)
  91752. }
  91753. }
  91754. // method id "compute.targetInstances.delete":
  91755. type TargetInstancesDeleteCall struct {
  91756. s *Service
  91757. project string
  91758. zone string
  91759. targetInstance string
  91760. urlParams_ gensupport.URLParams
  91761. ctx_ context.Context
  91762. header_ http.Header
  91763. }
  91764. // Delete: Deletes the specified TargetInstance resource.
  91765. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetInstances/delete
  91766. func (r *TargetInstancesService) Delete(project string, zone string, targetInstance string) *TargetInstancesDeleteCall {
  91767. c := &TargetInstancesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  91768. c.project = project
  91769. c.zone = zone
  91770. c.targetInstance = targetInstance
  91771. return c
  91772. }
  91773. // RequestId sets the optional parameter "requestId": An optional
  91774. // request ID to identify requests. Specify a unique request ID so that
  91775. // if you must retry your request, the server will know to ignore the
  91776. // request if it has already been completed.
  91777. //
  91778. // For example, consider a situation where you make an initial request
  91779. // and the request times out. If you make the request again with the
  91780. // same request ID, the server can check if original operation with the
  91781. // same request ID was received, and if so, will ignore the second
  91782. // request. This prevents clients from accidentally creating duplicate
  91783. // commitments.
  91784. //
  91785. // The request ID must be a valid UUID with the exception that zero UUID
  91786. // is not supported (00000000-0000-0000-0000-000000000000).
  91787. func (c *TargetInstancesDeleteCall) RequestId(requestId string) *TargetInstancesDeleteCall {
  91788. c.urlParams_.Set("requestId", requestId)
  91789. return c
  91790. }
  91791. // Fields allows partial responses to be retrieved. See
  91792. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  91793. // for more information.
  91794. func (c *TargetInstancesDeleteCall) Fields(s ...googleapi.Field) *TargetInstancesDeleteCall {
  91795. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  91796. return c
  91797. }
  91798. // Context sets the context to be used in this call's Do method. Any
  91799. // pending HTTP request will be aborted if the provided context is
  91800. // canceled.
  91801. func (c *TargetInstancesDeleteCall) Context(ctx context.Context) *TargetInstancesDeleteCall {
  91802. c.ctx_ = ctx
  91803. return c
  91804. }
  91805. // Header returns an http.Header that can be modified by the caller to
  91806. // add HTTP headers to the request.
  91807. func (c *TargetInstancesDeleteCall) Header() http.Header {
  91808. if c.header_ == nil {
  91809. c.header_ = make(http.Header)
  91810. }
  91811. return c.header_
  91812. }
  91813. func (c *TargetInstancesDeleteCall) doRequest(alt string) (*http.Response, error) {
  91814. reqHeaders := make(http.Header)
  91815. for k, v := range c.header_ {
  91816. reqHeaders[k] = v
  91817. }
  91818. reqHeaders.Set("User-Agent", c.s.userAgent())
  91819. var body io.Reader = nil
  91820. c.urlParams_.Set("alt", alt)
  91821. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/targetInstances/{targetInstance}")
  91822. urls += "?" + c.urlParams_.Encode()
  91823. req, _ := http.NewRequest("DELETE", urls, body)
  91824. req.Header = reqHeaders
  91825. googleapi.Expand(req.URL, map[string]string{
  91826. "project": c.project,
  91827. "zone": c.zone,
  91828. "targetInstance": c.targetInstance,
  91829. })
  91830. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  91831. }
  91832. // Do executes the "compute.targetInstances.delete" call.
  91833. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  91834. // status code is an error. Response headers are in either
  91835. // *Operation.ServerResponse.Header or (if a response was returned at
  91836. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  91837. // to check whether the returned error was because
  91838. // http.StatusNotModified was returned.
  91839. func (c *TargetInstancesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  91840. gensupport.SetOptions(c.urlParams_, opts...)
  91841. res, err := c.doRequest("json")
  91842. if res != nil && res.StatusCode == http.StatusNotModified {
  91843. if res.Body != nil {
  91844. res.Body.Close()
  91845. }
  91846. return nil, &googleapi.Error{
  91847. Code: res.StatusCode,
  91848. Header: res.Header,
  91849. }
  91850. }
  91851. if err != nil {
  91852. return nil, err
  91853. }
  91854. defer googleapi.CloseBody(res)
  91855. if err := googleapi.CheckResponse(res); err != nil {
  91856. return nil, err
  91857. }
  91858. ret := &Operation{
  91859. ServerResponse: googleapi.ServerResponse{
  91860. Header: res.Header,
  91861. HTTPStatusCode: res.StatusCode,
  91862. },
  91863. }
  91864. target := &ret
  91865. if err := gensupport.DecodeResponse(target, res); err != nil {
  91866. return nil, err
  91867. }
  91868. return ret, nil
  91869. // {
  91870. // "description": "Deletes the specified TargetInstance resource.",
  91871. // "httpMethod": "DELETE",
  91872. // "id": "compute.targetInstances.delete",
  91873. // "parameterOrder": [
  91874. // "project",
  91875. // "zone",
  91876. // "targetInstance"
  91877. // ],
  91878. // "parameters": {
  91879. // "project": {
  91880. // "description": "Project ID for this request.",
  91881. // "location": "path",
  91882. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  91883. // "required": true,
  91884. // "type": "string"
  91885. // },
  91886. // "requestId": {
  91887. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  91888. // "location": "query",
  91889. // "type": "string"
  91890. // },
  91891. // "targetInstance": {
  91892. // "description": "Name of the TargetInstance resource to delete.",
  91893. // "location": "path",
  91894. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  91895. // "required": true,
  91896. // "type": "string"
  91897. // },
  91898. // "zone": {
  91899. // "description": "Name of the zone scoping this request.",
  91900. // "location": "path",
  91901. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  91902. // "required": true,
  91903. // "type": "string"
  91904. // }
  91905. // },
  91906. // "path": "{project}/zones/{zone}/targetInstances/{targetInstance}",
  91907. // "response": {
  91908. // "$ref": "Operation"
  91909. // },
  91910. // "scopes": [
  91911. // "https://www.googleapis.com/auth/cloud-platform",
  91912. // "https://www.googleapis.com/auth/compute"
  91913. // ]
  91914. // }
  91915. }
  91916. // method id "compute.targetInstances.get":
  91917. type TargetInstancesGetCall struct {
  91918. s *Service
  91919. project string
  91920. zone string
  91921. targetInstance string
  91922. urlParams_ gensupport.URLParams
  91923. ifNoneMatch_ string
  91924. ctx_ context.Context
  91925. header_ http.Header
  91926. }
  91927. // Get: Returns the specified TargetInstance resource. Gets a list of
  91928. // available target instances by making a list() request.
  91929. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetInstances/get
  91930. func (r *TargetInstancesService) Get(project string, zone string, targetInstance string) *TargetInstancesGetCall {
  91931. c := &TargetInstancesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  91932. c.project = project
  91933. c.zone = zone
  91934. c.targetInstance = targetInstance
  91935. return c
  91936. }
  91937. // Fields allows partial responses to be retrieved. See
  91938. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  91939. // for more information.
  91940. func (c *TargetInstancesGetCall) Fields(s ...googleapi.Field) *TargetInstancesGetCall {
  91941. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  91942. return c
  91943. }
  91944. // IfNoneMatch sets the optional parameter which makes the operation
  91945. // fail if the object's ETag matches the given value. This is useful for
  91946. // getting updates only after the object has changed since the last
  91947. // request. Use googleapi.IsNotModified to check whether the response
  91948. // error from Do is the result of In-None-Match.
  91949. func (c *TargetInstancesGetCall) IfNoneMatch(entityTag string) *TargetInstancesGetCall {
  91950. c.ifNoneMatch_ = entityTag
  91951. return c
  91952. }
  91953. // Context sets the context to be used in this call's Do method. Any
  91954. // pending HTTP request will be aborted if the provided context is
  91955. // canceled.
  91956. func (c *TargetInstancesGetCall) Context(ctx context.Context) *TargetInstancesGetCall {
  91957. c.ctx_ = ctx
  91958. return c
  91959. }
  91960. // Header returns an http.Header that can be modified by the caller to
  91961. // add HTTP headers to the request.
  91962. func (c *TargetInstancesGetCall) Header() http.Header {
  91963. if c.header_ == nil {
  91964. c.header_ = make(http.Header)
  91965. }
  91966. return c.header_
  91967. }
  91968. func (c *TargetInstancesGetCall) doRequest(alt string) (*http.Response, error) {
  91969. reqHeaders := make(http.Header)
  91970. for k, v := range c.header_ {
  91971. reqHeaders[k] = v
  91972. }
  91973. reqHeaders.Set("User-Agent", c.s.userAgent())
  91974. if c.ifNoneMatch_ != "" {
  91975. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  91976. }
  91977. var body io.Reader = nil
  91978. c.urlParams_.Set("alt", alt)
  91979. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/targetInstances/{targetInstance}")
  91980. urls += "?" + c.urlParams_.Encode()
  91981. req, _ := http.NewRequest("GET", urls, body)
  91982. req.Header = reqHeaders
  91983. googleapi.Expand(req.URL, map[string]string{
  91984. "project": c.project,
  91985. "zone": c.zone,
  91986. "targetInstance": c.targetInstance,
  91987. })
  91988. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  91989. }
  91990. // Do executes the "compute.targetInstances.get" call.
  91991. // Exactly one of *TargetInstance or error will be non-nil. Any non-2xx
  91992. // status code is an error. Response headers are in either
  91993. // *TargetInstance.ServerResponse.Header or (if a response was returned
  91994. // at all) in error.(*googleapi.Error).Header. Use
  91995. // googleapi.IsNotModified to check whether the returned error was
  91996. // because http.StatusNotModified was returned.
  91997. func (c *TargetInstancesGetCall) Do(opts ...googleapi.CallOption) (*TargetInstance, error) {
  91998. gensupport.SetOptions(c.urlParams_, opts...)
  91999. res, err := c.doRequest("json")
  92000. if res != nil && res.StatusCode == http.StatusNotModified {
  92001. if res.Body != nil {
  92002. res.Body.Close()
  92003. }
  92004. return nil, &googleapi.Error{
  92005. Code: res.StatusCode,
  92006. Header: res.Header,
  92007. }
  92008. }
  92009. if err != nil {
  92010. return nil, err
  92011. }
  92012. defer googleapi.CloseBody(res)
  92013. if err := googleapi.CheckResponse(res); err != nil {
  92014. return nil, err
  92015. }
  92016. ret := &TargetInstance{
  92017. ServerResponse: googleapi.ServerResponse{
  92018. Header: res.Header,
  92019. HTTPStatusCode: res.StatusCode,
  92020. },
  92021. }
  92022. target := &ret
  92023. if err := gensupport.DecodeResponse(target, res); err != nil {
  92024. return nil, err
  92025. }
  92026. return ret, nil
  92027. // {
  92028. // "description": "Returns the specified TargetInstance resource. Gets a list of available target instances by making a list() request.",
  92029. // "httpMethod": "GET",
  92030. // "id": "compute.targetInstances.get",
  92031. // "parameterOrder": [
  92032. // "project",
  92033. // "zone",
  92034. // "targetInstance"
  92035. // ],
  92036. // "parameters": {
  92037. // "project": {
  92038. // "description": "Project ID for this request.",
  92039. // "location": "path",
  92040. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  92041. // "required": true,
  92042. // "type": "string"
  92043. // },
  92044. // "targetInstance": {
  92045. // "description": "Name of the TargetInstance resource to return.",
  92046. // "location": "path",
  92047. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  92048. // "required": true,
  92049. // "type": "string"
  92050. // },
  92051. // "zone": {
  92052. // "description": "Name of the zone scoping this request.",
  92053. // "location": "path",
  92054. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  92055. // "required": true,
  92056. // "type": "string"
  92057. // }
  92058. // },
  92059. // "path": "{project}/zones/{zone}/targetInstances/{targetInstance}",
  92060. // "response": {
  92061. // "$ref": "TargetInstance"
  92062. // },
  92063. // "scopes": [
  92064. // "https://www.googleapis.com/auth/cloud-platform",
  92065. // "https://www.googleapis.com/auth/compute",
  92066. // "https://www.googleapis.com/auth/compute.readonly"
  92067. // ]
  92068. // }
  92069. }
  92070. // method id "compute.targetInstances.insert":
  92071. type TargetInstancesInsertCall struct {
  92072. s *Service
  92073. project string
  92074. zone string
  92075. targetinstance *TargetInstance
  92076. urlParams_ gensupport.URLParams
  92077. ctx_ context.Context
  92078. header_ http.Header
  92079. }
  92080. // Insert: Creates a TargetInstance resource in the specified project
  92081. // and zone using the data included in the request.
  92082. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetInstances/insert
  92083. func (r *TargetInstancesService) Insert(project string, zone string, targetinstance *TargetInstance) *TargetInstancesInsertCall {
  92084. c := &TargetInstancesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  92085. c.project = project
  92086. c.zone = zone
  92087. c.targetinstance = targetinstance
  92088. return c
  92089. }
  92090. // RequestId sets the optional parameter "requestId": An optional
  92091. // request ID to identify requests. Specify a unique request ID so that
  92092. // if you must retry your request, the server will know to ignore the
  92093. // request if it has already been completed.
  92094. //
  92095. // For example, consider a situation where you make an initial request
  92096. // and the request times out. If you make the request again with the
  92097. // same request ID, the server can check if original operation with the
  92098. // same request ID was received, and if so, will ignore the second
  92099. // request. This prevents clients from accidentally creating duplicate
  92100. // commitments.
  92101. //
  92102. // The request ID must be a valid UUID with the exception that zero UUID
  92103. // is not supported (00000000-0000-0000-0000-000000000000).
  92104. func (c *TargetInstancesInsertCall) RequestId(requestId string) *TargetInstancesInsertCall {
  92105. c.urlParams_.Set("requestId", requestId)
  92106. return c
  92107. }
  92108. // Fields allows partial responses to be retrieved. See
  92109. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  92110. // for more information.
  92111. func (c *TargetInstancesInsertCall) Fields(s ...googleapi.Field) *TargetInstancesInsertCall {
  92112. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  92113. return c
  92114. }
  92115. // Context sets the context to be used in this call's Do method. Any
  92116. // pending HTTP request will be aborted if the provided context is
  92117. // canceled.
  92118. func (c *TargetInstancesInsertCall) Context(ctx context.Context) *TargetInstancesInsertCall {
  92119. c.ctx_ = ctx
  92120. return c
  92121. }
  92122. // Header returns an http.Header that can be modified by the caller to
  92123. // add HTTP headers to the request.
  92124. func (c *TargetInstancesInsertCall) Header() http.Header {
  92125. if c.header_ == nil {
  92126. c.header_ = make(http.Header)
  92127. }
  92128. return c.header_
  92129. }
  92130. func (c *TargetInstancesInsertCall) doRequest(alt string) (*http.Response, error) {
  92131. reqHeaders := make(http.Header)
  92132. for k, v := range c.header_ {
  92133. reqHeaders[k] = v
  92134. }
  92135. reqHeaders.Set("User-Agent", c.s.userAgent())
  92136. var body io.Reader = nil
  92137. body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetinstance)
  92138. if err != nil {
  92139. return nil, err
  92140. }
  92141. reqHeaders.Set("Content-Type", "application/json")
  92142. c.urlParams_.Set("alt", alt)
  92143. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/targetInstances")
  92144. urls += "?" + c.urlParams_.Encode()
  92145. req, _ := http.NewRequest("POST", urls, body)
  92146. req.Header = reqHeaders
  92147. googleapi.Expand(req.URL, map[string]string{
  92148. "project": c.project,
  92149. "zone": c.zone,
  92150. })
  92151. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  92152. }
  92153. // Do executes the "compute.targetInstances.insert" call.
  92154. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  92155. // status code is an error. Response headers are in either
  92156. // *Operation.ServerResponse.Header or (if a response was returned at
  92157. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  92158. // to check whether the returned error was because
  92159. // http.StatusNotModified was returned.
  92160. func (c *TargetInstancesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  92161. gensupport.SetOptions(c.urlParams_, opts...)
  92162. res, err := c.doRequest("json")
  92163. if res != nil && res.StatusCode == http.StatusNotModified {
  92164. if res.Body != nil {
  92165. res.Body.Close()
  92166. }
  92167. return nil, &googleapi.Error{
  92168. Code: res.StatusCode,
  92169. Header: res.Header,
  92170. }
  92171. }
  92172. if err != nil {
  92173. return nil, err
  92174. }
  92175. defer googleapi.CloseBody(res)
  92176. if err := googleapi.CheckResponse(res); err != nil {
  92177. return nil, err
  92178. }
  92179. ret := &Operation{
  92180. ServerResponse: googleapi.ServerResponse{
  92181. Header: res.Header,
  92182. HTTPStatusCode: res.StatusCode,
  92183. },
  92184. }
  92185. target := &ret
  92186. if err := gensupport.DecodeResponse(target, res); err != nil {
  92187. return nil, err
  92188. }
  92189. return ret, nil
  92190. // {
  92191. // "description": "Creates a TargetInstance resource in the specified project and zone using the data included in the request.",
  92192. // "httpMethod": "POST",
  92193. // "id": "compute.targetInstances.insert",
  92194. // "parameterOrder": [
  92195. // "project",
  92196. // "zone"
  92197. // ],
  92198. // "parameters": {
  92199. // "project": {
  92200. // "description": "Project ID for this request.",
  92201. // "location": "path",
  92202. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  92203. // "required": true,
  92204. // "type": "string"
  92205. // },
  92206. // "requestId": {
  92207. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  92208. // "location": "query",
  92209. // "type": "string"
  92210. // },
  92211. // "zone": {
  92212. // "description": "Name of the zone scoping this request.",
  92213. // "location": "path",
  92214. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  92215. // "required": true,
  92216. // "type": "string"
  92217. // }
  92218. // },
  92219. // "path": "{project}/zones/{zone}/targetInstances",
  92220. // "request": {
  92221. // "$ref": "TargetInstance"
  92222. // },
  92223. // "response": {
  92224. // "$ref": "Operation"
  92225. // },
  92226. // "scopes": [
  92227. // "https://www.googleapis.com/auth/cloud-platform",
  92228. // "https://www.googleapis.com/auth/compute"
  92229. // ]
  92230. // }
  92231. }
  92232. // method id "compute.targetInstances.list":
  92233. type TargetInstancesListCall struct {
  92234. s *Service
  92235. project string
  92236. zone string
  92237. urlParams_ gensupport.URLParams
  92238. ifNoneMatch_ string
  92239. ctx_ context.Context
  92240. header_ http.Header
  92241. }
  92242. // List: Retrieves a list of TargetInstance resources available to the
  92243. // specified project and zone.
  92244. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetInstances/list
  92245. func (r *TargetInstancesService) List(project string, zone string) *TargetInstancesListCall {
  92246. c := &TargetInstancesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  92247. c.project = project
  92248. c.zone = zone
  92249. return c
  92250. }
  92251. // Filter sets the optional parameter "filter": A filter expression that
  92252. // filters resources listed in the response. The expression must specify
  92253. // the field name, a comparison operator, and the value that you want to
  92254. // use for filtering. The value must be a string, a number, or a
  92255. // boolean. The comparison operator must be either =, !=, >, or <.
  92256. //
  92257. // For example, if you are filtering Compute Engine instances, you can
  92258. // exclude instances named example-instance by specifying name !=
  92259. // example-instance.
  92260. //
  92261. // You can also filter nested fields. For example, you could specify
  92262. // scheduling.automaticRestart = false to include instances only if they
  92263. // are not scheduled for automatic restarts. You can use filtering on
  92264. // nested fields to filter based on resource labels.
  92265. //
  92266. // To filter on multiple expressions, provide each separate expression
  92267. // within parentheses. For example, (scheduling.automaticRestart = true)
  92268. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  92269. // AND expression. However, you can include AND and OR expressions
  92270. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  92271. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  92272. // true).
  92273. func (c *TargetInstancesListCall) Filter(filter string) *TargetInstancesListCall {
  92274. c.urlParams_.Set("filter", filter)
  92275. return c
  92276. }
  92277. // MaxResults sets the optional parameter "maxResults": The maximum
  92278. // number of results per page that should be returned. If the number of
  92279. // available results is larger than maxResults, Compute Engine returns a
  92280. // nextPageToken that can be used to get the next page of results in
  92281. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  92282. // (Default: 500)
  92283. func (c *TargetInstancesListCall) MaxResults(maxResults int64) *TargetInstancesListCall {
  92284. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  92285. return c
  92286. }
  92287. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  92288. // a certain order. By default, results are returned in alphanumerical
  92289. // order based on the resource name.
  92290. //
  92291. // You can also sort results in descending order based on the creation
  92292. // timestamp using orderBy="creationTimestamp desc". This sorts results
  92293. // based on the creationTimestamp field in reverse chronological order
  92294. // (newest result first). Use this to sort resources like operations so
  92295. // that the newest operation is returned first.
  92296. //
  92297. // Currently, only sorting by name or creationTimestamp desc is
  92298. // supported.
  92299. func (c *TargetInstancesListCall) OrderBy(orderBy string) *TargetInstancesListCall {
  92300. c.urlParams_.Set("orderBy", orderBy)
  92301. return c
  92302. }
  92303. // PageToken sets the optional parameter "pageToken": Specifies a page
  92304. // token to use. Set pageToken to the nextPageToken returned by a
  92305. // previous list request to get the next page of results.
  92306. func (c *TargetInstancesListCall) PageToken(pageToken string) *TargetInstancesListCall {
  92307. c.urlParams_.Set("pageToken", pageToken)
  92308. return c
  92309. }
  92310. // Fields allows partial responses to be retrieved. See
  92311. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  92312. // for more information.
  92313. func (c *TargetInstancesListCall) Fields(s ...googleapi.Field) *TargetInstancesListCall {
  92314. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  92315. return c
  92316. }
  92317. // IfNoneMatch sets the optional parameter which makes the operation
  92318. // fail if the object's ETag matches the given value. This is useful for
  92319. // getting updates only after the object has changed since the last
  92320. // request. Use googleapi.IsNotModified to check whether the response
  92321. // error from Do is the result of In-None-Match.
  92322. func (c *TargetInstancesListCall) IfNoneMatch(entityTag string) *TargetInstancesListCall {
  92323. c.ifNoneMatch_ = entityTag
  92324. return c
  92325. }
  92326. // Context sets the context to be used in this call's Do method. Any
  92327. // pending HTTP request will be aborted if the provided context is
  92328. // canceled.
  92329. func (c *TargetInstancesListCall) Context(ctx context.Context) *TargetInstancesListCall {
  92330. c.ctx_ = ctx
  92331. return c
  92332. }
  92333. // Header returns an http.Header that can be modified by the caller to
  92334. // add HTTP headers to the request.
  92335. func (c *TargetInstancesListCall) Header() http.Header {
  92336. if c.header_ == nil {
  92337. c.header_ = make(http.Header)
  92338. }
  92339. return c.header_
  92340. }
  92341. func (c *TargetInstancesListCall) doRequest(alt string) (*http.Response, error) {
  92342. reqHeaders := make(http.Header)
  92343. for k, v := range c.header_ {
  92344. reqHeaders[k] = v
  92345. }
  92346. reqHeaders.Set("User-Agent", c.s.userAgent())
  92347. if c.ifNoneMatch_ != "" {
  92348. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  92349. }
  92350. var body io.Reader = nil
  92351. c.urlParams_.Set("alt", alt)
  92352. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/targetInstances")
  92353. urls += "?" + c.urlParams_.Encode()
  92354. req, _ := http.NewRequest("GET", urls, body)
  92355. req.Header = reqHeaders
  92356. googleapi.Expand(req.URL, map[string]string{
  92357. "project": c.project,
  92358. "zone": c.zone,
  92359. })
  92360. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  92361. }
  92362. // Do executes the "compute.targetInstances.list" call.
  92363. // Exactly one of *TargetInstanceList or error will be non-nil. Any
  92364. // non-2xx status code is an error. Response headers are in either
  92365. // *TargetInstanceList.ServerResponse.Header or (if a response was
  92366. // returned at all) in error.(*googleapi.Error).Header. Use
  92367. // googleapi.IsNotModified to check whether the returned error was
  92368. // because http.StatusNotModified was returned.
  92369. func (c *TargetInstancesListCall) Do(opts ...googleapi.CallOption) (*TargetInstanceList, error) {
  92370. gensupport.SetOptions(c.urlParams_, opts...)
  92371. res, err := c.doRequest("json")
  92372. if res != nil && res.StatusCode == http.StatusNotModified {
  92373. if res.Body != nil {
  92374. res.Body.Close()
  92375. }
  92376. return nil, &googleapi.Error{
  92377. Code: res.StatusCode,
  92378. Header: res.Header,
  92379. }
  92380. }
  92381. if err != nil {
  92382. return nil, err
  92383. }
  92384. defer googleapi.CloseBody(res)
  92385. if err := googleapi.CheckResponse(res); err != nil {
  92386. return nil, err
  92387. }
  92388. ret := &TargetInstanceList{
  92389. ServerResponse: googleapi.ServerResponse{
  92390. Header: res.Header,
  92391. HTTPStatusCode: res.StatusCode,
  92392. },
  92393. }
  92394. target := &ret
  92395. if err := gensupport.DecodeResponse(target, res); err != nil {
  92396. return nil, err
  92397. }
  92398. return ret, nil
  92399. // {
  92400. // "description": "Retrieves a list of TargetInstance resources available to the specified project and zone.",
  92401. // "httpMethod": "GET",
  92402. // "id": "compute.targetInstances.list",
  92403. // "parameterOrder": [
  92404. // "project",
  92405. // "zone"
  92406. // ],
  92407. // "parameters": {
  92408. // "filter": {
  92409. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  92410. // "location": "query",
  92411. // "type": "string"
  92412. // },
  92413. // "maxResults": {
  92414. // "default": "500",
  92415. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  92416. // "format": "uint32",
  92417. // "location": "query",
  92418. // "minimum": "0",
  92419. // "type": "integer"
  92420. // },
  92421. // "orderBy": {
  92422. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  92423. // "location": "query",
  92424. // "type": "string"
  92425. // },
  92426. // "pageToken": {
  92427. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  92428. // "location": "query",
  92429. // "type": "string"
  92430. // },
  92431. // "project": {
  92432. // "description": "Project ID for this request.",
  92433. // "location": "path",
  92434. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  92435. // "required": true,
  92436. // "type": "string"
  92437. // },
  92438. // "zone": {
  92439. // "description": "Name of the zone scoping this request.",
  92440. // "location": "path",
  92441. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  92442. // "required": true,
  92443. // "type": "string"
  92444. // }
  92445. // },
  92446. // "path": "{project}/zones/{zone}/targetInstances",
  92447. // "response": {
  92448. // "$ref": "TargetInstanceList"
  92449. // },
  92450. // "scopes": [
  92451. // "https://www.googleapis.com/auth/cloud-platform",
  92452. // "https://www.googleapis.com/auth/compute",
  92453. // "https://www.googleapis.com/auth/compute.readonly"
  92454. // ]
  92455. // }
  92456. }
  92457. // Pages invokes f for each page of results.
  92458. // A non-nil error returned from f will halt the iteration.
  92459. // The provided context supersedes any context provided to the Context method.
  92460. func (c *TargetInstancesListCall) Pages(ctx context.Context, f func(*TargetInstanceList) error) error {
  92461. c.ctx_ = ctx
  92462. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  92463. for {
  92464. x, err := c.Do()
  92465. if err != nil {
  92466. return err
  92467. }
  92468. if err := f(x); err != nil {
  92469. return err
  92470. }
  92471. if x.NextPageToken == "" {
  92472. return nil
  92473. }
  92474. c.PageToken(x.NextPageToken)
  92475. }
  92476. }
  92477. // method id "compute.targetInstances.testIamPermissions":
  92478. type TargetInstancesTestIamPermissionsCall struct {
  92479. s *Service
  92480. project string
  92481. zone string
  92482. resource string
  92483. testpermissionsrequest *TestPermissionsRequest
  92484. urlParams_ gensupport.URLParams
  92485. ctx_ context.Context
  92486. header_ http.Header
  92487. }
  92488. // TestIamPermissions: Returns permissions that a caller has on the
  92489. // specified resource.
  92490. func (r *TargetInstancesService) TestIamPermissions(project string, zone string, resource string, testpermissionsrequest *TestPermissionsRequest) *TargetInstancesTestIamPermissionsCall {
  92491. c := &TargetInstancesTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  92492. c.project = project
  92493. c.zone = zone
  92494. c.resource = resource
  92495. c.testpermissionsrequest = testpermissionsrequest
  92496. return c
  92497. }
  92498. // Fields allows partial responses to be retrieved. See
  92499. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  92500. // for more information.
  92501. func (c *TargetInstancesTestIamPermissionsCall) Fields(s ...googleapi.Field) *TargetInstancesTestIamPermissionsCall {
  92502. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  92503. return c
  92504. }
  92505. // Context sets the context to be used in this call's Do method. Any
  92506. // pending HTTP request will be aborted if the provided context is
  92507. // canceled.
  92508. func (c *TargetInstancesTestIamPermissionsCall) Context(ctx context.Context) *TargetInstancesTestIamPermissionsCall {
  92509. c.ctx_ = ctx
  92510. return c
  92511. }
  92512. // Header returns an http.Header that can be modified by the caller to
  92513. // add HTTP headers to the request.
  92514. func (c *TargetInstancesTestIamPermissionsCall) Header() http.Header {
  92515. if c.header_ == nil {
  92516. c.header_ = make(http.Header)
  92517. }
  92518. return c.header_
  92519. }
  92520. func (c *TargetInstancesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  92521. reqHeaders := make(http.Header)
  92522. for k, v := range c.header_ {
  92523. reqHeaders[k] = v
  92524. }
  92525. reqHeaders.Set("User-Agent", c.s.userAgent())
  92526. var body io.Reader = nil
  92527. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  92528. if err != nil {
  92529. return nil, err
  92530. }
  92531. reqHeaders.Set("Content-Type", "application/json")
  92532. c.urlParams_.Set("alt", alt)
  92533. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/targetInstances/{resource}/testIamPermissions")
  92534. urls += "?" + c.urlParams_.Encode()
  92535. req, _ := http.NewRequest("POST", urls, body)
  92536. req.Header = reqHeaders
  92537. googleapi.Expand(req.URL, map[string]string{
  92538. "project": c.project,
  92539. "zone": c.zone,
  92540. "resource": c.resource,
  92541. })
  92542. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  92543. }
  92544. // Do executes the "compute.targetInstances.testIamPermissions" call.
  92545. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  92546. // non-2xx status code is an error. Response headers are in either
  92547. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  92548. // returned at all) in error.(*googleapi.Error).Header. Use
  92549. // googleapi.IsNotModified to check whether the returned error was
  92550. // because http.StatusNotModified was returned.
  92551. func (c *TargetInstancesTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  92552. gensupport.SetOptions(c.urlParams_, opts...)
  92553. res, err := c.doRequest("json")
  92554. if res != nil && res.StatusCode == http.StatusNotModified {
  92555. if res.Body != nil {
  92556. res.Body.Close()
  92557. }
  92558. return nil, &googleapi.Error{
  92559. Code: res.StatusCode,
  92560. Header: res.Header,
  92561. }
  92562. }
  92563. if err != nil {
  92564. return nil, err
  92565. }
  92566. defer googleapi.CloseBody(res)
  92567. if err := googleapi.CheckResponse(res); err != nil {
  92568. return nil, err
  92569. }
  92570. ret := &TestPermissionsResponse{
  92571. ServerResponse: googleapi.ServerResponse{
  92572. Header: res.Header,
  92573. HTTPStatusCode: res.StatusCode,
  92574. },
  92575. }
  92576. target := &ret
  92577. if err := gensupport.DecodeResponse(target, res); err != nil {
  92578. return nil, err
  92579. }
  92580. return ret, nil
  92581. // {
  92582. // "description": "Returns permissions that a caller has on the specified resource.",
  92583. // "httpMethod": "POST",
  92584. // "id": "compute.targetInstances.testIamPermissions",
  92585. // "parameterOrder": [
  92586. // "project",
  92587. // "zone",
  92588. // "resource"
  92589. // ],
  92590. // "parameters": {
  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. // "resource": {
  92599. // "description": "Name of the resource for this request.",
  92600. // "location": "path",
  92601. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  92602. // "required": true,
  92603. // "type": "string"
  92604. // },
  92605. // "zone": {
  92606. // "description": "The name of the zone for this request.",
  92607. // "location": "path",
  92608. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  92609. // "required": true,
  92610. // "type": "string"
  92611. // }
  92612. // },
  92613. // "path": "{project}/zones/{zone}/targetInstances/{resource}/testIamPermissions",
  92614. // "request": {
  92615. // "$ref": "TestPermissionsRequest"
  92616. // },
  92617. // "response": {
  92618. // "$ref": "TestPermissionsResponse"
  92619. // },
  92620. // "scopes": [
  92621. // "https://www.googleapis.com/auth/cloud-platform",
  92622. // "https://www.googleapis.com/auth/compute",
  92623. // "https://www.googleapis.com/auth/compute.readonly"
  92624. // ]
  92625. // }
  92626. }
  92627. // method id "compute.targetPools.addHealthCheck":
  92628. type TargetPoolsAddHealthCheckCall struct {
  92629. s *Service
  92630. project string
  92631. region string
  92632. targetPool string
  92633. targetpoolsaddhealthcheckrequest *TargetPoolsAddHealthCheckRequest
  92634. urlParams_ gensupport.URLParams
  92635. ctx_ context.Context
  92636. header_ http.Header
  92637. }
  92638. // AddHealthCheck: Adds health check URLs to a target pool.
  92639. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetPools/addHealthCheck
  92640. func (r *TargetPoolsService) AddHealthCheck(project string, region string, targetPool string, targetpoolsaddhealthcheckrequest *TargetPoolsAddHealthCheckRequest) *TargetPoolsAddHealthCheckCall {
  92641. c := &TargetPoolsAddHealthCheckCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  92642. c.project = project
  92643. c.region = region
  92644. c.targetPool = targetPool
  92645. c.targetpoolsaddhealthcheckrequest = targetpoolsaddhealthcheckrequest
  92646. return c
  92647. }
  92648. // RequestId sets the optional parameter "requestId": An optional
  92649. // request ID to identify requests. Specify a unique request ID so that
  92650. // if you must retry your request, the server will know to ignore the
  92651. // request if it has already been completed.
  92652. //
  92653. // For example, consider a situation where you make an initial request
  92654. // and the request times out. If you make the request again with the
  92655. // same request ID, the server can check if original operation with the
  92656. // same request ID was received, and if so, will ignore the second
  92657. // request. This prevents clients from accidentally creating duplicate
  92658. // commitments.
  92659. //
  92660. // The request ID must be a valid UUID with the exception that zero UUID
  92661. // is not supported (00000000-0000-0000-0000-000000000000).
  92662. func (c *TargetPoolsAddHealthCheckCall) RequestId(requestId string) *TargetPoolsAddHealthCheckCall {
  92663. c.urlParams_.Set("requestId", requestId)
  92664. return c
  92665. }
  92666. // Fields allows partial responses to be retrieved. See
  92667. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  92668. // for more information.
  92669. func (c *TargetPoolsAddHealthCheckCall) Fields(s ...googleapi.Field) *TargetPoolsAddHealthCheckCall {
  92670. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  92671. return c
  92672. }
  92673. // Context sets the context to be used in this call's Do method. Any
  92674. // pending HTTP request will be aborted if the provided context is
  92675. // canceled.
  92676. func (c *TargetPoolsAddHealthCheckCall) Context(ctx context.Context) *TargetPoolsAddHealthCheckCall {
  92677. c.ctx_ = ctx
  92678. return c
  92679. }
  92680. // Header returns an http.Header that can be modified by the caller to
  92681. // add HTTP headers to the request.
  92682. func (c *TargetPoolsAddHealthCheckCall) Header() http.Header {
  92683. if c.header_ == nil {
  92684. c.header_ = make(http.Header)
  92685. }
  92686. return c.header_
  92687. }
  92688. func (c *TargetPoolsAddHealthCheckCall) doRequest(alt string) (*http.Response, error) {
  92689. reqHeaders := make(http.Header)
  92690. for k, v := range c.header_ {
  92691. reqHeaders[k] = v
  92692. }
  92693. reqHeaders.Set("User-Agent", c.s.userAgent())
  92694. var body io.Reader = nil
  92695. body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetpoolsaddhealthcheckrequest)
  92696. if err != nil {
  92697. return nil, err
  92698. }
  92699. reqHeaders.Set("Content-Type", "application/json")
  92700. c.urlParams_.Set("alt", alt)
  92701. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/targetPools/{targetPool}/addHealthCheck")
  92702. urls += "?" + c.urlParams_.Encode()
  92703. req, _ := http.NewRequest("POST", urls, body)
  92704. req.Header = reqHeaders
  92705. googleapi.Expand(req.URL, map[string]string{
  92706. "project": c.project,
  92707. "region": c.region,
  92708. "targetPool": c.targetPool,
  92709. })
  92710. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  92711. }
  92712. // Do executes the "compute.targetPools.addHealthCheck" call.
  92713. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  92714. // status code is an error. Response headers are in either
  92715. // *Operation.ServerResponse.Header or (if a response was returned at
  92716. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  92717. // to check whether the returned error was because
  92718. // http.StatusNotModified was returned.
  92719. func (c *TargetPoolsAddHealthCheckCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  92720. gensupport.SetOptions(c.urlParams_, opts...)
  92721. res, err := c.doRequest("json")
  92722. if res != nil && res.StatusCode == http.StatusNotModified {
  92723. if res.Body != nil {
  92724. res.Body.Close()
  92725. }
  92726. return nil, &googleapi.Error{
  92727. Code: res.StatusCode,
  92728. Header: res.Header,
  92729. }
  92730. }
  92731. if err != nil {
  92732. return nil, err
  92733. }
  92734. defer googleapi.CloseBody(res)
  92735. if err := googleapi.CheckResponse(res); err != nil {
  92736. return nil, err
  92737. }
  92738. ret := &Operation{
  92739. ServerResponse: googleapi.ServerResponse{
  92740. Header: res.Header,
  92741. HTTPStatusCode: res.StatusCode,
  92742. },
  92743. }
  92744. target := &ret
  92745. if err := gensupport.DecodeResponse(target, res); err != nil {
  92746. return nil, err
  92747. }
  92748. return ret, nil
  92749. // {
  92750. // "description": "Adds health check URLs to a target pool.",
  92751. // "httpMethod": "POST",
  92752. // "id": "compute.targetPools.addHealthCheck",
  92753. // "parameterOrder": [
  92754. // "project",
  92755. // "region",
  92756. // "targetPool"
  92757. // ],
  92758. // "parameters": {
  92759. // "project": {
  92760. // "description": "Project ID for this request.",
  92761. // "location": "path",
  92762. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  92763. // "required": true,
  92764. // "type": "string"
  92765. // },
  92766. // "region": {
  92767. // "description": "Name of the region scoping this request.",
  92768. // "location": "path",
  92769. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  92770. // "required": true,
  92771. // "type": "string"
  92772. // },
  92773. // "requestId": {
  92774. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  92775. // "location": "query",
  92776. // "type": "string"
  92777. // },
  92778. // "targetPool": {
  92779. // "description": "Name of the target pool to add a health check to.",
  92780. // "location": "path",
  92781. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  92782. // "required": true,
  92783. // "type": "string"
  92784. // }
  92785. // },
  92786. // "path": "{project}/regions/{region}/targetPools/{targetPool}/addHealthCheck",
  92787. // "request": {
  92788. // "$ref": "TargetPoolsAddHealthCheckRequest"
  92789. // },
  92790. // "response": {
  92791. // "$ref": "Operation"
  92792. // },
  92793. // "scopes": [
  92794. // "https://www.googleapis.com/auth/cloud-platform",
  92795. // "https://www.googleapis.com/auth/compute"
  92796. // ]
  92797. // }
  92798. }
  92799. // method id "compute.targetPools.addInstance":
  92800. type TargetPoolsAddInstanceCall struct {
  92801. s *Service
  92802. project string
  92803. region string
  92804. targetPool string
  92805. targetpoolsaddinstancerequest *TargetPoolsAddInstanceRequest
  92806. urlParams_ gensupport.URLParams
  92807. ctx_ context.Context
  92808. header_ http.Header
  92809. }
  92810. // AddInstance: Adds an instance to a target pool.
  92811. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetPools/addInstance
  92812. func (r *TargetPoolsService) AddInstance(project string, region string, targetPool string, targetpoolsaddinstancerequest *TargetPoolsAddInstanceRequest) *TargetPoolsAddInstanceCall {
  92813. c := &TargetPoolsAddInstanceCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  92814. c.project = project
  92815. c.region = region
  92816. c.targetPool = targetPool
  92817. c.targetpoolsaddinstancerequest = targetpoolsaddinstancerequest
  92818. return c
  92819. }
  92820. // RequestId sets the optional parameter "requestId": An optional
  92821. // request ID to identify requests. Specify a unique request ID so that
  92822. // if you must retry your request, the server will know to ignore the
  92823. // request if it has already been completed.
  92824. //
  92825. // For example, consider a situation where you make an initial request
  92826. // and the request times out. If you make the request again with the
  92827. // same request ID, the server can check if original operation with the
  92828. // same request ID was received, and if so, will ignore the second
  92829. // request. This prevents clients from accidentally creating duplicate
  92830. // commitments.
  92831. //
  92832. // The request ID must be a valid UUID with the exception that zero UUID
  92833. // is not supported (00000000-0000-0000-0000-000000000000).
  92834. func (c *TargetPoolsAddInstanceCall) RequestId(requestId string) *TargetPoolsAddInstanceCall {
  92835. c.urlParams_.Set("requestId", requestId)
  92836. return c
  92837. }
  92838. // Fields allows partial responses to be retrieved. See
  92839. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  92840. // for more information.
  92841. func (c *TargetPoolsAddInstanceCall) Fields(s ...googleapi.Field) *TargetPoolsAddInstanceCall {
  92842. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  92843. return c
  92844. }
  92845. // Context sets the context to be used in this call's Do method. Any
  92846. // pending HTTP request will be aborted if the provided context is
  92847. // canceled.
  92848. func (c *TargetPoolsAddInstanceCall) Context(ctx context.Context) *TargetPoolsAddInstanceCall {
  92849. c.ctx_ = ctx
  92850. return c
  92851. }
  92852. // Header returns an http.Header that can be modified by the caller to
  92853. // add HTTP headers to the request.
  92854. func (c *TargetPoolsAddInstanceCall) Header() http.Header {
  92855. if c.header_ == nil {
  92856. c.header_ = make(http.Header)
  92857. }
  92858. return c.header_
  92859. }
  92860. func (c *TargetPoolsAddInstanceCall) doRequest(alt string) (*http.Response, error) {
  92861. reqHeaders := make(http.Header)
  92862. for k, v := range c.header_ {
  92863. reqHeaders[k] = v
  92864. }
  92865. reqHeaders.Set("User-Agent", c.s.userAgent())
  92866. var body io.Reader = nil
  92867. body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetpoolsaddinstancerequest)
  92868. if err != nil {
  92869. return nil, err
  92870. }
  92871. reqHeaders.Set("Content-Type", "application/json")
  92872. c.urlParams_.Set("alt", alt)
  92873. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/targetPools/{targetPool}/addInstance")
  92874. urls += "?" + c.urlParams_.Encode()
  92875. req, _ := http.NewRequest("POST", urls, body)
  92876. req.Header = reqHeaders
  92877. googleapi.Expand(req.URL, map[string]string{
  92878. "project": c.project,
  92879. "region": c.region,
  92880. "targetPool": c.targetPool,
  92881. })
  92882. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  92883. }
  92884. // Do executes the "compute.targetPools.addInstance" call.
  92885. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  92886. // status code is an error. Response headers are in either
  92887. // *Operation.ServerResponse.Header or (if a response was returned at
  92888. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  92889. // to check whether the returned error was because
  92890. // http.StatusNotModified was returned.
  92891. func (c *TargetPoolsAddInstanceCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  92892. gensupport.SetOptions(c.urlParams_, opts...)
  92893. res, err := c.doRequest("json")
  92894. if res != nil && res.StatusCode == http.StatusNotModified {
  92895. if res.Body != nil {
  92896. res.Body.Close()
  92897. }
  92898. return nil, &googleapi.Error{
  92899. Code: res.StatusCode,
  92900. Header: res.Header,
  92901. }
  92902. }
  92903. if err != nil {
  92904. return nil, err
  92905. }
  92906. defer googleapi.CloseBody(res)
  92907. if err := googleapi.CheckResponse(res); err != nil {
  92908. return nil, err
  92909. }
  92910. ret := &Operation{
  92911. ServerResponse: googleapi.ServerResponse{
  92912. Header: res.Header,
  92913. HTTPStatusCode: res.StatusCode,
  92914. },
  92915. }
  92916. target := &ret
  92917. if err := gensupport.DecodeResponse(target, res); err != nil {
  92918. return nil, err
  92919. }
  92920. return ret, nil
  92921. // {
  92922. // "description": "Adds an instance to a target pool.",
  92923. // "httpMethod": "POST",
  92924. // "id": "compute.targetPools.addInstance",
  92925. // "parameterOrder": [
  92926. // "project",
  92927. // "region",
  92928. // "targetPool"
  92929. // ],
  92930. // "parameters": {
  92931. // "project": {
  92932. // "description": "Project ID for this request.",
  92933. // "location": "path",
  92934. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  92935. // "required": true,
  92936. // "type": "string"
  92937. // },
  92938. // "region": {
  92939. // "description": "Name of the region scoping this request.",
  92940. // "location": "path",
  92941. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  92942. // "required": true,
  92943. // "type": "string"
  92944. // },
  92945. // "requestId": {
  92946. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  92947. // "location": "query",
  92948. // "type": "string"
  92949. // },
  92950. // "targetPool": {
  92951. // "description": "Name of the TargetPool resource to add instances to.",
  92952. // "location": "path",
  92953. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  92954. // "required": true,
  92955. // "type": "string"
  92956. // }
  92957. // },
  92958. // "path": "{project}/regions/{region}/targetPools/{targetPool}/addInstance",
  92959. // "request": {
  92960. // "$ref": "TargetPoolsAddInstanceRequest"
  92961. // },
  92962. // "response": {
  92963. // "$ref": "Operation"
  92964. // },
  92965. // "scopes": [
  92966. // "https://www.googleapis.com/auth/cloud-platform",
  92967. // "https://www.googleapis.com/auth/compute"
  92968. // ]
  92969. // }
  92970. }
  92971. // method id "compute.targetPools.aggregatedList":
  92972. type TargetPoolsAggregatedListCall struct {
  92973. s *Service
  92974. project string
  92975. urlParams_ gensupport.URLParams
  92976. ifNoneMatch_ string
  92977. ctx_ context.Context
  92978. header_ http.Header
  92979. }
  92980. // AggregatedList: Retrieves an aggregated list of target pools.
  92981. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetPools/aggregatedList
  92982. func (r *TargetPoolsService) AggregatedList(project string) *TargetPoolsAggregatedListCall {
  92983. c := &TargetPoolsAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  92984. c.project = project
  92985. return c
  92986. }
  92987. // Filter sets the optional parameter "filter": A filter expression that
  92988. // filters resources listed in the response. The expression must specify
  92989. // the field name, a comparison operator, and the value that you want to
  92990. // use for filtering. The value must be a string, a number, or a
  92991. // boolean. The comparison operator must be either =, !=, >, or <.
  92992. //
  92993. // For example, if you are filtering Compute Engine instances, you can
  92994. // exclude instances named example-instance by specifying name !=
  92995. // example-instance.
  92996. //
  92997. // You can also filter nested fields. For example, you could specify
  92998. // scheduling.automaticRestart = false to include instances only if they
  92999. // are not scheduled for automatic restarts. You can use filtering on
  93000. // nested fields to filter based on resource labels.
  93001. //
  93002. // To filter on multiple expressions, provide each separate expression
  93003. // within parentheses. For example, (scheduling.automaticRestart = true)
  93004. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  93005. // AND expression. However, you can include AND and OR expressions
  93006. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  93007. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  93008. // true).
  93009. func (c *TargetPoolsAggregatedListCall) Filter(filter string) *TargetPoolsAggregatedListCall {
  93010. c.urlParams_.Set("filter", filter)
  93011. return c
  93012. }
  93013. // MaxResults sets the optional parameter "maxResults": The maximum
  93014. // number of results per page that should be returned. If the number of
  93015. // available results is larger than maxResults, Compute Engine returns a
  93016. // nextPageToken that can be used to get the next page of results in
  93017. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  93018. // (Default: 500)
  93019. func (c *TargetPoolsAggregatedListCall) MaxResults(maxResults int64) *TargetPoolsAggregatedListCall {
  93020. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  93021. return c
  93022. }
  93023. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  93024. // a certain order. By default, results are returned in alphanumerical
  93025. // order based on the resource name.
  93026. //
  93027. // You can also sort results in descending order based on the creation
  93028. // timestamp using orderBy="creationTimestamp desc". This sorts results
  93029. // based on the creationTimestamp field in reverse chronological order
  93030. // (newest result first). Use this to sort resources like operations so
  93031. // that the newest operation is returned first.
  93032. //
  93033. // Currently, only sorting by name or creationTimestamp desc is
  93034. // supported.
  93035. func (c *TargetPoolsAggregatedListCall) OrderBy(orderBy string) *TargetPoolsAggregatedListCall {
  93036. c.urlParams_.Set("orderBy", orderBy)
  93037. return c
  93038. }
  93039. // PageToken sets the optional parameter "pageToken": Specifies a page
  93040. // token to use. Set pageToken to the nextPageToken returned by a
  93041. // previous list request to get the next page of results.
  93042. func (c *TargetPoolsAggregatedListCall) PageToken(pageToken string) *TargetPoolsAggregatedListCall {
  93043. c.urlParams_.Set("pageToken", pageToken)
  93044. return c
  93045. }
  93046. // Fields allows partial responses to be retrieved. See
  93047. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  93048. // for more information.
  93049. func (c *TargetPoolsAggregatedListCall) Fields(s ...googleapi.Field) *TargetPoolsAggregatedListCall {
  93050. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  93051. return c
  93052. }
  93053. // IfNoneMatch sets the optional parameter which makes the operation
  93054. // fail if the object's ETag matches the given value. This is useful for
  93055. // getting updates only after the object has changed since the last
  93056. // request. Use googleapi.IsNotModified to check whether the response
  93057. // error from Do is the result of In-None-Match.
  93058. func (c *TargetPoolsAggregatedListCall) IfNoneMatch(entityTag string) *TargetPoolsAggregatedListCall {
  93059. c.ifNoneMatch_ = entityTag
  93060. return c
  93061. }
  93062. // Context sets the context to be used in this call's Do method. Any
  93063. // pending HTTP request will be aborted if the provided context is
  93064. // canceled.
  93065. func (c *TargetPoolsAggregatedListCall) Context(ctx context.Context) *TargetPoolsAggregatedListCall {
  93066. c.ctx_ = ctx
  93067. return c
  93068. }
  93069. // Header returns an http.Header that can be modified by the caller to
  93070. // add HTTP headers to the request.
  93071. func (c *TargetPoolsAggregatedListCall) Header() http.Header {
  93072. if c.header_ == nil {
  93073. c.header_ = make(http.Header)
  93074. }
  93075. return c.header_
  93076. }
  93077. func (c *TargetPoolsAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  93078. reqHeaders := make(http.Header)
  93079. for k, v := range c.header_ {
  93080. reqHeaders[k] = v
  93081. }
  93082. reqHeaders.Set("User-Agent", c.s.userAgent())
  93083. if c.ifNoneMatch_ != "" {
  93084. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  93085. }
  93086. var body io.Reader = nil
  93087. c.urlParams_.Set("alt", alt)
  93088. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/targetPools")
  93089. urls += "?" + c.urlParams_.Encode()
  93090. req, _ := http.NewRequest("GET", urls, body)
  93091. req.Header = reqHeaders
  93092. googleapi.Expand(req.URL, map[string]string{
  93093. "project": c.project,
  93094. })
  93095. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  93096. }
  93097. // Do executes the "compute.targetPools.aggregatedList" call.
  93098. // Exactly one of *TargetPoolAggregatedList or error will be non-nil.
  93099. // Any non-2xx status code is an error. Response headers are in either
  93100. // *TargetPoolAggregatedList.ServerResponse.Header or (if a response was
  93101. // returned at all) in error.(*googleapi.Error).Header. Use
  93102. // googleapi.IsNotModified to check whether the returned error was
  93103. // because http.StatusNotModified was returned.
  93104. func (c *TargetPoolsAggregatedListCall) Do(opts ...googleapi.CallOption) (*TargetPoolAggregatedList, error) {
  93105. gensupport.SetOptions(c.urlParams_, opts...)
  93106. res, err := c.doRequest("json")
  93107. if res != nil && res.StatusCode == http.StatusNotModified {
  93108. if res.Body != nil {
  93109. res.Body.Close()
  93110. }
  93111. return nil, &googleapi.Error{
  93112. Code: res.StatusCode,
  93113. Header: res.Header,
  93114. }
  93115. }
  93116. if err != nil {
  93117. return nil, err
  93118. }
  93119. defer googleapi.CloseBody(res)
  93120. if err := googleapi.CheckResponse(res); err != nil {
  93121. return nil, err
  93122. }
  93123. ret := &TargetPoolAggregatedList{
  93124. ServerResponse: googleapi.ServerResponse{
  93125. Header: res.Header,
  93126. HTTPStatusCode: res.StatusCode,
  93127. },
  93128. }
  93129. target := &ret
  93130. if err := gensupport.DecodeResponse(target, res); err != nil {
  93131. return nil, err
  93132. }
  93133. return ret, nil
  93134. // {
  93135. // "description": "Retrieves an aggregated list of target pools.",
  93136. // "httpMethod": "GET",
  93137. // "id": "compute.targetPools.aggregatedList",
  93138. // "parameterOrder": [
  93139. // "project"
  93140. // ],
  93141. // "parameters": {
  93142. // "filter": {
  93143. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  93144. // "location": "query",
  93145. // "type": "string"
  93146. // },
  93147. // "maxResults": {
  93148. // "default": "500",
  93149. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  93150. // "format": "uint32",
  93151. // "location": "query",
  93152. // "minimum": "0",
  93153. // "type": "integer"
  93154. // },
  93155. // "orderBy": {
  93156. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  93157. // "location": "query",
  93158. // "type": "string"
  93159. // },
  93160. // "pageToken": {
  93161. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  93162. // "location": "query",
  93163. // "type": "string"
  93164. // },
  93165. // "project": {
  93166. // "description": "Project ID for this request.",
  93167. // "location": "path",
  93168. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  93169. // "required": true,
  93170. // "type": "string"
  93171. // }
  93172. // },
  93173. // "path": "{project}/aggregated/targetPools",
  93174. // "response": {
  93175. // "$ref": "TargetPoolAggregatedList"
  93176. // },
  93177. // "scopes": [
  93178. // "https://www.googleapis.com/auth/cloud-platform",
  93179. // "https://www.googleapis.com/auth/compute",
  93180. // "https://www.googleapis.com/auth/compute.readonly"
  93181. // ]
  93182. // }
  93183. }
  93184. // Pages invokes f for each page of results.
  93185. // A non-nil error returned from f will halt the iteration.
  93186. // The provided context supersedes any context provided to the Context method.
  93187. func (c *TargetPoolsAggregatedListCall) Pages(ctx context.Context, f func(*TargetPoolAggregatedList) error) error {
  93188. c.ctx_ = ctx
  93189. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  93190. for {
  93191. x, err := c.Do()
  93192. if err != nil {
  93193. return err
  93194. }
  93195. if err := f(x); err != nil {
  93196. return err
  93197. }
  93198. if x.NextPageToken == "" {
  93199. return nil
  93200. }
  93201. c.PageToken(x.NextPageToken)
  93202. }
  93203. }
  93204. // method id "compute.targetPools.delete":
  93205. type TargetPoolsDeleteCall struct {
  93206. s *Service
  93207. project string
  93208. region string
  93209. targetPool string
  93210. urlParams_ gensupport.URLParams
  93211. ctx_ context.Context
  93212. header_ http.Header
  93213. }
  93214. // Delete: Deletes the specified target pool.
  93215. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetPools/delete
  93216. func (r *TargetPoolsService) Delete(project string, region string, targetPool string) *TargetPoolsDeleteCall {
  93217. c := &TargetPoolsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  93218. c.project = project
  93219. c.region = region
  93220. c.targetPool = targetPool
  93221. return c
  93222. }
  93223. // RequestId sets the optional parameter "requestId": An optional
  93224. // request ID to identify requests. Specify a unique request ID so that
  93225. // if you must retry your request, the server will know to ignore the
  93226. // request if it has already been completed.
  93227. //
  93228. // For example, consider a situation where you make an initial request
  93229. // and the request times out. If you make the request again with the
  93230. // same request ID, the server can check if original operation with the
  93231. // same request ID was received, and if so, will ignore the second
  93232. // request. This prevents clients from accidentally creating duplicate
  93233. // commitments.
  93234. //
  93235. // The request ID must be a valid UUID with the exception that zero UUID
  93236. // is not supported (00000000-0000-0000-0000-000000000000).
  93237. func (c *TargetPoolsDeleteCall) RequestId(requestId string) *TargetPoolsDeleteCall {
  93238. c.urlParams_.Set("requestId", requestId)
  93239. return c
  93240. }
  93241. // Fields allows partial responses to be retrieved. See
  93242. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  93243. // for more information.
  93244. func (c *TargetPoolsDeleteCall) Fields(s ...googleapi.Field) *TargetPoolsDeleteCall {
  93245. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  93246. return c
  93247. }
  93248. // Context sets the context to be used in this call's Do method. Any
  93249. // pending HTTP request will be aborted if the provided context is
  93250. // canceled.
  93251. func (c *TargetPoolsDeleteCall) Context(ctx context.Context) *TargetPoolsDeleteCall {
  93252. c.ctx_ = ctx
  93253. return c
  93254. }
  93255. // Header returns an http.Header that can be modified by the caller to
  93256. // add HTTP headers to the request.
  93257. func (c *TargetPoolsDeleteCall) Header() http.Header {
  93258. if c.header_ == nil {
  93259. c.header_ = make(http.Header)
  93260. }
  93261. return c.header_
  93262. }
  93263. func (c *TargetPoolsDeleteCall) doRequest(alt string) (*http.Response, error) {
  93264. reqHeaders := make(http.Header)
  93265. for k, v := range c.header_ {
  93266. reqHeaders[k] = v
  93267. }
  93268. reqHeaders.Set("User-Agent", c.s.userAgent())
  93269. var body io.Reader = nil
  93270. c.urlParams_.Set("alt", alt)
  93271. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/targetPools/{targetPool}")
  93272. urls += "?" + c.urlParams_.Encode()
  93273. req, _ := http.NewRequest("DELETE", urls, body)
  93274. req.Header = reqHeaders
  93275. googleapi.Expand(req.URL, map[string]string{
  93276. "project": c.project,
  93277. "region": c.region,
  93278. "targetPool": c.targetPool,
  93279. })
  93280. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  93281. }
  93282. // Do executes the "compute.targetPools.delete" call.
  93283. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  93284. // status code is an error. Response headers are in either
  93285. // *Operation.ServerResponse.Header or (if a response was returned at
  93286. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  93287. // to check whether the returned error was because
  93288. // http.StatusNotModified was returned.
  93289. func (c *TargetPoolsDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  93290. gensupport.SetOptions(c.urlParams_, opts...)
  93291. res, err := c.doRequest("json")
  93292. if res != nil && res.StatusCode == http.StatusNotModified {
  93293. if res.Body != nil {
  93294. res.Body.Close()
  93295. }
  93296. return nil, &googleapi.Error{
  93297. Code: res.StatusCode,
  93298. Header: res.Header,
  93299. }
  93300. }
  93301. if err != nil {
  93302. return nil, err
  93303. }
  93304. defer googleapi.CloseBody(res)
  93305. if err := googleapi.CheckResponse(res); err != nil {
  93306. return nil, err
  93307. }
  93308. ret := &Operation{
  93309. ServerResponse: googleapi.ServerResponse{
  93310. Header: res.Header,
  93311. HTTPStatusCode: res.StatusCode,
  93312. },
  93313. }
  93314. target := &ret
  93315. if err := gensupport.DecodeResponse(target, res); err != nil {
  93316. return nil, err
  93317. }
  93318. return ret, nil
  93319. // {
  93320. // "description": "Deletes the specified target pool.",
  93321. // "httpMethod": "DELETE",
  93322. // "id": "compute.targetPools.delete",
  93323. // "parameterOrder": [
  93324. // "project",
  93325. // "region",
  93326. // "targetPool"
  93327. // ],
  93328. // "parameters": {
  93329. // "project": {
  93330. // "description": "Project ID for this request.",
  93331. // "location": "path",
  93332. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  93333. // "required": true,
  93334. // "type": "string"
  93335. // },
  93336. // "region": {
  93337. // "description": "Name of the region scoping this request.",
  93338. // "location": "path",
  93339. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  93340. // "required": true,
  93341. // "type": "string"
  93342. // },
  93343. // "requestId": {
  93344. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  93345. // "location": "query",
  93346. // "type": "string"
  93347. // },
  93348. // "targetPool": {
  93349. // "description": "Name of the TargetPool resource to delete.",
  93350. // "location": "path",
  93351. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  93352. // "required": true,
  93353. // "type": "string"
  93354. // }
  93355. // },
  93356. // "path": "{project}/regions/{region}/targetPools/{targetPool}",
  93357. // "response": {
  93358. // "$ref": "Operation"
  93359. // },
  93360. // "scopes": [
  93361. // "https://www.googleapis.com/auth/cloud-platform",
  93362. // "https://www.googleapis.com/auth/compute"
  93363. // ]
  93364. // }
  93365. }
  93366. // method id "compute.targetPools.get":
  93367. type TargetPoolsGetCall struct {
  93368. s *Service
  93369. project string
  93370. region string
  93371. targetPool string
  93372. urlParams_ gensupport.URLParams
  93373. ifNoneMatch_ string
  93374. ctx_ context.Context
  93375. header_ http.Header
  93376. }
  93377. // Get: Returns the specified target pool. Gets a list of available
  93378. // target pools by making a list() request.
  93379. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetPools/get
  93380. func (r *TargetPoolsService) Get(project string, region string, targetPool string) *TargetPoolsGetCall {
  93381. c := &TargetPoolsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  93382. c.project = project
  93383. c.region = region
  93384. c.targetPool = targetPool
  93385. return c
  93386. }
  93387. // Fields allows partial responses to be retrieved. See
  93388. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  93389. // for more information.
  93390. func (c *TargetPoolsGetCall) Fields(s ...googleapi.Field) *TargetPoolsGetCall {
  93391. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  93392. return c
  93393. }
  93394. // IfNoneMatch sets the optional parameter which makes the operation
  93395. // fail if the object's ETag matches the given value. This is useful for
  93396. // getting updates only after the object has changed since the last
  93397. // request. Use googleapi.IsNotModified to check whether the response
  93398. // error from Do is the result of In-None-Match.
  93399. func (c *TargetPoolsGetCall) IfNoneMatch(entityTag string) *TargetPoolsGetCall {
  93400. c.ifNoneMatch_ = entityTag
  93401. return c
  93402. }
  93403. // Context sets the context to be used in this call's Do method. Any
  93404. // pending HTTP request will be aborted if the provided context is
  93405. // canceled.
  93406. func (c *TargetPoolsGetCall) Context(ctx context.Context) *TargetPoolsGetCall {
  93407. c.ctx_ = ctx
  93408. return c
  93409. }
  93410. // Header returns an http.Header that can be modified by the caller to
  93411. // add HTTP headers to the request.
  93412. func (c *TargetPoolsGetCall) Header() http.Header {
  93413. if c.header_ == nil {
  93414. c.header_ = make(http.Header)
  93415. }
  93416. return c.header_
  93417. }
  93418. func (c *TargetPoolsGetCall) doRequest(alt string) (*http.Response, error) {
  93419. reqHeaders := make(http.Header)
  93420. for k, v := range c.header_ {
  93421. reqHeaders[k] = v
  93422. }
  93423. reqHeaders.Set("User-Agent", c.s.userAgent())
  93424. if c.ifNoneMatch_ != "" {
  93425. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  93426. }
  93427. var body io.Reader = nil
  93428. c.urlParams_.Set("alt", alt)
  93429. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/targetPools/{targetPool}")
  93430. urls += "?" + c.urlParams_.Encode()
  93431. req, _ := http.NewRequest("GET", urls, body)
  93432. req.Header = reqHeaders
  93433. googleapi.Expand(req.URL, map[string]string{
  93434. "project": c.project,
  93435. "region": c.region,
  93436. "targetPool": c.targetPool,
  93437. })
  93438. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  93439. }
  93440. // Do executes the "compute.targetPools.get" call.
  93441. // Exactly one of *TargetPool or error will be non-nil. Any non-2xx
  93442. // status code is an error. Response headers are in either
  93443. // *TargetPool.ServerResponse.Header or (if a response was returned at
  93444. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  93445. // to check whether the returned error was because
  93446. // http.StatusNotModified was returned.
  93447. func (c *TargetPoolsGetCall) Do(opts ...googleapi.CallOption) (*TargetPool, error) {
  93448. gensupport.SetOptions(c.urlParams_, opts...)
  93449. res, err := c.doRequest("json")
  93450. if res != nil && res.StatusCode == http.StatusNotModified {
  93451. if res.Body != nil {
  93452. res.Body.Close()
  93453. }
  93454. return nil, &googleapi.Error{
  93455. Code: res.StatusCode,
  93456. Header: res.Header,
  93457. }
  93458. }
  93459. if err != nil {
  93460. return nil, err
  93461. }
  93462. defer googleapi.CloseBody(res)
  93463. if err := googleapi.CheckResponse(res); err != nil {
  93464. return nil, err
  93465. }
  93466. ret := &TargetPool{
  93467. ServerResponse: googleapi.ServerResponse{
  93468. Header: res.Header,
  93469. HTTPStatusCode: res.StatusCode,
  93470. },
  93471. }
  93472. target := &ret
  93473. if err := gensupport.DecodeResponse(target, res); err != nil {
  93474. return nil, err
  93475. }
  93476. return ret, nil
  93477. // {
  93478. // "description": "Returns the specified target pool. Gets a list of available target pools by making a list() request.",
  93479. // "httpMethod": "GET",
  93480. // "id": "compute.targetPools.get",
  93481. // "parameterOrder": [
  93482. // "project",
  93483. // "region",
  93484. // "targetPool"
  93485. // ],
  93486. // "parameters": {
  93487. // "project": {
  93488. // "description": "Project ID for this request.",
  93489. // "location": "path",
  93490. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  93491. // "required": true,
  93492. // "type": "string"
  93493. // },
  93494. // "region": {
  93495. // "description": "Name of the region scoping this request.",
  93496. // "location": "path",
  93497. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  93498. // "required": true,
  93499. // "type": "string"
  93500. // },
  93501. // "targetPool": {
  93502. // "description": "Name of the TargetPool resource to return.",
  93503. // "location": "path",
  93504. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  93505. // "required": true,
  93506. // "type": "string"
  93507. // }
  93508. // },
  93509. // "path": "{project}/regions/{region}/targetPools/{targetPool}",
  93510. // "response": {
  93511. // "$ref": "TargetPool"
  93512. // },
  93513. // "scopes": [
  93514. // "https://www.googleapis.com/auth/cloud-platform",
  93515. // "https://www.googleapis.com/auth/compute",
  93516. // "https://www.googleapis.com/auth/compute.readonly"
  93517. // ]
  93518. // }
  93519. }
  93520. // method id "compute.targetPools.getHealth":
  93521. type TargetPoolsGetHealthCall struct {
  93522. s *Service
  93523. project string
  93524. region string
  93525. targetPool string
  93526. instancereference *InstanceReference
  93527. urlParams_ gensupport.URLParams
  93528. ctx_ context.Context
  93529. header_ http.Header
  93530. }
  93531. // GetHealth: Gets the most recent health check results for each IP for
  93532. // the instance that is referenced by the given target pool.
  93533. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetPools/getHealth
  93534. func (r *TargetPoolsService) GetHealth(project string, region string, targetPool string, instancereference *InstanceReference) *TargetPoolsGetHealthCall {
  93535. c := &TargetPoolsGetHealthCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  93536. c.project = project
  93537. c.region = region
  93538. c.targetPool = targetPool
  93539. c.instancereference = instancereference
  93540. return c
  93541. }
  93542. // Fields allows partial responses to be retrieved. See
  93543. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  93544. // for more information.
  93545. func (c *TargetPoolsGetHealthCall) Fields(s ...googleapi.Field) *TargetPoolsGetHealthCall {
  93546. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  93547. return c
  93548. }
  93549. // Context sets the context to be used in this call's Do method. Any
  93550. // pending HTTP request will be aborted if the provided context is
  93551. // canceled.
  93552. func (c *TargetPoolsGetHealthCall) Context(ctx context.Context) *TargetPoolsGetHealthCall {
  93553. c.ctx_ = ctx
  93554. return c
  93555. }
  93556. // Header returns an http.Header that can be modified by the caller to
  93557. // add HTTP headers to the request.
  93558. func (c *TargetPoolsGetHealthCall) Header() http.Header {
  93559. if c.header_ == nil {
  93560. c.header_ = make(http.Header)
  93561. }
  93562. return c.header_
  93563. }
  93564. func (c *TargetPoolsGetHealthCall) doRequest(alt string) (*http.Response, error) {
  93565. reqHeaders := make(http.Header)
  93566. for k, v := range c.header_ {
  93567. reqHeaders[k] = v
  93568. }
  93569. reqHeaders.Set("User-Agent", c.s.userAgent())
  93570. var body io.Reader = nil
  93571. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancereference)
  93572. if err != nil {
  93573. return nil, err
  93574. }
  93575. reqHeaders.Set("Content-Type", "application/json")
  93576. c.urlParams_.Set("alt", alt)
  93577. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/targetPools/{targetPool}/getHealth")
  93578. urls += "?" + c.urlParams_.Encode()
  93579. req, _ := http.NewRequest("POST", urls, body)
  93580. req.Header = reqHeaders
  93581. googleapi.Expand(req.URL, map[string]string{
  93582. "project": c.project,
  93583. "region": c.region,
  93584. "targetPool": c.targetPool,
  93585. })
  93586. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  93587. }
  93588. // Do executes the "compute.targetPools.getHealth" call.
  93589. // Exactly one of *TargetPoolInstanceHealth or error will be non-nil.
  93590. // Any non-2xx status code is an error. Response headers are in either
  93591. // *TargetPoolInstanceHealth.ServerResponse.Header or (if a response was
  93592. // returned at all) in error.(*googleapi.Error).Header. Use
  93593. // googleapi.IsNotModified to check whether the returned error was
  93594. // because http.StatusNotModified was returned.
  93595. func (c *TargetPoolsGetHealthCall) Do(opts ...googleapi.CallOption) (*TargetPoolInstanceHealth, error) {
  93596. gensupport.SetOptions(c.urlParams_, opts...)
  93597. res, err := c.doRequest("json")
  93598. if res != nil && res.StatusCode == http.StatusNotModified {
  93599. if res.Body != nil {
  93600. res.Body.Close()
  93601. }
  93602. return nil, &googleapi.Error{
  93603. Code: res.StatusCode,
  93604. Header: res.Header,
  93605. }
  93606. }
  93607. if err != nil {
  93608. return nil, err
  93609. }
  93610. defer googleapi.CloseBody(res)
  93611. if err := googleapi.CheckResponse(res); err != nil {
  93612. return nil, err
  93613. }
  93614. ret := &TargetPoolInstanceHealth{
  93615. ServerResponse: googleapi.ServerResponse{
  93616. Header: res.Header,
  93617. HTTPStatusCode: res.StatusCode,
  93618. },
  93619. }
  93620. target := &ret
  93621. if err := gensupport.DecodeResponse(target, res); err != nil {
  93622. return nil, err
  93623. }
  93624. return ret, nil
  93625. // {
  93626. // "description": "Gets the most recent health check results for each IP for the instance that is referenced by the given target pool.",
  93627. // "httpMethod": "POST",
  93628. // "id": "compute.targetPools.getHealth",
  93629. // "parameterOrder": [
  93630. // "project",
  93631. // "region",
  93632. // "targetPool"
  93633. // ],
  93634. // "parameters": {
  93635. // "project": {
  93636. // "description": "Project ID for this request.",
  93637. // "location": "path",
  93638. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  93639. // "required": true,
  93640. // "type": "string"
  93641. // },
  93642. // "region": {
  93643. // "description": "Name of the region scoping this request.",
  93644. // "location": "path",
  93645. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  93646. // "required": true,
  93647. // "type": "string"
  93648. // },
  93649. // "targetPool": {
  93650. // "description": "Name of the TargetPool resource to which the queried instance belongs.",
  93651. // "location": "path",
  93652. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  93653. // "required": true,
  93654. // "type": "string"
  93655. // }
  93656. // },
  93657. // "path": "{project}/regions/{region}/targetPools/{targetPool}/getHealth",
  93658. // "request": {
  93659. // "$ref": "InstanceReference"
  93660. // },
  93661. // "response": {
  93662. // "$ref": "TargetPoolInstanceHealth"
  93663. // },
  93664. // "scopes": [
  93665. // "https://www.googleapis.com/auth/cloud-platform",
  93666. // "https://www.googleapis.com/auth/compute",
  93667. // "https://www.googleapis.com/auth/compute.readonly"
  93668. // ]
  93669. // }
  93670. }
  93671. // method id "compute.targetPools.insert":
  93672. type TargetPoolsInsertCall struct {
  93673. s *Service
  93674. project string
  93675. region string
  93676. targetpool *TargetPool
  93677. urlParams_ gensupport.URLParams
  93678. ctx_ context.Context
  93679. header_ http.Header
  93680. }
  93681. // Insert: Creates a target pool in the specified project and region
  93682. // using the data included in the request.
  93683. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetPools/insert
  93684. func (r *TargetPoolsService) Insert(project string, region string, targetpool *TargetPool) *TargetPoolsInsertCall {
  93685. c := &TargetPoolsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  93686. c.project = project
  93687. c.region = region
  93688. c.targetpool = targetpool
  93689. return c
  93690. }
  93691. // RequestId sets the optional parameter "requestId": An optional
  93692. // request ID to identify requests. Specify a unique request ID so that
  93693. // if you must retry your request, the server will know to ignore the
  93694. // request if it has already been completed.
  93695. //
  93696. // For example, consider a situation where you make an initial request
  93697. // and the request times out. If you make the request again with the
  93698. // same request ID, the server can check if original operation with the
  93699. // same request ID was received, and if so, will ignore the second
  93700. // request. This prevents clients from accidentally creating duplicate
  93701. // commitments.
  93702. //
  93703. // The request ID must be a valid UUID with the exception that zero UUID
  93704. // is not supported (00000000-0000-0000-0000-000000000000).
  93705. func (c *TargetPoolsInsertCall) RequestId(requestId string) *TargetPoolsInsertCall {
  93706. c.urlParams_.Set("requestId", requestId)
  93707. return c
  93708. }
  93709. // Fields allows partial responses to be retrieved. See
  93710. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  93711. // for more information.
  93712. func (c *TargetPoolsInsertCall) Fields(s ...googleapi.Field) *TargetPoolsInsertCall {
  93713. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  93714. return c
  93715. }
  93716. // Context sets the context to be used in this call's Do method. Any
  93717. // pending HTTP request will be aborted if the provided context is
  93718. // canceled.
  93719. func (c *TargetPoolsInsertCall) Context(ctx context.Context) *TargetPoolsInsertCall {
  93720. c.ctx_ = ctx
  93721. return c
  93722. }
  93723. // Header returns an http.Header that can be modified by the caller to
  93724. // add HTTP headers to the request.
  93725. func (c *TargetPoolsInsertCall) Header() http.Header {
  93726. if c.header_ == nil {
  93727. c.header_ = make(http.Header)
  93728. }
  93729. return c.header_
  93730. }
  93731. func (c *TargetPoolsInsertCall) doRequest(alt string) (*http.Response, error) {
  93732. reqHeaders := make(http.Header)
  93733. for k, v := range c.header_ {
  93734. reqHeaders[k] = v
  93735. }
  93736. reqHeaders.Set("User-Agent", c.s.userAgent())
  93737. var body io.Reader = nil
  93738. body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetpool)
  93739. if err != nil {
  93740. return nil, err
  93741. }
  93742. reqHeaders.Set("Content-Type", "application/json")
  93743. c.urlParams_.Set("alt", alt)
  93744. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/targetPools")
  93745. urls += "?" + c.urlParams_.Encode()
  93746. req, _ := http.NewRequest("POST", urls, body)
  93747. req.Header = reqHeaders
  93748. googleapi.Expand(req.URL, map[string]string{
  93749. "project": c.project,
  93750. "region": c.region,
  93751. })
  93752. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  93753. }
  93754. // Do executes the "compute.targetPools.insert" call.
  93755. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  93756. // status code is an error. Response headers are in either
  93757. // *Operation.ServerResponse.Header or (if a response was returned at
  93758. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  93759. // to check whether the returned error was because
  93760. // http.StatusNotModified was returned.
  93761. func (c *TargetPoolsInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  93762. gensupport.SetOptions(c.urlParams_, opts...)
  93763. res, err := c.doRequest("json")
  93764. if res != nil && res.StatusCode == http.StatusNotModified {
  93765. if res.Body != nil {
  93766. res.Body.Close()
  93767. }
  93768. return nil, &googleapi.Error{
  93769. Code: res.StatusCode,
  93770. Header: res.Header,
  93771. }
  93772. }
  93773. if err != nil {
  93774. return nil, err
  93775. }
  93776. defer googleapi.CloseBody(res)
  93777. if err := googleapi.CheckResponse(res); err != nil {
  93778. return nil, err
  93779. }
  93780. ret := &Operation{
  93781. ServerResponse: googleapi.ServerResponse{
  93782. Header: res.Header,
  93783. HTTPStatusCode: res.StatusCode,
  93784. },
  93785. }
  93786. target := &ret
  93787. if err := gensupport.DecodeResponse(target, res); err != nil {
  93788. return nil, err
  93789. }
  93790. return ret, nil
  93791. // {
  93792. // "description": "Creates a target pool in the specified project and region using the data included in the request.",
  93793. // "httpMethod": "POST",
  93794. // "id": "compute.targetPools.insert",
  93795. // "parameterOrder": [
  93796. // "project",
  93797. // "region"
  93798. // ],
  93799. // "parameters": {
  93800. // "project": {
  93801. // "description": "Project ID for this request.",
  93802. // "location": "path",
  93803. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  93804. // "required": true,
  93805. // "type": "string"
  93806. // },
  93807. // "region": {
  93808. // "description": "Name of the region scoping this request.",
  93809. // "location": "path",
  93810. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  93811. // "required": true,
  93812. // "type": "string"
  93813. // },
  93814. // "requestId": {
  93815. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  93816. // "location": "query",
  93817. // "type": "string"
  93818. // }
  93819. // },
  93820. // "path": "{project}/regions/{region}/targetPools",
  93821. // "request": {
  93822. // "$ref": "TargetPool"
  93823. // },
  93824. // "response": {
  93825. // "$ref": "Operation"
  93826. // },
  93827. // "scopes": [
  93828. // "https://www.googleapis.com/auth/cloud-platform",
  93829. // "https://www.googleapis.com/auth/compute"
  93830. // ]
  93831. // }
  93832. }
  93833. // method id "compute.targetPools.list":
  93834. type TargetPoolsListCall struct {
  93835. s *Service
  93836. project string
  93837. region string
  93838. urlParams_ gensupport.URLParams
  93839. ifNoneMatch_ string
  93840. ctx_ context.Context
  93841. header_ http.Header
  93842. }
  93843. // List: Retrieves a list of target pools available to the specified
  93844. // project and region.
  93845. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetPools/list
  93846. func (r *TargetPoolsService) List(project string, region string) *TargetPoolsListCall {
  93847. c := &TargetPoolsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  93848. c.project = project
  93849. c.region = region
  93850. return c
  93851. }
  93852. // Filter sets the optional parameter "filter": A filter expression that
  93853. // filters resources listed in the response. The expression must specify
  93854. // the field name, a comparison operator, and the value that you want to
  93855. // use for filtering. The value must be a string, a number, or a
  93856. // boolean. The comparison operator must be either =, !=, >, or <.
  93857. //
  93858. // For example, if you are filtering Compute Engine instances, you can
  93859. // exclude instances named example-instance by specifying name !=
  93860. // example-instance.
  93861. //
  93862. // You can also filter nested fields. For example, you could specify
  93863. // scheduling.automaticRestart = false to include instances only if they
  93864. // are not scheduled for automatic restarts. You can use filtering on
  93865. // nested fields to filter based on resource labels.
  93866. //
  93867. // To filter on multiple expressions, provide each separate expression
  93868. // within parentheses. For example, (scheduling.automaticRestart = true)
  93869. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  93870. // AND expression. However, you can include AND and OR expressions
  93871. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  93872. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  93873. // true).
  93874. func (c *TargetPoolsListCall) Filter(filter string) *TargetPoolsListCall {
  93875. c.urlParams_.Set("filter", filter)
  93876. return c
  93877. }
  93878. // MaxResults sets the optional parameter "maxResults": The maximum
  93879. // number of results per page that should be returned. If the number of
  93880. // available results is larger than maxResults, Compute Engine returns a
  93881. // nextPageToken that can be used to get the next page of results in
  93882. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  93883. // (Default: 500)
  93884. func (c *TargetPoolsListCall) MaxResults(maxResults int64) *TargetPoolsListCall {
  93885. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  93886. return c
  93887. }
  93888. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  93889. // a certain order. By default, results are returned in alphanumerical
  93890. // order based on the resource name.
  93891. //
  93892. // You can also sort results in descending order based on the creation
  93893. // timestamp using orderBy="creationTimestamp desc". This sorts results
  93894. // based on the creationTimestamp field in reverse chronological order
  93895. // (newest result first). Use this to sort resources like operations so
  93896. // that the newest operation is returned first.
  93897. //
  93898. // Currently, only sorting by name or creationTimestamp desc is
  93899. // supported.
  93900. func (c *TargetPoolsListCall) OrderBy(orderBy string) *TargetPoolsListCall {
  93901. c.urlParams_.Set("orderBy", orderBy)
  93902. return c
  93903. }
  93904. // PageToken sets the optional parameter "pageToken": Specifies a page
  93905. // token to use. Set pageToken to the nextPageToken returned by a
  93906. // previous list request to get the next page of results.
  93907. func (c *TargetPoolsListCall) PageToken(pageToken string) *TargetPoolsListCall {
  93908. c.urlParams_.Set("pageToken", pageToken)
  93909. return c
  93910. }
  93911. // Fields allows partial responses to be retrieved. See
  93912. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  93913. // for more information.
  93914. func (c *TargetPoolsListCall) Fields(s ...googleapi.Field) *TargetPoolsListCall {
  93915. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  93916. return c
  93917. }
  93918. // IfNoneMatch sets the optional parameter which makes the operation
  93919. // fail if the object's ETag matches the given value. This is useful for
  93920. // getting updates only after the object has changed since the last
  93921. // request. Use googleapi.IsNotModified to check whether the response
  93922. // error from Do is the result of In-None-Match.
  93923. func (c *TargetPoolsListCall) IfNoneMatch(entityTag string) *TargetPoolsListCall {
  93924. c.ifNoneMatch_ = entityTag
  93925. return c
  93926. }
  93927. // Context sets the context to be used in this call's Do method. Any
  93928. // pending HTTP request will be aborted if the provided context is
  93929. // canceled.
  93930. func (c *TargetPoolsListCall) Context(ctx context.Context) *TargetPoolsListCall {
  93931. c.ctx_ = ctx
  93932. return c
  93933. }
  93934. // Header returns an http.Header that can be modified by the caller to
  93935. // add HTTP headers to the request.
  93936. func (c *TargetPoolsListCall) Header() http.Header {
  93937. if c.header_ == nil {
  93938. c.header_ = make(http.Header)
  93939. }
  93940. return c.header_
  93941. }
  93942. func (c *TargetPoolsListCall) doRequest(alt string) (*http.Response, error) {
  93943. reqHeaders := make(http.Header)
  93944. for k, v := range c.header_ {
  93945. reqHeaders[k] = v
  93946. }
  93947. reqHeaders.Set("User-Agent", c.s.userAgent())
  93948. if c.ifNoneMatch_ != "" {
  93949. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  93950. }
  93951. var body io.Reader = nil
  93952. c.urlParams_.Set("alt", alt)
  93953. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/targetPools")
  93954. urls += "?" + c.urlParams_.Encode()
  93955. req, _ := http.NewRequest("GET", urls, body)
  93956. req.Header = reqHeaders
  93957. googleapi.Expand(req.URL, map[string]string{
  93958. "project": c.project,
  93959. "region": c.region,
  93960. })
  93961. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  93962. }
  93963. // Do executes the "compute.targetPools.list" call.
  93964. // Exactly one of *TargetPoolList or error will be non-nil. Any non-2xx
  93965. // status code is an error. Response headers are in either
  93966. // *TargetPoolList.ServerResponse.Header or (if a response was returned
  93967. // at all) in error.(*googleapi.Error).Header. Use
  93968. // googleapi.IsNotModified to check whether the returned error was
  93969. // because http.StatusNotModified was returned.
  93970. func (c *TargetPoolsListCall) Do(opts ...googleapi.CallOption) (*TargetPoolList, error) {
  93971. gensupport.SetOptions(c.urlParams_, opts...)
  93972. res, err := c.doRequest("json")
  93973. if res != nil && res.StatusCode == http.StatusNotModified {
  93974. if res.Body != nil {
  93975. res.Body.Close()
  93976. }
  93977. return nil, &googleapi.Error{
  93978. Code: res.StatusCode,
  93979. Header: res.Header,
  93980. }
  93981. }
  93982. if err != nil {
  93983. return nil, err
  93984. }
  93985. defer googleapi.CloseBody(res)
  93986. if err := googleapi.CheckResponse(res); err != nil {
  93987. return nil, err
  93988. }
  93989. ret := &TargetPoolList{
  93990. ServerResponse: googleapi.ServerResponse{
  93991. Header: res.Header,
  93992. HTTPStatusCode: res.StatusCode,
  93993. },
  93994. }
  93995. target := &ret
  93996. if err := gensupport.DecodeResponse(target, res); err != nil {
  93997. return nil, err
  93998. }
  93999. return ret, nil
  94000. // {
  94001. // "description": "Retrieves a list of target pools available to the specified project and region.",
  94002. // "httpMethod": "GET",
  94003. // "id": "compute.targetPools.list",
  94004. // "parameterOrder": [
  94005. // "project",
  94006. // "region"
  94007. // ],
  94008. // "parameters": {
  94009. // "filter": {
  94010. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  94011. // "location": "query",
  94012. // "type": "string"
  94013. // },
  94014. // "maxResults": {
  94015. // "default": "500",
  94016. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  94017. // "format": "uint32",
  94018. // "location": "query",
  94019. // "minimum": "0",
  94020. // "type": "integer"
  94021. // },
  94022. // "orderBy": {
  94023. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  94024. // "location": "query",
  94025. // "type": "string"
  94026. // },
  94027. // "pageToken": {
  94028. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  94029. // "location": "query",
  94030. // "type": "string"
  94031. // },
  94032. // "project": {
  94033. // "description": "Project ID for this request.",
  94034. // "location": "path",
  94035. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  94036. // "required": true,
  94037. // "type": "string"
  94038. // },
  94039. // "region": {
  94040. // "description": "Name of the region scoping this request.",
  94041. // "location": "path",
  94042. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  94043. // "required": true,
  94044. // "type": "string"
  94045. // }
  94046. // },
  94047. // "path": "{project}/regions/{region}/targetPools",
  94048. // "response": {
  94049. // "$ref": "TargetPoolList"
  94050. // },
  94051. // "scopes": [
  94052. // "https://www.googleapis.com/auth/cloud-platform",
  94053. // "https://www.googleapis.com/auth/compute",
  94054. // "https://www.googleapis.com/auth/compute.readonly"
  94055. // ]
  94056. // }
  94057. }
  94058. // Pages invokes f for each page of results.
  94059. // A non-nil error returned from f will halt the iteration.
  94060. // The provided context supersedes any context provided to the Context method.
  94061. func (c *TargetPoolsListCall) Pages(ctx context.Context, f func(*TargetPoolList) error) error {
  94062. c.ctx_ = ctx
  94063. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  94064. for {
  94065. x, err := c.Do()
  94066. if err != nil {
  94067. return err
  94068. }
  94069. if err := f(x); err != nil {
  94070. return err
  94071. }
  94072. if x.NextPageToken == "" {
  94073. return nil
  94074. }
  94075. c.PageToken(x.NextPageToken)
  94076. }
  94077. }
  94078. // method id "compute.targetPools.removeHealthCheck":
  94079. type TargetPoolsRemoveHealthCheckCall struct {
  94080. s *Service
  94081. project string
  94082. region string
  94083. targetPool string
  94084. targetpoolsremovehealthcheckrequest *TargetPoolsRemoveHealthCheckRequest
  94085. urlParams_ gensupport.URLParams
  94086. ctx_ context.Context
  94087. header_ http.Header
  94088. }
  94089. // RemoveHealthCheck: Removes health check URL from a target pool.
  94090. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetPools/removeHealthCheck
  94091. func (r *TargetPoolsService) RemoveHealthCheck(project string, region string, targetPool string, targetpoolsremovehealthcheckrequest *TargetPoolsRemoveHealthCheckRequest) *TargetPoolsRemoveHealthCheckCall {
  94092. c := &TargetPoolsRemoveHealthCheckCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  94093. c.project = project
  94094. c.region = region
  94095. c.targetPool = targetPool
  94096. c.targetpoolsremovehealthcheckrequest = targetpoolsremovehealthcheckrequest
  94097. return c
  94098. }
  94099. // RequestId sets the optional parameter "requestId": An optional
  94100. // request ID to identify requests. Specify a unique request ID so that
  94101. // if you must retry your request, the server will know to ignore the
  94102. // request if it has already been completed.
  94103. //
  94104. // For example, consider a situation where you make an initial request
  94105. // and the request times out. If you make the request again with the
  94106. // same request ID, the server can check if original operation with the
  94107. // same request ID was received, and if so, will ignore the second
  94108. // request. This prevents clients from accidentally creating duplicate
  94109. // commitments.
  94110. //
  94111. // The request ID must be a valid UUID with the exception that zero UUID
  94112. // is not supported (00000000-0000-0000-0000-000000000000).
  94113. func (c *TargetPoolsRemoveHealthCheckCall) RequestId(requestId string) *TargetPoolsRemoveHealthCheckCall {
  94114. c.urlParams_.Set("requestId", requestId)
  94115. return c
  94116. }
  94117. // Fields allows partial responses to be retrieved. See
  94118. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  94119. // for more information.
  94120. func (c *TargetPoolsRemoveHealthCheckCall) Fields(s ...googleapi.Field) *TargetPoolsRemoveHealthCheckCall {
  94121. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  94122. return c
  94123. }
  94124. // Context sets the context to be used in this call's Do method. Any
  94125. // pending HTTP request will be aborted if the provided context is
  94126. // canceled.
  94127. func (c *TargetPoolsRemoveHealthCheckCall) Context(ctx context.Context) *TargetPoolsRemoveHealthCheckCall {
  94128. c.ctx_ = ctx
  94129. return c
  94130. }
  94131. // Header returns an http.Header that can be modified by the caller to
  94132. // add HTTP headers to the request.
  94133. func (c *TargetPoolsRemoveHealthCheckCall) Header() http.Header {
  94134. if c.header_ == nil {
  94135. c.header_ = make(http.Header)
  94136. }
  94137. return c.header_
  94138. }
  94139. func (c *TargetPoolsRemoveHealthCheckCall) doRequest(alt string) (*http.Response, error) {
  94140. reqHeaders := make(http.Header)
  94141. for k, v := range c.header_ {
  94142. reqHeaders[k] = v
  94143. }
  94144. reqHeaders.Set("User-Agent", c.s.userAgent())
  94145. var body io.Reader = nil
  94146. body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetpoolsremovehealthcheckrequest)
  94147. if err != nil {
  94148. return nil, err
  94149. }
  94150. reqHeaders.Set("Content-Type", "application/json")
  94151. c.urlParams_.Set("alt", alt)
  94152. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/targetPools/{targetPool}/removeHealthCheck")
  94153. urls += "?" + c.urlParams_.Encode()
  94154. req, _ := http.NewRequest("POST", urls, body)
  94155. req.Header = reqHeaders
  94156. googleapi.Expand(req.URL, map[string]string{
  94157. "project": c.project,
  94158. "region": c.region,
  94159. "targetPool": c.targetPool,
  94160. })
  94161. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  94162. }
  94163. // Do executes the "compute.targetPools.removeHealthCheck" call.
  94164. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  94165. // status code is an error. Response headers are in either
  94166. // *Operation.ServerResponse.Header or (if a response was returned at
  94167. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  94168. // to check whether the returned error was because
  94169. // http.StatusNotModified was returned.
  94170. func (c *TargetPoolsRemoveHealthCheckCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  94171. gensupport.SetOptions(c.urlParams_, opts...)
  94172. res, err := c.doRequest("json")
  94173. if res != nil && res.StatusCode == http.StatusNotModified {
  94174. if res.Body != nil {
  94175. res.Body.Close()
  94176. }
  94177. return nil, &googleapi.Error{
  94178. Code: res.StatusCode,
  94179. Header: res.Header,
  94180. }
  94181. }
  94182. if err != nil {
  94183. return nil, err
  94184. }
  94185. defer googleapi.CloseBody(res)
  94186. if err := googleapi.CheckResponse(res); err != nil {
  94187. return nil, err
  94188. }
  94189. ret := &Operation{
  94190. ServerResponse: googleapi.ServerResponse{
  94191. Header: res.Header,
  94192. HTTPStatusCode: res.StatusCode,
  94193. },
  94194. }
  94195. target := &ret
  94196. if err := gensupport.DecodeResponse(target, res); err != nil {
  94197. return nil, err
  94198. }
  94199. return ret, nil
  94200. // {
  94201. // "description": "Removes health check URL from a target pool.",
  94202. // "httpMethod": "POST",
  94203. // "id": "compute.targetPools.removeHealthCheck",
  94204. // "parameterOrder": [
  94205. // "project",
  94206. // "region",
  94207. // "targetPool"
  94208. // ],
  94209. // "parameters": {
  94210. // "project": {
  94211. // "description": "Project ID for this request.",
  94212. // "location": "path",
  94213. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  94214. // "required": true,
  94215. // "type": "string"
  94216. // },
  94217. // "region": {
  94218. // "description": "Name of the region for this request.",
  94219. // "location": "path",
  94220. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  94221. // "required": true,
  94222. // "type": "string"
  94223. // },
  94224. // "requestId": {
  94225. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  94226. // "location": "query",
  94227. // "type": "string"
  94228. // },
  94229. // "targetPool": {
  94230. // "description": "Name of the target pool to remove health checks from.",
  94231. // "location": "path",
  94232. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  94233. // "required": true,
  94234. // "type": "string"
  94235. // }
  94236. // },
  94237. // "path": "{project}/regions/{region}/targetPools/{targetPool}/removeHealthCheck",
  94238. // "request": {
  94239. // "$ref": "TargetPoolsRemoveHealthCheckRequest"
  94240. // },
  94241. // "response": {
  94242. // "$ref": "Operation"
  94243. // },
  94244. // "scopes": [
  94245. // "https://www.googleapis.com/auth/cloud-platform",
  94246. // "https://www.googleapis.com/auth/compute"
  94247. // ]
  94248. // }
  94249. }
  94250. // method id "compute.targetPools.removeInstance":
  94251. type TargetPoolsRemoveInstanceCall struct {
  94252. s *Service
  94253. project string
  94254. region string
  94255. targetPool string
  94256. targetpoolsremoveinstancerequest *TargetPoolsRemoveInstanceRequest
  94257. urlParams_ gensupport.URLParams
  94258. ctx_ context.Context
  94259. header_ http.Header
  94260. }
  94261. // RemoveInstance: Removes instance URL from a target pool.
  94262. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetPools/removeInstance
  94263. func (r *TargetPoolsService) RemoveInstance(project string, region string, targetPool string, targetpoolsremoveinstancerequest *TargetPoolsRemoveInstanceRequest) *TargetPoolsRemoveInstanceCall {
  94264. c := &TargetPoolsRemoveInstanceCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  94265. c.project = project
  94266. c.region = region
  94267. c.targetPool = targetPool
  94268. c.targetpoolsremoveinstancerequest = targetpoolsremoveinstancerequest
  94269. return c
  94270. }
  94271. // RequestId sets the optional parameter "requestId": An optional
  94272. // request ID to identify requests. Specify a unique request ID so that
  94273. // if you must retry your request, the server will know to ignore the
  94274. // request if it has already been completed.
  94275. //
  94276. // For example, consider a situation where you make an initial request
  94277. // and the request times out. If you make the request again with the
  94278. // same request ID, the server can check if original operation with the
  94279. // same request ID was received, and if so, will ignore the second
  94280. // request. This prevents clients from accidentally creating duplicate
  94281. // commitments.
  94282. //
  94283. // The request ID must be a valid UUID with the exception that zero UUID
  94284. // is not supported (00000000-0000-0000-0000-000000000000).
  94285. func (c *TargetPoolsRemoveInstanceCall) RequestId(requestId string) *TargetPoolsRemoveInstanceCall {
  94286. c.urlParams_.Set("requestId", requestId)
  94287. return c
  94288. }
  94289. // Fields allows partial responses to be retrieved. See
  94290. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  94291. // for more information.
  94292. func (c *TargetPoolsRemoveInstanceCall) Fields(s ...googleapi.Field) *TargetPoolsRemoveInstanceCall {
  94293. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  94294. return c
  94295. }
  94296. // Context sets the context to be used in this call's Do method. Any
  94297. // pending HTTP request will be aborted if the provided context is
  94298. // canceled.
  94299. func (c *TargetPoolsRemoveInstanceCall) Context(ctx context.Context) *TargetPoolsRemoveInstanceCall {
  94300. c.ctx_ = ctx
  94301. return c
  94302. }
  94303. // Header returns an http.Header that can be modified by the caller to
  94304. // add HTTP headers to the request.
  94305. func (c *TargetPoolsRemoveInstanceCall) Header() http.Header {
  94306. if c.header_ == nil {
  94307. c.header_ = make(http.Header)
  94308. }
  94309. return c.header_
  94310. }
  94311. func (c *TargetPoolsRemoveInstanceCall) doRequest(alt string) (*http.Response, error) {
  94312. reqHeaders := make(http.Header)
  94313. for k, v := range c.header_ {
  94314. reqHeaders[k] = v
  94315. }
  94316. reqHeaders.Set("User-Agent", c.s.userAgent())
  94317. var body io.Reader = nil
  94318. body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetpoolsremoveinstancerequest)
  94319. if err != nil {
  94320. return nil, err
  94321. }
  94322. reqHeaders.Set("Content-Type", "application/json")
  94323. c.urlParams_.Set("alt", alt)
  94324. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/targetPools/{targetPool}/removeInstance")
  94325. urls += "?" + c.urlParams_.Encode()
  94326. req, _ := http.NewRequest("POST", urls, body)
  94327. req.Header = reqHeaders
  94328. googleapi.Expand(req.URL, map[string]string{
  94329. "project": c.project,
  94330. "region": c.region,
  94331. "targetPool": c.targetPool,
  94332. })
  94333. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  94334. }
  94335. // Do executes the "compute.targetPools.removeInstance" call.
  94336. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  94337. // status code is an error. Response headers are in either
  94338. // *Operation.ServerResponse.Header or (if a response was returned at
  94339. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  94340. // to check whether the returned error was because
  94341. // http.StatusNotModified was returned.
  94342. func (c *TargetPoolsRemoveInstanceCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  94343. gensupport.SetOptions(c.urlParams_, opts...)
  94344. res, err := c.doRequest("json")
  94345. if res != nil && res.StatusCode == http.StatusNotModified {
  94346. if res.Body != nil {
  94347. res.Body.Close()
  94348. }
  94349. return nil, &googleapi.Error{
  94350. Code: res.StatusCode,
  94351. Header: res.Header,
  94352. }
  94353. }
  94354. if err != nil {
  94355. return nil, err
  94356. }
  94357. defer googleapi.CloseBody(res)
  94358. if err := googleapi.CheckResponse(res); err != nil {
  94359. return nil, err
  94360. }
  94361. ret := &Operation{
  94362. ServerResponse: googleapi.ServerResponse{
  94363. Header: res.Header,
  94364. HTTPStatusCode: res.StatusCode,
  94365. },
  94366. }
  94367. target := &ret
  94368. if err := gensupport.DecodeResponse(target, res); err != nil {
  94369. return nil, err
  94370. }
  94371. return ret, nil
  94372. // {
  94373. // "description": "Removes instance URL from a target pool.",
  94374. // "httpMethod": "POST",
  94375. // "id": "compute.targetPools.removeInstance",
  94376. // "parameterOrder": [
  94377. // "project",
  94378. // "region",
  94379. // "targetPool"
  94380. // ],
  94381. // "parameters": {
  94382. // "project": {
  94383. // "description": "Project ID for this request.",
  94384. // "location": "path",
  94385. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  94386. // "required": true,
  94387. // "type": "string"
  94388. // },
  94389. // "region": {
  94390. // "description": "Name of the region scoping this request.",
  94391. // "location": "path",
  94392. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  94393. // "required": true,
  94394. // "type": "string"
  94395. // },
  94396. // "requestId": {
  94397. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  94398. // "location": "query",
  94399. // "type": "string"
  94400. // },
  94401. // "targetPool": {
  94402. // "description": "Name of the TargetPool resource to remove instances from.",
  94403. // "location": "path",
  94404. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  94405. // "required": true,
  94406. // "type": "string"
  94407. // }
  94408. // },
  94409. // "path": "{project}/regions/{region}/targetPools/{targetPool}/removeInstance",
  94410. // "request": {
  94411. // "$ref": "TargetPoolsRemoveInstanceRequest"
  94412. // },
  94413. // "response": {
  94414. // "$ref": "Operation"
  94415. // },
  94416. // "scopes": [
  94417. // "https://www.googleapis.com/auth/cloud-platform",
  94418. // "https://www.googleapis.com/auth/compute"
  94419. // ]
  94420. // }
  94421. }
  94422. // method id "compute.targetPools.setBackup":
  94423. type TargetPoolsSetBackupCall struct {
  94424. s *Service
  94425. project string
  94426. region string
  94427. targetPool string
  94428. targetreference *TargetReference
  94429. urlParams_ gensupport.URLParams
  94430. ctx_ context.Context
  94431. header_ http.Header
  94432. }
  94433. // SetBackup: Changes a backup target pool's configurations.
  94434. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetPools/setBackup
  94435. func (r *TargetPoolsService) SetBackup(project string, region string, targetPool string, targetreference *TargetReference) *TargetPoolsSetBackupCall {
  94436. c := &TargetPoolsSetBackupCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  94437. c.project = project
  94438. c.region = region
  94439. c.targetPool = targetPool
  94440. c.targetreference = targetreference
  94441. return c
  94442. }
  94443. // FailoverRatio sets the optional parameter "failoverRatio": New
  94444. // failoverRatio value for the target pool.
  94445. func (c *TargetPoolsSetBackupCall) FailoverRatio(failoverRatio float64) *TargetPoolsSetBackupCall {
  94446. c.urlParams_.Set("failoverRatio", fmt.Sprint(failoverRatio))
  94447. return c
  94448. }
  94449. // RequestId sets the optional parameter "requestId": An optional
  94450. // request ID to identify requests. Specify a unique request ID so that
  94451. // if you must retry your request, the server will know to ignore the
  94452. // request if it has already been completed.
  94453. //
  94454. // For example, consider a situation where you make an initial request
  94455. // and the request times out. If you make the request again with the
  94456. // same request ID, the server can check if original operation with the
  94457. // same request ID was received, and if so, will ignore the second
  94458. // request. This prevents clients from accidentally creating duplicate
  94459. // commitments.
  94460. //
  94461. // The request ID must be a valid UUID with the exception that zero UUID
  94462. // is not supported (00000000-0000-0000-0000-000000000000).
  94463. func (c *TargetPoolsSetBackupCall) RequestId(requestId string) *TargetPoolsSetBackupCall {
  94464. c.urlParams_.Set("requestId", requestId)
  94465. return c
  94466. }
  94467. // Fields allows partial responses to be retrieved. See
  94468. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  94469. // for more information.
  94470. func (c *TargetPoolsSetBackupCall) Fields(s ...googleapi.Field) *TargetPoolsSetBackupCall {
  94471. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  94472. return c
  94473. }
  94474. // Context sets the context to be used in this call's Do method. Any
  94475. // pending HTTP request will be aborted if the provided context is
  94476. // canceled.
  94477. func (c *TargetPoolsSetBackupCall) Context(ctx context.Context) *TargetPoolsSetBackupCall {
  94478. c.ctx_ = ctx
  94479. return c
  94480. }
  94481. // Header returns an http.Header that can be modified by the caller to
  94482. // add HTTP headers to the request.
  94483. func (c *TargetPoolsSetBackupCall) Header() http.Header {
  94484. if c.header_ == nil {
  94485. c.header_ = make(http.Header)
  94486. }
  94487. return c.header_
  94488. }
  94489. func (c *TargetPoolsSetBackupCall) doRequest(alt string) (*http.Response, error) {
  94490. reqHeaders := make(http.Header)
  94491. for k, v := range c.header_ {
  94492. reqHeaders[k] = v
  94493. }
  94494. reqHeaders.Set("User-Agent", c.s.userAgent())
  94495. var body io.Reader = nil
  94496. body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetreference)
  94497. if err != nil {
  94498. return nil, err
  94499. }
  94500. reqHeaders.Set("Content-Type", "application/json")
  94501. c.urlParams_.Set("alt", alt)
  94502. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/targetPools/{targetPool}/setBackup")
  94503. urls += "?" + c.urlParams_.Encode()
  94504. req, _ := http.NewRequest("POST", urls, body)
  94505. req.Header = reqHeaders
  94506. googleapi.Expand(req.URL, map[string]string{
  94507. "project": c.project,
  94508. "region": c.region,
  94509. "targetPool": c.targetPool,
  94510. })
  94511. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  94512. }
  94513. // Do executes the "compute.targetPools.setBackup" call.
  94514. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  94515. // status code is an error. Response headers are in either
  94516. // *Operation.ServerResponse.Header or (if a response was returned at
  94517. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  94518. // to check whether the returned error was because
  94519. // http.StatusNotModified was returned.
  94520. func (c *TargetPoolsSetBackupCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  94521. gensupport.SetOptions(c.urlParams_, opts...)
  94522. res, err := c.doRequest("json")
  94523. if res != nil && res.StatusCode == http.StatusNotModified {
  94524. if res.Body != nil {
  94525. res.Body.Close()
  94526. }
  94527. return nil, &googleapi.Error{
  94528. Code: res.StatusCode,
  94529. Header: res.Header,
  94530. }
  94531. }
  94532. if err != nil {
  94533. return nil, err
  94534. }
  94535. defer googleapi.CloseBody(res)
  94536. if err := googleapi.CheckResponse(res); err != nil {
  94537. return nil, err
  94538. }
  94539. ret := &Operation{
  94540. ServerResponse: googleapi.ServerResponse{
  94541. Header: res.Header,
  94542. HTTPStatusCode: res.StatusCode,
  94543. },
  94544. }
  94545. target := &ret
  94546. if err := gensupport.DecodeResponse(target, res); err != nil {
  94547. return nil, err
  94548. }
  94549. return ret, nil
  94550. // {
  94551. // "description": "Changes a backup target pool's configurations.",
  94552. // "httpMethod": "POST",
  94553. // "id": "compute.targetPools.setBackup",
  94554. // "parameterOrder": [
  94555. // "project",
  94556. // "region",
  94557. // "targetPool"
  94558. // ],
  94559. // "parameters": {
  94560. // "failoverRatio": {
  94561. // "description": "New failoverRatio value for the target pool.",
  94562. // "format": "float",
  94563. // "location": "query",
  94564. // "type": "number"
  94565. // },
  94566. // "project": {
  94567. // "description": "Project ID for this request.",
  94568. // "location": "path",
  94569. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  94570. // "required": true,
  94571. // "type": "string"
  94572. // },
  94573. // "region": {
  94574. // "description": "Name of the region scoping this request.",
  94575. // "location": "path",
  94576. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  94577. // "required": true,
  94578. // "type": "string"
  94579. // },
  94580. // "requestId": {
  94581. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  94582. // "location": "query",
  94583. // "type": "string"
  94584. // },
  94585. // "targetPool": {
  94586. // "description": "Name of the TargetPool resource to set a backup pool for.",
  94587. // "location": "path",
  94588. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  94589. // "required": true,
  94590. // "type": "string"
  94591. // }
  94592. // },
  94593. // "path": "{project}/regions/{region}/targetPools/{targetPool}/setBackup",
  94594. // "request": {
  94595. // "$ref": "TargetReference"
  94596. // },
  94597. // "response": {
  94598. // "$ref": "Operation"
  94599. // },
  94600. // "scopes": [
  94601. // "https://www.googleapis.com/auth/cloud-platform",
  94602. // "https://www.googleapis.com/auth/compute"
  94603. // ]
  94604. // }
  94605. }
  94606. // method id "compute.targetPools.testIamPermissions":
  94607. type TargetPoolsTestIamPermissionsCall struct {
  94608. s *Service
  94609. project string
  94610. region string
  94611. resource string
  94612. testpermissionsrequest *TestPermissionsRequest
  94613. urlParams_ gensupport.URLParams
  94614. ctx_ context.Context
  94615. header_ http.Header
  94616. }
  94617. // TestIamPermissions: Returns permissions that a caller has on the
  94618. // specified resource.
  94619. func (r *TargetPoolsService) TestIamPermissions(project string, region string, resource string, testpermissionsrequest *TestPermissionsRequest) *TargetPoolsTestIamPermissionsCall {
  94620. c := &TargetPoolsTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  94621. c.project = project
  94622. c.region = region
  94623. c.resource = resource
  94624. c.testpermissionsrequest = testpermissionsrequest
  94625. return c
  94626. }
  94627. // Fields allows partial responses to be retrieved. See
  94628. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  94629. // for more information.
  94630. func (c *TargetPoolsTestIamPermissionsCall) Fields(s ...googleapi.Field) *TargetPoolsTestIamPermissionsCall {
  94631. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  94632. return c
  94633. }
  94634. // Context sets the context to be used in this call's Do method. Any
  94635. // pending HTTP request will be aborted if the provided context is
  94636. // canceled.
  94637. func (c *TargetPoolsTestIamPermissionsCall) Context(ctx context.Context) *TargetPoolsTestIamPermissionsCall {
  94638. c.ctx_ = ctx
  94639. return c
  94640. }
  94641. // Header returns an http.Header that can be modified by the caller to
  94642. // add HTTP headers to the request.
  94643. func (c *TargetPoolsTestIamPermissionsCall) Header() http.Header {
  94644. if c.header_ == nil {
  94645. c.header_ = make(http.Header)
  94646. }
  94647. return c.header_
  94648. }
  94649. func (c *TargetPoolsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  94650. reqHeaders := make(http.Header)
  94651. for k, v := range c.header_ {
  94652. reqHeaders[k] = v
  94653. }
  94654. reqHeaders.Set("User-Agent", c.s.userAgent())
  94655. var body io.Reader = nil
  94656. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  94657. if err != nil {
  94658. return nil, err
  94659. }
  94660. reqHeaders.Set("Content-Type", "application/json")
  94661. c.urlParams_.Set("alt", alt)
  94662. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/targetPools/{resource}/testIamPermissions")
  94663. urls += "?" + c.urlParams_.Encode()
  94664. req, _ := http.NewRequest("POST", urls, body)
  94665. req.Header = reqHeaders
  94666. googleapi.Expand(req.URL, map[string]string{
  94667. "project": c.project,
  94668. "region": c.region,
  94669. "resource": c.resource,
  94670. })
  94671. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  94672. }
  94673. // Do executes the "compute.targetPools.testIamPermissions" call.
  94674. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  94675. // non-2xx status code is an error. Response headers are in either
  94676. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  94677. // returned at all) in error.(*googleapi.Error).Header. Use
  94678. // googleapi.IsNotModified to check whether the returned error was
  94679. // because http.StatusNotModified was returned.
  94680. func (c *TargetPoolsTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  94681. gensupport.SetOptions(c.urlParams_, opts...)
  94682. res, err := c.doRequest("json")
  94683. if res != nil && res.StatusCode == http.StatusNotModified {
  94684. if res.Body != nil {
  94685. res.Body.Close()
  94686. }
  94687. return nil, &googleapi.Error{
  94688. Code: res.StatusCode,
  94689. Header: res.Header,
  94690. }
  94691. }
  94692. if err != nil {
  94693. return nil, err
  94694. }
  94695. defer googleapi.CloseBody(res)
  94696. if err := googleapi.CheckResponse(res); err != nil {
  94697. return nil, err
  94698. }
  94699. ret := &TestPermissionsResponse{
  94700. ServerResponse: googleapi.ServerResponse{
  94701. Header: res.Header,
  94702. HTTPStatusCode: res.StatusCode,
  94703. },
  94704. }
  94705. target := &ret
  94706. if err := gensupport.DecodeResponse(target, res); err != nil {
  94707. return nil, err
  94708. }
  94709. return ret, nil
  94710. // {
  94711. // "description": "Returns permissions that a caller has on the specified resource.",
  94712. // "httpMethod": "POST",
  94713. // "id": "compute.targetPools.testIamPermissions",
  94714. // "parameterOrder": [
  94715. // "project",
  94716. // "region",
  94717. // "resource"
  94718. // ],
  94719. // "parameters": {
  94720. // "project": {
  94721. // "description": "Project ID for this request.",
  94722. // "location": "path",
  94723. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  94724. // "required": true,
  94725. // "type": "string"
  94726. // },
  94727. // "region": {
  94728. // "description": "The name of the region for this request.",
  94729. // "location": "path",
  94730. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  94731. // "required": true,
  94732. // "type": "string"
  94733. // },
  94734. // "resource": {
  94735. // "description": "Name of the resource for this request.",
  94736. // "location": "path",
  94737. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  94738. // "required": true,
  94739. // "type": "string"
  94740. // }
  94741. // },
  94742. // "path": "{project}/regions/{region}/targetPools/{resource}/testIamPermissions",
  94743. // "request": {
  94744. // "$ref": "TestPermissionsRequest"
  94745. // },
  94746. // "response": {
  94747. // "$ref": "TestPermissionsResponse"
  94748. // },
  94749. // "scopes": [
  94750. // "https://www.googleapis.com/auth/cloud-platform",
  94751. // "https://www.googleapis.com/auth/compute",
  94752. // "https://www.googleapis.com/auth/compute.readonly"
  94753. // ]
  94754. // }
  94755. }
  94756. // method id "compute.targetSslProxies.delete":
  94757. type TargetSslProxiesDeleteCall struct {
  94758. s *Service
  94759. project string
  94760. targetSslProxy string
  94761. urlParams_ gensupport.URLParams
  94762. ctx_ context.Context
  94763. header_ http.Header
  94764. }
  94765. // Delete: Deletes the specified TargetSslProxy resource.
  94766. func (r *TargetSslProxiesService) Delete(project string, targetSslProxy string) *TargetSslProxiesDeleteCall {
  94767. c := &TargetSslProxiesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  94768. c.project = project
  94769. c.targetSslProxy = targetSslProxy
  94770. return c
  94771. }
  94772. // RequestId sets the optional parameter "requestId": An optional
  94773. // request ID to identify requests. Specify a unique request ID so that
  94774. // if you must retry your request, the server will know to ignore the
  94775. // request if it has already been completed.
  94776. //
  94777. // For example, consider a situation where you make an initial request
  94778. // and the request times out. If you make the request again with the
  94779. // same request ID, the server can check if original operation with the
  94780. // same request ID was received, and if so, will ignore the second
  94781. // request. This prevents clients from accidentally creating duplicate
  94782. // commitments.
  94783. //
  94784. // The request ID must be a valid UUID with the exception that zero UUID
  94785. // is not supported (00000000-0000-0000-0000-000000000000).
  94786. func (c *TargetSslProxiesDeleteCall) RequestId(requestId string) *TargetSslProxiesDeleteCall {
  94787. c.urlParams_.Set("requestId", requestId)
  94788. return c
  94789. }
  94790. // Fields allows partial responses to be retrieved. See
  94791. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  94792. // for more information.
  94793. func (c *TargetSslProxiesDeleteCall) Fields(s ...googleapi.Field) *TargetSslProxiesDeleteCall {
  94794. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  94795. return c
  94796. }
  94797. // Context sets the context to be used in this call's Do method. Any
  94798. // pending HTTP request will be aborted if the provided context is
  94799. // canceled.
  94800. func (c *TargetSslProxiesDeleteCall) Context(ctx context.Context) *TargetSslProxiesDeleteCall {
  94801. c.ctx_ = ctx
  94802. return c
  94803. }
  94804. // Header returns an http.Header that can be modified by the caller to
  94805. // add HTTP headers to the request.
  94806. func (c *TargetSslProxiesDeleteCall) Header() http.Header {
  94807. if c.header_ == nil {
  94808. c.header_ = make(http.Header)
  94809. }
  94810. return c.header_
  94811. }
  94812. func (c *TargetSslProxiesDeleteCall) doRequest(alt string) (*http.Response, error) {
  94813. reqHeaders := make(http.Header)
  94814. for k, v := range c.header_ {
  94815. reqHeaders[k] = v
  94816. }
  94817. reqHeaders.Set("User-Agent", c.s.userAgent())
  94818. var body io.Reader = nil
  94819. c.urlParams_.Set("alt", alt)
  94820. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetSslProxies/{targetSslProxy}")
  94821. urls += "?" + c.urlParams_.Encode()
  94822. req, _ := http.NewRequest("DELETE", urls, body)
  94823. req.Header = reqHeaders
  94824. googleapi.Expand(req.URL, map[string]string{
  94825. "project": c.project,
  94826. "targetSslProxy": c.targetSslProxy,
  94827. })
  94828. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  94829. }
  94830. // Do executes the "compute.targetSslProxies.delete" call.
  94831. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  94832. // status code is an error. Response headers are in either
  94833. // *Operation.ServerResponse.Header or (if a response was returned at
  94834. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  94835. // to check whether the returned error was because
  94836. // http.StatusNotModified was returned.
  94837. func (c *TargetSslProxiesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  94838. gensupport.SetOptions(c.urlParams_, opts...)
  94839. res, err := c.doRequest("json")
  94840. if res != nil && res.StatusCode == http.StatusNotModified {
  94841. if res.Body != nil {
  94842. res.Body.Close()
  94843. }
  94844. return nil, &googleapi.Error{
  94845. Code: res.StatusCode,
  94846. Header: res.Header,
  94847. }
  94848. }
  94849. if err != nil {
  94850. return nil, err
  94851. }
  94852. defer googleapi.CloseBody(res)
  94853. if err := googleapi.CheckResponse(res); err != nil {
  94854. return nil, err
  94855. }
  94856. ret := &Operation{
  94857. ServerResponse: googleapi.ServerResponse{
  94858. Header: res.Header,
  94859. HTTPStatusCode: res.StatusCode,
  94860. },
  94861. }
  94862. target := &ret
  94863. if err := gensupport.DecodeResponse(target, res); err != nil {
  94864. return nil, err
  94865. }
  94866. return ret, nil
  94867. // {
  94868. // "description": "Deletes the specified TargetSslProxy resource.",
  94869. // "httpMethod": "DELETE",
  94870. // "id": "compute.targetSslProxies.delete",
  94871. // "parameterOrder": [
  94872. // "project",
  94873. // "targetSslProxy"
  94874. // ],
  94875. // "parameters": {
  94876. // "project": {
  94877. // "description": "Project ID for this request.",
  94878. // "location": "path",
  94879. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  94880. // "required": true,
  94881. // "type": "string"
  94882. // },
  94883. // "requestId": {
  94884. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  94885. // "location": "query",
  94886. // "type": "string"
  94887. // },
  94888. // "targetSslProxy": {
  94889. // "description": "Name of the TargetSslProxy resource to delete.",
  94890. // "location": "path",
  94891. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  94892. // "required": true,
  94893. // "type": "string"
  94894. // }
  94895. // },
  94896. // "path": "{project}/global/targetSslProxies/{targetSslProxy}",
  94897. // "response": {
  94898. // "$ref": "Operation"
  94899. // },
  94900. // "scopes": [
  94901. // "https://www.googleapis.com/auth/cloud-platform",
  94902. // "https://www.googleapis.com/auth/compute"
  94903. // ]
  94904. // }
  94905. }
  94906. // method id "compute.targetSslProxies.get":
  94907. type TargetSslProxiesGetCall struct {
  94908. s *Service
  94909. project string
  94910. targetSslProxy string
  94911. urlParams_ gensupport.URLParams
  94912. ifNoneMatch_ string
  94913. ctx_ context.Context
  94914. header_ http.Header
  94915. }
  94916. // Get: Returns the specified TargetSslProxy resource. Gets a list of
  94917. // available target SSL proxies by making a list() request.
  94918. func (r *TargetSslProxiesService) Get(project string, targetSslProxy string) *TargetSslProxiesGetCall {
  94919. c := &TargetSslProxiesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  94920. c.project = project
  94921. c.targetSslProxy = targetSslProxy
  94922. return c
  94923. }
  94924. // Fields allows partial responses to be retrieved. See
  94925. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  94926. // for more information.
  94927. func (c *TargetSslProxiesGetCall) Fields(s ...googleapi.Field) *TargetSslProxiesGetCall {
  94928. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  94929. return c
  94930. }
  94931. // IfNoneMatch sets the optional parameter which makes the operation
  94932. // fail if the object's ETag matches the given value. This is useful for
  94933. // getting updates only after the object has changed since the last
  94934. // request. Use googleapi.IsNotModified to check whether the response
  94935. // error from Do is the result of In-None-Match.
  94936. func (c *TargetSslProxiesGetCall) IfNoneMatch(entityTag string) *TargetSslProxiesGetCall {
  94937. c.ifNoneMatch_ = entityTag
  94938. return c
  94939. }
  94940. // Context sets the context to be used in this call's Do method. Any
  94941. // pending HTTP request will be aborted if the provided context is
  94942. // canceled.
  94943. func (c *TargetSslProxiesGetCall) Context(ctx context.Context) *TargetSslProxiesGetCall {
  94944. c.ctx_ = ctx
  94945. return c
  94946. }
  94947. // Header returns an http.Header that can be modified by the caller to
  94948. // add HTTP headers to the request.
  94949. func (c *TargetSslProxiesGetCall) Header() http.Header {
  94950. if c.header_ == nil {
  94951. c.header_ = make(http.Header)
  94952. }
  94953. return c.header_
  94954. }
  94955. func (c *TargetSslProxiesGetCall) doRequest(alt string) (*http.Response, error) {
  94956. reqHeaders := make(http.Header)
  94957. for k, v := range c.header_ {
  94958. reqHeaders[k] = v
  94959. }
  94960. reqHeaders.Set("User-Agent", c.s.userAgent())
  94961. if c.ifNoneMatch_ != "" {
  94962. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  94963. }
  94964. var body io.Reader = nil
  94965. c.urlParams_.Set("alt", alt)
  94966. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetSslProxies/{targetSslProxy}")
  94967. urls += "?" + c.urlParams_.Encode()
  94968. req, _ := http.NewRequest("GET", urls, body)
  94969. req.Header = reqHeaders
  94970. googleapi.Expand(req.URL, map[string]string{
  94971. "project": c.project,
  94972. "targetSslProxy": c.targetSslProxy,
  94973. })
  94974. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  94975. }
  94976. // Do executes the "compute.targetSslProxies.get" call.
  94977. // Exactly one of *TargetSslProxy or error will be non-nil. Any non-2xx
  94978. // status code is an error. Response headers are in either
  94979. // *TargetSslProxy.ServerResponse.Header or (if a response was returned
  94980. // at all) in error.(*googleapi.Error).Header. Use
  94981. // googleapi.IsNotModified to check whether the returned error was
  94982. // because http.StatusNotModified was returned.
  94983. func (c *TargetSslProxiesGetCall) Do(opts ...googleapi.CallOption) (*TargetSslProxy, error) {
  94984. gensupport.SetOptions(c.urlParams_, opts...)
  94985. res, err := c.doRequest("json")
  94986. if res != nil && res.StatusCode == http.StatusNotModified {
  94987. if res.Body != nil {
  94988. res.Body.Close()
  94989. }
  94990. return nil, &googleapi.Error{
  94991. Code: res.StatusCode,
  94992. Header: res.Header,
  94993. }
  94994. }
  94995. if err != nil {
  94996. return nil, err
  94997. }
  94998. defer googleapi.CloseBody(res)
  94999. if err := googleapi.CheckResponse(res); err != nil {
  95000. return nil, err
  95001. }
  95002. ret := &TargetSslProxy{
  95003. ServerResponse: googleapi.ServerResponse{
  95004. Header: res.Header,
  95005. HTTPStatusCode: res.StatusCode,
  95006. },
  95007. }
  95008. target := &ret
  95009. if err := gensupport.DecodeResponse(target, res); err != nil {
  95010. return nil, err
  95011. }
  95012. return ret, nil
  95013. // {
  95014. // "description": "Returns the specified TargetSslProxy resource. Gets a list of available target SSL proxies by making a list() request.",
  95015. // "httpMethod": "GET",
  95016. // "id": "compute.targetSslProxies.get",
  95017. // "parameterOrder": [
  95018. // "project",
  95019. // "targetSslProxy"
  95020. // ],
  95021. // "parameters": {
  95022. // "project": {
  95023. // "description": "Project ID for this request.",
  95024. // "location": "path",
  95025. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  95026. // "required": true,
  95027. // "type": "string"
  95028. // },
  95029. // "targetSslProxy": {
  95030. // "description": "Name of the TargetSslProxy resource to return.",
  95031. // "location": "path",
  95032. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  95033. // "required": true,
  95034. // "type": "string"
  95035. // }
  95036. // },
  95037. // "path": "{project}/global/targetSslProxies/{targetSslProxy}",
  95038. // "response": {
  95039. // "$ref": "TargetSslProxy"
  95040. // },
  95041. // "scopes": [
  95042. // "https://www.googleapis.com/auth/cloud-platform",
  95043. // "https://www.googleapis.com/auth/compute",
  95044. // "https://www.googleapis.com/auth/compute.readonly"
  95045. // ]
  95046. // }
  95047. }
  95048. // method id "compute.targetSslProxies.insert":
  95049. type TargetSslProxiesInsertCall struct {
  95050. s *Service
  95051. project string
  95052. targetsslproxy *TargetSslProxy
  95053. urlParams_ gensupport.URLParams
  95054. ctx_ context.Context
  95055. header_ http.Header
  95056. }
  95057. // Insert: Creates a TargetSslProxy resource in the specified project
  95058. // using the data included in the request.
  95059. func (r *TargetSslProxiesService) Insert(project string, targetsslproxy *TargetSslProxy) *TargetSslProxiesInsertCall {
  95060. c := &TargetSslProxiesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  95061. c.project = project
  95062. c.targetsslproxy = targetsslproxy
  95063. return c
  95064. }
  95065. // RequestId sets the optional parameter "requestId": An optional
  95066. // request ID to identify requests. Specify a unique request ID so that
  95067. // if you must retry your request, the server will know to ignore the
  95068. // request if it has already been completed.
  95069. //
  95070. // For example, consider a situation where you make an initial request
  95071. // and the request times out. If you make the request again with the
  95072. // same request ID, the server can check if original operation with the
  95073. // same request ID was received, and if so, will ignore the second
  95074. // request. This prevents clients from accidentally creating duplicate
  95075. // commitments.
  95076. //
  95077. // The request ID must be a valid UUID with the exception that zero UUID
  95078. // is not supported (00000000-0000-0000-0000-000000000000).
  95079. func (c *TargetSslProxiesInsertCall) RequestId(requestId string) *TargetSslProxiesInsertCall {
  95080. c.urlParams_.Set("requestId", requestId)
  95081. return c
  95082. }
  95083. // Fields allows partial responses to be retrieved. See
  95084. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  95085. // for more information.
  95086. func (c *TargetSslProxiesInsertCall) Fields(s ...googleapi.Field) *TargetSslProxiesInsertCall {
  95087. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  95088. return c
  95089. }
  95090. // Context sets the context to be used in this call's Do method. Any
  95091. // pending HTTP request will be aborted if the provided context is
  95092. // canceled.
  95093. func (c *TargetSslProxiesInsertCall) Context(ctx context.Context) *TargetSslProxiesInsertCall {
  95094. c.ctx_ = ctx
  95095. return c
  95096. }
  95097. // Header returns an http.Header that can be modified by the caller to
  95098. // add HTTP headers to the request.
  95099. func (c *TargetSslProxiesInsertCall) Header() http.Header {
  95100. if c.header_ == nil {
  95101. c.header_ = make(http.Header)
  95102. }
  95103. return c.header_
  95104. }
  95105. func (c *TargetSslProxiesInsertCall) doRequest(alt string) (*http.Response, error) {
  95106. reqHeaders := make(http.Header)
  95107. for k, v := range c.header_ {
  95108. reqHeaders[k] = v
  95109. }
  95110. reqHeaders.Set("User-Agent", c.s.userAgent())
  95111. var body io.Reader = nil
  95112. body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetsslproxy)
  95113. if err != nil {
  95114. return nil, err
  95115. }
  95116. reqHeaders.Set("Content-Type", "application/json")
  95117. c.urlParams_.Set("alt", alt)
  95118. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetSslProxies")
  95119. urls += "?" + c.urlParams_.Encode()
  95120. req, _ := http.NewRequest("POST", urls, body)
  95121. req.Header = reqHeaders
  95122. googleapi.Expand(req.URL, map[string]string{
  95123. "project": c.project,
  95124. })
  95125. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  95126. }
  95127. // Do executes the "compute.targetSslProxies.insert" call.
  95128. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  95129. // status code is an error. Response headers are in either
  95130. // *Operation.ServerResponse.Header or (if a response was returned at
  95131. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  95132. // to check whether the returned error was because
  95133. // http.StatusNotModified was returned.
  95134. func (c *TargetSslProxiesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  95135. gensupport.SetOptions(c.urlParams_, opts...)
  95136. res, err := c.doRequest("json")
  95137. if res != nil && res.StatusCode == http.StatusNotModified {
  95138. if res.Body != nil {
  95139. res.Body.Close()
  95140. }
  95141. return nil, &googleapi.Error{
  95142. Code: res.StatusCode,
  95143. Header: res.Header,
  95144. }
  95145. }
  95146. if err != nil {
  95147. return nil, err
  95148. }
  95149. defer googleapi.CloseBody(res)
  95150. if err := googleapi.CheckResponse(res); err != nil {
  95151. return nil, err
  95152. }
  95153. ret := &Operation{
  95154. ServerResponse: googleapi.ServerResponse{
  95155. Header: res.Header,
  95156. HTTPStatusCode: res.StatusCode,
  95157. },
  95158. }
  95159. target := &ret
  95160. if err := gensupport.DecodeResponse(target, res); err != nil {
  95161. return nil, err
  95162. }
  95163. return ret, nil
  95164. // {
  95165. // "description": "Creates a TargetSslProxy resource in the specified project using the data included in the request.",
  95166. // "httpMethod": "POST",
  95167. // "id": "compute.targetSslProxies.insert",
  95168. // "parameterOrder": [
  95169. // "project"
  95170. // ],
  95171. // "parameters": {
  95172. // "project": {
  95173. // "description": "Project ID for this request.",
  95174. // "location": "path",
  95175. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  95176. // "required": true,
  95177. // "type": "string"
  95178. // },
  95179. // "requestId": {
  95180. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  95181. // "location": "query",
  95182. // "type": "string"
  95183. // }
  95184. // },
  95185. // "path": "{project}/global/targetSslProxies",
  95186. // "request": {
  95187. // "$ref": "TargetSslProxy"
  95188. // },
  95189. // "response": {
  95190. // "$ref": "Operation"
  95191. // },
  95192. // "scopes": [
  95193. // "https://www.googleapis.com/auth/cloud-platform",
  95194. // "https://www.googleapis.com/auth/compute"
  95195. // ]
  95196. // }
  95197. }
  95198. // method id "compute.targetSslProxies.list":
  95199. type TargetSslProxiesListCall struct {
  95200. s *Service
  95201. project string
  95202. urlParams_ gensupport.URLParams
  95203. ifNoneMatch_ string
  95204. ctx_ context.Context
  95205. header_ http.Header
  95206. }
  95207. // List: Retrieves the list of TargetSslProxy resources available to the
  95208. // specified project.
  95209. func (r *TargetSslProxiesService) List(project string) *TargetSslProxiesListCall {
  95210. c := &TargetSslProxiesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  95211. c.project = project
  95212. return c
  95213. }
  95214. // Filter sets the optional parameter "filter": A filter expression that
  95215. // filters resources listed in the response. The expression must specify
  95216. // the field name, a comparison operator, and the value that you want to
  95217. // use for filtering. The value must be a string, a number, or a
  95218. // boolean. The comparison operator must be either =, !=, >, or <.
  95219. //
  95220. // For example, if you are filtering Compute Engine instances, you can
  95221. // exclude instances named example-instance by specifying name !=
  95222. // example-instance.
  95223. //
  95224. // You can also filter nested fields. For example, you could specify
  95225. // scheduling.automaticRestart = false to include instances only if they
  95226. // are not scheduled for automatic restarts. You can use filtering on
  95227. // nested fields to filter based on resource labels.
  95228. //
  95229. // To filter on multiple expressions, provide each separate expression
  95230. // within parentheses. For example, (scheduling.automaticRestart = true)
  95231. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  95232. // AND expression. However, you can include AND and OR expressions
  95233. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  95234. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  95235. // true).
  95236. func (c *TargetSslProxiesListCall) Filter(filter string) *TargetSslProxiesListCall {
  95237. c.urlParams_.Set("filter", filter)
  95238. return c
  95239. }
  95240. // MaxResults sets the optional parameter "maxResults": The maximum
  95241. // number of results per page that should be returned. If the number of
  95242. // available results is larger than maxResults, Compute Engine returns a
  95243. // nextPageToken that can be used to get the next page of results in
  95244. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  95245. // (Default: 500)
  95246. func (c *TargetSslProxiesListCall) MaxResults(maxResults int64) *TargetSslProxiesListCall {
  95247. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  95248. return c
  95249. }
  95250. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  95251. // a certain order. By default, results are returned in alphanumerical
  95252. // order based on the resource name.
  95253. //
  95254. // You can also sort results in descending order based on the creation
  95255. // timestamp using orderBy="creationTimestamp desc". This sorts results
  95256. // based on the creationTimestamp field in reverse chronological order
  95257. // (newest result first). Use this to sort resources like operations so
  95258. // that the newest operation is returned first.
  95259. //
  95260. // Currently, only sorting by name or creationTimestamp desc is
  95261. // supported.
  95262. func (c *TargetSslProxiesListCall) OrderBy(orderBy string) *TargetSslProxiesListCall {
  95263. c.urlParams_.Set("orderBy", orderBy)
  95264. return c
  95265. }
  95266. // PageToken sets the optional parameter "pageToken": Specifies a page
  95267. // token to use. Set pageToken to the nextPageToken returned by a
  95268. // previous list request to get the next page of results.
  95269. func (c *TargetSslProxiesListCall) PageToken(pageToken string) *TargetSslProxiesListCall {
  95270. c.urlParams_.Set("pageToken", pageToken)
  95271. return c
  95272. }
  95273. // Fields allows partial responses to be retrieved. See
  95274. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  95275. // for more information.
  95276. func (c *TargetSslProxiesListCall) Fields(s ...googleapi.Field) *TargetSslProxiesListCall {
  95277. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  95278. return c
  95279. }
  95280. // IfNoneMatch sets the optional parameter which makes the operation
  95281. // fail if the object's ETag matches the given value. This is useful for
  95282. // getting updates only after the object has changed since the last
  95283. // request. Use googleapi.IsNotModified to check whether the response
  95284. // error from Do is the result of In-None-Match.
  95285. func (c *TargetSslProxiesListCall) IfNoneMatch(entityTag string) *TargetSslProxiesListCall {
  95286. c.ifNoneMatch_ = entityTag
  95287. return c
  95288. }
  95289. // Context sets the context to be used in this call's Do method. Any
  95290. // pending HTTP request will be aborted if the provided context is
  95291. // canceled.
  95292. func (c *TargetSslProxiesListCall) Context(ctx context.Context) *TargetSslProxiesListCall {
  95293. c.ctx_ = ctx
  95294. return c
  95295. }
  95296. // Header returns an http.Header that can be modified by the caller to
  95297. // add HTTP headers to the request.
  95298. func (c *TargetSslProxiesListCall) Header() http.Header {
  95299. if c.header_ == nil {
  95300. c.header_ = make(http.Header)
  95301. }
  95302. return c.header_
  95303. }
  95304. func (c *TargetSslProxiesListCall) doRequest(alt string) (*http.Response, error) {
  95305. reqHeaders := make(http.Header)
  95306. for k, v := range c.header_ {
  95307. reqHeaders[k] = v
  95308. }
  95309. reqHeaders.Set("User-Agent", c.s.userAgent())
  95310. if c.ifNoneMatch_ != "" {
  95311. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  95312. }
  95313. var body io.Reader = nil
  95314. c.urlParams_.Set("alt", alt)
  95315. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetSslProxies")
  95316. urls += "?" + c.urlParams_.Encode()
  95317. req, _ := http.NewRequest("GET", urls, body)
  95318. req.Header = reqHeaders
  95319. googleapi.Expand(req.URL, map[string]string{
  95320. "project": c.project,
  95321. })
  95322. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  95323. }
  95324. // Do executes the "compute.targetSslProxies.list" call.
  95325. // Exactly one of *TargetSslProxyList or error will be non-nil. Any
  95326. // non-2xx status code is an error. Response headers are in either
  95327. // *TargetSslProxyList.ServerResponse.Header or (if a response was
  95328. // returned at all) in error.(*googleapi.Error).Header. Use
  95329. // googleapi.IsNotModified to check whether the returned error was
  95330. // because http.StatusNotModified was returned.
  95331. func (c *TargetSslProxiesListCall) Do(opts ...googleapi.CallOption) (*TargetSslProxyList, error) {
  95332. gensupport.SetOptions(c.urlParams_, opts...)
  95333. res, err := c.doRequest("json")
  95334. if res != nil && res.StatusCode == http.StatusNotModified {
  95335. if res.Body != nil {
  95336. res.Body.Close()
  95337. }
  95338. return nil, &googleapi.Error{
  95339. Code: res.StatusCode,
  95340. Header: res.Header,
  95341. }
  95342. }
  95343. if err != nil {
  95344. return nil, err
  95345. }
  95346. defer googleapi.CloseBody(res)
  95347. if err := googleapi.CheckResponse(res); err != nil {
  95348. return nil, err
  95349. }
  95350. ret := &TargetSslProxyList{
  95351. ServerResponse: googleapi.ServerResponse{
  95352. Header: res.Header,
  95353. HTTPStatusCode: res.StatusCode,
  95354. },
  95355. }
  95356. target := &ret
  95357. if err := gensupport.DecodeResponse(target, res); err != nil {
  95358. return nil, err
  95359. }
  95360. return ret, nil
  95361. // {
  95362. // "description": "Retrieves the list of TargetSslProxy resources available to the specified project.",
  95363. // "httpMethod": "GET",
  95364. // "id": "compute.targetSslProxies.list",
  95365. // "parameterOrder": [
  95366. // "project"
  95367. // ],
  95368. // "parameters": {
  95369. // "filter": {
  95370. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  95371. // "location": "query",
  95372. // "type": "string"
  95373. // },
  95374. // "maxResults": {
  95375. // "default": "500",
  95376. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  95377. // "format": "uint32",
  95378. // "location": "query",
  95379. // "minimum": "0",
  95380. // "type": "integer"
  95381. // },
  95382. // "orderBy": {
  95383. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  95384. // "location": "query",
  95385. // "type": "string"
  95386. // },
  95387. // "pageToken": {
  95388. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  95389. // "location": "query",
  95390. // "type": "string"
  95391. // },
  95392. // "project": {
  95393. // "description": "Project ID for this request.",
  95394. // "location": "path",
  95395. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  95396. // "required": true,
  95397. // "type": "string"
  95398. // }
  95399. // },
  95400. // "path": "{project}/global/targetSslProxies",
  95401. // "response": {
  95402. // "$ref": "TargetSslProxyList"
  95403. // },
  95404. // "scopes": [
  95405. // "https://www.googleapis.com/auth/cloud-platform",
  95406. // "https://www.googleapis.com/auth/compute",
  95407. // "https://www.googleapis.com/auth/compute.readonly"
  95408. // ]
  95409. // }
  95410. }
  95411. // Pages invokes f for each page of results.
  95412. // A non-nil error returned from f will halt the iteration.
  95413. // The provided context supersedes any context provided to the Context method.
  95414. func (c *TargetSslProxiesListCall) Pages(ctx context.Context, f func(*TargetSslProxyList) error) error {
  95415. c.ctx_ = ctx
  95416. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  95417. for {
  95418. x, err := c.Do()
  95419. if err != nil {
  95420. return err
  95421. }
  95422. if err := f(x); err != nil {
  95423. return err
  95424. }
  95425. if x.NextPageToken == "" {
  95426. return nil
  95427. }
  95428. c.PageToken(x.NextPageToken)
  95429. }
  95430. }
  95431. // method id "compute.targetSslProxies.setBackendService":
  95432. type TargetSslProxiesSetBackendServiceCall struct {
  95433. s *Service
  95434. project string
  95435. targetSslProxy string
  95436. targetsslproxiessetbackendservicerequest *TargetSslProxiesSetBackendServiceRequest
  95437. urlParams_ gensupport.URLParams
  95438. ctx_ context.Context
  95439. header_ http.Header
  95440. }
  95441. // SetBackendService: Changes the BackendService for TargetSslProxy.
  95442. func (r *TargetSslProxiesService) SetBackendService(project string, targetSslProxy string, targetsslproxiessetbackendservicerequest *TargetSslProxiesSetBackendServiceRequest) *TargetSslProxiesSetBackendServiceCall {
  95443. c := &TargetSslProxiesSetBackendServiceCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  95444. c.project = project
  95445. c.targetSslProxy = targetSslProxy
  95446. c.targetsslproxiessetbackendservicerequest = targetsslproxiessetbackendservicerequest
  95447. return c
  95448. }
  95449. // RequestId sets the optional parameter "requestId": An optional
  95450. // request ID to identify requests. Specify a unique request ID so that
  95451. // if you must retry your request, the server will know to ignore the
  95452. // request if it has already been completed.
  95453. //
  95454. // For example, consider a situation where you make an initial request
  95455. // and the request times out. If you make the request again with the
  95456. // same request ID, the server can check if original operation with the
  95457. // same request ID was received, and if so, will ignore the second
  95458. // request. This prevents clients from accidentally creating duplicate
  95459. // commitments.
  95460. //
  95461. // The request ID must be a valid UUID with the exception that zero UUID
  95462. // is not supported (00000000-0000-0000-0000-000000000000).
  95463. func (c *TargetSslProxiesSetBackendServiceCall) RequestId(requestId string) *TargetSslProxiesSetBackendServiceCall {
  95464. c.urlParams_.Set("requestId", requestId)
  95465. return c
  95466. }
  95467. // Fields allows partial responses to be retrieved. See
  95468. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  95469. // for more information.
  95470. func (c *TargetSslProxiesSetBackendServiceCall) Fields(s ...googleapi.Field) *TargetSslProxiesSetBackendServiceCall {
  95471. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  95472. return c
  95473. }
  95474. // Context sets the context to be used in this call's Do method. Any
  95475. // pending HTTP request will be aborted if the provided context is
  95476. // canceled.
  95477. func (c *TargetSslProxiesSetBackendServiceCall) Context(ctx context.Context) *TargetSslProxiesSetBackendServiceCall {
  95478. c.ctx_ = ctx
  95479. return c
  95480. }
  95481. // Header returns an http.Header that can be modified by the caller to
  95482. // add HTTP headers to the request.
  95483. func (c *TargetSslProxiesSetBackendServiceCall) Header() http.Header {
  95484. if c.header_ == nil {
  95485. c.header_ = make(http.Header)
  95486. }
  95487. return c.header_
  95488. }
  95489. func (c *TargetSslProxiesSetBackendServiceCall) doRequest(alt string) (*http.Response, error) {
  95490. reqHeaders := make(http.Header)
  95491. for k, v := range c.header_ {
  95492. reqHeaders[k] = v
  95493. }
  95494. reqHeaders.Set("User-Agent", c.s.userAgent())
  95495. var body io.Reader = nil
  95496. body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetsslproxiessetbackendservicerequest)
  95497. if err != nil {
  95498. return nil, err
  95499. }
  95500. reqHeaders.Set("Content-Type", "application/json")
  95501. c.urlParams_.Set("alt", alt)
  95502. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetSslProxies/{targetSslProxy}/setBackendService")
  95503. urls += "?" + c.urlParams_.Encode()
  95504. req, _ := http.NewRequest("POST", urls, body)
  95505. req.Header = reqHeaders
  95506. googleapi.Expand(req.URL, map[string]string{
  95507. "project": c.project,
  95508. "targetSslProxy": c.targetSslProxy,
  95509. })
  95510. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  95511. }
  95512. // Do executes the "compute.targetSslProxies.setBackendService" call.
  95513. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  95514. // status code is an error. Response headers are in either
  95515. // *Operation.ServerResponse.Header or (if a response was returned at
  95516. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  95517. // to check whether the returned error was because
  95518. // http.StatusNotModified was returned.
  95519. func (c *TargetSslProxiesSetBackendServiceCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  95520. gensupport.SetOptions(c.urlParams_, opts...)
  95521. res, err := c.doRequest("json")
  95522. if res != nil && res.StatusCode == http.StatusNotModified {
  95523. if res.Body != nil {
  95524. res.Body.Close()
  95525. }
  95526. return nil, &googleapi.Error{
  95527. Code: res.StatusCode,
  95528. Header: res.Header,
  95529. }
  95530. }
  95531. if err != nil {
  95532. return nil, err
  95533. }
  95534. defer googleapi.CloseBody(res)
  95535. if err := googleapi.CheckResponse(res); err != nil {
  95536. return nil, err
  95537. }
  95538. ret := &Operation{
  95539. ServerResponse: googleapi.ServerResponse{
  95540. Header: res.Header,
  95541. HTTPStatusCode: res.StatusCode,
  95542. },
  95543. }
  95544. target := &ret
  95545. if err := gensupport.DecodeResponse(target, res); err != nil {
  95546. return nil, err
  95547. }
  95548. return ret, nil
  95549. // {
  95550. // "description": "Changes the BackendService for TargetSslProxy.",
  95551. // "httpMethod": "POST",
  95552. // "id": "compute.targetSslProxies.setBackendService",
  95553. // "parameterOrder": [
  95554. // "project",
  95555. // "targetSslProxy"
  95556. // ],
  95557. // "parameters": {
  95558. // "project": {
  95559. // "description": "Project ID for this request.",
  95560. // "location": "path",
  95561. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  95562. // "required": true,
  95563. // "type": "string"
  95564. // },
  95565. // "requestId": {
  95566. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  95567. // "location": "query",
  95568. // "type": "string"
  95569. // },
  95570. // "targetSslProxy": {
  95571. // "description": "Name of the TargetSslProxy resource whose BackendService resource is to be set.",
  95572. // "location": "path",
  95573. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  95574. // "required": true,
  95575. // "type": "string"
  95576. // }
  95577. // },
  95578. // "path": "{project}/global/targetSslProxies/{targetSslProxy}/setBackendService",
  95579. // "request": {
  95580. // "$ref": "TargetSslProxiesSetBackendServiceRequest"
  95581. // },
  95582. // "response": {
  95583. // "$ref": "Operation"
  95584. // },
  95585. // "scopes": [
  95586. // "https://www.googleapis.com/auth/cloud-platform",
  95587. // "https://www.googleapis.com/auth/compute"
  95588. // ]
  95589. // }
  95590. }
  95591. // method id "compute.targetSslProxies.setProxyHeader":
  95592. type TargetSslProxiesSetProxyHeaderCall struct {
  95593. s *Service
  95594. project string
  95595. targetSslProxy string
  95596. targetsslproxiessetproxyheaderrequest *TargetSslProxiesSetProxyHeaderRequest
  95597. urlParams_ gensupport.URLParams
  95598. ctx_ context.Context
  95599. header_ http.Header
  95600. }
  95601. // SetProxyHeader: Changes the ProxyHeaderType for TargetSslProxy.
  95602. func (r *TargetSslProxiesService) SetProxyHeader(project string, targetSslProxy string, targetsslproxiessetproxyheaderrequest *TargetSslProxiesSetProxyHeaderRequest) *TargetSslProxiesSetProxyHeaderCall {
  95603. c := &TargetSslProxiesSetProxyHeaderCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  95604. c.project = project
  95605. c.targetSslProxy = targetSslProxy
  95606. c.targetsslproxiessetproxyheaderrequest = targetsslproxiessetproxyheaderrequest
  95607. return c
  95608. }
  95609. // RequestId sets the optional parameter "requestId": An optional
  95610. // request ID to identify requests. Specify a unique request ID so that
  95611. // if you must retry your request, the server will know to ignore the
  95612. // request if it has already been completed.
  95613. //
  95614. // For example, consider a situation where you make an initial request
  95615. // and the request times out. If you make the request again with the
  95616. // same request ID, the server can check if original operation with the
  95617. // same request ID was received, and if so, will ignore the second
  95618. // request. This prevents clients from accidentally creating duplicate
  95619. // commitments.
  95620. //
  95621. // The request ID must be a valid UUID with the exception that zero UUID
  95622. // is not supported (00000000-0000-0000-0000-000000000000).
  95623. func (c *TargetSslProxiesSetProxyHeaderCall) RequestId(requestId string) *TargetSslProxiesSetProxyHeaderCall {
  95624. c.urlParams_.Set("requestId", requestId)
  95625. return c
  95626. }
  95627. // Fields allows partial responses to be retrieved. See
  95628. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  95629. // for more information.
  95630. func (c *TargetSslProxiesSetProxyHeaderCall) Fields(s ...googleapi.Field) *TargetSslProxiesSetProxyHeaderCall {
  95631. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  95632. return c
  95633. }
  95634. // Context sets the context to be used in this call's Do method. Any
  95635. // pending HTTP request will be aborted if the provided context is
  95636. // canceled.
  95637. func (c *TargetSslProxiesSetProxyHeaderCall) Context(ctx context.Context) *TargetSslProxiesSetProxyHeaderCall {
  95638. c.ctx_ = ctx
  95639. return c
  95640. }
  95641. // Header returns an http.Header that can be modified by the caller to
  95642. // add HTTP headers to the request.
  95643. func (c *TargetSslProxiesSetProxyHeaderCall) Header() http.Header {
  95644. if c.header_ == nil {
  95645. c.header_ = make(http.Header)
  95646. }
  95647. return c.header_
  95648. }
  95649. func (c *TargetSslProxiesSetProxyHeaderCall) doRequest(alt string) (*http.Response, error) {
  95650. reqHeaders := make(http.Header)
  95651. for k, v := range c.header_ {
  95652. reqHeaders[k] = v
  95653. }
  95654. reqHeaders.Set("User-Agent", c.s.userAgent())
  95655. var body io.Reader = nil
  95656. body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetsslproxiessetproxyheaderrequest)
  95657. if err != nil {
  95658. return nil, err
  95659. }
  95660. reqHeaders.Set("Content-Type", "application/json")
  95661. c.urlParams_.Set("alt", alt)
  95662. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetSslProxies/{targetSslProxy}/setProxyHeader")
  95663. urls += "?" + c.urlParams_.Encode()
  95664. req, _ := http.NewRequest("POST", urls, body)
  95665. req.Header = reqHeaders
  95666. googleapi.Expand(req.URL, map[string]string{
  95667. "project": c.project,
  95668. "targetSslProxy": c.targetSslProxy,
  95669. })
  95670. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  95671. }
  95672. // Do executes the "compute.targetSslProxies.setProxyHeader" call.
  95673. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  95674. // status code is an error. Response headers are in either
  95675. // *Operation.ServerResponse.Header or (if a response was returned at
  95676. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  95677. // to check whether the returned error was because
  95678. // http.StatusNotModified was returned.
  95679. func (c *TargetSslProxiesSetProxyHeaderCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  95680. gensupport.SetOptions(c.urlParams_, opts...)
  95681. res, err := c.doRequest("json")
  95682. if res != nil && res.StatusCode == http.StatusNotModified {
  95683. if res.Body != nil {
  95684. res.Body.Close()
  95685. }
  95686. return nil, &googleapi.Error{
  95687. Code: res.StatusCode,
  95688. Header: res.Header,
  95689. }
  95690. }
  95691. if err != nil {
  95692. return nil, err
  95693. }
  95694. defer googleapi.CloseBody(res)
  95695. if err := googleapi.CheckResponse(res); err != nil {
  95696. return nil, err
  95697. }
  95698. ret := &Operation{
  95699. ServerResponse: googleapi.ServerResponse{
  95700. Header: res.Header,
  95701. HTTPStatusCode: res.StatusCode,
  95702. },
  95703. }
  95704. target := &ret
  95705. if err := gensupport.DecodeResponse(target, res); err != nil {
  95706. return nil, err
  95707. }
  95708. return ret, nil
  95709. // {
  95710. // "description": "Changes the ProxyHeaderType for TargetSslProxy.",
  95711. // "httpMethod": "POST",
  95712. // "id": "compute.targetSslProxies.setProxyHeader",
  95713. // "parameterOrder": [
  95714. // "project",
  95715. // "targetSslProxy"
  95716. // ],
  95717. // "parameters": {
  95718. // "project": {
  95719. // "description": "Project ID for this request.",
  95720. // "location": "path",
  95721. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  95722. // "required": true,
  95723. // "type": "string"
  95724. // },
  95725. // "requestId": {
  95726. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  95727. // "location": "query",
  95728. // "type": "string"
  95729. // },
  95730. // "targetSslProxy": {
  95731. // "description": "Name of the TargetSslProxy resource whose ProxyHeader is to be set.",
  95732. // "location": "path",
  95733. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  95734. // "required": true,
  95735. // "type": "string"
  95736. // }
  95737. // },
  95738. // "path": "{project}/global/targetSslProxies/{targetSslProxy}/setProxyHeader",
  95739. // "request": {
  95740. // "$ref": "TargetSslProxiesSetProxyHeaderRequest"
  95741. // },
  95742. // "response": {
  95743. // "$ref": "Operation"
  95744. // },
  95745. // "scopes": [
  95746. // "https://www.googleapis.com/auth/cloud-platform",
  95747. // "https://www.googleapis.com/auth/compute"
  95748. // ]
  95749. // }
  95750. }
  95751. // method id "compute.targetSslProxies.setSslCertificates":
  95752. type TargetSslProxiesSetSslCertificatesCall struct {
  95753. s *Service
  95754. project string
  95755. targetSslProxy string
  95756. targetsslproxiessetsslcertificatesrequest *TargetSslProxiesSetSslCertificatesRequest
  95757. urlParams_ gensupport.URLParams
  95758. ctx_ context.Context
  95759. header_ http.Header
  95760. }
  95761. // SetSslCertificates: Changes SslCertificates for TargetSslProxy.
  95762. func (r *TargetSslProxiesService) SetSslCertificates(project string, targetSslProxy string, targetsslproxiessetsslcertificatesrequest *TargetSslProxiesSetSslCertificatesRequest) *TargetSslProxiesSetSslCertificatesCall {
  95763. c := &TargetSslProxiesSetSslCertificatesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  95764. c.project = project
  95765. c.targetSslProxy = targetSslProxy
  95766. c.targetsslproxiessetsslcertificatesrequest = targetsslproxiessetsslcertificatesrequest
  95767. return c
  95768. }
  95769. // RequestId sets the optional parameter "requestId": An optional
  95770. // request ID to identify requests. Specify a unique request ID so that
  95771. // if you must retry your request, the server will know to ignore the
  95772. // request if it has already been completed.
  95773. //
  95774. // For example, consider a situation where you make an initial request
  95775. // and the request times out. If you make the request again with the
  95776. // same request ID, the server can check if original operation with the
  95777. // same request ID was received, and if so, will ignore the second
  95778. // request. This prevents clients from accidentally creating duplicate
  95779. // commitments.
  95780. //
  95781. // The request ID must be a valid UUID with the exception that zero UUID
  95782. // is not supported (00000000-0000-0000-0000-000000000000).
  95783. func (c *TargetSslProxiesSetSslCertificatesCall) RequestId(requestId string) *TargetSslProxiesSetSslCertificatesCall {
  95784. c.urlParams_.Set("requestId", requestId)
  95785. return c
  95786. }
  95787. // Fields allows partial responses to be retrieved. See
  95788. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  95789. // for more information.
  95790. func (c *TargetSslProxiesSetSslCertificatesCall) Fields(s ...googleapi.Field) *TargetSslProxiesSetSslCertificatesCall {
  95791. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  95792. return c
  95793. }
  95794. // Context sets the context to be used in this call's Do method. Any
  95795. // pending HTTP request will be aborted if the provided context is
  95796. // canceled.
  95797. func (c *TargetSslProxiesSetSslCertificatesCall) Context(ctx context.Context) *TargetSslProxiesSetSslCertificatesCall {
  95798. c.ctx_ = ctx
  95799. return c
  95800. }
  95801. // Header returns an http.Header that can be modified by the caller to
  95802. // add HTTP headers to the request.
  95803. func (c *TargetSslProxiesSetSslCertificatesCall) Header() http.Header {
  95804. if c.header_ == nil {
  95805. c.header_ = make(http.Header)
  95806. }
  95807. return c.header_
  95808. }
  95809. func (c *TargetSslProxiesSetSslCertificatesCall) doRequest(alt string) (*http.Response, error) {
  95810. reqHeaders := make(http.Header)
  95811. for k, v := range c.header_ {
  95812. reqHeaders[k] = v
  95813. }
  95814. reqHeaders.Set("User-Agent", c.s.userAgent())
  95815. var body io.Reader = nil
  95816. body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetsslproxiessetsslcertificatesrequest)
  95817. if err != nil {
  95818. return nil, err
  95819. }
  95820. reqHeaders.Set("Content-Type", "application/json")
  95821. c.urlParams_.Set("alt", alt)
  95822. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetSslProxies/{targetSslProxy}/setSslCertificates")
  95823. urls += "?" + c.urlParams_.Encode()
  95824. req, _ := http.NewRequest("POST", urls, body)
  95825. req.Header = reqHeaders
  95826. googleapi.Expand(req.URL, map[string]string{
  95827. "project": c.project,
  95828. "targetSslProxy": c.targetSslProxy,
  95829. })
  95830. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  95831. }
  95832. // Do executes the "compute.targetSslProxies.setSslCertificates" call.
  95833. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  95834. // status code is an error. Response headers are in either
  95835. // *Operation.ServerResponse.Header or (if a response was returned at
  95836. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  95837. // to check whether the returned error was because
  95838. // http.StatusNotModified was returned.
  95839. func (c *TargetSslProxiesSetSslCertificatesCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  95840. gensupport.SetOptions(c.urlParams_, opts...)
  95841. res, err := c.doRequest("json")
  95842. if res != nil && res.StatusCode == http.StatusNotModified {
  95843. if res.Body != nil {
  95844. res.Body.Close()
  95845. }
  95846. return nil, &googleapi.Error{
  95847. Code: res.StatusCode,
  95848. Header: res.Header,
  95849. }
  95850. }
  95851. if err != nil {
  95852. return nil, err
  95853. }
  95854. defer googleapi.CloseBody(res)
  95855. if err := googleapi.CheckResponse(res); err != nil {
  95856. return nil, err
  95857. }
  95858. ret := &Operation{
  95859. ServerResponse: googleapi.ServerResponse{
  95860. Header: res.Header,
  95861. HTTPStatusCode: res.StatusCode,
  95862. },
  95863. }
  95864. target := &ret
  95865. if err := gensupport.DecodeResponse(target, res); err != nil {
  95866. return nil, err
  95867. }
  95868. return ret, nil
  95869. // {
  95870. // "description": "Changes SslCertificates for TargetSslProxy.",
  95871. // "httpMethod": "POST",
  95872. // "id": "compute.targetSslProxies.setSslCertificates",
  95873. // "parameterOrder": [
  95874. // "project",
  95875. // "targetSslProxy"
  95876. // ],
  95877. // "parameters": {
  95878. // "project": {
  95879. // "description": "Project ID for this request.",
  95880. // "location": "path",
  95881. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  95882. // "required": true,
  95883. // "type": "string"
  95884. // },
  95885. // "requestId": {
  95886. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  95887. // "location": "query",
  95888. // "type": "string"
  95889. // },
  95890. // "targetSslProxy": {
  95891. // "description": "Name of the TargetSslProxy resource whose SslCertificate resource is to be set.",
  95892. // "location": "path",
  95893. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  95894. // "required": true,
  95895. // "type": "string"
  95896. // }
  95897. // },
  95898. // "path": "{project}/global/targetSslProxies/{targetSslProxy}/setSslCertificates",
  95899. // "request": {
  95900. // "$ref": "TargetSslProxiesSetSslCertificatesRequest"
  95901. // },
  95902. // "response": {
  95903. // "$ref": "Operation"
  95904. // },
  95905. // "scopes": [
  95906. // "https://www.googleapis.com/auth/cloud-platform",
  95907. // "https://www.googleapis.com/auth/compute"
  95908. // ]
  95909. // }
  95910. }
  95911. // method id "compute.targetSslProxies.setSslPolicy":
  95912. type TargetSslProxiesSetSslPolicyCall struct {
  95913. s *Service
  95914. project string
  95915. targetSslProxy string
  95916. sslpolicyreference *SslPolicyReference
  95917. urlParams_ gensupport.URLParams
  95918. ctx_ context.Context
  95919. header_ http.Header
  95920. }
  95921. // SetSslPolicy: Sets the SSL policy for TargetSslProxy. The SSL policy
  95922. // specifies the server-side support for SSL features. This affects
  95923. // connections between clients and the SSL proxy load balancer. They do
  95924. // not affect the connection between the load balancer and the backends.
  95925. func (r *TargetSslProxiesService) SetSslPolicy(project string, targetSslProxy string, sslpolicyreference *SslPolicyReference) *TargetSslProxiesSetSslPolicyCall {
  95926. c := &TargetSslProxiesSetSslPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  95927. c.project = project
  95928. c.targetSslProxy = targetSslProxy
  95929. c.sslpolicyreference = sslpolicyreference
  95930. return c
  95931. }
  95932. // RequestId sets the optional parameter "requestId": An optional
  95933. // request ID to identify requests. Specify a unique request ID so that
  95934. // if you must retry your request, the server will know to ignore the
  95935. // request if it has already been completed.
  95936. //
  95937. // For example, consider a situation where you make an initial request
  95938. // and the request times out. If you make the request again with the
  95939. // same request ID, the server can check if original operation with the
  95940. // same request ID was received, and if so, will ignore the second
  95941. // request. This prevents clients from accidentally creating duplicate
  95942. // commitments.
  95943. //
  95944. // The request ID must be a valid UUID with the exception that zero UUID
  95945. // is not supported (00000000-0000-0000-0000-000000000000).
  95946. func (c *TargetSslProxiesSetSslPolicyCall) RequestId(requestId string) *TargetSslProxiesSetSslPolicyCall {
  95947. c.urlParams_.Set("requestId", requestId)
  95948. return c
  95949. }
  95950. // Fields allows partial responses to be retrieved. See
  95951. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  95952. // for more information.
  95953. func (c *TargetSslProxiesSetSslPolicyCall) Fields(s ...googleapi.Field) *TargetSslProxiesSetSslPolicyCall {
  95954. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  95955. return c
  95956. }
  95957. // Context sets the context to be used in this call's Do method. Any
  95958. // pending HTTP request will be aborted if the provided context is
  95959. // canceled.
  95960. func (c *TargetSslProxiesSetSslPolicyCall) Context(ctx context.Context) *TargetSslProxiesSetSslPolicyCall {
  95961. c.ctx_ = ctx
  95962. return c
  95963. }
  95964. // Header returns an http.Header that can be modified by the caller to
  95965. // add HTTP headers to the request.
  95966. func (c *TargetSslProxiesSetSslPolicyCall) Header() http.Header {
  95967. if c.header_ == nil {
  95968. c.header_ = make(http.Header)
  95969. }
  95970. return c.header_
  95971. }
  95972. func (c *TargetSslProxiesSetSslPolicyCall) doRequest(alt string) (*http.Response, error) {
  95973. reqHeaders := make(http.Header)
  95974. for k, v := range c.header_ {
  95975. reqHeaders[k] = v
  95976. }
  95977. reqHeaders.Set("User-Agent", c.s.userAgent())
  95978. var body io.Reader = nil
  95979. body, err := googleapi.WithoutDataWrapper.JSONReader(c.sslpolicyreference)
  95980. if err != nil {
  95981. return nil, err
  95982. }
  95983. reqHeaders.Set("Content-Type", "application/json")
  95984. c.urlParams_.Set("alt", alt)
  95985. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetSslProxies/{targetSslProxy}/setSslPolicy")
  95986. urls += "?" + c.urlParams_.Encode()
  95987. req, _ := http.NewRequest("POST", urls, body)
  95988. req.Header = reqHeaders
  95989. googleapi.Expand(req.URL, map[string]string{
  95990. "project": c.project,
  95991. "targetSslProxy": c.targetSslProxy,
  95992. })
  95993. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  95994. }
  95995. // Do executes the "compute.targetSslProxies.setSslPolicy" call.
  95996. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  95997. // status code is an error. Response headers are in either
  95998. // *Operation.ServerResponse.Header or (if a response was returned at
  95999. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  96000. // to check whether the returned error was because
  96001. // http.StatusNotModified was returned.
  96002. func (c *TargetSslProxiesSetSslPolicyCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  96003. gensupport.SetOptions(c.urlParams_, opts...)
  96004. res, err := c.doRequest("json")
  96005. if res != nil && res.StatusCode == http.StatusNotModified {
  96006. if res.Body != nil {
  96007. res.Body.Close()
  96008. }
  96009. return nil, &googleapi.Error{
  96010. Code: res.StatusCode,
  96011. Header: res.Header,
  96012. }
  96013. }
  96014. if err != nil {
  96015. return nil, err
  96016. }
  96017. defer googleapi.CloseBody(res)
  96018. if err := googleapi.CheckResponse(res); err != nil {
  96019. return nil, err
  96020. }
  96021. ret := &Operation{
  96022. ServerResponse: googleapi.ServerResponse{
  96023. Header: res.Header,
  96024. HTTPStatusCode: res.StatusCode,
  96025. },
  96026. }
  96027. target := &ret
  96028. if err := gensupport.DecodeResponse(target, res); err != nil {
  96029. return nil, err
  96030. }
  96031. return ret, nil
  96032. // {
  96033. // "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.",
  96034. // "httpMethod": "POST",
  96035. // "id": "compute.targetSslProxies.setSslPolicy",
  96036. // "parameterOrder": [
  96037. // "project",
  96038. // "targetSslProxy"
  96039. // ],
  96040. // "parameters": {
  96041. // "project": {
  96042. // "description": "Project ID for this request.",
  96043. // "location": "path",
  96044. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  96045. // "required": true,
  96046. // "type": "string"
  96047. // },
  96048. // "requestId": {
  96049. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  96050. // "location": "query",
  96051. // "type": "string"
  96052. // },
  96053. // "targetSslProxy": {
  96054. // "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.",
  96055. // "location": "path",
  96056. // "required": true,
  96057. // "type": "string"
  96058. // }
  96059. // },
  96060. // "path": "{project}/global/targetSslProxies/{targetSslProxy}/setSslPolicy",
  96061. // "request": {
  96062. // "$ref": "SslPolicyReference"
  96063. // },
  96064. // "response": {
  96065. // "$ref": "Operation"
  96066. // },
  96067. // "scopes": [
  96068. // "https://www.googleapis.com/auth/cloud-platform",
  96069. // "https://www.googleapis.com/auth/compute"
  96070. // ]
  96071. // }
  96072. }
  96073. // method id "compute.targetSslProxies.testIamPermissions":
  96074. type TargetSslProxiesTestIamPermissionsCall struct {
  96075. s *Service
  96076. project string
  96077. resource string
  96078. testpermissionsrequest *TestPermissionsRequest
  96079. urlParams_ gensupport.URLParams
  96080. ctx_ context.Context
  96081. header_ http.Header
  96082. }
  96083. // TestIamPermissions: Returns permissions that a caller has on the
  96084. // specified resource.
  96085. func (r *TargetSslProxiesService) TestIamPermissions(project string, resource string, testpermissionsrequest *TestPermissionsRequest) *TargetSslProxiesTestIamPermissionsCall {
  96086. c := &TargetSslProxiesTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  96087. c.project = project
  96088. c.resource = resource
  96089. c.testpermissionsrequest = testpermissionsrequest
  96090. return c
  96091. }
  96092. // Fields allows partial responses to be retrieved. See
  96093. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  96094. // for more information.
  96095. func (c *TargetSslProxiesTestIamPermissionsCall) Fields(s ...googleapi.Field) *TargetSslProxiesTestIamPermissionsCall {
  96096. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  96097. return c
  96098. }
  96099. // Context sets the context to be used in this call's Do method. Any
  96100. // pending HTTP request will be aborted if the provided context is
  96101. // canceled.
  96102. func (c *TargetSslProxiesTestIamPermissionsCall) Context(ctx context.Context) *TargetSslProxiesTestIamPermissionsCall {
  96103. c.ctx_ = ctx
  96104. return c
  96105. }
  96106. // Header returns an http.Header that can be modified by the caller to
  96107. // add HTTP headers to the request.
  96108. func (c *TargetSslProxiesTestIamPermissionsCall) Header() http.Header {
  96109. if c.header_ == nil {
  96110. c.header_ = make(http.Header)
  96111. }
  96112. return c.header_
  96113. }
  96114. func (c *TargetSslProxiesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  96115. reqHeaders := make(http.Header)
  96116. for k, v := range c.header_ {
  96117. reqHeaders[k] = v
  96118. }
  96119. reqHeaders.Set("User-Agent", c.s.userAgent())
  96120. var body io.Reader = nil
  96121. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  96122. if err != nil {
  96123. return nil, err
  96124. }
  96125. reqHeaders.Set("Content-Type", "application/json")
  96126. c.urlParams_.Set("alt", alt)
  96127. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetSslProxies/{resource}/testIamPermissions")
  96128. urls += "?" + c.urlParams_.Encode()
  96129. req, _ := http.NewRequest("POST", urls, body)
  96130. req.Header = reqHeaders
  96131. googleapi.Expand(req.URL, map[string]string{
  96132. "project": c.project,
  96133. "resource": c.resource,
  96134. })
  96135. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  96136. }
  96137. // Do executes the "compute.targetSslProxies.testIamPermissions" call.
  96138. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  96139. // non-2xx status code is an error. Response headers are in either
  96140. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  96141. // returned at all) in error.(*googleapi.Error).Header. Use
  96142. // googleapi.IsNotModified to check whether the returned error was
  96143. // because http.StatusNotModified was returned.
  96144. func (c *TargetSslProxiesTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  96145. gensupport.SetOptions(c.urlParams_, opts...)
  96146. res, err := c.doRequest("json")
  96147. if res != nil && res.StatusCode == http.StatusNotModified {
  96148. if res.Body != nil {
  96149. res.Body.Close()
  96150. }
  96151. return nil, &googleapi.Error{
  96152. Code: res.StatusCode,
  96153. Header: res.Header,
  96154. }
  96155. }
  96156. if err != nil {
  96157. return nil, err
  96158. }
  96159. defer googleapi.CloseBody(res)
  96160. if err := googleapi.CheckResponse(res); err != nil {
  96161. return nil, err
  96162. }
  96163. ret := &TestPermissionsResponse{
  96164. ServerResponse: googleapi.ServerResponse{
  96165. Header: res.Header,
  96166. HTTPStatusCode: res.StatusCode,
  96167. },
  96168. }
  96169. target := &ret
  96170. if err := gensupport.DecodeResponse(target, res); err != nil {
  96171. return nil, err
  96172. }
  96173. return ret, nil
  96174. // {
  96175. // "description": "Returns permissions that a caller has on the specified resource.",
  96176. // "httpMethod": "POST",
  96177. // "id": "compute.targetSslProxies.testIamPermissions",
  96178. // "parameterOrder": [
  96179. // "project",
  96180. // "resource"
  96181. // ],
  96182. // "parameters": {
  96183. // "project": {
  96184. // "description": "Project ID for this request.",
  96185. // "location": "path",
  96186. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  96187. // "required": true,
  96188. // "type": "string"
  96189. // },
  96190. // "resource": {
  96191. // "description": "Name of the resource for this request.",
  96192. // "location": "path",
  96193. // "pattern": "(?:[-a-z0-9_]{0,62}[a-z0-9])?",
  96194. // "required": true,
  96195. // "type": "string"
  96196. // }
  96197. // },
  96198. // "path": "{project}/global/targetSslProxies/{resource}/testIamPermissions",
  96199. // "request": {
  96200. // "$ref": "TestPermissionsRequest"
  96201. // },
  96202. // "response": {
  96203. // "$ref": "TestPermissionsResponse"
  96204. // },
  96205. // "scopes": [
  96206. // "https://www.googleapis.com/auth/cloud-platform",
  96207. // "https://www.googleapis.com/auth/compute",
  96208. // "https://www.googleapis.com/auth/compute.readonly"
  96209. // ]
  96210. // }
  96211. }
  96212. // method id "compute.targetTcpProxies.delete":
  96213. type TargetTcpProxiesDeleteCall struct {
  96214. s *Service
  96215. project string
  96216. targetTcpProxy string
  96217. urlParams_ gensupport.URLParams
  96218. ctx_ context.Context
  96219. header_ http.Header
  96220. }
  96221. // Delete: Deletes the specified TargetTcpProxy resource.
  96222. func (r *TargetTcpProxiesService) Delete(project string, targetTcpProxy string) *TargetTcpProxiesDeleteCall {
  96223. c := &TargetTcpProxiesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  96224. c.project = project
  96225. c.targetTcpProxy = targetTcpProxy
  96226. return c
  96227. }
  96228. // RequestId sets the optional parameter "requestId": An optional
  96229. // request ID to identify requests. Specify a unique request ID so that
  96230. // if you must retry your request, the server will know to ignore the
  96231. // request if it has already been completed.
  96232. //
  96233. // For example, consider a situation where you make an initial request
  96234. // and the request times out. If you make the request again with the
  96235. // same request ID, the server can check if original operation with the
  96236. // same request ID was received, and if so, will ignore the second
  96237. // request. This prevents clients from accidentally creating duplicate
  96238. // commitments.
  96239. //
  96240. // The request ID must be a valid UUID with the exception that zero UUID
  96241. // is not supported (00000000-0000-0000-0000-000000000000).
  96242. func (c *TargetTcpProxiesDeleteCall) RequestId(requestId string) *TargetTcpProxiesDeleteCall {
  96243. c.urlParams_.Set("requestId", requestId)
  96244. return c
  96245. }
  96246. // Fields allows partial responses to be retrieved. See
  96247. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  96248. // for more information.
  96249. func (c *TargetTcpProxiesDeleteCall) Fields(s ...googleapi.Field) *TargetTcpProxiesDeleteCall {
  96250. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  96251. return c
  96252. }
  96253. // Context sets the context to be used in this call's Do method. Any
  96254. // pending HTTP request will be aborted if the provided context is
  96255. // canceled.
  96256. func (c *TargetTcpProxiesDeleteCall) Context(ctx context.Context) *TargetTcpProxiesDeleteCall {
  96257. c.ctx_ = ctx
  96258. return c
  96259. }
  96260. // Header returns an http.Header that can be modified by the caller to
  96261. // add HTTP headers to the request.
  96262. func (c *TargetTcpProxiesDeleteCall) Header() http.Header {
  96263. if c.header_ == nil {
  96264. c.header_ = make(http.Header)
  96265. }
  96266. return c.header_
  96267. }
  96268. func (c *TargetTcpProxiesDeleteCall) doRequest(alt string) (*http.Response, error) {
  96269. reqHeaders := make(http.Header)
  96270. for k, v := range c.header_ {
  96271. reqHeaders[k] = v
  96272. }
  96273. reqHeaders.Set("User-Agent", c.s.userAgent())
  96274. var body io.Reader = nil
  96275. c.urlParams_.Set("alt", alt)
  96276. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetTcpProxies/{targetTcpProxy}")
  96277. urls += "?" + c.urlParams_.Encode()
  96278. req, _ := http.NewRequest("DELETE", urls, body)
  96279. req.Header = reqHeaders
  96280. googleapi.Expand(req.URL, map[string]string{
  96281. "project": c.project,
  96282. "targetTcpProxy": c.targetTcpProxy,
  96283. })
  96284. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  96285. }
  96286. // Do executes the "compute.targetTcpProxies.delete" call.
  96287. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  96288. // status code is an error. Response headers are in either
  96289. // *Operation.ServerResponse.Header or (if a response was returned at
  96290. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  96291. // to check whether the returned error was because
  96292. // http.StatusNotModified was returned.
  96293. func (c *TargetTcpProxiesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  96294. gensupport.SetOptions(c.urlParams_, opts...)
  96295. res, err := c.doRequest("json")
  96296. if res != nil && res.StatusCode == http.StatusNotModified {
  96297. if res.Body != nil {
  96298. res.Body.Close()
  96299. }
  96300. return nil, &googleapi.Error{
  96301. Code: res.StatusCode,
  96302. Header: res.Header,
  96303. }
  96304. }
  96305. if err != nil {
  96306. return nil, err
  96307. }
  96308. defer googleapi.CloseBody(res)
  96309. if err := googleapi.CheckResponse(res); err != nil {
  96310. return nil, err
  96311. }
  96312. ret := &Operation{
  96313. ServerResponse: googleapi.ServerResponse{
  96314. Header: res.Header,
  96315. HTTPStatusCode: res.StatusCode,
  96316. },
  96317. }
  96318. target := &ret
  96319. if err := gensupport.DecodeResponse(target, res); err != nil {
  96320. return nil, err
  96321. }
  96322. return ret, nil
  96323. // {
  96324. // "description": "Deletes the specified TargetTcpProxy resource.",
  96325. // "httpMethod": "DELETE",
  96326. // "id": "compute.targetTcpProxies.delete",
  96327. // "parameterOrder": [
  96328. // "project",
  96329. // "targetTcpProxy"
  96330. // ],
  96331. // "parameters": {
  96332. // "project": {
  96333. // "description": "Project ID for this request.",
  96334. // "location": "path",
  96335. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  96336. // "required": true,
  96337. // "type": "string"
  96338. // },
  96339. // "requestId": {
  96340. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  96341. // "location": "query",
  96342. // "type": "string"
  96343. // },
  96344. // "targetTcpProxy": {
  96345. // "description": "Name of the TargetTcpProxy resource to delete.",
  96346. // "location": "path",
  96347. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  96348. // "required": true,
  96349. // "type": "string"
  96350. // }
  96351. // },
  96352. // "path": "{project}/global/targetTcpProxies/{targetTcpProxy}",
  96353. // "response": {
  96354. // "$ref": "Operation"
  96355. // },
  96356. // "scopes": [
  96357. // "https://www.googleapis.com/auth/cloud-platform",
  96358. // "https://www.googleapis.com/auth/compute"
  96359. // ]
  96360. // }
  96361. }
  96362. // method id "compute.targetTcpProxies.get":
  96363. type TargetTcpProxiesGetCall struct {
  96364. s *Service
  96365. project string
  96366. targetTcpProxy string
  96367. urlParams_ gensupport.URLParams
  96368. ifNoneMatch_ string
  96369. ctx_ context.Context
  96370. header_ http.Header
  96371. }
  96372. // Get: Returns the specified TargetTcpProxy resource. Gets a list of
  96373. // available target TCP proxies by making a list() request.
  96374. func (r *TargetTcpProxiesService) Get(project string, targetTcpProxy string) *TargetTcpProxiesGetCall {
  96375. c := &TargetTcpProxiesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  96376. c.project = project
  96377. c.targetTcpProxy = targetTcpProxy
  96378. return c
  96379. }
  96380. // Fields allows partial responses to be retrieved. See
  96381. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  96382. // for more information.
  96383. func (c *TargetTcpProxiesGetCall) Fields(s ...googleapi.Field) *TargetTcpProxiesGetCall {
  96384. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  96385. return c
  96386. }
  96387. // IfNoneMatch sets the optional parameter which makes the operation
  96388. // fail if the object's ETag matches the given value. This is useful for
  96389. // getting updates only after the object has changed since the last
  96390. // request. Use googleapi.IsNotModified to check whether the response
  96391. // error from Do is the result of In-None-Match.
  96392. func (c *TargetTcpProxiesGetCall) IfNoneMatch(entityTag string) *TargetTcpProxiesGetCall {
  96393. c.ifNoneMatch_ = entityTag
  96394. return c
  96395. }
  96396. // Context sets the context to be used in this call's Do method. Any
  96397. // pending HTTP request will be aborted if the provided context is
  96398. // canceled.
  96399. func (c *TargetTcpProxiesGetCall) Context(ctx context.Context) *TargetTcpProxiesGetCall {
  96400. c.ctx_ = ctx
  96401. return c
  96402. }
  96403. // Header returns an http.Header that can be modified by the caller to
  96404. // add HTTP headers to the request.
  96405. func (c *TargetTcpProxiesGetCall) Header() http.Header {
  96406. if c.header_ == nil {
  96407. c.header_ = make(http.Header)
  96408. }
  96409. return c.header_
  96410. }
  96411. func (c *TargetTcpProxiesGetCall) doRequest(alt string) (*http.Response, error) {
  96412. reqHeaders := make(http.Header)
  96413. for k, v := range c.header_ {
  96414. reqHeaders[k] = v
  96415. }
  96416. reqHeaders.Set("User-Agent", c.s.userAgent())
  96417. if c.ifNoneMatch_ != "" {
  96418. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  96419. }
  96420. var body io.Reader = nil
  96421. c.urlParams_.Set("alt", alt)
  96422. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetTcpProxies/{targetTcpProxy}")
  96423. urls += "?" + c.urlParams_.Encode()
  96424. req, _ := http.NewRequest("GET", urls, body)
  96425. req.Header = reqHeaders
  96426. googleapi.Expand(req.URL, map[string]string{
  96427. "project": c.project,
  96428. "targetTcpProxy": c.targetTcpProxy,
  96429. })
  96430. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  96431. }
  96432. // Do executes the "compute.targetTcpProxies.get" call.
  96433. // Exactly one of *TargetTcpProxy or error will be non-nil. Any non-2xx
  96434. // status code is an error. Response headers are in either
  96435. // *TargetTcpProxy.ServerResponse.Header or (if a response was returned
  96436. // at all) in error.(*googleapi.Error).Header. Use
  96437. // googleapi.IsNotModified to check whether the returned error was
  96438. // because http.StatusNotModified was returned.
  96439. func (c *TargetTcpProxiesGetCall) Do(opts ...googleapi.CallOption) (*TargetTcpProxy, error) {
  96440. gensupport.SetOptions(c.urlParams_, opts...)
  96441. res, err := c.doRequest("json")
  96442. if res != nil && res.StatusCode == http.StatusNotModified {
  96443. if res.Body != nil {
  96444. res.Body.Close()
  96445. }
  96446. return nil, &googleapi.Error{
  96447. Code: res.StatusCode,
  96448. Header: res.Header,
  96449. }
  96450. }
  96451. if err != nil {
  96452. return nil, err
  96453. }
  96454. defer googleapi.CloseBody(res)
  96455. if err := googleapi.CheckResponse(res); err != nil {
  96456. return nil, err
  96457. }
  96458. ret := &TargetTcpProxy{
  96459. ServerResponse: googleapi.ServerResponse{
  96460. Header: res.Header,
  96461. HTTPStatusCode: res.StatusCode,
  96462. },
  96463. }
  96464. target := &ret
  96465. if err := gensupport.DecodeResponse(target, res); err != nil {
  96466. return nil, err
  96467. }
  96468. return ret, nil
  96469. // {
  96470. // "description": "Returns the specified TargetTcpProxy resource. Gets a list of available target TCP proxies by making a list() request.",
  96471. // "httpMethod": "GET",
  96472. // "id": "compute.targetTcpProxies.get",
  96473. // "parameterOrder": [
  96474. // "project",
  96475. // "targetTcpProxy"
  96476. // ],
  96477. // "parameters": {
  96478. // "project": {
  96479. // "description": "Project ID for this request.",
  96480. // "location": "path",
  96481. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  96482. // "required": true,
  96483. // "type": "string"
  96484. // },
  96485. // "targetTcpProxy": {
  96486. // "description": "Name of the TargetTcpProxy resource to return.",
  96487. // "location": "path",
  96488. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  96489. // "required": true,
  96490. // "type": "string"
  96491. // }
  96492. // },
  96493. // "path": "{project}/global/targetTcpProxies/{targetTcpProxy}",
  96494. // "response": {
  96495. // "$ref": "TargetTcpProxy"
  96496. // },
  96497. // "scopes": [
  96498. // "https://www.googleapis.com/auth/cloud-platform",
  96499. // "https://www.googleapis.com/auth/compute",
  96500. // "https://www.googleapis.com/auth/compute.readonly"
  96501. // ]
  96502. // }
  96503. }
  96504. // method id "compute.targetTcpProxies.insert":
  96505. type TargetTcpProxiesInsertCall struct {
  96506. s *Service
  96507. project string
  96508. targettcpproxy *TargetTcpProxy
  96509. urlParams_ gensupport.URLParams
  96510. ctx_ context.Context
  96511. header_ http.Header
  96512. }
  96513. // Insert: Creates a TargetTcpProxy resource in the specified project
  96514. // using the data included in the request.
  96515. func (r *TargetTcpProxiesService) Insert(project string, targettcpproxy *TargetTcpProxy) *TargetTcpProxiesInsertCall {
  96516. c := &TargetTcpProxiesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  96517. c.project = project
  96518. c.targettcpproxy = targettcpproxy
  96519. return c
  96520. }
  96521. // RequestId sets the optional parameter "requestId": An optional
  96522. // request ID to identify requests. Specify a unique request ID so that
  96523. // if you must retry your request, the server will know to ignore the
  96524. // request if it has already been completed.
  96525. //
  96526. // For example, consider a situation where you make an initial request
  96527. // and the request times out. If you make the request again with the
  96528. // same request ID, the server can check if original operation with the
  96529. // same request ID was received, and if so, will ignore the second
  96530. // request. This prevents clients from accidentally creating duplicate
  96531. // commitments.
  96532. //
  96533. // The request ID must be a valid UUID with the exception that zero UUID
  96534. // is not supported (00000000-0000-0000-0000-000000000000).
  96535. func (c *TargetTcpProxiesInsertCall) RequestId(requestId string) *TargetTcpProxiesInsertCall {
  96536. c.urlParams_.Set("requestId", requestId)
  96537. return c
  96538. }
  96539. // Fields allows partial responses to be retrieved. See
  96540. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  96541. // for more information.
  96542. func (c *TargetTcpProxiesInsertCall) Fields(s ...googleapi.Field) *TargetTcpProxiesInsertCall {
  96543. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  96544. return c
  96545. }
  96546. // Context sets the context to be used in this call's Do method. Any
  96547. // pending HTTP request will be aborted if the provided context is
  96548. // canceled.
  96549. func (c *TargetTcpProxiesInsertCall) Context(ctx context.Context) *TargetTcpProxiesInsertCall {
  96550. c.ctx_ = ctx
  96551. return c
  96552. }
  96553. // Header returns an http.Header that can be modified by the caller to
  96554. // add HTTP headers to the request.
  96555. func (c *TargetTcpProxiesInsertCall) Header() http.Header {
  96556. if c.header_ == nil {
  96557. c.header_ = make(http.Header)
  96558. }
  96559. return c.header_
  96560. }
  96561. func (c *TargetTcpProxiesInsertCall) doRequest(alt string) (*http.Response, error) {
  96562. reqHeaders := make(http.Header)
  96563. for k, v := range c.header_ {
  96564. reqHeaders[k] = v
  96565. }
  96566. reqHeaders.Set("User-Agent", c.s.userAgent())
  96567. var body io.Reader = nil
  96568. body, err := googleapi.WithoutDataWrapper.JSONReader(c.targettcpproxy)
  96569. if err != nil {
  96570. return nil, err
  96571. }
  96572. reqHeaders.Set("Content-Type", "application/json")
  96573. c.urlParams_.Set("alt", alt)
  96574. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetTcpProxies")
  96575. urls += "?" + c.urlParams_.Encode()
  96576. req, _ := http.NewRequest("POST", urls, body)
  96577. req.Header = reqHeaders
  96578. googleapi.Expand(req.URL, map[string]string{
  96579. "project": c.project,
  96580. })
  96581. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  96582. }
  96583. // Do executes the "compute.targetTcpProxies.insert" call.
  96584. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  96585. // status code is an error. Response headers are in either
  96586. // *Operation.ServerResponse.Header or (if a response was returned at
  96587. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  96588. // to check whether the returned error was because
  96589. // http.StatusNotModified was returned.
  96590. func (c *TargetTcpProxiesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  96591. gensupport.SetOptions(c.urlParams_, opts...)
  96592. res, err := c.doRequest("json")
  96593. if res != nil && res.StatusCode == http.StatusNotModified {
  96594. if res.Body != nil {
  96595. res.Body.Close()
  96596. }
  96597. return nil, &googleapi.Error{
  96598. Code: res.StatusCode,
  96599. Header: res.Header,
  96600. }
  96601. }
  96602. if err != nil {
  96603. return nil, err
  96604. }
  96605. defer googleapi.CloseBody(res)
  96606. if err := googleapi.CheckResponse(res); err != nil {
  96607. return nil, err
  96608. }
  96609. ret := &Operation{
  96610. ServerResponse: googleapi.ServerResponse{
  96611. Header: res.Header,
  96612. HTTPStatusCode: res.StatusCode,
  96613. },
  96614. }
  96615. target := &ret
  96616. if err := gensupport.DecodeResponse(target, res); err != nil {
  96617. return nil, err
  96618. }
  96619. return ret, nil
  96620. // {
  96621. // "description": "Creates a TargetTcpProxy resource in the specified project using the data included in the request.",
  96622. // "httpMethod": "POST",
  96623. // "id": "compute.targetTcpProxies.insert",
  96624. // "parameterOrder": [
  96625. // "project"
  96626. // ],
  96627. // "parameters": {
  96628. // "project": {
  96629. // "description": "Project ID for this request.",
  96630. // "location": "path",
  96631. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  96632. // "required": true,
  96633. // "type": "string"
  96634. // },
  96635. // "requestId": {
  96636. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  96637. // "location": "query",
  96638. // "type": "string"
  96639. // }
  96640. // },
  96641. // "path": "{project}/global/targetTcpProxies",
  96642. // "request": {
  96643. // "$ref": "TargetTcpProxy"
  96644. // },
  96645. // "response": {
  96646. // "$ref": "Operation"
  96647. // },
  96648. // "scopes": [
  96649. // "https://www.googleapis.com/auth/cloud-platform",
  96650. // "https://www.googleapis.com/auth/compute"
  96651. // ]
  96652. // }
  96653. }
  96654. // method id "compute.targetTcpProxies.list":
  96655. type TargetTcpProxiesListCall struct {
  96656. s *Service
  96657. project string
  96658. urlParams_ gensupport.URLParams
  96659. ifNoneMatch_ string
  96660. ctx_ context.Context
  96661. header_ http.Header
  96662. }
  96663. // List: Retrieves the list of TargetTcpProxy resources available to the
  96664. // specified project.
  96665. func (r *TargetTcpProxiesService) List(project string) *TargetTcpProxiesListCall {
  96666. c := &TargetTcpProxiesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  96667. c.project = project
  96668. return c
  96669. }
  96670. // Filter sets the optional parameter "filter": A filter expression that
  96671. // filters resources listed in the response. The expression must specify
  96672. // the field name, a comparison operator, and the value that you want to
  96673. // use for filtering. The value must be a string, a number, or a
  96674. // boolean. The comparison operator must be either =, !=, >, or <.
  96675. //
  96676. // For example, if you are filtering Compute Engine instances, you can
  96677. // exclude instances named example-instance by specifying name !=
  96678. // example-instance.
  96679. //
  96680. // You can also filter nested fields. For example, you could specify
  96681. // scheduling.automaticRestart = false to include instances only if they
  96682. // are not scheduled for automatic restarts. You can use filtering on
  96683. // nested fields to filter based on resource labels.
  96684. //
  96685. // To filter on multiple expressions, provide each separate expression
  96686. // within parentheses. For example, (scheduling.automaticRestart = true)
  96687. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  96688. // AND expression. However, you can include AND and OR expressions
  96689. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  96690. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  96691. // true).
  96692. func (c *TargetTcpProxiesListCall) Filter(filter string) *TargetTcpProxiesListCall {
  96693. c.urlParams_.Set("filter", filter)
  96694. return c
  96695. }
  96696. // MaxResults sets the optional parameter "maxResults": The maximum
  96697. // number of results per page that should be returned. If the number of
  96698. // available results is larger than maxResults, Compute Engine returns a
  96699. // nextPageToken that can be used to get the next page of results in
  96700. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  96701. // (Default: 500)
  96702. func (c *TargetTcpProxiesListCall) MaxResults(maxResults int64) *TargetTcpProxiesListCall {
  96703. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  96704. return c
  96705. }
  96706. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  96707. // a certain order. By default, results are returned in alphanumerical
  96708. // order based on the resource name.
  96709. //
  96710. // You can also sort results in descending order based on the creation
  96711. // timestamp using orderBy="creationTimestamp desc". This sorts results
  96712. // based on the creationTimestamp field in reverse chronological order
  96713. // (newest result first). Use this to sort resources like operations so
  96714. // that the newest operation is returned first.
  96715. //
  96716. // Currently, only sorting by name or creationTimestamp desc is
  96717. // supported.
  96718. func (c *TargetTcpProxiesListCall) OrderBy(orderBy string) *TargetTcpProxiesListCall {
  96719. c.urlParams_.Set("orderBy", orderBy)
  96720. return c
  96721. }
  96722. // PageToken sets the optional parameter "pageToken": Specifies a page
  96723. // token to use. Set pageToken to the nextPageToken returned by a
  96724. // previous list request to get the next page of results.
  96725. func (c *TargetTcpProxiesListCall) PageToken(pageToken string) *TargetTcpProxiesListCall {
  96726. c.urlParams_.Set("pageToken", pageToken)
  96727. return c
  96728. }
  96729. // Fields allows partial responses to be retrieved. See
  96730. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  96731. // for more information.
  96732. func (c *TargetTcpProxiesListCall) Fields(s ...googleapi.Field) *TargetTcpProxiesListCall {
  96733. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  96734. return c
  96735. }
  96736. // IfNoneMatch sets the optional parameter which makes the operation
  96737. // fail if the object's ETag matches the given value. This is useful for
  96738. // getting updates only after the object has changed since the last
  96739. // request. Use googleapi.IsNotModified to check whether the response
  96740. // error from Do is the result of In-None-Match.
  96741. func (c *TargetTcpProxiesListCall) IfNoneMatch(entityTag string) *TargetTcpProxiesListCall {
  96742. c.ifNoneMatch_ = entityTag
  96743. return c
  96744. }
  96745. // Context sets the context to be used in this call's Do method. Any
  96746. // pending HTTP request will be aborted if the provided context is
  96747. // canceled.
  96748. func (c *TargetTcpProxiesListCall) Context(ctx context.Context) *TargetTcpProxiesListCall {
  96749. c.ctx_ = ctx
  96750. return c
  96751. }
  96752. // Header returns an http.Header that can be modified by the caller to
  96753. // add HTTP headers to the request.
  96754. func (c *TargetTcpProxiesListCall) Header() http.Header {
  96755. if c.header_ == nil {
  96756. c.header_ = make(http.Header)
  96757. }
  96758. return c.header_
  96759. }
  96760. func (c *TargetTcpProxiesListCall) doRequest(alt string) (*http.Response, error) {
  96761. reqHeaders := make(http.Header)
  96762. for k, v := range c.header_ {
  96763. reqHeaders[k] = v
  96764. }
  96765. reqHeaders.Set("User-Agent", c.s.userAgent())
  96766. if c.ifNoneMatch_ != "" {
  96767. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  96768. }
  96769. var body io.Reader = nil
  96770. c.urlParams_.Set("alt", alt)
  96771. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetTcpProxies")
  96772. urls += "?" + c.urlParams_.Encode()
  96773. req, _ := http.NewRequest("GET", urls, body)
  96774. req.Header = reqHeaders
  96775. googleapi.Expand(req.URL, map[string]string{
  96776. "project": c.project,
  96777. })
  96778. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  96779. }
  96780. // Do executes the "compute.targetTcpProxies.list" call.
  96781. // Exactly one of *TargetTcpProxyList or error will be non-nil. Any
  96782. // non-2xx status code is an error. Response headers are in either
  96783. // *TargetTcpProxyList.ServerResponse.Header or (if a response was
  96784. // returned at all) in error.(*googleapi.Error).Header. Use
  96785. // googleapi.IsNotModified to check whether the returned error was
  96786. // because http.StatusNotModified was returned.
  96787. func (c *TargetTcpProxiesListCall) Do(opts ...googleapi.CallOption) (*TargetTcpProxyList, error) {
  96788. gensupport.SetOptions(c.urlParams_, opts...)
  96789. res, err := c.doRequest("json")
  96790. if res != nil && res.StatusCode == http.StatusNotModified {
  96791. if res.Body != nil {
  96792. res.Body.Close()
  96793. }
  96794. return nil, &googleapi.Error{
  96795. Code: res.StatusCode,
  96796. Header: res.Header,
  96797. }
  96798. }
  96799. if err != nil {
  96800. return nil, err
  96801. }
  96802. defer googleapi.CloseBody(res)
  96803. if err := googleapi.CheckResponse(res); err != nil {
  96804. return nil, err
  96805. }
  96806. ret := &TargetTcpProxyList{
  96807. ServerResponse: googleapi.ServerResponse{
  96808. Header: res.Header,
  96809. HTTPStatusCode: res.StatusCode,
  96810. },
  96811. }
  96812. target := &ret
  96813. if err := gensupport.DecodeResponse(target, res); err != nil {
  96814. return nil, err
  96815. }
  96816. return ret, nil
  96817. // {
  96818. // "description": "Retrieves the list of TargetTcpProxy resources available to the specified project.",
  96819. // "httpMethod": "GET",
  96820. // "id": "compute.targetTcpProxies.list",
  96821. // "parameterOrder": [
  96822. // "project"
  96823. // ],
  96824. // "parameters": {
  96825. // "filter": {
  96826. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  96827. // "location": "query",
  96828. // "type": "string"
  96829. // },
  96830. // "maxResults": {
  96831. // "default": "500",
  96832. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  96833. // "format": "uint32",
  96834. // "location": "query",
  96835. // "minimum": "0",
  96836. // "type": "integer"
  96837. // },
  96838. // "orderBy": {
  96839. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  96840. // "location": "query",
  96841. // "type": "string"
  96842. // },
  96843. // "pageToken": {
  96844. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  96845. // "location": "query",
  96846. // "type": "string"
  96847. // },
  96848. // "project": {
  96849. // "description": "Project ID for this request.",
  96850. // "location": "path",
  96851. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  96852. // "required": true,
  96853. // "type": "string"
  96854. // }
  96855. // },
  96856. // "path": "{project}/global/targetTcpProxies",
  96857. // "response": {
  96858. // "$ref": "TargetTcpProxyList"
  96859. // },
  96860. // "scopes": [
  96861. // "https://www.googleapis.com/auth/cloud-platform",
  96862. // "https://www.googleapis.com/auth/compute",
  96863. // "https://www.googleapis.com/auth/compute.readonly"
  96864. // ]
  96865. // }
  96866. }
  96867. // Pages invokes f for each page of results.
  96868. // A non-nil error returned from f will halt the iteration.
  96869. // The provided context supersedes any context provided to the Context method.
  96870. func (c *TargetTcpProxiesListCall) Pages(ctx context.Context, f func(*TargetTcpProxyList) error) error {
  96871. c.ctx_ = ctx
  96872. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  96873. for {
  96874. x, err := c.Do()
  96875. if err != nil {
  96876. return err
  96877. }
  96878. if err := f(x); err != nil {
  96879. return err
  96880. }
  96881. if x.NextPageToken == "" {
  96882. return nil
  96883. }
  96884. c.PageToken(x.NextPageToken)
  96885. }
  96886. }
  96887. // method id "compute.targetTcpProxies.setBackendService":
  96888. type TargetTcpProxiesSetBackendServiceCall struct {
  96889. s *Service
  96890. project string
  96891. targetTcpProxy string
  96892. targettcpproxiessetbackendservicerequest *TargetTcpProxiesSetBackendServiceRequest
  96893. urlParams_ gensupport.URLParams
  96894. ctx_ context.Context
  96895. header_ http.Header
  96896. }
  96897. // SetBackendService: Changes the BackendService for TargetTcpProxy.
  96898. func (r *TargetTcpProxiesService) SetBackendService(project string, targetTcpProxy string, targettcpproxiessetbackendservicerequest *TargetTcpProxiesSetBackendServiceRequest) *TargetTcpProxiesSetBackendServiceCall {
  96899. c := &TargetTcpProxiesSetBackendServiceCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  96900. c.project = project
  96901. c.targetTcpProxy = targetTcpProxy
  96902. c.targettcpproxiessetbackendservicerequest = targettcpproxiessetbackendservicerequest
  96903. return c
  96904. }
  96905. // RequestId sets the optional parameter "requestId": An optional
  96906. // request ID to identify requests. Specify a unique request ID so that
  96907. // if you must retry your request, the server will know to ignore the
  96908. // request if it has already been completed.
  96909. //
  96910. // For example, consider a situation where you make an initial request
  96911. // and the request times out. If you make the request again with the
  96912. // same request ID, the server can check if original operation with the
  96913. // same request ID was received, and if so, will ignore the second
  96914. // request. This prevents clients from accidentally creating duplicate
  96915. // commitments.
  96916. //
  96917. // The request ID must be a valid UUID with the exception that zero UUID
  96918. // is not supported (00000000-0000-0000-0000-000000000000).
  96919. func (c *TargetTcpProxiesSetBackendServiceCall) RequestId(requestId string) *TargetTcpProxiesSetBackendServiceCall {
  96920. c.urlParams_.Set("requestId", requestId)
  96921. return c
  96922. }
  96923. // Fields allows partial responses to be retrieved. See
  96924. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  96925. // for more information.
  96926. func (c *TargetTcpProxiesSetBackendServiceCall) Fields(s ...googleapi.Field) *TargetTcpProxiesSetBackendServiceCall {
  96927. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  96928. return c
  96929. }
  96930. // Context sets the context to be used in this call's Do method. Any
  96931. // pending HTTP request will be aborted if the provided context is
  96932. // canceled.
  96933. func (c *TargetTcpProxiesSetBackendServiceCall) Context(ctx context.Context) *TargetTcpProxiesSetBackendServiceCall {
  96934. c.ctx_ = ctx
  96935. return c
  96936. }
  96937. // Header returns an http.Header that can be modified by the caller to
  96938. // add HTTP headers to the request.
  96939. func (c *TargetTcpProxiesSetBackendServiceCall) Header() http.Header {
  96940. if c.header_ == nil {
  96941. c.header_ = make(http.Header)
  96942. }
  96943. return c.header_
  96944. }
  96945. func (c *TargetTcpProxiesSetBackendServiceCall) doRequest(alt string) (*http.Response, error) {
  96946. reqHeaders := make(http.Header)
  96947. for k, v := range c.header_ {
  96948. reqHeaders[k] = v
  96949. }
  96950. reqHeaders.Set("User-Agent", c.s.userAgent())
  96951. var body io.Reader = nil
  96952. body, err := googleapi.WithoutDataWrapper.JSONReader(c.targettcpproxiessetbackendservicerequest)
  96953. if err != nil {
  96954. return nil, err
  96955. }
  96956. reqHeaders.Set("Content-Type", "application/json")
  96957. c.urlParams_.Set("alt", alt)
  96958. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetTcpProxies/{targetTcpProxy}/setBackendService")
  96959. urls += "?" + c.urlParams_.Encode()
  96960. req, _ := http.NewRequest("POST", urls, body)
  96961. req.Header = reqHeaders
  96962. googleapi.Expand(req.URL, map[string]string{
  96963. "project": c.project,
  96964. "targetTcpProxy": c.targetTcpProxy,
  96965. })
  96966. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  96967. }
  96968. // Do executes the "compute.targetTcpProxies.setBackendService" call.
  96969. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  96970. // status code is an error. Response headers are in either
  96971. // *Operation.ServerResponse.Header or (if a response was returned at
  96972. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  96973. // to check whether the returned error was because
  96974. // http.StatusNotModified was returned.
  96975. func (c *TargetTcpProxiesSetBackendServiceCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  96976. gensupport.SetOptions(c.urlParams_, opts...)
  96977. res, err := c.doRequest("json")
  96978. if res != nil && res.StatusCode == http.StatusNotModified {
  96979. if res.Body != nil {
  96980. res.Body.Close()
  96981. }
  96982. return nil, &googleapi.Error{
  96983. Code: res.StatusCode,
  96984. Header: res.Header,
  96985. }
  96986. }
  96987. if err != nil {
  96988. return nil, err
  96989. }
  96990. defer googleapi.CloseBody(res)
  96991. if err := googleapi.CheckResponse(res); err != nil {
  96992. return nil, err
  96993. }
  96994. ret := &Operation{
  96995. ServerResponse: googleapi.ServerResponse{
  96996. Header: res.Header,
  96997. HTTPStatusCode: res.StatusCode,
  96998. },
  96999. }
  97000. target := &ret
  97001. if err := gensupport.DecodeResponse(target, res); err != nil {
  97002. return nil, err
  97003. }
  97004. return ret, nil
  97005. // {
  97006. // "description": "Changes the BackendService for TargetTcpProxy.",
  97007. // "httpMethod": "POST",
  97008. // "id": "compute.targetTcpProxies.setBackendService",
  97009. // "parameterOrder": [
  97010. // "project",
  97011. // "targetTcpProxy"
  97012. // ],
  97013. // "parameters": {
  97014. // "project": {
  97015. // "description": "Project ID for this request.",
  97016. // "location": "path",
  97017. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  97018. // "required": true,
  97019. // "type": "string"
  97020. // },
  97021. // "requestId": {
  97022. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  97023. // "location": "query",
  97024. // "type": "string"
  97025. // },
  97026. // "targetTcpProxy": {
  97027. // "description": "Name of the TargetTcpProxy resource whose BackendService resource is to be set.",
  97028. // "location": "path",
  97029. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  97030. // "required": true,
  97031. // "type": "string"
  97032. // }
  97033. // },
  97034. // "path": "{project}/global/targetTcpProxies/{targetTcpProxy}/setBackendService",
  97035. // "request": {
  97036. // "$ref": "TargetTcpProxiesSetBackendServiceRequest"
  97037. // },
  97038. // "response": {
  97039. // "$ref": "Operation"
  97040. // },
  97041. // "scopes": [
  97042. // "https://www.googleapis.com/auth/cloud-platform",
  97043. // "https://www.googleapis.com/auth/compute"
  97044. // ]
  97045. // }
  97046. }
  97047. // method id "compute.targetTcpProxies.setProxyHeader":
  97048. type TargetTcpProxiesSetProxyHeaderCall struct {
  97049. s *Service
  97050. project string
  97051. targetTcpProxy string
  97052. targettcpproxiessetproxyheaderrequest *TargetTcpProxiesSetProxyHeaderRequest
  97053. urlParams_ gensupport.URLParams
  97054. ctx_ context.Context
  97055. header_ http.Header
  97056. }
  97057. // SetProxyHeader: Changes the ProxyHeaderType for TargetTcpProxy.
  97058. func (r *TargetTcpProxiesService) SetProxyHeader(project string, targetTcpProxy string, targettcpproxiessetproxyheaderrequest *TargetTcpProxiesSetProxyHeaderRequest) *TargetTcpProxiesSetProxyHeaderCall {
  97059. c := &TargetTcpProxiesSetProxyHeaderCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  97060. c.project = project
  97061. c.targetTcpProxy = targetTcpProxy
  97062. c.targettcpproxiessetproxyheaderrequest = targettcpproxiessetproxyheaderrequest
  97063. return c
  97064. }
  97065. // RequestId sets the optional parameter "requestId": An optional
  97066. // request ID to identify requests. Specify a unique request ID so that
  97067. // if you must retry your request, the server will know to ignore the
  97068. // request if it has already been completed.
  97069. //
  97070. // For example, consider a situation where you make an initial request
  97071. // and the request times out. If you make the request again with the
  97072. // same request ID, the server can check if original operation with the
  97073. // same request ID was received, and if so, will ignore the second
  97074. // request. This prevents clients from accidentally creating duplicate
  97075. // commitments.
  97076. //
  97077. // The request ID must be a valid UUID with the exception that zero UUID
  97078. // is not supported (00000000-0000-0000-0000-000000000000).
  97079. func (c *TargetTcpProxiesSetProxyHeaderCall) RequestId(requestId string) *TargetTcpProxiesSetProxyHeaderCall {
  97080. c.urlParams_.Set("requestId", requestId)
  97081. return c
  97082. }
  97083. // Fields allows partial responses to be retrieved. See
  97084. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  97085. // for more information.
  97086. func (c *TargetTcpProxiesSetProxyHeaderCall) Fields(s ...googleapi.Field) *TargetTcpProxiesSetProxyHeaderCall {
  97087. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  97088. return c
  97089. }
  97090. // Context sets the context to be used in this call's Do method. Any
  97091. // pending HTTP request will be aborted if the provided context is
  97092. // canceled.
  97093. func (c *TargetTcpProxiesSetProxyHeaderCall) Context(ctx context.Context) *TargetTcpProxiesSetProxyHeaderCall {
  97094. c.ctx_ = ctx
  97095. return c
  97096. }
  97097. // Header returns an http.Header that can be modified by the caller to
  97098. // add HTTP headers to the request.
  97099. func (c *TargetTcpProxiesSetProxyHeaderCall) Header() http.Header {
  97100. if c.header_ == nil {
  97101. c.header_ = make(http.Header)
  97102. }
  97103. return c.header_
  97104. }
  97105. func (c *TargetTcpProxiesSetProxyHeaderCall) doRequest(alt string) (*http.Response, error) {
  97106. reqHeaders := make(http.Header)
  97107. for k, v := range c.header_ {
  97108. reqHeaders[k] = v
  97109. }
  97110. reqHeaders.Set("User-Agent", c.s.userAgent())
  97111. var body io.Reader = nil
  97112. body, err := googleapi.WithoutDataWrapper.JSONReader(c.targettcpproxiessetproxyheaderrequest)
  97113. if err != nil {
  97114. return nil, err
  97115. }
  97116. reqHeaders.Set("Content-Type", "application/json")
  97117. c.urlParams_.Set("alt", alt)
  97118. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetTcpProxies/{targetTcpProxy}/setProxyHeader")
  97119. urls += "?" + c.urlParams_.Encode()
  97120. req, _ := http.NewRequest("POST", urls, body)
  97121. req.Header = reqHeaders
  97122. googleapi.Expand(req.URL, map[string]string{
  97123. "project": c.project,
  97124. "targetTcpProxy": c.targetTcpProxy,
  97125. })
  97126. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  97127. }
  97128. // Do executes the "compute.targetTcpProxies.setProxyHeader" call.
  97129. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  97130. // status code is an error. Response headers are in either
  97131. // *Operation.ServerResponse.Header or (if a response was returned at
  97132. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  97133. // to check whether the returned error was because
  97134. // http.StatusNotModified was returned.
  97135. func (c *TargetTcpProxiesSetProxyHeaderCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  97136. gensupport.SetOptions(c.urlParams_, opts...)
  97137. res, err := c.doRequest("json")
  97138. if res != nil && res.StatusCode == http.StatusNotModified {
  97139. if res.Body != nil {
  97140. res.Body.Close()
  97141. }
  97142. return nil, &googleapi.Error{
  97143. Code: res.StatusCode,
  97144. Header: res.Header,
  97145. }
  97146. }
  97147. if err != nil {
  97148. return nil, err
  97149. }
  97150. defer googleapi.CloseBody(res)
  97151. if err := googleapi.CheckResponse(res); err != nil {
  97152. return nil, err
  97153. }
  97154. ret := &Operation{
  97155. ServerResponse: googleapi.ServerResponse{
  97156. Header: res.Header,
  97157. HTTPStatusCode: res.StatusCode,
  97158. },
  97159. }
  97160. target := &ret
  97161. if err := gensupport.DecodeResponse(target, res); err != nil {
  97162. return nil, err
  97163. }
  97164. return ret, nil
  97165. // {
  97166. // "description": "Changes the ProxyHeaderType for TargetTcpProxy.",
  97167. // "httpMethod": "POST",
  97168. // "id": "compute.targetTcpProxies.setProxyHeader",
  97169. // "parameterOrder": [
  97170. // "project",
  97171. // "targetTcpProxy"
  97172. // ],
  97173. // "parameters": {
  97174. // "project": {
  97175. // "description": "Project ID for this request.",
  97176. // "location": "path",
  97177. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  97178. // "required": true,
  97179. // "type": "string"
  97180. // },
  97181. // "requestId": {
  97182. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  97183. // "location": "query",
  97184. // "type": "string"
  97185. // },
  97186. // "targetTcpProxy": {
  97187. // "description": "Name of the TargetTcpProxy resource whose ProxyHeader is to be set.",
  97188. // "location": "path",
  97189. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  97190. // "required": true,
  97191. // "type": "string"
  97192. // }
  97193. // },
  97194. // "path": "{project}/global/targetTcpProxies/{targetTcpProxy}/setProxyHeader",
  97195. // "request": {
  97196. // "$ref": "TargetTcpProxiesSetProxyHeaderRequest"
  97197. // },
  97198. // "response": {
  97199. // "$ref": "Operation"
  97200. // },
  97201. // "scopes": [
  97202. // "https://www.googleapis.com/auth/cloud-platform",
  97203. // "https://www.googleapis.com/auth/compute"
  97204. // ]
  97205. // }
  97206. }
  97207. // method id "compute.targetVpnGateways.aggregatedList":
  97208. type TargetVpnGatewaysAggregatedListCall struct {
  97209. s *Service
  97210. project string
  97211. urlParams_ gensupport.URLParams
  97212. ifNoneMatch_ string
  97213. ctx_ context.Context
  97214. header_ http.Header
  97215. }
  97216. // AggregatedList: Retrieves an aggregated list of target VPN gateways.
  97217. func (r *TargetVpnGatewaysService) AggregatedList(project string) *TargetVpnGatewaysAggregatedListCall {
  97218. c := &TargetVpnGatewaysAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  97219. c.project = project
  97220. return c
  97221. }
  97222. // Filter sets the optional parameter "filter": A filter expression that
  97223. // filters resources listed in the response. The expression must specify
  97224. // the field name, a comparison operator, and the value that you want to
  97225. // use for filtering. The value must be a string, a number, or a
  97226. // boolean. The comparison operator must be either =, !=, >, or <.
  97227. //
  97228. // For example, if you are filtering Compute Engine instances, you can
  97229. // exclude instances named example-instance by specifying name !=
  97230. // example-instance.
  97231. //
  97232. // You can also filter nested fields. For example, you could specify
  97233. // scheduling.automaticRestart = false to include instances only if they
  97234. // are not scheduled for automatic restarts. You can use filtering on
  97235. // nested fields to filter based on resource labels.
  97236. //
  97237. // To filter on multiple expressions, provide each separate expression
  97238. // within parentheses. For example, (scheduling.automaticRestart = true)
  97239. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  97240. // AND expression. However, you can include AND and OR expressions
  97241. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  97242. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  97243. // true).
  97244. func (c *TargetVpnGatewaysAggregatedListCall) Filter(filter string) *TargetVpnGatewaysAggregatedListCall {
  97245. c.urlParams_.Set("filter", filter)
  97246. return c
  97247. }
  97248. // MaxResults sets the optional parameter "maxResults": The maximum
  97249. // number of results per page that should be returned. If the number of
  97250. // available results is larger than maxResults, Compute Engine returns a
  97251. // nextPageToken that can be used to get the next page of results in
  97252. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  97253. // (Default: 500)
  97254. func (c *TargetVpnGatewaysAggregatedListCall) MaxResults(maxResults int64) *TargetVpnGatewaysAggregatedListCall {
  97255. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  97256. return c
  97257. }
  97258. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  97259. // a certain order. By default, results are returned in alphanumerical
  97260. // order based on the resource name.
  97261. //
  97262. // You can also sort results in descending order based on the creation
  97263. // timestamp using orderBy="creationTimestamp desc". This sorts results
  97264. // based on the creationTimestamp field in reverse chronological order
  97265. // (newest result first). Use this to sort resources like operations so
  97266. // that the newest operation is returned first.
  97267. //
  97268. // Currently, only sorting by name or creationTimestamp desc is
  97269. // supported.
  97270. func (c *TargetVpnGatewaysAggregatedListCall) OrderBy(orderBy string) *TargetVpnGatewaysAggregatedListCall {
  97271. c.urlParams_.Set("orderBy", orderBy)
  97272. return c
  97273. }
  97274. // PageToken sets the optional parameter "pageToken": Specifies a page
  97275. // token to use. Set pageToken to the nextPageToken returned by a
  97276. // previous list request to get the next page of results.
  97277. func (c *TargetVpnGatewaysAggregatedListCall) PageToken(pageToken string) *TargetVpnGatewaysAggregatedListCall {
  97278. c.urlParams_.Set("pageToken", pageToken)
  97279. return c
  97280. }
  97281. // Fields allows partial responses to be retrieved. See
  97282. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  97283. // for more information.
  97284. func (c *TargetVpnGatewaysAggregatedListCall) Fields(s ...googleapi.Field) *TargetVpnGatewaysAggregatedListCall {
  97285. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  97286. return c
  97287. }
  97288. // IfNoneMatch sets the optional parameter which makes the operation
  97289. // fail if the object's ETag matches the given value. This is useful for
  97290. // getting updates only after the object has changed since the last
  97291. // request. Use googleapi.IsNotModified to check whether the response
  97292. // error from Do is the result of In-None-Match.
  97293. func (c *TargetVpnGatewaysAggregatedListCall) IfNoneMatch(entityTag string) *TargetVpnGatewaysAggregatedListCall {
  97294. c.ifNoneMatch_ = entityTag
  97295. return c
  97296. }
  97297. // Context sets the context to be used in this call's Do method. Any
  97298. // pending HTTP request will be aborted if the provided context is
  97299. // canceled.
  97300. func (c *TargetVpnGatewaysAggregatedListCall) Context(ctx context.Context) *TargetVpnGatewaysAggregatedListCall {
  97301. c.ctx_ = ctx
  97302. return c
  97303. }
  97304. // Header returns an http.Header that can be modified by the caller to
  97305. // add HTTP headers to the request.
  97306. func (c *TargetVpnGatewaysAggregatedListCall) Header() http.Header {
  97307. if c.header_ == nil {
  97308. c.header_ = make(http.Header)
  97309. }
  97310. return c.header_
  97311. }
  97312. func (c *TargetVpnGatewaysAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  97313. reqHeaders := make(http.Header)
  97314. for k, v := range c.header_ {
  97315. reqHeaders[k] = v
  97316. }
  97317. reqHeaders.Set("User-Agent", c.s.userAgent())
  97318. if c.ifNoneMatch_ != "" {
  97319. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  97320. }
  97321. var body io.Reader = nil
  97322. c.urlParams_.Set("alt", alt)
  97323. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/targetVpnGateways")
  97324. urls += "?" + c.urlParams_.Encode()
  97325. req, _ := http.NewRequest("GET", urls, body)
  97326. req.Header = reqHeaders
  97327. googleapi.Expand(req.URL, map[string]string{
  97328. "project": c.project,
  97329. })
  97330. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  97331. }
  97332. // Do executes the "compute.targetVpnGateways.aggregatedList" call.
  97333. // Exactly one of *TargetVpnGatewayAggregatedList or error will be
  97334. // non-nil. Any non-2xx status code is an error. Response headers are in
  97335. // either *TargetVpnGatewayAggregatedList.ServerResponse.Header or (if a
  97336. // response was returned at all) in error.(*googleapi.Error).Header. Use
  97337. // googleapi.IsNotModified to check whether the returned error was
  97338. // because http.StatusNotModified was returned.
  97339. func (c *TargetVpnGatewaysAggregatedListCall) Do(opts ...googleapi.CallOption) (*TargetVpnGatewayAggregatedList, error) {
  97340. gensupport.SetOptions(c.urlParams_, opts...)
  97341. res, err := c.doRequest("json")
  97342. if res != nil && res.StatusCode == http.StatusNotModified {
  97343. if res.Body != nil {
  97344. res.Body.Close()
  97345. }
  97346. return nil, &googleapi.Error{
  97347. Code: res.StatusCode,
  97348. Header: res.Header,
  97349. }
  97350. }
  97351. if err != nil {
  97352. return nil, err
  97353. }
  97354. defer googleapi.CloseBody(res)
  97355. if err := googleapi.CheckResponse(res); err != nil {
  97356. return nil, err
  97357. }
  97358. ret := &TargetVpnGatewayAggregatedList{
  97359. ServerResponse: googleapi.ServerResponse{
  97360. Header: res.Header,
  97361. HTTPStatusCode: res.StatusCode,
  97362. },
  97363. }
  97364. target := &ret
  97365. if err := gensupport.DecodeResponse(target, res); err != nil {
  97366. return nil, err
  97367. }
  97368. return ret, nil
  97369. // {
  97370. // "description": "Retrieves an aggregated list of target VPN gateways.",
  97371. // "httpMethod": "GET",
  97372. // "id": "compute.targetVpnGateways.aggregatedList",
  97373. // "parameterOrder": [
  97374. // "project"
  97375. // ],
  97376. // "parameters": {
  97377. // "filter": {
  97378. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  97379. // "location": "query",
  97380. // "type": "string"
  97381. // },
  97382. // "maxResults": {
  97383. // "default": "500",
  97384. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  97385. // "format": "uint32",
  97386. // "location": "query",
  97387. // "minimum": "0",
  97388. // "type": "integer"
  97389. // },
  97390. // "orderBy": {
  97391. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  97392. // "location": "query",
  97393. // "type": "string"
  97394. // },
  97395. // "pageToken": {
  97396. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  97397. // "location": "query",
  97398. // "type": "string"
  97399. // },
  97400. // "project": {
  97401. // "description": "Project ID for this request.",
  97402. // "location": "path",
  97403. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  97404. // "required": true,
  97405. // "type": "string"
  97406. // }
  97407. // },
  97408. // "path": "{project}/aggregated/targetVpnGateways",
  97409. // "response": {
  97410. // "$ref": "TargetVpnGatewayAggregatedList"
  97411. // },
  97412. // "scopes": [
  97413. // "https://www.googleapis.com/auth/cloud-platform",
  97414. // "https://www.googleapis.com/auth/compute",
  97415. // "https://www.googleapis.com/auth/compute.readonly"
  97416. // ]
  97417. // }
  97418. }
  97419. // Pages invokes f for each page of results.
  97420. // A non-nil error returned from f will halt the iteration.
  97421. // The provided context supersedes any context provided to the Context method.
  97422. func (c *TargetVpnGatewaysAggregatedListCall) Pages(ctx context.Context, f func(*TargetVpnGatewayAggregatedList) error) error {
  97423. c.ctx_ = ctx
  97424. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  97425. for {
  97426. x, err := c.Do()
  97427. if err != nil {
  97428. return err
  97429. }
  97430. if err := f(x); err != nil {
  97431. return err
  97432. }
  97433. if x.NextPageToken == "" {
  97434. return nil
  97435. }
  97436. c.PageToken(x.NextPageToken)
  97437. }
  97438. }
  97439. // method id "compute.targetVpnGateways.delete":
  97440. type TargetVpnGatewaysDeleteCall struct {
  97441. s *Service
  97442. project string
  97443. region string
  97444. targetVpnGateway string
  97445. urlParams_ gensupport.URLParams
  97446. ctx_ context.Context
  97447. header_ http.Header
  97448. }
  97449. // Delete: Deletes the specified target VPN gateway.
  97450. func (r *TargetVpnGatewaysService) Delete(project string, region string, targetVpnGateway string) *TargetVpnGatewaysDeleteCall {
  97451. c := &TargetVpnGatewaysDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  97452. c.project = project
  97453. c.region = region
  97454. c.targetVpnGateway = targetVpnGateway
  97455. return c
  97456. }
  97457. // RequestId sets the optional parameter "requestId": An optional
  97458. // request ID to identify requests. Specify a unique request ID so that
  97459. // if you must retry your request, the server will know to ignore the
  97460. // request if it has already been completed.
  97461. //
  97462. // For example, consider a situation where you make an initial request
  97463. // and the request times out. If you make the request again with the
  97464. // same request ID, the server can check if original operation with the
  97465. // same request ID was received, and if so, will ignore the second
  97466. // request. This prevents clients from accidentally creating duplicate
  97467. // commitments.
  97468. //
  97469. // The request ID must be a valid UUID with the exception that zero UUID
  97470. // is not supported (00000000-0000-0000-0000-000000000000).
  97471. func (c *TargetVpnGatewaysDeleteCall) RequestId(requestId string) *TargetVpnGatewaysDeleteCall {
  97472. c.urlParams_.Set("requestId", requestId)
  97473. return c
  97474. }
  97475. // Fields allows partial responses to be retrieved. See
  97476. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  97477. // for more information.
  97478. func (c *TargetVpnGatewaysDeleteCall) Fields(s ...googleapi.Field) *TargetVpnGatewaysDeleteCall {
  97479. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  97480. return c
  97481. }
  97482. // Context sets the context to be used in this call's Do method. Any
  97483. // pending HTTP request will be aborted if the provided context is
  97484. // canceled.
  97485. func (c *TargetVpnGatewaysDeleteCall) Context(ctx context.Context) *TargetVpnGatewaysDeleteCall {
  97486. c.ctx_ = ctx
  97487. return c
  97488. }
  97489. // Header returns an http.Header that can be modified by the caller to
  97490. // add HTTP headers to the request.
  97491. func (c *TargetVpnGatewaysDeleteCall) Header() http.Header {
  97492. if c.header_ == nil {
  97493. c.header_ = make(http.Header)
  97494. }
  97495. return c.header_
  97496. }
  97497. func (c *TargetVpnGatewaysDeleteCall) doRequest(alt string) (*http.Response, error) {
  97498. reqHeaders := make(http.Header)
  97499. for k, v := range c.header_ {
  97500. reqHeaders[k] = v
  97501. }
  97502. reqHeaders.Set("User-Agent", c.s.userAgent())
  97503. var body io.Reader = nil
  97504. c.urlParams_.Set("alt", alt)
  97505. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/targetVpnGateways/{targetVpnGateway}")
  97506. urls += "?" + c.urlParams_.Encode()
  97507. req, _ := http.NewRequest("DELETE", urls, body)
  97508. req.Header = reqHeaders
  97509. googleapi.Expand(req.URL, map[string]string{
  97510. "project": c.project,
  97511. "region": c.region,
  97512. "targetVpnGateway": c.targetVpnGateway,
  97513. })
  97514. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  97515. }
  97516. // Do executes the "compute.targetVpnGateways.delete" call.
  97517. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  97518. // status code is an error. Response headers are in either
  97519. // *Operation.ServerResponse.Header or (if a response was returned at
  97520. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  97521. // to check whether the returned error was because
  97522. // http.StatusNotModified was returned.
  97523. func (c *TargetVpnGatewaysDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  97524. gensupport.SetOptions(c.urlParams_, opts...)
  97525. res, err := c.doRequest("json")
  97526. if res != nil && res.StatusCode == http.StatusNotModified {
  97527. if res.Body != nil {
  97528. res.Body.Close()
  97529. }
  97530. return nil, &googleapi.Error{
  97531. Code: res.StatusCode,
  97532. Header: res.Header,
  97533. }
  97534. }
  97535. if err != nil {
  97536. return nil, err
  97537. }
  97538. defer googleapi.CloseBody(res)
  97539. if err := googleapi.CheckResponse(res); err != nil {
  97540. return nil, err
  97541. }
  97542. ret := &Operation{
  97543. ServerResponse: googleapi.ServerResponse{
  97544. Header: res.Header,
  97545. HTTPStatusCode: res.StatusCode,
  97546. },
  97547. }
  97548. target := &ret
  97549. if err := gensupport.DecodeResponse(target, res); err != nil {
  97550. return nil, err
  97551. }
  97552. return ret, nil
  97553. // {
  97554. // "description": "Deletes the specified target VPN gateway.",
  97555. // "httpMethod": "DELETE",
  97556. // "id": "compute.targetVpnGateways.delete",
  97557. // "parameterOrder": [
  97558. // "project",
  97559. // "region",
  97560. // "targetVpnGateway"
  97561. // ],
  97562. // "parameters": {
  97563. // "project": {
  97564. // "description": "Project ID for this request.",
  97565. // "location": "path",
  97566. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  97567. // "required": true,
  97568. // "type": "string"
  97569. // },
  97570. // "region": {
  97571. // "description": "Name of the region for this request.",
  97572. // "location": "path",
  97573. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  97574. // "required": true,
  97575. // "type": "string"
  97576. // },
  97577. // "requestId": {
  97578. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  97579. // "location": "query",
  97580. // "type": "string"
  97581. // },
  97582. // "targetVpnGateway": {
  97583. // "description": "Name of the target VPN gateway to delete.",
  97584. // "location": "path",
  97585. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  97586. // "required": true,
  97587. // "type": "string"
  97588. // }
  97589. // },
  97590. // "path": "{project}/regions/{region}/targetVpnGateways/{targetVpnGateway}",
  97591. // "response": {
  97592. // "$ref": "Operation"
  97593. // },
  97594. // "scopes": [
  97595. // "https://www.googleapis.com/auth/cloud-platform",
  97596. // "https://www.googleapis.com/auth/compute"
  97597. // ]
  97598. // }
  97599. }
  97600. // method id "compute.targetVpnGateways.get":
  97601. type TargetVpnGatewaysGetCall struct {
  97602. s *Service
  97603. project string
  97604. region string
  97605. targetVpnGateway string
  97606. urlParams_ gensupport.URLParams
  97607. ifNoneMatch_ string
  97608. ctx_ context.Context
  97609. header_ http.Header
  97610. }
  97611. // Get: Returns the specified target VPN gateway. Gets a list of
  97612. // available target VPN gateways by making a list() request.
  97613. func (r *TargetVpnGatewaysService) Get(project string, region string, targetVpnGateway string) *TargetVpnGatewaysGetCall {
  97614. c := &TargetVpnGatewaysGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  97615. c.project = project
  97616. c.region = region
  97617. c.targetVpnGateway = targetVpnGateway
  97618. return c
  97619. }
  97620. // Fields allows partial responses to be retrieved. See
  97621. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  97622. // for more information.
  97623. func (c *TargetVpnGatewaysGetCall) Fields(s ...googleapi.Field) *TargetVpnGatewaysGetCall {
  97624. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  97625. return c
  97626. }
  97627. // IfNoneMatch sets the optional parameter which makes the operation
  97628. // fail if the object's ETag matches the given value. This is useful for
  97629. // getting updates only after the object has changed since the last
  97630. // request. Use googleapi.IsNotModified to check whether the response
  97631. // error from Do is the result of In-None-Match.
  97632. func (c *TargetVpnGatewaysGetCall) IfNoneMatch(entityTag string) *TargetVpnGatewaysGetCall {
  97633. c.ifNoneMatch_ = entityTag
  97634. return c
  97635. }
  97636. // Context sets the context to be used in this call's Do method. Any
  97637. // pending HTTP request will be aborted if the provided context is
  97638. // canceled.
  97639. func (c *TargetVpnGatewaysGetCall) Context(ctx context.Context) *TargetVpnGatewaysGetCall {
  97640. c.ctx_ = ctx
  97641. return c
  97642. }
  97643. // Header returns an http.Header that can be modified by the caller to
  97644. // add HTTP headers to the request.
  97645. func (c *TargetVpnGatewaysGetCall) Header() http.Header {
  97646. if c.header_ == nil {
  97647. c.header_ = make(http.Header)
  97648. }
  97649. return c.header_
  97650. }
  97651. func (c *TargetVpnGatewaysGetCall) doRequest(alt string) (*http.Response, error) {
  97652. reqHeaders := make(http.Header)
  97653. for k, v := range c.header_ {
  97654. reqHeaders[k] = v
  97655. }
  97656. reqHeaders.Set("User-Agent", c.s.userAgent())
  97657. if c.ifNoneMatch_ != "" {
  97658. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  97659. }
  97660. var body io.Reader = nil
  97661. c.urlParams_.Set("alt", alt)
  97662. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/targetVpnGateways/{targetVpnGateway}")
  97663. urls += "?" + c.urlParams_.Encode()
  97664. req, _ := http.NewRequest("GET", urls, body)
  97665. req.Header = reqHeaders
  97666. googleapi.Expand(req.URL, map[string]string{
  97667. "project": c.project,
  97668. "region": c.region,
  97669. "targetVpnGateway": c.targetVpnGateway,
  97670. })
  97671. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  97672. }
  97673. // Do executes the "compute.targetVpnGateways.get" call.
  97674. // Exactly one of *TargetVpnGateway or error will be non-nil. Any
  97675. // non-2xx status code is an error. Response headers are in either
  97676. // *TargetVpnGateway.ServerResponse.Header or (if a response was
  97677. // returned at all) in error.(*googleapi.Error).Header. Use
  97678. // googleapi.IsNotModified to check whether the returned error was
  97679. // because http.StatusNotModified was returned.
  97680. func (c *TargetVpnGatewaysGetCall) Do(opts ...googleapi.CallOption) (*TargetVpnGateway, error) {
  97681. gensupport.SetOptions(c.urlParams_, opts...)
  97682. res, err := c.doRequest("json")
  97683. if res != nil && res.StatusCode == http.StatusNotModified {
  97684. if res.Body != nil {
  97685. res.Body.Close()
  97686. }
  97687. return nil, &googleapi.Error{
  97688. Code: res.StatusCode,
  97689. Header: res.Header,
  97690. }
  97691. }
  97692. if err != nil {
  97693. return nil, err
  97694. }
  97695. defer googleapi.CloseBody(res)
  97696. if err := googleapi.CheckResponse(res); err != nil {
  97697. return nil, err
  97698. }
  97699. ret := &TargetVpnGateway{
  97700. ServerResponse: googleapi.ServerResponse{
  97701. Header: res.Header,
  97702. HTTPStatusCode: res.StatusCode,
  97703. },
  97704. }
  97705. target := &ret
  97706. if err := gensupport.DecodeResponse(target, res); err != nil {
  97707. return nil, err
  97708. }
  97709. return ret, nil
  97710. // {
  97711. // "description": "Returns the specified target VPN gateway. Gets a list of available target VPN gateways by making a list() request.",
  97712. // "httpMethod": "GET",
  97713. // "id": "compute.targetVpnGateways.get",
  97714. // "parameterOrder": [
  97715. // "project",
  97716. // "region",
  97717. // "targetVpnGateway"
  97718. // ],
  97719. // "parameters": {
  97720. // "project": {
  97721. // "description": "Project ID for this request.",
  97722. // "location": "path",
  97723. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  97724. // "required": true,
  97725. // "type": "string"
  97726. // },
  97727. // "region": {
  97728. // "description": "Name of the region for this request.",
  97729. // "location": "path",
  97730. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  97731. // "required": true,
  97732. // "type": "string"
  97733. // },
  97734. // "targetVpnGateway": {
  97735. // "description": "Name of the target VPN gateway to return.",
  97736. // "location": "path",
  97737. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  97738. // "required": true,
  97739. // "type": "string"
  97740. // }
  97741. // },
  97742. // "path": "{project}/regions/{region}/targetVpnGateways/{targetVpnGateway}",
  97743. // "response": {
  97744. // "$ref": "TargetVpnGateway"
  97745. // },
  97746. // "scopes": [
  97747. // "https://www.googleapis.com/auth/cloud-platform",
  97748. // "https://www.googleapis.com/auth/compute",
  97749. // "https://www.googleapis.com/auth/compute.readonly"
  97750. // ]
  97751. // }
  97752. }
  97753. // method id "compute.targetVpnGateways.insert":
  97754. type TargetVpnGatewaysInsertCall struct {
  97755. s *Service
  97756. project string
  97757. region string
  97758. targetvpngateway *TargetVpnGateway
  97759. urlParams_ gensupport.URLParams
  97760. ctx_ context.Context
  97761. header_ http.Header
  97762. }
  97763. // Insert: Creates a target VPN gateway in the specified project and
  97764. // region using the data included in the request.
  97765. func (r *TargetVpnGatewaysService) Insert(project string, region string, targetvpngateway *TargetVpnGateway) *TargetVpnGatewaysInsertCall {
  97766. c := &TargetVpnGatewaysInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  97767. c.project = project
  97768. c.region = region
  97769. c.targetvpngateway = targetvpngateway
  97770. return c
  97771. }
  97772. // RequestId sets the optional parameter "requestId": An optional
  97773. // request ID to identify requests. Specify a unique request ID so that
  97774. // if you must retry your request, the server will know to ignore the
  97775. // request if it has already been completed.
  97776. //
  97777. // For example, consider a situation where you make an initial request
  97778. // and the request times out. If you make the request again with the
  97779. // same request ID, the server can check if original operation with the
  97780. // same request ID was received, and if so, will ignore the second
  97781. // request. This prevents clients from accidentally creating duplicate
  97782. // commitments.
  97783. //
  97784. // The request ID must be a valid UUID with the exception that zero UUID
  97785. // is not supported (00000000-0000-0000-0000-000000000000).
  97786. func (c *TargetVpnGatewaysInsertCall) RequestId(requestId string) *TargetVpnGatewaysInsertCall {
  97787. c.urlParams_.Set("requestId", requestId)
  97788. return c
  97789. }
  97790. // Fields allows partial responses to be retrieved. See
  97791. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  97792. // for more information.
  97793. func (c *TargetVpnGatewaysInsertCall) Fields(s ...googleapi.Field) *TargetVpnGatewaysInsertCall {
  97794. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  97795. return c
  97796. }
  97797. // Context sets the context to be used in this call's Do method. Any
  97798. // pending HTTP request will be aborted if the provided context is
  97799. // canceled.
  97800. func (c *TargetVpnGatewaysInsertCall) Context(ctx context.Context) *TargetVpnGatewaysInsertCall {
  97801. c.ctx_ = ctx
  97802. return c
  97803. }
  97804. // Header returns an http.Header that can be modified by the caller to
  97805. // add HTTP headers to the request.
  97806. func (c *TargetVpnGatewaysInsertCall) Header() http.Header {
  97807. if c.header_ == nil {
  97808. c.header_ = make(http.Header)
  97809. }
  97810. return c.header_
  97811. }
  97812. func (c *TargetVpnGatewaysInsertCall) doRequest(alt string) (*http.Response, error) {
  97813. reqHeaders := make(http.Header)
  97814. for k, v := range c.header_ {
  97815. reqHeaders[k] = v
  97816. }
  97817. reqHeaders.Set("User-Agent", c.s.userAgent())
  97818. var body io.Reader = nil
  97819. body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetvpngateway)
  97820. if err != nil {
  97821. return nil, err
  97822. }
  97823. reqHeaders.Set("Content-Type", "application/json")
  97824. c.urlParams_.Set("alt", alt)
  97825. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/targetVpnGateways")
  97826. urls += "?" + c.urlParams_.Encode()
  97827. req, _ := http.NewRequest("POST", urls, body)
  97828. req.Header = reqHeaders
  97829. googleapi.Expand(req.URL, map[string]string{
  97830. "project": c.project,
  97831. "region": c.region,
  97832. })
  97833. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  97834. }
  97835. // Do executes the "compute.targetVpnGateways.insert" call.
  97836. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  97837. // status code is an error. Response headers are in either
  97838. // *Operation.ServerResponse.Header or (if a response was returned at
  97839. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  97840. // to check whether the returned error was because
  97841. // http.StatusNotModified was returned.
  97842. func (c *TargetVpnGatewaysInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  97843. gensupport.SetOptions(c.urlParams_, opts...)
  97844. res, err := c.doRequest("json")
  97845. if res != nil && res.StatusCode == http.StatusNotModified {
  97846. if res.Body != nil {
  97847. res.Body.Close()
  97848. }
  97849. return nil, &googleapi.Error{
  97850. Code: res.StatusCode,
  97851. Header: res.Header,
  97852. }
  97853. }
  97854. if err != nil {
  97855. return nil, err
  97856. }
  97857. defer googleapi.CloseBody(res)
  97858. if err := googleapi.CheckResponse(res); err != nil {
  97859. return nil, err
  97860. }
  97861. ret := &Operation{
  97862. ServerResponse: googleapi.ServerResponse{
  97863. Header: res.Header,
  97864. HTTPStatusCode: res.StatusCode,
  97865. },
  97866. }
  97867. target := &ret
  97868. if err := gensupport.DecodeResponse(target, res); err != nil {
  97869. return nil, err
  97870. }
  97871. return ret, nil
  97872. // {
  97873. // "description": "Creates a target VPN gateway in the specified project and region using the data included in the request.",
  97874. // "httpMethod": "POST",
  97875. // "id": "compute.targetVpnGateways.insert",
  97876. // "parameterOrder": [
  97877. // "project",
  97878. // "region"
  97879. // ],
  97880. // "parameters": {
  97881. // "project": {
  97882. // "description": "Project ID for this request.",
  97883. // "location": "path",
  97884. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  97885. // "required": true,
  97886. // "type": "string"
  97887. // },
  97888. // "region": {
  97889. // "description": "Name of the region for this request.",
  97890. // "location": "path",
  97891. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  97892. // "required": true,
  97893. // "type": "string"
  97894. // },
  97895. // "requestId": {
  97896. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  97897. // "location": "query",
  97898. // "type": "string"
  97899. // }
  97900. // },
  97901. // "path": "{project}/regions/{region}/targetVpnGateways",
  97902. // "request": {
  97903. // "$ref": "TargetVpnGateway"
  97904. // },
  97905. // "response": {
  97906. // "$ref": "Operation"
  97907. // },
  97908. // "scopes": [
  97909. // "https://www.googleapis.com/auth/cloud-platform",
  97910. // "https://www.googleapis.com/auth/compute"
  97911. // ]
  97912. // }
  97913. }
  97914. // method id "compute.targetVpnGateways.list":
  97915. type TargetVpnGatewaysListCall struct {
  97916. s *Service
  97917. project string
  97918. region string
  97919. urlParams_ gensupport.URLParams
  97920. ifNoneMatch_ string
  97921. ctx_ context.Context
  97922. header_ http.Header
  97923. }
  97924. // List: Retrieves a list of target VPN gateways available to the
  97925. // specified project and region.
  97926. func (r *TargetVpnGatewaysService) List(project string, region string) *TargetVpnGatewaysListCall {
  97927. c := &TargetVpnGatewaysListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  97928. c.project = project
  97929. c.region = region
  97930. return c
  97931. }
  97932. // Filter sets the optional parameter "filter": A filter expression that
  97933. // filters resources listed in the response. The expression must specify
  97934. // the field name, a comparison operator, and the value that you want to
  97935. // use for filtering. The value must be a string, a number, or a
  97936. // boolean. The comparison operator must be either =, !=, >, or <.
  97937. //
  97938. // For example, if you are filtering Compute Engine instances, you can
  97939. // exclude instances named example-instance by specifying name !=
  97940. // example-instance.
  97941. //
  97942. // You can also filter nested fields. For example, you could specify
  97943. // scheduling.automaticRestart = false to include instances only if they
  97944. // are not scheduled for automatic restarts. You can use filtering on
  97945. // nested fields to filter based on resource labels.
  97946. //
  97947. // To filter on multiple expressions, provide each separate expression
  97948. // within parentheses. For example, (scheduling.automaticRestart = true)
  97949. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  97950. // AND expression. However, you can include AND and OR expressions
  97951. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  97952. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  97953. // true).
  97954. func (c *TargetVpnGatewaysListCall) Filter(filter string) *TargetVpnGatewaysListCall {
  97955. c.urlParams_.Set("filter", filter)
  97956. return c
  97957. }
  97958. // MaxResults sets the optional parameter "maxResults": The maximum
  97959. // number of results per page that should be returned. If the number of
  97960. // available results is larger than maxResults, Compute Engine returns a
  97961. // nextPageToken that can be used to get the next page of results in
  97962. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  97963. // (Default: 500)
  97964. func (c *TargetVpnGatewaysListCall) MaxResults(maxResults int64) *TargetVpnGatewaysListCall {
  97965. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  97966. return c
  97967. }
  97968. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  97969. // a certain order. By default, results are returned in alphanumerical
  97970. // order based on the resource name.
  97971. //
  97972. // You can also sort results in descending order based on the creation
  97973. // timestamp using orderBy="creationTimestamp desc". This sorts results
  97974. // based on the creationTimestamp field in reverse chronological order
  97975. // (newest result first). Use this to sort resources like operations so
  97976. // that the newest operation is returned first.
  97977. //
  97978. // Currently, only sorting by name or creationTimestamp desc is
  97979. // supported.
  97980. func (c *TargetVpnGatewaysListCall) OrderBy(orderBy string) *TargetVpnGatewaysListCall {
  97981. c.urlParams_.Set("orderBy", orderBy)
  97982. return c
  97983. }
  97984. // PageToken sets the optional parameter "pageToken": Specifies a page
  97985. // token to use. Set pageToken to the nextPageToken returned by a
  97986. // previous list request to get the next page of results.
  97987. func (c *TargetVpnGatewaysListCall) PageToken(pageToken string) *TargetVpnGatewaysListCall {
  97988. c.urlParams_.Set("pageToken", pageToken)
  97989. return c
  97990. }
  97991. // Fields allows partial responses to be retrieved. See
  97992. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  97993. // for more information.
  97994. func (c *TargetVpnGatewaysListCall) Fields(s ...googleapi.Field) *TargetVpnGatewaysListCall {
  97995. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  97996. return c
  97997. }
  97998. // IfNoneMatch sets the optional parameter which makes the operation
  97999. // fail if the object's ETag matches the given value. This is useful for
  98000. // getting updates only after the object has changed since the last
  98001. // request. Use googleapi.IsNotModified to check whether the response
  98002. // error from Do is the result of In-None-Match.
  98003. func (c *TargetVpnGatewaysListCall) IfNoneMatch(entityTag string) *TargetVpnGatewaysListCall {
  98004. c.ifNoneMatch_ = entityTag
  98005. return c
  98006. }
  98007. // Context sets the context to be used in this call's Do method. Any
  98008. // pending HTTP request will be aborted if the provided context is
  98009. // canceled.
  98010. func (c *TargetVpnGatewaysListCall) Context(ctx context.Context) *TargetVpnGatewaysListCall {
  98011. c.ctx_ = ctx
  98012. return c
  98013. }
  98014. // Header returns an http.Header that can be modified by the caller to
  98015. // add HTTP headers to the request.
  98016. func (c *TargetVpnGatewaysListCall) Header() http.Header {
  98017. if c.header_ == nil {
  98018. c.header_ = make(http.Header)
  98019. }
  98020. return c.header_
  98021. }
  98022. func (c *TargetVpnGatewaysListCall) doRequest(alt string) (*http.Response, error) {
  98023. reqHeaders := make(http.Header)
  98024. for k, v := range c.header_ {
  98025. reqHeaders[k] = v
  98026. }
  98027. reqHeaders.Set("User-Agent", c.s.userAgent())
  98028. if c.ifNoneMatch_ != "" {
  98029. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  98030. }
  98031. var body io.Reader = nil
  98032. c.urlParams_.Set("alt", alt)
  98033. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/targetVpnGateways")
  98034. urls += "?" + c.urlParams_.Encode()
  98035. req, _ := http.NewRequest("GET", urls, body)
  98036. req.Header = reqHeaders
  98037. googleapi.Expand(req.URL, map[string]string{
  98038. "project": c.project,
  98039. "region": c.region,
  98040. })
  98041. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  98042. }
  98043. // Do executes the "compute.targetVpnGateways.list" call.
  98044. // Exactly one of *TargetVpnGatewayList or error will be non-nil. Any
  98045. // non-2xx status code is an error. Response headers are in either
  98046. // *TargetVpnGatewayList.ServerResponse.Header or (if a response was
  98047. // returned at all) in error.(*googleapi.Error).Header. Use
  98048. // googleapi.IsNotModified to check whether the returned error was
  98049. // because http.StatusNotModified was returned.
  98050. func (c *TargetVpnGatewaysListCall) Do(opts ...googleapi.CallOption) (*TargetVpnGatewayList, error) {
  98051. gensupport.SetOptions(c.urlParams_, opts...)
  98052. res, err := c.doRequest("json")
  98053. if res != nil && res.StatusCode == http.StatusNotModified {
  98054. if res.Body != nil {
  98055. res.Body.Close()
  98056. }
  98057. return nil, &googleapi.Error{
  98058. Code: res.StatusCode,
  98059. Header: res.Header,
  98060. }
  98061. }
  98062. if err != nil {
  98063. return nil, err
  98064. }
  98065. defer googleapi.CloseBody(res)
  98066. if err := googleapi.CheckResponse(res); err != nil {
  98067. return nil, err
  98068. }
  98069. ret := &TargetVpnGatewayList{
  98070. ServerResponse: googleapi.ServerResponse{
  98071. Header: res.Header,
  98072. HTTPStatusCode: res.StatusCode,
  98073. },
  98074. }
  98075. target := &ret
  98076. if err := gensupport.DecodeResponse(target, res); err != nil {
  98077. return nil, err
  98078. }
  98079. return ret, nil
  98080. // {
  98081. // "description": "Retrieves a list of target VPN gateways available to the specified project and region.",
  98082. // "httpMethod": "GET",
  98083. // "id": "compute.targetVpnGateways.list",
  98084. // "parameterOrder": [
  98085. // "project",
  98086. // "region"
  98087. // ],
  98088. // "parameters": {
  98089. // "filter": {
  98090. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  98091. // "location": "query",
  98092. // "type": "string"
  98093. // },
  98094. // "maxResults": {
  98095. // "default": "500",
  98096. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  98097. // "format": "uint32",
  98098. // "location": "query",
  98099. // "minimum": "0",
  98100. // "type": "integer"
  98101. // },
  98102. // "orderBy": {
  98103. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  98104. // "location": "query",
  98105. // "type": "string"
  98106. // },
  98107. // "pageToken": {
  98108. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  98109. // "location": "query",
  98110. // "type": "string"
  98111. // },
  98112. // "project": {
  98113. // "description": "Project ID for this request.",
  98114. // "location": "path",
  98115. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  98116. // "required": true,
  98117. // "type": "string"
  98118. // },
  98119. // "region": {
  98120. // "description": "Name of the region for this request.",
  98121. // "location": "path",
  98122. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  98123. // "required": true,
  98124. // "type": "string"
  98125. // }
  98126. // },
  98127. // "path": "{project}/regions/{region}/targetVpnGateways",
  98128. // "response": {
  98129. // "$ref": "TargetVpnGatewayList"
  98130. // },
  98131. // "scopes": [
  98132. // "https://www.googleapis.com/auth/cloud-platform",
  98133. // "https://www.googleapis.com/auth/compute",
  98134. // "https://www.googleapis.com/auth/compute.readonly"
  98135. // ]
  98136. // }
  98137. }
  98138. // Pages invokes f for each page of results.
  98139. // A non-nil error returned from f will halt the iteration.
  98140. // The provided context supersedes any context provided to the Context method.
  98141. func (c *TargetVpnGatewaysListCall) Pages(ctx context.Context, f func(*TargetVpnGatewayList) error) error {
  98142. c.ctx_ = ctx
  98143. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  98144. for {
  98145. x, err := c.Do()
  98146. if err != nil {
  98147. return err
  98148. }
  98149. if err := f(x); err != nil {
  98150. return err
  98151. }
  98152. if x.NextPageToken == "" {
  98153. return nil
  98154. }
  98155. c.PageToken(x.NextPageToken)
  98156. }
  98157. }
  98158. // method id "compute.targetVpnGateways.setLabels":
  98159. type TargetVpnGatewaysSetLabelsCall struct {
  98160. s *Service
  98161. project string
  98162. region string
  98163. resource string
  98164. regionsetlabelsrequest *RegionSetLabelsRequest
  98165. urlParams_ gensupport.URLParams
  98166. ctx_ context.Context
  98167. header_ http.Header
  98168. }
  98169. // SetLabels: Sets the labels on a TargetVpnGateway. To learn more about
  98170. // labels, read the Labeling Resources documentation.
  98171. func (r *TargetVpnGatewaysService) SetLabels(project string, region string, resource string, regionsetlabelsrequest *RegionSetLabelsRequest) *TargetVpnGatewaysSetLabelsCall {
  98172. c := &TargetVpnGatewaysSetLabelsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  98173. c.project = project
  98174. c.region = region
  98175. c.resource = resource
  98176. c.regionsetlabelsrequest = regionsetlabelsrequest
  98177. return c
  98178. }
  98179. // RequestId sets the optional parameter "requestId": An optional
  98180. // request ID to identify requests. Specify a unique request ID so that
  98181. // if you must retry your request, the server will know to ignore the
  98182. // request if it has already been completed.
  98183. //
  98184. // For example, consider a situation where you make an initial request
  98185. // and the request times out. If you make the request again with the
  98186. // same request ID, the server can check if original operation with the
  98187. // same request ID was received, and if so, will ignore the second
  98188. // request. This prevents clients from accidentally creating duplicate
  98189. // commitments.
  98190. //
  98191. // The request ID must be a valid UUID with the exception that zero UUID
  98192. // is not supported (00000000-0000-0000-0000-000000000000).
  98193. func (c *TargetVpnGatewaysSetLabelsCall) RequestId(requestId string) *TargetVpnGatewaysSetLabelsCall {
  98194. c.urlParams_.Set("requestId", requestId)
  98195. return c
  98196. }
  98197. // Fields allows partial responses to be retrieved. See
  98198. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  98199. // for more information.
  98200. func (c *TargetVpnGatewaysSetLabelsCall) Fields(s ...googleapi.Field) *TargetVpnGatewaysSetLabelsCall {
  98201. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  98202. return c
  98203. }
  98204. // Context sets the context to be used in this call's Do method. Any
  98205. // pending HTTP request will be aborted if the provided context is
  98206. // canceled.
  98207. func (c *TargetVpnGatewaysSetLabelsCall) Context(ctx context.Context) *TargetVpnGatewaysSetLabelsCall {
  98208. c.ctx_ = ctx
  98209. return c
  98210. }
  98211. // Header returns an http.Header that can be modified by the caller to
  98212. // add HTTP headers to the request.
  98213. func (c *TargetVpnGatewaysSetLabelsCall) Header() http.Header {
  98214. if c.header_ == nil {
  98215. c.header_ = make(http.Header)
  98216. }
  98217. return c.header_
  98218. }
  98219. func (c *TargetVpnGatewaysSetLabelsCall) doRequest(alt string) (*http.Response, error) {
  98220. reqHeaders := make(http.Header)
  98221. for k, v := range c.header_ {
  98222. reqHeaders[k] = v
  98223. }
  98224. reqHeaders.Set("User-Agent", c.s.userAgent())
  98225. var body io.Reader = nil
  98226. body, err := googleapi.WithoutDataWrapper.JSONReader(c.regionsetlabelsrequest)
  98227. if err != nil {
  98228. return nil, err
  98229. }
  98230. reqHeaders.Set("Content-Type", "application/json")
  98231. c.urlParams_.Set("alt", alt)
  98232. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/targetVpnGateways/{resource}/setLabels")
  98233. urls += "?" + c.urlParams_.Encode()
  98234. req, _ := http.NewRequest("POST", urls, body)
  98235. req.Header = reqHeaders
  98236. googleapi.Expand(req.URL, map[string]string{
  98237. "project": c.project,
  98238. "region": c.region,
  98239. "resource": c.resource,
  98240. })
  98241. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  98242. }
  98243. // Do executes the "compute.targetVpnGateways.setLabels" call.
  98244. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  98245. // status code is an error. Response headers are in either
  98246. // *Operation.ServerResponse.Header or (if a response was returned at
  98247. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  98248. // to check whether the returned error was because
  98249. // http.StatusNotModified was returned.
  98250. func (c *TargetVpnGatewaysSetLabelsCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  98251. gensupport.SetOptions(c.urlParams_, opts...)
  98252. res, err := c.doRequest("json")
  98253. if res != nil && res.StatusCode == http.StatusNotModified {
  98254. if res.Body != nil {
  98255. res.Body.Close()
  98256. }
  98257. return nil, &googleapi.Error{
  98258. Code: res.StatusCode,
  98259. Header: res.Header,
  98260. }
  98261. }
  98262. if err != nil {
  98263. return nil, err
  98264. }
  98265. defer googleapi.CloseBody(res)
  98266. if err := googleapi.CheckResponse(res); err != nil {
  98267. return nil, err
  98268. }
  98269. ret := &Operation{
  98270. ServerResponse: googleapi.ServerResponse{
  98271. Header: res.Header,
  98272. HTTPStatusCode: res.StatusCode,
  98273. },
  98274. }
  98275. target := &ret
  98276. if err := gensupport.DecodeResponse(target, res); err != nil {
  98277. return nil, err
  98278. }
  98279. return ret, nil
  98280. // {
  98281. // "description": "Sets the labels on a TargetVpnGateway. To learn more about labels, read the Labeling Resources documentation.",
  98282. // "httpMethod": "POST",
  98283. // "id": "compute.targetVpnGateways.setLabels",
  98284. // "parameterOrder": [
  98285. // "project",
  98286. // "region",
  98287. // "resource"
  98288. // ],
  98289. // "parameters": {
  98290. // "project": {
  98291. // "description": "Project ID for this request.",
  98292. // "location": "path",
  98293. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  98294. // "required": true,
  98295. // "type": "string"
  98296. // },
  98297. // "region": {
  98298. // "description": "The region for this request.",
  98299. // "location": "path",
  98300. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  98301. // "required": true,
  98302. // "type": "string"
  98303. // },
  98304. // "requestId": {
  98305. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  98306. // "location": "query",
  98307. // "type": "string"
  98308. // },
  98309. // "resource": {
  98310. // "description": "Name of the resource for this request.",
  98311. // "location": "path",
  98312. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  98313. // "required": true,
  98314. // "type": "string"
  98315. // }
  98316. // },
  98317. // "path": "{project}/regions/{region}/targetVpnGateways/{resource}/setLabels",
  98318. // "request": {
  98319. // "$ref": "RegionSetLabelsRequest"
  98320. // },
  98321. // "response": {
  98322. // "$ref": "Operation"
  98323. // },
  98324. // "scopes": [
  98325. // "https://www.googleapis.com/auth/cloud-platform",
  98326. // "https://www.googleapis.com/auth/compute"
  98327. // ]
  98328. // }
  98329. }
  98330. // method id "compute.targetVpnGateways.testIamPermissions":
  98331. type TargetVpnGatewaysTestIamPermissionsCall struct {
  98332. s *Service
  98333. project string
  98334. region string
  98335. resource string
  98336. testpermissionsrequest *TestPermissionsRequest
  98337. urlParams_ gensupport.URLParams
  98338. ctx_ context.Context
  98339. header_ http.Header
  98340. }
  98341. // TestIamPermissions: Returns permissions that a caller has on the
  98342. // specified resource.
  98343. func (r *TargetVpnGatewaysService) TestIamPermissions(project string, region string, resource string, testpermissionsrequest *TestPermissionsRequest) *TargetVpnGatewaysTestIamPermissionsCall {
  98344. c := &TargetVpnGatewaysTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  98345. c.project = project
  98346. c.region = region
  98347. c.resource = resource
  98348. c.testpermissionsrequest = testpermissionsrequest
  98349. return c
  98350. }
  98351. // Fields allows partial responses to be retrieved. See
  98352. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  98353. // for more information.
  98354. func (c *TargetVpnGatewaysTestIamPermissionsCall) Fields(s ...googleapi.Field) *TargetVpnGatewaysTestIamPermissionsCall {
  98355. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  98356. return c
  98357. }
  98358. // Context sets the context to be used in this call's Do method. Any
  98359. // pending HTTP request will be aborted if the provided context is
  98360. // canceled.
  98361. func (c *TargetVpnGatewaysTestIamPermissionsCall) Context(ctx context.Context) *TargetVpnGatewaysTestIamPermissionsCall {
  98362. c.ctx_ = ctx
  98363. return c
  98364. }
  98365. // Header returns an http.Header that can be modified by the caller to
  98366. // add HTTP headers to the request.
  98367. func (c *TargetVpnGatewaysTestIamPermissionsCall) Header() http.Header {
  98368. if c.header_ == nil {
  98369. c.header_ = make(http.Header)
  98370. }
  98371. return c.header_
  98372. }
  98373. func (c *TargetVpnGatewaysTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  98374. reqHeaders := make(http.Header)
  98375. for k, v := range c.header_ {
  98376. reqHeaders[k] = v
  98377. }
  98378. reqHeaders.Set("User-Agent", c.s.userAgent())
  98379. var body io.Reader = nil
  98380. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  98381. if err != nil {
  98382. return nil, err
  98383. }
  98384. reqHeaders.Set("Content-Type", "application/json")
  98385. c.urlParams_.Set("alt", alt)
  98386. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/targetVpnGateways/{resource}/testIamPermissions")
  98387. urls += "?" + c.urlParams_.Encode()
  98388. req, _ := http.NewRequest("POST", urls, body)
  98389. req.Header = reqHeaders
  98390. googleapi.Expand(req.URL, map[string]string{
  98391. "project": c.project,
  98392. "region": c.region,
  98393. "resource": c.resource,
  98394. })
  98395. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  98396. }
  98397. // Do executes the "compute.targetVpnGateways.testIamPermissions" call.
  98398. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  98399. // non-2xx status code is an error. Response headers are in either
  98400. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  98401. // returned at all) in error.(*googleapi.Error).Header. Use
  98402. // googleapi.IsNotModified to check whether the returned error was
  98403. // because http.StatusNotModified was returned.
  98404. func (c *TargetVpnGatewaysTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  98405. gensupport.SetOptions(c.urlParams_, opts...)
  98406. res, err := c.doRequest("json")
  98407. if res != nil && res.StatusCode == http.StatusNotModified {
  98408. if res.Body != nil {
  98409. res.Body.Close()
  98410. }
  98411. return nil, &googleapi.Error{
  98412. Code: res.StatusCode,
  98413. Header: res.Header,
  98414. }
  98415. }
  98416. if err != nil {
  98417. return nil, err
  98418. }
  98419. defer googleapi.CloseBody(res)
  98420. if err := googleapi.CheckResponse(res); err != nil {
  98421. return nil, err
  98422. }
  98423. ret := &TestPermissionsResponse{
  98424. ServerResponse: googleapi.ServerResponse{
  98425. Header: res.Header,
  98426. HTTPStatusCode: res.StatusCode,
  98427. },
  98428. }
  98429. target := &ret
  98430. if err := gensupport.DecodeResponse(target, res); err != nil {
  98431. return nil, err
  98432. }
  98433. return ret, nil
  98434. // {
  98435. // "description": "Returns permissions that a caller has on the specified resource.",
  98436. // "httpMethod": "POST",
  98437. // "id": "compute.targetVpnGateways.testIamPermissions",
  98438. // "parameterOrder": [
  98439. // "project",
  98440. // "region",
  98441. // "resource"
  98442. // ],
  98443. // "parameters": {
  98444. // "project": {
  98445. // "description": "Project ID for this request.",
  98446. // "location": "path",
  98447. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  98448. // "required": true,
  98449. // "type": "string"
  98450. // },
  98451. // "region": {
  98452. // "description": "The name of the region for this request.",
  98453. // "location": "path",
  98454. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  98455. // "required": true,
  98456. // "type": "string"
  98457. // },
  98458. // "resource": {
  98459. // "description": "Name of the resource for this request.",
  98460. // "location": "path",
  98461. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  98462. // "required": true,
  98463. // "type": "string"
  98464. // }
  98465. // },
  98466. // "path": "{project}/regions/{region}/targetVpnGateways/{resource}/testIamPermissions",
  98467. // "request": {
  98468. // "$ref": "TestPermissionsRequest"
  98469. // },
  98470. // "response": {
  98471. // "$ref": "TestPermissionsResponse"
  98472. // },
  98473. // "scopes": [
  98474. // "https://www.googleapis.com/auth/cloud-platform",
  98475. // "https://www.googleapis.com/auth/compute",
  98476. // "https://www.googleapis.com/auth/compute.readonly"
  98477. // ]
  98478. // }
  98479. }
  98480. // method id "compute.urlMaps.delete":
  98481. type UrlMapsDeleteCall struct {
  98482. s *Service
  98483. project string
  98484. urlMap string
  98485. urlParams_ gensupport.URLParams
  98486. ctx_ context.Context
  98487. header_ http.Header
  98488. }
  98489. // Delete: Deletes the specified UrlMap resource.
  98490. // For details, see https://cloud.google.com/compute/docs/reference/latest/urlMaps/delete
  98491. func (r *UrlMapsService) Delete(project string, urlMap string) *UrlMapsDeleteCall {
  98492. c := &UrlMapsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  98493. c.project = project
  98494. c.urlMap = urlMap
  98495. return c
  98496. }
  98497. // RequestId sets the optional parameter "requestId": An optional
  98498. // request ID to identify requests. Specify a unique request ID so that
  98499. // if you must retry your request, the server will know to ignore the
  98500. // request if it has already been completed.
  98501. //
  98502. // For example, consider a situation where you make an initial request
  98503. // and the request times out. If you make the request again with the
  98504. // same request ID, the server can check if original operation with the
  98505. // same request ID was received, and if so, will ignore the second
  98506. // request. This prevents clients from accidentally creating duplicate
  98507. // commitments.
  98508. //
  98509. // The request ID must be a valid UUID with the exception that zero UUID
  98510. // is not supported (00000000-0000-0000-0000-000000000000).
  98511. func (c *UrlMapsDeleteCall) RequestId(requestId string) *UrlMapsDeleteCall {
  98512. c.urlParams_.Set("requestId", requestId)
  98513. return c
  98514. }
  98515. // Fields allows partial responses to be retrieved. See
  98516. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  98517. // for more information.
  98518. func (c *UrlMapsDeleteCall) Fields(s ...googleapi.Field) *UrlMapsDeleteCall {
  98519. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  98520. return c
  98521. }
  98522. // Context sets the context to be used in this call's Do method. Any
  98523. // pending HTTP request will be aborted if the provided context is
  98524. // canceled.
  98525. func (c *UrlMapsDeleteCall) Context(ctx context.Context) *UrlMapsDeleteCall {
  98526. c.ctx_ = ctx
  98527. return c
  98528. }
  98529. // Header returns an http.Header that can be modified by the caller to
  98530. // add HTTP headers to the request.
  98531. func (c *UrlMapsDeleteCall) Header() http.Header {
  98532. if c.header_ == nil {
  98533. c.header_ = make(http.Header)
  98534. }
  98535. return c.header_
  98536. }
  98537. func (c *UrlMapsDeleteCall) doRequest(alt string) (*http.Response, error) {
  98538. reqHeaders := make(http.Header)
  98539. for k, v := range c.header_ {
  98540. reqHeaders[k] = v
  98541. }
  98542. reqHeaders.Set("User-Agent", c.s.userAgent())
  98543. var body io.Reader = nil
  98544. c.urlParams_.Set("alt", alt)
  98545. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/urlMaps/{urlMap}")
  98546. urls += "?" + c.urlParams_.Encode()
  98547. req, _ := http.NewRequest("DELETE", urls, body)
  98548. req.Header = reqHeaders
  98549. googleapi.Expand(req.URL, map[string]string{
  98550. "project": c.project,
  98551. "urlMap": c.urlMap,
  98552. })
  98553. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  98554. }
  98555. // Do executes the "compute.urlMaps.delete" call.
  98556. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  98557. // status code is an error. Response headers are in either
  98558. // *Operation.ServerResponse.Header or (if a response was returned at
  98559. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  98560. // to check whether the returned error was because
  98561. // http.StatusNotModified was returned.
  98562. func (c *UrlMapsDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  98563. gensupport.SetOptions(c.urlParams_, opts...)
  98564. res, err := c.doRequest("json")
  98565. if res != nil && res.StatusCode == http.StatusNotModified {
  98566. if res.Body != nil {
  98567. res.Body.Close()
  98568. }
  98569. return nil, &googleapi.Error{
  98570. Code: res.StatusCode,
  98571. Header: res.Header,
  98572. }
  98573. }
  98574. if err != nil {
  98575. return nil, err
  98576. }
  98577. defer googleapi.CloseBody(res)
  98578. if err := googleapi.CheckResponse(res); err != nil {
  98579. return nil, err
  98580. }
  98581. ret := &Operation{
  98582. ServerResponse: googleapi.ServerResponse{
  98583. Header: res.Header,
  98584. HTTPStatusCode: res.StatusCode,
  98585. },
  98586. }
  98587. target := &ret
  98588. if err := gensupport.DecodeResponse(target, res); err != nil {
  98589. return nil, err
  98590. }
  98591. return ret, nil
  98592. // {
  98593. // "description": "Deletes the specified UrlMap resource.",
  98594. // "httpMethod": "DELETE",
  98595. // "id": "compute.urlMaps.delete",
  98596. // "parameterOrder": [
  98597. // "project",
  98598. // "urlMap"
  98599. // ],
  98600. // "parameters": {
  98601. // "project": {
  98602. // "description": "Project ID for this request.",
  98603. // "location": "path",
  98604. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  98605. // "required": true,
  98606. // "type": "string"
  98607. // },
  98608. // "requestId": {
  98609. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  98610. // "location": "query",
  98611. // "type": "string"
  98612. // },
  98613. // "urlMap": {
  98614. // "description": "Name of the UrlMap resource to delete.",
  98615. // "location": "path",
  98616. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  98617. // "required": true,
  98618. // "type": "string"
  98619. // }
  98620. // },
  98621. // "path": "{project}/global/urlMaps/{urlMap}",
  98622. // "response": {
  98623. // "$ref": "Operation"
  98624. // },
  98625. // "scopes": [
  98626. // "https://www.googleapis.com/auth/cloud-platform",
  98627. // "https://www.googleapis.com/auth/compute"
  98628. // ]
  98629. // }
  98630. }
  98631. // method id "compute.urlMaps.get":
  98632. type UrlMapsGetCall struct {
  98633. s *Service
  98634. project string
  98635. urlMap string
  98636. urlParams_ gensupport.URLParams
  98637. ifNoneMatch_ string
  98638. ctx_ context.Context
  98639. header_ http.Header
  98640. }
  98641. // Get: Returns the specified UrlMap resource. Gets a list of available
  98642. // URL maps by making a list() request.
  98643. // For details, see https://cloud.google.com/compute/docs/reference/latest/urlMaps/get
  98644. func (r *UrlMapsService) Get(project string, urlMap string) *UrlMapsGetCall {
  98645. c := &UrlMapsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  98646. c.project = project
  98647. c.urlMap = urlMap
  98648. return c
  98649. }
  98650. // Fields allows partial responses to be retrieved. See
  98651. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  98652. // for more information.
  98653. func (c *UrlMapsGetCall) Fields(s ...googleapi.Field) *UrlMapsGetCall {
  98654. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  98655. return c
  98656. }
  98657. // IfNoneMatch sets the optional parameter which makes the operation
  98658. // fail if the object's ETag matches the given value. This is useful for
  98659. // getting updates only after the object has changed since the last
  98660. // request. Use googleapi.IsNotModified to check whether the response
  98661. // error from Do is the result of In-None-Match.
  98662. func (c *UrlMapsGetCall) IfNoneMatch(entityTag string) *UrlMapsGetCall {
  98663. c.ifNoneMatch_ = entityTag
  98664. return c
  98665. }
  98666. // Context sets the context to be used in this call's Do method. Any
  98667. // pending HTTP request will be aborted if the provided context is
  98668. // canceled.
  98669. func (c *UrlMapsGetCall) Context(ctx context.Context) *UrlMapsGetCall {
  98670. c.ctx_ = ctx
  98671. return c
  98672. }
  98673. // Header returns an http.Header that can be modified by the caller to
  98674. // add HTTP headers to the request.
  98675. func (c *UrlMapsGetCall) Header() http.Header {
  98676. if c.header_ == nil {
  98677. c.header_ = make(http.Header)
  98678. }
  98679. return c.header_
  98680. }
  98681. func (c *UrlMapsGetCall) doRequest(alt string) (*http.Response, error) {
  98682. reqHeaders := make(http.Header)
  98683. for k, v := range c.header_ {
  98684. reqHeaders[k] = v
  98685. }
  98686. reqHeaders.Set("User-Agent", c.s.userAgent())
  98687. if c.ifNoneMatch_ != "" {
  98688. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  98689. }
  98690. var body io.Reader = nil
  98691. c.urlParams_.Set("alt", alt)
  98692. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/urlMaps/{urlMap}")
  98693. urls += "?" + c.urlParams_.Encode()
  98694. req, _ := http.NewRequest("GET", urls, body)
  98695. req.Header = reqHeaders
  98696. googleapi.Expand(req.URL, map[string]string{
  98697. "project": c.project,
  98698. "urlMap": c.urlMap,
  98699. })
  98700. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  98701. }
  98702. // Do executes the "compute.urlMaps.get" call.
  98703. // Exactly one of *UrlMap or error will be non-nil. Any non-2xx status
  98704. // code is an error. Response headers are in either
  98705. // *UrlMap.ServerResponse.Header or (if a response was returned at all)
  98706. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  98707. // check whether the returned error was because http.StatusNotModified
  98708. // was returned.
  98709. func (c *UrlMapsGetCall) Do(opts ...googleapi.CallOption) (*UrlMap, error) {
  98710. gensupport.SetOptions(c.urlParams_, opts...)
  98711. res, err := c.doRequest("json")
  98712. if res != nil && res.StatusCode == http.StatusNotModified {
  98713. if res.Body != nil {
  98714. res.Body.Close()
  98715. }
  98716. return nil, &googleapi.Error{
  98717. Code: res.StatusCode,
  98718. Header: res.Header,
  98719. }
  98720. }
  98721. if err != nil {
  98722. return nil, err
  98723. }
  98724. defer googleapi.CloseBody(res)
  98725. if err := googleapi.CheckResponse(res); err != nil {
  98726. return nil, err
  98727. }
  98728. ret := &UrlMap{
  98729. ServerResponse: googleapi.ServerResponse{
  98730. Header: res.Header,
  98731. HTTPStatusCode: res.StatusCode,
  98732. },
  98733. }
  98734. target := &ret
  98735. if err := gensupport.DecodeResponse(target, res); err != nil {
  98736. return nil, err
  98737. }
  98738. return ret, nil
  98739. // {
  98740. // "description": "Returns the specified UrlMap resource. Gets a list of available URL maps by making a list() request.",
  98741. // "httpMethod": "GET",
  98742. // "id": "compute.urlMaps.get",
  98743. // "parameterOrder": [
  98744. // "project",
  98745. // "urlMap"
  98746. // ],
  98747. // "parameters": {
  98748. // "project": {
  98749. // "description": "Project ID for this request.",
  98750. // "location": "path",
  98751. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  98752. // "required": true,
  98753. // "type": "string"
  98754. // },
  98755. // "urlMap": {
  98756. // "description": "Name of the UrlMap resource to return.",
  98757. // "location": "path",
  98758. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  98759. // "required": true,
  98760. // "type": "string"
  98761. // }
  98762. // },
  98763. // "path": "{project}/global/urlMaps/{urlMap}",
  98764. // "response": {
  98765. // "$ref": "UrlMap"
  98766. // },
  98767. // "scopes": [
  98768. // "https://www.googleapis.com/auth/cloud-platform",
  98769. // "https://www.googleapis.com/auth/compute",
  98770. // "https://www.googleapis.com/auth/compute.readonly"
  98771. // ]
  98772. // }
  98773. }
  98774. // method id "compute.urlMaps.insert":
  98775. type UrlMapsInsertCall struct {
  98776. s *Service
  98777. project string
  98778. urlmap *UrlMap
  98779. urlParams_ gensupport.URLParams
  98780. ctx_ context.Context
  98781. header_ http.Header
  98782. }
  98783. // Insert: Creates a UrlMap resource in the specified project using the
  98784. // data included in the request.
  98785. // For details, see https://cloud.google.com/compute/docs/reference/latest/urlMaps/insert
  98786. func (r *UrlMapsService) Insert(project string, urlmap *UrlMap) *UrlMapsInsertCall {
  98787. c := &UrlMapsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  98788. c.project = project
  98789. c.urlmap = urlmap
  98790. return c
  98791. }
  98792. // RequestId sets the optional parameter "requestId": An optional
  98793. // request ID to identify requests. Specify a unique request ID so that
  98794. // if you must retry your request, the server will know to ignore the
  98795. // request if it has already been completed.
  98796. //
  98797. // For example, consider a situation where you make an initial request
  98798. // and the request times out. If you make the request again with the
  98799. // same request ID, the server can check if original operation with the
  98800. // same request ID was received, and if so, will ignore the second
  98801. // request. This prevents clients from accidentally creating duplicate
  98802. // commitments.
  98803. //
  98804. // The request ID must be a valid UUID with the exception that zero UUID
  98805. // is not supported (00000000-0000-0000-0000-000000000000).
  98806. func (c *UrlMapsInsertCall) RequestId(requestId string) *UrlMapsInsertCall {
  98807. c.urlParams_.Set("requestId", requestId)
  98808. return c
  98809. }
  98810. // Fields allows partial responses to be retrieved. See
  98811. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  98812. // for more information.
  98813. func (c *UrlMapsInsertCall) Fields(s ...googleapi.Field) *UrlMapsInsertCall {
  98814. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  98815. return c
  98816. }
  98817. // Context sets the context to be used in this call's Do method. Any
  98818. // pending HTTP request will be aborted if the provided context is
  98819. // canceled.
  98820. func (c *UrlMapsInsertCall) Context(ctx context.Context) *UrlMapsInsertCall {
  98821. c.ctx_ = ctx
  98822. return c
  98823. }
  98824. // Header returns an http.Header that can be modified by the caller to
  98825. // add HTTP headers to the request.
  98826. func (c *UrlMapsInsertCall) Header() http.Header {
  98827. if c.header_ == nil {
  98828. c.header_ = make(http.Header)
  98829. }
  98830. return c.header_
  98831. }
  98832. func (c *UrlMapsInsertCall) doRequest(alt string) (*http.Response, error) {
  98833. reqHeaders := make(http.Header)
  98834. for k, v := range c.header_ {
  98835. reqHeaders[k] = v
  98836. }
  98837. reqHeaders.Set("User-Agent", c.s.userAgent())
  98838. var body io.Reader = nil
  98839. body, err := googleapi.WithoutDataWrapper.JSONReader(c.urlmap)
  98840. if err != nil {
  98841. return nil, err
  98842. }
  98843. reqHeaders.Set("Content-Type", "application/json")
  98844. c.urlParams_.Set("alt", alt)
  98845. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/urlMaps")
  98846. urls += "?" + c.urlParams_.Encode()
  98847. req, _ := http.NewRequest("POST", urls, body)
  98848. req.Header = reqHeaders
  98849. googleapi.Expand(req.URL, map[string]string{
  98850. "project": c.project,
  98851. })
  98852. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  98853. }
  98854. // Do executes the "compute.urlMaps.insert" call.
  98855. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  98856. // status code is an error. Response headers are in either
  98857. // *Operation.ServerResponse.Header or (if a response was returned at
  98858. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  98859. // to check whether the returned error was because
  98860. // http.StatusNotModified was returned.
  98861. func (c *UrlMapsInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  98862. gensupport.SetOptions(c.urlParams_, opts...)
  98863. res, err := c.doRequest("json")
  98864. if res != nil && res.StatusCode == http.StatusNotModified {
  98865. if res.Body != nil {
  98866. res.Body.Close()
  98867. }
  98868. return nil, &googleapi.Error{
  98869. Code: res.StatusCode,
  98870. Header: res.Header,
  98871. }
  98872. }
  98873. if err != nil {
  98874. return nil, err
  98875. }
  98876. defer googleapi.CloseBody(res)
  98877. if err := googleapi.CheckResponse(res); err != nil {
  98878. return nil, err
  98879. }
  98880. ret := &Operation{
  98881. ServerResponse: googleapi.ServerResponse{
  98882. Header: res.Header,
  98883. HTTPStatusCode: res.StatusCode,
  98884. },
  98885. }
  98886. target := &ret
  98887. if err := gensupport.DecodeResponse(target, res); err != nil {
  98888. return nil, err
  98889. }
  98890. return ret, nil
  98891. // {
  98892. // "description": "Creates a UrlMap resource in the specified project using the data included in the request.",
  98893. // "httpMethod": "POST",
  98894. // "id": "compute.urlMaps.insert",
  98895. // "parameterOrder": [
  98896. // "project"
  98897. // ],
  98898. // "parameters": {
  98899. // "project": {
  98900. // "description": "Project ID for this request.",
  98901. // "location": "path",
  98902. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  98903. // "required": true,
  98904. // "type": "string"
  98905. // },
  98906. // "requestId": {
  98907. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  98908. // "location": "query",
  98909. // "type": "string"
  98910. // }
  98911. // },
  98912. // "path": "{project}/global/urlMaps",
  98913. // "request": {
  98914. // "$ref": "UrlMap"
  98915. // },
  98916. // "response": {
  98917. // "$ref": "Operation"
  98918. // },
  98919. // "scopes": [
  98920. // "https://www.googleapis.com/auth/cloud-platform",
  98921. // "https://www.googleapis.com/auth/compute"
  98922. // ]
  98923. // }
  98924. }
  98925. // method id "compute.urlMaps.invalidateCache":
  98926. type UrlMapsInvalidateCacheCall struct {
  98927. s *Service
  98928. project string
  98929. urlMap string
  98930. cacheinvalidationrule *CacheInvalidationRule
  98931. urlParams_ gensupport.URLParams
  98932. ctx_ context.Context
  98933. header_ http.Header
  98934. }
  98935. // InvalidateCache: Initiates a cache invalidation operation,
  98936. // invalidating the specified path, scoped to the specified UrlMap.
  98937. func (r *UrlMapsService) InvalidateCache(project string, urlMap string, cacheinvalidationrule *CacheInvalidationRule) *UrlMapsInvalidateCacheCall {
  98938. c := &UrlMapsInvalidateCacheCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  98939. c.project = project
  98940. c.urlMap = urlMap
  98941. c.cacheinvalidationrule = cacheinvalidationrule
  98942. return c
  98943. }
  98944. // RequestId sets the optional parameter "requestId": An optional
  98945. // request ID to identify requests. Specify a unique request ID so that
  98946. // if you must retry your request, the server will know to ignore the
  98947. // request if it has already been completed.
  98948. //
  98949. // For example, consider a situation where you make an initial request
  98950. // and the request times out. If you make the request again with the
  98951. // same request ID, the server can check if original operation with the
  98952. // same request ID was received, and if so, will ignore the second
  98953. // request. This prevents clients from accidentally creating duplicate
  98954. // commitments.
  98955. //
  98956. // The request ID must be a valid UUID with the exception that zero UUID
  98957. // is not supported (00000000-0000-0000-0000-000000000000).
  98958. func (c *UrlMapsInvalidateCacheCall) RequestId(requestId string) *UrlMapsInvalidateCacheCall {
  98959. c.urlParams_.Set("requestId", requestId)
  98960. return c
  98961. }
  98962. // Fields allows partial responses to be retrieved. See
  98963. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  98964. // for more information.
  98965. func (c *UrlMapsInvalidateCacheCall) Fields(s ...googleapi.Field) *UrlMapsInvalidateCacheCall {
  98966. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  98967. return c
  98968. }
  98969. // Context sets the context to be used in this call's Do method. Any
  98970. // pending HTTP request will be aborted if the provided context is
  98971. // canceled.
  98972. func (c *UrlMapsInvalidateCacheCall) Context(ctx context.Context) *UrlMapsInvalidateCacheCall {
  98973. c.ctx_ = ctx
  98974. return c
  98975. }
  98976. // Header returns an http.Header that can be modified by the caller to
  98977. // add HTTP headers to the request.
  98978. func (c *UrlMapsInvalidateCacheCall) Header() http.Header {
  98979. if c.header_ == nil {
  98980. c.header_ = make(http.Header)
  98981. }
  98982. return c.header_
  98983. }
  98984. func (c *UrlMapsInvalidateCacheCall) doRequest(alt string) (*http.Response, error) {
  98985. reqHeaders := make(http.Header)
  98986. for k, v := range c.header_ {
  98987. reqHeaders[k] = v
  98988. }
  98989. reqHeaders.Set("User-Agent", c.s.userAgent())
  98990. var body io.Reader = nil
  98991. body, err := googleapi.WithoutDataWrapper.JSONReader(c.cacheinvalidationrule)
  98992. if err != nil {
  98993. return nil, err
  98994. }
  98995. reqHeaders.Set("Content-Type", "application/json")
  98996. c.urlParams_.Set("alt", alt)
  98997. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/urlMaps/{urlMap}/invalidateCache")
  98998. urls += "?" + c.urlParams_.Encode()
  98999. req, _ := http.NewRequest("POST", urls, body)
  99000. req.Header = reqHeaders
  99001. googleapi.Expand(req.URL, map[string]string{
  99002. "project": c.project,
  99003. "urlMap": c.urlMap,
  99004. })
  99005. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  99006. }
  99007. // Do executes the "compute.urlMaps.invalidateCache" call.
  99008. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  99009. // status code is an error. Response headers are in either
  99010. // *Operation.ServerResponse.Header or (if a response was returned at
  99011. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  99012. // to check whether the returned error was because
  99013. // http.StatusNotModified was returned.
  99014. func (c *UrlMapsInvalidateCacheCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  99015. gensupport.SetOptions(c.urlParams_, opts...)
  99016. res, err := c.doRequest("json")
  99017. if res != nil && res.StatusCode == http.StatusNotModified {
  99018. if res.Body != nil {
  99019. res.Body.Close()
  99020. }
  99021. return nil, &googleapi.Error{
  99022. Code: res.StatusCode,
  99023. Header: res.Header,
  99024. }
  99025. }
  99026. if err != nil {
  99027. return nil, err
  99028. }
  99029. defer googleapi.CloseBody(res)
  99030. if err := googleapi.CheckResponse(res); err != nil {
  99031. return nil, err
  99032. }
  99033. ret := &Operation{
  99034. ServerResponse: googleapi.ServerResponse{
  99035. Header: res.Header,
  99036. HTTPStatusCode: res.StatusCode,
  99037. },
  99038. }
  99039. target := &ret
  99040. if err := gensupport.DecodeResponse(target, res); err != nil {
  99041. return nil, err
  99042. }
  99043. return ret, nil
  99044. // {
  99045. // "description": "Initiates a cache invalidation operation, invalidating the specified path, scoped to the specified UrlMap.",
  99046. // "httpMethod": "POST",
  99047. // "id": "compute.urlMaps.invalidateCache",
  99048. // "parameterOrder": [
  99049. // "project",
  99050. // "urlMap"
  99051. // ],
  99052. // "parameters": {
  99053. // "project": {
  99054. // "description": "Project ID for this request.",
  99055. // "location": "path",
  99056. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  99057. // "required": true,
  99058. // "type": "string"
  99059. // },
  99060. // "requestId": {
  99061. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  99062. // "location": "query",
  99063. // "type": "string"
  99064. // },
  99065. // "urlMap": {
  99066. // "description": "Name of the UrlMap scoping this request.",
  99067. // "location": "path",
  99068. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  99069. // "required": true,
  99070. // "type": "string"
  99071. // }
  99072. // },
  99073. // "path": "{project}/global/urlMaps/{urlMap}/invalidateCache",
  99074. // "request": {
  99075. // "$ref": "CacheInvalidationRule"
  99076. // },
  99077. // "response": {
  99078. // "$ref": "Operation"
  99079. // },
  99080. // "scopes": [
  99081. // "https://www.googleapis.com/auth/cloud-platform",
  99082. // "https://www.googleapis.com/auth/compute"
  99083. // ]
  99084. // }
  99085. }
  99086. // method id "compute.urlMaps.list":
  99087. type UrlMapsListCall struct {
  99088. s *Service
  99089. project string
  99090. urlParams_ gensupport.URLParams
  99091. ifNoneMatch_ string
  99092. ctx_ context.Context
  99093. header_ http.Header
  99094. }
  99095. // List: Retrieves the list of UrlMap resources available to the
  99096. // specified project.
  99097. // For details, see https://cloud.google.com/compute/docs/reference/latest/urlMaps/list
  99098. func (r *UrlMapsService) List(project string) *UrlMapsListCall {
  99099. c := &UrlMapsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  99100. c.project = project
  99101. return c
  99102. }
  99103. // Filter sets the optional parameter "filter": A filter expression that
  99104. // filters resources listed in the response. The expression must specify
  99105. // the field name, a comparison operator, and the value that you want to
  99106. // use for filtering. The value must be a string, a number, or a
  99107. // boolean. The comparison operator must be either =, !=, >, or <.
  99108. //
  99109. // For example, if you are filtering Compute Engine instances, you can
  99110. // exclude instances named example-instance by specifying name !=
  99111. // example-instance.
  99112. //
  99113. // You can also filter nested fields. For example, you could specify
  99114. // scheduling.automaticRestart = false to include instances only if they
  99115. // are not scheduled for automatic restarts. You can use filtering on
  99116. // nested fields to filter based on resource labels.
  99117. //
  99118. // To filter on multiple expressions, provide each separate expression
  99119. // within parentheses. For example, (scheduling.automaticRestart = true)
  99120. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  99121. // AND expression. However, you can include AND and OR expressions
  99122. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  99123. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  99124. // true).
  99125. func (c *UrlMapsListCall) Filter(filter string) *UrlMapsListCall {
  99126. c.urlParams_.Set("filter", filter)
  99127. return c
  99128. }
  99129. // MaxResults sets the optional parameter "maxResults": The maximum
  99130. // number of results per page that should be returned. If the number of
  99131. // available results is larger than maxResults, Compute Engine returns a
  99132. // nextPageToken that can be used to get the next page of results in
  99133. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  99134. // (Default: 500)
  99135. func (c *UrlMapsListCall) MaxResults(maxResults int64) *UrlMapsListCall {
  99136. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  99137. return c
  99138. }
  99139. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  99140. // a certain order. By default, results are returned in alphanumerical
  99141. // order based on the resource name.
  99142. //
  99143. // You can also sort results in descending order based on the creation
  99144. // timestamp using orderBy="creationTimestamp desc". This sorts results
  99145. // based on the creationTimestamp field in reverse chronological order
  99146. // (newest result first). Use this to sort resources like operations so
  99147. // that the newest operation is returned first.
  99148. //
  99149. // Currently, only sorting by name or creationTimestamp desc is
  99150. // supported.
  99151. func (c *UrlMapsListCall) OrderBy(orderBy string) *UrlMapsListCall {
  99152. c.urlParams_.Set("orderBy", orderBy)
  99153. return c
  99154. }
  99155. // PageToken sets the optional parameter "pageToken": Specifies a page
  99156. // token to use. Set pageToken to the nextPageToken returned by a
  99157. // previous list request to get the next page of results.
  99158. func (c *UrlMapsListCall) PageToken(pageToken string) *UrlMapsListCall {
  99159. c.urlParams_.Set("pageToken", pageToken)
  99160. return c
  99161. }
  99162. // Fields allows partial responses to be retrieved. See
  99163. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  99164. // for more information.
  99165. func (c *UrlMapsListCall) Fields(s ...googleapi.Field) *UrlMapsListCall {
  99166. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  99167. return c
  99168. }
  99169. // IfNoneMatch sets the optional parameter which makes the operation
  99170. // fail if the object's ETag matches the given value. This is useful for
  99171. // getting updates only after the object has changed since the last
  99172. // request. Use googleapi.IsNotModified to check whether the response
  99173. // error from Do is the result of In-None-Match.
  99174. func (c *UrlMapsListCall) IfNoneMatch(entityTag string) *UrlMapsListCall {
  99175. c.ifNoneMatch_ = entityTag
  99176. return c
  99177. }
  99178. // Context sets the context to be used in this call's Do method. Any
  99179. // pending HTTP request will be aborted if the provided context is
  99180. // canceled.
  99181. func (c *UrlMapsListCall) Context(ctx context.Context) *UrlMapsListCall {
  99182. c.ctx_ = ctx
  99183. return c
  99184. }
  99185. // Header returns an http.Header that can be modified by the caller to
  99186. // add HTTP headers to the request.
  99187. func (c *UrlMapsListCall) Header() http.Header {
  99188. if c.header_ == nil {
  99189. c.header_ = make(http.Header)
  99190. }
  99191. return c.header_
  99192. }
  99193. func (c *UrlMapsListCall) doRequest(alt string) (*http.Response, error) {
  99194. reqHeaders := make(http.Header)
  99195. for k, v := range c.header_ {
  99196. reqHeaders[k] = v
  99197. }
  99198. reqHeaders.Set("User-Agent", c.s.userAgent())
  99199. if c.ifNoneMatch_ != "" {
  99200. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  99201. }
  99202. var body io.Reader = nil
  99203. c.urlParams_.Set("alt", alt)
  99204. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/urlMaps")
  99205. urls += "?" + c.urlParams_.Encode()
  99206. req, _ := http.NewRequest("GET", urls, body)
  99207. req.Header = reqHeaders
  99208. googleapi.Expand(req.URL, map[string]string{
  99209. "project": c.project,
  99210. })
  99211. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  99212. }
  99213. // Do executes the "compute.urlMaps.list" call.
  99214. // Exactly one of *UrlMapList or error will be non-nil. Any non-2xx
  99215. // status code is an error. Response headers are in either
  99216. // *UrlMapList.ServerResponse.Header or (if a response was returned at
  99217. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  99218. // to check whether the returned error was because
  99219. // http.StatusNotModified was returned.
  99220. func (c *UrlMapsListCall) Do(opts ...googleapi.CallOption) (*UrlMapList, error) {
  99221. gensupport.SetOptions(c.urlParams_, opts...)
  99222. res, err := c.doRequest("json")
  99223. if res != nil && res.StatusCode == http.StatusNotModified {
  99224. if res.Body != nil {
  99225. res.Body.Close()
  99226. }
  99227. return nil, &googleapi.Error{
  99228. Code: res.StatusCode,
  99229. Header: res.Header,
  99230. }
  99231. }
  99232. if err != nil {
  99233. return nil, err
  99234. }
  99235. defer googleapi.CloseBody(res)
  99236. if err := googleapi.CheckResponse(res); err != nil {
  99237. return nil, err
  99238. }
  99239. ret := &UrlMapList{
  99240. ServerResponse: googleapi.ServerResponse{
  99241. Header: res.Header,
  99242. HTTPStatusCode: res.StatusCode,
  99243. },
  99244. }
  99245. target := &ret
  99246. if err := gensupport.DecodeResponse(target, res); err != nil {
  99247. return nil, err
  99248. }
  99249. return ret, nil
  99250. // {
  99251. // "description": "Retrieves the list of UrlMap resources available to the specified project.",
  99252. // "httpMethod": "GET",
  99253. // "id": "compute.urlMaps.list",
  99254. // "parameterOrder": [
  99255. // "project"
  99256. // ],
  99257. // "parameters": {
  99258. // "filter": {
  99259. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  99260. // "location": "query",
  99261. // "type": "string"
  99262. // },
  99263. // "maxResults": {
  99264. // "default": "500",
  99265. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  99266. // "format": "uint32",
  99267. // "location": "query",
  99268. // "minimum": "0",
  99269. // "type": "integer"
  99270. // },
  99271. // "orderBy": {
  99272. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  99273. // "location": "query",
  99274. // "type": "string"
  99275. // },
  99276. // "pageToken": {
  99277. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  99278. // "location": "query",
  99279. // "type": "string"
  99280. // },
  99281. // "project": {
  99282. // "description": "Project ID for this request.",
  99283. // "location": "path",
  99284. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  99285. // "required": true,
  99286. // "type": "string"
  99287. // }
  99288. // },
  99289. // "path": "{project}/global/urlMaps",
  99290. // "response": {
  99291. // "$ref": "UrlMapList"
  99292. // },
  99293. // "scopes": [
  99294. // "https://www.googleapis.com/auth/cloud-platform",
  99295. // "https://www.googleapis.com/auth/compute",
  99296. // "https://www.googleapis.com/auth/compute.readonly"
  99297. // ]
  99298. // }
  99299. }
  99300. // Pages invokes f for each page of results.
  99301. // A non-nil error returned from f will halt the iteration.
  99302. // The provided context supersedes any context provided to the Context method.
  99303. func (c *UrlMapsListCall) Pages(ctx context.Context, f func(*UrlMapList) error) error {
  99304. c.ctx_ = ctx
  99305. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  99306. for {
  99307. x, err := c.Do()
  99308. if err != nil {
  99309. return err
  99310. }
  99311. if err := f(x); err != nil {
  99312. return err
  99313. }
  99314. if x.NextPageToken == "" {
  99315. return nil
  99316. }
  99317. c.PageToken(x.NextPageToken)
  99318. }
  99319. }
  99320. // method id "compute.urlMaps.patch":
  99321. type UrlMapsPatchCall struct {
  99322. s *Service
  99323. project string
  99324. urlMap string
  99325. urlmap *UrlMap
  99326. urlParams_ gensupport.URLParams
  99327. ctx_ context.Context
  99328. header_ http.Header
  99329. }
  99330. // Patch: Patches the specified UrlMap resource with the data included
  99331. // in the request. This method supports PATCH semantics and uses the
  99332. // JSON merge patch format and processing rules.
  99333. // For details, see https://cloud.google.com/compute/docs/reference/latest/urlMaps/patch
  99334. func (r *UrlMapsService) Patch(project string, urlMap string, urlmap *UrlMap) *UrlMapsPatchCall {
  99335. c := &UrlMapsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  99336. c.project = project
  99337. c.urlMap = urlMap
  99338. c.urlmap = urlmap
  99339. return c
  99340. }
  99341. // RequestId sets the optional parameter "requestId": An optional
  99342. // request ID to identify requests. Specify a unique request ID so that
  99343. // if you must retry your request, the server will know to ignore the
  99344. // request if it has already been completed.
  99345. //
  99346. // For example, consider a situation where you make an initial request
  99347. // and the request times out. If you make the request again with the
  99348. // same request ID, the server can check if original operation with the
  99349. // same request ID was received, and if so, will ignore the second
  99350. // request. This prevents clients from accidentally creating duplicate
  99351. // commitments.
  99352. //
  99353. // The request ID must be a valid UUID with the exception that zero UUID
  99354. // is not supported (00000000-0000-0000-0000-000000000000).
  99355. func (c *UrlMapsPatchCall) RequestId(requestId string) *UrlMapsPatchCall {
  99356. c.urlParams_.Set("requestId", requestId)
  99357. return c
  99358. }
  99359. // Fields allows partial responses to be retrieved. See
  99360. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  99361. // for more information.
  99362. func (c *UrlMapsPatchCall) Fields(s ...googleapi.Field) *UrlMapsPatchCall {
  99363. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  99364. return c
  99365. }
  99366. // Context sets the context to be used in this call's Do method. Any
  99367. // pending HTTP request will be aborted if the provided context is
  99368. // canceled.
  99369. func (c *UrlMapsPatchCall) Context(ctx context.Context) *UrlMapsPatchCall {
  99370. c.ctx_ = ctx
  99371. return c
  99372. }
  99373. // Header returns an http.Header that can be modified by the caller to
  99374. // add HTTP headers to the request.
  99375. func (c *UrlMapsPatchCall) Header() http.Header {
  99376. if c.header_ == nil {
  99377. c.header_ = make(http.Header)
  99378. }
  99379. return c.header_
  99380. }
  99381. func (c *UrlMapsPatchCall) doRequest(alt string) (*http.Response, error) {
  99382. reqHeaders := make(http.Header)
  99383. for k, v := range c.header_ {
  99384. reqHeaders[k] = v
  99385. }
  99386. reqHeaders.Set("User-Agent", c.s.userAgent())
  99387. var body io.Reader = nil
  99388. body, err := googleapi.WithoutDataWrapper.JSONReader(c.urlmap)
  99389. if err != nil {
  99390. return nil, err
  99391. }
  99392. reqHeaders.Set("Content-Type", "application/json")
  99393. c.urlParams_.Set("alt", alt)
  99394. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/urlMaps/{urlMap}")
  99395. urls += "?" + c.urlParams_.Encode()
  99396. req, _ := http.NewRequest("PATCH", urls, body)
  99397. req.Header = reqHeaders
  99398. googleapi.Expand(req.URL, map[string]string{
  99399. "project": c.project,
  99400. "urlMap": c.urlMap,
  99401. })
  99402. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  99403. }
  99404. // Do executes the "compute.urlMaps.patch" call.
  99405. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  99406. // status code is an error. Response headers are in either
  99407. // *Operation.ServerResponse.Header or (if a response was returned at
  99408. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  99409. // to check whether the returned error was because
  99410. // http.StatusNotModified was returned.
  99411. func (c *UrlMapsPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  99412. gensupport.SetOptions(c.urlParams_, opts...)
  99413. res, err := c.doRequest("json")
  99414. if res != nil && res.StatusCode == http.StatusNotModified {
  99415. if res.Body != nil {
  99416. res.Body.Close()
  99417. }
  99418. return nil, &googleapi.Error{
  99419. Code: res.StatusCode,
  99420. Header: res.Header,
  99421. }
  99422. }
  99423. if err != nil {
  99424. return nil, err
  99425. }
  99426. defer googleapi.CloseBody(res)
  99427. if err := googleapi.CheckResponse(res); err != nil {
  99428. return nil, err
  99429. }
  99430. ret := &Operation{
  99431. ServerResponse: googleapi.ServerResponse{
  99432. Header: res.Header,
  99433. HTTPStatusCode: res.StatusCode,
  99434. },
  99435. }
  99436. target := &ret
  99437. if err := gensupport.DecodeResponse(target, res); err != nil {
  99438. return nil, err
  99439. }
  99440. return ret, nil
  99441. // {
  99442. // "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.",
  99443. // "httpMethod": "PATCH",
  99444. // "id": "compute.urlMaps.patch",
  99445. // "parameterOrder": [
  99446. // "project",
  99447. // "urlMap"
  99448. // ],
  99449. // "parameters": {
  99450. // "project": {
  99451. // "description": "Project ID for this request.",
  99452. // "location": "path",
  99453. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  99454. // "required": true,
  99455. // "type": "string"
  99456. // },
  99457. // "requestId": {
  99458. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  99459. // "location": "query",
  99460. // "type": "string"
  99461. // },
  99462. // "urlMap": {
  99463. // "description": "Name of the UrlMap resource to patch.",
  99464. // "location": "path",
  99465. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  99466. // "required": true,
  99467. // "type": "string"
  99468. // }
  99469. // },
  99470. // "path": "{project}/global/urlMaps/{urlMap}",
  99471. // "request": {
  99472. // "$ref": "UrlMap"
  99473. // },
  99474. // "response": {
  99475. // "$ref": "Operation"
  99476. // },
  99477. // "scopes": [
  99478. // "https://www.googleapis.com/auth/cloud-platform",
  99479. // "https://www.googleapis.com/auth/compute"
  99480. // ]
  99481. // }
  99482. }
  99483. // method id "compute.urlMaps.testIamPermissions":
  99484. type UrlMapsTestIamPermissionsCall struct {
  99485. s *Service
  99486. project string
  99487. resource string
  99488. testpermissionsrequest *TestPermissionsRequest
  99489. urlParams_ gensupport.URLParams
  99490. ctx_ context.Context
  99491. header_ http.Header
  99492. }
  99493. // TestIamPermissions: Returns permissions that a caller has on the
  99494. // specified resource.
  99495. func (r *UrlMapsService) TestIamPermissions(project string, resource string, testpermissionsrequest *TestPermissionsRequest) *UrlMapsTestIamPermissionsCall {
  99496. c := &UrlMapsTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  99497. c.project = project
  99498. c.resource = resource
  99499. c.testpermissionsrequest = testpermissionsrequest
  99500. return c
  99501. }
  99502. // Fields allows partial responses to be retrieved. See
  99503. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  99504. // for more information.
  99505. func (c *UrlMapsTestIamPermissionsCall) Fields(s ...googleapi.Field) *UrlMapsTestIamPermissionsCall {
  99506. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  99507. return c
  99508. }
  99509. // Context sets the context to be used in this call's Do method. Any
  99510. // pending HTTP request will be aborted if the provided context is
  99511. // canceled.
  99512. func (c *UrlMapsTestIamPermissionsCall) Context(ctx context.Context) *UrlMapsTestIamPermissionsCall {
  99513. c.ctx_ = ctx
  99514. return c
  99515. }
  99516. // Header returns an http.Header that can be modified by the caller to
  99517. // add HTTP headers to the request.
  99518. func (c *UrlMapsTestIamPermissionsCall) Header() http.Header {
  99519. if c.header_ == nil {
  99520. c.header_ = make(http.Header)
  99521. }
  99522. return c.header_
  99523. }
  99524. func (c *UrlMapsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  99525. reqHeaders := make(http.Header)
  99526. for k, v := range c.header_ {
  99527. reqHeaders[k] = v
  99528. }
  99529. reqHeaders.Set("User-Agent", c.s.userAgent())
  99530. var body io.Reader = nil
  99531. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  99532. if err != nil {
  99533. return nil, err
  99534. }
  99535. reqHeaders.Set("Content-Type", "application/json")
  99536. c.urlParams_.Set("alt", alt)
  99537. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/urlMaps/{resource}/testIamPermissions")
  99538. urls += "?" + c.urlParams_.Encode()
  99539. req, _ := http.NewRequest("POST", urls, body)
  99540. req.Header = reqHeaders
  99541. googleapi.Expand(req.URL, map[string]string{
  99542. "project": c.project,
  99543. "resource": c.resource,
  99544. })
  99545. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  99546. }
  99547. // Do executes the "compute.urlMaps.testIamPermissions" call.
  99548. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  99549. // non-2xx status code is an error. Response headers are in either
  99550. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  99551. // returned at all) in error.(*googleapi.Error).Header. Use
  99552. // googleapi.IsNotModified to check whether the returned error was
  99553. // because http.StatusNotModified was returned.
  99554. func (c *UrlMapsTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  99555. gensupport.SetOptions(c.urlParams_, opts...)
  99556. res, err := c.doRequest("json")
  99557. if res != nil && res.StatusCode == http.StatusNotModified {
  99558. if res.Body != nil {
  99559. res.Body.Close()
  99560. }
  99561. return nil, &googleapi.Error{
  99562. Code: res.StatusCode,
  99563. Header: res.Header,
  99564. }
  99565. }
  99566. if err != nil {
  99567. return nil, err
  99568. }
  99569. defer googleapi.CloseBody(res)
  99570. if err := googleapi.CheckResponse(res); err != nil {
  99571. return nil, err
  99572. }
  99573. ret := &TestPermissionsResponse{
  99574. ServerResponse: googleapi.ServerResponse{
  99575. Header: res.Header,
  99576. HTTPStatusCode: res.StatusCode,
  99577. },
  99578. }
  99579. target := &ret
  99580. if err := gensupport.DecodeResponse(target, res); err != nil {
  99581. return nil, err
  99582. }
  99583. return ret, nil
  99584. // {
  99585. // "description": "Returns permissions that a caller has on the specified resource.",
  99586. // "httpMethod": "POST",
  99587. // "id": "compute.urlMaps.testIamPermissions",
  99588. // "parameterOrder": [
  99589. // "project",
  99590. // "resource"
  99591. // ],
  99592. // "parameters": {
  99593. // "project": {
  99594. // "description": "Project ID for this request.",
  99595. // "location": "path",
  99596. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  99597. // "required": true,
  99598. // "type": "string"
  99599. // },
  99600. // "resource": {
  99601. // "description": "Name of the resource for this request.",
  99602. // "location": "path",
  99603. // "pattern": "(?:[-a-z0-9_]{0,62}[a-z0-9])?",
  99604. // "required": true,
  99605. // "type": "string"
  99606. // }
  99607. // },
  99608. // "path": "{project}/global/urlMaps/{resource}/testIamPermissions",
  99609. // "request": {
  99610. // "$ref": "TestPermissionsRequest"
  99611. // },
  99612. // "response": {
  99613. // "$ref": "TestPermissionsResponse"
  99614. // },
  99615. // "scopes": [
  99616. // "https://www.googleapis.com/auth/cloud-platform",
  99617. // "https://www.googleapis.com/auth/compute",
  99618. // "https://www.googleapis.com/auth/compute.readonly"
  99619. // ]
  99620. // }
  99621. }
  99622. // method id "compute.urlMaps.update":
  99623. type UrlMapsUpdateCall struct {
  99624. s *Service
  99625. project string
  99626. urlMap string
  99627. urlmap *UrlMap
  99628. urlParams_ gensupport.URLParams
  99629. ctx_ context.Context
  99630. header_ http.Header
  99631. }
  99632. // Update: Updates the specified UrlMap resource with the data included
  99633. // in the request.
  99634. // For details, see https://cloud.google.com/compute/docs/reference/latest/urlMaps/update
  99635. func (r *UrlMapsService) Update(project string, urlMap string, urlmap *UrlMap) *UrlMapsUpdateCall {
  99636. c := &UrlMapsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  99637. c.project = project
  99638. c.urlMap = urlMap
  99639. c.urlmap = urlmap
  99640. return c
  99641. }
  99642. // RequestId sets the optional parameter "requestId": An optional
  99643. // request ID to identify requests. Specify a unique request ID so that
  99644. // if you must retry your request, the server will know to ignore the
  99645. // request if it has already been completed.
  99646. //
  99647. // For example, consider a situation where you make an initial request
  99648. // and the request times out. If you make the request again with the
  99649. // same request ID, the server can check if original operation with the
  99650. // same request ID was received, and if so, will ignore the second
  99651. // request. This prevents clients from accidentally creating duplicate
  99652. // commitments.
  99653. //
  99654. // The request ID must be a valid UUID with the exception that zero UUID
  99655. // is not supported (00000000-0000-0000-0000-000000000000).
  99656. func (c *UrlMapsUpdateCall) RequestId(requestId string) *UrlMapsUpdateCall {
  99657. c.urlParams_.Set("requestId", requestId)
  99658. return c
  99659. }
  99660. // Fields allows partial responses to be retrieved. See
  99661. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  99662. // for more information.
  99663. func (c *UrlMapsUpdateCall) Fields(s ...googleapi.Field) *UrlMapsUpdateCall {
  99664. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  99665. return c
  99666. }
  99667. // Context sets the context to be used in this call's Do method. Any
  99668. // pending HTTP request will be aborted if the provided context is
  99669. // canceled.
  99670. func (c *UrlMapsUpdateCall) Context(ctx context.Context) *UrlMapsUpdateCall {
  99671. c.ctx_ = ctx
  99672. return c
  99673. }
  99674. // Header returns an http.Header that can be modified by the caller to
  99675. // add HTTP headers to the request.
  99676. func (c *UrlMapsUpdateCall) Header() http.Header {
  99677. if c.header_ == nil {
  99678. c.header_ = make(http.Header)
  99679. }
  99680. return c.header_
  99681. }
  99682. func (c *UrlMapsUpdateCall) doRequest(alt string) (*http.Response, error) {
  99683. reqHeaders := make(http.Header)
  99684. for k, v := range c.header_ {
  99685. reqHeaders[k] = v
  99686. }
  99687. reqHeaders.Set("User-Agent", c.s.userAgent())
  99688. var body io.Reader = nil
  99689. body, err := googleapi.WithoutDataWrapper.JSONReader(c.urlmap)
  99690. if err != nil {
  99691. return nil, err
  99692. }
  99693. reqHeaders.Set("Content-Type", "application/json")
  99694. c.urlParams_.Set("alt", alt)
  99695. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/urlMaps/{urlMap}")
  99696. urls += "?" + c.urlParams_.Encode()
  99697. req, _ := http.NewRequest("PUT", urls, body)
  99698. req.Header = reqHeaders
  99699. googleapi.Expand(req.URL, map[string]string{
  99700. "project": c.project,
  99701. "urlMap": c.urlMap,
  99702. })
  99703. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  99704. }
  99705. // Do executes the "compute.urlMaps.update" call.
  99706. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  99707. // status code is an error. Response headers are in either
  99708. // *Operation.ServerResponse.Header or (if a response was returned at
  99709. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  99710. // to check whether the returned error was because
  99711. // http.StatusNotModified was returned.
  99712. func (c *UrlMapsUpdateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  99713. gensupport.SetOptions(c.urlParams_, opts...)
  99714. res, err := c.doRequest("json")
  99715. if res != nil && res.StatusCode == http.StatusNotModified {
  99716. if res.Body != nil {
  99717. res.Body.Close()
  99718. }
  99719. return nil, &googleapi.Error{
  99720. Code: res.StatusCode,
  99721. Header: res.Header,
  99722. }
  99723. }
  99724. if err != nil {
  99725. return nil, err
  99726. }
  99727. defer googleapi.CloseBody(res)
  99728. if err := googleapi.CheckResponse(res); err != nil {
  99729. return nil, err
  99730. }
  99731. ret := &Operation{
  99732. ServerResponse: googleapi.ServerResponse{
  99733. Header: res.Header,
  99734. HTTPStatusCode: res.StatusCode,
  99735. },
  99736. }
  99737. target := &ret
  99738. if err := gensupport.DecodeResponse(target, res); err != nil {
  99739. return nil, err
  99740. }
  99741. return ret, nil
  99742. // {
  99743. // "description": "Updates the specified UrlMap resource with the data included in the request.",
  99744. // "httpMethod": "PUT",
  99745. // "id": "compute.urlMaps.update",
  99746. // "parameterOrder": [
  99747. // "project",
  99748. // "urlMap"
  99749. // ],
  99750. // "parameters": {
  99751. // "project": {
  99752. // "description": "Project ID for this request.",
  99753. // "location": "path",
  99754. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  99755. // "required": true,
  99756. // "type": "string"
  99757. // },
  99758. // "requestId": {
  99759. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  99760. // "location": "query",
  99761. // "type": "string"
  99762. // },
  99763. // "urlMap": {
  99764. // "description": "Name of the UrlMap resource to update.",
  99765. // "location": "path",
  99766. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  99767. // "required": true,
  99768. // "type": "string"
  99769. // }
  99770. // },
  99771. // "path": "{project}/global/urlMaps/{urlMap}",
  99772. // "request": {
  99773. // "$ref": "UrlMap"
  99774. // },
  99775. // "response": {
  99776. // "$ref": "Operation"
  99777. // },
  99778. // "scopes": [
  99779. // "https://www.googleapis.com/auth/cloud-platform",
  99780. // "https://www.googleapis.com/auth/compute"
  99781. // ]
  99782. // }
  99783. }
  99784. // method id "compute.urlMaps.validate":
  99785. type UrlMapsValidateCall struct {
  99786. s *Service
  99787. project string
  99788. urlMap string
  99789. urlmapsvalidaterequest *UrlMapsValidateRequest
  99790. urlParams_ gensupport.URLParams
  99791. ctx_ context.Context
  99792. header_ http.Header
  99793. }
  99794. // Validate: Runs static validation for the UrlMap. In particular, the
  99795. // tests of the provided UrlMap will be run. Calling this method does
  99796. // NOT create the UrlMap.
  99797. // For details, see https://cloud.google.com/compute/docs/reference/latest/urlMaps/validate
  99798. func (r *UrlMapsService) Validate(project string, urlMap string, urlmapsvalidaterequest *UrlMapsValidateRequest) *UrlMapsValidateCall {
  99799. c := &UrlMapsValidateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  99800. c.project = project
  99801. c.urlMap = urlMap
  99802. c.urlmapsvalidaterequest = urlmapsvalidaterequest
  99803. return c
  99804. }
  99805. // Fields allows partial responses to be retrieved. See
  99806. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  99807. // for more information.
  99808. func (c *UrlMapsValidateCall) Fields(s ...googleapi.Field) *UrlMapsValidateCall {
  99809. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  99810. return c
  99811. }
  99812. // Context sets the context to be used in this call's Do method. Any
  99813. // pending HTTP request will be aborted if the provided context is
  99814. // canceled.
  99815. func (c *UrlMapsValidateCall) Context(ctx context.Context) *UrlMapsValidateCall {
  99816. c.ctx_ = ctx
  99817. return c
  99818. }
  99819. // Header returns an http.Header that can be modified by the caller to
  99820. // add HTTP headers to the request.
  99821. func (c *UrlMapsValidateCall) Header() http.Header {
  99822. if c.header_ == nil {
  99823. c.header_ = make(http.Header)
  99824. }
  99825. return c.header_
  99826. }
  99827. func (c *UrlMapsValidateCall) doRequest(alt string) (*http.Response, error) {
  99828. reqHeaders := make(http.Header)
  99829. for k, v := range c.header_ {
  99830. reqHeaders[k] = v
  99831. }
  99832. reqHeaders.Set("User-Agent", c.s.userAgent())
  99833. var body io.Reader = nil
  99834. body, err := googleapi.WithoutDataWrapper.JSONReader(c.urlmapsvalidaterequest)
  99835. if err != nil {
  99836. return nil, err
  99837. }
  99838. reqHeaders.Set("Content-Type", "application/json")
  99839. c.urlParams_.Set("alt", alt)
  99840. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/urlMaps/{urlMap}/validate")
  99841. urls += "?" + c.urlParams_.Encode()
  99842. req, _ := http.NewRequest("POST", urls, body)
  99843. req.Header = reqHeaders
  99844. googleapi.Expand(req.URL, map[string]string{
  99845. "project": c.project,
  99846. "urlMap": c.urlMap,
  99847. })
  99848. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  99849. }
  99850. // Do executes the "compute.urlMaps.validate" call.
  99851. // Exactly one of *UrlMapsValidateResponse or error will be non-nil. Any
  99852. // non-2xx status code is an error. Response headers are in either
  99853. // *UrlMapsValidateResponse.ServerResponse.Header or (if a response was
  99854. // returned at all) in error.(*googleapi.Error).Header. Use
  99855. // googleapi.IsNotModified to check whether the returned error was
  99856. // because http.StatusNotModified was returned.
  99857. func (c *UrlMapsValidateCall) Do(opts ...googleapi.CallOption) (*UrlMapsValidateResponse, error) {
  99858. gensupport.SetOptions(c.urlParams_, opts...)
  99859. res, err := c.doRequest("json")
  99860. if res != nil && res.StatusCode == http.StatusNotModified {
  99861. if res.Body != nil {
  99862. res.Body.Close()
  99863. }
  99864. return nil, &googleapi.Error{
  99865. Code: res.StatusCode,
  99866. Header: res.Header,
  99867. }
  99868. }
  99869. if err != nil {
  99870. return nil, err
  99871. }
  99872. defer googleapi.CloseBody(res)
  99873. if err := googleapi.CheckResponse(res); err != nil {
  99874. return nil, err
  99875. }
  99876. ret := &UrlMapsValidateResponse{
  99877. ServerResponse: googleapi.ServerResponse{
  99878. Header: res.Header,
  99879. HTTPStatusCode: res.StatusCode,
  99880. },
  99881. }
  99882. target := &ret
  99883. if err := gensupport.DecodeResponse(target, res); err != nil {
  99884. return nil, err
  99885. }
  99886. return ret, nil
  99887. // {
  99888. // "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.",
  99889. // "httpMethod": "POST",
  99890. // "id": "compute.urlMaps.validate",
  99891. // "parameterOrder": [
  99892. // "project",
  99893. // "urlMap"
  99894. // ],
  99895. // "parameters": {
  99896. // "project": {
  99897. // "description": "Project ID for this request.",
  99898. // "location": "path",
  99899. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  99900. // "required": true,
  99901. // "type": "string"
  99902. // },
  99903. // "urlMap": {
  99904. // "description": "Name of the UrlMap resource to be validated as.",
  99905. // "location": "path",
  99906. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  99907. // "required": true,
  99908. // "type": "string"
  99909. // }
  99910. // },
  99911. // "path": "{project}/global/urlMaps/{urlMap}/validate",
  99912. // "request": {
  99913. // "$ref": "UrlMapsValidateRequest"
  99914. // },
  99915. // "response": {
  99916. // "$ref": "UrlMapsValidateResponse"
  99917. // },
  99918. // "scopes": [
  99919. // "https://www.googleapis.com/auth/cloud-platform",
  99920. // "https://www.googleapis.com/auth/compute"
  99921. // ]
  99922. // }
  99923. }
  99924. // method id "compute.vpnTunnels.aggregatedList":
  99925. type VpnTunnelsAggregatedListCall struct {
  99926. s *Service
  99927. project string
  99928. urlParams_ gensupport.URLParams
  99929. ifNoneMatch_ string
  99930. ctx_ context.Context
  99931. header_ http.Header
  99932. }
  99933. // AggregatedList: Retrieves an aggregated list of VPN tunnels.
  99934. func (r *VpnTunnelsService) AggregatedList(project string) *VpnTunnelsAggregatedListCall {
  99935. c := &VpnTunnelsAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  99936. c.project = project
  99937. return c
  99938. }
  99939. // Filter sets the optional parameter "filter": A filter expression that
  99940. // filters resources listed in the response. The expression must specify
  99941. // the field name, a comparison operator, and the value that you want to
  99942. // use for filtering. The value must be a string, a number, or a
  99943. // boolean. The comparison operator must be either =, !=, >, or <.
  99944. //
  99945. // For example, if you are filtering Compute Engine instances, you can
  99946. // exclude instances named example-instance by specifying name !=
  99947. // example-instance.
  99948. //
  99949. // You can also filter nested fields. For example, you could specify
  99950. // scheduling.automaticRestart = false to include instances only if they
  99951. // are not scheduled for automatic restarts. You can use filtering on
  99952. // nested fields to filter based on resource labels.
  99953. //
  99954. // To filter on multiple expressions, provide each separate expression
  99955. // within parentheses. For example, (scheduling.automaticRestart = true)
  99956. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  99957. // AND expression. However, you can include AND and OR expressions
  99958. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  99959. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  99960. // true).
  99961. func (c *VpnTunnelsAggregatedListCall) Filter(filter string) *VpnTunnelsAggregatedListCall {
  99962. c.urlParams_.Set("filter", filter)
  99963. return c
  99964. }
  99965. // MaxResults sets the optional parameter "maxResults": The maximum
  99966. // number of results per page that should be returned. If the number of
  99967. // available results is larger than maxResults, Compute Engine returns a
  99968. // nextPageToken that can be used to get the next page of results in
  99969. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  99970. // (Default: 500)
  99971. func (c *VpnTunnelsAggregatedListCall) MaxResults(maxResults int64) *VpnTunnelsAggregatedListCall {
  99972. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  99973. return c
  99974. }
  99975. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  99976. // a certain order. By default, results are returned in alphanumerical
  99977. // order based on the resource name.
  99978. //
  99979. // You can also sort results in descending order based on the creation
  99980. // timestamp using orderBy="creationTimestamp desc". This sorts results
  99981. // based on the creationTimestamp field in reverse chronological order
  99982. // (newest result first). Use this to sort resources like operations so
  99983. // that the newest operation is returned first.
  99984. //
  99985. // Currently, only sorting by name or creationTimestamp desc is
  99986. // supported.
  99987. func (c *VpnTunnelsAggregatedListCall) OrderBy(orderBy string) *VpnTunnelsAggregatedListCall {
  99988. c.urlParams_.Set("orderBy", orderBy)
  99989. return c
  99990. }
  99991. // PageToken sets the optional parameter "pageToken": Specifies a page
  99992. // token to use. Set pageToken to the nextPageToken returned by a
  99993. // previous list request to get the next page of results.
  99994. func (c *VpnTunnelsAggregatedListCall) PageToken(pageToken string) *VpnTunnelsAggregatedListCall {
  99995. c.urlParams_.Set("pageToken", pageToken)
  99996. return c
  99997. }
  99998. // Fields allows partial responses to be retrieved. See
  99999. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  100000. // for more information.
  100001. func (c *VpnTunnelsAggregatedListCall) Fields(s ...googleapi.Field) *VpnTunnelsAggregatedListCall {
  100002. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  100003. return c
  100004. }
  100005. // IfNoneMatch sets the optional parameter which makes the operation
  100006. // fail if the object's ETag matches the given value. This is useful for
  100007. // getting updates only after the object has changed since the last
  100008. // request. Use googleapi.IsNotModified to check whether the response
  100009. // error from Do is the result of In-None-Match.
  100010. func (c *VpnTunnelsAggregatedListCall) IfNoneMatch(entityTag string) *VpnTunnelsAggregatedListCall {
  100011. c.ifNoneMatch_ = entityTag
  100012. return c
  100013. }
  100014. // Context sets the context to be used in this call's Do method. Any
  100015. // pending HTTP request will be aborted if the provided context is
  100016. // canceled.
  100017. func (c *VpnTunnelsAggregatedListCall) Context(ctx context.Context) *VpnTunnelsAggregatedListCall {
  100018. c.ctx_ = ctx
  100019. return c
  100020. }
  100021. // Header returns an http.Header that can be modified by the caller to
  100022. // add HTTP headers to the request.
  100023. func (c *VpnTunnelsAggregatedListCall) Header() http.Header {
  100024. if c.header_ == nil {
  100025. c.header_ = make(http.Header)
  100026. }
  100027. return c.header_
  100028. }
  100029. func (c *VpnTunnelsAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  100030. reqHeaders := make(http.Header)
  100031. for k, v := range c.header_ {
  100032. reqHeaders[k] = v
  100033. }
  100034. reqHeaders.Set("User-Agent", c.s.userAgent())
  100035. if c.ifNoneMatch_ != "" {
  100036. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  100037. }
  100038. var body io.Reader = nil
  100039. c.urlParams_.Set("alt", alt)
  100040. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/vpnTunnels")
  100041. urls += "?" + c.urlParams_.Encode()
  100042. req, _ := http.NewRequest("GET", urls, body)
  100043. req.Header = reqHeaders
  100044. googleapi.Expand(req.URL, map[string]string{
  100045. "project": c.project,
  100046. })
  100047. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  100048. }
  100049. // Do executes the "compute.vpnTunnels.aggregatedList" call.
  100050. // Exactly one of *VpnTunnelAggregatedList or error will be non-nil. Any
  100051. // non-2xx status code is an error. Response headers are in either
  100052. // *VpnTunnelAggregatedList.ServerResponse.Header or (if a response was
  100053. // returned at all) in error.(*googleapi.Error).Header. Use
  100054. // googleapi.IsNotModified to check whether the returned error was
  100055. // because http.StatusNotModified was returned.
  100056. func (c *VpnTunnelsAggregatedListCall) Do(opts ...googleapi.CallOption) (*VpnTunnelAggregatedList, error) {
  100057. gensupport.SetOptions(c.urlParams_, opts...)
  100058. res, err := c.doRequest("json")
  100059. if res != nil && res.StatusCode == http.StatusNotModified {
  100060. if res.Body != nil {
  100061. res.Body.Close()
  100062. }
  100063. return nil, &googleapi.Error{
  100064. Code: res.StatusCode,
  100065. Header: res.Header,
  100066. }
  100067. }
  100068. if err != nil {
  100069. return nil, err
  100070. }
  100071. defer googleapi.CloseBody(res)
  100072. if err := googleapi.CheckResponse(res); err != nil {
  100073. return nil, err
  100074. }
  100075. ret := &VpnTunnelAggregatedList{
  100076. ServerResponse: googleapi.ServerResponse{
  100077. Header: res.Header,
  100078. HTTPStatusCode: res.StatusCode,
  100079. },
  100080. }
  100081. target := &ret
  100082. if err := gensupport.DecodeResponse(target, res); err != nil {
  100083. return nil, err
  100084. }
  100085. return ret, nil
  100086. // {
  100087. // "description": "Retrieves an aggregated list of VPN tunnels.",
  100088. // "httpMethod": "GET",
  100089. // "id": "compute.vpnTunnels.aggregatedList",
  100090. // "parameterOrder": [
  100091. // "project"
  100092. // ],
  100093. // "parameters": {
  100094. // "filter": {
  100095. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  100096. // "location": "query",
  100097. // "type": "string"
  100098. // },
  100099. // "maxResults": {
  100100. // "default": "500",
  100101. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  100102. // "format": "uint32",
  100103. // "location": "query",
  100104. // "minimum": "0",
  100105. // "type": "integer"
  100106. // },
  100107. // "orderBy": {
  100108. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  100109. // "location": "query",
  100110. // "type": "string"
  100111. // },
  100112. // "pageToken": {
  100113. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  100114. // "location": "query",
  100115. // "type": "string"
  100116. // },
  100117. // "project": {
  100118. // "description": "Project ID for this request.",
  100119. // "location": "path",
  100120. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  100121. // "required": true,
  100122. // "type": "string"
  100123. // }
  100124. // },
  100125. // "path": "{project}/aggregated/vpnTunnels",
  100126. // "response": {
  100127. // "$ref": "VpnTunnelAggregatedList"
  100128. // },
  100129. // "scopes": [
  100130. // "https://www.googleapis.com/auth/cloud-platform",
  100131. // "https://www.googleapis.com/auth/compute",
  100132. // "https://www.googleapis.com/auth/compute.readonly"
  100133. // ]
  100134. // }
  100135. }
  100136. // Pages invokes f for each page of results.
  100137. // A non-nil error returned from f will halt the iteration.
  100138. // The provided context supersedes any context provided to the Context method.
  100139. func (c *VpnTunnelsAggregatedListCall) Pages(ctx context.Context, f func(*VpnTunnelAggregatedList) error) error {
  100140. c.ctx_ = ctx
  100141. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  100142. for {
  100143. x, err := c.Do()
  100144. if err != nil {
  100145. return err
  100146. }
  100147. if err := f(x); err != nil {
  100148. return err
  100149. }
  100150. if x.NextPageToken == "" {
  100151. return nil
  100152. }
  100153. c.PageToken(x.NextPageToken)
  100154. }
  100155. }
  100156. // method id "compute.vpnTunnels.delete":
  100157. type VpnTunnelsDeleteCall struct {
  100158. s *Service
  100159. project string
  100160. region string
  100161. vpnTunnel string
  100162. urlParams_ gensupport.URLParams
  100163. ctx_ context.Context
  100164. header_ http.Header
  100165. }
  100166. // Delete: Deletes the specified VpnTunnel resource.
  100167. func (r *VpnTunnelsService) Delete(project string, region string, vpnTunnel string) *VpnTunnelsDeleteCall {
  100168. c := &VpnTunnelsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  100169. c.project = project
  100170. c.region = region
  100171. c.vpnTunnel = vpnTunnel
  100172. return c
  100173. }
  100174. // RequestId sets the optional parameter "requestId": An optional
  100175. // request ID to identify requests. Specify a unique request ID so that
  100176. // if you must retry your request, the server will know to ignore the
  100177. // request if it has already been completed.
  100178. //
  100179. // For example, consider a situation where you make an initial request
  100180. // and the request times out. If you make the request again with the
  100181. // same request ID, the server can check if original operation with the
  100182. // same request ID was received, and if so, will ignore the second
  100183. // request. This prevents clients from accidentally creating duplicate
  100184. // commitments.
  100185. //
  100186. // The request ID must be a valid UUID with the exception that zero UUID
  100187. // is not supported (00000000-0000-0000-0000-000000000000).
  100188. func (c *VpnTunnelsDeleteCall) RequestId(requestId string) *VpnTunnelsDeleteCall {
  100189. c.urlParams_.Set("requestId", requestId)
  100190. return c
  100191. }
  100192. // Fields allows partial responses to be retrieved. See
  100193. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  100194. // for more information.
  100195. func (c *VpnTunnelsDeleteCall) Fields(s ...googleapi.Field) *VpnTunnelsDeleteCall {
  100196. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  100197. return c
  100198. }
  100199. // Context sets the context to be used in this call's Do method. Any
  100200. // pending HTTP request will be aborted if the provided context is
  100201. // canceled.
  100202. func (c *VpnTunnelsDeleteCall) Context(ctx context.Context) *VpnTunnelsDeleteCall {
  100203. c.ctx_ = ctx
  100204. return c
  100205. }
  100206. // Header returns an http.Header that can be modified by the caller to
  100207. // add HTTP headers to the request.
  100208. func (c *VpnTunnelsDeleteCall) Header() http.Header {
  100209. if c.header_ == nil {
  100210. c.header_ = make(http.Header)
  100211. }
  100212. return c.header_
  100213. }
  100214. func (c *VpnTunnelsDeleteCall) doRequest(alt string) (*http.Response, error) {
  100215. reqHeaders := make(http.Header)
  100216. for k, v := range c.header_ {
  100217. reqHeaders[k] = v
  100218. }
  100219. reqHeaders.Set("User-Agent", c.s.userAgent())
  100220. var body io.Reader = nil
  100221. c.urlParams_.Set("alt", alt)
  100222. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/vpnTunnels/{vpnTunnel}")
  100223. urls += "?" + c.urlParams_.Encode()
  100224. req, _ := http.NewRequest("DELETE", urls, body)
  100225. req.Header = reqHeaders
  100226. googleapi.Expand(req.URL, map[string]string{
  100227. "project": c.project,
  100228. "region": c.region,
  100229. "vpnTunnel": c.vpnTunnel,
  100230. })
  100231. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  100232. }
  100233. // Do executes the "compute.vpnTunnels.delete" call.
  100234. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  100235. // status code is an error. Response headers are in either
  100236. // *Operation.ServerResponse.Header or (if a response was returned at
  100237. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  100238. // to check whether the returned error was because
  100239. // http.StatusNotModified was returned.
  100240. func (c *VpnTunnelsDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  100241. gensupport.SetOptions(c.urlParams_, opts...)
  100242. res, err := c.doRequest("json")
  100243. if res != nil && res.StatusCode == http.StatusNotModified {
  100244. if res.Body != nil {
  100245. res.Body.Close()
  100246. }
  100247. return nil, &googleapi.Error{
  100248. Code: res.StatusCode,
  100249. Header: res.Header,
  100250. }
  100251. }
  100252. if err != nil {
  100253. return nil, err
  100254. }
  100255. defer googleapi.CloseBody(res)
  100256. if err := googleapi.CheckResponse(res); err != nil {
  100257. return nil, err
  100258. }
  100259. ret := &Operation{
  100260. ServerResponse: googleapi.ServerResponse{
  100261. Header: res.Header,
  100262. HTTPStatusCode: res.StatusCode,
  100263. },
  100264. }
  100265. target := &ret
  100266. if err := gensupport.DecodeResponse(target, res); err != nil {
  100267. return nil, err
  100268. }
  100269. return ret, nil
  100270. // {
  100271. // "description": "Deletes the specified VpnTunnel resource.",
  100272. // "httpMethod": "DELETE",
  100273. // "id": "compute.vpnTunnels.delete",
  100274. // "parameterOrder": [
  100275. // "project",
  100276. // "region",
  100277. // "vpnTunnel"
  100278. // ],
  100279. // "parameters": {
  100280. // "project": {
  100281. // "description": "Project ID for this request.",
  100282. // "location": "path",
  100283. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  100284. // "required": true,
  100285. // "type": "string"
  100286. // },
  100287. // "region": {
  100288. // "description": "Name of the region for this request.",
  100289. // "location": "path",
  100290. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  100291. // "required": true,
  100292. // "type": "string"
  100293. // },
  100294. // "requestId": {
  100295. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  100296. // "location": "query",
  100297. // "type": "string"
  100298. // },
  100299. // "vpnTunnel": {
  100300. // "description": "Name of the VpnTunnel resource to delete.",
  100301. // "location": "path",
  100302. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  100303. // "required": true,
  100304. // "type": "string"
  100305. // }
  100306. // },
  100307. // "path": "{project}/regions/{region}/vpnTunnels/{vpnTunnel}",
  100308. // "response": {
  100309. // "$ref": "Operation"
  100310. // },
  100311. // "scopes": [
  100312. // "https://www.googleapis.com/auth/cloud-platform",
  100313. // "https://www.googleapis.com/auth/compute"
  100314. // ]
  100315. // }
  100316. }
  100317. // method id "compute.vpnTunnels.get":
  100318. type VpnTunnelsGetCall struct {
  100319. s *Service
  100320. project string
  100321. region string
  100322. vpnTunnel string
  100323. urlParams_ gensupport.URLParams
  100324. ifNoneMatch_ string
  100325. ctx_ context.Context
  100326. header_ http.Header
  100327. }
  100328. // Get: Returns the specified VpnTunnel resource. Gets a list of
  100329. // available VPN tunnels by making a list() request.
  100330. func (r *VpnTunnelsService) Get(project string, region string, vpnTunnel string) *VpnTunnelsGetCall {
  100331. c := &VpnTunnelsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  100332. c.project = project
  100333. c.region = region
  100334. c.vpnTunnel = vpnTunnel
  100335. return c
  100336. }
  100337. // Fields allows partial responses to be retrieved. See
  100338. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  100339. // for more information.
  100340. func (c *VpnTunnelsGetCall) Fields(s ...googleapi.Field) *VpnTunnelsGetCall {
  100341. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  100342. return c
  100343. }
  100344. // IfNoneMatch sets the optional parameter which makes the operation
  100345. // fail if the object's ETag matches the given value. This is useful for
  100346. // getting updates only after the object has changed since the last
  100347. // request. Use googleapi.IsNotModified to check whether the response
  100348. // error from Do is the result of In-None-Match.
  100349. func (c *VpnTunnelsGetCall) IfNoneMatch(entityTag string) *VpnTunnelsGetCall {
  100350. c.ifNoneMatch_ = entityTag
  100351. return c
  100352. }
  100353. // Context sets the context to be used in this call's Do method. Any
  100354. // pending HTTP request will be aborted if the provided context is
  100355. // canceled.
  100356. func (c *VpnTunnelsGetCall) Context(ctx context.Context) *VpnTunnelsGetCall {
  100357. c.ctx_ = ctx
  100358. return c
  100359. }
  100360. // Header returns an http.Header that can be modified by the caller to
  100361. // add HTTP headers to the request.
  100362. func (c *VpnTunnelsGetCall) Header() http.Header {
  100363. if c.header_ == nil {
  100364. c.header_ = make(http.Header)
  100365. }
  100366. return c.header_
  100367. }
  100368. func (c *VpnTunnelsGetCall) doRequest(alt string) (*http.Response, error) {
  100369. reqHeaders := make(http.Header)
  100370. for k, v := range c.header_ {
  100371. reqHeaders[k] = v
  100372. }
  100373. reqHeaders.Set("User-Agent", c.s.userAgent())
  100374. if c.ifNoneMatch_ != "" {
  100375. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  100376. }
  100377. var body io.Reader = nil
  100378. c.urlParams_.Set("alt", alt)
  100379. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/vpnTunnels/{vpnTunnel}")
  100380. urls += "?" + c.urlParams_.Encode()
  100381. req, _ := http.NewRequest("GET", urls, body)
  100382. req.Header = reqHeaders
  100383. googleapi.Expand(req.URL, map[string]string{
  100384. "project": c.project,
  100385. "region": c.region,
  100386. "vpnTunnel": c.vpnTunnel,
  100387. })
  100388. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  100389. }
  100390. // Do executes the "compute.vpnTunnels.get" call.
  100391. // Exactly one of *VpnTunnel or error will be non-nil. Any non-2xx
  100392. // status code is an error. Response headers are in either
  100393. // *VpnTunnel.ServerResponse.Header or (if a response was returned at
  100394. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  100395. // to check whether the returned error was because
  100396. // http.StatusNotModified was returned.
  100397. func (c *VpnTunnelsGetCall) Do(opts ...googleapi.CallOption) (*VpnTunnel, error) {
  100398. gensupport.SetOptions(c.urlParams_, opts...)
  100399. res, err := c.doRequest("json")
  100400. if res != nil && res.StatusCode == http.StatusNotModified {
  100401. if res.Body != nil {
  100402. res.Body.Close()
  100403. }
  100404. return nil, &googleapi.Error{
  100405. Code: res.StatusCode,
  100406. Header: res.Header,
  100407. }
  100408. }
  100409. if err != nil {
  100410. return nil, err
  100411. }
  100412. defer googleapi.CloseBody(res)
  100413. if err := googleapi.CheckResponse(res); err != nil {
  100414. return nil, err
  100415. }
  100416. ret := &VpnTunnel{
  100417. ServerResponse: googleapi.ServerResponse{
  100418. Header: res.Header,
  100419. HTTPStatusCode: res.StatusCode,
  100420. },
  100421. }
  100422. target := &ret
  100423. if err := gensupport.DecodeResponse(target, res); err != nil {
  100424. return nil, err
  100425. }
  100426. return ret, nil
  100427. // {
  100428. // "description": "Returns the specified VpnTunnel resource. Gets a list of available VPN tunnels by making a list() request.",
  100429. // "httpMethod": "GET",
  100430. // "id": "compute.vpnTunnels.get",
  100431. // "parameterOrder": [
  100432. // "project",
  100433. // "region",
  100434. // "vpnTunnel"
  100435. // ],
  100436. // "parameters": {
  100437. // "project": {
  100438. // "description": "Project ID for this request.",
  100439. // "location": "path",
  100440. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  100441. // "required": true,
  100442. // "type": "string"
  100443. // },
  100444. // "region": {
  100445. // "description": "Name of the region for this request.",
  100446. // "location": "path",
  100447. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  100448. // "required": true,
  100449. // "type": "string"
  100450. // },
  100451. // "vpnTunnel": {
  100452. // "description": "Name of the VpnTunnel resource to return.",
  100453. // "location": "path",
  100454. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  100455. // "required": true,
  100456. // "type": "string"
  100457. // }
  100458. // },
  100459. // "path": "{project}/regions/{region}/vpnTunnels/{vpnTunnel}",
  100460. // "response": {
  100461. // "$ref": "VpnTunnel"
  100462. // },
  100463. // "scopes": [
  100464. // "https://www.googleapis.com/auth/cloud-platform",
  100465. // "https://www.googleapis.com/auth/compute",
  100466. // "https://www.googleapis.com/auth/compute.readonly"
  100467. // ]
  100468. // }
  100469. }
  100470. // method id "compute.vpnTunnels.insert":
  100471. type VpnTunnelsInsertCall struct {
  100472. s *Service
  100473. project string
  100474. region string
  100475. vpntunnel *VpnTunnel
  100476. urlParams_ gensupport.URLParams
  100477. ctx_ context.Context
  100478. header_ http.Header
  100479. }
  100480. // Insert: Creates a VpnTunnel resource in the specified project and
  100481. // region using the data included in the request.
  100482. func (r *VpnTunnelsService) Insert(project string, region string, vpntunnel *VpnTunnel) *VpnTunnelsInsertCall {
  100483. c := &VpnTunnelsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  100484. c.project = project
  100485. c.region = region
  100486. c.vpntunnel = vpntunnel
  100487. return c
  100488. }
  100489. // RequestId sets the optional parameter "requestId": An optional
  100490. // request ID to identify requests. Specify a unique request ID so that
  100491. // if you must retry your request, the server will know to ignore the
  100492. // request if it has already been completed.
  100493. //
  100494. // For example, consider a situation where you make an initial request
  100495. // and the request times out. If you make the request again with the
  100496. // same request ID, the server can check if original operation with the
  100497. // same request ID was received, and if so, will ignore the second
  100498. // request. This prevents clients from accidentally creating duplicate
  100499. // commitments.
  100500. //
  100501. // The request ID must be a valid UUID with the exception that zero UUID
  100502. // is not supported (00000000-0000-0000-0000-000000000000).
  100503. func (c *VpnTunnelsInsertCall) RequestId(requestId string) *VpnTunnelsInsertCall {
  100504. c.urlParams_.Set("requestId", requestId)
  100505. return c
  100506. }
  100507. // Fields allows partial responses to be retrieved. See
  100508. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  100509. // for more information.
  100510. func (c *VpnTunnelsInsertCall) Fields(s ...googleapi.Field) *VpnTunnelsInsertCall {
  100511. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  100512. return c
  100513. }
  100514. // Context sets the context to be used in this call's Do method. Any
  100515. // pending HTTP request will be aborted if the provided context is
  100516. // canceled.
  100517. func (c *VpnTunnelsInsertCall) Context(ctx context.Context) *VpnTunnelsInsertCall {
  100518. c.ctx_ = ctx
  100519. return c
  100520. }
  100521. // Header returns an http.Header that can be modified by the caller to
  100522. // add HTTP headers to the request.
  100523. func (c *VpnTunnelsInsertCall) Header() http.Header {
  100524. if c.header_ == nil {
  100525. c.header_ = make(http.Header)
  100526. }
  100527. return c.header_
  100528. }
  100529. func (c *VpnTunnelsInsertCall) doRequest(alt string) (*http.Response, error) {
  100530. reqHeaders := make(http.Header)
  100531. for k, v := range c.header_ {
  100532. reqHeaders[k] = v
  100533. }
  100534. reqHeaders.Set("User-Agent", c.s.userAgent())
  100535. var body io.Reader = nil
  100536. body, err := googleapi.WithoutDataWrapper.JSONReader(c.vpntunnel)
  100537. if err != nil {
  100538. return nil, err
  100539. }
  100540. reqHeaders.Set("Content-Type", "application/json")
  100541. c.urlParams_.Set("alt", alt)
  100542. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/vpnTunnels")
  100543. urls += "?" + c.urlParams_.Encode()
  100544. req, _ := http.NewRequest("POST", urls, body)
  100545. req.Header = reqHeaders
  100546. googleapi.Expand(req.URL, map[string]string{
  100547. "project": c.project,
  100548. "region": c.region,
  100549. })
  100550. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  100551. }
  100552. // Do executes the "compute.vpnTunnels.insert" call.
  100553. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  100554. // status code is an error. Response headers are in either
  100555. // *Operation.ServerResponse.Header or (if a response was returned at
  100556. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  100557. // to check whether the returned error was because
  100558. // http.StatusNotModified was returned.
  100559. func (c *VpnTunnelsInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  100560. gensupport.SetOptions(c.urlParams_, opts...)
  100561. res, err := c.doRequest("json")
  100562. if res != nil && res.StatusCode == http.StatusNotModified {
  100563. if res.Body != nil {
  100564. res.Body.Close()
  100565. }
  100566. return nil, &googleapi.Error{
  100567. Code: res.StatusCode,
  100568. Header: res.Header,
  100569. }
  100570. }
  100571. if err != nil {
  100572. return nil, err
  100573. }
  100574. defer googleapi.CloseBody(res)
  100575. if err := googleapi.CheckResponse(res); err != nil {
  100576. return nil, err
  100577. }
  100578. ret := &Operation{
  100579. ServerResponse: googleapi.ServerResponse{
  100580. Header: res.Header,
  100581. HTTPStatusCode: res.StatusCode,
  100582. },
  100583. }
  100584. target := &ret
  100585. if err := gensupport.DecodeResponse(target, res); err != nil {
  100586. return nil, err
  100587. }
  100588. return ret, nil
  100589. // {
  100590. // "description": "Creates a VpnTunnel resource in the specified project and region using the data included in the request.",
  100591. // "httpMethod": "POST",
  100592. // "id": "compute.vpnTunnels.insert",
  100593. // "parameterOrder": [
  100594. // "project",
  100595. // "region"
  100596. // ],
  100597. // "parameters": {
  100598. // "project": {
  100599. // "description": "Project ID for this request.",
  100600. // "location": "path",
  100601. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  100602. // "required": true,
  100603. // "type": "string"
  100604. // },
  100605. // "region": {
  100606. // "description": "Name of the region for this request.",
  100607. // "location": "path",
  100608. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  100609. // "required": true,
  100610. // "type": "string"
  100611. // },
  100612. // "requestId": {
  100613. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  100614. // "location": "query",
  100615. // "type": "string"
  100616. // }
  100617. // },
  100618. // "path": "{project}/regions/{region}/vpnTunnels",
  100619. // "request": {
  100620. // "$ref": "VpnTunnel"
  100621. // },
  100622. // "response": {
  100623. // "$ref": "Operation"
  100624. // },
  100625. // "scopes": [
  100626. // "https://www.googleapis.com/auth/cloud-platform",
  100627. // "https://www.googleapis.com/auth/compute"
  100628. // ]
  100629. // }
  100630. }
  100631. // method id "compute.vpnTunnels.list":
  100632. type VpnTunnelsListCall struct {
  100633. s *Service
  100634. project string
  100635. region string
  100636. urlParams_ gensupport.URLParams
  100637. ifNoneMatch_ string
  100638. ctx_ context.Context
  100639. header_ http.Header
  100640. }
  100641. // List: Retrieves a list of VpnTunnel resources contained in the
  100642. // specified project and region.
  100643. func (r *VpnTunnelsService) List(project string, region string) *VpnTunnelsListCall {
  100644. c := &VpnTunnelsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  100645. c.project = project
  100646. c.region = region
  100647. return c
  100648. }
  100649. // Filter sets the optional parameter "filter": A filter expression that
  100650. // filters resources listed in the response. The expression must specify
  100651. // the field name, a comparison operator, and the value that you want to
  100652. // use for filtering. The value must be a string, a number, or a
  100653. // boolean. The comparison operator must be either =, !=, >, or <.
  100654. //
  100655. // For example, if you are filtering Compute Engine instances, you can
  100656. // exclude instances named example-instance by specifying name !=
  100657. // example-instance.
  100658. //
  100659. // You can also filter nested fields. For example, you could specify
  100660. // scheduling.automaticRestart = false to include instances only if they
  100661. // are not scheduled for automatic restarts. You can use filtering on
  100662. // nested fields to filter based on resource labels.
  100663. //
  100664. // To filter on multiple expressions, provide each separate expression
  100665. // within parentheses. For example, (scheduling.automaticRestart = true)
  100666. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  100667. // AND expression. However, you can include AND and OR expressions
  100668. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  100669. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  100670. // true).
  100671. func (c *VpnTunnelsListCall) Filter(filter string) *VpnTunnelsListCall {
  100672. c.urlParams_.Set("filter", filter)
  100673. return c
  100674. }
  100675. // MaxResults sets the optional parameter "maxResults": The maximum
  100676. // number of results per page that should be returned. If the number of
  100677. // available results is larger than maxResults, Compute Engine returns a
  100678. // nextPageToken that can be used to get the next page of results in
  100679. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  100680. // (Default: 500)
  100681. func (c *VpnTunnelsListCall) MaxResults(maxResults int64) *VpnTunnelsListCall {
  100682. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  100683. return c
  100684. }
  100685. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  100686. // a certain order. By default, results are returned in alphanumerical
  100687. // order based on the resource name.
  100688. //
  100689. // You can also sort results in descending order based on the creation
  100690. // timestamp using orderBy="creationTimestamp desc". This sorts results
  100691. // based on the creationTimestamp field in reverse chronological order
  100692. // (newest result first). Use this to sort resources like operations so
  100693. // that the newest operation is returned first.
  100694. //
  100695. // Currently, only sorting by name or creationTimestamp desc is
  100696. // supported.
  100697. func (c *VpnTunnelsListCall) OrderBy(orderBy string) *VpnTunnelsListCall {
  100698. c.urlParams_.Set("orderBy", orderBy)
  100699. return c
  100700. }
  100701. // PageToken sets the optional parameter "pageToken": Specifies a page
  100702. // token to use. Set pageToken to the nextPageToken returned by a
  100703. // previous list request to get the next page of results.
  100704. func (c *VpnTunnelsListCall) PageToken(pageToken string) *VpnTunnelsListCall {
  100705. c.urlParams_.Set("pageToken", pageToken)
  100706. return c
  100707. }
  100708. // Fields allows partial responses to be retrieved. See
  100709. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  100710. // for more information.
  100711. func (c *VpnTunnelsListCall) Fields(s ...googleapi.Field) *VpnTunnelsListCall {
  100712. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  100713. return c
  100714. }
  100715. // IfNoneMatch sets the optional parameter which makes the operation
  100716. // fail if the object's ETag matches the given value. This is useful for
  100717. // getting updates only after the object has changed since the last
  100718. // request. Use googleapi.IsNotModified to check whether the response
  100719. // error from Do is the result of In-None-Match.
  100720. func (c *VpnTunnelsListCall) IfNoneMatch(entityTag string) *VpnTunnelsListCall {
  100721. c.ifNoneMatch_ = entityTag
  100722. return c
  100723. }
  100724. // Context sets the context to be used in this call's Do method. Any
  100725. // pending HTTP request will be aborted if the provided context is
  100726. // canceled.
  100727. func (c *VpnTunnelsListCall) Context(ctx context.Context) *VpnTunnelsListCall {
  100728. c.ctx_ = ctx
  100729. return c
  100730. }
  100731. // Header returns an http.Header that can be modified by the caller to
  100732. // add HTTP headers to the request.
  100733. func (c *VpnTunnelsListCall) Header() http.Header {
  100734. if c.header_ == nil {
  100735. c.header_ = make(http.Header)
  100736. }
  100737. return c.header_
  100738. }
  100739. func (c *VpnTunnelsListCall) doRequest(alt string) (*http.Response, error) {
  100740. reqHeaders := make(http.Header)
  100741. for k, v := range c.header_ {
  100742. reqHeaders[k] = v
  100743. }
  100744. reqHeaders.Set("User-Agent", c.s.userAgent())
  100745. if c.ifNoneMatch_ != "" {
  100746. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  100747. }
  100748. var body io.Reader = nil
  100749. c.urlParams_.Set("alt", alt)
  100750. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/vpnTunnels")
  100751. urls += "?" + c.urlParams_.Encode()
  100752. req, _ := http.NewRequest("GET", urls, body)
  100753. req.Header = reqHeaders
  100754. googleapi.Expand(req.URL, map[string]string{
  100755. "project": c.project,
  100756. "region": c.region,
  100757. })
  100758. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  100759. }
  100760. // Do executes the "compute.vpnTunnels.list" call.
  100761. // Exactly one of *VpnTunnelList or error will be non-nil. Any non-2xx
  100762. // status code is an error. Response headers are in either
  100763. // *VpnTunnelList.ServerResponse.Header or (if a response was returned
  100764. // at all) in error.(*googleapi.Error).Header. Use
  100765. // googleapi.IsNotModified to check whether the returned error was
  100766. // because http.StatusNotModified was returned.
  100767. func (c *VpnTunnelsListCall) Do(opts ...googleapi.CallOption) (*VpnTunnelList, error) {
  100768. gensupport.SetOptions(c.urlParams_, opts...)
  100769. res, err := c.doRequest("json")
  100770. if res != nil && res.StatusCode == http.StatusNotModified {
  100771. if res.Body != nil {
  100772. res.Body.Close()
  100773. }
  100774. return nil, &googleapi.Error{
  100775. Code: res.StatusCode,
  100776. Header: res.Header,
  100777. }
  100778. }
  100779. if err != nil {
  100780. return nil, err
  100781. }
  100782. defer googleapi.CloseBody(res)
  100783. if err := googleapi.CheckResponse(res); err != nil {
  100784. return nil, err
  100785. }
  100786. ret := &VpnTunnelList{
  100787. ServerResponse: googleapi.ServerResponse{
  100788. Header: res.Header,
  100789. HTTPStatusCode: res.StatusCode,
  100790. },
  100791. }
  100792. target := &ret
  100793. if err := gensupport.DecodeResponse(target, res); err != nil {
  100794. return nil, err
  100795. }
  100796. return ret, nil
  100797. // {
  100798. // "description": "Retrieves a list of VpnTunnel resources contained in the specified project and region.",
  100799. // "httpMethod": "GET",
  100800. // "id": "compute.vpnTunnels.list",
  100801. // "parameterOrder": [
  100802. // "project",
  100803. // "region"
  100804. // ],
  100805. // "parameters": {
  100806. // "filter": {
  100807. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  100808. // "location": "query",
  100809. // "type": "string"
  100810. // },
  100811. // "maxResults": {
  100812. // "default": "500",
  100813. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  100814. // "format": "uint32",
  100815. // "location": "query",
  100816. // "minimum": "0",
  100817. // "type": "integer"
  100818. // },
  100819. // "orderBy": {
  100820. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  100821. // "location": "query",
  100822. // "type": "string"
  100823. // },
  100824. // "pageToken": {
  100825. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  100826. // "location": "query",
  100827. // "type": "string"
  100828. // },
  100829. // "project": {
  100830. // "description": "Project ID for this request.",
  100831. // "location": "path",
  100832. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  100833. // "required": true,
  100834. // "type": "string"
  100835. // },
  100836. // "region": {
  100837. // "description": "Name of the region for this request.",
  100838. // "location": "path",
  100839. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  100840. // "required": true,
  100841. // "type": "string"
  100842. // }
  100843. // },
  100844. // "path": "{project}/regions/{region}/vpnTunnels",
  100845. // "response": {
  100846. // "$ref": "VpnTunnelList"
  100847. // },
  100848. // "scopes": [
  100849. // "https://www.googleapis.com/auth/cloud-platform",
  100850. // "https://www.googleapis.com/auth/compute",
  100851. // "https://www.googleapis.com/auth/compute.readonly"
  100852. // ]
  100853. // }
  100854. }
  100855. // Pages invokes f for each page of results.
  100856. // A non-nil error returned from f will halt the iteration.
  100857. // The provided context supersedes any context provided to the Context method.
  100858. func (c *VpnTunnelsListCall) Pages(ctx context.Context, f func(*VpnTunnelList) error) error {
  100859. c.ctx_ = ctx
  100860. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  100861. for {
  100862. x, err := c.Do()
  100863. if err != nil {
  100864. return err
  100865. }
  100866. if err := f(x); err != nil {
  100867. return err
  100868. }
  100869. if x.NextPageToken == "" {
  100870. return nil
  100871. }
  100872. c.PageToken(x.NextPageToken)
  100873. }
  100874. }
  100875. // method id "compute.vpnTunnels.setLabels":
  100876. type VpnTunnelsSetLabelsCall struct {
  100877. s *Service
  100878. project string
  100879. region string
  100880. resource string
  100881. regionsetlabelsrequest *RegionSetLabelsRequest
  100882. urlParams_ gensupport.URLParams
  100883. ctx_ context.Context
  100884. header_ http.Header
  100885. }
  100886. // SetLabels: Sets the labels on a VpnTunnel. To learn more about
  100887. // labels, read the Labeling Resources documentation.
  100888. func (r *VpnTunnelsService) SetLabels(project string, region string, resource string, regionsetlabelsrequest *RegionSetLabelsRequest) *VpnTunnelsSetLabelsCall {
  100889. c := &VpnTunnelsSetLabelsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  100890. c.project = project
  100891. c.region = region
  100892. c.resource = resource
  100893. c.regionsetlabelsrequest = regionsetlabelsrequest
  100894. return c
  100895. }
  100896. // RequestId sets the optional parameter "requestId": An optional
  100897. // request ID to identify requests. Specify a unique request ID so that
  100898. // if you must retry your request, the server will know to ignore the
  100899. // request if it has already been completed.
  100900. //
  100901. // For example, consider a situation where you make an initial request
  100902. // and the request times out. If you make the request again with the
  100903. // same request ID, the server can check if original operation with the
  100904. // same request ID was received, and if so, will ignore the second
  100905. // request. This prevents clients from accidentally creating duplicate
  100906. // commitments.
  100907. //
  100908. // The request ID must be a valid UUID with the exception that zero UUID
  100909. // is not supported (00000000-0000-0000-0000-000000000000).
  100910. func (c *VpnTunnelsSetLabelsCall) RequestId(requestId string) *VpnTunnelsSetLabelsCall {
  100911. c.urlParams_.Set("requestId", requestId)
  100912. return c
  100913. }
  100914. // Fields allows partial responses to be retrieved. See
  100915. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  100916. // for more information.
  100917. func (c *VpnTunnelsSetLabelsCall) Fields(s ...googleapi.Field) *VpnTunnelsSetLabelsCall {
  100918. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  100919. return c
  100920. }
  100921. // Context sets the context to be used in this call's Do method. Any
  100922. // pending HTTP request will be aborted if the provided context is
  100923. // canceled.
  100924. func (c *VpnTunnelsSetLabelsCall) Context(ctx context.Context) *VpnTunnelsSetLabelsCall {
  100925. c.ctx_ = ctx
  100926. return c
  100927. }
  100928. // Header returns an http.Header that can be modified by the caller to
  100929. // add HTTP headers to the request.
  100930. func (c *VpnTunnelsSetLabelsCall) Header() http.Header {
  100931. if c.header_ == nil {
  100932. c.header_ = make(http.Header)
  100933. }
  100934. return c.header_
  100935. }
  100936. func (c *VpnTunnelsSetLabelsCall) doRequest(alt string) (*http.Response, error) {
  100937. reqHeaders := make(http.Header)
  100938. for k, v := range c.header_ {
  100939. reqHeaders[k] = v
  100940. }
  100941. reqHeaders.Set("User-Agent", c.s.userAgent())
  100942. var body io.Reader = nil
  100943. body, err := googleapi.WithoutDataWrapper.JSONReader(c.regionsetlabelsrequest)
  100944. if err != nil {
  100945. return nil, err
  100946. }
  100947. reqHeaders.Set("Content-Type", "application/json")
  100948. c.urlParams_.Set("alt", alt)
  100949. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/vpnTunnels/{resource}/setLabels")
  100950. urls += "?" + c.urlParams_.Encode()
  100951. req, _ := http.NewRequest("POST", urls, body)
  100952. req.Header = reqHeaders
  100953. googleapi.Expand(req.URL, map[string]string{
  100954. "project": c.project,
  100955. "region": c.region,
  100956. "resource": c.resource,
  100957. })
  100958. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  100959. }
  100960. // Do executes the "compute.vpnTunnels.setLabels" call.
  100961. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  100962. // status code is an error. Response headers are in either
  100963. // *Operation.ServerResponse.Header or (if a response was returned at
  100964. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  100965. // to check whether the returned error was because
  100966. // http.StatusNotModified was returned.
  100967. func (c *VpnTunnelsSetLabelsCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  100968. gensupport.SetOptions(c.urlParams_, opts...)
  100969. res, err := c.doRequest("json")
  100970. if res != nil && res.StatusCode == http.StatusNotModified {
  100971. if res.Body != nil {
  100972. res.Body.Close()
  100973. }
  100974. return nil, &googleapi.Error{
  100975. Code: res.StatusCode,
  100976. Header: res.Header,
  100977. }
  100978. }
  100979. if err != nil {
  100980. return nil, err
  100981. }
  100982. defer googleapi.CloseBody(res)
  100983. if err := googleapi.CheckResponse(res); err != nil {
  100984. return nil, err
  100985. }
  100986. ret := &Operation{
  100987. ServerResponse: googleapi.ServerResponse{
  100988. Header: res.Header,
  100989. HTTPStatusCode: res.StatusCode,
  100990. },
  100991. }
  100992. target := &ret
  100993. if err := gensupport.DecodeResponse(target, res); err != nil {
  100994. return nil, err
  100995. }
  100996. return ret, nil
  100997. // {
  100998. // "description": "Sets the labels on a VpnTunnel. To learn more about labels, read the Labeling Resources documentation.",
  100999. // "httpMethod": "POST",
  101000. // "id": "compute.vpnTunnels.setLabels",
  101001. // "parameterOrder": [
  101002. // "project",
  101003. // "region",
  101004. // "resource"
  101005. // ],
  101006. // "parameters": {
  101007. // "project": {
  101008. // "description": "Project ID for this request.",
  101009. // "location": "path",
  101010. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  101011. // "required": true,
  101012. // "type": "string"
  101013. // },
  101014. // "region": {
  101015. // "description": "The region for this request.",
  101016. // "location": "path",
  101017. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  101018. // "required": true,
  101019. // "type": "string"
  101020. // },
  101021. // "requestId": {
  101022. // "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.\n\nFor example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.\n\nThe request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).",
  101023. // "location": "query",
  101024. // "type": "string"
  101025. // },
  101026. // "resource": {
  101027. // "description": "Name of the resource for this request.",
  101028. // "location": "path",
  101029. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  101030. // "required": true,
  101031. // "type": "string"
  101032. // }
  101033. // },
  101034. // "path": "{project}/regions/{region}/vpnTunnels/{resource}/setLabels",
  101035. // "request": {
  101036. // "$ref": "RegionSetLabelsRequest"
  101037. // },
  101038. // "response": {
  101039. // "$ref": "Operation"
  101040. // },
  101041. // "scopes": [
  101042. // "https://www.googleapis.com/auth/cloud-platform",
  101043. // "https://www.googleapis.com/auth/compute"
  101044. // ]
  101045. // }
  101046. }
  101047. // method id "compute.vpnTunnels.testIamPermissions":
  101048. type VpnTunnelsTestIamPermissionsCall struct {
  101049. s *Service
  101050. project string
  101051. region string
  101052. resource string
  101053. testpermissionsrequest *TestPermissionsRequest
  101054. urlParams_ gensupport.URLParams
  101055. ctx_ context.Context
  101056. header_ http.Header
  101057. }
  101058. // TestIamPermissions: Returns permissions that a caller has on the
  101059. // specified resource.
  101060. func (r *VpnTunnelsService) TestIamPermissions(project string, region string, resource string, testpermissionsrequest *TestPermissionsRequest) *VpnTunnelsTestIamPermissionsCall {
  101061. c := &VpnTunnelsTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  101062. c.project = project
  101063. c.region = region
  101064. c.resource = resource
  101065. c.testpermissionsrequest = testpermissionsrequest
  101066. return c
  101067. }
  101068. // Fields allows partial responses to be retrieved. See
  101069. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  101070. // for more information.
  101071. func (c *VpnTunnelsTestIamPermissionsCall) Fields(s ...googleapi.Field) *VpnTunnelsTestIamPermissionsCall {
  101072. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  101073. return c
  101074. }
  101075. // Context sets the context to be used in this call's Do method. Any
  101076. // pending HTTP request will be aborted if the provided context is
  101077. // canceled.
  101078. func (c *VpnTunnelsTestIamPermissionsCall) Context(ctx context.Context) *VpnTunnelsTestIamPermissionsCall {
  101079. c.ctx_ = ctx
  101080. return c
  101081. }
  101082. // Header returns an http.Header that can be modified by the caller to
  101083. // add HTTP headers to the request.
  101084. func (c *VpnTunnelsTestIamPermissionsCall) Header() http.Header {
  101085. if c.header_ == nil {
  101086. c.header_ = make(http.Header)
  101087. }
  101088. return c.header_
  101089. }
  101090. func (c *VpnTunnelsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  101091. reqHeaders := make(http.Header)
  101092. for k, v := range c.header_ {
  101093. reqHeaders[k] = v
  101094. }
  101095. reqHeaders.Set("User-Agent", c.s.userAgent())
  101096. var body io.Reader = nil
  101097. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  101098. if err != nil {
  101099. return nil, err
  101100. }
  101101. reqHeaders.Set("Content-Type", "application/json")
  101102. c.urlParams_.Set("alt", alt)
  101103. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/vpnTunnels/{resource}/testIamPermissions")
  101104. urls += "?" + c.urlParams_.Encode()
  101105. req, _ := http.NewRequest("POST", urls, body)
  101106. req.Header = reqHeaders
  101107. googleapi.Expand(req.URL, map[string]string{
  101108. "project": c.project,
  101109. "region": c.region,
  101110. "resource": c.resource,
  101111. })
  101112. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  101113. }
  101114. // Do executes the "compute.vpnTunnels.testIamPermissions" call.
  101115. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  101116. // non-2xx status code is an error. Response headers are in either
  101117. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  101118. // returned at all) in error.(*googleapi.Error).Header. Use
  101119. // googleapi.IsNotModified to check whether the returned error was
  101120. // because http.StatusNotModified was returned.
  101121. func (c *VpnTunnelsTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  101122. gensupport.SetOptions(c.urlParams_, opts...)
  101123. res, err := c.doRequest("json")
  101124. if res != nil && res.StatusCode == http.StatusNotModified {
  101125. if res.Body != nil {
  101126. res.Body.Close()
  101127. }
  101128. return nil, &googleapi.Error{
  101129. Code: res.StatusCode,
  101130. Header: res.Header,
  101131. }
  101132. }
  101133. if err != nil {
  101134. return nil, err
  101135. }
  101136. defer googleapi.CloseBody(res)
  101137. if err := googleapi.CheckResponse(res); err != nil {
  101138. return nil, err
  101139. }
  101140. ret := &TestPermissionsResponse{
  101141. ServerResponse: googleapi.ServerResponse{
  101142. Header: res.Header,
  101143. HTTPStatusCode: res.StatusCode,
  101144. },
  101145. }
  101146. target := &ret
  101147. if err := gensupport.DecodeResponse(target, res); err != nil {
  101148. return nil, err
  101149. }
  101150. return ret, nil
  101151. // {
  101152. // "description": "Returns permissions that a caller has on the specified resource.",
  101153. // "httpMethod": "POST",
  101154. // "id": "compute.vpnTunnels.testIamPermissions",
  101155. // "parameterOrder": [
  101156. // "project",
  101157. // "region",
  101158. // "resource"
  101159. // ],
  101160. // "parameters": {
  101161. // "project": {
  101162. // "description": "Project ID for this request.",
  101163. // "location": "path",
  101164. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  101165. // "required": true,
  101166. // "type": "string"
  101167. // },
  101168. // "region": {
  101169. // "description": "The name of the region for this request.",
  101170. // "location": "path",
  101171. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  101172. // "required": true,
  101173. // "type": "string"
  101174. // },
  101175. // "resource": {
  101176. // "description": "Name of the resource for this request.",
  101177. // "location": "path",
  101178. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  101179. // "required": true,
  101180. // "type": "string"
  101181. // }
  101182. // },
  101183. // "path": "{project}/regions/{region}/vpnTunnels/{resource}/testIamPermissions",
  101184. // "request": {
  101185. // "$ref": "TestPermissionsRequest"
  101186. // },
  101187. // "response": {
  101188. // "$ref": "TestPermissionsResponse"
  101189. // },
  101190. // "scopes": [
  101191. // "https://www.googleapis.com/auth/cloud-platform",
  101192. // "https://www.googleapis.com/auth/compute",
  101193. // "https://www.googleapis.com/auth/compute.readonly"
  101194. // ]
  101195. // }
  101196. }
  101197. // method id "compute.zoneOperations.delete":
  101198. type ZoneOperationsDeleteCall struct {
  101199. s *Service
  101200. project string
  101201. zone string
  101202. operation string
  101203. urlParams_ gensupport.URLParams
  101204. ctx_ context.Context
  101205. header_ http.Header
  101206. }
  101207. // Delete: Deletes the specified zone-specific Operations resource.
  101208. // For details, see https://cloud.google.com/compute/docs/reference/latest/zoneOperations/delete
  101209. func (r *ZoneOperationsService) Delete(project string, zone string, operation string) *ZoneOperationsDeleteCall {
  101210. c := &ZoneOperationsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  101211. c.project = project
  101212. c.zone = zone
  101213. c.operation = operation
  101214. return c
  101215. }
  101216. // Fields allows partial responses to be retrieved. See
  101217. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  101218. // for more information.
  101219. func (c *ZoneOperationsDeleteCall) Fields(s ...googleapi.Field) *ZoneOperationsDeleteCall {
  101220. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  101221. return c
  101222. }
  101223. // Context sets the context to be used in this call's Do method. Any
  101224. // pending HTTP request will be aborted if the provided context is
  101225. // canceled.
  101226. func (c *ZoneOperationsDeleteCall) Context(ctx context.Context) *ZoneOperationsDeleteCall {
  101227. c.ctx_ = ctx
  101228. return c
  101229. }
  101230. // Header returns an http.Header that can be modified by the caller to
  101231. // add HTTP headers to the request.
  101232. func (c *ZoneOperationsDeleteCall) Header() http.Header {
  101233. if c.header_ == nil {
  101234. c.header_ = make(http.Header)
  101235. }
  101236. return c.header_
  101237. }
  101238. func (c *ZoneOperationsDeleteCall) doRequest(alt string) (*http.Response, error) {
  101239. reqHeaders := make(http.Header)
  101240. for k, v := range c.header_ {
  101241. reqHeaders[k] = v
  101242. }
  101243. reqHeaders.Set("User-Agent", c.s.userAgent())
  101244. var body io.Reader = nil
  101245. c.urlParams_.Set("alt", alt)
  101246. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/operations/{operation}")
  101247. urls += "?" + c.urlParams_.Encode()
  101248. req, _ := http.NewRequest("DELETE", urls, body)
  101249. req.Header = reqHeaders
  101250. googleapi.Expand(req.URL, map[string]string{
  101251. "project": c.project,
  101252. "zone": c.zone,
  101253. "operation": c.operation,
  101254. })
  101255. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  101256. }
  101257. // Do executes the "compute.zoneOperations.delete" call.
  101258. func (c *ZoneOperationsDeleteCall) Do(opts ...googleapi.CallOption) error {
  101259. gensupport.SetOptions(c.urlParams_, opts...)
  101260. res, err := c.doRequest("json")
  101261. if err != nil {
  101262. return err
  101263. }
  101264. defer googleapi.CloseBody(res)
  101265. if err := googleapi.CheckResponse(res); err != nil {
  101266. return err
  101267. }
  101268. return nil
  101269. // {
  101270. // "description": "Deletes the specified zone-specific Operations resource.",
  101271. // "httpMethod": "DELETE",
  101272. // "id": "compute.zoneOperations.delete",
  101273. // "parameterOrder": [
  101274. // "project",
  101275. // "zone",
  101276. // "operation"
  101277. // ],
  101278. // "parameters": {
  101279. // "operation": {
  101280. // "description": "Name of the Operations resource to delete.",
  101281. // "location": "path",
  101282. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  101283. // "required": true,
  101284. // "type": "string"
  101285. // },
  101286. // "project": {
  101287. // "description": "Project ID for this request.",
  101288. // "location": "path",
  101289. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  101290. // "required": true,
  101291. // "type": "string"
  101292. // },
  101293. // "zone": {
  101294. // "description": "Name of the zone for this request.",
  101295. // "location": "path",
  101296. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  101297. // "required": true,
  101298. // "type": "string"
  101299. // }
  101300. // },
  101301. // "path": "{project}/zones/{zone}/operations/{operation}",
  101302. // "scopes": [
  101303. // "https://www.googleapis.com/auth/cloud-platform",
  101304. // "https://www.googleapis.com/auth/compute"
  101305. // ]
  101306. // }
  101307. }
  101308. // method id "compute.zoneOperations.get":
  101309. type ZoneOperationsGetCall struct {
  101310. s *Service
  101311. project string
  101312. zone string
  101313. operation string
  101314. urlParams_ gensupport.URLParams
  101315. ifNoneMatch_ string
  101316. ctx_ context.Context
  101317. header_ http.Header
  101318. }
  101319. // Get: Retrieves the specified zone-specific Operations resource.
  101320. // For details, see https://cloud.google.com/compute/docs/reference/latest/zoneOperations/get
  101321. func (r *ZoneOperationsService) Get(project string, zone string, operation string) *ZoneOperationsGetCall {
  101322. c := &ZoneOperationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  101323. c.project = project
  101324. c.zone = zone
  101325. c.operation = operation
  101326. return c
  101327. }
  101328. // Fields allows partial responses to be retrieved. See
  101329. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  101330. // for more information.
  101331. func (c *ZoneOperationsGetCall) Fields(s ...googleapi.Field) *ZoneOperationsGetCall {
  101332. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  101333. return c
  101334. }
  101335. // IfNoneMatch sets the optional parameter which makes the operation
  101336. // fail if the object's ETag matches the given value. This is useful for
  101337. // getting updates only after the object has changed since the last
  101338. // request. Use googleapi.IsNotModified to check whether the response
  101339. // error from Do is the result of In-None-Match.
  101340. func (c *ZoneOperationsGetCall) IfNoneMatch(entityTag string) *ZoneOperationsGetCall {
  101341. c.ifNoneMatch_ = entityTag
  101342. return c
  101343. }
  101344. // Context sets the context to be used in this call's Do method. Any
  101345. // pending HTTP request will be aborted if the provided context is
  101346. // canceled.
  101347. func (c *ZoneOperationsGetCall) Context(ctx context.Context) *ZoneOperationsGetCall {
  101348. c.ctx_ = ctx
  101349. return c
  101350. }
  101351. // Header returns an http.Header that can be modified by the caller to
  101352. // add HTTP headers to the request.
  101353. func (c *ZoneOperationsGetCall) Header() http.Header {
  101354. if c.header_ == nil {
  101355. c.header_ = make(http.Header)
  101356. }
  101357. return c.header_
  101358. }
  101359. func (c *ZoneOperationsGetCall) doRequest(alt string) (*http.Response, error) {
  101360. reqHeaders := make(http.Header)
  101361. for k, v := range c.header_ {
  101362. reqHeaders[k] = v
  101363. }
  101364. reqHeaders.Set("User-Agent", c.s.userAgent())
  101365. if c.ifNoneMatch_ != "" {
  101366. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  101367. }
  101368. var body io.Reader = nil
  101369. c.urlParams_.Set("alt", alt)
  101370. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/operations/{operation}")
  101371. urls += "?" + c.urlParams_.Encode()
  101372. req, _ := http.NewRequest("GET", urls, body)
  101373. req.Header = reqHeaders
  101374. googleapi.Expand(req.URL, map[string]string{
  101375. "project": c.project,
  101376. "zone": c.zone,
  101377. "operation": c.operation,
  101378. })
  101379. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  101380. }
  101381. // Do executes the "compute.zoneOperations.get" call.
  101382. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  101383. // status code is an error. Response headers are in either
  101384. // *Operation.ServerResponse.Header or (if a response was returned at
  101385. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  101386. // to check whether the returned error was because
  101387. // http.StatusNotModified was returned.
  101388. func (c *ZoneOperationsGetCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  101389. gensupport.SetOptions(c.urlParams_, opts...)
  101390. res, err := c.doRequest("json")
  101391. if res != nil && res.StatusCode == http.StatusNotModified {
  101392. if res.Body != nil {
  101393. res.Body.Close()
  101394. }
  101395. return nil, &googleapi.Error{
  101396. Code: res.StatusCode,
  101397. Header: res.Header,
  101398. }
  101399. }
  101400. if err != nil {
  101401. return nil, err
  101402. }
  101403. defer googleapi.CloseBody(res)
  101404. if err := googleapi.CheckResponse(res); err != nil {
  101405. return nil, err
  101406. }
  101407. ret := &Operation{
  101408. ServerResponse: googleapi.ServerResponse{
  101409. Header: res.Header,
  101410. HTTPStatusCode: res.StatusCode,
  101411. },
  101412. }
  101413. target := &ret
  101414. if err := gensupport.DecodeResponse(target, res); err != nil {
  101415. return nil, err
  101416. }
  101417. return ret, nil
  101418. // {
  101419. // "description": "Retrieves the specified zone-specific Operations resource.",
  101420. // "httpMethod": "GET",
  101421. // "id": "compute.zoneOperations.get",
  101422. // "parameterOrder": [
  101423. // "project",
  101424. // "zone",
  101425. // "operation"
  101426. // ],
  101427. // "parameters": {
  101428. // "operation": {
  101429. // "description": "Name of the Operations resource to return.",
  101430. // "location": "path",
  101431. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  101432. // "required": true,
  101433. // "type": "string"
  101434. // },
  101435. // "project": {
  101436. // "description": "Project ID for this request.",
  101437. // "location": "path",
  101438. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  101439. // "required": true,
  101440. // "type": "string"
  101441. // },
  101442. // "zone": {
  101443. // "description": "Name of the zone for this request.",
  101444. // "location": "path",
  101445. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  101446. // "required": true,
  101447. // "type": "string"
  101448. // }
  101449. // },
  101450. // "path": "{project}/zones/{zone}/operations/{operation}",
  101451. // "response": {
  101452. // "$ref": "Operation"
  101453. // },
  101454. // "scopes": [
  101455. // "https://www.googleapis.com/auth/cloud-platform",
  101456. // "https://www.googleapis.com/auth/compute",
  101457. // "https://www.googleapis.com/auth/compute.readonly"
  101458. // ]
  101459. // }
  101460. }
  101461. // method id "compute.zoneOperations.list":
  101462. type ZoneOperationsListCall struct {
  101463. s *Service
  101464. project string
  101465. zone string
  101466. urlParams_ gensupport.URLParams
  101467. ifNoneMatch_ string
  101468. ctx_ context.Context
  101469. header_ http.Header
  101470. }
  101471. // List: Retrieves a list of Operation resources contained within the
  101472. // specified zone.
  101473. // For details, see https://cloud.google.com/compute/docs/reference/latest/zoneOperations/list
  101474. func (r *ZoneOperationsService) List(project string, zone string) *ZoneOperationsListCall {
  101475. c := &ZoneOperationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  101476. c.project = project
  101477. c.zone = zone
  101478. return c
  101479. }
  101480. // Filter sets the optional parameter "filter": A filter expression that
  101481. // filters resources listed in the response. The expression must specify
  101482. // the field name, a comparison operator, and the value that you want to
  101483. // use for filtering. The value must be a string, a number, or a
  101484. // boolean. The comparison operator must be either =, !=, >, or <.
  101485. //
  101486. // For example, if you are filtering Compute Engine instances, you can
  101487. // exclude instances named example-instance by specifying name !=
  101488. // example-instance.
  101489. //
  101490. // You can also filter nested fields. For example, you could specify
  101491. // scheduling.automaticRestart = false to include instances only if they
  101492. // are not scheduled for automatic restarts. You can use filtering on
  101493. // nested fields to filter based on resource labels.
  101494. //
  101495. // To filter on multiple expressions, provide each separate expression
  101496. // within parentheses. For example, (scheduling.automaticRestart = true)
  101497. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  101498. // AND expression. However, you can include AND and OR expressions
  101499. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  101500. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  101501. // true).
  101502. func (c *ZoneOperationsListCall) Filter(filter string) *ZoneOperationsListCall {
  101503. c.urlParams_.Set("filter", filter)
  101504. return c
  101505. }
  101506. // MaxResults sets the optional parameter "maxResults": The maximum
  101507. // number of results per page that should be returned. If the number of
  101508. // available results is larger than maxResults, Compute Engine returns a
  101509. // nextPageToken that can be used to get the next page of results in
  101510. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  101511. // (Default: 500)
  101512. func (c *ZoneOperationsListCall) MaxResults(maxResults int64) *ZoneOperationsListCall {
  101513. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  101514. return c
  101515. }
  101516. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  101517. // a certain order. By default, results are returned in alphanumerical
  101518. // order based on the resource name.
  101519. //
  101520. // You can also sort results in descending order based on the creation
  101521. // timestamp using orderBy="creationTimestamp desc". This sorts results
  101522. // based on the creationTimestamp field in reverse chronological order
  101523. // (newest result first). Use this to sort resources like operations so
  101524. // that the newest operation is returned first.
  101525. //
  101526. // Currently, only sorting by name or creationTimestamp desc is
  101527. // supported.
  101528. func (c *ZoneOperationsListCall) OrderBy(orderBy string) *ZoneOperationsListCall {
  101529. c.urlParams_.Set("orderBy", orderBy)
  101530. return c
  101531. }
  101532. // PageToken sets the optional parameter "pageToken": Specifies a page
  101533. // token to use. Set pageToken to the nextPageToken returned by a
  101534. // previous list request to get the next page of results.
  101535. func (c *ZoneOperationsListCall) PageToken(pageToken string) *ZoneOperationsListCall {
  101536. c.urlParams_.Set("pageToken", pageToken)
  101537. return c
  101538. }
  101539. // Fields allows partial responses to be retrieved. See
  101540. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  101541. // for more information.
  101542. func (c *ZoneOperationsListCall) Fields(s ...googleapi.Field) *ZoneOperationsListCall {
  101543. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  101544. return c
  101545. }
  101546. // IfNoneMatch sets the optional parameter which makes the operation
  101547. // fail if the object's ETag matches the given value. This is useful for
  101548. // getting updates only after the object has changed since the last
  101549. // request. Use googleapi.IsNotModified to check whether the response
  101550. // error from Do is the result of In-None-Match.
  101551. func (c *ZoneOperationsListCall) IfNoneMatch(entityTag string) *ZoneOperationsListCall {
  101552. c.ifNoneMatch_ = entityTag
  101553. return c
  101554. }
  101555. // Context sets the context to be used in this call's Do method. Any
  101556. // pending HTTP request will be aborted if the provided context is
  101557. // canceled.
  101558. func (c *ZoneOperationsListCall) Context(ctx context.Context) *ZoneOperationsListCall {
  101559. c.ctx_ = ctx
  101560. return c
  101561. }
  101562. // Header returns an http.Header that can be modified by the caller to
  101563. // add HTTP headers to the request.
  101564. func (c *ZoneOperationsListCall) Header() http.Header {
  101565. if c.header_ == nil {
  101566. c.header_ = make(http.Header)
  101567. }
  101568. return c.header_
  101569. }
  101570. func (c *ZoneOperationsListCall) doRequest(alt string) (*http.Response, error) {
  101571. reqHeaders := make(http.Header)
  101572. for k, v := range c.header_ {
  101573. reqHeaders[k] = v
  101574. }
  101575. reqHeaders.Set("User-Agent", c.s.userAgent())
  101576. if c.ifNoneMatch_ != "" {
  101577. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  101578. }
  101579. var body io.Reader = nil
  101580. c.urlParams_.Set("alt", alt)
  101581. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/operations")
  101582. urls += "?" + c.urlParams_.Encode()
  101583. req, _ := http.NewRequest("GET", urls, body)
  101584. req.Header = reqHeaders
  101585. googleapi.Expand(req.URL, map[string]string{
  101586. "project": c.project,
  101587. "zone": c.zone,
  101588. })
  101589. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  101590. }
  101591. // Do executes the "compute.zoneOperations.list" call.
  101592. // Exactly one of *OperationList or error will be non-nil. Any non-2xx
  101593. // status code is an error. Response headers are in either
  101594. // *OperationList.ServerResponse.Header or (if a response was returned
  101595. // at all) in error.(*googleapi.Error).Header. Use
  101596. // googleapi.IsNotModified to check whether the returned error was
  101597. // because http.StatusNotModified was returned.
  101598. func (c *ZoneOperationsListCall) Do(opts ...googleapi.CallOption) (*OperationList, error) {
  101599. gensupport.SetOptions(c.urlParams_, opts...)
  101600. res, err := c.doRequest("json")
  101601. if res != nil && res.StatusCode == http.StatusNotModified {
  101602. if res.Body != nil {
  101603. res.Body.Close()
  101604. }
  101605. return nil, &googleapi.Error{
  101606. Code: res.StatusCode,
  101607. Header: res.Header,
  101608. }
  101609. }
  101610. if err != nil {
  101611. return nil, err
  101612. }
  101613. defer googleapi.CloseBody(res)
  101614. if err := googleapi.CheckResponse(res); err != nil {
  101615. return nil, err
  101616. }
  101617. ret := &OperationList{
  101618. ServerResponse: googleapi.ServerResponse{
  101619. Header: res.Header,
  101620. HTTPStatusCode: res.StatusCode,
  101621. },
  101622. }
  101623. target := &ret
  101624. if err := gensupport.DecodeResponse(target, res); err != nil {
  101625. return nil, err
  101626. }
  101627. return ret, nil
  101628. // {
  101629. // "description": "Retrieves a list of Operation resources contained within the specified zone.",
  101630. // "httpMethod": "GET",
  101631. // "id": "compute.zoneOperations.list",
  101632. // "parameterOrder": [
  101633. // "project",
  101634. // "zone"
  101635. // ],
  101636. // "parameters": {
  101637. // "filter": {
  101638. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  101639. // "location": "query",
  101640. // "type": "string"
  101641. // },
  101642. // "maxResults": {
  101643. // "default": "500",
  101644. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  101645. // "format": "uint32",
  101646. // "location": "query",
  101647. // "minimum": "0",
  101648. // "type": "integer"
  101649. // },
  101650. // "orderBy": {
  101651. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  101652. // "location": "query",
  101653. // "type": "string"
  101654. // },
  101655. // "pageToken": {
  101656. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  101657. // "location": "query",
  101658. // "type": "string"
  101659. // },
  101660. // "project": {
  101661. // "description": "Project ID for this request.",
  101662. // "location": "path",
  101663. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  101664. // "required": true,
  101665. // "type": "string"
  101666. // },
  101667. // "zone": {
  101668. // "description": "Name of the zone for request.",
  101669. // "location": "path",
  101670. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  101671. // "required": true,
  101672. // "type": "string"
  101673. // }
  101674. // },
  101675. // "path": "{project}/zones/{zone}/operations",
  101676. // "response": {
  101677. // "$ref": "OperationList"
  101678. // },
  101679. // "scopes": [
  101680. // "https://www.googleapis.com/auth/cloud-platform",
  101681. // "https://www.googleapis.com/auth/compute",
  101682. // "https://www.googleapis.com/auth/compute.readonly"
  101683. // ]
  101684. // }
  101685. }
  101686. // Pages invokes f for each page of results.
  101687. // A non-nil error returned from f will halt the iteration.
  101688. // The provided context supersedes any context provided to the Context method.
  101689. func (c *ZoneOperationsListCall) Pages(ctx context.Context, f func(*OperationList) error) error {
  101690. c.ctx_ = ctx
  101691. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  101692. for {
  101693. x, err := c.Do()
  101694. if err != nil {
  101695. return err
  101696. }
  101697. if err := f(x); err != nil {
  101698. return err
  101699. }
  101700. if x.NextPageToken == "" {
  101701. return nil
  101702. }
  101703. c.PageToken(x.NextPageToken)
  101704. }
  101705. }
  101706. // method id "compute.zones.get":
  101707. type ZonesGetCall struct {
  101708. s *Service
  101709. project string
  101710. zone string
  101711. urlParams_ gensupport.URLParams
  101712. ifNoneMatch_ string
  101713. ctx_ context.Context
  101714. header_ http.Header
  101715. }
  101716. // Get: Returns the specified Zone resource. Gets a list of available
  101717. // zones by making a list() request.
  101718. // For details, see https://cloud.google.com/compute/docs/reference/latest/zones/get
  101719. func (r *ZonesService) Get(project string, zone string) *ZonesGetCall {
  101720. c := &ZonesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  101721. c.project = project
  101722. c.zone = zone
  101723. return c
  101724. }
  101725. // Fields allows partial responses to be retrieved. See
  101726. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  101727. // for more information.
  101728. func (c *ZonesGetCall) Fields(s ...googleapi.Field) *ZonesGetCall {
  101729. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  101730. return c
  101731. }
  101732. // IfNoneMatch sets the optional parameter which makes the operation
  101733. // fail if the object's ETag matches the given value. This is useful for
  101734. // getting updates only after the object has changed since the last
  101735. // request. Use googleapi.IsNotModified to check whether the response
  101736. // error from Do is the result of In-None-Match.
  101737. func (c *ZonesGetCall) IfNoneMatch(entityTag string) *ZonesGetCall {
  101738. c.ifNoneMatch_ = entityTag
  101739. return c
  101740. }
  101741. // Context sets the context to be used in this call's Do method. Any
  101742. // pending HTTP request will be aborted if the provided context is
  101743. // canceled.
  101744. func (c *ZonesGetCall) Context(ctx context.Context) *ZonesGetCall {
  101745. c.ctx_ = ctx
  101746. return c
  101747. }
  101748. // Header returns an http.Header that can be modified by the caller to
  101749. // add HTTP headers to the request.
  101750. func (c *ZonesGetCall) Header() http.Header {
  101751. if c.header_ == nil {
  101752. c.header_ = make(http.Header)
  101753. }
  101754. return c.header_
  101755. }
  101756. func (c *ZonesGetCall) doRequest(alt string) (*http.Response, error) {
  101757. reqHeaders := make(http.Header)
  101758. for k, v := range c.header_ {
  101759. reqHeaders[k] = v
  101760. }
  101761. reqHeaders.Set("User-Agent", c.s.userAgent())
  101762. if c.ifNoneMatch_ != "" {
  101763. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  101764. }
  101765. var body io.Reader = nil
  101766. c.urlParams_.Set("alt", alt)
  101767. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}")
  101768. urls += "?" + c.urlParams_.Encode()
  101769. req, _ := http.NewRequest("GET", urls, body)
  101770. req.Header = reqHeaders
  101771. googleapi.Expand(req.URL, map[string]string{
  101772. "project": c.project,
  101773. "zone": c.zone,
  101774. })
  101775. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  101776. }
  101777. // Do executes the "compute.zones.get" call.
  101778. // Exactly one of *Zone or error will be non-nil. Any non-2xx status
  101779. // code is an error. Response headers are in either
  101780. // *Zone.ServerResponse.Header or (if a response was returned at all) in
  101781. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  101782. // whether the returned error was because http.StatusNotModified was
  101783. // returned.
  101784. func (c *ZonesGetCall) Do(opts ...googleapi.CallOption) (*Zone, error) {
  101785. gensupport.SetOptions(c.urlParams_, opts...)
  101786. res, err := c.doRequest("json")
  101787. if res != nil && res.StatusCode == http.StatusNotModified {
  101788. if res.Body != nil {
  101789. res.Body.Close()
  101790. }
  101791. return nil, &googleapi.Error{
  101792. Code: res.StatusCode,
  101793. Header: res.Header,
  101794. }
  101795. }
  101796. if err != nil {
  101797. return nil, err
  101798. }
  101799. defer googleapi.CloseBody(res)
  101800. if err := googleapi.CheckResponse(res); err != nil {
  101801. return nil, err
  101802. }
  101803. ret := &Zone{
  101804. ServerResponse: googleapi.ServerResponse{
  101805. Header: res.Header,
  101806. HTTPStatusCode: res.StatusCode,
  101807. },
  101808. }
  101809. target := &ret
  101810. if err := gensupport.DecodeResponse(target, res); err != nil {
  101811. return nil, err
  101812. }
  101813. return ret, nil
  101814. // {
  101815. // "description": "Returns the specified Zone resource. Gets a list of available zones by making a list() request.",
  101816. // "httpMethod": "GET",
  101817. // "id": "compute.zones.get",
  101818. // "parameterOrder": [
  101819. // "project",
  101820. // "zone"
  101821. // ],
  101822. // "parameters": {
  101823. // "project": {
  101824. // "description": "Project ID for this request.",
  101825. // "location": "path",
  101826. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  101827. // "required": true,
  101828. // "type": "string"
  101829. // },
  101830. // "zone": {
  101831. // "description": "Name of the zone resource to return.",
  101832. // "location": "path",
  101833. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  101834. // "required": true,
  101835. // "type": "string"
  101836. // }
  101837. // },
  101838. // "path": "{project}/zones/{zone}",
  101839. // "response": {
  101840. // "$ref": "Zone"
  101841. // },
  101842. // "scopes": [
  101843. // "https://www.googleapis.com/auth/cloud-platform",
  101844. // "https://www.googleapis.com/auth/compute",
  101845. // "https://www.googleapis.com/auth/compute.readonly"
  101846. // ]
  101847. // }
  101848. }
  101849. // method id "compute.zones.list":
  101850. type ZonesListCall struct {
  101851. s *Service
  101852. project string
  101853. urlParams_ gensupport.URLParams
  101854. ifNoneMatch_ string
  101855. ctx_ context.Context
  101856. header_ http.Header
  101857. }
  101858. // List: Retrieves the list of Zone resources available to the specified
  101859. // project.
  101860. // For details, see https://cloud.google.com/compute/docs/reference/latest/zones/list
  101861. func (r *ZonesService) List(project string) *ZonesListCall {
  101862. c := &ZonesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  101863. c.project = project
  101864. return c
  101865. }
  101866. // Filter sets the optional parameter "filter": A filter expression that
  101867. // filters resources listed in the response. The expression must specify
  101868. // the field name, a comparison operator, and the value that you want to
  101869. // use for filtering. The value must be a string, a number, or a
  101870. // boolean. The comparison operator must be either =, !=, >, or <.
  101871. //
  101872. // For example, if you are filtering Compute Engine instances, you can
  101873. // exclude instances named example-instance by specifying name !=
  101874. // example-instance.
  101875. //
  101876. // You can also filter nested fields. For example, you could specify
  101877. // scheduling.automaticRestart = false to include instances only if they
  101878. // are not scheduled for automatic restarts. You can use filtering on
  101879. // nested fields to filter based on resource labels.
  101880. //
  101881. // To filter on multiple expressions, provide each separate expression
  101882. // within parentheses. For example, (scheduling.automaticRestart = true)
  101883. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  101884. // AND expression. However, you can include AND and OR expressions
  101885. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  101886. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  101887. // true).
  101888. func (c *ZonesListCall) Filter(filter string) *ZonesListCall {
  101889. c.urlParams_.Set("filter", filter)
  101890. return c
  101891. }
  101892. // MaxResults sets the optional parameter "maxResults": The maximum
  101893. // number of results per page that should be returned. If the number of
  101894. // available results is larger than maxResults, Compute Engine returns a
  101895. // nextPageToken that can be used to get the next page of results in
  101896. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  101897. // (Default: 500)
  101898. func (c *ZonesListCall) MaxResults(maxResults int64) *ZonesListCall {
  101899. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  101900. return c
  101901. }
  101902. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  101903. // a certain order. By default, results are returned in alphanumerical
  101904. // order based on the resource name.
  101905. //
  101906. // You can also sort results in descending order based on the creation
  101907. // timestamp using orderBy="creationTimestamp desc". This sorts results
  101908. // based on the creationTimestamp field in reverse chronological order
  101909. // (newest result first). Use this to sort resources like operations so
  101910. // that the newest operation is returned first.
  101911. //
  101912. // Currently, only sorting by name or creationTimestamp desc is
  101913. // supported.
  101914. func (c *ZonesListCall) OrderBy(orderBy string) *ZonesListCall {
  101915. c.urlParams_.Set("orderBy", orderBy)
  101916. return c
  101917. }
  101918. // PageToken sets the optional parameter "pageToken": Specifies a page
  101919. // token to use. Set pageToken to the nextPageToken returned by a
  101920. // previous list request to get the next page of results.
  101921. func (c *ZonesListCall) PageToken(pageToken string) *ZonesListCall {
  101922. c.urlParams_.Set("pageToken", pageToken)
  101923. return c
  101924. }
  101925. // Fields allows partial responses to be retrieved. See
  101926. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  101927. // for more information.
  101928. func (c *ZonesListCall) Fields(s ...googleapi.Field) *ZonesListCall {
  101929. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  101930. return c
  101931. }
  101932. // IfNoneMatch sets the optional parameter which makes the operation
  101933. // fail if the object's ETag matches the given value. This is useful for
  101934. // getting updates only after the object has changed since the last
  101935. // request. Use googleapi.IsNotModified to check whether the response
  101936. // error from Do is the result of In-None-Match.
  101937. func (c *ZonesListCall) IfNoneMatch(entityTag string) *ZonesListCall {
  101938. c.ifNoneMatch_ = entityTag
  101939. return c
  101940. }
  101941. // Context sets the context to be used in this call's Do method. Any
  101942. // pending HTTP request will be aborted if the provided context is
  101943. // canceled.
  101944. func (c *ZonesListCall) Context(ctx context.Context) *ZonesListCall {
  101945. c.ctx_ = ctx
  101946. return c
  101947. }
  101948. // Header returns an http.Header that can be modified by the caller to
  101949. // add HTTP headers to the request.
  101950. func (c *ZonesListCall) Header() http.Header {
  101951. if c.header_ == nil {
  101952. c.header_ = make(http.Header)
  101953. }
  101954. return c.header_
  101955. }
  101956. func (c *ZonesListCall) doRequest(alt string) (*http.Response, error) {
  101957. reqHeaders := make(http.Header)
  101958. for k, v := range c.header_ {
  101959. reqHeaders[k] = v
  101960. }
  101961. reqHeaders.Set("User-Agent", c.s.userAgent())
  101962. if c.ifNoneMatch_ != "" {
  101963. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  101964. }
  101965. var body io.Reader = nil
  101966. c.urlParams_.Set("alt", alt)
  101967. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones")
  101968. urls += "?" + c.urlParams_.Encode()
  101969. req, _ := http.NewRequest("GET", urls, body)
  101970. req.Header = reqHeaders
  101971. googleapi.Expand(req.URL, map[string]string{
  101972. "project": c.project,
  101973. })
  101974. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  101975. }
  101976. // Do executes the "compute.zones.list" call.
  101977. // Exactly one of *ZoneList or error will be non-nil. Any non-2xx status
  101978. // code is an error. Response headers are in either
  101979. // *ZoneList.ServerResponse.Header or (if a response was returned at
  101980. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  101981. // to check whether the returned error was because
  101982. // http.StatusNotModified was returned.
  101983. func (c *ZonesListCall) Do(opts ...googleapi.CallOption) (*ZoneList, error) {
  101984. gensupport.SetOptions(c.urlParams_, opts...)
  101985. res, err := c.doRequest("json")
  101986. if res != nil && res.StatusCode == http.StatusNotModified {
  101987. if res.Body != nil {
  101988. res.Body.Close()
  101989. }
  101990. return nil, &googleapi.Error{
  101991. Code: res.StatusCode,
  101992. Header: res.Header,
  101993. }
  101994. }
  101995. if err != nil {
  101996. return nil, err
  101997. }
  101998. defer googleapi.CloseBody(res)
  101999. if err := googleapi.CheckResponse(res); err != nil {
  102000. return nil, err
  102001. }
  102002. ret := &ZoneList{
  102003. ServerResponse: googleapi.ServerResponse{
  102004. Header: res.Header,
  102005. HTTPStatusCode: res.StatusCode,
  102006. },
  102007. }
  102008. target := &ret
  102009. if err := gensupport.DecodeResponse(target, res); err != nil {
  102010. return nil, err
  102011. }
  102012. return ret, nil
  102013. // {
  102014. // "description": "Retrieves the list of Zone resources available to the specified project.",
  102015. // "httpMethod": "GET",
  102016. // "id": "compute.zones.list",
  102017. // "parameterOrder": [
  102018. // "project"
  102019. // ],
  102020. // "parameters": {
  102021. // "filter": {
  102022. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  102023. // "location": "query",
  102024. // "type": "string"
  102025. // },
  102026. // "maxResults": {
  102027. // "default": "500",
  102028. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  102029. // "format": "uint32",
  102030. // "location": "query",
  102031. // "minimum": "0",
  102032. // "type": "integer"
  102033. // },
  102034. // "orderBy": {
  102035. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  102036. // "location": "query",
  102037. // "type": "string"
  102038. // },
  102039. // "pageToken": {
  102040. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  102041. // "location": "query",
  102042. // "type": "string"
  102043. // },
  102044. // "project": {
  102045. // "description": "Project ID for this request.",
  102046. // "location": "path",
  102047. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  102048. // "required": true,
  102049. // "type": "string"
  102050. // }
  102051. // },
  102052. // "path": "{project}/zones",
  102053. // "response": {
  102054. // "$ref": "ZoneList"
  102055. // },
  102056. // "scopes": [
  102057. // "https://www.googleapis.com/auth/cloud-platform",
  102058. // "https://www.googleapis.com/auth/compute",
  102059. // "https://www.googleapis.com/auth/compute.readonly"
  102060. // ]
  102061. // }
  102062. }
  102063. // Pages invokes f for each page of results.
  102064. // A non-nil error returned from f will halt the iteration.
  102065. // The provided context supersedes any context provided to the Context method.
  102066. func (c *ZonesListCall) Pages(ctx context.Context, f func(*ZoneList) error) error {
  102067. c.ctx_ = ctx
  102068. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  102069. for {
  102070. x, err := c.Do()
  102071. if err != nil {
  102072. return err
  102073. }
  102074. if err := f(x); err != nil {
  102075. return err
  102076. }
  102077. if x.NextPageToken == "" {
  102078. return nil
  102079. }
  102080. c.PageToken(x.NextPageToken)
  102081. }
  102082. }