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