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.
 
 
 

2856 lines
104 KiB

  1. // Copyright 2019 Google LLC.
  2. // Use of this source code is governed by a BSD-style
  3. // license that can be found in the LICENSE file.
  4. // Code generated file. DO NOT EDIT.
  5. // Package composer provides access to the Cloud Composer API.
  6. //
  7. // For product documentation, see: https://cloud.google.com/composer/
  8. //
  9. // Creating a client
  10. //
  11. // Usage example:
  12. //
  13. // import "google.golang.org/api/composer/v1beta1"
  14. // ...
  15. // ctx := context.Background()
  16. // composerService, err := composer.NewService(ctx)
  17. //
  18. // In this example, Google Application Default Credentials are used for authentication.
  19. //
  20. // For information on how to create and obtain Application Default Credentials, see https://developers.google.com/identity/protocols/application-default-credentials.
  21. //
  22. // Other authentication options
  23. //
  24. // To use an API key for authentication (note: some APIs do not support API keys), use option.WithAPIKey:
  25. //
  26. // composerService, err := composer.NewService(ctx, option.WithAPIKey("AIza..."))
  27. //
  28. // To use an OAuth token (e.g., a user token obtained via a three-legged OAuth flow), use option.WithTokenSource:
  29. //
  30. // config := &oauth2.Config{...}
  31. // // ...
  32. // token, err := config.Exchange(ctx, ...)
  33. // composerService, err := composer.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token)))
  34. //
  35. // See https://godoc.org/google.golang.org/api/option/ for details on options.
  36. package composer // import "google.golang.org/api/composer/v1beta1"
  37. import (
  38. "bytes"
  39. "context"
  40. "encoding/json"
  41. "errors"
  42. "fmt"
  43. "io"
  44. "net/http"
  45. "net/url"
  46. "strconv"
  47. "strings"
  48. gensupport "google.golang.org/api/gensupport"
  49. googleapi "google.golang.org/api/googleapi"
  50. option "google.golang.org/api/option"
  51. htransport "google.golang.org/api/transport/http"
  52. )
  53. // Always reference these packages, just in case the auto-generated code
  54. // below doesn't.
  55. var _ = bytes.NewBuffer
  56. var _ = strconv.Itoa
  57. var _ = fmt.Sprintf
  58. var _ = json.NewDecoder
  59. var _ = io.Copy
  60. var _ = url.Parse
  61. var _ = gensupport.MarshalJSON
  62. var _ = googleapi.Version
  63. var _ = errors.New
  64. var _ = strings.Replace
  65. var _ = context.Canceled
  66. const apiId = "composer:v1beta1"
  67. const apiName = "composer"
  68. const apiVersion = "v1beta1"
  69. const basePath = "https://composer.googleapis.com/"
  70. // OAuth2 scopes used by this API.
  71. const (
  72. // View and manage your data across Google Cloud Platform services
  73. CloudPlatformScope = "https://www.googleapis.com/auth/cloud-platform"
  74. )
  75. // NewService creates a new Service.
  76. func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, error) {
  77. scopesOption := option.WithScopes(
  78. "https://www.googleapis.com/auth/cloud-platform",
  79. )
  80. // NOTE: prepend, so we don't override user-specified scopes.
  81. opts = append([]option.ClientOption{scopesOption}, opts...)
  82. client, endpoint, err := htransport.NewClient(ctx, opts...)
  83. if err != nil {
  84. return nil, err
  85. }
  86. s, err := New(client)
  87. if err != nil {
  88. return nil, err
  89. }
  90. if endpoint != "" {
  91. s.BasePath = endpoint
  92. }
  93. return s, nil
  94. }
  95. // New creates a new Service. It uses the provided http.Client for requests.
  96. //
  97. // Deprecated: please use NewService instead.
  98. // To provide a custom HTTP client, use option.WithHTTPClient.
  99. // If you are using google.golang.org/api/googleapis/transport.APIKey, use option.WithAPIKey with NewService instead.
  100. func New(client *http.Client) (*Service, error) {
  101. if client == nil {
  102. return nil, errors.New("client is nil")
  103. }
  104. s := &Service{client: client, BasePath: basePath}
  105. s.Projects = NewProjectsService(s)
  106. return s, nil
  107. }
  108. type Service struct {
  109. client *http.Client
  110. BasePath string // API endpoint base URL
  111. UserAgent string // optional additional User-Agent fragment
  112. Projects *ProjectsService
  113. }
  114. func (s *Service) userAgent() string {
  115. if s.UserAgent == "" {
  116. return googleapi.UserAgent
  117. }
  118. return googleapi.UserAgent + " " + s.UserAgent
  119. }
  120. func NewProjectsService(s *Service) *ProjectsService {
  121. rs := &ProjectsService{s: s}
  122. rs.Locations = NewProjectsLocationsService(s)
  123. return rs
  124. }
  125. type ProjectsService struct {
  126. s *Service
  127. Locations *ProjectsLocationsService
  128. }
  129. func NewProjectsLocationsService(s *Service) *ProjectsLocationsService {
  130. rs := &ProjectsLocationsService{s: s}
  131. rs.Environments = NewProjectsLocationsEnvironmentsService(s)
  132. rs.ImageVersions = NewProjectsLocationsImageVersionsService(s)
  133. rs.Operations = NewProjectsLocationsOperationsService(s)
  134. return rs
  135. }
  136. type ProjectsLocationsService struct {
  137. s *Service
  138. Environments *ProjectsLocationsEnvironmentsService
  139. ImageVersions *ProjectsLocationsImageVersionsService
  140. Operations *ProjectsLocationsOperationsService
  141. }
  142. func NewProjectsLocationsEnvironmentsService(s *Service) *ProjectsLocationsEnvironmentsService {
  143. rs := &ProjectsLocationsEnvironmentsService{s: s}
  144. return rs
  145. }
  146. type ProjectsLocationsEnvironmentsService struct {
  147. s *Service
  148. }
  149. func NewProjectsLocationsImageVersionsService(s *Service) *ProjectsLocationsImageVersionsService {
  150. rs := &ProjectsLocationsImageVersionsService{s: s}
  151. return rs
  152. }
  153. type ProjectsLocationsImageVersionsService struct {
  154. s *Service
  155. }
  156. func NewProjectsLocationsOperationsService(s *Service) *ProjectsLocationsOperationsService {
  157. rs := &ProjectsLocationsOperationsService{s: s}
  158. return rs
  159. }
  160. type ProjectsLocationsOperationsService struct {
  161. s *Service
  162. }
  163. // Empty: A generic empty message that you can re-use to avoid defining
  164. // duplicated
  165. // empty messages in your APIs. A typical example is to use it as the
  166. // request
  167. // or the response type of an API method. For instance:
  168. //
  169. // service Foo {
  170. // rpc Bar(google.protobuf.Empty) returns
  171. // (google.protobuf.Empty);
  172. // }
  173. //
  174. // The JSON representation for `Empty` is empty JSON object `{}`.
  175. type Empty struct {
  176. // ServerResponse contains the HTTP response code and headers from the
  177. // server.
  178. googleapi.ServerResponse `json:"-"`
  179. }
  180. // Environment: An environment for running orchestration tasks.
  181. type Environment struct {
  182. // Config: Configuration parameters for this environment.
  183. Config *EnvironmentConfig `json:"config,omitempty"`
  184. // CreateTime: Output only.
  185. // The time at which this environment was created.
  186. CreateTime string `json:"createTime,omitempty"`
  187. // Labels: Optional. User-defined labels for this environment.
  188. // The labels map can contain no more than 64 entries. Entries of the
  189. // labels
  190. // map are UTF8 strings that comply with the following restrictions:
  191. //
  192. // * Keys must conform to regexp: \p{Ll}\p{Lo}{0,62}
  193. // * Values must conform to regexp: [\p{Ll}\p{Lo}\p{N}_-]{0,63}
  194. // * Both keys and values are additionally constrained to be <= 128
  195. // bytes in
  196. // size.
  197. Labels map[string]string `json:"labels,omitempty"`
  198. // Name: The resource name of the environment, in the
  199. // form:
  200. // "projects/{projectId}/locations/{locationId}/environments/{envir
  201. // onmentId}"
  202. Name string `json:"name,omitempty"`
  203. // State: The current state of the environment.
  204. //
  205. // Possible values:
  206. // "STATE_UNSPECIFIED" - The state of the environment is unknown.
  207. // "CREATING" - The environment is in the process of being created.
  208. // "RUNNING" - The environment is currently running and healthy. It is
  209. // ready for use.
  210. // "UPDATING" - The environment is being updated. It remains usable
  211. // but cannot receive
  212. // additional update requests or be deleted at this time.
  213. // "DELETING" - The environment is undergoing deletion. It cannot be
  214. // used.
  215. // "ERROR" - The environment has encountered an error and cannot be
  216. // used.
  217. State string `json:"state,omitempty"`
  218. // UpdateTime: Output only.
  219. // The time at which this environment was last modified.
  220. UpdateTime string `json:"updateTime,omitempty"`
  221. // Uuid: Output only.
  222. // The UUID (Universally Unique IDentifier) associated with this
  223. // environment.
  224. // This value is generated when the environment is created.
  225. Uuid string `json:"uuid,omitempty"`
  226. // ServerResponse contains the HTTP response code and headers from the
  227. // server.
  228. googleapi.ServerResponse `json:"-"`
  229. // ForceSendFields is a list of field names (e.g. "Config") to
  230. // unconditionally include in API requests. By default, fields with
  231. // empty values are omitted from API requests. However, any non-pointer,
  232. // non-interface field appearing in ForceSendFields will be sent to the
  233. // server regardless of whether the field is empty or not. This may be
  234. // used to include empty fields in Patch requests.
  235. ForceSendFields []string `json:"-"`
  236. // NullFields is a list of field names (e.g. "Config") to include in API
  237. // requests with the JSON null value. By default, fields with empty
  238. // values are omitted from API requests. However, any field with an
  239. // empty value appearing in NullFields will be sent to the server as
  240. // null. It is an error if a field in this list has a non-empty value.
  241. // This may be used to include null fields in Patch requests.
  242. NullFields []string `json:"-"`
  243. }
  244. func (s *Environment) MarshalJSON() ([]byte, error) {
  245. type NoMethod Environment
  246. raw := NoMethod(*s)
  247. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  248. }
  249. // EnvironmentConfig: Configuration information for an environment.
  250. type EnvironmentConfig struct {
  251. // AirflowUri: Output only.
  252. // The URI of the Apache Airflow Web UI hosted within this environment
  253. // (see
  254. // [Airflow web
  255. // interface](/composer/docs/how-to/accessing/airflow-web-interface)).
  256. AirflowUri string `json:"airflowUri,omitempty"`
  257. // DagGcsPrefix: Output only.
  258. // The Cloud Storage prefix of the DAGs for this environment. Although
  259. // Cloud
  260. // Storage objects reside in a flat namespace, a hierarchical file
  261. // tree
  262. // can be simulated using "/"-delimited object name prefixes. DAG
  263. // objects for
  264. // this environment reside in a simulated directory with the given
  265. // prefix.
  266. DagGcsPrefix string `json:"dagGcsPrefix,omitempty"`
  267. // GkeCluster: Output only.
  268. // The Kubernetes Engine cluster used to run this environment.
  269. GkeCluster string `json:"gkeCluster,omitempty"`
  270. // NodeConfig: The configuration used for the Kubernetes Engine cluster.
  271. NodeConfig *NodeConfig `json:"nodeConfig,omitempty"`
  272. // NodeCount: The number of nodes in the Kubernetes Engine cluster that
  273. // will be
  274. // used to run this environment.
  275. NodeCount int64 `json:"nodeCount,omitempty"`
  276. // PrivateEnvironmentConfig: The configuration used for the private
  277. // Composer environment.
  278. PrivateEnvironmentConfig *PrivateEnvironmentConfig `json:"privateEnvironmentConfig,omitempty"`
  279. // SoftwareConfig: The configuration settings for software inside the
  280. // environment.
  281. SoftwareConfig *SoftwareConfig `json:"softwareConfig,omitempty"`
  282. // ForceSendFields is a list of field names (e.g. "AirflowUri") to
  283. // unconditionally include in API requests. By default, fields with
  284. // empty values are omitted from API requests. However, any non-pointer,
  285. // non-interface field appearing in ForceSendFields will be sent to the
  286. // server regardless of whether the field is empty or not. This may be
  287. // used to include empty fields in Patch requests.
  288. ForceSendFields []string `json:"-"`
  289. // NullFields is a list of field names (e.g. "AirflowUri") to include in
  290. // API requests with the JSON null value. By default, fields with empty
  291. // values are omitted from API requests. However, any field with an
  292. // empty value appearing in NullFields will be sent to the server as
  293. // null. It is an error if a field in this list has a non-empty value.
  294. // This may be used to include null fields in Patch requests.
  295. NullFields []string `json:"-"`
  296. }
  297. func (s *EnvironmentConfig) MarshalJSON() ([]byte, error) {
  298. type NoMethod EnvironmentConfig
  299. raw := NoMethod(*s)
  300. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  301. }
  302. // IPAllocationPolicy: Configuration for controlling how IPs are
  303. // allocated in the
  304. // GKE cluster.
  305. type IPAllocationPolicy struct {
  306. // ClusterIpv4CidrBlock: Optional. The IP address range used to allocate
  307. // IP addresses to pods in
  308. // the cluster.
  309. //
  310. // This field is applicable only when `use_ip_aliases` is true.
  311. //
  312. // Set to blank to have GKE choose a range with the default size.
  313. //
  314. // Set to /netmask (e.g. `/14`) to have GKE choose a range with a
  315. // specific
  316. // netmask.
  317. //
  318. // Set to
  319. // a
  320. // [CIDR](http://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing)
  321. //
  322. // notation (e.g. `10.96.0.0/14`) from the RFC-1918 private networks
  323. // (e.g.
  324. // `10.0.0.0/8`, `172.16.0.0/12`, `192.168.0.0/16`) to pick a specific
  325. // range
  326. // to use.
  327. // Specify `cluster_secondary_range_name` or
  328. // `cluster_ipv4_cidr_block`
  329. // but not both.
  330. ClusterIpv4CidrBlock string `json:"clusterIpv4CidrBlock,omitempty"`
  331. // ClusterSecondaryRangeName: Optional. The name of the cluster's
  332. // secondary range used to allocate
  333. // IP addresses to pods. Specify either
  334. // `cluster_secondary_range_name`
  335. // or `cluster_ipv4_cidr_block` but not both.
  336. ClusterSecondaryRangeName string `json:"clusterSecondaryRangeName,omitempty"`
  337. // ServicesIpv4CidrBlock: Optional. The IP address range of the services
  338. // IP addresses in this
  339. // cluster.
  340. //
  341. // This field is applicable only when `use_ip_aliases` is true.
  342. //
  343. // Set to blank to have GKE choose a range with the default size.
  344. //
  345. // Set to /netmask (e.g. `/14`) to have GKE choose a range with a
  346. // specific
  347. // netmask.
  348. //
  349. // Set to
  350. // a
  351. // [CIDR](http://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing)
  352. //
  353. // notation (e.g. `10.96.0.0/14`) from the RFC-1918 private networks
  354. // (e.g.
  355. // `10.0.0.0/8`, `172.16.0.0/12`, `192.168.0.0/16`) to pick a specific
  356. // range
  357. // to use.
  358. // Specify `services_secondary_range_name` or
  359. // `services_ipv4_cidr_block`
  360. // but not both.
  361. ServicesIpv4CidrBlock string `json:"servicesIpv4CidrBlock,omitempty"`
  362. // ServicesSecondaryRangeName: Optional. The name of the services'
  363. // secondary range used to allocate
  364. // IP addresses to the cluster. Specify either
  365. // `services_secondary_range_name`
  366. // or `services_ipv4_cidr_block` but not both.
  367. ServicesSecondaryRangeName string `json:"servicesSecondaryRangeName,omitempty"`
  368. // UseIpAliases: Optional. Whether or not to enable Alias IPs in the GKE
  369. // cluster.
  370. // If true or if left blank, a VPC-native cluster is created.
  371. UseIpAliases bool `json:"useIpAliases,omitempty"`
  372. // ForceSendFields is a list of field names (e.g.
  373. // "ClusterIpv4CidrBlock") to unconditionally include in API requests.
  374. // By default, fields with empty values are omitted from API requests.
  375. // However, any non-pointer, non-interface field appearing in
  376. // ForceSendFields will be sent to the server regardless of whether the
  377. // field is empty or not. This may be used to include empty fields in
  378. // Patch requests.
  379. ForceSendFields []string `json:"-"`
  380. // NullFields is a list of field names (e.g. "ClusterIpv4CidrBlock") to
  381. // include in API requests with the JSON null value. By default, fields
  382. // with empty values are omitted from API requests. However, any field
  383. // with an empty value appearing in NullFields will be sent to the
  384. // server as null. It is an error if a field in this list has a
  385. // non-empty value. This may be used to include null fields in Patch
  386. // requests.
  387. NullFields []string `json:"-"`
  388. }
  389. func (s *IPAllocationPolicy) MarshalJSON() ([]byte, error) {
  390. type NoMethod IPAllocationPolicy
  391. raw := NoMethod(*s)
  392. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  393. }
  394. // ImageVersion: Image Version information
  395. type ImageVersion struct {
  396. // ImageVersionId: The string identifier of the ImageVersion, in the
  397. // form:
  398. // "composer-x.y.z-airflow-a.b(.c)"
  399. ImageVersionId string `json:"imageVersionId,omitempty"`
  400. // IsDefault: Whether this is the default ImageVersion used by Composer
  401. // during
  402. // environment creation if no input ImageVersion is specified.
  403. IsDefault bool `json:"isDefault,omitempty"`
  404. // SupportedPythonVersions: supported python versions
  405. SupportedPythonVersions []string `json:"supportedPythonVersions,omitempty"`
  406. // ForceSendFields is a list of field names (e.g. "ImageVersionId") to
  407. // unconditionally include in API requests. By default, fields with
  408. // empty values are omitted from API requests. However, any non-pointer,
  409. // non-interface field appearing in ForceSendFields will be sent to the
  410. // server regardless of whether the field is empty or not. This may be
  411. // used to include empty fields in Patch requests.
  412. ForceSendFields []string `json:"-"`
  413. // NullFields is a list of field names (e.g. "ImageVersionId") to
  414. // include in API requests with the JSON null value. By default, fields
  415. // with empty values are omitted from API requests. However, any field
  416. // with an empty value appearing in NullFields will be sent to the
  417. // server as null. It is an error if a field in this list has a
  418. // non-empty value. This may be used to include null fields in Patch
  419. // requests.
  420. NullFields []string `json:"-"`
  421. }
  422. func (s *ImageVersion) MarshalJSON() ([]byte, error) {
  423. type NoMethod ImageVersion
  424. raw := NoMethod(*s)
  425. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  426. }
  427. // ListEnvironmentsResponse: The environments in a project and location.
  428. type ListEnvironmentsResponse struct {
  429. // Environments: The list of environments returned by a
  430. // ListEnvironmentsRequest.
  431. Environments []*Environment `json:"environments,omitempty"`
  432. // NextPageToken: The page token used to query for the next page if one
  433. // exists.
  434. NextPageToken string `json:"nextPageToken,omitempty"`
  435. // ServerResponse contains the HTTP response code and headers from the
  436. // server.
  437. googleapi.ServerResponse `json:"-"`
  438. // ForceSendFields is a list of field names (e.g. "Environments") to
  439. // unconditionally include in API requests. By default, fields with
  440. // empty values are omitted from API requests. However, any non-pointer,
  441. // non-interface field appearing in ForceSendFields will be sent to the
  442. // server regardless of whether the field is empty or not. This may be
  443. // used to include empty fields in Patch requests.
  444. ForceSendFields []string `json:"-"`
  445. // NullFields is a list of field names (e.g. "Environments") to include
  446. // in API requests with the JSON null value. By default, fields with
  447. // empty values are omitted from API requests. However, any field with
  448. // an empty value appearing in NullFields will be sent to the server as
  449. // null. It is an error if a field in this list has a non-empty value.
  450. // This may be used to include null fields in Patch requests.
  451. NullFields []string `json:"-"`
  452. }
  453. func (s *ListEnvironmentsResponse) MarshalJSON() ([]byte, error) {
  454. type NoMethod ListEnvironmentsResponse
  455. raw := NoMethod(*s)
  456. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  457. }
  458. // ListImageVersionsResponse: The ImageVersions in a project and
  459. // location.
  460. type ListImageVersionsResponse struct {
  461. // ImageVersions: The list of supported ImageVersions in a location.
  462. ImageVersions []*ImageVersion `json:"imageVersions,omitempty"`
  463. // NextPageToken: The page token used to query for the next page if one
  464. // exists.
  465. NextPageToken string `json:"nextPageToken,omitempty"`
  466. // ServerResponse contains the HTTP response code and headers from the
  467. // server.
  468. googleapi.ServerResponse `json:"-"`
  469. // ForceSendFields is a list of field names (e.g. "ImageVersions") to
  470. // unconditionally include in API requests. By default, fields with
  471. // empty values are omitted from API requests. However, any non-pointer,
  472. // non-interface field appearing in ForceSendFields will be sent to the
  473. // server regardless of whether the field is empty or not. This may be
  474. // used to include empty fields in Patch requests.
  475. ForceSendFields []string `json:"-"`
  476. // NullFields is a list of field names (e.g. "ImageVersions") to include
  477. // in API requests with the JSON null value. By default, fields with
  478. // empty values are omitted from API requests. However, any field with
  479. // an empty value appearing in NullFields will be sent to the server as
  480. // null. It is an error if a field in this list has a non-empty value.
  481. // This may be used to include null fields in Patch requests.
  482. NullFields []string `json:"-"`
  483. }
  484. func (s *ListImageVersionsResponse) MarshalJSON() ([]byte, error) {
  485. type NoMethod ListImageVersionsResponse
  486. raw := NoMethod(*s)
  487. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  488. }
  489. // ListOperationsResponse: The response message for
  490. // Operations.ListOperations.
  491. type ListOperationsResponse struct {
  492. // NextPageToken: The standard List next-page token.
  493. NextPageToken string `json:"nextPageToken,omitempty"`
  494. // Operations: A list of operations that matches the specified filter in
  495. // the request.
  496. Operations []*Operation `json:"operations,omitempty"`
  497. // ServerResponse contains the HTTP response code and headers from the
  498. // server.
  499. googleapi.ServerResponse `json:"-"`
  500. // ForceSendFields is a list of field names (e.g. "NextPageToken") to
  501. // unconditionally include in API requests. By default, fields with
  502. // empty values are omitted from API requests. However, any non-pointer,
  503. // non-interface field appearing in ForceSendFields will be sent to the
  504. // server regardless of whether the field is empty or not. This may be
  505. // used to include empty fields in Patch requests.
  506. ForceSendFields []string `json:"-"`
  507. // NullFields is a list of field names (e.g. "NextPageToken") to include
  508. // in API requests with the JSON null value. By default, fields with
  509. // empty values are omitted from API requests. However, any field with
  510. // an empty value appearing in NullFields will be sent to the server as
  511. // null. It is an error if a field in this list has a non-empty value.
  512. // This may be used to include null fields in Patch requests.
  513. NullFields []string `json:"-"`
  514. }
  515. func (s *ListOperationsResponse) MarshalJSON() ([]byte, error) {
  516. type NoMethod ListOperationsResponse
  517. raw := NoMethod(*s)
  518. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  519. }
  520. // NodeConfig: The configuration information for the Kubernetes Engine
  521. // nodes running
  522. // the Apache Airflow software.
  523. type NodeConfig struct {
  524. // DiskSizeGb: Optional. The disk size in GB used for node VMs. Minimum
  525. // size is 20GB.
  526. // If unspecified, defaults to 100GB. Cannot be updated.
  527. DiskSizeGb int64 `json:"diskSizeGb,omitempty"`
  528. // IpAllocationPolicy: Optional. The IPAllocationPolicy fields for the
  529. // GKE cluster.
  530. IpAllocationPolicy *IPAllocationPolicy `json:"ipAllocationPolicy,omitempty"`
  531. // Location: Optional. The Compute Engine
  532. // [zone](/compute/docs/regions-zones) in which
  533. // to deploy the VMs used to run the Apache Airflow software, specified
  534. // as a
  535. // [relative resource
  536. // name](/apis/design/resource_names#relative_resource_name).
  537. // For example: "projects/{projectId}/zones/{zoneId}".
  538. //
  539. // This `location` must belong to the enclosing environment's project
  540. // and
  541. // location. If both this field and `nodeConfig.machineType` are
  542. // specified,
  543. // `nodeConfig.machineType` must belong to this `location`; if both
  544. // are
  545. // unspecified, the service will pick a zone in the Compute Engine
  546. // region
  547. // corresponding to the Cloud Composer location, and propagate that
  548. // choice to
  549. // both fields. If only one field (`location` or
  550. // `nodeConfig.machineType`) is
  551. // specified, the location information from the specified field will
  552. // be
  553. // propagated to the unspecified field.
  554. Location string `json:"location,omitempty"`
  555. // MachineType: Optional. The Compute Engine
  556. // [machine type](/compute/docs/machine-types) used for cluster
  557. // instances,
  558. // specified as a
  559. // [relative resource
  560. // name](/apis/design/resource_names#relative_resource_name).
  561. // For
  562. // example:
  563. // "projects/{projectId}/zones/{zoneId}/machineTypes/{machineTyp
  564. // eId}".
  565. //
  566. // The `machineType` must belong to the enclosing environment's project
  567. // and
  568. // location. If both this field and `nodeConfig.location` are
  569. // specified,
  570. // this `machineType` must belong to the `nodeConfig.location`; if both
  571. // are
  572. // unspecified, the service will pick a zone in the Compute Engine
  573. // region
  574. // corresponding to the Cloud Composer location, and propagate that
  575. // choice to
  576. // both fields. If exactly one of this field and `nodeConfig.location`
  577. // is
  578. // specified, the location information from the specified field will
  579. // be
  580. // propagated to the unspecified field.
  581. //
  582. // If this field is unspecified, the `machineTypeId` defaults
  583. // to "n1-standard-1".
  584. MachineType string `json:"machineType,omitempty"`
  585. // Network: Optional. The Compute Engine network to be used for
  586. // machine
  587. // communications, specified as a
  588. // [relative resource
  589. // name](/apis/design/resource_names#relative_resource_name).
  590. // For example: "projects/{projectId}/global/networks/{networkId}".
  591. //
  592. // If unspecified, the default network in the environment's project is
  593. // used.
  594. // If a [Custom Subnet
  595. // Network](/vpc/docs/vpc#vpc_networks_and_subnets)
  596. // is provided, `nodeConfig.subnetwork` must also be provided.
  597. // For
  598. // [Shared VPC](/vpc/docs/shared-vpc) subnetwork requirements,
  599. // see
  600. // `nodeConfig.subnetwork`.
  601. Network string `json:"network,omitempty"`
  602. // OauthScopes: Optional. The set of Google API scopes to be made
  603. // available on all
  604. // node VMs. Defaults
  605. // to
  606. // ["https://www.googleapis.com/auth/cloud-platform"] and must be
  607. // included in
  608. // the list of specified scopes. Cannot be updated.
  609. OauthScopes []string `json:"oauthScopes,omitempty"`
  610. // ServiceAccount: Optional. The Google Cloud Platform Service Account
  611. // to be used by the node
  612. // VMs. If a service account is not specified, the "default" Compute
  613. // Engine
  614. // service account is used. Cannot be updated.
  615. ServiceAccount string `json:"serviceAccount,omitempty"`
  616. // Subnetwork: Optional. The Compute Engine subnetwork to be used for
  617. // machine
  618. // communications, specified as a
  619. // [relative resource
  620. // name](/apis/design/resource_names#relative_resource_name).
  621. // For
  622. // example:
  623. // "projects/{projectId}/regions/{regionId}/subnetworks/{subnetw
  624. // orkId}"
  625. //
  626. // If a subnetwork is provided, `nodeConfig.network` must also be
  627. // provided,
  628. // and the subnetwork must belong to the same project as the
  629. // network.
  630. //
  631. // For Shared VPC, you must configure the subnetwork with secondary
  632. // ranges
  633. // named <strong>composer-pods</strong>
  634. // and
  635. // <strong>composer-services</strong> to support Alias IPs.
  636. Subnetwork string `json:"subnetwork,omitempty"`
  637. // Tags: Optional. The list of instance tags applied to all node VMs.
  638. // Tags are used
  639. // to identify valid sources or targets for network firewalls. Each tag
  640. // within
  641. // the list must comply with
  642. // [RFC1035](https://www.ietf.org/rfc/rfc1035.txt).
  643. // Cannot be updated.
  644. Tags []string `json:"tags,omitempty"`
  645. // ForceSendFields is a list of field names (e.g. "DiskSizeGb") to
  646. // unconditionally include in API requests. By default, fields with
  647. // empty values are omitted from API requests. However, any non-pointer,
  648. // non-interface field appearing in ForceSendFields will be sent to the
  649. // server regardless of whether the field is empty or not. This may be
  650. // used to include empty fields in Patch requests.
  651. ForceSendFields []string `json:"-"`
  652. // NullFields is a list of field names (e.g. "DiskSizeGb") to include in
  653. // API requests with the JSON null value. By default, fields with empty
  654. // values are omitted from API requests. However, any field with an
  655. // empty value appearing in NullFields will be sent to the server as
  656. // null. It is an error if a field in this list has a non-empty value.
  657. // This may be used to include null fields in Patch requests.
  658. NullFields []string `json:"-"`
  659. }
  660. func (s *NodeConfig) MarshalJSON() ([]byte, error) {
  661. type NoMethod NodeConfig
  662. raw := NoMethod(*s)
  663. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  664. }
  665. // Operation: This resource represents a long-running operation that is
  666. // the result of a
  667. // network API call.
  668. type Operation struct {
  669. // Done: If the value is `false`, it means the operation is still in
  670. // progress.
  671. // If `true`, the operation is completed, and either `error` or
  672. // `response` is
  673. // available.
  674. Done bool `json:"done,omitempty"`
  675. // Error: The error result of the operation in case of failure or
  676. // cancellation.
  677. Error *Status `json:"error,omitempty"`
  678. // Metadata: Service-specific metadata associated with the operation.
  679. // It typically
  680. // contains progress information and common metadata such as create
  681. // time.
  682. // Some services might not provide such metadata. Any method that
  683. // returns a
  684. // long-running operation should document the metadata type, if any.
  685. Metadata googleapi.RawMessage `json:"metadata,omitempty"`
  686. // Name: The server-assigned name, which is only unique within the same
  687. // service that
  688. // originally returns it. If you use the default HTTP mapping,
  689. // the
  690. // `name` should have the format of `operations/some/unique/name`.
  691. Name string `json:"name,omitempty"`
  692. // Response: The normal response of the operation in case of success.
  693. // If the original
  694. // method returns no data on success, such as `Delete`, the response
  695. // is
  696. // `google.protobuf.Empty`. If the original method is
  697. // standard
  698. // `Get`/`Create`/`Update`, the response should be the resource. For
  699. // other
  700. // methods, the response should have the type `XxxResponse`, where
  701. // `Xxx`
  702. // is the original method name. For example, if the original method
  703. // name
  704. // is `TakeSnapshot()`, the inferred response type
  705. // is
  706. // `TakeSnapshotResponse`.
  707. Response googleapi.RawMessage `json:"response,omitempty"`
  708. // ServerResponse contains the HTTP response code and headers from the
  709. // server.
  710. googleapi.ServerResponse `json:"-"`
  711. // ForceSendFields is a list of field names (e.g. "Done") to
  712. // unconditionally include in API requests. By default, fields with
  713. // empty values are omitted from API requests. However, any non-pointer,
  714. // non-interface field appearing in ForceSendFields will be sent to the
  715. // server regardless of whether the field is empty or not. This may be
  716. // used to include empty fields in Patch requests.
  717. ForceSendFields []string `json:"-"`
  718. // NullFields is a list of field names (e.g. "Done") to include in API
  719. // requests with the JSON null value. By default, fields with empty
  720. // values are omitted from API requests. However, any field with an
  721. // empty value appearing in NullFields will be sent to the server as
  722. // null. It is an error if a field in this list has a non-empty value.
  723. // This may be used to include null fields in Patch requests.
  724. NullFields []string `json:"-"`
  725. }
  726. func (s *Operation) MarshalJSON() ([]byte, error) {
  727. type NoMethod Operation
  728. raw := NoMethod(*s)
  729. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  730. }
  731. // OperationMetadata: Metadata describing an operation.
  732. type OperationMetadata struct {
  733. // CreateTime: Output only.
  734. // The time the operation was submitted to the server.
  735. CreateTime string `json:"createTime,omitempty"`
  736. // EndTime: Output only.
  737. // The time when the operation terminated, regardless of its
  738. // success.
  739. // This field is unset if the operation is still ongoing.
  740. EndTime string `json:"endTime,omitempty"`
  741. // OperationType: Output only.
  742. // The type of operation being performed.
  743. //
  744. // Possible values:
  745. // "TYPE_UNSPECIFIED" - Unused.
  746. // "CREATE" - A resource creation operation.
  747. // "DELETE" - A resource deletion operation.
  748. // "UPDATE" - A resource update operation.
  749. OperationType string `json:"operationType,omitempty"`
  750. // Resource: Output only.
  751. // The resource being operated on, as a [relative resource
  752. // name](
  753. // /apis/design/resource_names#relative_resource_name).
  754. Resource string `json:"resource,omitempty"`
  755. // ResourceUuid: Output only.
  756. // The UUID of the resource being operated on.
  757. ResourceUuid string `json:"resourceUuid,omitempty"`
  758. // State: Output only.
  759. // The current operation state.
  760. //
  761. // Possible values:
  762. // "STATE_UNSPECIFIED" - Unused.
  763. // "PENDING" - The operation has been created but is not yet started.
  764. // "RUNNING" - The operation is underway.
  765. // "SUCCESSFUL" - The operation completed successfully.
  766. // "FAILED" - The operation is no longer running but did not succeed.
  767. State string `json:"state,omitempty"`
  768. // ForceSendFields is a list of field names (e.g. "CreateTime") to
  769. // unconditionally include in API requests. By default, fields with
  770. // empty values are omitted from API requests. However, any non-pointer,
  771. // non-interface field appearing in ForceSendFields will be sent to the
  772. // server regardless of whether the field is empty or not. This may be
  773. // used to include empty fields in Patch requests.
  774. ForceSendFields []string `json:"-"`
  775. // NullFields is a list of field names (e.g. "CreateTime") to include in
  776. // API requests with the JSON null value. By default, fields with empty
  777. // values are omitted from API requests. However, any field with an
  778. // empty value appearing in NullFields will be sent to the server as
  779. // null. It is an error if a field in this list has a non-empty value.
  780. // This may be used to include null fields in Patch requests.
  781. NullFields []string `json:"-"`
  782. }
  783. func (s *OperationMetadata) MarshalJSON() ([]byte, error) {
  784. type NoMethod OperationMetadata
  785. raw := NoMethod(*s)
  786. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  787. }
  788. // PrivateClusterConfig: Configuration options for private cluster of
  789. // Composer environment.
  790. type PrivateClusterConfig struct {
  791. // EnablePrivateEndpoint: Optional. If true, access to public endpoint
  792. // of gke cluster will be denied.
  793. // `IPAllocationPolicy.use_ip_aliases` must be true if this field is
  794. // set to true. Default value is false.
  795. EnablePrivateEndpoint bool `json:"enablePrivateEndpoint,omitempty"`
  796. // MasterIpv4CidrBlock: The IP range in CIDR notation to use for the
  797. // hosted master network. This
  798. // range will be used for assigning internal IP addresses to the
  799. // cluster
  800. // master or set of masters, as well as the ILB VIP (Internal Load
  801. // Balance
  802. // Virtual IP).This range must not overlap with any other ranges in
  803. // use
  804. // within the cluster's network. If left blank, default value
  805. // of
  806. // '172.16.0.0/28' will be used.
  807. MasterIpv4CidrBlock string `json:"masterIpv4CidrBlock,omitempty"`
  808. // ForceSendFields is a list of field names (e.g.
  809. // "EnablePrivateEndpoint") to unconditionally include in API requests.
  810. // By default, fields with empty values are omitted from API requests.
  811. // However, any non-pointer, non-interface field appearing in
  812. // ForceSendFields will be sent to the server regardless of whether the
  813. // field is empty or not. This may be used to include empty fields in
  814. // Patch requests.
  815. ForceSendFields []string `json:"-"`
  816. // NullFields is a list of field names (e.g. "EnablePrivateEndpoint") to
  817. // include in API requests with the JSON null value. By default, fields
  818. // with empty values are omitted from API requests. However, any field
  819. // with an empty value appearing in NullFields will be sent to the
  820. // server as null. It is an error if a field in this list has a
  821. // non-empty value. This may be used to include null fields in Patch
  822. // requests.
  823. NullFields []string `json:"-"`
  824. }
  825. func (s *PrivateClusterConfig) MarshalJSON() ([]byte, error) {
  826. type NoMethod PrivateClusterConfig
  827. raw := NoMethod(*s)
  828. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  829. }
  830. // PrivateEnvironmentConfig: The configuration information for
  831. // configuring a private Composer environment.
  832. type PrivateEnvironmentConfig struct {
  833. // EnablePrivateEnvironment: Optional. If `true`, a private Composer
  834. // environment is created.
  835. EnablePrivateEnvironment bool `json:"enablePrivateEnvironment,omitempty"`
  836. // PrivateClusterConfig: Optional. Configuration for private cluster for
  837. // a private Composer
  838. // environment.
  839. PrivateClusterConfig *PrivateClusterConfig `json:"privateClusterConfig,omitempty"`
  840. // ForceSendFields is a list of field names (e.g.
  841. // "EnablePrivateEnvironment") to unconditionally include in API
  842. // requests. By default, fields with empty values are omitted from API
  843. // requests. However, any non-pointer, non-interface field appearing in
  844. // ForceSendFields will be sent to the server regardless of whether the
  845. // field is empty or not. This may be used to include empty fields in
  846. // Patch requests.
  847. ForceSendFields []string `json:"-"`
  848. // NullFields is a list of field names (e.g. "EnablePrivateEnvironment")
  849. // to include in API requests with the JSON null value. By default,
  850. // fields with empty values are omitted from API requests. However, any
  851. // field with an empty value appearing in NullFields will be sent to the
  852. // server as null. It is an error if a field in this list has a
  853. // non-empty value. This may be used to include null fields in Patch
  854. // requests.
  855. NullFields []string `json:"-"`
  856. }
  857. func (s *PrivateEnvironmentConfig) MarshalJSON() ([]byte, error) {
  858. type NoMethod PrivateEnvironmentConfig
  859. raw := NoMethod(*s)
  860. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  861. }
  862. // SoftwareConfig: Specifies the selection and configuration of software
  863. // inside the environment.
  864. type SoftwareConfig struct {
  865. // AirflowConfigOverrides: Optional. Apache Airflow configuration
  866. // properties to override.
  867. //
  868. // Property keys contain the section and property names, separated by a
  869. // hyphen,
  870. // for example "core-dags_are_paused_at_creation". Section names must
  871. // not
  872. // contain hyphens ("-"), opening square brackets ("["), or closing
  873. // square
  874. // brackets ("]"). The property name must not be empty and must not
  875. // contain
  876. // an equals sign ("=") or semicolon (";"). Section and property names
  877. // must
  878. // not contain a period ("."). Apache Airflow configuration property
  879. // names
  880. // must be written in
  881. // [snake_case](https://en.wikipedia.org/wiki/Snake_case).
  882. // Property values can contain any character, and can be written in
  883. // any
  884. // lower/upper case format.
  885. //
  886. // Certain Apache Airflow configuration property values
  887. // are
  888. // [blacklisted](/composer/docs/how-to/managing/setting-airflow-confi
  889. // gurations#airflow_configuration_blacklists),
  890. // and cannot be overridden.
  891. AirflowConfigOverrides map[string]string `json:"airflowConfigOverrides,omitempty"`
  892. // EnvVariables: Optional. Additional environment variables to provide
  893. // to the Apache Airflow
  894. // scheduler, worker, and webserver processes.
  895. //
  896. // Environment variable names must match the regular
  897. // expression
  898. // `a-zA-Z_*`. They cannot specify Apache Airflow
  899. // software configuration overrides (they cannot match the regular
  900. // expression
  901. // `AIRFLOW__[A-Z0-9_]+__[A-Z0-9_]+`), and they cannot match any of
  902. // the
  903. // following reserved names:
  904. //
  905. // * `AIRFLOW_HOME`
  906. // * `C_FORCE_ROOT`
  907. // * `CONTAINER_NAME`
  908. // * `DAGS_FOLDER`
  909. // * `GCP_PROJECT`
  910. // * `GCS_BUCKET`
  911. // * `GKE_CLUSTER_NAME`
  912. // * `SQL_DATABASE`
  913. // * `SQL_INSTANCE`
  914. // * `SQL_PASSWORD`
  915. // * `SQL_PROJECT`
  916. // * `SQL_REGION`
  917. // * `SQL_USER`
  918. EnvVariables map[string]string `json:"envVariables,omitempty"`
  919. // ImageVersion: The version of the software running in the
  920. // environment.
  921. // This encapsulates both the version of Cloud Composer functionality
  922. // and the
  923. // version of Apache Airflow. It must match the regular
  924. // expression
  925. // `composer-([0-9]+\.[0-9]+\.[0-9]+|latest)-airflow-[0-9]+\.[
  926. // 0-9]+(\.[0-9]+.*)?`.
  927. // When used as input, the server also checks if the provided version
  928. // is
  929. // supported and denies the request for an unsupported version.
  930. //
  931. // The Cloud Composer portion of the version is a
  932. // [semantic version](https://semver.org) or `latest`. When the patch
  933. // version
  934. // is omitted, the current Cloud Composer patch version is
  935. // selected.
  936. // When `latest` is provided instead of an explicit version number,
  937. // the server replaces `latest` with the current Cloud Composer
  938. // version
  939. // and stores that version number in the same field.
  940. //
  941. // The portion of the image version that follows <em>airflow-</em> is
  942. // an
  943. // official Apache Airflow repository
  944. // [release
  945. // name](https://github.com/apache/incubator-airflow/releases).
  946. //
  947. // See also [Version
  948. // List](/composer/docs/concepts/versioning/composer-versions).
  949. ImageVersion string `json:"imageVersion,omitempty"`
  950. // PypiPackages: Optional. Custom Python Package Index (PyPI) packages
  951. // to be installed in
  952. // the environment.
  953. //
  954. // Keys refer to the lowercase package name such as "numpy"
  955. // and values are the lowercase extras and version specifier such
  956. // as
  957. // "==1.12.0", "[devel,gcp_api]", or "[devel]>=1.8.2, <1.9.2". To
  958. // specify a
  959. // package without pinning it to a version specifier, use the empty
  960. // string as
  961. // the value.
  962. PypiPackages map[string]string `json:"pypiPackages,omitempty"`
  963. // PythonVersion: Optional. The major version of Python used to run the
  964. // Apache Airflow
  965. // scheduler, worker, and webserver processes.
  966. //
  967. // Can be set to '2' or '3'. If not specified, the default is '2'.
  968. // Cannot be
  969. // updated.
  970. PythonVersion string `json:"pythonVersion,omitempty"`
  971. // ForceSendFields is a list of field names (e.g.
  972. // "AirflowConfigOverrides") to unconditionally include in API requests.
  973. // By default, fields with empty values are omitted from API requests.
  974. // However, any non-pointer, non-interface field appearing in
  975. // ForceSendFields will be sent to the server regardless of whether the
  976. // field is empty or not. This may be used to include empty fields in
  977. // Patch requests.
  978. ForceSendFields []string `json:"-"`
  979. // NullFields is a list of field names (e.g. "AirflowConfigOverrides")
  980. // to include in API requests with the JSON null value. By default,
  981. // fields with empty values are omitted from API requests. However, any
  982. // field with an empty value appearing in NullFields will be sent to the
  983. // server as null. It is an error if a field in this list has a
  984. // non-empty value. This may be used to include null fields in Patch
  985. // requests.
  986. NullFields []string `json:"-"`
  987. }
  988. func (s *SoftwareConfig) MarshalJSON() ([]byte, error) {
  989. type NoMethod SoftwareConfig
  990. raw := NoMethod(*s)
  991. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  992. }
  993. // Status: The `Status` type defines a logical error model that is
  994. // suitable for
  995. // different programming environments, including REST APIs and RPC APIs.
  996. // It is
  997. // used by [gRPC](https://github.com/grpc). The error model is designed
  998. // to be:
  999. //
  1000. // - Simple to use and understand for most users
  1001. // - Flexible enough to meet unexpected needs
  1002. //
  1003. // # Overview
  1004. //
  1005. // The `Status` message contains three pieces of data: error code,
  1006. // error
  1007. // message, and error details. The error code should be an enum value
  1008. // of
  1009. // google.rpc.Code, but it may accept additional error codes if needed.
  1010. // The
  1011. // error message should be a developer-facing English message that
  1012. // helps
  1013. // developers *understand* and *resolve* the error. If a localized
  1014. // user-facing
  1015. // error message is needed, put the localized message in the error
  1016. // details or
  1017. // localize it in the client. The optional error details may contain
  1018. // arbitrary
  1019. // information about the error. There is a predefined set of error
  1020. // detail types
  1021. // in the package `google.rpc` that can be used for common error
  1022. // conditions.
  1023. //
  1024. // # Language mapping
  1025. //
  1026. // The `Status` message is the logical representation of the error
  1027. // model, but it
  1028. // is not necessarily the actual wire format. When the `Status` message
  1029. // is
  1030. // exposed in different client libraries and different wire protocols,
  1031. // it can be
  1032. // mapped differently. For example, it will likely be mapped to some
  1033. // exceptions
  1034. // in Java, but more likely mapped to some error codes in C.
  1035. //
  1036. // # Other uses
  1037. //
  1038. // The error model and the `Status` message can be used in a variety
  1039. // of
  1040. // environments, either with or without APIs, to provide a
  1041. // consistent developer experience across different
  1042. // environments.
  1043. //
  1044. // Example uses of this error model include:
  1045. //
  1046. // - Partial errors. If a service needs to return partial errors to the
  1047. // client,
  1048. // it may embed the `Status` in the normal response to indicate the
  1049. // partial
  1050. // errors.
  1051. //
  1052. // - Workflow errors. A typical workflow has multiple steps. Each step
  1053. // may
  1054. // have a `Status` message for error reporting.
  1055. //
  1056. // - Batch operations. If a client uses batch request and batch
  1057. // response, the
  1058. // `Status` message should be used directly inside batch response,
  1059. // one for
  1060. // each error sub-response.
  1061. //
  1062. // - Asynchronous operations. If an API call embeds asynchronous
  1063. // operation
  1064. // results in its response, the status of those operations should
  1065. // be
  1066. // represented directly using the `Status` message.
  1067. //
  1068. // - Logging. If some API errors are stored in logs, the message
  1069. // `Status` could
  1070. // be used directly after any stripping needed for security/privacy
  1071. // reasons.
  1072. type Status struct {
  1073. // Code: The status code, which should be an enum value of
  1074. // google.rpc.Code.
  1075. Code int64 `json:"code,omitempty"`
  1076. // Details: A list of messages that carry the error details. There is a
  1077. // common set of
  1078. // message types for APIs to use.
  1079. Details []googleapi.RawMessage `json:"details,omitempty"`
  1080. // Message: A developer-facing error message, which should be in
  1081. // English. Any
  1082. // user-facing error message should be localized and sent in
  1083. // the
  1084. // google.rpc.Status.details field, or localized by the client.
  1085. Message string `json:"message,omitempty"`
  1086. // ForceSendFields is a list of field names (e.g. "Code") to
  1087. // unconditionally include in API requests. By default, fields with
  1088. // empty values are omitted from API requests. However, any non-pointer,
  1089. // non-interface field appearing in ForceSendFields will be sent to the
  1090. // server regardless of whether the field is empty or not. This may be
  1091. // used to include empty fields in Patch requests.
  1092. ForceSendFields []string `json:"-"`
  1093. // NullFields is a list of field names (e.g. "Code") to include in API
  1094. // requests with the JSON null value. By default, fields with empty
  1095. // values are omitted from API requests. However, any field with an
  1096. // empty value appearing in NullFields will be sent to the server as
  1097. // null. It is an error if a field in this list has a non-empty value.
  1098. // This may be used to include null fields in Patch requests.
  1099. NullFields []string `json:"-"`
  1100. }
  1101. func (s *Status) MarshalJSON() ([]byte, error) {
  1102. type NoMethod Status
  1103. raw := NoMethod(*s)
  1104. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1105. }
  1106. // method id "composer.projects.locations.environments.create":
  1107. type ProjectsLocationsEnvironmentsCreateCall struct {
  1108. s *Service
  1109. parent string
  1110. environment *Environment
  1111. urlParams_ gensupport.URLParams
  1112. ctx_ context.Context
  1113. header_ http.Header
  1114. }
  1115. // Create: Create a new environment.
  1116. func (r *ProjectsLocationsEnvironmentsService) Create(parent string, environment *Environment) *ProjectsLocationsEnvironmentsCreateCall {
  1117. c := &ProjectsLocationsEnvironmentsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1118. c.parent = parent
  1119. c.environment = environment
  1120. return c
  1121. }
  1122. // Fields allows partial responses to be retrieved. See
  1123. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  1124. // for more information.
  1125. func (c *ProjectsLocationsEnvironmentsCreateCall) Fields(s ...googleapi.Field) *ProjectsLocationsEnvironmentsCreateCall {
  1126. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1127. return c
  1128. }
  1129. // Context sets the context to be used in this call's Do method. Any
  1130. // pending HTTP request will be aborted if the provided context is
  1131. // canceled.
  1132. func (c *ProjectsLocationsEnvironmentsCreateCall) Context(ctx context.Context) *ProjectsLocationsEnvironmentsCreateCall {
  1133. c.ctx_ = ctx
  1134. return c
  1135. }
  1136. // Header returns an http.Header that can be modified by the caller to
  1137. // add HTTP headers to the request.
  1138. func (c *ProjectsLocationsEnvironmentsCreateCall) Header() http.Header {
  1139. if c.header_ == nil {
  1140. c.header_ = make(http.Header)
  1141. }
  1142. return c.header_
  1143. }
  1144. func (c *ProjectsLocationsEnvironmentsCreateCall) doRequest(alt string) (*http.Response, error) {
  1145. reqHeaders := make(http.Header)
  1146. for k, v := range c.header_ {
  1147. reqHeaders[k] = v
  1148. }
  1149. reqHeaders.Set("User-Agent", c.s.userAgent())
  1150. var body io.Reader = nil
  1151. body, err := googleapi.WithoutDataWrapper.JSONReader(c.environment)
  1152. if err != nil {
  1153. return nil, err
  1154. }
  1155. reqHeaders.Set("Content-Type", "application/json")
  1156. c.urlParams_.Set("alt", alt)
  1157. c.urlParams_.Set("prettyPrint", "false")
  1158. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/environments")
  1159. urls += "?" + c.urlParams_.Encode()
  1160. req, err := http.NewRequest("POST", urls, body)
  1161. if err != nil {
  1162. return nil, err
  1163. }
  1164. req.Header = reqHeaders
  1165. googleapi.Expand(req.URL, map[string]string{
  1166. "parent": c.parent,
  1167. })
  1168. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1169. }
  1170. // Do executes the "composer.projects.locations.environments.create" call.
  1171. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  1172. // status code is an error. Response headers are in either
  1173. // *Operation.ServerResponse.Header or (if a response was returned at
  1174. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  1175. // to check whether the returned error was because
  1176. // http.StatusNotModified was returned.
  1177. func (c *ProjectsLocationsEnvironmentsCreateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  1178. gensupport.SetOptions(c.urlParams_, opts...)
  1179. res, err := c.doRequest("json")
  1180. if res != nil && res.StatusCode == http.StatusNotModified {
  1181. if res.Body != nil {
  1182. res.Body.Close()
  1183. }
  1184. return nil, &googleapi.Error{
  1185. Code: res.StatusCode,
  1186. Header: res.Header,
  1187. }
  1188. }
  1189. if err != nil {
  1190. return nil, err
  1191. }
  1192. defer googleapi.CloseBody(res)
  1193. if err := googleapi.CheckResponse(res); err != nil {
  1194. return nil, err
  1195. }
  1196. ret := &Operation{
  1197. ServerResponse: googleapi.ServerResponse{
  1198. Header: res.Header,
  1199. HTTPStatusCode: res.StatusCode,
  1200. },
  1201. }
  1202. target := &ret
  1203. if err := gensupport.DecodeResponse(target, res); err != nil {
  1204. return nil, err
  1205. }
  1206. return ret, nil
  1207. // {
  1208. // "description": "Create a new environment.",
  1209. // "flatPath": "v1beta1/projects/{projectsId}/locations/{locationsId}/environments",
  1210. // "httpMethod": "POST",
  1211. // "id": "composer.projects.locations.environments.create",
  1212. // "parameterOrder": [
  1213. // "parent"
  1214. // ],
  1215. // "parameters": {
  1216. // "parent": {
  1217. // "description": "The parent must be of the form \"projects/{projectId}/locations/{locationId}\".",
  1218. // "location": "path",
  1219. // "pattern": "^projects/[^/]+/locations/[^/]+$",
  1220. // "required": true,
  1221. // "type": "string"
  1222. // }
  1223. // },
  1224. // "path": "v1beta1/{+parent}/environments",
  1225. // "request": {
  1226. // "$ref": "Environment"
  1227. // },
  1228. // "response": {
  1229. // "$ref": "Operation"
  1230. // },
  1231. // "scopes": [
  1232. // "https://www.googleapis.com/auth/cloud-platform"
  1233. // ]
  1234. // }
  1235. }
  1236. // method id "composer.projects.locations.environments.delete":
  1237. type ProjectsLocationsEnvironmentsDeleteCall struct {
  1238. s *Service
  1239. name string
  1240. urlParams_ gensupport.URLParams
  1241. ctx_ context.Context
  1242. header_ http.Header
  1243. }
  1244. // Delete: Delete an environment.
  1245. func (r *ProjectsLocationsEnvironmentsService) Delete(name string) *ProjectsLocationsEnvironmentsDeleteCall {
  1246. c := &ProjectsLocationsEnvironmentsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1247. c.name = name
  1248. return c
  1249. }
  1250. // Fields allows partial responses to be retrieved. See
  1251. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  1252. // for more information.
  1253. func (c *ProjectsLocationsEnvironmentsDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsEnvironmentsDeleteCall {
  1254. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1255. return c
  1256. }
  1257. // Context sets the context to be used in this call's Do method. Any
  1258. // pending HTTP request will be aborted if the provided context is
  1259. // canceled.
  1260. func (c *ProjectsLocationsEnvironmentsDeleteCall) Context(ctx context.Context) *ProjectsLocationsEnvironmentsDeleteCall {
  1261. c.ctx_ = ctx
  1262. return c
  1263. }
  1264. // Header returns an http.Header that can be modified by the caller to
  1265. // add HTTP headers to the request.
  1266. func (c *ProjectsLocationsEnvironmentsDeleteCall) Header() http.Header {
  1267. if c.header_ == nil {
  1268. c.header_ = make(http.Header)
  1269. }
  1270. return c.header_
  1271. }
  1272. func (c *ProjectsLocationsEnvironmentsDeleteCall) doRequest(alt string) (*http.Response, error) {
  1273. reqHeaders := make(http.Header)
  1274. for k, v := range c.header_ {
  1275. reqHeaders[k] = v
  1276. }
  1277. reqHeaders.Set("User-Agent", c.s.userAgent())
  1278. var body io.Reader = nil
  1279. c.urlParams_.Set("alt", alt)
  1280. c.urlParams_.Set("prettyPrint", "false")
  1281. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}")
  1282. urls += "?" + c.urlParams_.Encode()
  1283. req, err := http.NewRequest("DELETE", urls, body)
  1284. if err != nil {
  1285. return nil, err
  1286. }
  1287. req.Header = reqHeaders
  1288. googleapi.Expand(req.URL, map[string]string{
  1289. "name": c.name,
  1290. })
  1291. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1292. }
  1293. // Do executes the "composer.projects.locations.environments.delete" call.
  1294. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  1295. // status code is an error. Response headers are in either
  1296. // *Operation.ServerResponse.Header or (if a response was returned at
  1297. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  1298. // to check whether the returned error was because
  1299. // http.StatusNotModified was returned.
  1300. func (c *ProjectsLocationsEnvironmentsDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  1301. gensupport.SetOptions(c.urlParams_, opts...)
  1302. res, err := c.doRequest("json")
  1303. if res != nil && res.StatusCode == http.StatusNotModified {
  1304. if res.Body != nil {
  1305. res.Body.Close()
  1306. }
  1307. return nil, &googleapi.Error{
  1308. Code: res.StatusCode,
  1309. Header: res.Header,
  1310. }
  1311. }
  1312. if err != nil {
  1313. return nil, err
  1314. }
  1315. defer googleapi.CloseBody(res)
  1316. if err := googleapi.CheckResponse(res); err != nil {
  1317. return nil, err
  1318. }
  1319. ret := &Operation{
  1320. ServerResponse: googleapi.ServerResponse{
  1321. Header: res.Header,
  1322. HTTPStatusCode: res.StatusCode,
  1323. },
  1324. }
  1325. target := &ret
  1326. if err := gensupport.DecodeResponse(target, res); err != nil {
  1327. return nil, err
  1328. }
  1329. return ret, nil
  1330. // {
  1331. // "description": "Delete an environment.",
  1332. // "flatPath": "v1beta1/projects/{projectsId}/locations/{locationsId}/environments/{environmentsId}",
  1333. // "httpMethod": "DELETE",
  1334. // "id": "composer.projects.locations.environments.delete",
  1335. // "parameterOrder": [
  1336. // "name"
  1337. // ],
  1338. // "parameters": {
  1339. // "name": {
  1340. // "description": "The environment to delete, in the form:\n\"projects/{projectId}/locations/{locationId}/environments/{environmentId}\"",
  1341. // "location": "path",
  1342. // "pattern": "^projects/[^/]+/locations/[^/]+/environments/[^/]+$",
  1343. // "required": true,
  1344. // "type": "string"
  1345. // }
  1346. // },
  1347. // "path": "v1beta1/{+name}",
  1348. // "response": {
  1349. // "$ref": "Operation"
  1350. // },
  1351. // "scopes": [
  1352. // "https://www.googleapis.com/auth/cloud-platform"
  1353. // ]
  1354. // }
  1355. }
  1356. // method id "composer.projects.locations.environments.get":
  1357. type ProjectsLocationsEnvironmentsGetCall struct {
  1358. s *Service
  1359. name string
  1360. urlParams_ gensupport.URLParams
  1361. ifNoneMatch_ string
  1362. ctx_ context.Context
  1363. header_ http.Header
  1364. }
  1365. // Get: Get an existing environment.
  1366. func (r *ProjectsLocationsEnvironmentsService) Get(name string) *ProjectsLocationsEnvironmentsGetCall {
  1367. c := &ProjectsLocationsEnvironmentsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1368. c.name = name
  1369. return c
  1370. }
  1371. // Fields allows partial responses to be retrieved. See
  1372. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  1373. // for more information.
  1374. func (c *ProjectsLocationsEnvironmentsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsEnvironmentsGetCall {
  1375. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1376. return c
  1377. }
  1378. // IfNoneMatch sets the optional parameter which makes the operation
  1379. // fail if the object's ETag matches the given value. This is useful for
  1380. // getting updates only after the object has changed since the last
  1381. // request. Use googleapi.IsNotModified to check whether the response
  1382. // error from Do is the result of In-None-Match.
  1383. func (c *ProjectsLocationsEnvironmentsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsEnvironmentsGetCall {
  1384. c.ifNoneMatch_ = entityTag
  1385. return c
  1386. }
  1387. // Context sets the context to be used in this call's Do method. Any
  1388. // pending HTTP request will be aborted if the provided context is
  1389. // canceled.
  1390. func (c *ProjectsLocationsEnvironmentsGetCall) Context(ctx context.Context) *ProjectsLocationsEnvironmentsGetCall {
  1391. c.ctx_ = ctx
  1392. return c
  1393. }
  1394. // Header returns an http.Header that can be modified by the caller to
  1395. // add HTTP headers to the request.
  1396. func (c *ProjectsLocationsEnvironmentsGetCall) Header() http.Header {
  1397. if c.header_ == nil {
  1398. c.header_ = make(http.Header)
  1399. }
  1400. return c.header_
  1401. }
  1402. func (c *ProjectsLocationsEnvironmentsGetCall) doRequest(alt string) (*http.Response, error) {
  1403. reqHeaders := make(http.Header)
  1404. for k, v := range c.header_ {
  1405. reqHeaders[k] = v
  1406. }
  1407. reqHeaders.Set("User-Agent", c.s.userAgent())
  1408. if c.ifNoneMatch_ != "" {
  1409. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  1410. }
  1411. var body io.Reader = nil
  1412. c.urlParams_.Set("alt", alt)
  1413. c.urlParams_.Set("prettyPrint", "false")
  1414. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}")
  1415. urls += "?" + c.urlParams_.Encode()
  1416. req, err := http.NewRequest("GET", urls, body)
  1417. if err != nil {
  1418. return nil, err
  1419. }
  1420. req.Header = reqHeaders
  1421. googleapi.Expand(req.URL, map[string]string{
  1422. "name": c.name,
  1423. })
  1424. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1425. }
  1426. // Do executes the "composer.projects.locations.environments.get" call.
  1427. // Exactly one of *Environment or error will be non-nil. Any non-2xx
  1428. // status code is an error. Response headers are in either
  1429. // *Environment.ServerResponse.Header or (if a response was returned at
  1430. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  1431. // to check whether the returned error was because
  1432. // http.StatusNotModified was returned.
  1433. func (c *ProjectsLocationsEnvironmentsGetCall) Do(opts ...googleapi.CallOption) (*Environment, error) {
  1434. gensupport.SetOptions(c.urlParams_, opts...)
  1435. res, err := c.doRequest("json")
  1436. if res != nil && res.StatusCode == http.StatusNotModified {
  1437. if res.Body != nil {
  1438. res.Body.Close()
  1439. }
  1440. return nil, &googleapi.Error{
  1441. Code: res.StatusCode,
  1442. Header: res.Header,
  1443. }
  1444. }
  1445. if err != nil {
  1446. return nil, err
  1447. }
  1448. defer googleapi.CloseBody(res)
  1449. if err := googleapi.CheckResponse(res); err != nil {
  1450. return nil, err
  1451. }
  1452. ret := &Environment{
  1453. ServerResponse: googleapi.ServerResponse{
  1454. Header: res.Header,
  1455. HTTPStatusCode: res.StatusCode,
  1456. },
  1457. }
  1458. target := &ret
  1459. if err := gensupport.DecodeResponse(target, res); err != nil {
  1460. return nil, err
  1461. }
  1462. return ret, nil
  1463. // {
  1464. // "description": "Get an existing environment.",
  1465. // "flatPath": "v1beta1/projects/{projectsId}/locations/{locationsId}/environments/{environmentsId}",
  1466. // "httpMethod": "GET",
  1467. // "id": "composer.projects.locations.environments.get",
  1468. // "parameterOrder": [
  1469. // "name"
  1470. // ],
  1471. // "parameters": {
  1472. // "name": {
  1473. // "description": "The resource name of the environment to get, in the form:\n\"projects/{projectId}/locations/{locationId}/environments/{environmentId}\"",
  1474. // "location": "path",
  1475. // "pattern": "^projects/[^/]+/locations/[^/]+/environments/[^/]+$",
  1476. // "required": true,
  1477. // "type": "string"
  1478. // }
  1479. // },
  1480. // "path": "v1beta1/{+name}",
  1481. // "response": {
  1482. // "$ref": "Environment"
  1483. // },
  1484. // "scopes": [
  1485. // "https://www.googleapis.com/auth/cloud-platform"
  1486. // ]
  1487. // }
  1488. }
  1489. // method id "composer.projects.locations.environments.list":
  1490. type ProjectsLocationsEnvironmentsListCall struct {
  1491. s *Service
  1492. parent string
  1493. urlParams_ gensupport.URLParams
  1494. ifNoneMatch_ string
  1495. ctx_ context.Context
  1496. header_ http.Header
  1497. }
  1498. // List: List environments.
  1499. func (r *ProjectsLocationsEnvironmentsService) List(parent string) *ProjectsLocationsEnvironmentsListCall {
  1500. c := &ProjectsLocationsEnvironmentsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1501. c.parent = parent
  1502. return c
  1503. }
  1504. // PageSize sets the optional parameter "pageSize": The maximum number
  1505. // of environments to return.
  1506. func (c *ProjectsLocationsEnvironmentsListCall) PageSize(pageSize int64) *ProjectsLocationsEnvironmentsListCall {
  1507. c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  1508. return c
  1509. }
  1510. // PageToken sets the optional parameter "pageToken": The
  1511. // next_page_token value returned from a previous List request, if any.
  1512. func (c *ProjectsLocationsEnvironmentsListCall) PageToken(pageToken string) *ProjectsLocationsEnvironmentsListCall {
  1513. c.urlParams_.Set("pageToken", pageToken)
  1514. return c
  1515. }
  1516. // Fields allows partial responses to be retrieved. See
  1517. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  1518. // for more information.
  1519. func (c *ProjectsLocationsEnvironmentsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsEnvironmentsListCall {
  1520. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1521. return c
  1522. }
  1523. // IfNoneMatch sets the optional parameter which makes the operation
  1524. // fail if the object's ETag matches the given value. This is useful for
  1525. // getting updates only after the object has changed since the last
  1526. // request. Use googleapi.IsNotModified to check whether the response
  1527. // error from Do is the result of In-None-Match.
  1528. func (c *ProjectsLocationsEnvironmentsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsEnvironmentsListCall {
  1529. c.ifNoneMatch_ = entityTag
  1530. return c
  1531. }
  1532. // Context sets the context to be used in this call's Do method. Any
  1533. // pending HTTP request will be aborted if the provided context is
  1534. // canceled.
  1535. func (c *ProjectsLocationsEnvironmentsListCall) Context(ctx context.Context) *ProjectsLocationsEnvironmentsListCall {
  1536. c.ctx_ = ctx
  1537. return c
  1538. }
  1539. // Header returns an http.Header that can be modified by the caller to
  1540. // add HTTP headers to the request.
  1541. func (c *ProjectsLocationsEnvironmentsListCall) Header() http.Header {
  1542. if c.header_ == nil {
  1543. c.header_ = make(http.Header)
  1544. }
  1545. return c.header_
  1546. }
  1547. func (c *ProjectsLocationsEnvironmentsListCall) doRequest(alt string) (*http.Response, error) {
  1548. reqHeaders := make(http.Header)
  1549. for k, v := range c.header_ {
  1550. reqHeaders[k] = v
  1551. }
  1552. reqHeaders.Set("User-Agent", c.s.userAgent())
  1553. if c.ifNoneMatch_ != "" {
  1554. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  1555. }
  1556. var body io.Reader = nil
  1557. c.urlParams_.Set("alt", alt)
  1558. c.urlParams_.Set("prettyPrint", "false")
  1559. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/environments")
  1560. urls += "?" + c.urlParams_.Encode()
  1561. req, err := http.NewRequest("GET", urls, body)
  1562. if err != nil {
  1563. return nil, err
  1564. }
  1565. req.Header = reqHeaders
  1566. googleapi.Expand(req.URL, map[string]string{
  1567. "parent": c.parent,
  1568. })
  1569. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1570. }
  1571. // Do executes the "composer.projects.locations.environments.list" call.
  1572. // Exactly one of *ListEnvironmentsResponse or error will be non-nil.
  1573. // Any non-2xx status code is an error. Response headers are in either
  1574. // *ListEnvironmentsResponse.ServerResponse.Header or (if a response was
  1575. // returned at all) in error.(*googleapi.Error).Header. Use
  1576. // googleapi.IsNotModified to check whether the returned error was
  1577. // because http.StatusNotModified was returned.
  1578. func (c *ProjectsLocationsEnvironmentsListCall) Do(opts ...googleapi.CallOption) (*ListEnvironmentsResponse, error) {
  1579. gensupport.SetOptions(c.urlParams_, opts...)
  1580. res, err := c.doRequest("json")
  1581. if res != nil && res.StatusCode == http.StatusNotModified {
  1582. if res.Body != nil {
  1583. res.Body.Close()
  1584. }
  1585. return nil, &googleapi.Error{
  1586. Code: res.StatusCode,
  1587. Header: res.Header,
  1588. }
  1589. }
  1590. if err != nil {
  1591. return nil, err
  1592. }
  1593. defer googleapi.CloseBody(res)
  1594. if err := googleapi.CheckResponse(res); err != nil {
  1595. return nil, err
  1596. }
  1597. ret := &ListEnvironmentsResponse{
  1598. ServerResponse: googleapi.ServerResponse{
  1599. Header: res.Header,
  1600. HTTPStatusCode: res.StatusCode,
  1601. },
  1602. }
  1603. target := &ret
  1604. if err := gensupport.DecodeResponse(target, res); err != nil {
  1605. return nil, err
  1606. }
  1607. return ret, nil
  1608. // {
  1609. // "description": "List environments.",
  1610. // "flatPath": "v1beta1/projects/{projectsId}/locations/{locationsId}/environments",
  1611. // "httpMethod": "GET",
  1612. // "id": "composer.projects.locations.environments.list",
  1613. // "parameterOrder": [
  1614. // "parent"
  1615. // ],
  1616. // "parameters": {
  1617. // "pageSize": {
  1618. // "description": "The maximum number of environments to return.",
  1619. // "format": "int32",
  1620. // "location": "query",
  1621. // "type": "integer"
  1622. // },
  1623. // "pageToken": {
  1624. // "description": "The next_page_token value returned from a previous List request, if any.",
  1625. // "location": "query",
  1626. // "type": "string"
  1627. // },
  1628. // "parent": {
  1629. // "description": "List environments in the given project and location, in the form:\n\"projects/{projectId}/locations/{locationId}\"",
  1630. // "location": "path",
  1631. // "pattern": "^projects/[^/]+/locations/[^/]+$",
  1632. // "required": true,
  1633. // "type": "string"
  1634. // }
  1635. // },
  1636. // "path": "v1beta1/{+parent}/environments",
  1637. // "response": {
  1638. // "$ref": "ListEnvironmentsResponse"
  1639. // },
  1640. // "scopes": [
  1641. // "https://www.googleapis.com/auth/cloud-platform"
  1642. // ]
  1643. // }
  1644. }
  1645. // Pages invokes f for each page of results.
  1646. // A non-nil error returned from f will halt the iteration.
  1647. // The provided context supersedes any context provided to the Context method.
  1648. func (c *ProjectsLocationsEnvironmentsListCall) Pages(ctx context.Context, f func(*ListEnvironmentsResponse) error) error {
  1649. c.ctx_ = ctx
  1650. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  1651. for {
  1652. x, err := c.Do()
  1653. if err != nil {
  1654. return err
  1655. }
  1656. if err := f(x); err != nil {
  1657. return err
  1658. }
  1659. if x.NextPageToken == "" {
  1660. return nil
  1661. }
  1662. c.PageToken(x.NextPageToken)
  1663. }
  1664. }
  1665. // method id "composer.projects.locations.environments.patch":
  1666. type ProjectsLocationsEnvironmentsPatchCall struct {
  1667. s *Service
  1668. name string
  1669. environment *Environment
  1670. urlParams_ gensupport.URLParams
  1671. ctx_ context.Context
  1672. header_ http.Header
  1673. }
  1674. // Patch: Update an environment.
  1675. func (r *ProjectsLocationsEnvironmentsService) Patch(name string, environment *Environment) *ProjectsLocationsEnvironmentsPatchCall {
  1676. c := &ProjectsLocationsEnvironmentsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1677. c.name = name
  1678. c.environment = environment
  1679. return c
  1680. }
  1681. // UpdateMask sets the optional parameter "updateMask": Required. A
  1682. // comma-separated list of paths, relative to `Environment`, of
  1683. // fields to update.
  1684. // For example, to set the version of scikit-learn to install in
  1685. // the
  1686. // environment to 0.19.0 and to remove an existing installation
  1687. // of
  1688. // argparse, the `updateMask` parameter would include the following
  1689. // two
  1690. // `paths` values: "config.softwareConfig.pypiPackages.scikit-learn"
  1691. // and
  1692. // "config.softwareConfig.pypiPackages.argparse". The included
  1693. // patch
  1694. // environment would specify the scikit-learn version as follows:
  1695. //
  1696. // {
  1697. // "config":{
  1698. // "softwareConfig":{
  1699. // "pypiPackages":{
  1700. // "scikit-learn":"==0.19.0"
  1701. // }
  1702. // }
  1703. // }
  1704. // }
  1705. //
  1706. // Note that in the above example, any existing PyPI packages
  1707. // other than scikit-learn and argparse will be unaffected.
  1708. //
  1709. // Only one update type may be included in a single request's
  1710. // `updateMask`.
  1711. // For example, one cannot update both the PyPI packages and
  1712. // labels in the same request. However, it is possible to update
  1713. // multiple
  1714. // members of a map field simultaneously in the same request. For
  1715. // example,
  1716. // to set the labels "label1" and "label2" while clearing "label3"
  1717. // (assuming
  1718. // it already exists), one can
  1719. // provide the paths "labels.label1", "labels.label2", and
  1720. // "labels.label3"
  1721. // and populate the patch environment as follows:
  1722. //
  1723. // {
  1724. // "labels":{
  1725. // "label1":"new-label1-value"
  1726. // "label2":"new-label2-value"
  1727. // }
  1728. // }
  1729. //
  1730. // Note that in the above example, any existing labels that are
  1731. // not
  1732. // included in the `updateMask` will be unaffected.
  1733. //
  1734. // It is also possible to replace an entire map field by providing
  1735. // the
  1736. // map field's path in the `updateMask`. The new value of the field
  1737. // will
  1738. // be that which is provided in the patch environment. For example,
  1739. // to
  1740. // delete all pre-existing user-specified PyPI packages and
  1741. // install botocore at version 1.7.14, the `updateMask` would
  1742. // contain
  1743. // the path "config.softwareConfig.pypiPackages", and
  1744. // the patch environment would be the following:
  1745. //
  1746. // {
  1747. // "config":{
  1748. // "softwareConfig":{
  1749. // "pypiPackages":{
  1750. // "botocore":"==1.7.14"
  1751. // }
  1752. // }
  1753. // }
  1754. // }
  1755. //
  1756. // <strong>Note:</strong> Only the following fields can be updated:
  1757. //
  1758. // <table>
  1759. // <tbody>
  1760. // <tr>
  1761. // <td><strong>Mask</strong></td>
  1762. // <td><strong>Purpose</strong></td>
  1763. // </tr>
  1764. // <tr>
  1765. // <td>config.softwareConfig.pypiPackages
  1766. // </td>
  1767. // <td>Replace all custom custom PyPI packages. If a replacement
  1768. // package map is not included in `environment`, all custom
  1769. // PyPI packages are cleared. It is an error to provide both this mask
  1770. // and a
  1771. // mask specifying an individual package.</td>
  1772. // </tr>
  1773. // <tr>
  1774. // <td>config.softwareConfig.pypiPackages.<var>packagename</var></td>
  1775. // <td>Update the custom PyPI package <var>packagename</var>,
  1776. // preserving other packages. To delete the package, include it in
  1777. // `updateMask`, and omit the mapping for it in
  1778. // `environment.config.softwareConfig.pypiPackages`. It is an error
  1779. // to provide both a mask of this form and the
  1780. // "config.softwareConfig.pypiPackages" mask.</td>
  1781. // </tr>
  1782. // <tr>
  1783. // <td>labels</td>
  1784. // <td>Replace all environment labels. If a replacement labels map is
  1785. // not
  1786. // included in `environment`, all labels are cleared. It is an error
  1787. // to
  1788. // provide both this mask and a mask specifying one or more individual
  1789. // labels.</td>
  1790. // </tr>
  1791. // <tr>
  1792. // <td>labels.<var>labelName</var></td>
  1793. // <td>Set the label named <var>labelName</var>, while preserving
  1794. // other
  1795. // labels. To delete the label, include it in `updateMask` and omit
  1796. // its
  1797. // mapping in `environment.labels`. It is an error to provide both a
  1798. // mask of this form and the "labels" mask.</td>
  1799. // </tr>
  1800. // <tr>
  1801. // <td>config.nodeCount</td>
  1802. // <td>Horizontally scale the number of nodes in the environment. An
  1803. // integer
  1804. // greater than or equal to 3 must be provided in the
  1805. // `config.nodeCount` field.
  1806. // </td>
  1807. // </tr>
  1808. // <tr>
  1809. // <td>config.softwareConfig.airflowConfigOverrides</td>
  1810. // <td>Replace all Apache Airflow config overrides. If a replacement
  1811. // config
  1812. // overrides map is not included in `environment`, all config
  1813. // overrides
  1814. // are cleared.
  1815. // It is an error to provide both this mask and a mask specifying one
  1816. // or
  1817. // more individual config overrides.</td>
  1818. // </tr>
  1819. // <tr>
  1820. //
  1821. // <td>config.softwareConfig.airflowConfigOverrides.<var>section</var>-<v
  1822. // ar>name
  1823. // </var></td>
  1824. // <td>Override the Apache Airflow config property <var>name</var> in
  1825. // the
  1826. // section named <var>section</var>, preserving other properties. To
  1827. // delete
  1828. // the property override, include it in `updateMask` and omit its
  1829. // mapping
  1830. // in `environment.config.softwareConfig.airflowConfigOverrides`.
  1831. // It is an error to provide both a mask of this form and the
  1832. // "config.softwareConfig.airflowConfigOverrides" mask.</td>
  1833. // </tr>
  1834. // <tr>
  1835. // <td>config.softwareConfig.envVariables</td>
  1836. // <td>Replace all environment variables. If a replacement environment
  1837. // variable map is not included in `environment`, all custom
  1838. // environment
  1839. // variables are cleared.
  1840. // It is an error to provide both this mask and a mask specifying one
  1841. // or
  1842. // more individual environment variables.</td>
  1843. // </tr>
  1844. // <tr>
  1845. // <td>config.softwareConfig.imageVersion</td>
  1846. // <td>Upgrade the version of the environment in-place. Refer to
  1847. // `SoftwareConfig.image_version` for information on how to format the
  1848. // new
  1849. // image version. Additionally, the new image version cannot effect a
  1850. // version
  1851. // downgrade and must match the current image version's Composer major
  1852. // version and Airflow major and minor versions. Consult the
  1853. // <a
  1854. // href="/composer/docs/concepts/versioning/composer-versions">Cloud
  1855. // Composer Version List</a> for valid values.</td>
  1856. // </tr>
  1857. // </tbody>
  1858. // </table>
  1859. func (c *ProjectsLocationsEnvironmentsPatchCall) UpdateMask(updateMask string) *ProjectsLocationsEnvironmentsPatchCall {
  1860. c.urlParams_.Set("updateMask", updateMask)
  1861. return c
  1862. }
  1863. // Fields allows partial responses to be retrieved. See
  1864. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  1865. // for more information.
  1866. func (c *ProjectsLocationsEnvironmentsPatchCall) Fields(s ...googleapi.Field) *ProjectsLocationsEnvironmentsPatchCall {
  1867. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1868. return c
  1869. }
  1870. // Context sets the context to be used in this call's Do method. Any
  1871. // pending HTTP request will be aborted if the provided context is
  1872. // canceled.
  1873. func (c *ProjectsLocationsEnvironmentsPatchCall) Context(ctx context.Context) *ProjectsLocationsEnvironmentsPatchCall {
  1874. c.ctx_ = ctx
  1875. return c
  1876. }
  1877. // Header returns an http.Header that can be modified by the caller to
  1878. // add HTTP headers to the request.
  1879. func (c *ProjectsLocationsEnvironmentsPatchCall) Header() http.Header {
  1880. if c.header_ == nil {
  1881. c.header_ = make(http.Header)
  1882. }
  1883. return c.header_
  1884. }
  1885. func (c *ProjectsLocationsEnvironmentsPatchCall) doRequest(alt string) (*http.Response, error) {
  1886. reqHeaders := make(http.Header)
  1887. for k, v := range c.header_ {
  1888. reqHeaders[k] = v
  1889. }
  1890. reqHeaders.Set("User-Agent", c.s.userAgent())
  1891. var body io.Reader = nil
  1892. body, err := googleapi.WithoutDataWrapper.JSONReader(c.environment)
  1893. if err != nil {
  1894. return nil, err
  1895. }
  1896. reqHeaders.Set("Content-Type", "application/json")
  1897. c.urlParams_.Set("alt", alt)
  1898. c.urlParams_.Set("prettyPrint", "false")
  1899. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}")
  1900. urls += "?" + c.urlParams_.Encode()
  1901. req, err := http.NewRequest("PATCH", urls, body)
  1902. if err != nil {
  1903. return nil, err
  1904. }
  1905. req.Header = reqHeaders
  1906. googleapi.Expand(req.URL, map[string]string{
  1907. "name": c.name,
  1908. })
  1909. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1910. }
  1911. // Do executes the "composer.projects.locations.environments.patch" call.
  1912. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  1913. // status code is an error. Response headers are in either
  1914. // *Operation.ServerResponse.Header or (if a response was returned at
  1915. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  1916. // to check whether the returned error was because
  1917. // http.StatusNotModified was returned.
  1918. func (c *ProjectsLocationsEnvironmentsPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  1919. gensupport.SetOptions(c.urlParams_, opts...)
  1920. res, err := c.doRequest("json")
  1921. if res != nil && res.StatusCode == http.StatusNotModified {
  1922. if res.Body != nil {
  1923. res.Body.Close()
  1924. }
  1925. return nil, &googleapi.Error{
  1926. Code: res.StatusCode,
  1927. Header: res.Header,
  1928. }
  1929. }
  1930. if err != nil {
  1931. return nil, err
  1932. }
  1933. defer googleapi.CloseBody(res)
  1934. if err := googleapi.CheckResponse(res); err != nil {
  1935. return nil, err
  1936. }
  1937. ret := &Operation{
  1938. ServerResponse: googleapi.ServerResponse{
  1939. Header: res.Header,
  1940. HTTPStatusCode: res.StatusCode,
  1941. },
  1942. }
  1943. target := &ret
  1944. if err := gensupport.DecodeResponse(target, res); err != nil {
  1945. return nil, err
  1946. }
  1947. return ret, nil
  1948. // {
  1949. // "description": "Update an environment.",
  1950. // "flatPath": "v1beta1/projects/{projectsId}/locations/{locationsId}/environments/{environmentsId}",
  1951. // "httpMethod": "PATCH",
  1952. // "id": "composer.projects.locations.environments.patch",
  1953. // "parameterOrder": [
  1954. // "name"
  1955. // ],
  1956. // "parameters": {
  1957. // "name": {
  1958. // "description": "The relative resource name of the environment to update, in the form:\n\"projects/{projectId}/locations/{locationId}/environments/{environmentId}\"",
  1959. // "location": "path",
  1960. // "pattern": "^projects/[^/]+/locations/[^/]+/environments/[^/]+$",
  1961. // "required": true,
  1962. // "type": "string"
  1963. // },
  1964. // "updateMask": {
  1965. // "description": "Required. A comma-separated list of paths, relative to `Environment`, of\nfields to update.\nFor example, to set the version of scikit-learn to install in the\nenvironment to 0.19.0 and to remove an existing installation of\nargparse, the `updateMask` parameter would include the following two\n`paths` values: \"config.softwareConfig.pypiPackages.scikit-learn\" and\n\"config.softwareConfig.pypiPackages.argparse\". The included patch\nenvironment would specify the scikit-learn version as follows:\n\n {\n \"config\":{\n \"softwareConfig\":{\n \"pypiPackages\":{\n \"scikit-learn\":\"==0.19.0\"\n }\n }\n }\n }\n\nNote that in the above example, any existing PyPI packages\nother than scikit-learn and argparse will be unaffected.\n\nOnly one update type may be included in a single request's `updateMask`.\nFor example, one cannot update both the PyPI packages and\nlabels in the same request. However, it is possible to update multiple\nmembers of a map field simultaneously in the same request. For example,\nto set the labels \"label1\" and \"label2\" while clearing \"label3\" (assuming\nit already exists), one can\nprovide the paths \"labels.label1\", \"labels.label2\", and \"labels.label3\"\nand populate the patch environment as follows:\n\n {\n \"labels\":{\n \"label1\":\"new-label1-value\"\n \"label2\":\"new-label2-value\"\n }\n }\n\nNote that in the above example, any existing labels that are not\nincluded in the `updateMask` will be unaffected.\n\nIt is also possible to replace an entire map field by providing the\nmap field's path in the `updateMask`. The new value of the field will\nbe that which is provided in the patch environment. For example, to\ndelete all pre-existing user-specified PyPI packages and\ninstall botocore at version 1.7.14, the `updateMask` would contain\nthe path \"config.softwareConfig.pypiPackages\", and\nthe patch environment would be the following:\n\n {\n \"config\":{\n \"softwareConfig\":{\n \"pypiPackages\":{\n \"botocore\":\"==1.7.14\"\n }\n }\n }\n }\n\n\u003cstrong\u003eNote:\u003c/strong\u003e Only the following fields can be updated:\n\n \u003ctable\u003e\n \u003ctbody\u003e\n \u003ctr\u003e\n \u003ctd\u003e\u003cstrong\u003eMask\u003c/strong\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cstrong\u003ePurpose\u003c/strong\u003e\u003c/td\u003e\n \u003c/tr\u003e\n \u003ctr\u003e\n \u003ctd\u003econfig.softwareConfig.pypiPackages\n \u003c/td\u003e\n \u003ctd\u003eReplace all custom custom PyPI packages. If a replacement\n package map is not included in `environment`, all custom\n PyPI packages are cleared. It is an error to provide both this mask and a\n mask specifying an individual package.\u003c/td\u003e\n \u003c/tr\u003e\n \u003ctr\u003e\n \u003ctd\u003econfig.softwareConfig.pypiPackages.\u003cvar\u003epackagename\u003c/var\u003e\u003c/td\u003e\n \u003ctd\u003eUpdate the custom PyPI package \u003cvar\u003epackagename\u003c/var\u003e,\n preserving other packages. To delete the package, include it in\n `updateMask`, and omit the mapping for it in\n `environment.config.softwareConfig.pypiPackages`. It is an error\n to provide both a mask of this form and the\n \"config.softwareConfig.pypiPackages\" mask.\u003c/td\u003e\n \u003c/tr\u003e\n \u003ctr\u003e\n \u003ctd\u003elabels\u003c/td\u003e\n \u003ctd\u003eReplace all environment labels. If a replacement labels map is not\n included in `environment`, all labels are cleared. It is an error to\n provide both this mask and a mask specifying one or more individual\n labels.\u003c/td\u003e\n \u003c/tr\u003e\n \u003ctr\u003e\n \u003ctd\u003elabels.\u003cvar\u003elabelName\u003c/var\u003e\u003c/td\u003e\n \u003ctd\u003eSet the label named \u003cvar\u003elabelName\u003c/var\u003e, while preserving other\n labels. To delete the label, include it in `updateMask` and omit its\n mapping in `environment.labels`. It is an error to provide both a\n mask of this form and the \"labels\" mask.\u003c/td\u003e\n \u003c/tr\u003e\n \u003ctr\u003e\n \u003ctd\u003econfig.nodeCount\u003c/td\u003e\n \u003ctd\u003eHorizontally scale the number of nodes in the environment. An integer\n greater than or equal to 3 must be provided in the `config.nodeCount` field.\n \u003c/td\u003e\n \u003c/tr\u003e\n \u003ctr\u003e\n \u003ctd\u003econfig.softwareConfig.airflowConfigOverrides\u003c/td\u003e\n \u003ctd\u003eReplace all Apache Airflow config overrides. If a replacement config\n overrides map is not included in `environment`, all config overrides\n are cleared.\n It is an error to provide both this mask and a mask specifying one or\n more individual config overrides.\u003c/td\u003e\n \u003c/tr\u003e\n \u003ctr\u003e\n \u003ctd\u003econfig.softwareConfig.airflowConfigOverrides.\u003cvar\u003esection\u003c/var\u003e-\u003cvar\u003ename\n \u003c/var\u003e\u003c/td\u003e\n \u003ctd\u003eOverride the Apache Airflow config property \u003cvar\u003ename\u003c/var\u003e in the\n section named \u003cvar\u003esection\u003c/var\u003e, preserving other properties. To delete\n the property override, include it in `updateMask` and omit its mapping\n in `environment.config.softwareConfig.airflowConfigOverrides`.\n It is an error to provide both a mask of this form and the\n \"config.softwareConfig.airflowConfigOverrides\" mask.\u003c/td\u003e\n \u003c/tr\u003e\n \u003ctr\u003e\n \u003ctd\u003econfig.softwareConfig.envVariables\u003c/td\u003e\n \u003ctd\u003eReplace all environment variables. If a replacement environment\n variable map is not included in `environment`, all custom environment\n variables are cleared.\n It is an error to provide both this mask and a mask specifying one or\n more individual environment variables.\u003c/td\u003e\n \u003c/tr\u003e\n \u003ctr\u003e\n \u003ctd\u003econfig.softwareConfig.imageVersion\u003c/td\u003e\n \u003ctd\u003eUpgrade the version of the environment in-place. Refer to\n `SoftwareConfig.image_version` for information on how to format the new\n image version. Additionally, the new image version cannot effect a version\n downgrade and must match the current image version's Composer major\n version and Airflow major and minor versions. Consult the\n \u003ca href=\"/composer/docs/concepts/versioning/composer-versions\"\u003eCloud\n Composer Version List\u003c/a\u003e for valid values.\u003c/td\u003e\n \u003c/tr\u003e\n \u003c/tbody\u003e\n \u003c/table\u003e",
  1966. // "format": "google-fieldmask",
  1967. // "location": "query",
  1968. // "type": "string"
  1969. // }
  1970. // },
  1971. // "path": "v1beta1/{+name}",
  1972. // "request": {
  1973. // "$ref": "Environment"
  1974. // },
  1975. // "response": {
  1976. // "$ref": "Operation"
  1977. // },
  1978. // "scopes": [
  1979. // "https://www.googleapis.com/auth/cloud-platform"
  1980. // ]
  1981. // }
  1982. }
  1983. // method id "composer.projects.locations.imageVersions.list":
  1984. type ProjectsLocationsImageVersionsListCall struct {
  1985. s *Service
  1986. parent string
  1987. urlParams_ gensupport.URLParams
  1988. ifNoneMatch_ string
  1989. ctx_ context.Context
  1990. header_ http.Header
  1991. }
  1992. // List: List ImageVersions for provided location.
  1993. func (r *ProjectsLocationsImageVersionsService) List(parent string) *ProjectsLocationsImageVersionsListCall {
  1994. c := &ProjectsLocationsImageVersionsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1995. c.parent = parent
  1996. return c
  1997. }
  1998. // PageSize sets the optional parameter "pageSize": The maximum number
  1999. // of image_versions to return.
  2000. func (c *ProjectsLocationsImageVersionsListCall) PageSize(pageSize int64) *ProjectsLocationsImageVersionsListCall {
  2001. c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  2002. return c
  2003. }
  2004. // PageToken sets the optional parameter "pageToken": The
  2005. // next_page_token value returned from a previous List request, if any.
  2006. func (c *ProjectsLocationsImageVersionsListCall) PageToken(pageToken string) *ProjectsLocationsImageVersionsListCall {
  2007. c.urlParams_.Set("pageToken", pageToken)
  2008. return c
  2009. }
  2010. // Fields allows partial responses to be retrieved. See
  2011. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2012. // for more information.
  2013. func (c *ProjectsLocationsImageVersionsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsImageVersionsListCall {
  2014. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2015. return c
  2016. }
  2017. // IfNoneMatch sets the optional parameter which makes the operation
  2018. // fail if the object's ETag matches the given value. This is useful for
  2019. // getting updates only after the object has changed since the last
  2020. // request. Use googleapi.IsNotModified to check whether the response
  2021. // error from Do is the result of In-None-Match.
  2022. func (c *ProjectsLocationsImageVersionsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsImageVersionsListCall {
  2023. c.ifNoneMatch_ = entityTag
  2024. return c
  2025. }
  2026. // Context sets the context to be used in this call's Do method. Any
  2027. // pending HTTP request will be aborted if the provided context is
  2028. // canceled.
  2029. func (c *ProjectsLocationsImageVersionsListCall) Context(ctx context.Context) *ProjectsLocationsImageVersionsListCall {
  2030. c.ctx_ = ctx
  2031. return c
  2032. }
  2033. // Header returns an http.Header that can be modified by the caller to
  2034. // add HTTP headers to the request.
  2035. func (c *ProjectsLocationsImageVersionsListCall) Header() http.Header {
  2036. if c.header_ == nil {
  2037. c.header_ = make(http.Header)
  2038. }
  2039. return c.header_
  2040. }
  2041. func (c *ProjectsLocationsImageVersionsListCall) doRequest(alt string) (*http.Response, error) {
  2042. reqHeaders := make(http.Header)
  2043. for k, v := range c.header_ {
  2044. reqHeaders[k] = v
  2045. }
  2046. reqHeaders.Set("User-Agent", c.s.userAgent())
  2047. if c.ifNoneMatch_ != "" {
  2048. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  2049. }
  2050. var body io.Reader = nil
  2051. c.urlParams_.Set("alt", alt)
  2052. c.urlParams_.Set("prettyPrint", "false")
  2053. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/imageVersions")
  2054. urls += "?" + c.urlParams_.Encode()
  2055. req, err := http.NewRequest("GET", urls, body)
  2056. if err != nil {
  2057. return nil, err
  2058. }
  2059. req.Header = reqHeaders
  2060. googleapi.Expand(req.URL, map[string]string{
  2061. "parent": c.parent,
  2062. })
  2063. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2064. }
  2065. // Do executes the "composer.projects.locations.imageVersions.list" call.
  2066. // Exactly one of *ListImageVersionsResponse or error will be non-nil.
  2067. // Any non-2xx status code is an error. Response headers are in either
  2068. // *ListImageVersionsResponse.ServerResponse.Header or (if a response
  2069. // was returned at all) in error.(*googleapi.Error).Header. Use
  2070. // googleapi.IsNotModified to check whether the returned error was
  2071. // because http.StatusNotModified was returned.
  2072. func (c *ProjectsLocationsImageVersionsListCall) Do(opts ...googleapi.CallOption) (*ListImageVersionsResponse, error) {
  2073. gensupport.SetOptions(c.urlParams_, opts...)
  2074. res, err := c.doRequest("json")
  2075. if res != nil && res.StatusCode == http.StatusNotModified {
  2076. if res.Body != nil {
  2077. res.Body.Close()
  2078. }
  2079. return nil, &googleapi.Error{
  2080. Code: res.StatusCode,
  2081. Header: res.Header,
  2082. }
  2083. }
  2084. if err != nil {
  2085. return nil, err
  2086. }
  2087. defer googleapi.CloseBody(res)
  2088. if err := googleapi.CheckResponse(res); err != nil {
  2089. return nil, err
  2090. }
  2091. ret := &ListImageVersionsResponse{
  2092. ServerResponse: googleapi.ServerResponse{
  2093. Header: res.Header,
  2094. HTTPStatusCode: res.StatusCode,
  2095. },
  2096. }
  2097. target := &ret
  2098. if err := gensupport.DecodeResponse(target, res); err != nil {
  2099. return nil, err
  2100. }
  2101. return ret, nil
  2102. // {
  2103. // "description": "List ImageVersions for provided location.",
  2104. // "flatPath": "v1beta1/projects/{projectsId}/locations/{locationsId}/imageVersions",
  2105. // "httpMethod": "GET",
  2106. // "id": "composer.projects.locations.imageVersions.list",
  2107. // "parameterOrder": [
  2108. // "parent"
  2109. // ],
  2110. // "parameters": {
  2111. // "pageSize": {
  2112. // "description": "The maximum number of image_versions to return.",
  2113. // "format": "int32",
  2114. // "location": "query",
  2115. // "type": "integer"
  2116. // },
  2117. // "pageToken": {
  2118. // "description": "The next_page_token value returned from a previous List request, if any.",
  2119. // "location": "query",
  2120. // "type": "string"
  2121. // },
  2122. // "parent": {
  2123. // "description": "List ImageVersions in the given project and location, in the form:\n\"projects/{projectId}/locations/{locationId}\"",
  2124. // "location": "path",
  2125. // "pattern": "^projects/[^/]+/locations/[^/]+$",
  2126. // "required": true,
  2127. // "type": "string"
  2128. // }
  2129. // },
  2130. // "path": "v1beta1/{+parent}/imageVersions",
  2131. // "response": {
  2132. // "$ref": "ListImageVersionsResponse"
  2133. // },
  2134. // "scopes": [
  2135. // "https://www.googleapis.com/auth/cloud-platform"
  2136. // ]
  2137. // }
  2138. }
  2139. // Pages invokes f for each page of results.
  2140. // A non-nil error returned from f will halt the iteration.
  2141. // The provided context supersedes any context provided to the Context method.
  2142. func (c *ProjectsLocationsImageVersionsListCall) Pages(ctx context.Context, f func(*ListImageVersionsResponse) error) error {
  2143. c.ctx_ = ctx
  2144. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  2145. for {
  2146. x, err := c.Do()
  2147. if err != nil {
  2148. return err
  2149. }
  2150. if err := f(x); err != nil {
  2151. return err
  2152. }
  2153. if x.NextPageToken == "" {
  2154. return nil
  2155. }
  2156. c.PageToken(x.NextPageToken)
  2157. }
  2158. }
  2159. // method id "composer.projects.locations.operations.delete":
  2160. type ProjectsLocationsOperationsDeleteCall struct {
  2161. s *Service
  2162. name string
  2163. urlParams_ gensupport.URLParams
  2164. ctx_ context.Context
  2165. header_ http.Header
  2166. }
  2167. // Delete: Deletes a long-running operation. This method indicates that
  2168. // the client is
  2169. // no longer interested in the operation result. It does not cancel
  2170. // the
  2171. // operation. If the server doesn't support this method, it
  2172. // returns
  2173. // `google.rpc.Code.UNIMPLEMENTED`.
  2174. func (r *ProjectsLocationsOperationsService) Delete(name string) *ProjectsLocationsOperationsDeleteCall {
  2175. c := &ProjectsLocationsOperationsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2176. c.name = name
  2177. return c
  2178. }
  2179. // Fields allows partial responses to be retrieved. See
  2180. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2181. // for more information.
  2182. func (c *ProjectsLocationsOperationsDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsOperationsDeleteCall {
  2183. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2184. return c
  2185. }
  2186. // Context sets the context to be used in this call's Do method. Any
  2187. // pending HTTP request will be aborted if the provided context is
  2188. // canceled.
  2189. func (c *ProjectsLocationsOperationsDeleteCall) Context(ctx context.Context) *ProjectsLocationsOperationsDeleteCall {
  2190. c.ctx_ = ctx
  2191. return c
  2192. }
  2193. // Header returns an http.Header that can be modified by the caller to
  2194. // add HTTP headers to the request.
  2195. func (c *ProjectsLocationsOperationsDeleteCall) Header() http.Header {
  2196. if c.header_ == nil {
  2197. c.header_ = make(http.Header)
  2198. }
  2199. return c.header_
  2200. }
  2201. func (c *ProjectsLocationsOperationsDeleteCall) doRequest(alt string) (*http.Response, error) {
  2202. reqHeaders := make(http.Header)
  2203. for k, v := range c.header_ {
  2204. reqHeaders[k] = v
  2205. }
  2206. reqHeaders.Set("User-Agent", c.s.userAgent())
  2207. var body io.Reader = nil
  2208. c.urlParams_.Set("alt", alt)
  2209. c.urlParams_.Set("prettyPrint", "false")
  2210. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}")
  2211. urls += "?" + c.urlParams_.Encode()
  2212. req, err := http.NewRequest("DELETE", urls, body)
  2213. if err != nil {
  2214. return nil, err
  2215. }
  2216. req.Header = reqHeaders
  2217. googleapi.Expand(req.URL, map[string]string{
  2218. "name": c.name,
  2219. })
  2220. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2221. }
  2222. // Do executes the "composer.projects.locations.operations.delete" call.
  2223. // Exactly one of *Empty or error will be non-nil. Any non-2xx status
  2224. // code is an error. Response headers are in either
  2225. // *Empty.ServerResponse.Header or (if a response was returned at all)
  2226. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  2227. // check whether the returned error was because http.StatusNotModified
  2228. // was returned.
  2229. func (c *ProjectsLocationsOperationsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
  2230. gensupport.SetOptions(c.urlParams_, opts...)
  2231. res, err := c.doRequest("json")
  2232. if res != nil && res.StatusCode == http.StatusNotModified {
  2233. if res.Body != nil {
  2234. res.Body.Close()
  2235. }
  2236. return nil, &googleapi.Error{
  2237. Code: res.StatusCode,
  2238. Header: res.Header,
  2239. }
  2240. }
  2241. if err != nil {
  2242. return nil, err
  2243. }
  2244. defer googleapi.CloseBody(res)
  2245. if err := googleapi.CheckResponse(res); err != nil {
  2246. return nil, err
  2247. }
  2248. ret := &Empty{
  2249. ServerResponse: googleapi.ServerResponse{
  2250. Header: res.Header,
  2251. HTTPStatusCode: res.StatusCode,
  2252. },
  2253. }
  2254. target := &ret
  2255. if err := gensupport.DecodeResponse(target, res); err != nil {
  2256. return nil, err
  2257. }
  2258. return ret, nil
  2259. // {
  2260. // "description": "Deletes a long-running operation. This method indicates that the client is\nno longer interested in the operation result. It does not cancel the\noperation. If the server doesn't support this method, it returns\n`google.rpc.Code.UNIMPLEMENTED`.",
  2261. // "flatPath": "v1beta1/projects/{projectsId}/locations/{locationsId}/operations/{operationsId}",
  2262. // "httpMethod": "DELETE",
  2263. // "id": "composer.projects.locations.operations.delete",
  2264. // "parameterOrder": [
  2265. // "name"
  2266. // ],
  2267. // "parameters": {
  2268. // "name": {
  2269. // "description": "The name of the operation resource to be deleted.",
  2270. // "location": "path",
  2271. // "pattern": "^projects/[^/]+/locations/[^/]+/operations/[^/]+$",
  2272. // "required": true,
  2273. // "type": "string"
  2274. // }
  2275. // },
  2276. // "path": "v1beta1/{+name}",
  2277. // "response": {
  2278. // "$ref": "Empty"
  2279. // },
  2280. // "scopes": [
  2281. // "https://www.googleapis.com/auth/cloud-platform"
  2282. // ]
  2283. // }
  2284. }
  2285. // method id "composer.projects.locations.operations.get":
  2286. type ProjectsLocationsOperationsGetCall struct {
  2287. s *Service
  2288. name string
  2289. urlParams_ gensupport.URLParams
  2290. ifNoneMatch_ string
  2291. ctx_ context.Context
  2292. header_ http.Header
  2293. }
  2294. // Get: Gets the latest state of a long-running operation. Clients can
  2295. // use this
  2296. // method to poll the operation result at intervals as recommended by
  2297. // the API
  2298. // service.
  2299. func (r *ProjectsLocationsOperationsService) Get(name string) *ProjectsLocationsOperationsGetCall {
  2300. c := &ProjectsLocationsOperationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2301. c.name = name
  2302. return c
  2303. }
  2304. // Fields allows partial responses to be retrieved. See
  2305. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2306. // for more information.
  2307. func (c *ProjectsLocationsOperationsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsOperationsGetCall {
  2308. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2309. return c
  2310. }
  2311. // IfNoneMatch sets the optional parameter which makes the operation
  2312. // fail if the object's ETag matches the given value. This is useful for
  2313. // getting updates only after the object has changed since the last
  2314. // request. Use googleapi.IsNotModified to check whether the response
  2315. // error from Do is the result of In-None-Match.
  2316. func (c *ProjectsLocationsOperationsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsOperationsGetCall {
  2317. c.ifNoneMatch_ = entityTag
  2318. return c
  2319. }
  2320. // Context sets the context to be used in this call's Do method. Any
  2321. // pending HTTP request will be aborted if the provided context is
  2322. // canceled.
  2323. func (c *ProjectsLocationsOperationsGetCall) Context(ctx context.Context) *ProjectsLocationsOperationsGetCall {
  2324. c.ctx_ = ctx
  2325. return c
  2326. }
  2327. // Header returns an http.Header that can be modified by the caller to
  2328. // add HTTP headers to the request.
  2329. func (c *ProjectsLocationsOperationsGetCall) Header() http.Header {
  2330. if c.header_ == nil {
  2331. c.header_ = make(http.Header)
  2332. }
  2333. return c.header_
  2334. }
  2335. func (c *ProjectsLocationsOperationsGetCall) doRequest(alt string) (*http.Response, error) {
  2336. reqHeaders := make(http.Header)
  2337. for k, v := range c.header_ {
  2338. reqHeaders[k] = v
  2339. }
  2340. reqHeaders.Set("User-Agent", c.s.userAgent())
  2341. if c.ifNoneMatch_ != "" {
  2342. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  2343. }
  2344. var body io.Reader = nil
  2345. c.urlParams_.Set("alt", alt)
  2346. c.urlParams_.Set("prettyPrint", "false")
  2347. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}")
  2348. urls += "?" + c.urlParams_.Encode()
  2349. req, err := http.NewRequest("GET", urls, body)
  2350. if err != nil {
  2351. return nil, err
  2352. }
  2353. req.Header = reqHeaders
  2354. googleapi.Expand(req.URL, map[string]string{
  2355. "name": c.name,
  2356. })
  2357. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2358. }
  2359. // Do executes the "composer.projects.locations.operations.get" call.
  2360. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  2361. // status code is an error. Response headers are in either
  2362. // *Operation.ServerResponse.Header or (if a response was returned at
  2363. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  2364. // to check whether the returned error was because
  2365. // http.StatusNotModified was returned.
  2366. func (c *ProjectsLocationsOperationsGetCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  2367. gensupport.SetOptions(c.urlParams_, opts...)
  2368. res, err := c.doRequest("json")
  2369. if res != nil && res.StatusCode == http.StatusNotModified {
  2370. if res.Body != nil {
  2371. res.Body.Close()
  2372. }
  2373. return nil, &googleapi.Error{
  2374. Code: res.StatusCode,
  2375. Header: res.Header,
  2376. }
  2377. }
  2378. if err != nil {
  2379. return nil, err
  2380. }
  2381. defer googleapi.CloseBody(res)
  2382. if err := googleapi.CheckResponse(res); err != nil {
  2383. return nil, err
  2384. }
  2385. ret := &Operation{
  2386. ServerResponse: googleapi.ServerResponse{
  2387. Header: res.Header,
  2388. HTTPStatusCode: res.StatusCode,
  2389. },
  2390. }
  2391. target := &ret
  2392. if err := gensupport.DecodeResponse(target, res); err != nil {
  2393. return nil, err
  2394. }
  2395. return ret, nil
  2396. // {
  2397. // "description": "Gets the latest state of a long-running operation. Clients can use this\nmethod to poll the operation result at intervals as recommended by the API\nservice.",
  2398. // "flatPath": "v1beta1/projects/{projectsId}/locations/{locationsId}/operations/{operationsId}",
  2399. // "httpMethod": "GET",
  2400. // "id": "composer.projects.locations.operations.get",
  2401. // "parameterOrder": [
  2402. // "name"
  2403. // ],
  2404. // "parameters": {
  2405. // "name": {
  2406. // "description": "The name of the operation resource.",
  2407. // "location": "path",
  2408. // "pattern": "^projects/[^/]+/locations/[^/]+/operations/[^/]+$",
  2409. // "required": true,
  2410. // "type": "string"
  2411. // }
  2412. // },
  2413. // "path": "v1beta1/{+name}",
  2414. // "response": {
  2415. // "$ref": "Operation"
  2416. // },
  2417. // "scopes": [
  2418. // "https://www.googleapis.com/auth/cloud-platform"
  2419. // ]
  2420. // }
  2421. }
  2422. // method id "composer.projects.locations.operations.list":
  2423. type ProjectsLocationsOperationsListCall struct {
  2424. s *Service
  2425. name string
  2426. urlParams_ gensupport.URLParams
  2427. ifNoneMatch_ string
  2428. ctx_ context.Context
  2429. header_ http.Header
  2430. }
  2431. // List: Lists operations that match the specified filter in the
  2432. // request. If the
  2433. // server doesn't support this method, it returns
  2434. // `UNIMPLEMENTED`.
  2435. //
  2436. // NOTE: the `name` binding allows API services to override the
  2437. // binding
  2438. // to use different resource name schemes, such as `users/*/operations`.
  2439. // To
  2440. // override the binding, API services can add a binding such
  2441. // as
  2442. // "/v1/{name=users/*}/operations" to their service configuration.
  2443. // For backwards compatibility, the default name includes the
  2444. // operations
  2445. // collection id, however overriding users must ensure the name
  2446. // binding
  2447. // is the parent resource, without the operations collection id.
  2448. func (r *ProjectsLocationsOperationsService) List(name string) *ProjectsLocationsOperationsListCall {
  2449. c := &ProjectsLocationsOperationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2450. c.name = name
  2451. return c
  2452. }
  2453. // Filter sets the optional parameter "filter": The standard list
  2454. // filter.
  2455. func (c *ProjectsLocationsOperationsListCall) Filter(filter string) *ProjectsLocationsOperationsListCall {
  2456. c.urlParams_.Set("filter", filter)
  2457. return c
  2458. }
  2459. // PageSize sets the optional parameter "pageSize": The standard list
  2460. // page size.
  2461. func (c *ProjectsLocationsOperationsListCall) PageSize(pageSize int64) *ProjectsLocationsOperationsListCall {
  2462. c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  2463. return c
  2464. }
  2465. // PageToken sets the optional parameter "pageToken": The standard list
  2466. // page token.
  2467. func (c *ProjectsLocationsOperationsListCall) PageToken(pageToken string) *ProjectsLocationsOperationsListCall {
  2468. c.urlParams_.Set("pageToken", pageToken)
  2469. return c
  2470. }
  2471. // Fields allows partial responses to be retrieved. See
  2472. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2473. // for more information.
  2474. func (c *ProjectsLocationsOperationsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsOperationsListCall {
  2475. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2476. return c
  2477. }
  2478. // IfNoneMatch sets the optional parameter which makes the operation
  2479. // fail if the object's ETag matches the given value. This is useful for
  2480. // getting updates only after the object has changed since the last
  2481. // request. Use googleapi.IsNotModified to check whether the response
  2482. // error from Do is the result of In-None-Match.
  2483. func (c *ProjectsLocationsOperationsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsOperationsListCall {
  2484. c.ifNoneMatch_ = entityTag
  2485. return c
  2486. }
  2487. // Context sets the context to be used in this call's Do method. Any
  2488. // pending HTTP request will be aborted if the provided context is
  2489. // canceled.
  2490. func (c *ProjectsLocationsOperationsListCall) Context(ctx context.Context) *ProjectsLocationsOperationsListCall {
  2491. c.ctx_ = ctx
  2492. return c
  2493. }
  2494. // Header returns an http.Header that can be modified by the caller to
  2495. // add HTTP headers to the request.
  2496. func (c *ProjectsLocationsOperationsListCall) Header() http.Header {
  2497. if c.header_ == nil {
  2498. c.header_ = make(http.Header)
  2499. }
  2500. return c.header_
  2501. }
  2502. func (c *ProjectsLocationsOperationsListCall) doRequest(alt string) (*http.Response, error) {
  2503. reqHeaders := make(http.Header)
  2504. for k, v := range c.header_ {
  2505. reqHeaders[k] = v
  2506. }
  2507. reqHeaders.Set("User-Agent", c.s.userAgent())
  2508. if c.ifNoneMatch_ != "" {
  2509. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  2510. }
  2511. var body io.Reader = nil
  2512. c.urlParams_.Set("alt", alt)
  2513. c.urlParams_.Set("prettyPrint", "false")
  2514. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}/operations")
  2515. urls += "?" + c.urlParams_.Encode()
  2516. req, err := http.NewRequest("GET", urls, body)
  2517. if err != nil {
  2518. return nil, err
  2519. }
  2520. req.Header = reqHeaders
  2521. googleapi.Expand(req.URL, map[string]string{
  2522. "name": c.name,
  2523. })
  2524. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2525. }
  2526. // Do executes the "composer.projects.locations.operations.list" call.
  2527. // Exactly one of *ListOperationsResponse or error will be non-nil. Any
  2528. // non-2xx status code is an error. Response headers are in either
  2529. // *ListOperationsResponse.ServerResponse.Header or (if a response was
  2530. // returned at all) in error.(*googleapi.Error).Header. Use
  2531. // googleapi.IsNotModified to check whether the returned error was
  2532. // because http.StatusNotModified was returned.
  2533. func (c *ProjectsLocationsOperationsListCall) Do(opts ...googleapi.CallOption) (*ListOperationsResponse, error) {
  2534. gensupport.SetOptions(c.urlParams_, opts...)
  2535. res, err := c.doRequest("json")
  2536. if res != nil && res.StatusCode == http.StatusNotModified {
  2537. if res.Body != nil {
  2538. res.Body.Close()
  2539. }
  2540. return nil, &googleapi.Error{
  2541. Code: res.StatusCode,
  2542. Header: res.Header,
  2543. }
  2544. }
  2545. if err != nil {
  2546. return nil, err
  2547. }
  2548. defer googleapi.CloseBody(res)
  2549. if err := googleapi.CheckResponse(res); err != nil {
  2550. return nil, err
  2551. }
  2552. ret := &ListOperationsResponse{
  2553. ServerResponse: googleapi.ServerResponse{
  2554. Header: res.Header,
  2555. HTTPStatusCode: res.StatusCode,
  2556. },
  2557. }
  2558. target := &ret
  2559. if err := gensupport.DecodeResponse(target, res); err != nil {
  2560. return nil, err
  2561. }
  2562. return ret, nil
  2563. // {
  2564. // "description": "Lists operations that match the specified filter in the request. If the\nserver doesn't support this method, it returns `UNIMPLEMENTED`.\n\nNOTE: the `name` binding allows API services to override the binding\nto use different resource name schemes, such as `users/*/operations`. To\noverride the binding, API services can add a binding such as\n`\"/v1/{name=users/*}/operations\"` to their service configuration.\nFor backwards compatibility, the default name includes the operations\ncollection id, however overriding users must ensure the name binding\nis the parent resource, without the operations collection id.",
  2565. // "flatPath": "v1beta1/projects/{projectsId}/locations/{locationsId}/operations",
  2566. // "httpMethod": "GET",
  2567. // "id": "composer.projects.locations.operations.list",
  2568. // "parameterOrder": [
  2569. // "name"
  2570. // ],
  2571. // "parameters": {
  2572. // "filter": {
  2573. // "description": "The standard list filter.",
  2574. // "location": "query",
  2575. // "type": "string"
  2576. // },
  2577. // "name": {
  2578. // "description": "The name of the operation's parent resource.",
  2579. // "location": "path",
  2580. // "pattern": "^projects/[^/]+/locations/[^/]+$",
  2581. // "required": true,
  2582. // "type": "string"
  2583. // },
  2584. // "pageSize": {
  2585. // "description": "The standard list page size.",
  2586. // "format": "int32",
  2587. // "location": "query",
  2588. // "type": "integer"
  2589. // },
  2590. // "pageToken": {
  2591. // "description": "The standard list page token.",
  2592. // "location": "query",
  2593. // "type": "string"
  2594. // }
  2595. // },
  2596. // "path": "v1beta1/{+name}/operations",
  2597. // "response": {
  2598. // "$ref": "ListOperationsResponse"
  2599. // },
  2600. // "scopes": [
  2601. // "https://www.googleapis.com/auth/cloud-platform"
  2602. // ]
  2603. // }
  2604. }
  2605. // Pages invokes f for each page of results.
  2606. // A non-nil error returned from f will halt the iteration.
  2607. // The provided context supersedes any context provided to the Context method.
  2608. func (c *ProjectsLocationsOperationsListCall) Pages(ctx context.Context, f func(*ListOperationsResponse) error) error {
  2609. c.ctx_ = ctx
  2610. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  2611. for {
  2612. x, err := c.Do()
  2613. if err != nil {
  2614. return err
  2615. }
  2616. if err := f(x); err != nil {
  2617. return err
  2618. }
  2619. if x.NextPageToken == "" {
  2620. return nil
  2621. }
  2622. c.PageToken(x.NextPageToken)
  2623. }
  2624. }