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