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 // PrivateEnvironmentConfig: The configuration used for the Private IP 327 // Cloud Composer environment. 328 PrivateEnvironmentConfig *PrivateEnvironmentConfig `json:"privateEnvironmentConfig,omitempty"` 329 330 // SoftwareConfig: The configuration settings for software inside the 331 // environment. 332 SoftwareConfig *SoftwareConfig `json:"softwareConfig,omitempty"` 333 334 // ForceSendFields is a list of field names (e.g. "AirflowUri") to 335 // unconditionally include in API requests. By default, fields with 336 // empty values are omitted from API requests. However, any non-pointer, 337 // non-interface field appearing in ForceSendFields will be sent to the 338 // server regardless of whether the field is empty or not. This may be 339 // used to include empty fields in Patch requests. 340 ForceSendFields []string `json:"-"` 341 342 // NullFields is a list of field names (e.g. "AirflowUri") to include in 343 // API requests with the JSON null value. By default, fields with empty 344 // values are omitted from API requests. However, any field with an 345 // empty value appearing in NullFields will be sent to the server as 346 // null. It is an error if a field in this list has a non-empty value. 347 // This may be used to include null fields in Patch requests. 348 NullFields []string `json:"-"` 349} 350 351func (s *EnvironmentConfig) MarshalJSON() ([]byte, error) { 352 type NoMethod EnvironmentConfig 353 raw := NoMethod(*s) 354 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 355} 356 357// IPAllocationPolicy: Configuration for controlling how IPs are 358// allocated in the 359// GKE cluster running the Apache Airflow software. 360type IPAllocationPolicy struct { 361 // ClusterIpv4CidrBlock: Optional. The IP address range used to allocate 362 // IP addresses to pods in 363 // the GKE cluster. 364 // 365 // This field is applicable only when `use_ip_aliases` is true. 366 // 367 // Set to blank to have GKE choose a range with the default size. 368 // 369 // Set to /netmask (e.g. `/14`) to have GKE choose a range with a 370 // specific 371 // netmask. 372 // 373 // Set to 374 // a 375 // [CIDR](http://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing) 376 // 377 // notation (e.g. `10.96.0.0/14`) from the RFC-1918 private networks 378 // (e.g. 379 // `10.0.0.0/8`, `172.16.0.0/12`, `192.168.0.0/16`) to pick a specific 380 // range 381 // to use. 382 ClusterIpv4CidrBlock string `json:"clusterIpv4CidrBlock,omitempty"` 383 384 // ClusterSecondaryRangeName: Optional. The name of the GKE cluster's 385 // secondary range used to allocate 386 // IP addresses to pods. 387 // 388 // This field is applicable only when `use_ip_aliases` is true. 389 ClusterSecondaryRangeName string `json:"clusterSecondaryRangeName,omitempty"` 390 391 // ServicesIpv4CidrBlock: Optional. The IP address range of the services 392 // IP addresses in this 393 // GKE cluster. 394 // 395 // This field is applicable only when `use_ip_aliases` is true. 396 // 397 // Set to blank to have GKE choose a range with the default size. 398 // 399 // Set to /netmask (e.g. `/14`) to have GKE choose a range with a 400 // specific 401 // netmask. 402 // 403 // Set to 404 // a 405 // [CIDR](http://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing) 406 // 407 // notation (e.g. `10.96.0.0/14`) from the RFC-1918 private networks 408 // (e.g. 409 // `10.0.0.0/8`, `172.16.0.0/12`, `192.168.0.0/16`) to pick a specific 410 // range 411 // to use. 412 ServicesIpv4CidrBlock string `json:"servicesIpv4CidrBlock,omitempty"` 413 414 // ServicesSecondaryRangeName: Optional. The name of the services' 415 // secondary range used to allocate 416 // IP addresses to the GKE cluster. 417 // 418 // This field is applicable only when `use_ip_aliases` is true. 419 ServicesSecondaryRangeName string `json:"servicesSecondaryRangeName,omitempty"` 420 421 // UseIpAliases: Optional. Whether or not to enable Alias IPs in the GKE 422 // cluster. 423 // If `true`, a VPC-native cluster is created. 424 UseIpAliases bool `json:"useIpAliases,omitempty"` 425 426 // ForceSendFields is a list of field names (e.g. 427 // "ClusterIpv4CidrBlock") to unconditionally include in API requests. 428 // By default, fields with empty values are omitted from API requests. 429 // However, any non-pointer, non-interface field appearing in 430 // ForceSendFields will be sent to the server regardless of whether the 431 // field is empty or not. This may be used to include empty fields in 432 // Patch requests. 433 ForceSendFields []string `json:"-"` 434 435 // NullFields is a list of field names (e.g. "ClusterIpv4CidrBlock") to 436 // include in API requests with the JSON null value. By default, fields 437 // with empty values are omitted from API requests. However, any field 438 // with an empty value appearing in NullFields will be sent to the 439 // server as null. It is an error if a field in this list has a 440 // non-empty value. This may be used to include null fields in Patch 441 // requests. 442 NullFields []string `json:"-"` 443} 444 445func (s *IPAllocationPolicy) MarshalJSON() ([]byte, error) { 446 type NoMethod IPAllocationPolicy 447 raw := NoMethod(*s) 448 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 449} 450 451// ImageVersion: ImageVersion information 452type ImageVersion struct { 453 // ImageVersionId: The string identifier of the ImageVersion, in the 454 // form: 455 // "composer-x.y.z-airflow-a.b(.c)" 456 ImageVersionId string `json:"imageVersionId,omitempty"` 457 458 // IsDefault: Whether this is the default ImageVersion used by Composer 459 // during 460 // environment creation if no input ImageVersion is specified. 461 IsDefault bool `json:"isDefault,omitempty"` 462 463 // SupportedPythonVersions: supported python versions 464 SupportedPythonVersions []string `json:"supportedPythonVersions,omitempty"` 465 466 // ForceSendFields is a list of field names (e.g. "ImageVersionId") to 467 // unconditionally include in API requests. By default, fields with 468 // empty values are omitted from API requests. However, any non-pointer, 469 // non-interface field appearing in ForceSendFields will be sent to the 470 // server regardless of whether the field is empty or not. This may be 471 // used to include empty fields in Patch requests. 472 ForceSendFields []string `json:"-"` 473 474 // NullFields is a list of field names (e.g. "ImageVersionId") to 475 // include in API requests with the JSON null value. By default, fields 476 // with empty values are omitted from API requests. However, any field 477 // with an empty value appearing in NullFields will be sent to the 478 // server as null. It is an error if a field in this list has a 479 // non-empty value. This may be used to include null fields in Patch 480 // requests. 481 NullFields []string `json:"-"` 482} 483 484func (s *ImageVersion) MarshalJSON() ([]byte, error) { 485 type NoMethod ImageVersion 486 raw := NoMethod(*s) 487 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 488} 489 490// ListEnvironmentsResponse: The environments in a project and location. 491type ListEnvironmentsResponse struct { 492 // Environments: The list of environments returned by a 493 // ListEnvironmentsRequest. 494 Environments []*Environment `json:"environments,omitempty"` 495 496 // NextPageToken: The page token used to query for the next page if one 497 // exists. 498 NextPageToken string `json:"nextPageToken,omitempty"` 499 500 // ServerResponse contains the HTTP response code and headers from the 501 // server. 502 googleapi.ServerResponse `json:"-"` 503 504 // ForceSendFields is a list of field names (e.g. "Environments") to 505 // unconditionally include in API requests. By default, fields with 506 // empty values are omitted from API requests. However, any non-pointer, 507 // non-interface field appearing in ForceSendFields will be sent to the 508 // server regardless of whether the field is empty or not. This may be 509 // used to include empty fields in Patch requests. 510 ForceSendFields []string `json:"-"` 511 512 // NullFields is a list of field names (e.g. "Environments") to include 513 // in API requests with the JSON null value. By default, fields with 514 // empty values are omitted from API requests. However, any field with 515 // an empty value appearing in NullFields will be sent to the server as 516 // null. It is an error if a field in this list has a non-empty value. 517 // This may be used to include null fields in Patch requests. 518 NullFields []string `json:"-"` 519} 520 521func (s *ListEnvironmentsResponse) MarshalJSON() ([]byte, error) { 522 type NoMethod ListEnvironmentsResponse 523 raw := NoMethod(*s) 524 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 525} 526 527// ListImageVersionsResponse: The ImageVersions in a project and 528// location. 529type ListImageVersionsResponse struct { 530 // ImageVersions: The list of supported ImageVersions in a location. 531 ImageVersions []*ImageVersion `json:"imageVersions,omitempty"` 532 533 // NextPageToken: The page token used to query for the next page if one 534 // exists. 535 NextPageToken string `json:"nextPageToken,omitempty"` 536 537 // ServerResponse contains the HTTP response code and headers from the 538 // server. 539 googleapi.ServerResponse `json:"-"` 540 541 // ForceSendFields is a list of field names (e.g. "ImageVersions") to 542 // unconditionally include in API requests. By default, fields with 543 // empty values are omitted from API requests. However, any non-pointer, 544 // non-interface field appearing in ForceSendFields will be sent to the 545 // server regardless of whether the field is empty or not. This may be 546 // used to include empty fields in Patch requests. 547 ForceSendFields []string `json:"-"` 548 549 // NullFields is a list of field names (e.g. "ImageVersions") to include 550 // in API requests with the JSON null value. By default, fields with 551 // empty values are omitted from API requests. However, any field with 552 // an empty value appearing in NullFields will be sent to the server as 553 // null. It is an error if a field in this list has a non-empty value. 554 // This may be used to include null fields in Patch requests. 555 NullFields []string `json:"-"` 556} 557 558func (s *ListImageVersionsResponse) MarshalJSON() ([]byte, error) { 559 type NoMethod ListImageVersionsResponse 560 raw := NoMethod(*s) 561 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 562} 563 564// ListOperationsResponse: The response message for 565// Operations.ListOperations. 566type ListOperationsResponse struct { 567 // NextPageToken: The standard List next-page token. 568 NextPageToken string `json:"nextPageToken,omitempty"` 569 570 // Operations: A list of operations that matches the specified filter in 571 // the request. 572 Operations []*Operation `json:"operations,omitempty"` 573 574 // ServerResponse contains the HTTP response code and headers from the 575 // server. 576 googleapi.ServerResponse `json:"-"` 577 578 // ForceSendFields is a list of field names (e.g. "NextPageToken") to 579 // unconditionally include in API requests. By default, fields with 580 // empty values are omitted from API requests. However, any non-pointer, 581 // non-interface field appearing in ForceSendFields will be sent to the 582 // server regardless of whether the field is empty or not. This may be 583 // used to include empty fields in Patch requests. 584 ForceSendFields []string `json:"-"` 585 586 // NullFields is a list of field names (e.g. "NextPageToken") to include 587 // in API requests with the JSON null value. By default, fields with 588 // empty values are omitted from API requests. However, any field with 589 // an empty value appearing in NullFields will be sent to the server as 590 // null. It is an error if a field in this list has a non-empty value. 591 // This may be used to include null fields in Patch requests. 592 NullFields []string `json:"-"` 593} 594 595func (s *ListOperationsResponse) MarshalJSON() ([]byte, error) { 596 type NoMethod ListOperationsResponse 597 raw := NoMethod(*s) 598 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 599} 600 601// NodeConfig: The configuration information for the Kubernetes Engine 602// nodes running 603// the Apache Airflow software. 604type NodeConfig struct { 605 // DiskSizeGb: Optional. The disk size in GB used for node VMs. Minimum 606 // size is 20GB. 607 // If unspecified, defaults to 100GB. Cannot be updated. 608 DiskSizeGb int64 `json:"diskSizeGb,omitempty"` 609 610 // IpAllocationPolicy: Optional. The configuration for controlling how 611 // IPs are allocated in the GKE cluster. 612 IpAllocationPolicy *IPAllocationPolicy `json:"ipAllocationPolicy,omitempty"` 613 614 // Location: Optional. The Compute Engine 615 // [zone](/compute/docs/regions-zones) in which 616 // to deploy the VMs used to run the Apache Airflow software, specified 617 // as a 618 // [relative 619 // resource 620 // name](/apis/design/resource_names#relative_resource_name). For 621 // example: 622 // "projects/{projectId}/zones/{zoneId}". 623 // 624 // This `location` must belong to the enclosing environment's project 625 // and 626 // location. If both this field and `nodeConfig.machineType` are 627 // specified, 628 // `nodeConfig.machineType` must belong to this `location`; if both 629 // are 630 // unspecified, the service will pick a zone in the Compute Engine 631 // region 632 // corresponding to the Cloud Composer location, and propagate that 633 // choice to 634 // both fields. If only one field (`location` or 635 // `nodeConfig.machineType`) is 636 // specified, the location information from the specified field will 637 // be 638 // propagated to the unspecified field. 639 Location string `json:"location,omitempty"` 640 641 // MachineType: Optional. The Compute Engine 642 // [machine type](/compute/docs/machine-types) used for cluster 643 // instances, 644 // specified as a 645 // [relative 646 // resource 647 // name](/apis/design/resource_names#relative_resource_name). For 648 // example: 649 // "projects/{projectId}/zones/{zoneId}/machineTypes/{machineTyp 650 // eId}". 651 // 652 // The `machineType` must belong to the enclosing environment's project 653 // and 654 // location. If both this field and `nodeConfig.location` are 655 // specified, 656 // this `machineType` must belong to the `nodeConfig.location`; if both 657 // are 658 // unspecified, the service will pick a zone in the Compute Engine 659 // region 660 // corresponding to the Cloud Composer location, and propagate that 661 // choice to 662 // both fields. If exactly one of this field and `nodeConfig.location` 663 // is 664 // specified, the location information from the specified field will 665 // be 666 // propagated to the unspecified field. 667 // 668 // The `machineTypeId` must not be a [shared-core 669 // machine 670 // type](/compute/docs/machine-types#sharedcore). 671 // 672 // If this field is unspecified, the `machineTypeId` defaults 673 // to "n1-standard-1". 674 MachineType string `json:"machineType,omitempty"` 675 676 // Network: Optional. The Compute Engine network to be used for 677 // machine 678 // communications, specified as a 679 // [relative 680 // resource 681 // name](/apis/design/resource_names#relative_resource_name). For 682 // example: 683 // "projects/{projectId}/global/networks/{networkId}". 684 // 685 // [Shared VPC](/vpc/docs/shared-vpc) is not currently supported. 686 // The 687 // network must belong to the environment's project. If unspecified, 688 // the 689 // "default" network ID in the environment's project is used. If 690 // a 691 // [Custom Subnet Network](/vpc/docs/vpc#vpc_networks_and_subnets) 692 // is provided, `nodeConfig.subnetwork` must also be provided. 693 Network string `json:"network,omitempty"` 694 695 // OauthScopes: Optional. The set of Google API scopes to be made 696 // available on all 697 // node VMs. If `oauth_scopes` is empty, defaults 698 // to 699 // ["https://www.googleapis.com/auth/cloud-platform"]. Cannot be 700 // updated. 701 OauthScopes []string `json:"oauthScopes,omitempty"` 702 703 // ServiceAccount: Optional. The Google Cloud Platform Service Account 704 // to be used by the node 705 // VMs. If a service account is not specified, the "default" Compute 706 // Engine 707 // service account is used. Cannot be updated. 708 ServiceAccount string `json:"serviceAccount,omitempty"` 709 710 // Subnetwork: Optional. The Compute Engine subnetwork to be used for 711 // machine 712 // communications, specified as a 713 // [relative 714 // resource 715 // name](/apis/design/resource_names#relative_resource_name). For 716 // example: 717 // "projects/{projectId}/regions/{regionId}/subnetworks/{subnetw 718 // orkId}" 719 // 720 // If a subnetwork is provided, `nodeConfig.network` must also be 721 // provided, 722 // and the subnetwork must belong to the enclosing environment's project 723 // and 724 // location. 725 Subnetwork string `json:"subnetwork,omitempty"` 726 727 // Tags: Optional. The list of instance tags applied to all node VMs. 728 // Tags are used 729 // to identify valid sources or targets for network firewalls. Each tag 730 // within 731 // the list must comply with 732 // [RFC1035](https://www.ietf.org/rfc/rfc1035.txt). 733 // Cannot be updated. 734 Tags []string `json:"tags,omitempty"` 735 736 // ForceSendFields is a list of field names (e.g. "DiskSizeGb") to 737 // unconditionally include in API requests. By default, fields with 738 // empty values are omitted from API requests. However, any non-pointer, 739 // non-interface field appearing in ForceSendFields will be sent to the 740 // server regardless of whether the field is empty or not. This may be 741 // used to include empty fields in Patch requests. 742 ForceSendFields []string `json:"-"` 743 744 // NullFields is a list of field names (e.g. "DiskSizeGb") to include in 745 // API requests with the JSON null value. By default, fields with empty 746 // values are omitted from API requests. However, any field with an 747 // empty value appearing in NullFields will be sent to the server as 748 // null. It is an error if a field in this list has a non-empty value. 749 // This may be used to include null fields in Patch requests. 750 NullFields []string `json:"-"` 751} 752 753func (s *NodeConfig) MarshalJSON() ([]byte, error) { 754 type NoMethod NodeConfig 755 raw := NoMethod(*s) 756 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 757} 758 759// Operation: This resource represents a long-running operation that is 760// the result of a 761// network API call. 762type Operation struct { 763 // Done: If the value is `false`, it means the operation is still in 764 // progress. 765 // If `true`, the operation is completed, and either `error` or 766 // `response` is 767 // available. 768 Done bool `json:"done,omitempty"` 769 770 // Error: The error result of the operation in case of failure or 771 // cancellation. 772 Error *Status `json:"error,omitempty"` 773 774 // Metadata: Service-specific metadata associated with the operation. 775 // It typically 776 // contains progress information and common metadata such as create 777 // time. 778 // Some services might not provide such metadata. Any method that 779 // returns a 780 // long-running operation should document the metadata type, if any. 781 Metadata googleapi.RawMessage `json:"metadata,omitempty"` 782 783 // Name: The server-assigned name, which is only unique within the same 784 // service that 785 // originally returns it. If you use the default HTTP mapping, 786 // the 787 // `name` should be a resource name ending with 788 // `operations/{unique_id}`. 789 Name string `json:"name,omitempty"` 790 791 // Response: The normal response of the operation in case of success. 792 // If the original 793 // method returns no data on success, such as `Delete`, the response 794 // is 795 // `google.protobuf.Empty`. If the original method is 796 // standard 797 // `Get`/`Create`/`Update`, the response should be the resource. For 798 // other 799 // methods, the response should have the type `XxxResponse`, where 800 // `Xxx` 801 // is the original method name. For example, if the original method 802 // name 803 // is `TakeSnapshot()`, the inferred response type 804 // is 805 // `TakeSnapshotResponse`. 806 Response googleapi.RawMessage `json:"response,omitempty"` 807 808 // ServerResponse contains the HTTP response code and headers from the 809 // server. 810 googleapi.ServerResponse `json:"-"` 811 812 // ForceSendFields is a list of field names (e.g. "Done") to 813 // unconditionally include in API requests. By default, fields with 814 // empty values are omitted from API requests. However, any non-pointer, 815 // non-interface field appearing in ForceSendFields will be sent to the 816 // server regardless of whether the field is empty or not. This may be 817 // used to include empty fields in Patch requests. 818 ForceSendFields []string `json:"-"` 819 820 // NullFields is a list of field names (e.g. "Done") to include in API 821 // requests with the JSON null value. By default, fields with empty 822 // values are omitted from API requests. However, any field with an 823 // empty value appearing in NullFields will be sent to the server as 824 // null. It is an error if a field in this list has a non-empty value. 825 // This may be used to include null fields in Patch requests. 826 NullFields []string `json:"-"` 827} 828 829func (s *Operation) MarshalJSON() ([]byte, error) { 830 type NoMethod Operation 831 raw := NoMethod(*s) 832 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 833} 834 835// OperationMetadata: Metadata describing an operation. 836type OperationMetadata struct { 837 // CreateTime: Output only. The time the operation was submitted to the 838 // server. 839 CreateTime string `json:"createTime,omitempty"` 840 841 // EndTime: Output only. The time when the operation terminated, 842 // regardless of its success. 843 // This field is unset if the operation is still ongoing. 844 EndTime string `json:"endTime,omitempty"` 845 846 // OperationType: Output only. The type of operation being performed. 847 // 848 // Possible values: 849 // "TYPE_UNSPECIFIED" - Unused. 850 // "CREATE" - A resource creation operation. 851 // "DELETE" - A resource deletion operation. 852 // "UPDATE" - A resource update operation. 853 OperationType string `json:"operationType,omitempty"` 854 855 // Resource: Output only. The resource being operated on, as a [relative 856 // resource name]( 857 // /apis/design/resource_names#relative_resource_name). 858 Resource string `json:"resource,omitempty"` 859 860 // ResourceUuid: Output only. The UUID of the resource being operated 861 // on. 862 ResourceUuid string `json:"resourceUuid,omitempty"` 863 864 // State: Output only. The current operation state. 865 // 866 // Possible values: 867 // "STATE_UNSPECIFIED" - Unused. 868 // "PENDING" - The operation has been created but is not yet started. 869 // "RUNNING" - The operation is underway. 870 // "SUCCEEDED" - The operation completed successfully. 871 // "SUCCESSFUL" 872 // "FAILED" - The operation is no longer running but did not succeed. 873 State string `json:"state,omitempty"` 874 875 // ForceSendFields is a list of field names (e.g. "CreateTime") to 876 // unconditionally include in API requests. By default, fields with 877 // empty values are omitted from API requests. However, any non-pointer, 878 // non-interface field appearing in ForceSendFields will be sent to the 879 // server regardless of whether the field is empty or not. This may be 880 // used to include empty fields in Patch requests. 881 ForceSendFields []string `json:"-"` 882 883 // NullFields is a list of field names (e.g. "CreateTime") to include in 884 // API requests with the JSON null value. By default, fields with empty 885 // values are omitted from API requests. However, any field with an 886 // empty value appearing in NullFields will be sent to the server as 887 // null. It is an error if a field in this list has a non-empty value. 888 // This may be used to include null fields in Patch requests. 889 NullFields []string `json:"-"` 890} 891 892func (s *OperationMetadata) MarshalJSON() ([]byte, error) { 893 type NoMethod OperationMetadata 894 raw := NoMethod(*s) 895 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 896} 897 898// PrivateClusterConfig: Configuration options for the private GKE 899// cluster in a Cloud Composer 900// environment. 901type PrivateClusterConfig struct { 902 // EnablePrivateEndpoint: Optional. If `true`, access to the public 903 // endpoint of the GKE cluster is 904 // denied. 905 EnablePrivateEndpoint bool `json:"enablePrivateEndpoint,omitempty"` 906 907 // MasterIpv4CidrBlock: Optional. The CIDR block from which IPv4 range 908 // for GKE master will be reserved. If 909 // left blank, the default value of '172.16.0.0/23' is used. 910 MasterIpv4CidrBlock string `json:"masterIpv4CidrBlock,omitempty"` 911 912 // MasterIpv4ReservedRange: Output only. The IP range in CIDR notation 913 // to use for the hosted master network. This 914 // range is used for assigning internal IP addresses to the GKE 915 // cluster 916 // master or set of masters and to the internal load balancer virtual 917 // IP. 918 // This range must not overlap with any other ranges in use 919 // within the cluster's network. 920 MasterIpv4ReservedRange string `json:"masterIpv4ReservedRange,omitempty"` 921 922 // ForceSendFields is a list of field names (e.g. 923 // "EnablePrivateEndpoint") to unconditionally include in API requests. 924 // By default, fields with empty values are omitted from API requests. 925 // However, any non-pointer, non-interface field appearing in 926 // ForceSendFields will be sent to the server regardless of whether the 927 // field is empty or not. This may be used to include empty fields in 928 // Patch requests. 929 ForceSendFields []string `json:"-"` 930 931 // NullFields is a list of field names (e.g. "EnablePrivateEndpoint") to 932 // include in API requests with the JSON null value. By default, fields 933 // with empty values are omitted from API requests. However, any field 934 // with an empty value appearing in NullFields will be sent to the 935 // server as null. It is an error if a field in this list has a 936 // non-empty value. This may be used to include null fields in Patch 937 // requests. 938 NullFields []string `json:"-"` 939} 940 941func (s *PrivateClusterConfig) MarshalJSON() ([]byte, error) { 942 type NoMethod PrivateClusterConfig 943 raw := NoMethod(*s) 944 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 945} 946 947// PrivateEnvironmentConfig: The configuration information for 948// configuring a Private IP Cloud Composer 949// environment. 950type PrivateEnvironmentConfig struct { 951 // CloudSqlIpv4CidrBlock: Optional. The CIDR block from which IP range 952 // in tenant project will be reserved for 953 // Cloud SQL. Needs to be disjoint from `web_server_ipv4_cidr_block`. 954 CloudSqlIpv4CidrBlock string `json:"cloudSqlIpv4CidrBlock,omitempty"` 955 956 // EnablePrivateEnvironment: Optional. If `true`, a Private IP Cloud 957 // Composer environment is created. 958 // If this field is set to true, `IPAllocationPolicy.use_ip_aliases` 959 // must be 960 // set to true. 961 EnablePrivateEnvironment bool `json:"enablePrivateEnvironment,omitempty"` 962 963 // PrivateClusterConfig: Optional. Configuration for the private GKE 964 // cluster for a Private IP 965 // Cloud Composer environment. 966 PrivateClusterConfig *PrivateClusterConfig `json:"privateClusterConfig,omitempty"` 967 968 // WebServerIpv4CidrBlock: Optional. The CIDR block from which IP range 969 // for web server will be reserved. Needs 970 // to be disjoint from `private_cluster_config.master_ipv4_cidr_block` 971 // and 972 // `cloud_sql_ipv4_cidr_block`. 973 WebServerIpv4CidrBlock string `json:"webServerIpv4CidrBlock,omitempty"` 974 975 // WebServerIpv4ReservedRange: Output only. The IP range reserved for 976 // the tenant project's App Engine VMs. 977 WebServerIpv4ReservedRange string `json:"webServerIpv4ReservedRange,omitempty"` 978 979 // ForceSendFields is a list of field names (e.g. 980 // "CloudSqlIpv4CidrBlock") to unconditionally include in API requests. 981 // By default, fields with empty values are omitted from API requests. 982 // However, any non-pointer, non-interface field appearing in 983 // ForceSendFields will be sent to the server regardless of whether the 984 // field is empty or not. This may be used to include empty fields in 985 // Patch requests. 986 ForceSendFields []string `json:"-"` 987 988 // NullFields is a list of field names (e.g. "CloudSqlIpv4CidrBlock") to 989 // include in API requests with the JSON null value. By default, fields 990 // with empty values are omitted from API requests. However, any field 991 // with an empty value appearing in NullFields will be sent to the 992 // server as null. It is an error if a field in this list has a 993 // non-empty value. This may be used to include null fields in Patch 994 // requests. 995 NullFields []string `json:"-"` 996} 997 998func (s *PrivateEnvironmentConfig) MarshalJSON() ([]byte, error) { 999 type NoMethod PrivateEnvironmentConfig 1000 raw := NoMethod(*s) 1001 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1002} 1003 1004// SoftwareConfig: Specifies the selection and configuration of software 1005// inside the environment. 1006type SoftwareConfig struct { 1007 // AirflowConfigOverrides: Optional. Apache Airflow configuration 1008 // properties to override. 1009 // 1010 // Property keys contain the section and property names, separated by 1011 // a 1012 // hyphen, for example "core-dags_are_paused_at_creation". Section names 1013 // must 1014 // not contain hyphens ("-"), opening square brackets ("["), or 1015 // closing 1016 // square brackets ("]"). The property name must not be empty and must 1017 // not 1018 // contain an equals sign ("=") or semicolon (";"). Section and property 1019 // names 1020 // must not contain a period ("."). Apache Airflow configuration 1021 // property 1022 // names must be written 1023 // in 1024 // [snake_case](https://en.wikipedia.org/wiki/Snake_case). Property 1025 // values can 1026 // contain any character, and can be written in any lower/upper case 1027 // format. 1028 // 1029 // Certain Apache Airflow configuration property values 1030 // are 1031 // [blacklisted](/composer/docs/how-to/managing/setting-airflow-confi 1032 // gurations#airflow_configuration_blacklists), 1033 // and cannot be overridden. 1034 AirflowConfigOverrides map[string]string `json:"airflowConfigOverrides,omitempty"` 1035 1036 // EnvVariables: Optional. Additional environment variables to provide 1037 // to the Apache Airflow 1038 // scheduler, worker, and webserver processes. 1039 // 1040 // Environment variable names must match the regular 1041 // expression 1042 // `a-zA-Z_*`. They cannot specify Apache Airflow 1043 // software configuration overrides (they cannot match the regular 1044 // expression 1045 // `AIRFLOW__[A-Z0-9_]+__[A-Z0-9_]+`), and they cannot match any of 1046 // the 1047 // following reserved names: 1048 // 1049 // * `AIRFLOW_HOME` 1050 // * `C_FORCE_ROOT` 1051 // * `CONTAINER_NAME` 1052 // * `DAGS_FOLDER` 1053 // * `GCP_PROJECT` 1054 // * `GCS_BUCKET` 1055 // * `GKE_CLUSTER_NAME` 1056 // * `SQL_DATABASE` 1057 // * `SQL_INSTANCE` 1058 // * `SQL_PASSWORD` 1059 // * `SQL_PROJECT` 1060 // * `SQL_REGION` 1061 // * `SQL_USER` 1062 EnvVariables map[string]string `json:"envVariables,omitempty"` 1063 1064 // ImageVersion: The version of the software running in the 1065 // environment. 1066 // This encapsulates both the version of Cloud Composer functionality 1067 // and the 1068 // version of Apache Airflow. It must match the regular 1069 // expression 1070 // `composer-([0-9]+\.[0-9]+\.[0-9]+|latest)-airflow-[0-9]+\.[ 1071 // 0-9]+(\.[0-9]+.*)?`. 1072 // When used as input, the server also checks if the provided version 1073 // is 1074 // supported and denies the request for an unsupported version. 1075 // 1076 // The Cloud Composer portion of the version is a 1077 // [semantic version](https://semver.org) or `latest`. When the patch 1078 // version 1079 // is omitted, the current Cloud Composer patch version is 1080 // selected. 1081 // When `latest` is provided instead of an explicit version number, 1082 // the server replaces `latest` with the current Cloud Composer 1083 // version 1084 // and stores that version number in the same field. 1085 // 1086 // The portion of the image version that follows <em>airflow-</em> is 1087 // an 1088 // official Apache Airflow repository 1089 // [release 1090 // name](https://github.com/apache/incubator-airflow/releases). 1091 // 1092 // See also 1093 // [Version 1094 // List](/composer/docs/concepts/versioning/composer-versions). 1095 ImageVersion string `json:"imageVersion,omitempty"` 1096 1097 // PypiPackages: Optional. Custom Python Package Index (PyPI) packages 1098 // to be installed in 1099 // the environment. 1100 // 1101 // Keys refer to the lowercase package name such as "numpy" 1102 // and values are the lowercase extras and version specifier such 1103 // as 1104 // "==1.12.0", "[devel,gcp_api]", or "[devel]>=1.8.2, <1.9.2". To 1105 // specify a 1106 // package without pinning it to a version specifier, use the empty 1107 // string as 1108 // the value. 1109 PypiPackages map[string]string `json:"pypiPackages,omitempty"` 1110 1111 // PythonVersion: Optional. The major version of Python used to run the 1112 // Apache Airflow 1113 // scheduler, worker, and webserver processes. 1114 // 1115 // Can be set to '2' or '3'. If not specified, the default is '2'. 1116 // Cannot be 1117 // updated. 1118 PythonVersion string `json:"pythonVersion,omitempty"` 1119 1120 // ForceSendFields is a list of field names (e.g. 1121 // "AirflowConfigOverrides") to unconditionally include in API requests. 1122 // By default, fields with empty values are omitted from API requests. 1123 // However, any non-pointer, non-interface field appearing in 1124 // ForceSendFields will be sent to the server regardless of whether the 1125 // field is empty or not. This may be used to include empty fields in 1126 // Patch requests. 1127 ForceSendFields []string `json:"-"` 1128 1129 // NullFields is a list of field names (e.g. "AirflowConfigOverrides") 1130 // to include in API requests with the JSON null value. By default, 1131 // fields with empty values are omitted from API requests. However, any 1132 // field with an empty value appearing in NullFields will be sent to the 1133 // server as null. It is an error if a field in this list has a 1134 // non-empty value. This may be used to include null fields in Patch 1135 // requests. 1136 NullFields []string `json:"-"` 1137} 1138 1139func (s *SoftwareConfig) MarshalJSON() ([]byte, error) { 1140 type NoMethod SoftwareConfig 1141 raw := NoMethod(*s) 1142 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1143} 1144 1145// Status: The `Status` type defines a logical error model that is 1146// suitable for 1147// different programming environments, including REST APIs and RPC APIs. 1148// It is 1149// used by [gRPC](https://github.com/grpc). Each `Status` message 1150// contains 1151// three pieces of data: error code, error message, and error 1152// details. 1153// 1154// You can find out more about this error model and how to work with it 1155// in the 1156// [API Design Guide](https://cloud.google.com/apis/design/errors). 1157type Status struct { 1158 // Code: The status code, which should be an enum value of 1159 // google.rpc.Code. 1160 Code int64 `json:"code,omitempty"` 1161 1162 // Details: A list of messages that carry the error details. There is a 1163 // common set of 1164 // message types for APIs to use. 1165 Details []googleapi.RawMessage `json:"details,omitempty"` 1166 1167 // Message: A developer-facing error message, which should be in 1168 // English. Any 1169 // user-facing error message should be localized and sent in 1170 // the 1171 // google.rpc.Status.details field, or localized by the client. 1172 Message string `json:"message,omitempty"` 1173 1174 // ForceSendFields is a list of field names (e.g. "Code") to 1175 // unconditionally include in API requests. By default, fields with 1176 // empty values are omitted from API requests. However, any non-pointer, 1177 // non-interface field appearing in ForceSendFields will be sent to the 1178 // server regardless of whether the field is empty or not. This may be 1179 // used to include empty fields in Patch requests. 1180 ForceSendFields []string `json:"-"` 1181 1182 // NullFields is a list of field names (e.g. "Code") to include in API 1183 // requests with the JSON null value. By default, fields with empty 1184 // values are omitted from API requests. However, any field with an 1185 // empty value appearing in NullFields will be sent to the server as 1186 // null. It is an error if a field in this list has a non-empty value. 1187 // This may be used to include null fields in Patch requests. 1188 NullFields []string `json:"-"` 1189} 1190 1191func (s *Status) MarshalJSON() ([]byte, error) { 1192 type NoMethod Status 1193 raw := NoMethod(*s) 1194 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1195} 1196 1197// method id "composer.projects.locations.environments.create": 1198 1199type ProjectsLocationsEnvironmentsCreateCall struct { 1200 s *Service 1201 parent string 1202 environment *Environment 1203 urlParams_ gensupport.URLParams 1204 ctx_ context.Context 1205 header_ http.Header 1206} 1207 1208// Create: Create a new environment. 1209func (r *ProjectsLocationsEnvironmentsService) Create(parent string, environment *Environment) *ProjectsLocationsEnvironmentsCreateCall { 1210 c := &ProjectsLocationsEnvironmentsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 1211 c.parent = parent 1212 c.environment = environment 1213 return c 1214} 1215 1216// Fields allows partial responses to be retrieved. See 1217// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 1218// for more information. 1219func (c *ProjectsLocationsEnvironmentsCreateCall) Fields(s ...googleapi.Field) *ProjectsLocationsEnvironmentsCreateCall { 1220 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 1221 return c 1222} 1223 1224// Context sets the context to be used in this call's Do method. Any 1225// pending HTTP request will be aborted if the provided context is 1226// canceled. 1227func (c *ProjectsLocationsEnvironmentsCreateCall) Context(ctx context.Context) *ProjectsLocationsEnvironmentsCreateCall { 1228 c.ctx_ = ctx 1229 return c 1230} 1231 1232// Header returns an http.Header that can be modified by the caller to 1233// add HTTP headers to the request. 1234func (c *ProjectsLocationsEnvironmentsCreateCall) Header() http.Header { 1235 if c.header_ == nil { 1236 c.header_ = make(http.Header) 1237 } 1238 return c.header_ 1239} 1240 1241func (c *ProjectsLocationsEnvironmentsCreateCall) doRequest(alt string) (*http.Response, error) { 1242 reqHeaders := make(http.Header) 1243 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200503") 1244 for k, v := range c.header_ { 1245 reqHeaders[k] = v 1246 } 1247 reqHeaders.Set("User-Agent", c.s.userAgent()) 1248 var body io.Reader = nil 1249 body, err := googleapi.WithoutDataWrapper.JSONReader(c.environment) 1250 if err != nil { 1251 return nil, err 1252 } 1253 reqHeaders.Set("Content-Type", "application/json") 1254 c.urlParams_.Set("alt", alt) 1255 c.urlParams_.Set("prettyPrint", "false") 1256 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/environments") 1257 urls += "?" + c.urlParams_.Encode() 1258 req, err := http.NewRequest("POST", urls, body) 1259 if err != nil { 1260 return nil, err 1261 } 1262 req.Header = reqHeaders 1263 googleapi.Expand(req.URL, map[string]string{ 1264 "parent": c.parent, 1265 }) 1266 return gensupport.SendRequest(c.ctx_, c.s.client, req) 1267} 1268 1269// Do executes the "composer.projects.locations.environments.create" call. 1270// Exactly one of *Operation or error will be non-nil. Any non-2xx 1271// status code is an error. Response headers are in either 1272// *Operation.ServerResponse.Header or (if a response was returned at 1273// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 1274// to check whether the returned error was because 1275// http.StatusNotModified was returned. 1276func (c *ProjectsLocationsEnvironmentsCreateCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 1277 gensupport.SetOptions(c.urlParams_, opts...) 1278 res, err := c.doRequest("json") 1279 if res != nil && res.StatusCode == http.StatusNotModified { 1280 if res.Body != nil { 1281 res.Body.Close() 1282 } 1283 return nil, &googleapi.Error{ 1284 Code: res.StatusCode, 1285 Header: res.Header, 1286 } 1287 } 1288 if err != nil { 1289 return nil, err 1290 } 1291 defer googleapi.CloseBody(res) 1292 if err := googleapi.CheckResponse(res); err != nil { 1293 return nil, err 1294 } 1295 ret := &Operation{ 1296 ServerResponse: googleapi.ServerResponse{ 1297 Header: res.Header, 1298 HTTPStatusCode: res.StatusCode, 1299 }, 1300 } 1301 target := &ret 1302 if err := gensupport.DecodeResponse(target, res); err != nil { 1303 return nil, err 1304 } 1305 return ret, nil 1306 // { 1307 // "description": "Create a new environment.", 1308 // "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/environments", 1309 // "httpMethod": "POST", 1310 // "id": "composer.projects.locations.environments.create", 1311 // "parameterOrder": [ 1312 // "parent" 1313 // ], 1314 // "parameters": { 1315 // "parent": { 1316 // "description": "The parent must be of the form\n\"projects/{projectId}/locations/{locationId}\".", 1317 // "location": "path", 1318 // "pattern": "^projects/[^/]+/locations/[^/]+$", 1319 // "required": true, 1320 // "type": "string" 1321 // } 1322 // }, 1323 // "path": "v1/{+parent}/environments", 1324 // "request": { 1325 // "$ref": "Environment" 1326 // }, 1327 // "response": { 1328 // "$ref": "Operation" 1329 // }, 1330 // "scopes": [ 1331 // "https://www.googleapis.com/auth/cloud-platform" 1332 // ] 1333 // } 1334 1335} 1336 1337// method id "composer.projects.locations.environments.delete": 1338 1339type ProjectsLocationsEnvironmentsDeleteCall struct { 1340 s *Service 1341 name string 1342 urlParams_ gensupport.URLParams 1343 ctx_ context.Context 1344 header_ http.Header 1345} 1346 1347// Delete: Delete an environment. 1348func (r *ProjectsLocationsEnvironmentsService) Delete(name string) *ProjectsLocationsEnvironmentsDeleteCall { 1349 c := &ProjectsLocationsEnvironmentsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} 1350 c.name = name 1351 return c 1352} 1353 1354// Fields allows partial responses to be retrieved. See 1355// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 1356// for more information. 1357func (c *ProjectsLocationsEnvironmentsDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsEnvironmentsDeleteCall { 1358 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 1359 return c 1360} 1361 1362// Context sets the context to be used in this call's Do method. Any 1363// pending HTTP request will be aborted if the provided context is 1364// canceled. 1365func (c *ProjectsLocationsEnvironmentsDeleteCall) Context(ctx context.Context) *ProjectsLocationsEnvironmentsDeleteCall { 1366 c.ctx_ = ctx 1367 return c 1368} 1369 1370// Header returns an http.Header that can be modified by the caller to 1371// add HTTP headers to the request. 1372func (c *ProjectsLocationsEnvironmentsDeleteCall) Header() http.Header { 1373 if c.header_ == nil { 1374 c.header_ = make(http.Header) 1375 } 1376 return c.header_ 1377} 1378 1379func (c *ProjectsLocationsEnvironmentsDeleteCall) doRequest(alt string) (*http.Response, error) { 1380 reqHeaders := make(http.Header) 1381 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200503") 1382 for k, v := range c.header_ { 1383 reqHeaders[k] = v 1384 } 1385 reqHeaders.Set("User-Agent", c.s.userAgent()) 1386 var body io.Reader = nil 1387 c.urlParams_.Set("alt", alt) 1388 c.urlParams_.Set("prettyPrint", "false") 1389 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") 1390 urls += "?" + c.urlParams_.Encode() 1391 req, err := http.NewRequest("DELETE", urls, body) 1392 if err != nil { 1393 return nil, err 1394 } 1395 req.Header = reqHeaders 1396 googleapi.Expand(req.URL, map[string]string{ 1397 "name": c.name, 1398 }) 1399 return gensupport.SendRequest(c.ctx_, c.s.client, req) 1400} 1401 1402// Do executes the "composer.projects.locations.environments.delete" call. 1403// Exactly one of *Operation or error will be non-nil. Any non-2xx 1404// status code is an error. Response headers are in either 1405// *Operation.ServerResponse.Header or (if a response was returned at 1406// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 1407// to check whether the returned error was because 1408// http.StatusNotModified was returned. 1409func (c *ProjectsLocationsEnvironmentsDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 1410 gensupport.SetOptions(c.urlParams_, opts...) 1411 res, err := c.doRequest("json") 1412 if res != nil && res.StatusCode == http.StatusNotModified { 1413 if res.Body != nil { 1414 res.Body.Close() 1415 } 1416 return nil, &googleapi.Error{ 1417 Code: res.StatusCode, 1418 Header: res.Header, 1419 } 1420 } 1421 if err != nil { 1422 return nil, err 1423 } 1424 defer googleapi.CloseBody(res) 1425 if err := googleapi.CheckResponse(res); err != nil { 1426 return nil, err 1427 } 1428 ret := &Operation{ 1429 ServerResponse: googleapi.ServerResponse{ 1430 Header: res.Header, 1431 HTTPStatusCode: res.StatusCode, 1432 }, 1433 } 1434 target := &ret 1435 if err := gensupport.DecodeResponse(target, res); err != nil { 1436 return nil, err 1437 } 1438 return ret, nil 1439 // { 1440 // "description": "Delete an environment.", 1441 // "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/environments/{environmentsId}", 1442 // "httpMethod": "DELETE", 1443 // "id": "composer.projects.locations.environments.delete", 1444 // "parameterOrder": [ 1445 // "name" 1446 // ], 1447 // "parameters": { 1448 // "name": { 1449 // "description": "The environment to delete, in the form:\n\"projects/{projectId}/locations/{locationId}/environments/{environmentId}\"", 1450 // "location": "path", 1451 // "pattern": "^projects/[^/]+/locations/[^/]+/environments/[^/]+$", 1452 // "required": true, 1453 // "type": "string" 1454 // } 1455 // }, 1456 // "path": "v1/{+name}", 1457 // "response": { 1458 // "$ref": "Operation" 1459 // }, 1460 // "scopes": [ 1461 // "https://www.googleapis.com/auth/cloud-platform" 1462 // ] 1463 // } 1464 1465} 1466 1467// method id "composer.projects.locations.environments.get": 1468 1469type ProjectsLocationsEnvironmentsGetCall struct { 1470 s *Service 1471 name string 1472 urlParams_ gensupport.URLParams 1473 ifNoneMatch_ string 1474 ctx_ context.Context 1475 header_ http.Header 1476} 1477 1478// Get: Get an existing environment. 1479func (r *ProjectsLocationsEnvironmentsService) Get(name string) *ProjectsLocationsEnvironmentsGetCall { 1480 c := &ProjectsLocationsEnvironmentsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 1481 c.name = name 1482 return c 1483} 1484 1485// Fields allows partial responses to be retrieved. See 1486// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 1487// for more information. 1488func (c *ProjectsLocationsEnvironmentsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsEnvironmentsGetCall { 1489 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 1490 return c 1491} 1492 1493// IfNoneMatch sets the optional parameter which makes the operation 1494// fail if the object's ETag matches the given value. This is useful for 1495// getting updates only after the object has changed since the last 1496// request. Use googleapi.IsNotModified to check whether the response 1497// error from Do is the result of In-None-Match. 1498func (c *ProjectsLocationsEnvironmentsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsEnvironmentsGetCall { 1499 c.ifNoneMatch_ = entityTag 1500 return c 1501} 1502 1503// Context sets the context to be used in this call's Do method. Any 1504// pending HTTP request will be aborted if the provided context is 1505// canceled. 1506func (c *ProjectsLocationsEnvironmentsGetCall) Context(ctx context.Context) *ProjectsLocationsEnvironmentsGetCall { 1507 c.ctx_ = ctx 1508 return c 1509} 1510 1511// Header returns an http.Header that can be modified by the caller to 1512// add HTTP headers to the request. 1513func (c *ProjectsLocationsEnvironmentsGetCall) Header() http.Header { 1514 if c.header_ == nil { 1515 c.header_ = make(http.Header) 1516 } 1517 return c.header_ 1518} 1519 1520func (c *ProjectsLocationsEnvironmentsGetCall) doRequest(alt string) (*http.Response, error) { 1521 reqHeaders := make(http.Header) 1522 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200503") 1523 for k, v := range c.header_ { 1524 reqHeaders[k] = v 1525 } 1526 reqHeaders.Set("User-Agent", c.s.userAgent()) 1527 if c.ifNoneMatch_ != "" { 1528 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 1529 } 1530 var body io.Reader = nil 1531 c.urlParams_.Set("alt", alt) 1532 c.urlParams_.Set("prettyPrint", "false") 1533 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") 1534 urls += "?" + c.urlParams_.Encode() 1535 req, err := http.NewRequest("GET", urls, body) 1536 if err != nil { 1537 return nil, err 1538 } 1539 req.Header = reqHeaders 1540 googleapi.Expand(req.URL, map[string]string{ 1541 "name": c.name, 1542 }) 1543 return gensupport.SendRequest(c.ctx_, c.s.client, req) 1544} 1545 1546// Do executes the "composer.projects.locations.environments.get" call. 1547// Exactly one of *Environment or error will be non-nil. Any non-2xx 1548// status code is an error. Response headers are in either 1549// *Environment.ServerResponse.Header or (if a response was returned at 1550// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 1551// to check whether the returned error was because 1552// http.StatusNotModified was returned. 1553func (c *ProjectsLocationsEnvironmentsGetCall) Do(opts ...googleapi.CallOption) (*Environment, error) { 1554 gensupport.SetOptions(c.urlParams_, opts...) 1555 res, err := c.doRequest("json") 1556 if res != nil && res.StatusCode == http.StatusNotModified { 1557 if res.Body != nil { 1558 res.Body.Close() 1559 } 1560 return nil, &googleapi.Error{ 1561 Code: res.StatusCode, 1562 Header: res.Header, 1563 } 1564 } 1565 if err != nil { 1566 return nil, err 1567 } 1568 defer googleapi.CloseBody(res) 1569 if err := googleapi.CheckResponse(res); err != nil { 1570 return nil, err 1571 } 1572 ret := &Environment{ 1573 ServerResponse: googleapi.ServerResponse{ 1574 Header: res.Header, 1575 HTTPStatusCode: res.StatusCode, 1576 }, 1577 } 1578 target := &ret 1579 if err := gensupport.DecodeResponse(target, res); err != nil { 1580 return nil, err 1581 } 1582 return ret, nil 1583 // { 1584 // "description": "Get an existing environment.", 1585 // "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/environments/{environmentsId}", 1586 // "httpMethod": "GET", 1587 // "id": "composer.projects.locations.environments.get", 1588 // "parameterOrder": [ 1589 // "name" 1590 // ], 1591 // "parameters": { 1592 // "name": { 1593 // "description": "The resource name of the environment to get, in the form:\n\"projects/{projectId}/locations/{locationId}/environments/{environmentId}\"", 1594 // "location": "path", 1595 // "pattern": "^projects/[^/]+/locations/[^/]+/environments/[^/]+$", 1596 // "required": true, 1597 // "type": "string" 1598 // } 1599 // }, 1600 // "path": "v1/{+name}", 1601 // "response": { 1602 // "$ref": "Environment" 1603 // }, 1604 // "scopes": [ 1605 // "https://www.googleapis.com/auth/cloud-platform" 1606 // ] 1607 // } 1608 1609} 1610 1611// method id "composer.projects.locations.environments.list": 1612 1613type ProjectsLocationsEnvironmentsListCall struct { 1614 s *Service 1615 parent string 1616 urlParams_ gensupport.URLParams 1617 ifNoneMatch_ string 1618 ctx_ context.Context 1619 header_ http.Header 1620} 1621 1622// List: List environments. 1623func (r *ProjectsLocationsEnvironmentsService) List(parent string) *ProjectsLocationsEnvironmentsListCall { 1624 c := &ProjectsLocationsEnvironmentsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 1625 c.parent = parent 1626 return c 1627} 1628 1629// PageSize sets the optional parameter "pageSize": The maximum number 1630// of environments to return. 1631func (c *ProjectsLocationsEnvironmentsListCall) PageSize(pageSize int64) *ProjectsLocationsEnvironmentsListCall { 1632 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) 1633 return c 1634} 1635 1636// PageToken sets the optional parameter "pageToken": The 1637// next_page_token value returned from a previous List request, if any. 1638func (c *ProjectsLocationsEnvironmentsListCall) PageToken(pageToken string) *ProjectsLocationsEnvironmentsListCall { 1639 c.urlParams_.Set("pageToken", pageToken) 1640 return c 1641} 1642 1643// Fields allows partial responses to be retrieved. See 1644// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 1645// for more information. 1646func (c *ProjectsLocationsEnvironmentsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsEnvironmentsListCall { 1647 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 1648 return c 1649} 1650 1651// IfNoneMatch sets the optional parameter which makes the operation 1652// fail if the object's ETag matches the given value. This is useful for 1653// getting updates only after the object has changed since the last 1654// request. Use googleapi.IsNotModified to check whether the response 1655// error from Do is the result of In-None-Match. 1656func (c *ProjectsLocationsEnvironmentsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsEnvironmentsListCall { 1657 c.ifNoneMatch_ = entityTag 1658 return c 1659} 1660 1661// Context sets the context to be used in this call's Do method. Any 1662// pending HTTP request will be aborted if the provided context is 1663// canceled. 1664func (c *ProjectsLocationsEnvironmentsListCall) Context(ctx context.Context) *ProjectsLocationsEnvironmentsListCall { 1665 c.ctx_ = ctx 1666 return c 1667} 1668 1669// Header returns an http.Header that can be modified by the caller to 1670// add HTTP headers to the request. 1671func (c *ProjectsLocationsEnvironmentsListCall) Header() http.Header { 1672 if c.header_ == nil { 1673 c.header_ = make(http.Header) 1674 } 1675 return c.header_ 1676} 1677 1678func (c *ProjectsLocationsEnvironmentsListCall) doRequest(alt string) (*http.Response, error) { 1679 reqHeaders := make(http.Header) 1680 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200503") 1681 for k, v := range c.header_ { 1682 reqHeaders[k] = v 1683 } 1684 reqHeaders.Set("User-Agent", c.s.userAgent()) 1685 if c.ifNoneMatch_ != "" { 1686 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 1687 } 1688 var body io.Reader = nil 1689 c.urlParams_.Set("alt", alt) 1690 c.urlParams_.Set("prettyPrint", "false") 1691 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/environments") 1692 urls += "?" + c.urlParams_.Encode() 1693 req, err := http.NewRequest("GET", urls, body) 1694 if err != nil { 1695 return nil, err 1696 } 1697 req.Header = reqHeaders 1698 googleapi.Expand(req.URL, map[string]string{ 1699 "parent": c.parent, 1700 }) 1701 return gensupport.SendRequest(c.ctx_, c.s.client, req) 1702} 1703 1704// Do executes the "composer.projects.locations.environments.list" call. 1705// Exactly one of *ListEnvironmentsResponse or error will be non-nil. 1706// Any non-2xx status code is an error. Response headers are in either 1707// *ListEnvironmentsResponse.ServerResponse.Header or (if a response was 1708// returned at all) in error.(*googleapi.Error).Header. Use 1709// googleapi.IsNotModified to check whether the returned error was 1710// because http.StatusNotModified was returned. 1711func (c *ProjectsLocationsEnvironmentsListCall) Do(opts ...googleapi.CallOption) (*ListEnvironmentsResponse, error) { 1712 gensupport.SetOptions(c.urlParams_, opts...) 1713 res, err := c.doRequest("json") 1714 if res != nil && res.StatusCode == http.StatusNotModified { 1715 if res.Body != nil { 1716 res.Body.Close() 1717 } 1718 return nil, &googleapi.Error{ 1719 Code: res.StatusCode, 1720 Header: res.Header, 1721 } 1722 } 1723 if err != nil { 1724 return nil, err 1725 } 1726 defer googleapi.CloseBody(res) 1727 if err := googleapi.CheckResponse(res); err != nil { 1728 return nil, err 1729 } 1730 ret := &ListEnvironmentsResponse{ 1731 ServerResponse: googleapi.ServerResponse{ 1732 Header: res.Header, 1733 HTTPStatusCode: res.StatusCode, 1734 }, 1735 } 1736 target := &ret 1737 if err := gensupport.DecodeResponse(target, res); err != nil { 1738 return nil, err 1739 } 1740 return ret, nil 1741 // { 1742 // "description": "List environments.", 1743 // "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/environments", 1744 // "httpMethod": "GET", 1745 // "id": "composer.projects.locations.environments.list", 1746 // "parameterOrder": [ 1747 // "parent" 1748 // ], 1749 // "parameters": { 1750 // "pageSize": { 1751 // "description": "The maximum number of environments to return.", 1752 // "format": "int32", 1753 // "location": "query", 1754 // "type": "integer" 1755 // }, 1756 // "pageToken": { 1757 // "description": "The next_page_token value returned from a previous List request, if any.", 1758 // "location": "query", 1759 // "type": "string" 1760 // }, 1761 // "parent": { 1762 // "description": "List environments in the given project and location, in the form:\n\"projects/{projectId}/locations/{locationId}\"", 1763 // "location": "path", 1764 // "pattern": "^projects/[^/]+/locations/[^/]+$", 1765 // "required": true, 1766 // "type": "string" 1767 // } 1768 // }, 1769 // "path": "v1/{+parent}/environments", 1770 // "response": { 1771 // "$ref": "ListEnvironmentsResponse" 1772 // }, 1773 // "scopes": [ 1774 // "https://www.googleapis.com/auth/cloud-platform" 1775 // ] 1776 // } 1777 1778} 1779 1780// Pages invokes f for each page of results. 1781// A non-nil error returned from f will halt the iteration. 1782// The provided context supersedes any context provided to the Context method. 1783func (c *ProjectsLocationsEnvironmentsListCall) Pages(ctx context.Context, f func(*ListEnvironmentsResponse) error) error { 1784 c.ctx_ = ctx 1785 defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point 1786 for { 1787 x, err := c.Do() 1788 if err != nil { 1789 return err 1790 } 1791 if err := f(x); err != nil { 1792 return err 1793 } 1794 if x.NextPageToken == "" { 1795 return nil 1796 } 1797 c.PageToken(x.NextPageToken) 1798 } 1799} 1800 1801// method id "composer.projects.locations.environments.patch": 1802 1803type ProjectsLocationsEnvironmentsPatchCall struct { 1804 s *Service 1805 name string 1806 environment *Environment 1807 urlParams_ gensupport.URLParams 1808 ctx_ context.Context 1809 header_ http.Header 1810} 1811 1812// Patch: Update an environment. 1813func (r *ProjectsLocationsEnvironmentsService) Patch(name string, environment *Environment) *ProjectsLocationsEnvironmentsPatchCall { 1814 c := &ProjectsLocationsEnvironmentsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} 1815 c.name = name 1816 c.environment = environment 1817 return c 1818} 1819 1820// UpdateMask sets the optional parameter "updateMask": Required. A 1821// comma-separated list of paths, relative to `Environment`, of 1822// fields to update. 1823// For example, to set the version of scikit-learn to install in 1824// the 1825// environment to 0.19.0 and to remove an existing installation 1826// of 1827// numpy, the `updateMask` parameter would include the following 1828// two 1829// `paths` values: "config.softwareConfig.pypiPackages.scikit-learn" 1830// and 1831// "config.softwareConfig.pypiPackages.numpy". The included 1832// patch 1833// environment would specify the scikit-learn version as follows: 1834// 1835// { 1836// "config":{ 1837// "softwareConfig":{ 1838// "pypiPackages":{ 1839// "scikit-learn":"==0.19.0" 1840// } 1841// } 1842// } 1843// } 1844// 1845// Note that in the above example, any existing PyPI packages 1846// other than scikit-learn and numpy will be unaffected. 1847// 1848// Only one update type may be included in a single request's 1849// `updateMask`. 1850// For example, one cannot update both the PyPI packages and 1851// labels in the same request. However, it is possible to update 1852// multiple 1853// members of a map field simultaneously in the same request. For 1854// example, 1855// to set the labels "label1" and "label2" while clearing "label3" 1856// (assuming 1857// it already exists), one can 1858// provide the paths "labels.label1", "labels.label2", and 1859// "labels.label3" 1860// and populate the patch environment as follows: 1861// 1862// { 1863// "labels":{ 1864// "label1":"new-label1-value" 1865// "label2":"new-label2-value" 1866// } 1867// } 1868// 1869// Note that in the above example, any existing labels that are 1870// not 1871// included in the `updateMask` will be unaffected. 1872// 1873// It is also possible to replace an entire map field by providing 1874// the 1875// map field's path in the `updateMask`. The new value of the field 1876// will 1877// be that which is provided in the patch environment. For example, 1878// to 1879// delete all pre-existing user-specified PyPI packages and 1880// install botocore at version 1.7.14, the `updateMask` would 1881// contain 1882// the path "config.softwareConfig.pypiPackages", and 1883// the patch environment would be the following: 1884// 1885// { 1886// "config":{ 1887// "softwareConfig":{ 1888// "pypiPackages":{ 1889// "botocore":"==1.7.14" 1890// } 1891// } 1892// } 1893// } 1894// 1895// **Note:** Only the following fields can be updated: 1896// 1897// <table> 1898// <tbody> 1899// <tr> 1900// <td><strong>Mask</strong></td> 1901// <td><strong>Purpose</strong></td> 1902// </tr> 1903// <tr> 1904// <td>config.softwareConfig.pypiPackages 1905// </td> 1906// <td>Replace all custom custom PyPI packages. If a replacement 1907// package map is not included in `environment`, all custom 1908// PyPI packages are cleared. It is an error to provide both this mask 1909// and a 1910// mask specifying an individual package.</td> 1911// </tr> 1912// <tr> 1913// <td>config.softwareConfig.pypiPackages.<var>packagename</var></td> 1914// <td>Update the custom PyPI package <var>packagename</var>, 1915// preserving other packages. To delete the package, include it in 1916// `updateMask`, and omit the mapping for it in 1917// `environment.config.softwareConfig.pypiPackages`. It is an error 1918// to provide both a mask of this form and the 1919// "config.softwareConfig.pypiPackages" mask.</td> 1920// </tr> 1921// <tr> 1922// <td>labels</td> 1923// <td>Replace all environment labels. If a replacement labels map is 1924// not 1925// included in `environment`, all labels are cleared. It is an error 1926// to 1927// provide both this mask and a mask specifying one or more individual 1928// labels.</td> 1929// </tr> 1930// <tr> 1931// <td>labels.<var>labelName</var></td> 1932// <td>Set the label named <var>labelName</var>, while preserving 1933// other 1934// labels. To delete the label, include it in `updateMask` and omit 1935// its 1936// mapping in `environment.labels`. It is an error to provide both a 1937// mask of this form and the "labels" mask.</td> 1938// </tr> 1939// <tr> 1940// <td>config.nodeCount</td> 1941// <td>Horizontally scale the number of nodes in the environment. An 1942// integer 1943// greater than or equal to 3 must be provided in the 1944// `config.nodeCount` 1945// field. 1946// </td> 1947// </tr> 1948// <tr> 1949// <td>config.softwareConfig.airflowConfigOverrides</td> 1950// <td>Replace all Apache Airflow config overrides. If a replacement 1951// config 1952// overrides map is not included in `environment`, all config 1953// overrides 1954// are cleared. 1955// It is an error to provide both this mask and a mask specifying one 1956// or 1957// more individual config overrides.</td> 1958// </tr> 1959// <tr> 1960// 1961// <td>config.softwareConfig.airflowConfigOverrides.<var>section</var>-<v 1962// ar>name 1963// </var></td> 1964// <td>Override the Apache Airflow config property <var>name</var> in 1965// the 1966// section named <var>section</var>, preserving other properties. To 1967// delete 1968// the property override, include it in `updateMask` and omit its 1969// mapping 1970// in `environment.config.softwareConfig.airflowConfigOverrides`. 1971// It is an error to provide both a mask of this form and the 1972// "config.softwareConfig.airflowConfigOverrides" mask.</td> 1973// </tr> 1974// <tr> 1975// <td>config.softwareConfig.envVariables</td> 1976// <td>Replace all environment variables. If a replacement environment 1977// variable map is not included in `environment`, all custom 1978// environment 1979// variables are cleared. 1980// It is an error to provide both this mask and a mask specifying one 1981// or 1982// more individual environment variables.</td> 1983// </tr> 1984// </tbody> 1985// </table> 1986func (c *ProjectsLocationsEnvironmentsPatchCall) UpdateMask(updateMask string) *ProjectsLocationsEnvironmentsPatchCall { 1987 c.urlParams_.Set("updateMask", updateMask) 1988 return c 1989} 1990 1991// Fields allows partial responses to be retrieved. See 1992// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 1993// for more information. 1994func (c *ProjectsLocationsEnvironmentsPatchCall) Fields(s ...googleapi.Field) *ProjectsLocationsEnvironmentsPatchCall { 1995 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 1996 return c 1997} 1998 1999// Context sets the context to be used in this call's Do method. Any 2000// pending HTTP request will be aborted if the provided context is 2001// canceled. 2002func (c *ProjectsLocationsEnvironmentsPatchCall) Context(ctx context.Context) *ProjectsLocationsEnvironmentsPatchCall { 2003 c.ctx_ = ctx 2004 return c 2005} 2006 2007// Header returns an http.Header that can be modified by the caller to 2008// add HTTP headers to the request. 2009func (c *ProjectsLocationsEnvironmentsPatchCall) Header() http.Header { 2010 if c.header_ == nil { 2011 c.header_ = make(http.Header) 2012 } 2013 return c.header_ 2014} 2015 2016func (c *ProjectsLocationsEnvironmentsPatchCall) doRequest(alt string) (*http.Response, error) { 2017 reqHeaders := make(http.Header) 2018 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200503") 2019 for k, v := range c.header_ { 2020 reqHeaders[k] = v 2021 } 2022 reqHeaders.Set("User-Agent", c.s.userAgent()) 2023 var body io.Reader = nil 2024 body, err := googleapi.WithoutDataWrapper.JSONReader(c.environment) 2025 if err != nil { 2026 return nil, err 2027 } 2028 reqHeaders.Set("Content-Type", "application/json") 2029 c.urlParams_.Set("alt", alt) 2030 c.urlParams_.Set("prettyPrint", "false") 2031 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") 2032 urls += "?" + c.urlParams_.Encode() 2033 req, err := http.NewRequest("PATCH", urls, body) 2034 if err != nil { 2035 return nil, err 2036 } 2037 req.Header = reqHeaders 2038 googleapi.Expand(req.URL, map[string]string{ 2039 "name": c.name, 2040 }) 2041 return gensupport.SendRequest(c.ctx_, c.s.client, req) 2042} 2043 2044// Do executes the "composer.projects.locations.environments.patch" call. 2045// Exactly one of *Operation or error will be non-nil. Any non-2xx 2046// status code is an error. Response headers are in either 2047// *Operation.ServerResponse.Header or (if a response was returned at 2048// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 2049// to check whether the returned error was because 2050// http.StatusNotModified was returned. 2051func (c *ProjectsLocationsEnvironmentsPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 2052 gensupport.SetOptions(c.urlParams_, opts...) 2053 res, err := c.doRequest("json") 2054 if res != nil && res.StatusCode == http.StatusNotModified { 2055 if res.Body != nil { 2056 res.Body.Close() 2057 } 2058 return nil, &googleapi.Error{ 2059 Code: res.StatusCode, 2060 Header: res.Header, 2061 } 2062 } 2063 if err != nil { 2064 return nil, err 2065 } 2066 defer googleapi.CloseBody(res) 2067 if err := googleapi.CheckResponse(res); err != nil { 2068 return nil, err 2069 } 2070 ret := &Operation{ 2071 ServerResponse: googleapi.ServerResponse{ 2072 Header: res.Header, 2073 HTTPStatusCode: res.StatusCode, 2074 }, 2075 } 2076 target := &ret 2077 if err := gensupport.DecodeResponse(target, res); err != nil { 2078 return nil, err 2079 } 2080 return ret, nil 2081 // { 2082 // "description": "Update an environment.", 2083 // "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/environments/{environmentsId}", 2084 // "httpMethod": "PATCH", 2085 // "id": "composer.projects.locations.environments.patch", 2086 // "parameterOrder": [ 2087 // "name" 2088 // ], 2089 // "parameters": { 2090 // "name": { 2091 // "description": "The relative resource name of the environment to update, in the form:\n\"projects/{projectId}/locations/{locationId}/environments/{environmentId}\"", 2092 // "location": "path", 2093 // "pattern": "^projects/[^/]+/locations/[^/]+/environments/[^/]+$", 2094 // "required": true, 2095 // "type": "string" 2096 // }, 2097 // "updateMask": { 2098 // "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", 2099 // "format": "google-fieldmask", 2100 // "location": "query", 2101 // "type": "string" 2102 // } 2103 // }, 2104 // "path": "v1/{+name}", 2105 // "request": { 2106 // "$ref": "Environment" 2107 // }, 2108 // "response": { 2109 // "$ref": "Operation" 2110 // }, 2111 // "scopes": [ 2112 // "https://www.googleapis.com/auth/cloud-platform" 2113 // ] 2114 // } 2115 2116} 2117 2118// method id "composer.projects.locations.imageVersions.list": 2119 2120type ProjectsLocationsImageVersionsListCall struct { 2121 s *Service 2122 parent string 2123 urlParams_ gensupport.URLParams 2124 ifNoneMatch_ string 2125 ctx_ context.Context 2126 header_ http.Header 2127} 2128 2129// List: List ImageVersions for provided location. 2130func (r *ProjectsLocationsImageVersionsService) List(parent string) *ProjectsLocationsImageVersionsListCall { 2131 c := &ProjectsLocationsImageVersionsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 2132 c.parent = parent 2133 return c 2134} 2135 2136// PageSize sets the optional parameter "pageSize": The maximum number 2137// of image_versions to return. 2138func (c *ProjectsLocationsImageVersionsListCall) PageSize(pageSize int64) *ProjectsLocationsImageVersionsListCall { 2139 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) 2140 return c 2141} 2142 2143// PageToken sets the optional parameter "pageToken": The 2144// next_page_token value returned from a previous List request, if any. 2145func (c *ProjectsLocationsImageVersionsListCall) PageToken(pageToken string) *ProjectsLocationsImageVersionsListCall { 2146 c.urlParams_.Set("pageToken", pageToken) 2147 return c 2148} 2149 2150// Fields allows partial responses to be retrieved. See 2151// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 2152// for more information. 2153func (c *ProjectsLocationsImageVersionsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsImageVersionsListCall { 2154 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 2155 return c 2156} 2157 2158// IfNoneMatch sets the optional parameter which makes the operation 2159// fail if the object's ETag matches the given value. This is useful for 2160// getting updates only after the object has changed since the last 2161// request. Use googleapi.IsNotModified to check whether the response 2162// error from Do is the result of In-None-Match. 2163func (c *ProjectsLocationsImageVersionsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsImageVersionsListCall { 2164 c.ifNoneMatch_ = entityTag 2165 return c 2166} 2167 2168// Context sets the context to be used in this call's Do method. Any 2169// pending HTTP request will be aborted if the provided context is 2170// canceled. 2171func (c *ProjectsLocationsImageVersionsListCall) Context(ctx context.Context) *ProjectsLocationsImageVersionsListCall { 2172 c.ctx_ = ctx 2173 return c 2174} 2175 2176// Header returns an http.Header that can be modified by the caller to 2177// add HTTP headers to the request. 2178func (c *ProjectsLocationsImageVersionsListCall) Header() http.Header { 2179 if c.header_ == nil { 2180 c.header_ = make(http.Header) 2181 } 2182 return c.header_ 2183} 2184 2185func (c *ProjectsLocationsImageVersionsListCall) doRequest(alt string) (*http.Response, error) { 2186 reqHeaders := make(http.Header) 2187 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200503") 2188 for k, v := range c.header_ { 2189 reqHeaders[k] = v 2190 } 2191 reqHeaders.Set("User-Agent", c.s.userAgent()) 2192 if c.ifNoneMatch_ != "" { 2193 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 2194 } 2195 var body io.Reader = nil 2196 c.urlParams_.Set("alt", alt) 2197 c.urlParams_.Set("prettyPrint", "false") 2198 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/imageVersions") 2199 urls += "?" + c.urlParams_.Encode() 2200 req, err := http.NewRequest("GET", urls, body) 2201 if err != nil { 2202 return nil, err 2203 } 2204 req.Header = reqHeaders 2205 googleapi.Expand(req.URL, map[string]string{ 2206 "parent": c.parent, 2207 }) 2208 return gensupport.SendRequest(c.ctx_, c.s.client, req) 2209} 2210 2211// Do executes the "composer.projects.locations.imageVersions.list" call. 2212// Exactly one of *ListImageVersionsResponse or error will be non-nil. 2213// Any non-2xx status code is an error. Response headers are in either 2214// *ListImageVersionsResponse.ServerResponse.Header or (if a response 2215// was returned at all) in error.(*googleapi.Error).Header. Use 2216// googleapi.IsNotModified to check whether the returned error was 2217// because http.StatusNotModified was returned. 2218func (c *ProjectsLocationsImageVersionsListCall) Do(opts ...googleapi.CallOption) (*ListImageVersionsResponse, error) { 2219 gensupport.SetOptions(c.urlParams_, opts...) 2220 res, err := c.doRequest("json") 2221 if res != nil && res.StatusCode == http.StatusNotModified { 2222 if res.Body != nil { 2223 res.Body.Close() 2224 } 2225 return nil, &googleapi.Error{ 2226 Code: res.StatusCode, 2227 Header: res.Header, 2228 } 2229 } 2230 if err != nil { 2231 return nil, err 2232 } 2233 defer googleapi.CloseBody(res) 2234 if err := googleapi.CheckResponse(res); err != nil { 2235 return nil, err 2236 } 2237 ret := &ListImageVersionsResponse{ 2238 ServerResponse: googleapi.ServerResponse{ 2239 Header: res.Header, 2240 HTTPStatusCode: res.StatusCode, 2241 }, 2242 } 2243 target := &ret 2244 if err := gensupport.DecodeResponse(target, res); err != nil { 2245 return nil, err 2246 } 2247 return ret, nil 2248 // { 2249 // "description": "List ImageVersions for provided location.", 2250 // "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/imageVersions", 2251 // "httpMethod": "GET", 2252 // "id": "composer.projects.locations.imageVersions.list", 2253 // "parameterOrder": [ 2254 // "parent" 2255 // ], 2256 // "parameters": { 2257 // "pageSize": { 2258 // "description": "The maximum number of image_versions to return.", 2259 // "format": "int32", 2260 // "location": "query", 2261 // "type": "integer" 2262 // }, 2263 // "pageToken": { 2264 // "description": "The next_page_token value returned from a previous List request, if any.", 2265 // "location": "query", 2266 // "type": "string" 2267 // }, 2268 // "parent": { 2269 // "description": "List ImageVersions in the given project and location, in the form:\n\"projects/{projectId}/locations/{locationId}\"", 2270 // "location": "path", 2271 // "pattern": "^projects/[^/]+/locations/[^/]+$", 2272 // "required": true, 2273 // "type": "string" 2274 // } 2275 // }, 2276 // "path": "v1/{+parent}/imageVersions", 2277 // "response": { 2278 // "$ref": "ListImageVersionsResponse" 2279 // }, 2280 // "scopes": [ 2281 // "https://www.googleapis.com/auth/cloud-platform" 2282 // ] 2283 // } 2284 2285} 2286 2287// Pages invokes f for each page of results. 2288// A non-nil error returned from f will halt the iteration. 2289// The provided context supersedes any context provided to the Context method. 2290func (c *ProjectsLocationsImageVersionsListCall) Pages(ctx context.Context, f func(*ListImageVersionsResponse) error) error { 2291 c.ctx_ = ctx 2292 defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point 2293 for { 2294 x, err := c.Do() 2295 if err != nil { 2296 return err 2297 } 2298 if err := f(x); err != nil { 2299 return err 2300 } 2301 if x.NextPageToken == "" { 2302 return nil 2303 } 2304 c.PageToken(x.NextPageToken) 2305 } 2306} 2307 2308// method id "composer.projects.locations.operations.delete": 2309 2310type ProjectsLocationsOperationsDeleteCall struct { 2311 s *Service 2312 name string 2313 urlParams_ gensupport.URLParams 2314 ctx_ context.Context 2315 header_ http.Header 2316} 2317 2318// Delete: Deletes a long-running operation. This method indicates that 2319// the client is 2320// no longer interested in the operation result. It does not cancel 2321// the 2322// operation. If the server doesn't support this method, it 2323// returns 2324// `google.rpc.Code.UNIMPLEMENTED`. 2325func (r *ProjectsLocationsOperationsService) Delete(name string) *ProjectsLocationsOperationsDeleteCall { 2326 c := &ProjectsLocationsOperationsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} 2327 c.name = name 2328 return c 2329} 2330 2331// Fields allows partial responses to be retrieved. See 2332// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 2333// for more information. 2334func (c *ProjectsLocationsOperationsDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsOperationsDeleteCall { 2335 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 2336 return c 2337} 2338 2339// Context sets the context to be used in this call's Do method. Any 2340// pending HTTP request will be aborted if the provided context is 2341// canceled. 2342func (c *ProjectsLocationsOperationsDeleteCall) Context(ctx context.Context) *ProjectsLocationsOperationsDeleteCall { 2343 c.ctx_ = ctx 2344 return c 2345} 2346 2347// Header returns an http.Header that can be modified by the caller to 2348// add HTTP headers to the request. 2349func (c *ProjectsLocationsOperationsDeleteCall) Header() http.Header { 2350 if c.header_ == nil { 2351 c.header_ = make(http.Header) 2352 } 2353 return c.header_ 2354} 2355 2356func (c *ProjectsLocationsOperationsDeleteCall) doRequest(alt string) (*http.Response, error) { 2357 reqHeaders := make(http.Header) 2358 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200503") 2359 for k, v := range c.header_ { 2360 reqHeaders[k] = v 2361 } 2362 reqHeaders.Set("User-Agent", c.s.userAgent()) 2363 var body io.Reader = nil 2364 c.urlParams_.Set("alt", alt) 2365 c.urlParams_.Set("prettyPrint", "false") 2366 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") 2367 urls += "?" + c.urlParams_.Encode() 2368 req, err := http.NewRequest("DELETE", urls, body) 2369 if err != nil { 2370 return nil, err 2371 } 2372 req.Header = reqHeaders 2373 googleapi.Expand(req.URL, map[string]string{ 2374 "name": c.name, 2375 }) 2376 return gensupport.SendRequest(c.ctx_, c.s.client, req) 2377} 2378 2379// Do executes the "composer.projects.locations.operations.delete" call. 2380// Exactly one of *Empty or error will be non-nil. Any non-2xx status 2381// code is an error. Response headers are in either 2382// *Empty.ServerResponse.Header or (if a response was returned at all) 2383// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 2384// check whether the returned error was because http.StatusNotModified 2385// was returned. 2386func (c *ProjectsLocationsOperationsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) { 2387 gensupport.SetOptions(c.urlParams_, opts...) 2388 res, err := c.doRequest("json") 2389 if res != nil && res.StatusCode == http.StatusNotModified { 2390 if res.Body != nil { 2391 res.Body.Close() 2392 } 2393 return nil, &googleapi.Error{ 2394 Code: res.StatusCode, 2395 Header: res.Header, 2396 } 2397 } 2398 if err != nil { 2399 return nil, err 2400 } 2401 defer googleapi.CloseBody(res) 2402 if err := googleapi.CheckResponse(res); err != nil { 2403 return nil, err 2404 } 2405 ret := &Empty{ 2406 ServerResponse: googleapi.ServerResponse{ 2407 Header: res.Header, 2408 HTTPStatusCode: res.StatusCode, 2409 }, 2410 } 2411 target := &ret 2412 if err := gensupport.DecodeResponse(target, res); err != nil { 2413 return nil, err 2414 } 2415 return ret, nil 2416 // { 2417 // "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`.", 2418 // "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/operations/{operationsId}", 2419 // "httpMethod": "DELETE", 2420 // "id": "composer.projects.locations.operations.delete", 2421 // "parameterOrder": [ 2422 // "name" 2423 // ], 2424 // "parameters": { 2425 // "name": { 2426 // "description": "The name of the operation resource to be deleted.", 2427 // "location": "path", 2428 // "pattern": "^projects/[^/]+/locations/[^/]+/operations/[^/]+$", 2429 // "required": true, 2430 // "type": "string" 2431 // } 2432 // }, 2433 // "path": "v1/{+name}", 2434 // "response": { 2435 // "$ref": "Empty" 2436 // }, 2437 // "scopes": [ 2438 // "https://www.googleapis.com/auth/cloud-platform" 2439 // ] 2440 // } 2441 2442} 2443 2444// method id "composer.projects.locations.operations.get": 2445 2446type ProjectsLocationsOperationsGetCall struct { 2447 s *Service 2448 name string 2449 urlParams_ gensupport.URLParams 2450 ifNoneMatch_ string 2451 ctx_ context.Context 2452 header_ http.Header 2453} 2454 2455// Get: Gets the latest state of a long-running operation. Clients can 2456// use this 2457// method to poll the operation result at intervals as recommended by 2458// the API 2459// service. 2460func (r *ProjectsLocationsOperationsService) Get(name string) *ProjectsLocationsOperationsGetCall { 2461 c := &ProjectsLocationsOperationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 2462 c.name = name 2463 return c 2464} 2465 2466// Fields allows partial responses to be retrieved. See 2467// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 2468// for more information. 2469func (c *ProjectsLocationsOperationsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsOperationsGetCall { 2470 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 2471 return c 2472} 2473 2474// IfNoneMatch sets the optional parameter which makes the operation 2475// fail if the object's ETag matches the given value. This is useful for 2476// getting updates only after the object has changed since the last 2477// request. Use googleapi.IsNotModified to check whether the response 2478// error from Do is the result of In-None-Match. 2479func (c *ProjectsLocationsOperationsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsOperationsGetCall { 2480 c.ifNoneMatch_ = entityTag 2481 return c 2482} 2483 2484// Context sets the context to be used in this call's Do method. Any 2485// pending HTTP request will be aborted if the provided context is 2486// canceled. 2487func (c *ProjectsLocationsOperationsGetCall) Context(ctx context.Context) *ProjectsLocationsOperationsGetCall { 2488 c.ctx_ = ctx 2489 return c 2490} 2491 2492// Header returns an http.Header that can be modified by the caller to 2493// add HTTP headers to the request. 2494func (c *ProjectsLocationsOperationsGetCall) Header() http.Header { 2495 if c.header_ == nil { 2496 c.header_ = make(http.Header) 2497 } 2498 return c.header_ 2499} 2500 2501func (c *ProjectsLocationsOperationsGetCall) doRequest(alt string) (*http.Response, error) { 2502 reqHeaders := make(http.Header) 2503 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200503") 2504 for k, v := range c.header_ { 2505 reqHeaders[k] = v 2506 } 2507 reqHeaders.Set("User-Agent", c.s.userAgent()) 2508 if c.ifNoneMatch_ != "" { 2509 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 2510 } 2511 var body io.Reader = nil 2512 c.urlParams_.Set("alt", alt) 2513 c.urlParams_.Set("prettyPrint", "false") 2514 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") 2515 urls += "?" + c.urlParams_.Encode() 2516 req, err := http.NewRequest("GET", urls, body) 2517 if err != nil { 2518 return nil, err 2519 } 2520 req.Header = reqHeaders 2521 googleapi.Expand(req.URL, map[string]string{ 2522 "name": c.name, 2523 }) 2524 return gensupport.SendRequest(c.ctx_, c.s.client, req) 2525} 2526 2527// Do executes the "composer.projects.locations.operations.get" call. 2528// Exactly one of *Operation or error will be non-nil. Any non-2xx 2529// status code is an error. Response headers are in either 2530// *Operation.ServerResponse.Header or (if a response was returned at 2531// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 2532// to check whether the returned error was because 2533// http.StatusNotModified was returned. 2534func (c *ProjectsLocationsOperationsGetCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 2535 gensupport.SetOptions(c.urlParams_, opts...) 2536 res, err := c.doRequest("json") 2537 if res != nil && res.StatusCode == http.StatusNotModified { 2538 if res.Body != nil { 2539 res.Body.Close() 2540 } 2541 return nil, &googleapi.Error{ 2542 Code: res.StatusCode, 2543 Header: res.Header, 2544 } 2545 } 2546 if err != nil { 2547 return nil, err 2548 } 2549 defer googleapi.CloseBody(res) 2550 if err := googleapi.CheckResponse(res); err != nil { 2551 return nil, err 2552 } 2553 ret := &Operation{ 2554 ServerResponse: googleapi.ServerResponse{ 2555 Header: res.Header, 2556 HTTPStatusCode: res.StatusCode, 2557 }, 2558 } 2559 target := &ret 2560 if err := gensupport.DecodeResponse(target, res); err != nil { 2561 return nil, err 2562 } 2563 return ret, nil 2564 // { 2565 // "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.", 2566 // "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/operations/{operationsId}", 2567 // "httpMethod": "GET", 2568 // "id": "composer.projects.locations.operations.get", 2569 // "parameterOrder": [ 2570 // "name" 2571 // ], 2572 // "parameters": { 2573 // "name": { 2574 // "description": "The name of the operation resource.", 2575 // "location": "path", 2576 // "pattern": "^projects/[^/]+/locations/[^/]+/operations/[^/]+$", 2577 // "required": true, 2578 // "type": "string" 2579 // } 2580 // }, 2581 // "path": "v1/{+name}", 2582 // "response": { 2583 // "$ref": "Operation" 2584 // }, 2585 // "scopes": [ 2586 // "https://www.googleapis.com/auth/cloud-platform" 2587 // ] 2588 // } 2589 2590} 2591 2592// method id "composer.projects.locations.operations.list": 2593 2594type ProjectsLocationsOperationsListCall struct { 2595 s *Service 2596 name string 2597 urlParams_ gensupport.URLParams 2598 ifNoneMatch_ string 2599 ctx_ context.Context 2600 header_ http.Header 2601} 2602 2603// List: Lists operations that match the specified filter in the 2604// request. If the 2605// server doesn't support this method, it returns 2606// `UNIMPLEMENTED`. 2607// 2608// NOTE: the `name` binding allows API services to override the 2609// binding 2610// to use different resource name schemes, such as `users/*/operations`. 2611// To 2612// override the binding, API services can add a binding such 2613// as 2614// "/v1/{name=users/*}/operations" to their service configuration. 2615// For backwards compatibility, the default name includes the 2616// operations 2617// collection id, however overriding users must ensure the name 2618// binding 2619// is the parent resource, without the operations collection id. 2620func (r *ProjectsLocationsOperationsService) List(name string) *ProjectsLocationsOperationsListCall { 2621 c := &ProjectsLocationsOperationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 2622 c.name = name 2623 return c 2624} 2625 2626// Filter sets the optional parameter "filter": The standard list 2627// filter. 2628func (c *ProjectsLocationsOperationsListCall) Filter(filter string) *ProjectsLocationsOperationsListCall { 2629 c.urlParams_.Set("filter", filter) 2630 return c 2631} 2632 2633// PageSize sets the optional parameter "pageSize": The standard list 2634// page size. 2635func (c *ProjectsLocationsOperationsListCall) PageSize(pageSize int64) *ProjectsLocationsOperationsListCall { 2636 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) 2637 return c 2638} 2639 2640// PageToken sets the optional parameter "pageToken": The standard list 2641// page token. 2642func (c *ProjectsLocationsOperationsListCall) PageToken(pageToken string) *ProjectsLocationsOperationsListCall { 2643 c.urlParams_.Set("pageToken", pageToken) 2644 return c 2645} 2646 2647// Fields allows partial responses to be retrieved. See 2648// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 2649// for more information. 2650func (c *ProjectsLocationsOperationsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsOperationsListCall { 2651 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 2652 return c 2653} 2654 2655// IfNoneMatch sets the optional parameter which makes the operation 2656// fail if the object's ETag matches the given value. This is useful for 2657// getting updates only after the object has changed since the last 2658// request. Use googleapi.IsNotModified to check whether the response 2659// error from Do is the result of In-None-Match. 2660func (c *ProjectsLocationsOperationsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsOperationsListCall { 2661 c.ifNoneMatch_ = entityTag 2662 return c 2663} 2664 2665// Context sets the context to be used in this call's Do method. Any 2666// pending HTTP request will be aborted if the provided context is 2667// canceled. 2668func (c *ProjectsLocationsOperationsListCall) Context(ctx context.Context) *ProjectsLocationsOperationsListCall { 2669 c.ctx_ = ctx 2670 return c 2671} 2672 2673// Header returns an http.Header that can be modified by the caller to 2674// add HTTP headers to the request. 2675func (c *ProjectsLocationsOperationsListCall) Header() http.Header { 2676 if c.header_ == nil { 2677 c.header_ = make(http.Header) 2678 } 2679 return c.header_ 2680} 2681 2682func (c *ProjectsLocationsOperationsListCall) doRequest(alt string) (*http.Response, error) { 2683 reqHeaders := make(http.Header) 2684 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200503") 2685 for k, v := range c.header_ { 2686 reqHeaders[k] = v 2687 } 2688 reqHeaders.Set("User-Agent", c.s.userAgent()) 2689 if c.ifNoneMatch_ != "" { 2690 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 2691 } 2692 var body io.Reader = nil 2693 c.urlParams_.Set("alt", alt) 2694 c.urlParams_.Set("prettyPrint", "false") 2695 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}/operations") 2696 urls += "?" + c.urlParams_.Encode() 2697 req, err := http.NewRequest("GET", urls, body) 2698 if err != nil { 2699 return nil, err 2700 } 2701 req.Header = reqHeaders 2702 googleapi.Expand(req.URL, map[string]string{ 2703 "name": c.name, 2704 }) 2705 return gensupport.SendRequest(c.ctx_, c.s.client, req) 2706} 2707 2708// Do executes the "composer.projects.locations.operations.list" call. 2709// Exactly one of *ListOperationsResponse or error will be non-nil. Any 2710// non-2xx status code is an error. Response headers are in either 2711// *ListOperationsResponse.ServerResponse.Header or (if a response was 2712// returned at all) in error.(*googleapi.Error).Header. Use 2713// googleapi.IsNotModified to check whether the returned error was 2714// because http.StatusNotModified was returned. 2715func (c *ProjectsLocationsOperationsListCall) Do(opts ...googleapi.CallOption) (*ListOperationsResponse, error) { 2716 gensupport.SetOptions(c.urlParams_, opts...) 2717 res, err := c.doRequest("json") 2718 if res != nil && res.StatusCode == http.StatusNotModified { 2719 if res.Body != nil { 2720 res.Body.Close() 2721 } 2722 return nil, &googleapi.Error{ 2723 Code: res.StatusCode, 2724 Header: res.Header, 2725 } 2726 } 2727 if err != nil { 2728 return nil, err 2729 } 2730 defer googleapi.CloseBody(res) 2731 if err := googleapi.CheckResponse(res); err != nil { 2732 return nil, err 2733 } 2734 ret := &ListOperationsResponse{ 2735 ServerResponse: googleapi.ServerResponse{ 2736 Header: res.Header, 2737 HTTPStatusCode: res.StatusCode, 2738 }, 2739 } 2740 target := &ret 2741 if err := gensupport.DecodeResponse(target, res); err != nil { 2742 return nil, err 2743 } 2744 return ret, nil 2745 // { 2746 // "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.", 2747 // "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/operations", 2748 // "httpMethod": "GET", 2749 // "id": "composer.projects.locations.operations.list", 2750 // "parameterOrder": [ 2751 // "name" 2752 // ], 2753 // "parameters": { 2754 // "filter": { 2755 // "description": "The standard list filter.", 2756 // "location": "query", 2757 // "type": "string" 2758 // }, 2759 // "name": { 2760 // "description": "The name of the operation's parent resource.", 2761 // "location": "path", 2762 // "pattern": "^projects/[^/]+/locations/[^/]+$", 2763 // "required": true, 2764 // "type": "string" 2765 // }, 2766 // "pageSize": { 2767 // "description": "The standard list page size.", 2768 // "format": "int32", 2769 // "location": "query", 2770 // "type": "integer" 2771 // }, 2772 // "pageToken": { 2773 // "description": "The standard list page token.", 2774 // "location": "query", 2775 // "type": "string" 2776 // } 2777 // }, 2778 // "path": "v1/{+name}/operations", 2779 // "response": { 2780 // "$ref": "ListOperationsResponse" 2781 // }, 2782 // "scopes": [ 2783 // "https://www.googleapis.com/auth/cloud-platform" 2784 // ] 2785 // } 2786 2787} 2788 2789// Pages invokes f for each page of results. 2790// A non-nil error returned from f will halt the iteration. 2791// The provided context supersedes any context provided to the Context method. 2792func (c *ProjectsLocationsOperationsListCall) Pages(ctx context.Context, f func(*ListOperationsResponse) error) error { 2793 c.ctx_ = ctx 2794 defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point 2795 for { 2796 x, err := c.Do() 2797 if err != nil { 2798 return err 2799 } 2800 if err := f(x); err != nil { 2801 return err 2802 } 2803 if x.NextPageToken == "" { 2804 return nil 2805 } 2806 c.PageToken(x.NextPageToken) 2807 } 2808} 2809