1// Copyright 2020 Google LLC. 2// Use of this source code is governed by a BSD-style 3// license that can be found in the LICENSE file. 4 5// Code generated file. DO NOT EDIT. 6 7// Package networkmanagement provides access to the Network Management API. 8// 9// For product documentation, see: https://cloud.google.com/ 10// 11// Creating a client 12// 13// Usage example: 14// 15// import "google.golang.org/api/networkmanagement/v1beta1" 16// ... 17// ctx := context.Background() 18// networkmanagementService, err := networkmanagement.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// networkmanagementService, err := networkmanagement.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// networkmanagementService, err := networkmanagement.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token))) 36// 37// See https://godoc.org/google.golang.org/api/option/ for details on options. 38package networkmanagement // import "google.golang.org/api/networkmanagement/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 googleapi "google.golang.org/api/googleapi" 53 gensupport "google.golang.org/api/internal/gensupport" 54 option "google.golang.org/api/option" 55 internaloption "google.golang.org/api/option/internaloption" 56 htransport "google.golang.org/api/transport/http" 57) 58 59// Always reference these packages, just in case the auto-generated code 60// below doesn't. 61var _ = bytes.NewBuffer 62var _ = strconv.Itoa 63var _ = fmt.Sprintf 64var _ = json.NewDecoder 65var _ = io.Copy 66var _ = url.Parse 67var _ = gensupport.MarshalJSON 68var _ = googleapi.Version 69var _ = errors.New 70var _ = strings.Replace 71var _ = context.Canceled 72var _ = internaloption.WithDefaultEndpoint 73 74const apiId = "networkmanagement:v1beta1" 75const apiName = "networkmanagement" 76const apiVersion = "v1beta1" 77const basePath = "https://networkmanagement.googleapis.com/" 78const mtlsBasePath = "https://networkmanagement.mtls.googleapis.com/" 79 80// OAuth2 scopes used by this API. 81const ( 82 // View and manage your data across Google Cloud Platform services 83 CloudPlatformScope = "https://www.googleapis.com/auth/cloud-platform" 84) 85 86// NewService creates a new Service. 87func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, error) { 88 scopesOption := option.WithScopes( 89 "https://www.googleapis.com/auth/cloud-platform", 90 ) 91 // NOTE: prepend, so we don't override user-specified scopes. 92 opts = append([]option.ClientOption{scopesOption}, opts...) 93 opts = append(opts, internaloption.WithDefaultEndpoint(basePath)) 94 opts = append(opts, internaloption.WithDefaultMTLSEndpoint(mtlsBasePath)) 95 client, endpoint, err := htransport.NewClient(ctx, opts...) 96 if err != nil { 97 return nil, err 98 } 99 s, err := New(client) 100 if err != nil { 101 return nil, err 102 } 103 if endpoint != "" { 104 s.BasePath = endpoint 105 } 106 return s, nil 107} 108 109// New creates a new Service. It uses the provided http.Client for requests. 110// 111// Deprecated: please use NewService instead. 112// To provide a custom HTTP client, use option.WithHTTPClient. 113// If you are using google.golang.org/api/googleapis/transport.APIKey, use option.WithAPIKey with NewService instead. 114func New(client *http.Client) (*Service, error) { 115 if client == nil { 116 return nil, errors.New("client is nil") 117 } 118 s := &Service{client: client, BasePath: basePath} 119 s.Projects = NewProjectsService(s) 120 return s, nil 121} 122 123type Service struct { 124 client *http.Client 125 BasePath string // API endpoint base URL 126 UserAgent string // optional additional User-Agent fragment 127 128 Projects *ProjectsService 129} 130 131func (s *Service) userAgent() string { 132 if s.UserAgent == "" { 133 return googleapi.UserAgent 134 } 135 return googleapi.UserAgent + " " + s.UserAgent 136} 137 138func NewProjectsService(s *Service) *ProjectsService { 139 rs := &ProjectsService{s: s} 140 rs.Locations = NewProjectsLocationsService(s) 141 return rs 142} 143 144type ProjectsService struct { 145 s *Service 146 147 Locations *ProjectsLocationsService 148} 149 150func NewProjectsLocationsService(s *Service) *ProjectsLocationsService { 151 rs := &ProjectsLocationsService{s: s} 152 rs.Global = NewProjectsLocationsGlobalService(s) 153 return rs 154} 155 156type ProjectsLocationsService struct { 157 s *Service 158 159 Global *ProjectsLocationsGlobalService 160} 161 162func NewProjectsLocationsGlobalService(s *Service) *ProjectsLocationsGlobalService { 163 rs := &ProjectsLocationsGlobalService{s: s} 164 rs.ConnectivityTests = NewProjectsLocationsGlobalConnectivityTestsService(s) 165 rs.Operations = NewProjectsLocationsGlobalOperationsService(s) 166 return rs 167} 168 169type ProjectsLocationsGlobalService struct { 170 s *Service 171 172 ConnectivityTests *ProjectsLocationsGlobalConnectivityTestsService 173 174 Operations *ProjectsLocationsGlobalOperationsService 175} 176 177func NewProjectsLocationsGlobalConnectivityTestsService(s *Service) *ProjectsLocationsGlobalConnectivityTestsService { 178 rs := &ProjectsLocationsGlobalConnectivityTestsService{s: s} 179 return rs 180} 181 182type ProjectsLocationsGlobalConnectivityTestsService struct { 183 s *Service 184} 185 186func NewProjectsLocationsGlobalOperationsService(s *Service) *ProjectsLocationsGlobalOperationsService { 187 rs := &ProjectsLocationsGlobalOperationsService{s: s} 188 return rs 189} 190 191type ProjectsLocationsGlobalOperationsService struct { 192 s *Service 193} 194 195// AbortInfo: Details of the final state "abort" and associated 196// resource. 197type AbortInfo struct { 198 // Cause: Causes that the analysis is aborted. 199 // 200 // Possible values: 201 // "CAUSE_UNSPECIFIED" - Cause is unspecified. 202 // "UNKNOWN_NETWORK" - Aborted due to unknown network. The 203 // reachability analysis cannot proceed because the user does not have 204 // access to the host project's network configurations, including 205 // firewall rules and routes. This happens when the project is a service 206 // project and the endpoints being traced are in the host project's 207 // network. 208 // "UNKNOWN_IP" - Aborted because the IP address(es) are unknown. 209 // "UNKNOWN_PROJECT" - Aborted because no project information can be 210 // derived from the test input. 211 // "PERMISSION_DENIED" - Aborted because the user lacks the permission 212 // to access all or part of the network configurations required to run 213 // the test. 214 // "NO_SOURCE_LOCATION" - Aborted because no valid source endpoint is 215 // derived from the input test request. 216 // "INVALID_ARGUMENT" - Aborted because the source and/or destination 217 // endpoint specified in the test are invalid. The possible reasons that 218 // an endpoint is invalid include: malformed IP address; nonexistent 219 // instance or network URI; IP address not in the range of specified 220 // network URI; and instance not owning the network interface in the 221 // specified network. 222 // "NO_EXTERNAL_IP" - Aborted because traffic is sent from a public IP 223 // to an instance without an external IP. 224 // "UNINTENDED_DESTINATION" - Aborted because none of the traces 225 // matches destination information specified in the input test request. 226 // "TRACE_TOO_LONG" - Aborted because the number of steps in the trace 227 // exceeding a certain limit which may be caused by routing loop. 228 // "INTERNAL_ERROR" - Aborted due to internal server error. 229 Cause string `json:"cause,omitempty"` 230 231 // ResourceUri: URI of the resource that caused the abort. 232 ResourceUri string `json:"resourceUri,omitempty"` 233 234 // ForceSendFields is a list of field names (e.g. "Cause") to 235 // unconditionally include in API requests. By default, fields with 236 // empty values are omitted from API requests. However, any non-pointer, 237 // non-interface field appearing in ForceSendFields will be sent to the 238 // server regardless of whether the field is empty or not. This may be 239 // used to include empty fields in Patch requests. 240 ForceSendFields []string `json:"-"` 241 242 // NullFields is a list of field names (e.g. "Cause") to include in API 243 // requests with the JSON null value. By default, fields with empty 244 // values are omitted from API requests. However, any field with an 245 // empty value appearing in NullFields will be sent to the server as 246 // null. It is an error if a field in this list has a non-empty value. 247 // This may be used to include null fields in Patch requests. 248 NullFields []string `json:"-"` 249} 250 251func (s *AbortInfo) MarshalJSON() ([]byte, error) { 252 type NoMethod AbortInfo 253 raw := NoMethod(*s) 254 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 255} 256 257// AuditConfig: Specifies the audit configuration for a service. The 258// configuration determines which permission types are logged, and what 259// identities, if any, are exempted from logging. An AuditConfig must 260// have one or more AuditLogConfigs. If there are AuditConfigs for both 261// `allServices` and a specific service, the union of the two 262// AuditConfigs is used for that service: the log_types specified in 263// each AuditConfig are enabled, and the exempted_members in each 264// AuditLogConfig are exempted. Example Policy with multiple 265// AuditConfigs: { "audit_configs": [ { "service": "allServices", 266// "audit_log_configs": [ { "log_type": "DATA_READ", "exempted_members": 267// [ "user:jose@example.com" ] }, { "log_type": "DATA_WRITE" }, { 268// "log_type": "ADMIN_READ" } ] }, { "service": 269// "sampleservice.googleapis.com", "audit_log_configs": [ { "log_type": 270// "DATA_READ" }, { "log_type": "DATA_WRITE", "exempted_members": [ 271// "user:aliya@example.com" ] } ] } ] } For sampleservice, this policy 272// enables DATA_READ, DATA_WRITE and ADMIN_READ logging. It also exempts 273// jose@example.com from DATA_READ logging, and aliya@example.com from 274// DATA_WRITE logging. 275type AuditConfig struct { 276 // AuditLogConfigs: The configuration for logging of each type of 277 // permission. 278 AuditLogConfigs []*AuditLogConfig `json:"auditLogConfigs,omitempty"` 279 280 // Service: Specifies a service that will be enabled for audit logging. 281 // For example, `storage.googleapis.com`, `cloudsql.googleapis.com`. 282 // `allServices` is a special value that covers all services. 283 Service string `json:"service,omitempty"` 284 285 // ForceSendFields is a list of field names (e.g. "AuditLogConfigs") to 286 // unconditionally include in API requests. By default, fields with 287 // empty values are omitted from API requests. However, any non-pointer, 288 // non-interface field appearing in ForceSendFields will be sent to the 289 // server regardless of whether the field is empty or not. This may be 290 // used to include empty fields in Patch requests. 291 ForceSendFields []string `json:"-"` 292 293 // NullFields is a list of field names (e.g. "AuditLogConfigs") to 294 // include in API requests with the JSON null value. By default, fields 295 // with empty values are omitted from API requests. However, any field 296 // with an empty value appearing in NullFields will be sent to the 297 // server as null. It is an error if a field in this list has a 298 // non-empty value. This may be used to include null fields in Patch 299 // requests. 300 NullFields []string `json:"-"` 301} 302 303func (s *AuditConfig) MarshalJSON() ([]byte, error) { 304 type NoMethod AuditConfig 305 raw := NoMethod(*s) 306 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 307} 308 309// AuditLogConfig: Provides the configuration for logging a type of 310// permissions. Example: { "audit_log_configs": [ { "log_type": 311// "DATA_READ", "exempted_members": [ "user:jose@example.com" ] }, { 312// "log_type": "DATA_WRITE" } ] } This enables 'DATA_READ' and 313// 'DATA_WRITE' logging, while exempting jose@example.com from DATA_READ 314// logging. 315type AuditLogConfig struct { 316 // ExemptedMembers: Specifies the identities that do not cause logging 317 // for this type of permission. Follows the same format of 318 // Binding.members. 319 ExemptedMembers []string `json:"exemptedMembers,omitempty"` 320 321 // LogType: The log type that this config enables. 322 // 323 // Possible values: 324 // "LOG_TYPE_UNSPECIFIED" - Default case. Should never be this. 325 // "ADMIN_READ" - Admin reads. Example: CloudIAM getIamPolicy 326 // "DATA_WRITE" - Data writes. Example: CloudSQL Users create 327 // "DATA_READ" - Data reads. Example: CloudSQL Users list 328 LogType string `json:"logType,omitempty"` 329 330 // ForceSendFields is a list of field names (e.g. "ExemptedMembers") 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. "ExemptedMembers") to 339 // include in API requests with the JSON null value. By default, fields 340 // with empty values are omitted from API requests. However, any field 341 // with an empty value appearing in NullFields will be sent to the 342 // server as null. It is an error if a field in this list has a 343 // non-empty value. This may be used to include null fields in Patch 344 // requests. 345 NullFields []string `json:"-"` 346} 347 348func (s *AuditLogConfig) MarshalJSON() ([]byte, error) { 349 type NoMethod AuditLogConfig 350 raw := NoMethod(*s) 351 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 352} 353 354// Binding: Associates `members` with a `role`. 355type Binding struct { 356 BindingId string `json:"bindingId,omitempty"` 357 358 // Condition: The condition that is associated with this binding. If the 359 // condition evaluates to `true`, then this binding applies to the 360 // current request. If the condition evaluates to `false`, then this 361 // binding does not apply to the current request. However, a different 362 // role binding might grant the same role to one or more of the members 363 // in this binding. To learn which resources support conditions in their 364 // IAM policies, see the [IAM 365 // documentation](https://cloud.google.com/iam/help/conditions/resource-p 366 // olicies). 367 Condition *Expr `json:"condition,omitempty"` 368 369 // Members: Specifies the identities requesting access for a Cloud 370 // Platform resource. `members` can have the following values: * 371 // `allUsers`: A special identifier that represents anyone who is on the 372 // internet; with or without a Google account. * 373 // `allAuthenticatedUsers`: A special identifier that represents anyone 374 // who is authenticated with a Google account or a service account. * 375 // `user:{emailid}`: An email address that represents a specific Google 376 // account. For example, `alice@example.com` . * 377 // `serviceAccount:{emailid}`: An email address that represents a 378 // service account. For example, 379 // `my-other-app@appspot.gserviceaccount.com`. * `group:{emailid}`: An 380 // email address that represents a Google group. For example, 381 // `admins@example.com`. * `deleted:user:{emailid}?uid={uniqueid}`: An 382 // email address (plus unique identifier) representing a user that has 383 // been recently deleted. For example, 384 // `alice@example.com?uid=123456789012345678901`. If the user is 385 // recovered, this value reverts to `user:{emailid}` and the recovered 386 // user retains the role in the binding. * 387 // `deleted:serviceAccount:{emailid}?uid={uniqueid}`: An email address 388 // (plus unique identifier) representing a service account that has been 389 // recently deleted. For example, 390 // `my-other-app@appspot.gserviceaccount.com?uid=123456789012345678901`. 391 // If the service account is undeleted, this value reverts to 392 // `serviceAccount:{emailid}` and the undeleted service account retains 393 // the role in the binding. * `deleted:group:{emailid}?uid={uniqueid}`: 394 // An email address (plus unique identifier) representing a Google group 395 // that has been recently deleted. For example, 396 // `admins@example.com?uid=123456789012345678901`. If the group is 397 // recovered, this value reverts to `group:{emailid}` and the recovered 398 // group retains the role in the binding. * `domain:{domain}`: The G 399 // Suite domain (primary) that represents all the users of that domain. 400 // For example, `google.com` or `example.com`. 401 Members []string `json:"members,omitempty"` 402 403 // Role: Role that is assigned to `members`. For example, 404 // `roles/viewer`, `roles/editor`, or `roles/owner`. 405 Role string `json:"role,omitempty"` 406 407 // ForceSendFields is a list of field names (e.g. "BindingId") to 408 // unconditionally include in API requests. By default, fields with 409 // empty values are omitted from API requests. However, any non-pointer, 410 // non-interface field appearing in ForceSendFields will be sent to the 411 // server regardless of whether the field is empty or not. This may be 412 // used to include empty fields in Patch requests. 413 ForceSendFields []string `json:"-"` 414 415 // NullFields is a list of field names (e.g. "BindingId") to include in 416 // API requests with the JSON null value. By default, fields with empty 417 // values are omitted from API requests. However, any field with an 418 // empty value appearing in NullFields will be sent to the server as 419 // null. It is an error if a field in this list has a non-empty value. 420 // This may be used to include null fields in Patch requests. 421 NullFields []string `json:"-"` 422} 423 424func (s *Binding) MarshalJSON() ([]byte, error) { 425 type NoMethod Binding 426 raw := NoMethod(*s) 427 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 428} 429 430// CancelOperationRequest: The request message for 431// Operations.CancelOperation. 432type CancelOperationRequest struct { 433} 434 435// CloudSQLInstanceInfo: For display only. Metadata associated with a 436// Cloud SQL instance. 437type CloudSQLInstanceInfo struct { 438 // DisplayName: Name of a Cloud SQL instance. 439 DisplayName string `json:"displayName,omitempty"` 440 441 // ExternalIp: External IP address of Cloud SQL instance. 442 ExternalIp string `json:"externalIp,omitempty"` 443 444 // InternalIp: Internal IP address of Cloud SQL instance. 445 InternalIp string `json:"internalIp,omitempty"` 446 447 // NetworkUri: URI of a Cloud SQL instance network or empty string if 448 // instance does not have one. 449 NetworkUri string `json:"networkUri,omitempty"` 450 451 // Region: Region in which the Cloud SQL instance is running. 452 Region string `json:"region,omitempty"` 453 454 // Uri: URI of a Cloud SQL instance. 455 Uri string `json:"uri,omitempty"` 456 457 // ForceSendFields is a list of field names (e.g. "DisplayName") to 458 // unconditionally include in API requests. By default, fields with 459 // empty values are omitted from API requests. However, any non-pointer, 460 // non-interface field appearing in ForceSendFields will be sent to the 461 // server regardless of whether the field is empty or not. This may be 462 // used to include empty fields in Patch requests. 463 ForceSendFields []string `json:"-"` 464 465 // NullFields is a list of field names (e.g. "DisplayName") to include 466 // in API requests with the JSON null value. By default, fields with 467 // empty values are omitted from API requests. However, any field with 468 // an empty value appearing in NullFields will be sent to the server as 469 // null. It is an error if a field in this list has a non-empty value. 470 // This may be used to include null fields in Patch requests. 471 NullFields []string `json:"-"` 472} 473 474func (s *CloudSQLInstanceInfo) MarshalJSON() ([]byte, error) { 475 type NoMethod CloudSQLInstanceInfo 476 raw := NoMethod(*s) 477 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 478} 479 480// ConnectivityTest: A Connectivity Test for a network reachability 481// analysis. 482type ConnectivityTest struct { 483 // CreateTime: Output only. The time the test was created. 484 CreateTime string `json:"createTime,omitempty"` 485 486 // Description: The user-supplied description of the Connectivity Test. 487 // Maximum of 512 characters. 488 Description string `json:"description,omitempty"` 489 490 // Destination: Required. Destination specification of the Connectivity 491 // Test. You can use a combination of destination IP address, Compute 492 // Engine VM instance, or VPC network to uniquely identify the 493 // destination location. Even if the destination IP address is not 494 // unique, the source IP location is unique. Usually, the analysis can 495 // infer the destination endpoint from route information. If the 496 // destination you specify is a VM instance and the instance has 497 // multiple network interfaces, then you must also specify either a 498 // destination IP address or VPC network to identify the destination 499 // interface. A reachability analysis proceeds even if the destination 500 // location is ambiguous. However, the result can include endpoints that 501 // you don't intend to test. 502 Destination *Endpoint `json:"destination,omitempty"` 503 504 // DisplayName: Output only. The display name of a Connectivity Test. 505 DisplayName string `json:"displayName,omitempty"` 506 507 // Labels: Resource labels to represent user-provided metadata. 508 Labels map[string]string `json:"labels,omitempty"` 509 510 // Name: Required. Unique name of the resource using the form: 511 // `projects/{project_id}/locations/global/connectivityTests/{test}` 512 Name string `json:"name,omitempty"` 513 514 // ProbingDetails: Output only. The probing details of this test from 515 // the latest run, present for applicable tests only. The details are 516 // updated when creating a new test, updating an existing test, or 517 // triggering a one-time rerun of an existing test. 518 ProbingDetails *ProbingDetails `json:"probingDetails,omitempty"` 519 520 // Protocol: IP Protocol of the test. When not provided, "TCP" is 521 // assumed. 522 Protocol string `json:"protocol,omitempty"` 523 524 // ReachabilityDetails: Output only. The reachability details of this 525 // test from the latest run. The details are updated when creating a new 526 // test, updating an existing test, or triggering a one-time rerun of an 527 // existing test. 528 ReachabilityDetails *ReachabilityDetails `json:"reachabilityDetails,omitempty"` 529 530 // RelatedProjects: Other projects that may be relevant for reachability 531 // analysis. This is applicable to scenarios where a test can cross 532 // project boundaries. 533 RelatedProjects []string `json:"relatedProjects,omitempty"` 534 535 // Source: Required. Source specification of the Connectivity Test. You 536 // can use a combination of source IP address, virtual machine (VM) 537 // instance, or Compute Engine network to uniquely identify the source 538 // location. Examples: If the source IP address is an internal IP 539 // address within a Google Cloud Virtual Private Cloud (VPC) network, 540 // then you must also specify the VPC network. Otherwise, specify the VM 541 // instance, which already contains its internal IP address and VPC 542 // network information. If the source of the test is within an 543 // on-premises network, then you must provide the destination VPC 544 // network. If the source endpoint is a Compute Engine VM instance with 545 // multiple network interfaces, the instance itself is not sufficient to 546 // identify the endpoint. So, you must also specify the source IP 547 // address or VPC network. A reachability analysis proceeds even if the 548 // source location is ambiguous. However, the test result may include 549 // endpoints that you don't intend to test. 550 Source *Endpoint `json:"source,omitempty"` 551 552 // UpdateTime: Output only. The time the test's configuration was 553 // updated. 554 UpdateTime string `json:"updateTime,omitempty"` 555 556 // ServerResponse contains the HTTP response code and headers from the 557 // server. 558 googleapi.ServerResponse `json:"-"` 559 560 // ForceSendFields is a list of field names (e.g. "CreateTime") to 561 // unconditionally include in API requests. By default, fields with 562 // empty values are omitted from API requests. However, any non-pointer, 563 // non-interface field appearing in ForceSendFields will be sent to the 564 // server regardless of whether the field is empty or not. This may be 565 // used to include empty fields in Patch requests. 566 ForceSendFields []string `json:"-"` 567 568 // NullFields is a list of field names (e.g. "CreateTime") to include in 569 // API requests with the JSON null value. By default, fields with empty 570 // values are omitted from API requests. However, any field with an 571 // empty value appearing in NullFields will be sent to the server as 572 // null. It is an error if a field in this list has a non-empty value. 573 // This may be used to include null fields in Patch requests. 574 NullFields []string `json:"-"` 575} 576 577func (s *ConnectivityTest) MarshalJSON() ([]byte, error) { 578 type NoMethod ConnectivityTest 579 raw := NoMethod(*s) 580 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 581} 582 583// DeliverInfo: Details of the final state "deliver" and associated 584// resource. 585type DeliverInfo struct { 586 // ResourceUri: URI of the resource that the packet is delivered to. 587 ResourceUri string `json:"resourceUri,omitempty"` 588 589 // Target: Target type where the packet is delivered to. 590 // 591 // Possible values: 592 // "TARGET_UNSPECIFIED" - Target not specified. 593 // "INSTANCE" - Target is a Compute Engine instance. 594 // "INTERNET" - Target is the Internet. 595 // "GOOGLE_API" - Target is a Google API. 596 // "GKE_MASTER" - Target is a Google Kubernetes Engine cluster master. 597 // "CLOUD_SQL_INSTANCE" - Target is a Cloud SQL instance. 598 Target string `json:"target,omitempty"` 599 600 // ForceSendFields is a list of field names (e.g. "ResourceUri") to 601 // unconditionally include in API requests. By default, fields with 602 // empty values are omitted from API requests. However, any non-pointer, 603 // non-interface field appearing in ForceSendFields will be sent to the 604 // server regardless of whether the field is empty or not. This may be 605 // used to include empty fields in Patch requests. 606 ForceSendFields []string `json:"-"` 607 608 // NullFields is a list of field names (e.g. "ResourceUri") to include 609 // in API requests with the JSON null value. By default, fields with 610 // empty values are omitted from API requests. However, any field with 611 // an empty value appearing in NullFields will be sent to the server as 612 // null. It is an error if a field in this list has a non-empty value. 613 // This may be used to include null fields in Patch requests. 614 NullFields []string `json:"-"` 615} 616 617func (s *DeliverInfo) MarshalJSON() ([]byte, error) { 618 type NoMethod DeliverInfo 619 raw := NoMethod(*s) 620 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 621} 622 623// DropInfo: Details of the final state "drop" and associated resource. 624type DropInfo struct { 625 // Cause: Cause that the packet is dropped. 626 // 627 // Possible values: 628 // "CAUSE_UNSPECIFIED" - Cause is unspecified. 629 // "UNKNOWN_EXTERNAL_ADDRESS" - Destination external address cannot be 630 // resolved to a known target. 631 // "FOREIGN_IP_DISALLOWED" - a Compute Engine instance can only send 632 // or receive a packet with a foreign IP if ip_forward is enabled. 633 // "FIREWALL_RULE" - Dropped due to a firewall rule unless allowed due 634 // to connection tracking. 635 // "NO_ROUTE" - Dropped due to no routes. 636 // "ROUTE_BLACKHOLE" - Dropped due to invalid route. Route's next hop 637 // is a blackhole. 638 // "ROUTE_WRONG_NETWORK" - Packet is sent to a wrong (unintended) 639 // network. Example: user traces a packet from VM1:Network1 to 640 // VM2:Network2, however, the route configured in Network1 sends the 641 // packet destined for VM2's IP addresss to Network3. 642 // "PRIVATE_TRAFFIC_TO_INTERNET" - Packet with internal destination 643 // address sent to Internet gateway. 644 // "PRIVATE_GOOGLE_ACCESS_DISALLOWED" - Instance with only an internal 645 // IP tries to access Google API and Services, and private Google access 646 // is not enabled. 647 // "NO_EXTERNAL_ADDRESS" - Instance with only internal IP tries to 648 // access external hosts, but Cloud NAT is not enabled in the subnet, 649 // unless special configurations on a VM allows this connection. See 650 // [Special Configurations for VM 651 // instances](https://cloud.google.com/vpc/docs/special-configurations) 652 // for details. 653 // "UNKNOWN_INTERNAL_ADDRESS" - Destination internal address cannot be 654 // resolved to a known target. 655 // "FORWARDING_RULE_MISMATCH" - Forwarding rule's protocol and ports 656 // do not match the packet header. 657 // "FORWARDING_RULE_NO_INSTANCES" - Forwarding rule does not have 658 // backends configured. 659 // "FIREWALL_BLOCKING_LOAD_BALANCER_BACKEND_HEALTH_CHECK" - Firewalls 660 // block the health check probes to the backends and cause the backends 661 // to be unavailable for traffic from the load balancer. See [Health 662 // check firewall 663 // rules](https://cloud.google.com/load-balancing/docs/health-checks#fire 664 // wall_rules) for more details. 665 // "INSTANCE_NOT_RUNNING" - Packet is sent from or to a Compute Engine 666 // instance that is not in a running state. 667 // "TRAFFIC_TYPE_BLOCKED" - The type of traffic is blocked and the 668 // user cannot configure a firewall rule to enable it. See [Always 669 // blocked 670 // traffic](https://cloud.google.com/vpc/docs/firewalls#blockedtraffic) 671 // for more details. 672 // "GKE_MASTER_UNAUTHORIZED_ACCESS" - Access to Google Kubernetes 673 // Engine cluster master's endpoint is not authorized. See [Access to 674 // the cluster 675 // endpoints](https://cloud.google.com/kubernetes-engine/docs/how-to/priv 676 // ate-clusters#access_to_the_cluster_endpoints) for more details. 677 // "CLOUD_SQL_INSTANCE_UNAUTHORIZED_ACCESS" - Access to the Cloud SQL 678 // instance endpoint is not authorized. See [Authorizing with authorized 679 // networks](https://cloud.google.com/sql/docs/mysql/authorize-networks) 680 // for more details. 681 // "DROPPED_INSIDE_GKE_SERVICE" - Packet was dropped inside Google 682 // Kubernetes Engine Service. 683 // "DROPPED_INSIDE_CLOUD_SQL_SERVICE" - Packet was dropped inside 684 // Cloud SQL Service. 685 Cause string `json:"cause,omitempty"` 686 687 // ResourceUri: URI of the resource that caused the drop. 688 ResourceUri string `json:"resourceUri,omitempty"` 689 690 // ForceSendFields is a list of field names (e.g. "Cause") to 691 // unconditionally include in API requests. By default, fields with 692 // empty values are omitted from API requests. However, any non-pointer, 693 // non-interface field appearing in ForceSendFields will be sent to the 694 // server regardless of whether the field is empty or not. This may be 695 // used to include empty fields in Patch requests. 696 ForceSendFields []string `json:"-"` 697 698 // NullFields is a list of field names (e.g. "Cause") to include in API 699 // requests with the JSON null value. By default, fields with empty 700 // values are omitted from API requests. However, any field with an 701 // empty value appearing in NullFields will be sent to the server as 702 // null. It is an error if a field in this list has a non-empty value. 703 // This may be used to include null fields in Patch requests. 704 NullFields []string `json:"-"` 705} 706 707func (s *DropInfo) MarshalJSON() ([]byte, error) { 708 type NoMethod DropInfo 709 raw := NoMethod(*s) 710 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 711} 712 713// Empty: A generic empty message that you can re-use to avoid defining 714// duplicated empty messages in your APIs. A typical example is to use 715// it as the request or the response type of an API method. For 716// instance: service Foo { rpc Bar(google.protobuf.Empty) returns 717// (google.protobuf.Empty); } The JSON representation for `Empty` is 718// empty JSON object `{}`. 719type Empty struct { 720 // ServerResponse contains the HTTP response code and headers from the 721 // server. 722 googleapi.ServerResponse `json:"-"` 723} 724 725// Endpoint: Source or destination of the Connectivity Test. 726type Endpoint struct { 727 // CloudSqlInstance: A [Cloud SQL](https://cloud.google.com/sql) 728 // instance URI. 729 CloudSqlInstance string `json:"cloudSqlInstance,omitempty"` 730 731 // GkeMasterCluster: A cluster URI for [Google Kubernetes Engine 732 // master](https://cloud.google.com/kubernetes-engine/docs/concepts/clust 733 // er-architecture). 734 GkeMasterCluster string `json:"gkeMasterCluster,omitempty"` 735 736 // Instance: A Compute Engine instance URI. 737 Instance string `json:"instance,omitempty"` 738 739 // IpAddress: The IP address of the endpoint, which can be an external 740 // or internal IP. An IPv6 address is only allowed when the test's 741 // destination is a [global load balancer 742 // VIP](https://cloud.google.com/load-balancing/docs/load-balancing-overv 743 // iew). 744 IpAddress string `json:"ipAddress,omitempty"` 745 746 // Network: A Compute Engine network URI. 747 Network string `json:"network,omitempty"` 748 749 // NetworkType: Type of the network where the endpoint is located. 750 // Applicable only to source endpoint, as destination network type can 751 // be inferred from the source. 752 // 753 // Possible values: 754 // "NETWORK_TYPE_UNSPECIFIED" - Default type if unspecified. 755 // "GCP_NETWORK" - A network hosted within Google Cloud Platform. To 756 // receive more detailed output, specify the URI for the source or 757 // destination network. 758 // "NON_GCP_NETWORK" - A network hosted outside of Google Cloud 759 // Platform. This can be an on-premises network, or a network hosted by 760 // another cloud provider. 761 NetworkType string `json:"networkType,omitempty"` 762 763 // Port: The IP protocol port of the endpoint. Only applicable when 764 // protocol is TCP or UDP. 765 Port int64 `json:"port,omitempty"` 766 767 // ProjectId: Project ID where the endpoint is located. The Project ID 768 // can be derived from the URI if you provide a VM instance or network 769 // URI. The following are two cases where you must provide the project 770 // ID: 1. Only the IP address is specified, and the IP address is within 771 // a GCP project. 2. When you are using Shared VPC and the IP address 772 // that you provide is from the service project. In this case, the 773 // network that the IP address resides in is defined in the host 774 // project. 775 ProjectId string `json:"projectId,omitempty"` 776 777 // ForceSendFields is a list of field names (e.g. "CloudSqlInstance") to 778 // unconditionally include in API requests. By default, fields with 779 // empty values are omitted from API requests. However, any non-pointer, 780 // non-interface field appearing in ForceSendFields will be sent to the 781 // server regardless of whether the field is empty or not. This may be 782 // used to include empty fields in Patch requests. 783 ForceSendFields []string `json:"-"` 784 785 // NullFields is a list of field names (e.g. "CloudSqlInstance") to 786 // include in API requests with the JSON null value. By default, fields 787 // with empty values are omitted from API requests. However, any field 788 // with an empty value appearing in NullFields will be sent to the 789 // server as null. It is an error if a field in this list has a 790 // non-empty value. This may be used to include null fields in Patch 791 // requests. 792 NullFields []string `json:"-"` 793} 794 795func (s *Endpoint) MarshalJSON() ([]byte, error) { 796 type NoMethod Endpoint 797 raw := NoMethod(*s) 798 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 799} 800 801// EndpointInfo: For display only. The specification of the endpoints 802// for the test. EndpointInfo is derived from source and destination 803// Endpoint and validated by the backend data plane model. 804type EndpointInfo struct { 805 // DestinationIp: Destination IP address. 806 DestinationIp string `json:"destinationIp,omitempty"` 807 808 // DestinationNetworkUri: URI of the network where this packet is sent 809 // to. 810 DestinationNetworkUri string `json:"destinationNetworkUri,omitempty"` 811 812 // DestinationPort: Destination port. Only valid when protocol is TCP or 813 // UDP. 814 DestinationPort int64 `json:"destinationPort,omitempty"` 815 816 // Protocol: IP protocol in string format, for example: "TCP", "UDP", 817 // "ICMP". 818 Protocol string `json:"protocol,omitempty"` 819 820 // SourceIp: Source IP address. 821 SourceIp string `json:"sourceIp,omitempty"` 822 823 // SourceNetworkUri: URI of the network where this packet originates 824 // from. 825 SourceNetworkUri string `json:"sourceNetworkUri,omitempty"` 826 827 // SourcePort: Source port. Only valid when protocol is TCP or UDP. 828 SourcePort int64 `json:"sourcePort,omitempty"` 829 830 // ForceSendFields is a list of field names (e.g. "DestinationIp") to 831 // unconditionally include in API requests. By default, fields with 832 // empty values are omitted from API requests. However, any non-pointer, 833 // non-interface field appearing in ForceSendFields will be sent to the 834 // server regardless of whether the field is empty or not. This may be 835 // used to include empty fields in Patch requests. 836 ForceSendFields []string `json:"-"` 837 838 // NullFields is a list of field names (e.g. "DestinationIp") to include 839 // in API requests with the JSON null value. By default, fields with 840 // empty values are omitted from API requests. However, any field with 841 // an empty value appearing in NullFields will be sent to the server as 842 // null. It is an error if a field in this list has a non-empty value. 843 // This may be used to include null fields in Patch requests. 844 NullFields []string `json:"-"` 845} 846 847func (s *EndpointInfo) MarshalJSON() ([]byte, error) { 848 type NoMethod EndpointInfo 849 raw := NoMethod(*s) 850 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 851} 852 853// Expr: Represents a textual expression in the Common Expression 854// Language (CEL) syntax. CEL is a C-like expression language. The 855// syntax and semantics of CEL are documented at 856// https://github.com/google/cel-spec. Example (Comparison): title: 857// "Summary size limit" description: "Determines if a summary is less 858// than 100 chars" expression: "document.summary.size() < 100" Example 859// (Equality): title: "Requestor is owner" description: "Determines if 860// requestor is the document owner" expression: "document.owner == 861// request.auth.claims.email" Example (Logic): title: "Public documents" 862// description: "Determine whether the document should be publicly 863// visible" expression: "document.type != 'private' && document.type != 864// 'internal'" Example (Data Manipulation): title: "Notification string" 865// description: "Create a notification string with a timestamp." 866// expression: "'New message received at ' + 867// string(document.create_time)" The exact variables and functions that 868// may be referenced within an expression are determined by the service 869// that evaluates it. See the service documentation for additional 870// information. 871type Expr struct { 872 // Description: Optional. Description of the expression. This is a 873 // longer text which describes the expression, e.g. when hovered over it 874 // in a UI. 875 Description string `json:"description,omitempty"` 876 877 // Expression: Textual representation of an expression in Common 878 // Expression Language syntax. 879 Expression string `json:"expression,omitempty"` 880 881 // Location: Optional. String indicating the location of the expression 882 // for error reporting, e.g. a file name and a position in the file. 883 Location string `json:"location,omitempty"` 884 885 // Title: Optional. Title for the expression, i.e. a short string 886 // describing its purpose. This can be used e.g. in UIs which allow to 887 // enter the expression. 888 Title string `json:"title,omitempty"` 889 890 // ForceSendFields is a list of field names (e.g. "Description") to 891 // unconditionally include in API requests. By default, fields with 892 // empty values are omitted from API requests. However, any non-pointer, 893 // non-interface field appearing in ForceSendFields will be sent to the 894 // server regardless of whether the field is empty or not. This may be 895 // used to include empty fields in Patch requests. 896 ForceSendFields []string `json:"-"` 897 898 // NullFields is a list of field names (e.g. "Description") to include 899 // in API requests with the JSON null value. By default, fields with 900 // empty values are omitted from API requests. However, any field with 901 // an empty value appearing in NullFields will be sent to the server as 902 // null. It is an error if a field in this list has a non-empty value. 903 // This may be used to include null fields in Patch requests. 904 NullFields []string `json:"-"` 905} 906 907func (s *Expr) MarshalJSON() ([]byte, error) { 908 type NoMethod Expr 909 raw := NoMethod(*s) 910 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 911} 912 913// FirewallInfo: For display only. Metadata associated with a Compute 914// Engine firewall rule. 915type FirewallInfo struct { 916 // Action: Possible values: ALLOW, DENY 917 Action string `json:"action,omitempty"` 918 919 // Direction: Possible values: INGRESS, EGRESS 920 Direction string `json:"direction,omitempty"` 921 922 // DisplayName: Name of a Compute Engine firewall rule. 923 DisplayName string `json:"displayName,omitempty"` 924 925 // NetworkUri: URI of a Compute Engine network. 926 NetworkUri string `json:"networkUri,omitempty"` 927 928 // Priority: Priority of the firewall rule. 929 Priority int64 `json:"priority,omitempty"` 930 931 // TargetServiceAccounts: Target service accounts of the firewall rule. 932 TargetServiceAccounts []string `json:"targetServiceAccounts,omitempty"` 933 934 // TargetTags: Target tags of the firewall rule. 935 TargetTags []string `json:"targetTags,omitempty"` 936 937 // Uri: URI of a Compute Engine firewall rule. Implied default rule does 938 // not have URI. 939 Uri string `json:"uri,omitempty"` 940 941 // ForceSendFields is a list of field names (e.g. "Action") to 942 // unconditionally include in API requests. By default, fields with 943 // empty values are omitted from API requests. However, any non-pointer, 944 // non-interface field appearing in ForceSendFields will be sent to the 945 // server regardless of whether the field is empty or not. This may be 946 // used to include empty fields in Patch requests. 947 ForceSendFields []string `json:"-"` 948 949 // NullFields is a list of field names (e.g. "Action") to include in API 950 // requests with the JSON null value. By default, fields with empty 951 // values are omitted from API requests. However, any field with an 952 // empty value appearing in NullFields will be sent to the server as 953 // null. It is an error if a field in this list has a non-empty value. 954 // This may be used to include null fields in Patch requests. 955 NullFields []string `json:"-"` 956} 957 958func (s *FirewallInfo) MarshalJSON() ([]byte, error) { 959 type NoMethod FirewallInfo 960 raw := NoMethod(*s) 961 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 962} 963 964// ForwardInfo: Details of the final state "forward" and associated 965// resource. 966type ForwardInfo struct { 967 // ResourceUri: URI of the resource that the packet is forwarded to. 968 ResourceUri string `json:"resourceUri,omitempty"` 969 970 // Target: Target type where this packet is forwarded to. 971 // 972 // Possible values: 973 // "TARGET_UNSPECIFIED" - Target not specified. 974 // "PEERING_VPC" - Forwarded to a VPC peering network. 975 // "VPN_GATEWAY" - Forwarded to a Cloud VPN gateway. 976 // "INTERCONNECT" - Forwarded to an Cloud Interconnect connection. 977 // "GKE_MASTER" - Forwarded to a Google Kubernetes Engine Container 978 // cluster master. 979 // "IMPORTED_CUSTOM_ROUTE_NEXT_HOP" - Forwarded to the next hop of a 980 // custom route imported from a peering VPC. 981 // "CLOUD_SQL_INSTANCE" - Forwarded to a Cloud SQL Instance. 982 Target string `json:"target,omitempty"` 983 984 // ForceSendFields is a list of field names (e.g. "ResourceUri") to 985 // unconditionally include in API requests. By default, fields with 986 // empty values are omitted from API requests. However, any non-pointer, 987 // non-interface field appearing in ForceSendFields will be sent to the 988 // server regardless of whether the field is empty or not. This may be 989 // used to include empty fields in Patch requests. 990 ForceSendFields []string `json:"-"` 991 992 // NullFields is a list of field names (e.g. "ResourceUri") to include 993 // in API requests with the JSON null value. By default, fields with 994 // empty values are omitted from API requests. However, any field with 995 // an empty value appearing in NullFields will be sent to the server as 996 // null. It is an error if a field in this list has a non-empty value. 997 // This may be used to include null fields in Patch requests. 998 NullFields []string `json:"-"` 999} 1000 1001func (s *ForwardInfo) MarshalJSON() ([]byte, error) { 1002 type NoMethod ForwardInfo 1003 raw := NoMethod(*s) 1004 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1005} 1006 1007// ForwardingRuleInfo: For display only. Metadata associated with a 1008// Compute Engine forwarding rule. 1009type ForwardingRuleInfo struct { 1010 // DisplayName: Name of a Compute Engine forwarding rule. 1011 DisplayName string `json:"displayName,omitempty"` 1012 1013 // MatchedPortRange: Port range defined in the forwarding rule that 1014 // matches the test. 1015 MatchedPortRange string `json:"matchedPortRange,omitempty"` 1016 1017 // MatchedProtocol: Protocol defined in the forwarding rule that matches 1018 // the test. 1019 MatchedProtocol string `json:"matchedProtocol,omitempty"` 1020 1021 // NetworkUri: Network URI. Only valid for Internal Load Balancer. 1022 NetworkUri string `json:"networkUri,omitempty"` 1023 1024 // Target: Target type of the forwarding rule. 1025 Target string `json:"target,omitempty"` 1026 1027 // Uri: URI of a Compute Engine forwarding rule. 1028 Uri string `json:"uri,omitempty"` 1029 1030 // Vip: VIP of the forwarding rule. 1031 Vip string `json:"vip,omitempty"` 1032 1033 // ForceSendFields is a list of field names (e.g. "DisplayName") to 1034 // unconditionally include in API requests. By default, fields with 1035 // empty values are omitted from API requests. However, any non-pointer, 1036 // non-interface field appearing in ForceSendFields will be sent to the 1037 // server regardless of whether the field is empty or not. This may be 1038 // used to include empty fields in Patch requests. 1039 ForceSendFields []string `json:"-"` 1040 1041 // NullFields is a list of field names (e.g. "DisplayName") to include 1042 // in API requests with the JSON null value. By default, fields with 1043 // empty values are omitted from API requests. However, any field with 1044 // an empty value appearing in NullFields will be sent to the server as 1045 // null. It is an error if a field in this list has a non-empty value. 1046 // This may be used to include null fields in Patch requests. 1047 NullFields []string `json:"-"` 1048} 1049 1050func (s *ForwardingRuleInfo) MarshalJSON() ([]byte, error) { 1051 type NoMethod ForwardingRuleInfo 1052 raw := NoMethod(*s) 1053 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1054} 1055 1056// GKEMasterInfo: For display only. Metadata associated with a Google 1057// Kubernetes Engine cluster master. 1058type GKEMasterInfo struct { 1059 // ClusterNetworkUri: URI of a Google Kubernetes Engine cluster network. 1060 ClusterNetworkUri string `json:"clusterNetworkUri,omitempty"` 1061 1062 // ClusterUri: URI of a Google Kubernetes Engine cluster. 1063 ClusterUri string `json:"clusterUri,omitempty"` 1064 1065 // ExternalIp: External IP address of a Google Kubernetes Engine cluster 1066 // master. 1067 ExternalIp string `json:"externalIp,omitempty"` 1068 1069 // InternalIp: Internal IP address of a Google Kubernetes Engine cluster 1070 // master. 1071 InternalIp string `json:"internalIp,omitempty"` 1072 1073 // ForceSendFields is a list of field names (e.g. "ClusterNetworkUri") 1074 // to unconditionally include in API requests. By default, fields with 1075 // empty values are omitted from API requests. However, any non-pointer, 1076 // non-interface field appearing in ForceSendFields will be sent to the 1077 // server regardless of whether the field is empty or not. This may be 1078 // used to include empty fields in Patch requests. 1079 ForceSendFields []string `json:"-"` 1080 1081 // NullFields is a list of field names (e.g. "ClusterNetworkUri") to 1082 // include in API requests with the JSON null value. By default, fields 1083 // with empty values are omitted from API requests. However, any field 1084 // with an empty value appearing in NullFields will be sent to the 1085 // server as null. It is an error if a field in this list has a 1086 // non-empty value. This may be used to include null fields in Patch 1087 // requests. 1088 NullFields []string `json:"-"` 1089} 1090 1091func (s *GKEMasterInfo) MarshalJSON() ([]byte, error) { 1092 type NoMethod GKEMasterInfo 1093 raw := NoMethod(*s) 1094 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1095} 1096 1097// InstanceInfo: For display only. Metadata associated with a Compute 1098// Engine instance. 1099type InstanceInfo struct { 1100 // DisplayName: Name of a Compute Engine instance. 1101 DisplayName string `json:"displayName,omitempty"` 1102 1103 // ExternalIp: External IP address of the network interface. 1104 ExternalIp string `json:"externalIp,omitempty"` 1105 1106 // Interface: Name of the network interface of a Compute Engine 1107 // instance. 1108 Interface string `json:"interface,omitempty"` 1109 1110 // InternalIp: Internal IP address of the network interface. 1111 InternalIp string `json:"internalIp,omitempty"` 1112 1113 // NetworkTags: Network tags configured on the instance. 1114 NetworkTags []string `json:"networkTags,omitempty"` 1115 1116 // NetworkUri: URI of a Compute Engine network. 1117 NetworkUri string `json:"networkUri,omitempty"` 1118 1119 // ServiceAccount: Service account authorized for the instance. 1120 ServiceAccount string `json:"serviceAccount,omitempty"` 1121 1122 // Uri: URI of a Compute Engine instance. 1123 Uri string `json:"uri,omitempty"` 1124 1125 // ForceSendFields is a list of field names (e.g. "DisplayName") to 1126 // unconditionally include in API requests. By default, fields with 1127 // empty values are omitted from API requests. However, any non-pointer, 1128 // non-interface field appearing in ForceSendFields will be sent to the 1129 // server regardless of whether the field is empty or not. This may be 1130 // used to include empty fields in Patch requests. 1131 ForceSendFields []string `json:"-"` 1132 1133 // NullFields is a list of field names (e.g. "DisplayName") to include 1134 // in API requests with the JSON null value. By default, fields with 1135 // empty values are omitted from API requests. However, any field with 1136 // an empty value appearing in NullFields will be sent to the server as 1137 // null. It is an error if a field in this list has a non-empty value. 1138 // This may be used to include null fields in Patch requests. 1139 NullFields []string `json:"-"` 1140} 1141 1142func (s *InstanceInfo) MarshalJSON() ([]byte, error) { 1143 type NoMethod InstanceInfo 1144 raw := NoMethod(*s) 1145 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1146} 1147 1148// LatencyDistribution: Describes measured latency distribution. 1149type LatencyDistribution struct { 1150 // LatencyPercentiles: Representative latency percentiles. 1151 LatencyPercentiles []*LatencyPercentile `json:"latencyPercentiles,omitempty"` 1152 1153 // ForceSendFields is a list of field names (e.g. "LatencyPercentiles") 1154 // to unconditionally include in API requests. By default, fields with 1155 // empty values are omitted from API requests. However, any non-pointer, 1156 // non-interface field appearing in ForceSendFields will be sent to the 1157 // server regardless of whether the field is empty or not. This may be 1158 // used to include empty fields in Patch requests. 1159 ForceSendFields []string `json:"-"` 1160 1161 // NullFields is a list of field names (e.g. "LatencyPercentiles") to 1162 // include in API requests with the JSON null value. By default, fields 1163 // with empty values are omitted from API requests. However, any field 1164 // with an empty value appearing in NullFields will be sent to the 1165 // server as null. It is an error if a field in this list has a 1166 // non-empty value. This may be used to include null fields in Patch 1167 // requests. 1168 NullFields []string `json:"-"` 1169} 1170 1171func (s *LatencyDistribution) MarshalJSON() ([]byte, error) { 1172 type NoMethod LatencyDistribution 1173 raw := NoMethod(*s) 1174 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1175} 1176 1177// LatencyPercentile: Latency percentile rank and value. 1178type LatencyPercentile struct { 1179 // LatencyMicros: percent-th percentile of latency observed, in 1180 // microseconds. Fraction of percent/100 of samples have latency lower 1181 // or equal to the value of this field. 1182 LatencyMicros int64 `json:"latencyMicros,omitempty,string"` 1183 1184 // Percent: Percentage of samples this data point applies to. 1185 Percent int64 `json:"percent,omitempty"` 1186 1187 // ForceSendFields is a list of field names (e.g. "LatencyMicros") to 1188 // unconditionally include in API requests. By default, fields with 1189 // empty values are omitted from API requests. However, any non-pointer, 1190 // non-interface field appearing in ForceSendFields will be sent to the 1191 // server regardless of whether the field is empty or not. This may be 1192 // used to include empty fields in Patch requests. 1193 ForceSendFields []string `json:"-"` 1194 1195 // NullFields is a list of field names (e.g. "LatencyMicros") to include 1196 // in API requests with the JSON null value. By default, fields with 1197 // empty values are omitted from API requests. However, any field with 1198 // an empty value appearing in NullFields will be sent to the server as 1199 // null. It is an error if a field in this list has a non-empty value. 1200 // This may be used to include null fields in Patch requests. 1201 NullFields []string `json:"-"` 1202} 1203 1204func (s *LatencyPercentile) MarshalJSON() ([]byte, error) { 1205 type NoMethod LatencyPercentile 1206 raw := NoMethod(*s) 1207 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1208} 1209 1210// ListConnectivityTestsResponse: Response for the 1211// `ListConnectivityTests` method. 1212type ListConnectivityTestsResponse struct { 1213 // NextPageToken: Page token to fetch the next set of Connectivity 1214 // Tests. 1215 NextPageToken string `json:"nextPageToken,omitempty"` 1216 1217 // Resources: List of Connectivity Tests. 1218 Resources []*ConnectivityTest `json:"resources,omitempty"` 1219 1220 // Unreachable: Locations that could not be reached (when querying all 1221 // locations with `-`). 1222 Unreachable []string `json:"unreachable,omitempty"` 1223 1224 // ServerResponse contains the HTTP response code and headers from the 1225 // server. 1226 googleapi.ServerResponse `json:"-"` 1227 1228 // ForceSendFields is a list of field names (e.g. "NextPageToken") to 1229 // unconditionally include in API requests. By default, fields with 1230 // empty values are omitted from API requests. However, any non-pointer, 1231 // non-interface field appearing in ForceSendFields will be sent to the 1232 // server regardless of whether the field is empty or not. This may be 1233 // used to include empty fields in Patch requests. 1234 ForceSendFields []string `json:"-"` 1235 1236 // NullFields is a list of field names (e.g. "NextPageToken") to include 1237 // in API requests with the JSON null value. By default, fields with 1238 // empty values are omitted from API requests. However, any field with 1239 // an empty value appearing in NullFields will be sent to the server as 1240 // null. It is an error if a field in this list has a non-empty value. 1241 // This may be used to include null fields in Patch requests. 1242 NullFields []string `json:"-"` 1243} 1244 1245func (s *ListConnectivityTestsResponse) MarshalJSON() ([]byte, error) { 1246 type NoMethod ListConnectivityTestsResponse 1247 raw := NoMethod(*s) 1248 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1249} 1250 1251// ListLocationsResponse: The response message for 1252// Locations.ListLocations. 1253type ListLocationsResponse struct { 1254 // Locations: A list of locations that matches the specified filter in 1255 // the request. 1256 Locations []*Location `json:"locations,omitempty"` 1257 1258 // NextPageToken: The standard List next-page token. 1259 NextPageToken string `json:"nextPageToken,omitempty"` 1260 1261 // ServerResponse contains the HTTP response code and headers from the 1262 // server. 1263 googleapi.ServerResponse `json:"-"` 1264 1265 // ForceSendFields is a list of field names (e.g. "Locations") to 1266 // unconditionally include in API requests. By default, fields with 1267 // empty values are omitted from API requests. However, any non-pointer, 1268 // non-interface field appearing in ForceSendFields will be sent to the 1269 // server regardless of whether the field is empty or not. This may be 1270 // used to include empty fields in Patch requests. 1271 ForceSendFields []string `json:"-"` 1272 1273 // NullFields is a list of field names (e.g. "Locations") to include in 1274 // API requests with the JSON null value. By default, fields with empty 1275 // values are omitted from API requests. However, any field with an 1276 // empty value appearing in NullFields will be sent to the server as 1277 // null. It is an error if a field in this list has a non-empty value. 1278 // This may be used to include null fields in Patch requests. 1279 NullFields []string `json:"-"` 1280} 1281 1282func (s *ListLocationsResponse) MarshalJSON() ([]byte, error) { 1283 type NoMethod ListLocationsResponse 1284 raw := NoMethod(*s) 1285 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1286} 1287 1288// ListOperationsResponse: The response message for 1289// Operations.ListOperations. 1290type ListOperationsResponse struct { 1291 // NextPageToken: The standard List next-page token. 1292 NextPageToken string `json:"nextPageToken,omitempty"` 1293 1294 // Operations: A list of operations that matches the specified filter in 1295 // the request. 1296 Operations []*Operation `json:"operations,omitempty"` 1297 1298 // ServerResponse contains the HTTP response code and headers from the 1299 // server. 1300 googleapi.ServerResponse `json:"-"` 1301 1302 // ForceSendFields is a list of field names (e.g. "NextPageToken") to 1303 // unconditionally include in API requests. By default, fields with 1304 // empty values are omitted from API requests. However, any non-pointer, 1305 // non-interface field appearing in ForceSendFields will be sent to the 1306 // server regardless of whether the field is empty or not. This may be 1307 // used to include empty fields in Patch requests. 1308 ForceSendFields []string `json:"-"` 1309 1310 // NullFields is a list of field names (e.g. "NextPageToken") to include 1311 // in API requests with the JSON null value. By default, fields with 1312 // empty values are omitted from API requests. However, any field with 1313 // an empty value appearing in NullFields will be sent to the server as 1314 // null. It is an error if a field in this list has a non-empty value. 1315 // This may be used to include null fields in Patch requests. 1316 NullFields []string `json:"-"` 1317} 1318 1319func (s *ListOperationsResponse) MarshalJSON() ([]byte, error) { 1320 type NoMethod ListOperationsResponse 1321 raw := NoMethod(*s) 1322 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1323} 1324 1325// LoadBalancerBackend: For display only. Metadata associated with a 1326// specific load balancer backend. 1327type LoadBalancerBackend struct { 1328 // DisplayName: Name of a Compute Engine instance or network endpoint. 1329 DisplayName string `json:"displayName,omitempty"` 1330 1331 // HealthCheckAllowingFirewallRules: A list of firewall rule URIs 1332 // allowing probes from health check IP ranges. 1333 HealthCheckAllowingFirewallRules []string `json:"healthCheckAllowingFirewallRules,omitempty"` 1334 1335 // HealthCheckBlockingFirewallRules: A list of firewall rule URIs 1336 // blocking probes from health check IP ranges. 1337 HealthCheckBlockingFirewallRules []string `json:"healthCheckBlockingFirewallRules,omitempty"` 1338 1339 // HealthCheckFirewallState: State of the health check firewall 1340 // configuration. 1341 // 1342 // Possible values: 1343 // "HEALTH_CHECK_FIREWALL_STATE_UNSPECIFIED" - State is unspecified. 1344 // Default state if not populated. 1345 // "CONFIGURED" - There are configured firewall rules to allow health 1346 // check probes to the backend. 1347 // "MISCONFIGURED" - There are firewall rules configured to allow 1348 // partial health check ranges or block all health check ranges. If a 1349 // health check probe is sent from denied IP ranges, the health check to 1350 // the backend will fail. Then, the backend will be marked unhealthy and 1351 // will not receive traffic sent to the load balancer. 1352 HealthCheckFirewallState string `json:"healthCheckFirewallState,omitempty"` 1353 1354 // Uri: URI of a Compute Engine instance or network endpoint. 1355 Uri string `json:"uri,omitempty"` 1356 1357 // ForceSendFields is a list of field names (e.g. "DisplayName") to 1358 // unconditionally include in API requests. By default, fields with 1359 // empty values are omitted from API requests. However, any non-pointer, 1360 // non-interface field appearing in ForceSendFields will be sent to the 1361 // server regardless of whether the field is empty or not. This may be 1362 // used to include empty fields in Patch requests. 1363 ForceSendFields []string `json:"-"` 1364 1365 // NullFields is a list of field names (e.g. "DisplayName") to include 1366 // in API requests with the JSON null value. By default, fields with 1367 // empty values are omitted from API requests. However, any field with 1368 // an empty value appearing in NullFields will be sent to the server as 1369 // null. It is an error if a field in this list has a non-empty value. 1370 // This may be used to include null fields in Patch requests. 1371 NullFields []string `json:"-"` 1372} 1373 1374func (s *LoadBalancerBackend) MarshalJSON() ([]byte, error) { 1375 type NoMethod LoadBalancerBackend 1376 raw := NoMethod(*s) 1377 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1378} 1379 1380// LoadBalancerInfo: For display only. Metadata associated with a load 1381// balancer. 1382type LoadBalancerInfo struct { 1383 // BackendType: Type of load balancer's backend configuration. 1384 // 1385 // Possible values: 1386 // "BACKEND_TYPE_UNSPECIFIED" - Type is unspecified. 1387 // "BACKEND_SERVICE" - Backend Service as the load balancer's backend. 1388 // "TARGET_POOL" - Target Pool as the load balancer's backend. 1389 BackendType string `json:"backendType,omitempty"` 1390 1391 // BackendUri: Backend configuration URI. 1392 BackendUri string `json:"backendUri,omitempty"` 1393 1394 // Backends: Information for the loadbalancer backends. 1395 Backends []*LoadBalancerBackend `json:"backends,omitempty"` 1396 1397 // HealthCheckUri: URI of the health check for the load balancer. 1398 HealthCheckUri string `json:"healthCheckUri,omitempty"` 1399 1400 // LoadBalancerType: Type of the load balancer. 1401 // 1402 // Possible values: 1403 // "LOAD_BALANCER_TYPE_UNSPECIFIED" - Type is unspecified. 1404 // "INTERNAL_TCP_UDP" - Internal TCP/UDP load balancer. 1405 // "NETWORK_TCP_UDP" - Network TCP/UDP load balancer. 1406 // "HTTP_PROXY" - HTTP(S) proxy load balancer. 1407 // "TCP_PROXY" - TCP proxy load balancer. 1408 // "SSL_PROXY" - SSL proxy load balancer. 1409 LoadBalancerType string `json:"loadBalancerType,omitempty"` 1410 1411 // ForceSendFields is a list of field names (e.g. "BackendType") to 1412 // unconditionally include in API requests. By default, fields with 1413 // empty values are omitted from API requests. However, any non-pointer, 1414 // non-interface field appearing in ForceSendFields will be sent to the 1415 // server regardless of whether the field is empty or not. This may be 1416 // used to include empty fields in Patch requests. 1417 ForceSendFields []string `json:"-"` 1418 1419 // NullFields is a list of field names (e.g. "BackendType") to include 1420 // in API requests with the JSON null value. By default, fields with 1421 // empty values are omitted from API requests. However, any field with 1422 // an empty value appearing in NullFields will be sent to the server as 1423 // null. It is an error if a field in this list has a non-empty value. 1424 // This may be used to include null fields in Patch requests. 1425 NullFields []string `json:"-"` 1426} 1427 1428func (s *LoadBalancerInfo) MarshalJSON() ([]byte, error) { 1429 type NoMethod LoadBalancerInfo 1430 raw := NoMethod(*s) 1431 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1432} 1433 1434// Location: A resource that represents Google Cloud Platform location. 1435type Location struct { 1436 // DisplayName: The friendly name for this location, typically a nearby 1437 // city name. For example, "Tokyo". 1438 DisplayName string `json:"displayName,omitempty"` 1439 1440 // Labels: Cross-service attributes for the location. For example 1441 // {"cloud.googleapis.com/region": "us-east1"} 1442 Labels map[string]string `json:"labels,omitempty"` 1443 1444 // LocationId: The canonical id for this location. For example: 1445 // "us-east1". 1446 LocationId string `json:"locationId,omitempty"` 1447 1448 // Metadata: Service-specific metadata. For example the available 1449 // capacity at the given location. 1450 Metadata googleapi.RawMessage `json:"metadata,omitempty"` 1451 1452 // Name: Resource name for the location, which may vary between 1453 // implementations. For example: 1454 // "projects/example-project/locations/us-east1" 1455 Name string `json:"name,omitempty"` 1456 1457 // ServerResponse contains the HTTP response code and headers from the 1458 // server. 1459 googleapi.ServerResponse `json:"-"` 1460 1461 // ForceSendFields is a list of field names (e.g. "DisplayName") to 1462 // unconditionally include in API requests. By default, fields with 1463 // empty values are omitted from API requests. However, any non-pointer, 1464 // non-interface field appearing in ForceSendFields will be sent to the 1465 // server regardless of whether the field is empty or not. This may be 1466 // used to include empty fields in Patch requests. 1467 ForceSendFields []string `json:"-"` 1468 1469 // NullFields is a list of field names (e.g. "DisplayName") to include 1470 // in API requests with the JSON null value. By default, fields with 1471 // empty values are omitted from API requests. However, any field with 1472 // an empty value appearing in NullFields will be sent to the server as 1473 // null. It is an error if a field in this list has a non-empty value. 1474 // This may be used to include null fields in Patch requests. 1475 NullFields []string `json:"-"` 1476} 1477 1478func (s *Location) MarshalJSON() ([]byte, error) { 1479 type NoMethod Location 1480 raw := NoMethod(*s) 1481 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1482} 1483 1484// NetworkInfo: For display only. Metadata associated with a Compute 1485// Engine network. 1486type NetworkInfo struct { 1487 // DisplayName: Name of a Compute Engine network. 1488 DisplayName string `json:"displayName,omitempty"` 1489 1490 // MatchedIpRange: The IP range that matches the test. 1491 MatchedIpRange string `json:"matchedIpRange,omitempty"` 1492 1493 // Uri: URI of a Compute Engine network. 1494 Uri string `json:"uri,omitempty"` 1495 1496 // ForceSendFields is a list of field names (e.g. "DisplayName") to 1497 // unconditionally include in API requests. By default, fields with 1498 // empty values are omitted from API requests. However, any non-pointer, 1499 // non-interface field appearing in ForceSendFields will be sent to the 1500 // server regardless of whether the field is empty or not. This may be 1501 // used to include empty fields in Patch requests. 1502 ForceSendFields []string `json:"-"` 1503 1504 // NullFields is a list of field names (e.g. "DisplayName") to include 1505 // in API requests with the JSON null value. By default, fields with 1506 // empty values are omitted from API requests. However, any field with 1507 // an empty value appearing in NullFields will be sent to the server as 1508 // null. It is an error if a field in this list has a non-empty value. 1509 // This may be used to include null fields in Patch requests. 1510 NullFields []string `json:"-"` 1511} 1512 1513func (s *NetworkInfo) MarshalJSON() ([]byte, error) { 1514 type NoMethod NetworkInfo 1515 raw := NoMethod(*s) 1516 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1517} 1518 1519// Operation: This resource represents a long-running operation that is 1520// the result of a network API call. 1521type Operation struct { 1522 // Done: If the value is `false`, it means the operation is still in 1523 // progress. If `true`, the operation is completed, and either `error` 1524 // or `response` is available. 1525 Done bool `json:"done,omitempty"` 1526 1527 // Error: The error result of the operation in case of failure or 1528 // cancellation. 1529 Error *Status `json:"error,omitempty"` 1530 1531 // Metadata: Service-specific metadata associated with the operation. It 1532 // typically contains progress information and common metadata such as 1533 // create time. Some services might not provide such metadata. Any 1534 // method that returns a long-running operation should document the 1535 // metadata type, if any. 1536 Metadata googleapi.RawMessage `json:"metadata,omitempty"` 1537 1538 // Name: The server-assigned name, which is only unique within the same 1539 // service that originally returns it. If you use the default HTTP 1540 // mapping, the `name` should be a resource name ending with 1541 // `operations/{unique_id}`. 1542 Name string `json:"name,omitempty"` 1543 1544 // Response: The normal response of the operation in case of success. If 1545 // the original method returns no data on success, such as `Delete`, the 1546 // response is `google.protobuf.Empty`. If the original method is 1547 // standard `Get`/`Create`/`Update`, the response should be the 1548 // resource. For other methods, the response should have the type 1549 // `XxxResponse`, where `Xxx` is the original method name. For example, 1550 // if the original method name is `TakeSnapshot()`, the inferred 1551 // response type is `TakeSnapshotResponse`. 1552 Response googleapi.RawMessage `json:"response,omitempty"` 1553 1554 // ServerResponse contains the HTTP response code and headers from the 1555 // server. 1556 googleapi.ServerResponse `json:"-"` 1557 1558 // ForceSendFields is a list of field names (e.g. "Done") to 1559 // unconditionally include in API requests. By default, fields with 1560 // empty values are omitted from API requests. However, any non-pointer, 1561 // non-interface field appearing in ForceSendFields will be sent to the 1562 // server regardless of whether the field is empty or not. This may be 1563 // used to include empty fields in Patch requests. 1564 ForceSendFields []string `json:"-"` 1565 1566 // NullFields is a list of field names (e.g. "Done") to include in API 1567 // requests with the JSON null value. By default, fields with empty 1568 // values are omitted from API requests. However, any field with an 1569 // empty value appearing in NullFields will be sent to the server as 1570 // null. It is an error if a field in this list has a non-empty value. 1571 // This may be used to include null fields in Patch requests. 1572 NullFields []string `json:"-"` 1573} 1574 1575func (s *Operation) MarshalJSON() ([]byte, error) { 1576 type NoMethod Operation 1577 raw := NoMethod(*s) 1578 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1579} 1580 1581// OperationMetadata: Metadata describing an Operation 1582type OperationMetadata struct { 1583 // ApiVersion: API version. 1584 ApiVersion string `json:"apiVersion,omitempty"` 1585 1586 // CancelRequested: Specifies if cancellation was requested for the 1587 // operation. 1588 CancelRequested bool `json:"cancelRequested,omitempty"` 1589 1590 // CreateTime: The time the operation was created. 1591 CreateTime string `json:"createTime,omitempty"` 1592 1593 // EndTime: The time the operation finished running. 1594 EndTime string `json:"endTime,omitempty"` 1595 1596 // StatusDetail: Human-readable status of the operation, if any. 1597 StatusDetail string `json:"statusDetail,omitempty"` 1598 1599 // Target: Target of the operation - for example 1600 // projects/project-1/locations/global/connectivityTests/test-1 1601 Target string `json:"target,omitempty"` 1602 1603 // Verb: Name of the verb executed by the operation. 1604 Verb string `json:"verb,omitempty"` 1605 1606 // ForceSendFields is a list of field names (e.g. "ApiVersion") to 1607 // unconditionally include in API requests. By default, fields with 1608 // empty values are omitted from API requests. However, any non-pointer, 1609 // non-interface field appearing in ForceSendFields will be sent to the 1610 // server regardless of whether the field is empty or not. This may be 1611 // used to include empty fields in Patch requests. 1612 ForceSendFields []string `json:"-"` 1613 1614 // NullFields is a list of field names (e.g. "ApiVersion") to include in 1615 // API requests with the JSON null value. By default, fields with empty 1616 // values are omitted from API requests. However, any field with an 1617 // empty value appearing in NullFields will be sent to the server as 1618 // null. It is an error if a field in this list has a non-empty value. 1619 // This may be used to include null fields in Patch requests. 1620 NullFields []string `json:"-"` 1621} 1622 1623func (s *OperationMetadata) MarshalJSON() ([]byte, error) { 1624 type NoMethod OperationMetadata 1625 raw := NoMethod(*s) 1626 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1627} 1628 1629// Policy: An Identity and Access Management (IAM) policy, which 1630// specifies access controls for Google Cloud resources. A `Policy` is a 1631// collection of `bindings`. A `binding` binds one or more `members` to 1632// a single `role`. Members can be user accounts, service accounts, 1633// Google groups, and domains (such as G Suite). A `role` is a named 1634// list of permissions; each `role` can be an IAM predefined role or a 1635// user-created custom role. For some types of Google Cloud resources, a 1636// `binding` can also specify a `condition`, which is a logical 1637// expression that allows access to a resource only if the expression 1638// evaluates to `true`. A condition can add constraints based on 1639// attributes of the request, the resource, or both. To learn which 1640// resources support conditions in their IAM policies, see the [IAM 1641// documentation](https://cloud.google.com/iam/help/conditions/resource-p 1642// olicies). **JSON example:** { "bindings": [ { "role": 1643// "roles/resourcemanager.organizationAdmin", "members": [ 1644// "user:mike@example.com", "group:admins@example.com", 1645// "domain:google.com", 1646// "serviceAccount:my-project-id@appspot.gserviceaccount.com" ] }, { 1647// "role": "roles/resourcemanager.organizationViewer", "members": [ 1648// "user:eve@example.com" ], "condition": { "title": "expirable access", 1649// "description": "Does not grant access after Sep 2020", "expression": 1650// "request.time < timestamp('2020-10-01T00:00:00.000Z')", } } ], 1651// "etag": "BwWWja0YfJA=", "version": 3 } **YAML example:** bindings: - 1652// members: - user:mike@example.com - group:admins@example.com - 1653// domain:google.com - 1654// serviceAccount:my-project-id@appspot.gserviceaccount.com role: 1655// roles/resourcemanager.organizationAdmin - members: - 1656// user:eve@example.com role: roles/resourcemanager.organizationViewer 1657// condition: title: expirable access description: Does not grant access 1658// after Sep 2020 expression: request.time < 1659// timestamp('2020-10-01T00:00:00.000Z') - etag: BwWWja0YfJA= - version: 1660// 3 For a description of IAM and its features, see the [IAM 1661// documentation](https://cloud.google.com/iam/docs/). 1662type Policy struct { 1663 // AuditConfigs: Specifies cloud audit logging configuration for this 1664 // policy. 1665 AuditConfigs []*AuditConfig `json:"auditConfigs,omitempty"` 1666 1667 // Bindings: Associates a list of `members` to a `role`. Optionally, may 1668 // specify a `condition` that determines how and when the `bindings` are 1669 // applied. Each of the `bindings` must contain at least one member. 1670 Bindings []*Binding `json:"bindings,omitempty"` 1671 1672 // Etag: `etag` is used for optimistic concurrency control as a way to 1673 // help prevent simultaneous updates of a policy from overwriting each 1674 // other. It is strongly suggested that systems make use of the `etag` 1675 // in the read-modify-write cycle to perform policy updates in order to 1676 // avoid race conditions: An `etag` is returned in the response to 1677 // `getIamPolicy`, and systems are expected to put that etag in the 1678 // request to `setIamPolicy` to ensure that their change will be applied 1679 // to the same version of the policy. **Important:** If you use IAM 1680 // Conditions, you must include the `etag` field whenever you call 1681 // `setIamPolicy`. If you omit this field, then IAM allows you to 1682 // overwrite a version `3` policy with a version `1` policy, and all of 1683 // the conditions in the version `3` policy are lost. 1684 Etag string `json:"etag,omitempty"` 1685 1686 // Version: Specifies the format of the policy. Valid values are `0`, 1687 // `1`, and `3`. Requests that specify an invalid value are rejected. 1688 // Any operation that affects conditional role bindings must specify 1689 // version `3`. This requirement applies to the following operations: * 1690 // Getting a policy that includes a conditional role binding * Adding a 1691 // conditional role binding to a policy * Changing a conditional role 1692 // binding in a policy * Removing any role binding, with or without a 1693 // condition, from a policy that includes conditions **Important:** If 1694 // you use IAM Conditions, you must include the `etag` field whenever 1695 // you call `setIamPolicy`. If you omit this field, then IAM allows you 1696 // to overwrite a version `3` policy with a version `1` policy, and all 1697 // of the conditions in the version `3` policy are lost. If a policy 1698 // does not include any conditions, operations on that policy may 1699 // specify any valid version or leave the field unset. To learn which 1700 // resources support conditions in their IAM policies, see the [IAM 1701 // documentation](https://cloud.google.com/iam/help/conditions/resource-p 1702 // olicies). 1703 Version int64 `json:"version,omitempty"` 1704 1705 // ServerResponse contains the HTTP response code and headers from the 1706 // server. 1707 googleapi.ServerResponse `json:"-"` 1708 1709 // ForceSendFields is a list of field names (e.g. "AuditConfigs") to 1710 // unconditionally include in API requests. By default, fields with 1711 // empty values are omitted from API requests. However, any non-pointer, 1712 // non-interface field appearing in ForceSendFields will be sent to the 1713 // server regardless of whether the field is empty or not. This may be 1714 // used to include empty fields in Patch requests. 1715 ForceSendFields []string `json:"-"` 1716 1717 // NullFields is a list of field names (e.g. "AuditConfigs") to include 1718 // in API requests with the JSON null value. By default, fields with 1719 // empty values are omitted from API requests. However, any field with 1720 // an empty value appearing in NullFields will be sent to the server as 1721 // null. It is an error if a field in this list has a non-empty value. 1722 // This may be used to include null fields in Patch requests. 1723 NullFields []string `json:"-"` 1724} 1725 1726func (s *Policy) MarshalJSON() ([]byte, error) { 1727 type NoMethod Policy 1728 raw := NoMethod(*s) 1729 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1730} 1731 1732// ProbingDetails: The details of probing from the latest run. 1733type ProbingDetails struct { 1734 // AbortCause: Causes that the probing was aborted. 1735 // 1736 // Possible values: 1737 // "PROBING_ABORT_CAUSE_UNSPECIFIED" - Abort reason unspecified. 1738 // "PERMISSION_DENIED" - Aborted because the user lacks the permission 1739 // to access all or part of the network configurations required to run 1740 // the test. 1741 // "NO_SOURCE_LOCATION" - Aborted because no valid source endpoint is 1742 // derived from the input test request. 1743 AbortCause string `json:"abortCause,omitempty"` 1744 1745 // EndpointInfo: Derived from the test input. The actual source and 1746 // destination endpoint where the probing was run. 1747 EndpointInfo *EndpointInfo `json:"endpointInfo,omitempty"` 1748 1749 // Error: The details of an internal failure or a cancellation of 1750 // reachability analysis. 1751 Error *Status `json:"error,omitempty"` 1752 1753 // ProbingLatency: One way probing latency distribution. The latency is 1754 // measured as duration of packet traversal of Google Cloud network, 1755 // from source to destination endpoint. 1756 ProbingLatency *LatencyDistribution `json:"probingLatency,omitempty"` 1757 1758 // Result: The overall reachability result of the test. 1759 // 1760 // Possible values: 1761 // "PROBING_RESULT_UNSPECIFIED" - Result is not specified. 1762 // "REACHABLE" - 95% or more packets originating from source reached 1763 // destination. 1764 // "UNREACHABLE" - No packet originating from source reached 1765 // destination. 1766 // "REACHABILITY_INCONSISTENT" - Less than 95% packets originating 1767 // from source reached destination. 1768 // "UNDETERMINED" - The reachability could not be determined. Possible 1769 // reasons are: * Analysis is aborted due to permission error. User does 1770 // not have read permission to the projects listed in the test. * 1771 // Analysis is aborted due to internal errors. 1772 Result string `json:"result,omitempty"` 1773 1774 // SentProbeCount: Number of probes sent. 1775 SentProbeCount int64 `json:"sentProbeCount,omitempty"` 1776 1777 // SuccessfulProbeCount: Number of probes that reached destination. 1778 SuccessfulProbeCount int64 `json:"successfulProbeCount,omitempty"` 1779 1780 // VerifyTime: The time the reachability state was verified. 1781 VerifyTime string `json:"verifyTime,omitempty"` 1782 1783 // ForceSendFields is a list of field names (e.g. "AbortCause") to 1784 // unconditionally include in API requests. By default, fields with 1785 // empty values are omitted from API requests. However, any non-pointer, 1786 // non-interface field appearing in ForceSendFields will be sent to the 1787 // server regardless of whether the field is empty or not. This may be 1788 // used to include empty fields in Patch requests. 1789 ForceSendFields []string `json:"-"` 1790 1791 // NullFields is a list of field names (e.g. "AbortCause") to include in 1792 // API requests with the JSON null value. By default, fields with empty 1793 // values are omitted from API requests. However, any field with an 1794 // empty value appearing in NullFields will be sent to the server as 1795 // null. It is an error if a field in this list has a non-empty value. 1796 // This may be used to include null fields in Patch requests. 1797 NullFields []string `json:"-"` 1798} 1799 1800func (s *ProbingDetails) MarshalJSON() ([]byte, error) { 1801 type NoMethod ProbingDetails 1802 raw := NoMethod(*s) 1803 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1804} 1805 1806// ReachabilityDetails: The details of reachability state from the 1807// latest run. 1808type ReachabilityDetails struct { 1809 // Error: The details of a failure or a cancellation of reachability 1810 // analysis. 1811 Error *Status `json:"error,omitempty"` 1812 1813 // Result: The overall reachability result of the test. 1814 // 1815 // Possible values: 1816 // "RESULT_UNSPECIFIED" - Result is not specified. 1817 // "REACHABLE" - Packet originating from source is expected to reach 1818 // destination. 1819 // "UNREACHABLE" - Packet originating from source is expected to be 1820 // dropped before reaching destination. 1821 // "AMBIGUOUS" - If the source and destination endpoint does not 1822 // uniquely identify the test location in the network, and the 1823 // reachability result contains multiple traces with mixed reachable and 1824 // unreachable states, then this result is returned. 1825 // "UNDETERMINED" - The reachability could not be determined. Possible 1826 // reasons are: * Analysis is aborted due to permission error. User does 1827 // not have read permission to the projects listed in the test. * 1828 // Analysis is aborted due to internal errors. * Analysis is partially 1829 // complete based on configurations where the user has permission. The 1830 // Final state indicates that the packet is forwarded to another network 1831 // where the user has no permission to access the configurations. 1832 Result string `json:"result,omitempty"` 1833 1834 // Traces: Result may contain a list of traces if a test has multiple 1835 // possible paths in the network, such as when destination endpoint is a 1836 // load balancer with multiple backends. 1837 Traces []*Trace `json:"traces,omitempty"` 1838 1839 // VerifyTime: The time the reachability state was verified. 1840 VerifyTime string `json:"verifyTime,omitempty"` 1841 1842 // ForceSendFields is a list of field names (e.g. "Error") to 1843 // unconditionally include in API requests. By default, fields with 1844 // empty values are omitted from API requests. However, any non-pointer, 1845 // non-interface field appearing in ForceSendFields will be sent to the 1846 // server regardless of whether the field is empty or not. This may be 1847 // used to include empty fields in Patch requests. 1848 ForceSendFields []string `json:"-"` 1849 1850 // NullFields is a list of field names (e.g. "Error") to include in API 1851 // requests with the JSON null value. By default, fields with empty 1852 // values are omitted from API requests. However, any field with an 1853 // empty value appearing in NullFields will be sent to the server as 1854 // null. It is an error if a field in this list has a non-empty value. 1855 // This may be used to include null fields in Patch requests. 1856 NullFields []string `json:"-"` 1857} 1858 1859func (s *ReachabilityDetails) MarshalJSON() ([]byte, error) { 1860 type NoMethod ReachabilityDetails 1861 raw := NoMethod(*s) 1862 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1863} 1864 1865// RerunConnectivityTestRequest: Request for the `RerunConnectivityTest` 1866// method. 1867type RerunConnectivityTestRequest struct { 1868} 1869 1870// RouteInfo: For display only. Metadata associated with a Compute 1871// Engine route. 1872type RouteInfo struct { 1873 // DestIpRange: Destination IP range of the route. 1874 DestIpRange string `json:"destIpRange,omitempty"` 1875 1876 // DisplayName: Name of a Compute Engine route. 1877 DisplayName string `json:"displayName,omitempty"` 1878 1879 // InstanceTags: Instance tags of the route. 1880 InstanceTags []string `json:"instanceTags,omitempty"` 1881 1882 // NetworkUri: URI of a Compute Engine network. 1883 NetworkUri string `json:"networkUri,omitempty"` 1884 1885 // NextHop: Next hop of the route. 1886 NextHop string `json:"nextHop,omitempty"` 1887 1888 // NextHopType: Type of next hop. 1889 // 1890 // Possible values: 1891 // "NEXT_HOP_TYPE_UNSPECIFIED" - Unspecified type. Default value. 1892 // "NEXT_HOP_IP" - Next hop is an IP address. 1893 // "NEXT_HOP_INSTANCE" - Next hop is a Compute Engine instance. 1894 // "NEXT_HOP_NETWORK" - Next hop is a VPC network gateway. 1895 // "NEXT_HOP_PEERING" - Next hop is a peering VPC. 1896 // "NEXT_HOP_INTERCONNECT" - Next hop is an interconnect. 1897 // "NEXT_HOP_VPN_TUNNEL" - Next hop is a VPN tunnel. 1898 // "NEXT_HOP_VPN_GATEWAY" - Next hop is a VPN Gateway. This scenario 1899 // only happens when tracing connectivity from an on-premises network to 1900 // GCP through a VPN. The analysis simulates a packet departing from the 1901 // on-premises network through a VPN tunnel and arrives at a Cloud VPN 1902 // gateway. 1903 // "NEXT_HOP_INTERNET_GATEWAY" - Next hop is an internet gateway. 1904 // "NEXT_HOP_BLACKHOLE" - Next hop is blackhole; that is, the next hop 1905 // either does not exist or is not running. 1906 // "NEXT_HOP_ILB" - Next hop is the forwarding rule of an Internal 1907 // Load Balancer. 1908 NextHopType string `json:"nextHopType,omitempty"` 1909 1910 // Priority: Priority of the route. 1911 Priority int64 `json:"priority,omitempty"` 1912 1913 // RouteType: Type of route. 1914 // 1915 // Possible values: 1916 // "ROUTE_TYPE_UNSPECIFIED" - Unspecified type. Default value. 1917 // "SUBNET" - Route is a subnet route automatically created by the 1918 // system. 1919 // "STATIC" - Static route created by the user including the default 1920 // route to the Internet. 1921 // "DYNAMIC" - Dynamic route exchanged between BGP peers. 1922 // "PEERING_SUBNET" - A subnet route received from peering network. 1923 // "PEERING_STATIC" - A static route received from peering network. 1924 // "PEERING_DYNAMIC" - A dynamic route received from peering network. 1925 RouteType string `json:"routeType,omitempty"` 1926 1927 // Uri: URI of a Compute Engine route. Dynamic route from cloud router 1928 // does not have a URI. Advertised route from Google Cloud VPC to 1929 // on-premises network also does not have a URI. 1930 Uri string `json:"uri,omitempty"` 1931 1932 // ForceSendFields is a list of field names (e.g. "DestIpRange") to 1933 // unconditionally include in API requests. By default, fields with 1934 // empty values are omitted from API requests. However, any non-pointer, 1935 // non-interface field appearing in ForceSendFields will be sent to the 1936 // server regardless of whether the field is empty or not. This may be 1937 // used to include empty fields in Patch requests. 1938 ForceSendFields []string `json:"-"` 1939 1940 // NullFields is a list of field names (e.g. "DestIpRange") to include 1941 // in API requests with the JSON null value. By default, fields with 1942 // empty values are omitted from API requests. However, any field with 1943 // an empty value appearing in NullFields will be sent to the server as 1944 // null. It is an error if a field in this list has a non-empty value. 1945 // This may be used to include null fields in Patch requests. 1946 NullFields []string `json:"-"` 1947} 1948 1949func (s *RouteInfo) MarshalJSON() ([]byte, error) { 1950 type NoMethod RouteInfo 1951 raw := NoMethod(*s) 1952 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1953} 1954 1955// SetIamPolicyRequest: Request message for `SetIamPolicy` method. 1956type SetIamPolicyRequest struct { 1957 // Policy: REQUIRED: The complete policy to be applied to the 1958 // `resource`. The size of the policy is limited to a few 10s of KB. An 1959 // empty policy is a valid policy but certain Cloud Platform services 1960 // (such as Projects) might reject them. 1961 Policy *Policy `json:"policy,omitempty"` 1962 1963 // UpdateMask: OPTIONAL: A FieldMask specifying which fields of the 1964 // policy to modify. Only the fields in the mask will be modified. If no 1965 // mask is provided, the following default mask is used: `paths: 1966 // "bindings, etag" 1967 UpdateMask string `json:"updateMask,omitempty"` 1968 1969 // ForceSendFields is a list of field names (e.g. "Policy") to 1970 // unconditionally include in API requests. By default, fields with 1971 // empty values are omitted from API requests. However, any non-pointer, 1972 // non-interface field appearing in ForceSendFields will be sent to the 1973 // server regardless of whether the field is empty or not. This may be 1974 // used to include empty fields in Patch requests. 1975 ForceSendFields []string `json:"-"` 1976 1977 // NullFields is a list of field names (e.g. "Policy") to include in API 1978 // requests with the JSON null value. By default, fields with empty 1979 // values are omitted from API requests. However, any field with an 1980 // empty value appearing in NullFields will be sent to the server as 1981 // null. It is an error if a field in this list has a non-empty value. 1982 // This may be used to include null fields in Patch requests. 1983 NullFields []string `json:"-"` 1984} 1985 1986func (s *SetIamPolicyRequest) MarshalJSON() ([]byte, error) { 1987 type NoMethod SetIamPolicyRequest 1988 raw := NoMethod(*s) 1989 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1990} 1991 1992// Status: The `Status` type defines a logical error model that is 1993// suitable for different programming environments, including REST APIs 1994// and RPC APIs. It is used by [gRPC](https://github.com/grpc). Each 1995// `Status` message contains three pieces of data: error code, error 1996// message, and error details. You can find out more about this error 1997// model and how to work with it in the [API Design 1998// Guide](https://cloud.google.com/apis/design/errors). 1999type Status struct { 2000 // Code: The status code, which should be an enum value of 2001 // google.rpc.Code. 2002 Code int64 `json:"code,omitempty"` 2003 2004 // Details: A list of messages that carry the error details. There is a 2005 // common set of message types for APIs to use. 2006 Details []googleapi.RawMessage `json:"details,omitempty"` 2007 2008 // Message: A developer-facing error message, which should be in 2009 // English. Any user-facing error message should be localized and sent 2010 // in the google.rpc.Status.details field, or localized by the client. 2011 Message string `json:"message,omitempty"` 2012 2013 // ForceSendFields is a list of field names (e.g. "Code") to 2014 // unconditionally include in API requests. By default, fields with 2015 // empty values are omitted from API requests. However, any non-pointer, 2016 // non-interface field appearing in ForceSendFields will be sent to the 2017 // server regardless of whether the field is empty or not. This may be 2018 // used to include empty fields in Patch requests. 2019 ForceSendFields []string `json:"-"` 2020 2021 // NullFields is a list of field names (e.g. "Code") to include in API 2022 // requests with the JSON null value. By default, fields with empty 2023 // values are omitted from API requests. However, any field with an 2024 // empty value appearing in NullFields will be sent to the server as 2025 // null. It is an error if a field in this list has a non-empty value. 2026 // This may be used to include null fields in Patch requests. 2027 NullFields []string `json:"-"` 2028} 2029 2030func (s *Status) MarshalJSON() ([]byte, error) { 2031 type NoMethod Status 2032 raw := NoMethod(*s) 2033 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2034} 2035 2036// Step: A simulated forwarding path is composed of multiple steps. Each 2037// step has a well-defined state and an associated configuration. 2038type Step struct { 2039 // Abort: Display info of the final state "abort" and reason. 2040 Abort *AbortInfo `json:"abort,omitempty"` 2041 2042 // CausesDrop: This is a step that leads to the final state Drop. 2043 CausesDrop bool `json:"causesDrop,omitempty"` 2044 2045 // CloudSqlInstance: Display info of a Cloud SQL instance. 2046 CloudSqlInstance *CloudSQLInstanceInfo `json:"cloudSqlInstance,omitempty"` 2047 2048 // Deliver: Display info of the final state "deliver" and reason. 2049 Deliver *DeliverInfo `json:"deliver,omitempty"` 2050 2051 // Description: A description of the step. Usually this is a summary of 2052 // the state. 2053 Description string `json:"description,omitempty"` 2054 2055 // Drop: Display info of the final state "drop" and reason. 2056 Drop *DropInfo `json:"drop,omitempty"` 2057 2058 // Endpoint: Display info of the source and destination under analysis. 2059 // The endpiont info in an intermediate state may differ with the 2060 // initial input, as it might be modified by state like NAT, or 2061 // Connection Proxy. 2062 Endpoint *EndpointInfo `json:"endpoint,omitempty"` 2063 2064 // Firewall: Display info of a Compute Engine firewall rule. 2065 Firewall *FirewallInfo `json:"firewall,omitempty"` 2066 2067 // Forward: Display info of the final state "forward" and reason. 2068 Forward *ForwardInfo `json:"forward,omitempty"` 2069 2070 // ForwardingRule: Display info of a Compute Engine forwarding rule. 2071 ForwardingRule *ForwardingRuleInfo `json:"forwardingRule,omitempty"` 2072 2073 // GkeMaster: Display info of a Google Kubernetes Engine cluster master. 2074 GkeMaster *GKEMasterInfo `json:"gkeMaster,omitempty"` 2075 2076 // Instance: Display info of a Compute Engine instance. 2077 Instance *InstanceInfo `json:"instance,omitempty"` 2078 2079 // LoadBalancer: Display info of the load balancers. 2080 LoadBalancer *LoadBalancerInfo `json:"loadBalancer,omitempty"` 2081 2082 // Network: Display info of a GCP network. 2083 Network *NetworkInfo `json:"network,omitempty"` 2084 2085 // ProjectId: Project ID that contains the configuration this step is 2086 // validating. 2087 ProjectId string `json:"projectId,omitempty"` 2088 2089 // Route: Display info of a Compute Engine route. 2090 Route *RouteInfo `json:"route,omitempty"` 2091 2092 // State: Each step is in one of the pre-defined states. 2093 // 2094 // Possible values: 2095 // "STATE_UNSPECIFIED" - Unspecified state. 2096 // "START_FROM_INSTANCE" - Initial state: packet originating from a 2097 // Compute Engine instance. An InstanceInfo will be populated with 2098 // starting instance info. 2099 // "START_FROM_INTERNET" - Initial state: packet originating from 2100 // Internet. The endpoint info will be populated. 2101 // "START_FROM_PRIVATE_NETWORK" - Initial state: packet originating 2102 // from a VPC or on-premises network with internal source IP. If the 2103 // source is a VPC network visible to the user, a NetworkInfo will be 2104 // populated with details of the network. 2105 // "START_FROM_GKE_MASTER" - Initial state: packet originating from a 2106 // Google Kubernetes Engine cluster master. A GKEMasterInfo will be 2107 // populated with starting instance info. 2108 // "START_FROM_CLOUD_SQL_INSTANCE" - Initial state: packet originating 2109 // from a Cloud SQL instance. A CloudSQLInstanceInfo will be populated 2110 // with starting instance info. 2111 // "APPLY_INGRESS_FIREWALL_RULE" - Config checking state: verify 2112 // ingress firewall rule. 2113 // "APPLY_EGRESS_FIREWALL_RULE" - Config checking state: verify egress 2114 // firewall rule. 2115 // "APPLY_ROUTE" - Config checking state: verify route. 2116 // "APPLY_FORWARDING_RULE" - Config checking state: match forwarding 2117 // rule. 2118 // "SPOOFING_APPROVED" - Config checking state: packet sent or 2119 // received under foreign IP address and allowed. 2120 // "ARRIVE_AT_INSTANCE" - Forwarding state: arriving at a Compute 2121 // Engine instance. 2122 // "ARRIVE_AT_INTERNAL_LOAD_BALANCER" - Forwarding state: arriving at 2123 // a Compute Engine internal load balancer. 2124 // "ARRIVE_AT_EXTERNAL_LOAD_BALANCER" - Forwarding state: arriving at 2125 // a Compute Engine external load balancer. 2126 // "ARRIVE_AT_VPN_GATEWAY" - Forwarding state: arriving at a Cloud VPN 2127 // gateway. 2128 // "ARRIVE_AT_VPN_TUNNEL" - Forwarding state: arriving at a Cloud VPN 2129 // tunnel. 2130 // "NAT" - Transition state: packet header translated. 2131 // "PROXY_CONNECTION" - Transition state: original connection is 2132 // terminated and a new proxied connection is initiated. 2133 // "DELIVER" - Final state: packet delivered. 2134 // "DROP" - Final state: packet dropped. 2135 // "FORWARD" - Final state: packet forwarded to a network with an 2136 // unknown configuration. 2137 // "ABORT" - Final state: analysis is aborted. 2138 // "VIEWER_PERMISSION_MISSING" - Special state: viewer of the test 2139 // result does not have permission to see the configuration in this 2140 // step. 2141 State string `json:"state,omitempty"` 2142 2143 // VpnGateway: Display info of a Compute Engine VPN gateway. 2144 VpnGateway *VpnGatewayInfo `json:"vpnGateway,omitempty"` 2145 2146 // VpnTunnel: Display info of a Compute Engine VPN tunnel. 2147 VpnTunnel *VpnTunnelInfo `json:"vpnTunnel,omitempty"` 2148 2149 // ForceSendFields is a list of field names (e.g. "Abort") to 2150 // unconditionally include in API requests. By default, fields with 2151 // empty values are omitted from API requests. However, any non-pointer, 2152 // non-interface field appearing in ForceSendFields will be sent to the 2153 // server regardless of whether the field is empty or not. This may be 2154 // used to include empty fields in Patch requests. 2155 ForceSendFields []string `json:"-"` 2156 2157 // NullFields is a list of field names (e.g. "Abort") to include in API 2158 // requests with the JSON null value. By default, fields with empty 2159 // values are omitted from API requests. However, any field with an 2160 // empty value appearing in NullFields will be sent to the server as 2161 // null. It is an error if a field in this list has a non-empty value. 2162 // This may be used to include null fields in Patch requests. 2163 NullFields []string `json:"-"` 2164} 2165 2166func (s *Step) MarshalJSON() ([]byte, error) { 2167 type NoMethod Step 2168 raw := NoMethod(*s) 2169 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2170} 2171 2172// TestIamPermissionsRequest: Request message for `TestIamPermissions` 2173// method. 2174type TestIamPermissionsRequest struct { 2175 // Permissions: The set of permissions to check for the `resource`. 2176 // Permissions with wildcards (such as '*' or 'storage.*') are not 2177 // allowed. For more information see [IAM 2178 // Overview](https://cloud.google.com/iam/docs/overview#permissions). 2179 Permissions []string `json:"permissions,omitempty"` 2180 2181 // ForceSendFields is a list of field names (e.g. "Permissions") to 2182 // unconditionally include in API requests. By default, fields with 2183 // empty values are omitted from API requests. However, any non-pointer, 2184 // non-interface field appearing in ForceSendFields will be sent to the 2185 // server regardless of whether the field is empty or not. This may be 2186 // used to include empty fields in Patch requests. 2187 ForceSendFields []string `json:"-"` 2188 2189 // NullFields is a list of field names (e.g. "Permissions") to include 2190 // in API requests with the JSON null value. By default, fields with 2191 // empty values are omitted from API requests. However, any field with 2192 // an empty value appearing in NullFields will be sent to the server as 2193 // null. It is an error if a field in this list has a non-empty value. 2194 // This may be used to include null fields in Patch requests. 2195 NullFields []string `json:"-"` 2196} 2197 2198func (s *TestIamPermissionsRequest) MarshalJSON() ([]byte, error) { 2199 type NoMethod TestIamPermissionsRequest 2200 raw := NoMethod(*s) 2201 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2202} 2203 2204// TestIamPermissionsResponse: Response message for `TestIamPermissions` 2205// method. 2206type TestIamPermissionsResponse struct { 2207 // Permissions: A subset of `TestPermissionsRequest.permissions` that 2208 // the caller is allowed. 2209 Permissions []string `json:"permissions,omitempty"` 2210 2211 // ServerResponse contains the HTTP response code and headers from the 2212 // server. 2213 googleapi.ServerResponse `json:"-"` 2214 2215 // ForceSendFields is a list of field names (e.g. "Permissions") to 2216 // unconditionally include in API requests. By default, fields with 2217 // empty values are omitted from API requests. However, any non-pointer, 2218 // non-interface field appearing in ForceSendFields will be sent to the 2219 // server regardless of whether the field is empty or not. This may be 2220 // used to include empty fields in Patch requests. 2221 ForceSendFields []string `json:"-"` 2222 2223 // NullFields is a list of field names (e.g. "Permissions") to include 2224 // in API requests with the JSON null value. By default, fields with 2225 // empty values are omitted from API requests. However, any field with 2226 // an empty value appearing in NullFields will be sent to the server as 2227 // null. It is an error if a field in this list has a non-empty value. 2228 // This may be used to include null fields in Patch requests. 2229 NullFields []string `json:"-"` 2230} 2231 2232func (s *TestIamPermissionsResponse) MarshalJSON() ([]byte, error) { 2233 type NoMethod TestIamPermissionsResponse 2234 raw := NoMethod(*s) 2235 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2236} 2237 2238// Trace: Trace represents one simulated packet forwarding path. - Each 2239// trace contains multiple ordered steps. - Each step is in a particular 2240// state and has an associated configuration. - State is categorized as 2241// a final or non-final state. - Each final state has a reason 2242// associated with it. - Each trace must end with a final state (the 2243// last step). |---------------------Trace----------------------| 2244// Step1(State) Step2(State) --- StepN(State(final)) 2245type Trace struct { 2246 // EndpointInfo: Derived from the source and destination endpoints 2247 // definition, and validated by the data plane model. If there are 2248 // multiple traces starting from different source locations, then the 2249 // endpoint_info may be different between traces. 2250 EndpointInfo *EndpointInfo `json:"endpointInfo,omitempty"` 2251 2252 // Steps: A trace of a test contains multiple steps from the initial 2253 // state to the final state (delivered, dropped, forwarded, or aborted). 2254 // The steps are ordered by the processing sequence within the simulated 2255 // network state machine. It is critical to preserve the order of the 2256 // steps and avoid reordering or sorting them. 2257 Steps []*Step `json:"steps,omitempty"` 2258 2259 // ForceSendFields is a list of field names (e.g. "EndpointInfo") to 2260 // unconditionally include in API requests. By default, fields with 2261 // empty values are omitted from API requests. However, any non-pointer, 2262 // non-interface field appearing in ForceSendFields will be sent to the 2263 // server regardless of whether the field is empty or not. This may be 2264 // used to include empty fields in Patch requests. 2265 ForceSendFields []string `json:"-"` 2266 2267 // NullFields is a list of field names (e.g. "EndpointInfo") to include 2268 // in API requests with the JSON null value. By default, fields with 2269 // empty values are omitted from API requests. However, any field with 2270 // an empty value appearing in NullFields will be sent to the server as 2271 // null. It is an error if a field in this list has a non-empty value. 2272 // This may be used to include null fields in Patch requests. 2273 NullFields []string `json:"-"` 2274} 2275 2276func (s *Trace) MarshalJSON() ([]byte, error) { 2277 type NoMethod Trace 2278 raw := NoMethod(*s) 2279 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2280} 2281 2282// VpnGatewayInfo: For display only. Metadata associated with a Compute 2283// Engine VPN gateway. 2284type VpnGatewayInfo struct { 2285 // DisplayName: Name of a VPN gateway. 2286 DisplayName string `json:"displayName,omitempty"` 2287 2288 // IpAddress: IP address of the VPN gateway. 2289 IpAddress string `json:"ipAddress,omitempty"` 2290 2291 // NetworkUri: URI of a Compute Engine network where the VPN gateway is 2292 // configured. 2293 NetworkUri string `json:"networkUri,omitempty"` 2294 2295 // Region: Name of a GCP region where this VPN gateway is configured. 2296 Region string `json:"region,omitempty"` 2297 2298 // Uri: URI of a VPN gateway. 2299 Uri string `json:"uri,omitempty"` 2300 2301 // VpnTunnelUri: A VPN tunnel that is associated with this VPN gateway. 2302 // There may be multiple VPN tunnels configured on a VPN gateway, and 2303 // only the one relevant to the test is displayed. 2304 VpnTunnelUri string `json:"vpnTunnelUri,omitempty"` 2305 2306 // ForceSendFields is a list of field names (e.g. "DisplayName") to 2307 // unconditionally include in API requests. By default, fields with 2308 // empty values are omitted from API requests. However, any non-pointer, 2309 // non-interface field appearing in ForceSendFields will be sent to the 2310 // server regardless of whether the field is empty or not. This may be 2311 // used to include empty fields in Patch requests. 2312 ForceSendFields []string `json:"-"` 2313 2314 // NullFields is a list of field names (e.g. "DisplayName") to include 2315 // in API requests with the JSON null value. By default, fields with 2316 // empty values are omitted from API requests. However, any field with 2317 // an empty value appearing in NullFields will be sent to the server as 2318 // null. It is an error if a field in this list has a non-empty value. 2319 // This may be used to include null fields in Patch requests. 2320 NullFields []string `json:"-"` 2321} 2322 2323func (s *VpnGatewayInfo) MarshalJSON() ([]byte, error) { 2324 type NoMethod VpnGatewayInfo 2325 raw := NoMethod(*s) 2326 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2327} 2328 2329// VpnTunnelInfo: For display only. Metadata associated with a Compute 2330// Engine VPN tunnel. 2331type VpnTunnelInfo struct { 2332 // DisplayName: Name of a VPN tunnel. 2333 DisplayName string `json:"displayName,omitempty"` 2334 2335 // NetworkUri: URI of a Compute Engine network where the VPN tunnel is 2336 // configured. 2337 NetworkUri string `json:"networkUri,omitempty"` 2338 2339 // Region: Name of a GCP region where this VPN tunnel is configured. 2340 Region string `json:"region,omitempty"` 2341 2342 // RemoteGateway: URI of a VPN gateway at remote end of the tunnel. 2343 RemoteGateway string `json:"remoteGateway,omitempty"` 2344 2345 // RemoteGatewayIp: Remote VPN gateway's IP address. 2346 RemoteGatewayIp string `json:"remoteGatewayIp,omitempty"` 2347 2348 // RoutingType: Type of the routing policy. 2349 // 2350 // Possible values: 2351 // "ROUTING_TYPE_UNSPECIFIED" - Unspecified type. Default value. 2352 // "ROUTE_BASED" - Route based VPN. 2353 // "POLICY_BASED" - Policy based routing. 2354 // "DYNAMIC" - Dynamic (BGP) routing. 2355 RoutingType string `json:"routingType,omitempty"` 2356 2357 // SourceGateway: URI of the VPN gateway at local end of the tunnel. 2358 SourceGateway string `json:"sourceGateway,omitempty"` 2359 2360 // SourceGatewayIp: Local VPN gateway's IP address. 2361 SourceGatewayIp string `json:"sourceGatewayIp,omitempty"` 2362 2363 // Uri: URI of a VPN tunnel. 2364 Uri string `json:"uri,omitempty"` 2365 2366 // ForceSendFields is a list of field names (e.g. "DisplayName") to 2367 // unconditionally include in API requests. By default, fields with 2368 // empty values are omitted from API requests. However, any non-pointer, 2369 // non-interface field appearing in ForceSendFields will be sent to the 2370 // server regardless of whether the field is empty or not. This may be 2371 // used to include empty fields in Patch requests. 2372 ForceSendFields []string `json:"-"` 2373 2374 // NullFields is a list of field names (e.g. "DisplayName") to include 2375 // in API requests with the JSON null value. By default, fields with 2376 // empty values are omitted from API requests. However, any field with 2377 // an empty value appearing in NullFields will be sent to the server as 2378 // null. It is an error if a field in this list has a non-empty value. 2379 // This may be used to include null fields in Patch requests. 2380 NullFields []string `json:"-"` 2381} 2382 2383func (s *VpnTunnelInfo) MarshalJSON() ([]byte, error) { 2384 type NoMethod VpnTunnelInfo 2385 raw := NoMethod(*s) 2386 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2387} 2388 2389// method id "networkmanagement.projects.locations.get": 2390 2391type ProjectsLocationsGetCall struct { 2392 s *Service 2393 name string 2394 urlParams_ gensupport.URLParams 2395 ifNoneMatch_ string 2396 ctx_ context.Context 2397 header_ http.Header 2398} 2399 2400// Get: Gets information about a location. 2401func (r *ProjectsLocationsService) Get(name string) *ProjectsLocationsGetCall { 2402 c := &ProjectsLocationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 2403 c.name = name 2404 return c 2405} 2406 2407// Fields allows partial responses to be retrieved. See 2408// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 2409// for more information. 2410func (c *ProjectsLocationsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsGetCall { 2411 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 2412 return c 2413} 2414 2415// IfNoneMatch sets the optional parameter which makes the operation 2416// fail if the object's ETag matches the given value. This is useful for 2417// getting updates only after the object has changed since the last 2418// request. Use googleapi.IsNotModified to check whether the response 2419// error from Do is the result of In-None-Match. 2420func (c *ProjectsLocationsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsGetCall { 2421 c.ifNoneMatch_ = entityTag 2422 return c 2423} 2424 2425// Context sets the context to be used in this call's Do method. Any 2426// pending HTTP request will be aborted if the provided context is 2427// canceled. 2428func (c *ProjectsLocationsGetCall) Context(ctx context.Context) *ProjectsLocationsGetCall { 2429 c.ctx_ = ctx 2430 return c 2431} 2432 2433// Header returns an http.Header that can be modified by the caller to 2434// add HTTP headers to the request. 2435func (c *ProjectsLocationsGetCall) Header() http.Header { 2436 if c.header_ == nil { 2437 c.header_ = make(http.Header) 2438 } 2439 return c.header_ 2440} 2441 2442func (c *ProjectsLocationsGetCall) doRequest(alt string) (*http.Response, error) { 2443 reqHeaders := make(http.Header) 2444 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124") 2445 for k, v := range c.header_ { 2446 reqHeaders[k] = v 2447 } 2448 reqHeaders.Set("User-Agent", c.s.userAgent()) 2449 if c.ifNoneMatch_ != "" { 2450 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 2451 } 2452 var body io.Reader = nil 2453 c.urlParams_.Set("alt", alt) 2454 c.urlParams_.Set("prettyPrint", "false") 2455 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") 2456 urls += "?" + c.urlParams_.Encode() 2457 req, err := http.NewRequest("GET", urls, body) 2458 if err != nil { 2459 return nil, err 2460 } 2461 req.Header = reqHeaders 2462 googleapi.Expand(req.URL, map[string]string{ 2463 "name": c.name, 2464 }) 2465 return gensupport.SendRequest(c.ctx_, c.s.client, req) 2466} 2467 2468// Do executes the "networkmanagement.projects.locations.get" call. 2469// Exactly one of *Location or error will be non-nil. Any non-2xx status 2470// code is an error. Response headers are in either 2471// *Location.ServerResponse.Header or (if a response was returned at 2472// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 2473// to check whether the returned error was because 2474// http.StatusNotModified was returned. 2475func (c *ProjectsLocationsGetCall) Do(opts ...googleapi.CallOption) (*Location, error) { 2476 gensupport.SetOptions(c.urlParams_, opts...) 2477 res, err := c.doRequest("json") 2478 if res != nil && res.StatusCode == http.StatusNotModified { 2479 if res.Body != nil { 2480 res.Body.Close() 2481 } 2482 return nil, &googleapi.Error{ 2483 Code: res.StatusCode, 2484 Header: res.Header, 2485 } 2486 } 2487 if err != nil { 2488 return nil, err 2489 } 2490 defer googleapi.CloseBody(res) 2491 if err := googleapi.CheckResponse(res); err != nil { 2492 return nil, err 2493 } 2494 ret := &Location{ 2495 ServerResponse: googleapi.ServerResponse{ 2496 Header: res.Header, 2497 HTTPStatusCode: res.StatusCode, 2498 }, 2499 } 2500 target := &ret 2501 if err := gensupport.DecodeResponse(target, res); err != nil { 2502 return nil, err 2503 } 2504 return ret, nil 2505 // { 2506 // "description": "Gets information about a location.", 2507 // "flatPath": "v1beta1/projects/{projectsId}/locations/{locationsId}", 2508 // "httpMethod": "GET", 2509 // "id": "networkmanagement.projects.locations.get", 2510 // "parameterOrder": [ 2511 // "name" 2512 // ], 2513 // "parameters": { 2514 // "name": { 2515 // "description": "Resource name for the location.", 2516 // "location": "path", 2517 // "pattern": "^projects/[^/]+/locations/[^/]+$", 2518 // "required": true, 2519 // "type": "string" 2520 // } 2521 // }, 2522 // "path": "v1beta1/{+name}", 2523 // "response": { 2524 // "$ref": "Location" 2525 // }, 2526 // "scopes": [ 2527 // "https://www.googleapis.com/auth/cloud-platform" 2528 // ] 2529 // } 2530 2531} 2532 2533// method id "networkmanagement.projects.locations.list": 2534 2535type ProjectsLocationsListCall struct { 2536 s *Service 2537 name string 2538 urlParams_ gensupport.URLParams 2539 ifNoneMatch_ string 2540 ctx_ context.Context 2541 header_ http.Header 2542} 2543 2544// List: Lists information about the supported locations for this 2545// service. 2546func (r *ProjectsLocationsService) List(name string) *ProjectsLocationsListCall { 2547 c := &ProjectsLocationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 2548 c.name = name 2549 return c 2550} 2551 2552// Filter sets the optional parameter "filter": The standard list 2553// filter. 2554func (c *ProjectsLocationsListCall) Filter(filter string) *ProjectsLocationsListCall { 2555 c.urlParams_.Set("filter", filter) 2556 return c 2557} 2558 2559// PageSize sets the optional parameter "pageSize": The standard list 2560// page size. 2561func (c *ProjectsLocationsListCall) PageSize(pageSize int64) *ProjectsLocationsListCall { 2562 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) 2563 return c 2564} 2565 2566// PageToken sets the optional parameter "pageToken": The standard list 2567// page token. 2568func (c *ProjectsLocationsListCall) PageToken(pageToken string) *ProjectsLocationsListCall { 2569 c.urlParams_.Set("pageToken", pageToken) 2570 return c 2571} 2572 2573// Fields allows partial responses to be retrieved. See 2574// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 2575// for more information. 2576func (c *ProjectsLocationsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsListCall { 2577 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 2578 return c 2579} 2580 2581// IfNoneMatch sets the optional parameter which makes the operation 2582// fail if the object's ETag matches the given value. This is useful for 2583// getting updates only after the object has changed since the last 2584// request. Use googleapi.IsNotModified to check whether the response 2585// error from Do is the result of In-None-Match. 2586func (c *ProjectsLocationsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsListCall { 2587 c.ifNoneMatch_ = entityTag 2588 return c 2589} 2590 2591// Context sets the context to be used in this call's Do method. Any 2592// pending HTTP request will be aborted if the provided context is 2593// canceled. 2594func (c *ProjectsLocationsListCall) Context(ctx context.Context) *ProjectsLocationsListCall { 2595 c.ctx_ = ctx 2596 return c 2597} 2598 2599// Header returns an http.Header that can be modified by the caller to 2600// add HTTP headers to the request. 2601func (c *ProjectsLocationsListCall) Header() http.Header { 2602 if c.header_ == nil { 2603 c.header_ = make(http.Header) 2604 } 2605 return c.header_ 2606} 2607 2608func (c *ProjectsLocationsListCall) doRequest(alt string) (*http.Response, error) { 2609 reqHeaders := make(http.Header) 2610 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124") 2611 for k, v := range c.header_ { 2612 reqHeaders[k] = v 2613 } 2614 reqHeaders.Set("User-Agent", c.s.userAgent()) 2615 if c.ifNoneMatch_ != "" { 2616 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 2617 } 2618 var body io.Reader = nil 2619 c.urlParams_.Set("alt", alt) 2620 c.urlParams_.Set("prettyPrint", "false") 2621 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}/locations") 2622 urls += "?" + c.urlParams_.Encode() 2623 req, err := http.NewRequest("GET", urls, body) 2624 if err != nil { 2625 return nil, err 2626 } 2627 req.Header = reqHeaders 2628 googleapi.Expand(req.URL, map[string]string{ 2629 "name": c.name, 2630 }) 2631 return gensupport.SendRequest(c.ctx_, c.s.client, req) 2632} 2633 2634// Do executes the "networkmanagement.projects.locations.list" call. 2635// Exactly one of *ListLocationsResponse or error will be non-nil. Any 2636// non-2xx status code is an error. Response headers are in either 2637// *ListLocationsResponse.ServerResponse.Header or (if a response was 2638// returned at all) in error.(*googleapi.Error).Header. Use 2639// googleapi.IsNotModified to check whether the returned error was 2640// because http.StatusNotModified was returned. 2641func (c *ProjectsLocationsListCall) Do(opts ...googleapi.CallOption) (*ListLocationsResponse, error) { 2642 gensupport.SetOptions(c.urlParams_, opts...) 2643 res, err := c.doRequest("json") 2644 if res != nil && res.StatusCode == http.StatusNotModified { 2645 if res.Body != nil { 2646 res.Body.Close() 2647 } 2648 return nil, &googleapi.Error{ 2649 Code: res.StatusCode, 2650 Header: res.Header, 2651 } 2652 } 2653 if err != nil { 2654 return nil, err 2655 } 2656 defer googleapi.CloseBody(res) 2657 if err := googleapi.CheckResponse(res); err != nil { 2658 return nil, err 2659 } 2660 ret := &ListLocationsResponse{ 2661 ServerResponse: googleapi.ServerResponse{ 2662 Header: res.Header, 2663 HTTPStatusCode: res.StatusCode, 2664 }, 2665 } 2666 target := &ret 2667 if err := gensupport.DecodeResponse(target, res); err != nil { 2668 return nil, err 2669 } 2670 return ret, nil 2671 // { 2672 // "description": "Lists information about the supported locations for this service.", 2673 // "flatPath": "v1beta1/projects/{projectsId}/locations", 2674 // "httpMethod": "GET", 2675 // "id": "networkmanagement.projects.locations.list", 2676 // "parameterOrder": [ 2677 // "name" 2678 // ], 2679 // "parameters": { 2680 // "filter": { 2681 // "description": "The standard list filter.", 2682 // "location": "query", 2683 // "type": "string" 2684 // }, 2685 // "name": { 2686 // "description": "The resource that owns the locations collection, if applicable.", 2687 // "location": "path", 2688 // "pattern": "^projects/[^/]+$", 2689 // "required": true, 2690 // "type": "string" 2691 // }, 2692 // "pageSize": { 2693 // "description": "The standard list page size.", 2694 // "format": "int32", 2695 // "location": "query", 2696 // "type": "integer" 2697 // }, 2698 // "pageToken": { 2699 // "description": "The standard list page token.", 2700 // "location": "query", 2701 // "type": "string" 2702 // } 2703 // }, 2704 // "path": "v1beta1/{+name}/locations", 2705 // "response": { 2706 // "$ref": "ListLocationsResponse" 2707 // }, 2708 // "scopes": [ 2709 // "https://www.googleapis.com/auth/cloud-platform" 2710 // ] 2711 // } 2712 2713} 2714 2715// Pages invokes f for each page of results. 2716// A non-nil error returned from f will halt the iteration. 2717// The provided context supersedes any context provided to the Context method. 2718func (c *ProjectsLocationsListCall) Pages(ctx context.Context, f func(*ListLocationsResponse) error) error { 2719 c.ctx_ = ctx 2720 defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point 2721 for { 2722 x, err := c.Do() 2723 if err != nil { 2724 return err 2725 } 2726 if err := f(x); err != nil { 2727 return err 2728 } 2729 if x.NextPageToken == "" { 2730 return nil 2731 } 2732 c.PageToken(x.NextPageToken) 2733 } 2734} 2735 2736// method id "networkmanagement.projects.locations.global.connectivityTests.create": 2737 2738type ProjectsLocationsGlobalConnectivityTestsCreateCall struct { 2739 s *Service 2740 parent string 2741 connectivitytest *ConnectivityTest 2742 urlParams_ gensupport.URLParams 2743 ctx_ context.Context 2744 header_ http.Header 2745} 2746 2747// Create: Creates a new Connectivity Test. After you create a test, the 2748// reachability analysis is performed as part of the long running 2749// operation, which completes when the analysis completes. If the 2750// endpoint specifications in `ConnectivityTest` are invalid (for 2751// example, containing non-existent resources in the network, or you 2752// don't have read permissions to the network configurations of listed 2753// projects), then the reachability result returns a value of `UNKNOWN`. 2754// If the endpoint specifications in `ConnectivityTest` are incomplete, 2755// the reachability result returns a value of AMBIGUOUS. For more 2756// information, see the Connectivity Test documentation. 2757func (r *ProjectsLocationsGlobalConnectivityTestsService) Create(parent string, connectivitytest *ConnectivityTest) *ProjectsLocationsGlobalConnectivityTestsCreateCall { 2758 c := &ProjectsLocationsGlobalConnectivityTestsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 2759 c.parent = parent 2760 c.connectivitytest = connectivitytest 2761 return c 2762} 2763 2764// TestId sets the optional parameter "testId": Required. The logical 2765// name of the Connectivity Test in your project with the following 2766// restrictions: * Must contain only lowercase letters, numbers, and 2767// hyphens. * Must start with a letter. * Must be between 1-40 2768// characters. * Must end with a number or a letter. * Must be unique 2769// within the customer project 2770func (c *ProjectsLocationsGlobalConnectivityTestsCreateCall) TestId(testId string) *ProjectsLocationsGlobalConnectivityTestsCreateCall { 2771 c.urlParams_.Set("testId", testId) 2772 return c 2773} 2774 2775// Fields allows partial responses to be retrieved. See 2776// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 2777// for more information. 2778func (c *ProjectsLocationsGlobalConnectivityTestsCreateCall) Fields(s ...googleapi.Field) *ProjectsLocationsGlobalConnectivityTestsCreateCall { 2779 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 2780 return c 2781} 2782 2783// Context sets the context to be used in this call's Do method. Any 2784// pending HTTP request will be aborted if the provided context is 2785// canceled. 2786func (c *ProjectsLocationsGlobalConnectivityTestsCreateCall) Context(ctx context.Context) *ProjectsLocationsGlobalConnectivityTestsCreateCall { 2787 c.ctx_ = ctx 2788 return c 2789} 2790 2791// Header returns an http.Header that can be modified by the caller to 2792// add HTTP headers to the request. 2793func (c *ProjectsLocationsGlobalConnectivityTestsCreateCall) Header() http.Header { 2794 if c.header_ == nil { 2795 c.header_ = make(http.Header) 2796 } 2797 return c.header_ 2798} 2799 2800func (c *ProjectsLocationsGlobalConnectivityTestsCreateCall) doRequest(alt string) (*http.Response, error) { 2801 reqHeaders := make(http.Header) 2802 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124") 2803 for k, v := range c.header_ { 2804 reqHeaders[k] = v 2805 } 2806 reqHeaders.Set("User-Agent", c.s.userAgent()) 2807 var body io.Reader = nil 2808 body, err := googleapi.WithoutDataWrapper.JSONReader(c.connectivitytest) 2809 if err != nil { 2810 return nil, err 2811 } 2812 reqHeaders.Set("Content-Type", "application/json") 2813 c.urlParams_.Set("alt", alt) 2814 c.urlParams_.Set("prettyPrint", "false") 2815 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/connectivityTests") 2816 urls += "?" + c.urlParams_.Encode() 2817 req, err := http.NewRequest("POST", urls, body) 2818 if err != nil { 2819 return nil, err 2820 } 2821 req.Header = reqHeaders 2822 googleapi.Expand(req.URL, map[string]string{ 2823 "parent": c.parent, 2824 }) 2825 return gensupport.SendRequest(c.ctx_, c.s.client, req) 2826} 2827 2828// Do executes the "networkmanagement.projects.locations.global.connectivityTests.create" call. 2829// Exactly one of *Operation or error will be non-nil. Any non-2xx 2830// status code is an error. Response headers are in either 2831// *Operation.ServerResponse.Header or (if a response was returned at 2832// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 2833// to check whether the returned error was because 2834// http.StatusNotModified was returned. 2835func (c *ProjectsLocationsGlobalConnectivityTestsCreateCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 2836 gensupport.SetOptions(c.urlParams_, opts...) 2837 res, err := c.doRequest("json") 2838 if res != nil && res.StatusCode == http.StatusNotModified { 2839 if res.Body != nil { 2840 res.Body.Close() 2841 } 2842 return nil, &googleapi.Error{ 2843 Code: res.StatusCode, 2844 Header: res.Header, 2845 } 2846 } 2847 if err != nil { 2848 return nil, err 2849 } 2850 defer googleapi.CloseBody(res) 2851 if err := googleapi.CheckResponse(res); err != nil { 2852 return nil, err 2853 } 2854 ret := &Operation{ 2855 ServerResponse: googleapi.ServerResponse{ 2856 Header: res.Header, 2857 HTTPStatusCode: res.StatusCode, 2858 }, 2859 } 2860 target := &ret 2861 if err := gensupport.DecodeResponse(target, res); err != nil { 2862 return nil, err 2863 } 2864 return ret, nil 2865 // { 2866 // "description": "Creates a new Connectivity Test. After you create a test, the reachability analysis is performed as part of the long running operation, which completes when the analysis completes. If the endpoint specifications in `ConnectivityTest` are invalid (for example, containing non-existent resources in the network, or you don't have read permissions to the network configurations of listed projects), then the reachability result returns a value of `UNKNOWN`. If the endpoint specifications in `ConnectivityTest` are incomplete, the reachability result returns a value of AMBIGUOUS. For more information, see the Connectivity Test documentation.", 2867 // "flatPath": "v1beta1/projects/{projectsId}/locations/global/connectivityTests", 2868 // "httpMethod": "POST", 2869 // "id": "networkmanagement.projects.locations.global.connectivityTests.create", 2870 // "parameterOrder": [ 2871 // "parent" 2872 // ], 2873 // "parameters": { 2874 // "parent": { 2875 // "description": "Required. The parent resource of the Connectivity Test to create: `projects/{project_id}/locations/global`", 2876 // "location": "path", 2877 // "pattern": "^projects/[^/]+/locations/global$", 2878 // "required": true, 2879 // "type": "string" 2880 // }, 2881 // "testId": { 2882 // "description": "Required. The logical name of the Connectivity Test in your project with the following restrictions: * Must contain only lowercase letters, numbers, and hyphens. * Must start with a letter. * Must be between 1-40 characters. * Must end with a number or a letter. * Must be unique within the customer project", 2883 // "location": "query", 2884 // "type": "string" 2885 // } 2886 // }, 2887 // "path": "v1beta1/{+parent}/connectivityTests", 2888 // "request": { 2889 // "$ref": "ConnectivityTest" 2890 // }, 2891 // "response": { 2892 // "$ref": "Operation" 2893 // }, 2894 // "scopes": [ 2895 // "https://www.googleapis.com/auth/cloud-platform" 2896 // ] 2897 // } 2898 2899} 2900 2901// method id "networkmanagement.projects.locations.global.connectivityTests.delete": 2902 2903type ProjectsLocationsGlobalConnectivityTestsDeleteCall struct { 2904 s *Service 2905 name string 2906 urlParams_ gensupport.URLParams 2907 ctx_ context.Context 2908 header_ http.Header 2909} 2910 2911// Delete: Deletes a specific `ConnectivityTest`. 2912func (r *ProjectsLocationsGlobalConnectivityTestsService) Delete(name string) *ProjectsLocationsGlobalConnectivityTestsDeleteCall { 2913 c := &ProjectsLocationsGlobalConnectivityTestsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} 2914 c.name = name 2915 return c 2916} 2917 2918// Fields allows partial responses to be retrieved. See 2919// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 2920// for more information. 2921func (c *ProjectsLocationsGlobalConnectivityTestsDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsGlobalConnectivityTestsDeleteCall { 2922 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 2923 return c 2924} 2925 2926// Context sets the context to be used in this call's Do method. Any 2927// pending HTTP request will be aborted if the provided context is 2928// canceled. 2929func (c *ProjectsLocationsGlobalConnectivityTestsDeleteCall) Context(ctx context.Context) *ProjectsLocationsGlobalConnectivityTestsDeleteCall { 2930 c.ctx_ = ctx 2931 return c 2932} 2933 2934// Header returns an http.Header that can be modified by the caller to 2935// add HTTP headers to the request. 2936func (c *ProjectsLocationsGlobalConnectivityTestsDeleteCall) Header() http.Header { 2937 if c.header_ == nil { 2938 c.header_ = make(http.Header) 2939 } 2940 return c.header_ 2941} 2942 2943func (c *ProjectsLocationsGlobalConnectivityTestsDeleteCall) doRequest(alt string) (*http.Response, error) { 2944 reqHeaders := make(http.Header) 2945 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124") 2946 for k, v := range c.header_ { 2947 reqHeaders[k] = v 2948 } 2949 reqHeaders.Set("User-Agent", c.s.userAgent()) 2950 var body io.Reader = nil 2951 c.urlParams_.Set("alt", alt) 2952 c.urlParams_.Set("prettyPrint", "false") 2953 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") 2954 urls += "?" + c.urlParams_.Encode() 2955 req, err := http.NewRequest("DELETE", urls, body) 2956 if err != nil { 2957 return nil, err 2958 } 2959 req.Header = reqHeaders 2960 googleapi.Expand(req.URL, map[string]string{ 2961 "name": c.name, 2962 }) 2963 return gensupport.SendRequest(c.ctx_, c.s.client, req) 2964} 2965 2966// Do executes the "networkmanagement.projects.locations.global.connectivityTests.delete" call. 2967// Exactly one of *Operation or error will be non-nil. Any non-2xx 2968// status code is an error. Response headers are in either 2969// *Operation.ServerResponse.Header or (if a response was returned at 2970// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 2971// to check whether the returned error was because 2972// http.StatusNotModified was returned. 2973func (c *ProjectsLocationsGlobalConnectivityTestsDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 2974 gensupport.SetOptions(c.urlParams_, opts...) 2975 res, err := c.doRequest("json") 2976 if res != nil && res.StatusCode == http.StatusNotModified { 2977 if res.Body != nil { 2978 res.Body.Close() 2979 } 2980 return nil, &googleapi.Error{ 2981 Code: res.StatusCode, 2982 Header: res.Header, 2983 } 2984 } 2985 if err != nil { 2986 return nil, err 2987 } 2988 defer googleapi.CloseBody(res) 2989 if err := googleapi.CheckResponse(res); err != nil { 2990 return nil, err 2991 } 2992 ret := &Operation{ 2993 ServerResponse: googleapi.ServerResponse{ 2994 Header: res.Header, 2995 HTTPStatusCode: res.StatusCode, 2996 }, 2997 } 2998 target := &ret 2999 if err := gensupport.DecodeResponse(target, res); err != nil { 3000 return nil, err 3001 } 3002 return ret, nil 3003 // { 3004 // "description": "Deletes a specific `ConnectivityTest`.", 3005 // "flatPath": "v1beta1/projects/{projectsId}/locations/global/connectivityTests/{connectivityTestsId}", 3006 // "httpMethod": "DELETE", 3007 // "id": "networkmanagement.projects.locations.global.connectivityTests.delete", 3008 // "parameterOrder": [ 3009 // "name" 3010 // ], 3011 // "parameters": { 3012 // "name": { 3013 // "description": "Required. Connectivity Test resource name using the form: `projects/{project_id}/locations/global/connectivityTests/{test_id}`", 3014 // "location": "path", 3015 // "pattern": "^projects/[^/]+/locations/global/connectivityTests/[^/]+$", 3016 // "required": true, 3017 // "type": "string" 3018 // } 3019 // }, 3020 // "path": "v1beta1/{+name}", 3021 // "response": { 3022 // "$ref": "Operation" 3023 // }, 3024 // "scopes": [ 3025 // "https://www.googleapis.com/auth/cloud-platform" 3026 // ] 3027 // } 3028 3029} 3030 3031// method id "networkmanagement.projects.locations.global.connectivityTests.get": 3032 3033type ProjectsLocationsGlobalConnectivityTestsGetCall struct { 3034 s *Service 3035 name string 3036 urlParams_ gensupport.URLParams 3037 ifNoneMatch_ string 3038 ctx_ context.Context 3039 header_ http.Header 3040} 3041 3042// Get: Gets the details of a specific Connectivity Test. 3043func (r *ProjectsLocationsGlobalConnectivityTestsService) Get(name string) *ProjectsLocationsGlobalConnectivityTestsGetCall { 3044 c := &ProjectsLocationsGlobalConnectivityTestsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 3045 c.name = name 3046 return c 3047} 3048 3049// Fields allows partial responses to be retrieved. See 3050// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 3051// for more information. 3052func (c *ProjectsLocationsGlobalConnectivityTestsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsGlobalConnectivityTestsGetCall { 3053 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 3054 return c 3055} 3056 3057// IfNoneMatch sets the optional parameter which makes the operation 3058// fail if the object's ETag matches the given value. This is useful for 3059// getting updates only after the object has changed since the last 3060// request. Use googleapi.IsNotModified to check whether the response 3061// error from Do is the result of In-None-Match. 3062func (c *ProjectsLocationsGlobalConnectivityTestsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsGlobalConnectivityTestsGetCall { 3063 c.ifNoneMatch_ = entityTag 3064 return c 3065} 3066 3067// Context sets the context to be used in this call's Do method. Any 3068// pending HTTP request will be aborted if the provided context is 3069// canceled. 3070func (c *ProjectsLocationsGlobalConnectivityTestsGetCall) Context(ctx context.Context) *ProjectsLocationsGlobalConnectivityTestsGetCall { 3071 c.ctx_ = ctx 3072 return c 3073} 3074 3075// Header returns an http.Header that can be modified by the caller to 3076// add HTTP headers to the request. 3077func (c *ProjectsLocationsGlobalConnectivityTestsGetCall) Header() http.Header { 3078 if c.header_ == nil { 3079 c.header_ = make(http.Header) 3080 } 3081 return c.header_ 3082} 3083 3084func (c *ProjectsLocationsGlobalConnectivityTestsGetCall) doRequest(alt string) (*http.Response, error) { 3085 reqHeaders := make(http.Header) 3086 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124") 3087 for k, v := range c.header_ { 3088 reqHeaders[k] = v 3089 } 3090 reqHeaders.Set("User-Agent", c.s.userAgent()) 3091 if c.ifNoneMatch_ != "" { 3092 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 3093 } 3094 var body io.Reader = nil 3095 c.urlParams_.Set("alt", alt) 3096 c.urlParams_.Set("prettyPrint", "false") 3097 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") 3098 urls += "?" + c.urlParams_.Encode() 3099 req, err := http.NewRequest("GET", urls, body) 3100 if err != nil { 3101 return nil, err 3102 } 3103 req.Header = reqHeaders 3104 googleapi.Expand(req.URL, map[string]string{ 3105 "name": c.name, 3106 }) 3107 return gensupport.SendRequest(c.ctx_, c.s.client, req) 3108} 3109 3110// Do executes the "networkmanagement.projects.locations.global.connectivityTests.get" call. 3111// Exactly one of *ConnectivityTest or error will be non-nil. Any 3112// non-2xx status code is an error. Response headers are in either 3113// *ConnectivityTest.ServerResponse.Header or (if a response was 3114// returned at all) in error.(*googleapi.Error).Header. Use 3115// googleapi.IsNotModified to check whether the returned error was 3116// because http.StatusNotModified was returned. 3117func (c *ProjectsLocationsGlobalConnectivityTestsGetCall) Do(opts ...googleapi.CallOption) (*ConnectivityTest, error) { 3118 gensupport.SetOptions(c.urlParams_, opts...) 3119 res, err := c.doRequest("json") 3120 if res != nil && res.StatusCode == http.StatusNotModified { 3121 if res.Body != nil { 3122 res.Body.Close() 3123 } 3124 return nil, &googleapi.Error{ 3125 Code: res.StatusCode, 3126 Header: res.Header, 3127 } 3128 } 3129 if err != nil { 3130 return nil, err 3131 } 3132 defer googleapi.CloseBody(res) 3133 if err := googleapi.CheckResponse(res); err != nil { 3134 return nil, err 3135 } 3136 ret := &ConnectivityTest{ 3137 ServerResponse: googleapi.ServerResponse{ 3138 Header: res.Header, 3139 HTTPStatusCode: res.StatusCode, 3140 }, 3141 } 3142 target := &ret 3143 if err := gensupport.DecodeResponse(target, res); err != nil { 3144 return nil, err 3145 } 3146 return ret, nil 3147 // { 3148 // "description": "Gets the details of a specific Connectivity Test.", 3149 // "flatPath": "v1beta1/projects/{projectsId}/locations/global/connectivityTests/{connectivityTestsId}", 3150 // "httpMethod": "GET", 3151 // "id": "networkmanagement.projects.locations.global.connectivityTests.get", 3152 // "parameterOrder": [ 3153 // "name" 3154 // ], 3155 // "parameters": { 3156 // "name": { 3157 // "description": "Required. `ConnectivityTest` resource name using the form: `projects/{project_id}/locations/global/connectivityTests/{test_id}`", 3158 // "location": "path", 3159 // "pattern": "^projects/[^/]+/locations/global/connectivityTests/[^/]+$", 3160 // "required": true, 3161 // "type": "string" 3162 // } 3163 // }, 3164 // "path": "v1beta1/{+name}", 3165 // "response": { 3166 // "$ref": "ConnectivityTest" 3167 // }, 3168 // "scopes": [ 3169 // "https://www.googleapis.com/auth/cloud-platform" 3170 // ] 3171 // } 3172 3173} 3174 3175// method id "networkmanagement.projects.locations.global.connectivityTests.getIamPolicy": 3176 3177type ProjectsLocationsGlobalConnectivityTestsGetIamPolicyCall struct { 3178 s *Service 3179 resource string 3180 urlParams_ gensupport.URLParams 3181 ifNoneMatch_ string 3182 ctx_ context.Context 3183 header_ http.Header 3184} 3185 3186// GetIamPolicy: Gets the access control policy for a resource. Returns 3187// an empty policy if the resource exists and does not have a policy 3188// set. 3189func (r *ProjectsLocationsGlobalConnectivityTestsService) GetIamPolicy(resource string) *ProjectsLocationsGlobalConnectivityTestsGetIamPolicyCall { 3190 c := &ProjectsLocationsGlobalConnectivityTestsGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)} 3191 c.resource = resource 3192 return c 3193} 3194 3195// OptionsRequestedPolicyVersion sets the optional parameter 3196// "options.requestedPolicyVersion": The policy format version to be 3197// returned. Valid values are 0, 1, and 3. Requests specifying an 3198// invalid value will be rejected. Requests for policies with any 3199// conditional bindings must specify version 3. Policies without any 3200// conditional bindings may specify any valid value or leave the field 3201// unset. To learn which resources support conditions in their IAM 3202// policies, see the [IAM 3203// documentation](https://cloud.google.com/iam/help/conditions/resource-p 3204// olicies). 3205func (c *ProjectsLocationsGlobalConnectivityTestsGetIamPolicyCall) OptionsRequestedPolicyVersion(optionsRequestedPolicyVersion int64) *ProjectsLocationsGlobalConnectivityTestsGetIamPolicyCall { 3206 c.urlParams_.Set("options.requestedPolicyVersion", fmt.Sprint(optionsRequestedPolicyVersion)) 3207 return c 3208} 3209 3210// Fields allows partial responses to be retrieved. See 3211// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 3212// for more information. 3213func (c *ProjectsLocationsGlobalConnectivityTestsGetIamPolicyCall) Fields(s ...googleapi.Field) *ProjectsLocationsGlobalConnectivityTestsGetIamPolicyCall { 3214 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 3215 return c 3216} 3217 3218// IfNoneMatch sets the optional parameter which makes the operation 3219// fail if the object's ETag matches the given value. This is useful for 3220// getting updates only after the object has changed since the last 3221// request. Use googleapi.IsNotModified to check whether the response 3222// error from Do is the result of In-None-Match. 3223func (c *ProjectsLocationsGlobalConnectivityTestsGetIamPolicyCall) IfNoneMatch(entityTag string) *ProjectsLocationsGlobalConnectivityTestsGetIamPolicyCall { 3224 c.ifNoneMatch_ = entityTag 3225 return c 3226} 3227 3228// Context sets the context to be used in this call's Do method. Any 3229// pending HTTP request will be aborted if the provided context is 3230// canceled. 3231func (c *ProjectsLocationsGlobalConnectivityTestsGetIamPolicyCall) Context(ctx context.Context) *ProjectsLocationsGlobalConnectivityTestsGetIamPolicyCall { 3232 c.ctx_ = ctx 3233 return c 3234} 3235 3236// Header returns an http.Header that can be modified by the caller to 3237// add HTTP headers to the request. 3238func (c *ProjectsLocationsGlobalConnectivityTestsGetIamPolicyCall) Header() http.Header { 3239 if c.header_ == nil { 3240 c.header_ = make(http.Header) 3241 } 3242 return c.header_ 3243} 3244 3245func (c *ProjectsLocationsGlobalConnectivityTestsGetIamPolicyCall) doRequest(alt string) (*http.Response, error) { 3246 reqHeaders := make(http.Header) 3247 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124") 3248 for k, v := range c.header_ { 3249 reqHeaders[k] = v 3250 } 3251 reqHeaders.Set("User-Agent", c.s.userAgent()) 3252 if c.ifNoneMatch_ != "" { 3253 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 3254 } 3255 var body io.Reader = nil 3256 c.urlParams_.Set("alt", alt) 3257 c.urlParams_.Set("prettyPrint", "false") 3258 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+resource}:getIamPolicy") 3259 urls += "?" + c.urlParams_.Encode() 3260 req, err := http.NewRequest("GET", urls, body) 3261 if err != nil { 3262 return nil, err 3263 } 3264 req.Header = reqHeaders 3265 googleapi.Expand(req.URL, map[string]string{ 3266 "resource": c.resource, 3267 }) 3268 return gensupport.SendRequest(c.ctx_, c.s.client, req) 3269} 3270 3271// Do executes the "networkmanagement.projects.locations.global.connectivityTests.getIamPolicy" call. 3272// Exactly one of *Policy or error will be non-nil. Any non-2xx status 3273// code is an error. Response headers are in either 3274// *Policy.ServerResponse.Header or (if a response was returned at all) 3275// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 3276// check whether the returned error was because http.StatusNotModified 3277// was returned. 3278func (c *ProjectsLocationsGlobalConnectivityTestsGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) { 3279 gensupport.SetOptions(c.urlParams_, opts...) 3280 res, err := c.doRequest("json") 3281 if res != nil && res.StatusCode == http.StatusNotModified { 3282 if res.Body != nil { 3283 res.Body.Close() 3284 } 3285 return nil, &googleapi.Error{ 3286 Code: res.StatusCode, 3287 Header: res.Header, 3288 } 3289 } 3290 if err != nil { 3291 return nil, err 3292 } 3293 defer googleapi.CloseBody(res) 3294 if err := googleapi.CheckResponse(res); err != nil { 3295 return nil, err 3296 } 3297 ret := &Policy{ 3298 ServerResponse: googleapi.ServerResponse{ 3299 Header: res.Header, 3300 HTTPStatusCode: res.StatusCode, 3301 }, 3302 } 3303 target := &ret 3304 if err := gensupport.DecodeResponse(target, res); err != nil { 3305 return nil, err 3306 } 3307 return ret, nil 3308 // { 3309 // "description": "Gets the access control policy for a resource. Returns an empty policy if the resource exists and does not have a policy set.", 3310 // "flatPath": "v1beta1/projects/{projectsId}/locations/global/connectivityTests/{connectivityTestsId}:getIamPolicy", 3311 // "httpMethod": "GET", 3312 // "id": "networkmanagement.projects.locations.global.connectivityTests.getIamPolicy", 3313 // "parameterOrder": [ 3314 // "resource" 3315 // ], 3316 // "parameters": { 3317 // "options.requestedPolicyVersion": { 3318 // "description": "Optional. The policy format version to be returned. Valid values are 0, 1, and 3. Requests specifying an invalid value will be rejected. Requests for policies with any conditional bindings must specify version 3. Policies without any conditional bindings may specify any valid value or leave the field unset. To learn which resources support conditions in their IAM policies, see the [IAM documentation](https://cloud.google.com/iam/help/conditions/resource-policies).", 3319 // "format": "int32", 3320 // "location": "query", 3321 // "type": "integer" 3322 // }, 3323 // "resource": { 3324 // "description": "REQUIRED: The resource for which the policy is being requested. See the operation documentation for the appropriate value for this field.", 3325 // "location": "path", 3326 // "pattern": "^projects/[^/]+/locations/global/connectivityTests/[^/]+$", 3327 // "required": true, 3328 // "type": "string" 3329 // } 3330 // }, 3331 // "path": "v1beta1/{+resource}:getIamPolicy", 3332 // "response": { 3333 // "$ref": "Policy" 3334 // }, 3335 // "scopes": [ 3336 // "https://www.googleapis.com/auth/cloud-platform" 3337 // ] 3338 // } 3339 3340} 3341 3342// method id "networkmanagement.projects.locations.global.connectivityTests.list": 3343 3344type ProjectsLocationsGlobalConnectivityTestsListCall struct { 3345 s *Service 3346 parent string 3347 urlParams_ gensupport.URLParams 3348 ifNoneMatch_ string 3349 ctx_ context.Context 3350 header_ http.Header 3351} 3352 3353// List: Lists all Connectivity Tests owned by a project. 3354func (r *ProjectsLocationsGlobalConnectivityTestsService) List(parent string) *ProjectsLocationsGlobalConnectivityTestsListCall { 3355 c := &ProjectsLocationsGlobalConnectivityTestsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 3356 c.parent = parent 3357 return c 3358} 3359 3360// Filter sets the optional parameter "filter": Lists the 3361// `ConnectivityTests` that match the filter expression. A filter 3362// expression filters the resources listed in the response. The 3363// expression must be of the form ` ` where operators: `<`, `>`, `<=`, 3364// `>=`, `!=`, `=`, `:` are supported (colon `:` represents a HAS 3365// operator which is roughly synonymous with equality). can refer to a 3366// proto or JSON field, or a synthetic field. Field names can be 3367// camelCase or snake_case. Examples: - Filter by name: name = 3368// "projects/proj-1/locations/global/connectivityTests/test-1 - Filter 3369// by labels: - Resources that have a key called `foo` labels.foo:* - 3370// Resources that have a key called `foo` whose value is `bar` 3371// labels.foo = bar 3372func (c *ProjectsLocationsGlobalConnectivityTestsListCall) Filter(filter string) *ProjectsLocationsGlobalConnectivityTestsListCall { 3373 c.urlParams_.Set("filter", filter) 3374 return c 3375} 3376 3377// OrderBy sets the optional parameter "orderBy": Field to use to sort 3378// the list. 3379func (c *ProjectsLocationsGlobalConnectivityTestsListCall) OrderBy(orderBy string) *ProjectsLocationsGlobalConnectivityTestsListCall { 3380 c.urlParams_.Set("orderBy", orderBy) 3381 return c 3382} 3383 3384// PageSize sets the optional parameter "pageSize": Number of 3385// `ConnectivityTests` to return. 3386func (c *ProjectsLocationsGlobalConnectivityTestsListCall) PageSize(pageSize int64) *ProjectsLocationsGlobalConnectivityTestsListCall { 3387 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) 3388 return c 3389} 3390 3391// PageToken sets the optional parameter "pageToken": Page token from an 3392// earlier query, as returned in `next_page_token`. 3393func (c *ProjectsLocationsGlobalConnectivityTestsListCall) PageToken(pageToken string) *ProjectsLocationsGlobalConnectivityTestsListCall { 3394 c.urlParams_.Set("pageToken", pageToken) 3395 return c 3396} 3397 3398// Fields allows partial responses to be retrieved. See 3399// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 3400// for more information. 3401func (c *ProjectsLocationsGlobalConnectivityTestsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsGlobalConnectivityTestsListCall { 3402 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 3403 return c 3404} 3405 3406// IfNoneMatch sets the optional parameter which makes the operation 3407// fail if the object's ETag matches the given value. This is useful for 3408// getting updates only after the object has changed since the last 3409// request. Use googleapi.IsNotModified to check whether the response 3410// error from Do is the result of In-None-Match. 3411func (c *ProjectsLocationsGlobalConnectivityTestsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsGlobalConnectivityTestsListCall { 3412 c.ifNoneMatch_ = entityTag 3413 return c 3414} 3415 3416// Context sets the context to be used in this call's Do method. Any 3417// pending HTTP request will be aborted if the provided context is 3418// canceled. 3419func (c *ProjectsLocationsGlobalConnectivityTestsListCall) Context(ctx context.Context) *ProjectsLocationsGlobalConnectivityTestsListCall { 3420 c.ctx_ = ctx 3421 return c 3422} 3423 3424// Header returns an http.Header that can be modified by the caller to 3425// add HTTP headers to the request. 3426func (c *ProjectsLocationsGlobalConnectivityTestsListCall) Header() http.Header { 3427 if c.header_ == nil { 3428 c.header_ = make(http.Header) 3429 } 3430 return c.header_ 3431} 3432 3433func (c *ProjectsLocationsGlobalConnectivityTestsListCall) doRequest(alt string) (*http.Response, error) { 3434 reqHeaders := make(http.Header) 3435 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124") 3436 for k, v := range c.header_ { 3437 reqHeaders[k] = v 3438 } 3439 reqHeaders.Set("User-Agent", c.s.userAgent()) 3440 if c.ifNoneMatch_ != "" { 3441 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 3442 } 3443 var body io.Reader = nil 3444 c.urlParams_.Set("alt", alt) 3445 c.urlParams_.Set("prettyPrint", "false") 3446 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/connectivityTests") 3447 urls += "?" + c.urlParams_.Encode() 3448 req, err := http.NewRequest("GET", urls, body) 3449 if err != nil { 3450 return nil, err 3451 } 3452 req.Header = reqHeaders 3453 googleapi.Expand(req.URL, map[string]string{ 3454 "parent": c.parent, 3455 }) 3456 return gensupport.SendRequest(c.ctx_, c.s.client, req) 3457} 3458 3459// Do executes the "networkmanagement.projects.locations.global.connectivityTests.list" call. 3460// Exactly one of *ListConnectivityTestsResponse or error will be 3461// non-nil. Any non-2xx status code is an error. Response headers are in 3462// either *ListConnectivityTestsResponse.ServerResponse.Header or (if a 3463// response was returned at all) in error.(*googleapi.Error).Header. Use 3464// googleapi.IsNotModified to check whether the returned error was 3465// because http.StatusNotModified was returned. 3466func (c *ProjectsLocationsGlobalConnectivityTestsListCall) Do(opts ...googleapi.CallOption) (*ListConnectivityTestsResponse, error) { 3467 gensupport.SetOptions(c.urlParams_, opts...) 3468 res, err := c.doRequest("json") 3469 if res != nil && res.StatusCode == http.StatusNotModified { 3470 if res.Body != nil { 3471 res.Body.Close() 3472 } 3473 return nil, &googleapi.Error{ 3474 Code: res.StatusCode, 3475 Header: res.Header, 3476 } 3477 } 3478 if err != nil { 3479 return nil, err 3480 } 3481 defer googleapi.CloseBody(res) 3482 if err := googleapi.CheckResponse(res); err != nil { 3483 return nil, err 3484 } 3485 ret := &ListConnectivityTestsResponse{ 3486 ServerResponse: googleapi.ServerResponse{ 3487 Header: res.Header, 3488 HTTPStatusCode: res.StatusCode, 3489 }, 3490 } 3491 target := &ret 3492 if err := gensupport.DecodeResponse(target, res); err != nil { 3493 return nil, err 3494 } 3495 return ret, nil 3496 // { 3497 // "description": "Lists all Connectivity Tests owned by a project.", 3498 // "flatPath": "v1beta1/projects/{projectsId}/locations/global/connectivityTests", 3499 // "httpMethod": "GET", 3500 // "id": "networkmanagement.projects.locations.global.connectivityTests.list", 3501 // "parameterOrder": [ 3502 // "parent" 3503 // ], 3504 // "parameters": { 3505 // "filter": { 3506 // "description": "Lists the `ConnectivityTests` that match the filter expression. A filter expression filters the resources listed in the response. The expression must be of the form ` ` where operators: `\u003c`, `\u003e`, `\u003c=`, `\u003e=`, `!=`, `=`, `:` are supported (colon `:` represents a HAS operator which is roughly synonymous with equality). can refer to a proto or JSON field, or a synthetic field. Field names can be camelCase or snake_case. Examples: - Filter by name: name = \"projects/proj-1/locations/global/connectivityTests/test-1 - Filter by labels: - Resources that have a key called `foo` labels.foo:* - Resources that have a key called `foo` whose value is `bar` labels.foo = bar", 3507 // "location": "query", 3508 // "type": "string" 3509 // }, 3510 // "orderBy": { 3511 // "description": "Field to use to sort the list.", 3512 // "location": "query", 3513 // "type": "string" 3514 // }, 3515 // "pageSize": { 3516 // "description": "Number of `ConnectivityTests` to return.", 3517 // "format": "int32", 3518 // "location": "query", 3519 // "type": "integer" 3520 // }, 3521 // "pageToken": { 3522 // "description": "Page token from an earlier query, as returned in `next_page_token`.", 3523 // "location": "query", 3524 // "type": "string" 3525 // }, 3526 // "parent": { 3527 // "description": "Required. The parent resource of the Connectivity Tests: `projects/{project_id}/locations/global`", 3528 // "location": "path", 3529 // "pattern": "^projects/[^/]+/locations/global$", 3530 // "required": true, 3531 // "type": "string" 3532 // } 3533 // }, 3534 // "path": "v1beta1/{+parent}/connectivityTests", 3535 // "response": { 3536 // "$ref": "ListConnectivityTestsResponse" 3537 // }, 3538 // "scopes": [ 3539 // "https://www.googleapis.com/auth/cloud-platform" 3540 // ] 3541 // } 3542 3543} 3544 3545// Pages invokes f for each page of results. 3546// A non-nil error returned from f will halt the iteration. 3547// The provided context supersedes any context provided to the Context method. 3548func (c *ProjectsLocationsGlobalConnectivityTestsListCall) Pages(ctx context.Context, f func(*ListConnectivityTestsResponse) error) error { 3549 c.ctx_ = ctx 3550 defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point 3551 for { 3552 x, err := c.Do() 3553 if err != nil { 3554 return err 3555 } 3556 if err := f(x); err != nil { 3557 return err 3558 } 3559 if x.NextPageToken == "" { 3560 return nil 3561 } 3562 c.PageToken(x.NextPageToken) 3563 } 3564} 3565 3566// method id "networkmanagement.projects.locations.global.connectivityTests.patch": 3567 3568type ProjectsLocationsGlobalConnectivityTestsPatchCall struct { 3569 s *Service 3570 name string 3571 connectivitytest *ConnectivityTest 3572 urlParams_ gensupport.URLParams 3573 ctx_ context.Context 3574 header_ http.Header 3575} 3576 3577// Patch: Updates the configuration of an existing `ConnectivityTest`. 3578// After you update a test, the reachability analysis is performed as 3579// part of the long running operation, which completes when the analysis 3580// completes. The Reachability state in the test resource is updated 3581// with the new result. If the endpoint specifications in 3582// `ConnectivityTest` are invalid (for example, they contain 3583// non-existent resources in the network, or the user does not have read 3584// permissions to the network configurations of listed projects), then 3585// the reachability result returns a value of UNKNOWN. If the endpoint 3586// specifications in `ConnectivityTest` are incomplete, the reachability 3587// result returns a value of `AMBIGUOUS`. See the documentation in 3588// `ConnectivityTest` for for more details. 3589func (r *ProjectsLocationsGlobalConnectivityTestsService) Patch(name string, connectivitytest *ConnectivityTest) *ProjectsLocationsGlobalConnectivityTestsPatchCall { 3590 c := &ProjectsLocationsGlobalConnectivityTestsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} 3591 c.name = name 3592 c.connectivitytest = connectivitytest 3593 return c 3594} 3595 3596// UpdateMask sets the optional parameter "updateMask": Required. Mask 3597// of fields to update. At least one path must be supplied in this 3598// field. 3599func (c *ProjectsLocationsGlobalConnectivityTestsPatchCall) UpdateMask(updateMask string) *ProjectsLocationsGlobalConnectivityTestsPatchCall { 3600 c.urlParams_.Set("updateMask", updateMask) 3601 return c 3602} 3603 3604// Fields allows partial responses to be retrieved. See 3605// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 3606// for more information. 3607func (c *ProjectsLocationsGlobalConnectivityTestsPatchCall) Fields(s ...googleapi.Field) *ProjectsLocationsGlobalConnectivityTestsPatchCall { 3608 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 3609 return c 3610} 3611 3612// Context sets the context to be used in this call's Do method. Any 3613// pending HTTP request will be aborted if the provided context is 3614// canceled. 3615func (c *ProjectsLocationsGlobalConnectivityTestsPatchCall) Context(ctx context.Context) *ProjectsLocationsGlobalConnectivityTestsPatchCall { 3616 c.ctx_ = ctx 3617 return c 3618} 3619 3620// Header returns an http.Header that can be modified by the caller to 3621// add HTTP headers to the request. 3622func (c *ProjectsLocationsGlobalConnectivityTestsPatchCall) Header() http.Header { 3623 if c.header_ == nil { 3624 c.header_ = make(http.Header) 3625 } 3626 return c.header_ 3627} 3628 3629func (c *ProjectsLocationsGlobalConnectivityTestsPatchCall) doRequest(alt string) (*http.Response, error) { 3630 reqHeaders := make(http.Header) 3631 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124") 3632 for k, v := range c.header_ { 3633 reqHeaders[k] = v 3634 } 3635 reqHeaders.Set("User-Agent", c.s.userAgent()) 3636 var body io.Reader = nil 3637 body, err := googleapi.WithoutDataWrapper.JSONReader(c.connectivitytest) 3638 if err != nil { 3639 return nil, err 3640 } 3641 reqHeaders.Set("Content-Type", "application/json") 3642 c.urlParams_.Set("alt", alt) 3643 c.urlParams_.Set("prettyPrint", "false") 3644 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") 3645 urls += "?" + c.urlParams_.Encode() 3646 req, err := http.NewRequest("PATCH", urls, body) 3647 if err != nil { 3648 return nil, err 3649 } 3650 req.Header = reqHeaders 3651 googleapi.Expand(req.URL, map[string]string{ 3652 "name": c.name, 3653 }) 3654 return gensupport.SendRequest(c.ctx_, c.s.client, req) 3655} 3656 3657// Do executes the "networkmanagement.projects.locations.global.connectivityTests.patch" call. 3658// Exactly one of *Operation or error will be non-nil. Any non-2xx 3659// status code is an error. Response headers are in either 3660// *Operation.ServerResponse.Header or (if a response was returned at 3661// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 3662// to check whether the returned error was because 3663// http.StatusNotModified was returned. 3664func (c *ProjectsLocationsGlobalConnectivityTestsPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 3665 gensupport.SetOptions(c.urlParams_, opts...) 3666 res, err := c.doRequest("json") 3667 if res != nil && res.StatusCode == http.StatusNotModified { 3668 if res.Body != nil { 3669 res.Body.Close() 3670 } 3671 return nil, &googleapi.Error{ 3672 Code: res.StatusCode, 3673 Header: res.Header, 3674 } 3675 } 3676 if err != nil { 3677 return nil, err 3678 } 3679 defer googleapi.CloseBody(res) 3680 if err := googleapi.CheckResponse(res); err != nil { 3681 return nil, err 3682 } 3683 ret := &Operation{ 3684 ServerResponse: googleapi.ServerResponse{ 3685 Header: res.Header, 3686 HTTPStatusCode: res.StatusCode, 3687 }, 3688 } 3689 target := &ret 3690 if err := gensupport.DecodeResponse(target, res); err != nil { 3691 return nil, err 3692 } 3693 return ret, nil 3694 // { 3695 // "description": "Updates the configuration of an existing `ConnectivityTest`. After you update a test, the reachability analysis is performed as part of the long running operation, which completes when the analysis completes. The Reachability state in the test resource is updated with the new result. If the endpoint specifications in `ConnectivityTest` are invalid (for example, they contain non-existent resources in the network, or the user does not have read permissions to the network configurations of listed projects), then the reachability result returns a value of UNKNOWN. If the endpoint specifications in `ConnectivityTest` are incomplete, the reachability result returns a value of `AMBIGUOUS`. See the documentation in `ConnectivityTest` for for more details.", 3696 // "flatPath": "v1beta1/projects/{projectsId}/locations/global/connectivityTests/{connectivityTestsId}", 3697 // "httpMethod": "PATCH", 3698 // "id": "networkmanagement.projects.locations.global.connectivityTests.patch", 3699 // "parameterOrder": [ 3700 // "name" 3701 // ], 3702 // "parameters": { 3703 // "name": { 3704 // "description": "Required. Unique name of the resource using the form: `projects/{project_id}/locations/global/connectivityTests/{test}`", 3705 // "location": "path", 3706 // "pattern": "^projects/[^/]+/locations/global/connectivityTests/[^/]+$", 3707 // "required": true, 3708 // "type": "string" 3709 // }, 3710 // "updateMask": { 3711 // "description": "Required. Mask of fields to update. At least one path must be supplied in this field.", 3712 // "format": "google-fieldmask", 3713 // "location": "query", 3714 // "type": "string" 3715 // } 3716 // }, 3717 // "path": "v1beta1/{+name}", 3718 // "request": { 3719 // "$ref": "ConnectivityTest" 3720 // }, 3721 // "response": { 3722 // "$ref": "Operation" 3723 // }, 3724 // "scopes": [ 3725 // "https://www.googleapis.com/auth/cloud-platform" 3726 // ] 3727 // } 3728 3729} 3730 3731// method id "networkmanagement.projects.locations.global.connectivityTests.rerun": 3732 3733type ProjectsLocationsGlobalConnectivityTestsRerunCall struct { 3734 s *Service 3735 name string 3736 rerunconnectivitytestrequest *RerunConnectivityTestRequest 3737 urlParams_ gensupport.URLParams 3738 ctx_ context.Context 3739 header_ http.Header 3740} 3741 3742// Rerun: Rerun an existing `ConnectivityTest`. After the user triggers 3743// the rerun, the reachability analysis is performed as part of the long 3744// running operation, which completes when the analysis completes. Even 3745// though the test configuration remains the same, the reachability 3746// result may change due to underlying network configuration changes. If 3747// the endpoint specifications in `ConnectivityTest` become invalid (for 3748// example, specified resources are deleted in the network, or you lost 3749// read permissions to the network configurations of listed projects), 3750// then the reachability result returns a value of `UNKNOWN`. 3751func (r *ProjectsLocationsGlobalConnectivityTestsService) Rerun(name string, rerunconnectivitytestrequest *RerunConnectivityTestRequest) *ProjectsLocationsGlobalConnectivityTestsRerunCall { 3752 c := &ProjectsLocationsGlobalConnectivityTestsRerunCall{s: r.s, urlParams_: make(gensupport.URLParams)} 3753 c.name = name 3754 c.rerunconnectivitytestrequest = rerunconnectivitytestrequest 3755 return c 3756} 3757 3758// Fields allows partial responses to be retrieved. See 3759// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 3760// for more information. 3761func (c *ProjectsLocationsGlobalConnectivityTestsRerunCall) Fields(s ...googleapi.Field) *ProjectsLocationsGlobalConnectivityTestsRerunCall { 3762 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 3763 return c 3764} 3765 3766// Context sets the context to be used in this call's Do method. Any 3767// pending HTTP request will be aborted if the provided context is 3768// canceled. 3769func (c *ProjectsLocationsGlobalConnectivityTestsRerunCall) Context(ctx context.Context) *ProjectsLocationsGlobalConnectivityTestsRerunCall { 3770 c.ctx_ = ctx 3771 return c 3772} 3773 3774// Header returns an http.Header that can be modified by the caller to 3775// add HTTP headers to the request. 3776func (c *ProjectsLocationsGlobalConnectivityTestsRerunCall) Header() http.Header { 3777 if c.header_ == nil { 3778 c.header_ = make(http.Header) 3779 } 3780 return c.header_ 3781} 3782 3783func (c *ProjectsLocationsGlobalConnectivityTestsRerunCall) doRequest(alt string) (*http.Response, error) { 3784 reqHeaders := make(http.Header) 3785 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124") 3786 for k, v := range c.header_ { 3787 reqHeaders[k] = v 3788 } 3789 reqHeaders.Set("User-Agent", c.s.userAgent()) 3790 var body io.Reader = nil 3791 body, err := googleapi.WithoutDataWrapper.JSONReader(c.rerunconnectivitytestrequest) 3792 if err != nil { 3793 return nil, err 3794 } 3795 reqHeaders.Set("Content-Type", "application/json") 3796 c.urlParams_.Set("alt", alt) 3797 c.urlParams_.Set("prettyPrint", "false") 3798 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}:rerun") 3799 urls += "?" + c.urlParams_.Encode() 3800 req, err := http.NewRequest("POST", urls, body) 3801 if err != nil { 3802 return nil, err 3803 } 3804 req.Header = reqHeaders 3805 googleapi.Expand(req.URL, map[string]string{ 3806 "name": c.name, 3807 }) 3808 return gensupport.SendRequest(c.ctx_, c.s.client, req) 3809} 3810 3811// Do executes the "networkmanagement.projects.locations.global.connectivityTests.rerun" call. 3812// Exactly one of *Operation or error will be non-nil. Any non-2xx 3813// status code is an error. Response headers are in either 3814// *Operation.ServerResponse.Header or (if a response was returned at 3815// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 3816// to check whether the returned error was because 3817// http.StatusNotModified was returned. 3818func (c *ProjectsLocationsGlobalConnectivityTestsRerunCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 3819 gensupport.SetOptions(c.urlParams_, opts...) 3820 res, err := c.doRequest("json") 3821 if res != nil && res.StatusCode == http.StatusNotModified { 3822 if res.Body != nil { 3823 res.Body.Close() 3824 } 3825 return nil, &googleapi.Error{ 3826 Code: res.StatusCode, 3827 Header: res.Header, 3828 } 3829 } 3830 if err != nil { 3831 return nil, err 3832 } 3833 defer googleapi.CloseBody(res) 3834 if err := googleapi.CheckResponse(res); err != nil { 3835 return nil, err 3836 } 3837 ret := &Operation{ 3838 ServerResponse: googleapi.ServerResponse{ 3839 Header: res.Header, 3840 HTTPStatusCode: res.StatusCode, 3841 }, 3842 } 3843 target := &ret 3844 if err := gensupport.DecodeResponse(target, res); err != nil { 3845 return nil, err 3846 } 3847 return ret, nil 3848 // { 3849 // "description": "Rerun an existing `ConnectivityTest`. After the user triggers the rerun, the reachability analysis is performed as part of the long running operation, which completes when the analysis completes. Even though the test configuration remains the same, the reachability result may change due to underlying network configuration changes. If the endpoint specifications in `ConnectivityTest` become invalid (for example, specified resources are deleted in the network, or you lost read permissions to the network configurations of listed projects), then the reachability result returns a value of `UNKNOWN`.", 3850 // "flatPath": "v1beta1/projects/{projectsId}/locations/global/connectivityTests/{connectivityTestsId}:rerun", 3851 // "httpMethod": "POST", 3852 // "id": "networkmanagement.projects.locations.global.connectivityTests.rerun", 3853 // "parameterOrder": [ 3854 // "name" 3855 // ], 3856 // "parameters": { 3857 // "name": { 3858 // "description": "Required. Connectivity Test resource name using the form: `projects/{project_id}/locations/global/connectivityTests/{test_id}`", 3859 // "location": "path", 3860 // "pattern": "^projects/[^/]+/locations/global/connectivityTests/[^/]+$", 3861 // "required": true, 3862 // "type": "string" 3863 // } 3864 // }, 3865 // "path": "v1beta1/{+name}:rerun", 3866 // "request": { 3867 // "$ref": "RerunConnectivityTestRequest" 3868 // }, 3869 // "response": { 3870 // "$ref": "Operation" 3871 // }, 3872 // "scopes": [ 3873 // "https://www.googleapis.com/auth/cloud-platform" 3874 // ] 3875 // } 3876 3877} 3878 3879// method id "networkmanagement.projects.locations.global.connectivityTests.setIamPolicy": 3880 3881type ProjectsLocationsGlobalConnectivityTestsSetIamPolicyCall struct { 3882 s *Service 3883 resource string 3884 setiampolicyrequest *SetIamPolicyRequest 3885 urlParams_ gensupport.URLParams 3886 ctx_ context.Context 3887 header_ http.Header 3888} 3889 3890// SetIamPolicy: Sets the access control policy on the specified 3891// resource. Replaces any existing policy. Can return `NOT_FOUND`, 3892// `INVALID_ARGUMENT`, and `PERMISSION_DENIED` errors. 3893func (r *ProjectsLocationsGlobalConnectivityTestsService) SetIamPolicy(resource string, setiampolicyrequest *SetIamPolicyRequest) *ProjectsLocationsGlobalConnectivityTestsSetIamPolicyCall { 3894 c := &ProjectsLocationsGlobalConnectivityTestsSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)} 3895 c.resource = resource 3896 c.setiampolicyrequest = setiampolicyrequest 3897 return c 3898} 3899 3900// Fields allows partial responses to be retrieved. See 3901// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 3902// for more information. 3903func (c *ProjectsLocationsGlobalConnectivityTestsSetIamPolicyCall) Fields(s ...googleapi.Field) *ProjectsLocationsGlobalConnectivityTestsSetIamPolicyCall { 3904 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 3905 return c 3906} 3907 3908// Context sets the context to be used in this call's Do method. Any 3909// pending HTTP request will be aborted if the provided context is 3910// canceled. 3911func (c *ProjectsLocationsGlobalConnectivityTestsSetIamPolicyCall) Context(ctx context.Context) *ProjectsLocationsGlobalConnectivityTestsSetIamPolicyCall { 3912 c.ctx_ = ctx 3913 return c 3914} 3915 3916// Header returns an http.Header that can be modified by the caller to 3917// add HTTP headers to the request. 3918func (c *ProjectsLocationsGlobalConnectivityTestsSetIamPolicyCall) Header() http.Header { 3919 if c.header_ == nil { 3920 c.header_ = make(http.Header) 3921 } 3922 return c.header_ 3923} 3924 3925func (c *ProjectsLocationsGlobalConnectivityTestsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { 3926 reqHeaders := make(http.Header) 3927 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124") 3928 for k, v := range c.header_ { 3929 reqHeaders[k] = v 3930 } 3931 reqHeaders.Set("User-Agent", c.s.userAgent()) 3932 var body io.Reader = nil 3933 body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest) 3934 if err != nil { 3935 return nil, err 3936 } 3937 reqHeaders.Set("Content-Type", "application/json") 3938 c.urlParams_.Set("alt", alt) 3939 c.urlParams_.Set("prettyPrint", "false") 3940 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+resource}:setIamPolicy") 3941 urls += "?" + c.urlParams_.Encode() 3942 req, err := http.NewRequest("POST", urls, body) 3943 if err != nil { 3944 return nil, err 3945 } 3946 req.Header = reqHeaders 3947 googleapi.Expand(req.URL, map[string]string{ 3948 "resource": c.resource, 3949 }) 3950 return gensupport.SendRequest(c.ctx_, c.s.client, req) 3951} 3952 3953// Do executes the "networkmanagement.projects.locations.global.connectivityTests.setIamPolicy" call. 3954// Exactly one of *Policy or error will be non-nil. Any non-2xx status 3955// code is an error. Response headers are in either 3956// *Policy.ServerResponse.Header or (if a response was returned at all) 3957// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 3958// check whether the returned error was because http.StatusNotModified 3959// was returned. 3960func (c *ProjectsLocationsGlobalConnectivityTestsSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) { 3961 gensupport.SetOptions(c.urlParams_, opts...) 3962 res, err := c.doRequest("json") 3963 if res != nil && res.StatusCode == http.StatusNotModified { 3964 if res.Body != nil { 3965 res.Body.Close() 3966 } 3967 return nil, &googleapi.Error{ 3968 Code: res.StatusCode, 3969 Header: res.Header, 3970 } 3971 } 3972 if err != nil { 3973 return nil, err 3974 } 3975 defer googleapi.CloseBody(res) 3976 if err := googleapi.CheckResponse(res); err != nil { 3977 return nil, err 3978 } 3979 ret := &Policy{ 3980 ServerResponse: googleapi.ServerResponse{ 3981 Header: res.Header, 3982 HTTPStatusCode: res.StatusCode, 3983 }, 3984 } 3985 target := &ret 3986 if err := gensupport.DecodeResponse(target, res); err != nil { 3987 return nil, err 3988 } 3989 return ret, nil 3990 // { 3991 // "description": "Sets the access control policy on the specified resource. Replaces any existing policy. Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED` errors.", 3992 // "flatPath": "v1beta1/projects/{projectsId}/locations/global/connectivityTests/{connectivityTestsId}:setIamPolicy", 3993 // "httpMethod": "POST", 3994 // "id": "networkmanagement.projects.locations.global.connectivityTests.setIamPolicy", 3995 // "parameterOrder": [ 3996 // "resource" 3997 // ], 3998 // "parameters": { 3999 // "resource": { 4000 // "description": "REQUIRED: The resource for which the policy is being specified. See the operation documentation for the appropriate value for this field.", 4001 // "location": "path", 4002 // "pattern": "^projects/[^/]+/locations/global/connectivityTests/[^/]+$", 4003 // "required": true, 4004 // "type": "string" 4005 // } 4006 // }, 4007 // "path": "v1beta1/{+resource}:setIamPolicy", 4008 // "request": { 4009 // "$ref": "SetIamPolicyRequest" 4010 // }, 4011 // "response": { 4012 // "$ref": "Policy" 4013 // }, 4014 // "scopes": [ 4015 // "https://www.googleapis.com/auth/cloud-platform" 4016 // ] 4017 // } 4018 4019} 4020 4021// method id "networkmanagement.projects.locations.global.connectivityTests.testIamPermissions": 4022 4023type ProjectsLocationsGlobalConnectivityTestsTestIamPermissionsCall struct { 4024 s *Service 4025 resource string 4026 testiampermissionsrequest *TestIamPermissionsRequest 4027 urlParams_ gensupport.URLParams 4028 ctx_ context.Context 4029 header_ http.Header 4030} 4031 4032// TestIamPermissions: Returns permissions that a caller has on the 4033// specified resource. If the resource does not exist, this will return 4034// an empty set of permissions, not a `NOT_FOUND` error. Note: This 4035// operation is designed to be used for building permission-aware UIs 4036// and command-line tools, not for authorization checking. This 4037// operation may "fail open" without warning. 4038func (r *ProjectsLocationsGlobalConnectivityTestsService) TestIamPermissions(resource string, testiampermissionsrequest *TestIamPermissionsRequest) *ProjectsLocationsGlobalConnectivityTestsTestIamPermissionsCall { 4039 c := &ProjectsLocationsGlobalConnectivityTestsTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)} 4040 c.resource = resource 4041 c.testiampermissionsrequest = testiampermissionsrequest 4042 return c 4043} 4044 4045// Fields allows partial responses to be retrieved. See 4046// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 4047// for more information. 4048func (c *ProjectsLocationsGlobalConnectivityTestsTestIamPermissionsCall) Fields(s ...googleapi.Field) *ProjectsLocationsGlobalConnectivityTestsTestIamPermissionsCall { 4049 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 4050 return c 4051} 4052 4053// Context sets the context to be used in this call's Do method. Any 4054// pending HTTP request will be aborted if the provided context is 4055// canceled. 4056func (c *ProjectsLocationsGlobalConnectivityTestsTestIamPermissionsCall) Context(ctx context.Context) *ProjectsLocationsGlobalConnectivityTestsTestIamPermissionsCall { 4057 c.ctx_ = ctx 4058 return c 4059} 4060 4061// Header returns an http.Header that can be modified by the caller to 4062// add HTTP headers to the request. 4063func (c *ProjectsLocationsGlobalConnectivityTestsTestIamPermissionsCall) Header() http.Header { 4064 if c.header_ == nil { 4065 c.header_ = make(http.Header) 4066 } 4067 return c.header_ 4068} 4069 4070func (c *ProjectsLocationsGlobalConnectivityTestsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { 4071 reqHeaders := make(http.Header) 4072 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124") 4073 for k, v := range c.header_ { 4074 reqHeaders[k] = v 4075 } 4076 reqHeaders.Set("User-Agent", c.s.userAgent()) 4077 var body io.Reader = nil 4078 body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest) 4079 if err != nil { 4080 return nil, err 4081 } 4082 reqHeaders.Set("Content-Type", "application/json") 4083 c.urlParams_.Set("alt", alt) 4084 c.urlParams_.Set("prettyPrint", "false") 4085 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+resource}:testIamPermissions") 4086 urls += "?" + c.urlParams_.Encode() 4087 req, err := http.NewRequest("POST", urls, body) 4088 if err != nil { 4089 return nil, err 4090 } 4091 req.Header = reqHeaders 4092 googleapi.Expand(req.URL, map[string]string{ 4093 "resource": c.resource, 4094 }) 4095 return gensupport.SendRequest(c.ctx_, c.s.client, req) 4096} 4097 4098// Do executes the "networkmanagement.projects.locations.global.connectivityTests.testIamPermissions" call. 4099// Exactly one of *TestIamPermissionsResponse or error will be non-nil. 4100// Any non-2xx status code is an error. Response headers are in either 4101// *TestIamPermissionsResponse.ServerResponse.Header or (if a response 4102// was returned at all) in error.(*googleapi.Error).Header. Use 4103// googleapi.IsNotModified to check whether the returned error was 4104// because http.StatusNotModified was returned. 4105func (c *ProjectsLocationsGlobalConnectivityTestsTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestIamPermissionsResponse, error) { 4106 gensupport.SetOptions(c.urlParams_, opts...) 4107 res, err := c.doRequest("json") 4108 if res != nil && res.StatusCode == http.StatusNotModified { 4109 if res.Body != nil { 4110 res.Body.Close() 4111 } 4112 return nil, &googleapi.Error{ 4113 Code: res.StatusCode, 4114 Header: res.Header, 4115 } 4116 } 4117 if err != nil { 4118 return nil, err 4119 } 4120 defer googleapi.CloseBody(res) 4121 if err := googleapi.CheckResponse(res); err != nil { 4122 return nil, err 4123 } 4124 ret := &TestIamPermissionsResponse{ 4125 ServerResponse: googleapi.ServerResponse{ 4126 Header: res.Header, 4127 HTTPStatusCode: res.StatusCode, 4128 }, 4129 } 4130 target := &ret 4131 if err := gensupport.DecodeResponse(target, res); err != nil { 4132 return nil, err 4133 } 4134 return ret, nil 4135 // { 4136 // "description": "Returns permissions that a caller has on the specified resource. If the resource does not exist, this will return an empty set of permissions, not a `NOT_FOUND` error. Note: This operation is designed to be used for building permission-aware UIs and command-line tools, not for authorization checking. This operation may \"fail open\" without warning.", 4137 // "flatPath": "v1beta1/projects/{projectsId}/locations/global/connectivityTests/{connectivityTestsId}:testIamPermissions", 4138 // "httpMethod": "POST", 4139 // "id": "networkmanagement.projects.locations.global.connectivityTests.testIamPermissions", 4140 // "parameterOrder": [ 4141 // "resource" 4142 // ], 4143 // "parameters": { 4144 // "resource": { 4145 // "description": "REQUIRED: The resource for which the policy detail is being requested. See the operation documentation for the appropriate value for this field.", 4146 // "location": "path", 4147 // "pattern": "^projects/[^/]+/locations/global/connectivityTests/[^/]+$", 4148 // "required": true, 4149 // "type": "string" 4150 // } 4151 // }, 4152 // "path": "v1beta1/{+resource}:testIamPermissions", 4153 // "request": { 4154 // "$ref": "TestIamPermissionsRequest" 4155 // }, 4156 // "response": { 4157 // "$ref": "TestIamPermissionsResponse" 4158 // }, 4159 // "scopes": [ 4160 // "https://www.googleapis.com/auth/cloud-platform" 4161 // ] 4162 // } 4163 4164} 4165 4166// method id "networkmanagement.projects.locations.global.operations.cancel": 4167 4168type ProjectsLocationsGlobalOperationsCancelCall struct { 4169 s *Service 4170 name string 4171 canceloperationrequest *CancelOperationRequest 4172 urlParams_ gensupport.URLParams 4173 ctx_ context.Context 4174 header_ http.Header 4175} 4176 4177// Cancel: Starts asynchronous cancellation on a long-running operation. 4178// The server makes a best effort to cancel the operation, but success 4179// is not guaranteed. If the server doesn't support this method, it 4180// returns `google.rpc.Code.UNIMPLEMENTED`. Clients can use 4181// Operations.GetOperation or other methods to check whether the 4182// cancellation succeeded or whether the operation completed despite 4183// cancellation. On successful cancellation, the operation is not 4184// deleted; instead, it becomes an operation with an Operation.error 4185// value with a google.rpc.Status.code of 1, corresponding to 4186// `Code.CANCELLED`. 4187func (r *ProjectsLocationsGlobalOperationsService) Cancel(name string, canceloperationrequest *CancelOperationRequest) *ProjectsLocationsGlobalOperationsCancelCall { 4188 c := &ProjectsLocationsGlobalOperationsCancelCall{s: r.s, urlParams_: make(gensupport.URLParams)} 4189 c.name = name 4190 c.canceloperationrequest = canceloperationrequest 4191 return c 4192} 4193 4194// Fields allows partial responses to be retrieved. See 4195// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 4196// for more information. 4197func (c *ProjectsLocationsGlobalOperationsCancelCall) Fields(s ...googleapi.Field) *ProjectsLocationsGlobalOperationsCancelCall { 4198 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 4199 return c 4200} 4201 4202// Context sets the context to be used in this call's Do method. Any 4203// pending HTTP request will be aborted if the provided context is 4204// canceled. 4205func (c *ProjectsLocationsGlobalOperationsCancelCall) Context(ctx context.Context) *ProjectsLocationsGlobalOperationsCancelCall { 4206 c.ctx_ = ctx 4207 return c 4208} 4209 4210// Header returns an http.Header that can be modified by the caller to 4211// add HTTP headers to the request. 4212func (c *ProjectsLocationsGlobalOperationsCancelCall) Header() http.Header { 4213 if c.header_ == nil { 4214 c.header_ = make(http.Header) 4215 } 4216 return c.header_ 4217} 4218 4219func (c *ProjectsLocationsGlobalOperationsCancelCall) doRequest(alt string) (*http.Response, error) { 4220 reqHeaders := make(http.Header) 4221 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124") 4222 for k, v := range c.header_ { 4223 reqHeaders[k] = v 4224 } 4225 reqHeaders.Set("User-Agent", c.s.userAgent()) 4226 var body io.Reader = nil 4227 body, err := googleapi.WithoutDataWrapper.JSONReader(c.canceloperationrequest) 4228 if err != nil { 4229 return nil, err 4230 } 4231 reqHeaders.Set("Content-Type", "application/json") 4232 c.urlParams_.Set("alt", alt) 4233 c.urlParams_.Set("prettyPrint", "false") 4234 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}:cancel") 4235 urls += "?" + c.urlParams_.Encode() 4236 req, err := http.NewRequest("POST", urls, body) 4237 if err != nil { 4238 return nil, err 4239 } 4240 req.Header = reqHeaders 4241 googleapi.Expand(req.URL, map[string]string{ 4242 "name": c.name, 4243 }) 4244 return gensupport.SendRequest(c.ctx_, c.s.client, req) 4245} 4246 4247// Do executes the "networkmanagement.projects.locations.global.operations.cancel" call. 4248// Exactly one of *Empty or error will be non-nil. Any non-2xx status 4249// code is an error. Response headers are in either 4250// *Empty.ServerResponse.Header or (if a response was returned at all) 4251// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 4252// check whether the returned error was because http.StatusNotModified 4253// was returned. 4254func (c *ProjectsLocationsGlobalOperationsCancelCall) Do(opts ...googleapi.CallOption) (*Empty, error) { 4255 gensupport.SetOptions(c.urlParams_, opts...) 4256 res, err := c.doRequest("json") 4257 if res != nil && res.StatusCode == http.StatusNotModified { 4258 if res.Body != nil { 4259 res.Body.Close() 4260 } 4261 return nil, &googleapi.Error{ 4262 Code: res.StatusCode, 4263 Header: res.Header, 4264 } 4265 } 4266 if err != nil { 4267 return nil, err 4268 } 4269 defer googleapi.CloseBody(res) 4270 if err := googleapi.CheckResponse(res); err != nil { 4271 return nil, err 4272 } 4273 ret := &Empty{ 4274 ServerResponse: googleapi.ServerResponse{ 4275 Header: res.Header, 4276 HTTPStatusCode: res.StatusCode, 4277 }, 4278 } 4279 target := &ret 4280 if err := gensupport.DecodeResponse(target, res); err != nil { 4281 return nil, err 4282 } 4283 return ret, nil 4284 // { 4285 // "description": "Starts asynchronous cancellation on a long-running operation. The server makes a best effort to cancel the operation, but success is not guaranteed. If the server doesn't support this method, it returns `google.rpc.Code.UNIMPLEMENTED`. Clients can use Operations.GetOperation or other methods to check whether the cancellation succeeded or whether the operation completed despite cancellation. On successful cancellation, the operation is not deleted; instead, it becomes an operation with an Operation.error value with a google.rpc.Status.code of 1, corresponding to `Code.CANCELLED`.", 4286 // "flatPath": "v1beta1/projects/{projectsId}/locations/global/operations/{operationsId}:cancel", 4287 // "httpMethod": "POST", 4288 // "id": "networkmanagement.projects.locations.global.operations.cancel", 4289 // "parameterOrder": [ 4290 // "name" 4291 // ], 4292 // "parameters": { 4293 // "name": { 4294 // "description": "The name of the operation resource to be cancelled.", 4295 // "location": "path", 4296 // "pattern": "^projects/[^/]+/locations/global/operations/[^/]+$", 4297 // "required": true, 4298 // "type": "string" 4299 // } 4300 // }, 4301 // "path": "v1beta1/{+name}:cancel", 4302 // "request": { 4303 // "$ref": "CancelOperationRequest" 4304 // }, 4305 // "response": { 4306 // "$ref": "Empty" 4307 // }, 4308 // "scopes": [ 4309 // "https://www.googleapis.com/auth/cloud-platform" 4310 // ] 4311 // } 4312 4313} 4314 4315// method id "networkmanagement.projects.locations.global.operations.delete": 4316 4317type ProjectsLocationsGlobalOperationsDeleteCall struct { 4318 s *Service 4319 name string 4320 urlParams_ gensupport.URLParams 4321 ctx_ context.Context 4322 header_ http.Header 4323} 4324 4325// Delete: Deletes a long-running operation. This method indicates that 4326// the client is no longer interested in the operation result. It does 4327// not cancel the operation. If the server doesn't support this method, 4328// it returns `google.rpc.Code.UNIMPLEMENTED`. 4329func (r *ProjectsLocationsGlobalOperationsService) Delete(name string) *ProjectsLocationsGlobalOperationsDeleteCall { 4330 c := &ProjectsLocationsGlobalOperationsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} 4331 c.name = name 4332 return c 4333} 4334 4335// Fields allows partial responses to be retrieved. See 4336// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 4337// for more information. 4338func (c *ProjectsLocationsGlobalOperationsDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsGlobalOperationsDeleteCall { 4339 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 4340 return c 4341} 4342 4343// Context sets the context to be used in this call's Do method. Any 4344// pending HTTP request will be aborted if the provided context is 4345// canceled. 4346func (c *ProjectsLocationsGlobalOperationsDeleteCall) Context(ctx context.Context) *ProjectsLocationsGlobalOperationsDeleteCall { 4347 c.ctx_ = ctx 4348 return c 4349} 4350 4351// Header returns an http.Header that can be modified by the caller to 4352// add HTTP headers to the request. 4353func (c *ProjectsLocationsGlobalOperationsDeleteCall) Header() http.Header { 4354 if c.header_ == nil { 4355 c.header_ = make(http.Header) 4356 } 4357 return c.header_ 4358} 4359 4360func (c *ProjectsLocationsGlobalOperationsDeleteCall) doRequest(alt string) (*http.Response, error) { 4361 reqHeaders := make(http.Header) 4362 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124") 4363 for k, v := range c.header_ { 4364 reqHeaders[k] = v 4365 } 4366 reqHeaders.Set("User-Agent", c.s.userAgent()) 4367 var body io.Reader = nil 4368 c.urlParams_.Set("alt", alt) 4369 c.urlParams_.Set("prettyPrint", "false") 4370 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") 4371 urls += "?" + c.urlParams_.Encode() 4372 req, err := http.NewRequest("DELETE", urls, body) 4373 if err != nil { 4374 return nil, err 4375 } 4376 req.Header = reqHeaders 4377 googleapi.Expand(req.URL, map[string]string{ 4378 "name": c.name, 4379 }) 4380 return gensupport.SendRequest(c.ctx_, c.s.client, req) 4381} 4382 4383// Do executes the "networkmanagement.projects.locations.global.operations.delete" call. 4384// Exactly one of *Empty or error will be non-nil. Any non-2xx status 4385// code is an error. Response headers are in either 4386// *Empty.ServerResponse.Header or (if a response was returned at all) 4387// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 4388// check whether the returned error was because http.StatusNotModified 4389// was returned. 4390func (c *ProjectsLocationsGlobalOperationsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) { 4391 gensupport.SetOptions(c.urlParams_, opts...) 4392 res, err := c.doRequest("json") 4393 if res != nil && res.StatusCode == http.StatusNotModified { 4394 if res.Body != nil { 4395 res.Body.Close() 4396 } 4397 return nil, &googleapi.Error{ 4398 Code: res.StatusCode, 4399 Header: res.Header, 4400 } 4401 } 4402 if err != nil { 4403 return nil, err 4404 } 4405 defer googleapi.CloseBody(res) 4406 if err := googleapi.CheckResponse(res); err != nil { 4407 return nil, err 4408 } 4409 ret := &Empty{ 4410 ServerResponse: googleapi.ServerResponse{ 4411 Header: res.Header, 4412 HTTPStatusCode: res.StatusCode, 4413 }, 4414 } 4415 target := &ret 4416 if err := gensupport.DecodeResponse(target, res); err != nil { 4417 return nil, err 4418 } 4419 return ret, nil 4420 // { 4421 // "description": "Deletes a long-running operation. This method indicates that the client is no longer interested in the operation result. It does not cancel the operation. If the server doesn't support this method, it returns `google.rpc.Code.UNIMPLEMENTED`.", 4422 // "flatPath": "v1beta1/projects/{projectsId}/locations/global/operations/{operationsId}", 4423 // "httpMethod": "DELETE", 4424 // "id": "networkmanagement.projects.locations.global.operations.delete", 4425 // "parameterOrder": [ 4426 // "name" 4427 // ], 4428 // "parameters": { 4429 // "name": { 4430 // "description": "The name of the operation resource to be deleted.", 4431 // "location": "path", 4432 // "pattern": "^projects/[^/]+/locations/global/operations/[^/]+$", 4433 // "required": true, 4434 // "type": "string" 4435 // } 4436 // }, 4437 // "path": "v1beta1/{+name}", 4438 // "response": { 4439 // "$ref": "Empty" 4440 // }, 4441 // "scopes": [ 4442 // "https://www.googleapis.com/auth/cloud-platform" 4443 // ] 4444 // } 4445 4446} 4447 4448// method id "networkmanagement.projects.locations.global.operations.get": 4449 4450type ProjectsLocationsGlobalOperationsGetCall struct { 4451 s *Service 4452 name string 4453 urlParams_ gensupport.URLParams 4454 ifNoneMatch_ string 4455 ctx_ context.Context 4456 header_ http.Header 4457} 4458 4459// Get: Gets the latest state of a long-running operation. Clients can 4460// use this method to poll the operation result at intervals as 4461// recommended by the API service. 4462func (r *ProjectsLocationsGlobalOperationsService) Get(name string) *ProjectsLocationsGlobalOperationsGetCall { 4463 c := &ProjectsLocationsGlobalOperationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 4464 c.name = name 4465 return c 4466} 4467 4468// Fields allows partial responses to be retrieved. See 4469// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 4470// for more information. 4471func (c *ProjectsLocationsGlobalOperationsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsGlobalOperationsGetCall { 4472 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 4473 return c 4474} 4475 4476// IfNoneMatch sets the optional parameter which makes the operation 4477// fail if the object's ETag matches the given value. This is useful for 4478// getting updates only after the object has changed since the last 4479// request. Use googleapi.IsNotModified to check whether the response 4480// error from Do is the result of In-None-Match. 4481func (c *ProjectsLocationsGlobalOperationsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsGlobalOperationsGetCall { 4482 c.ifNoneMatch_ = entityTag 4483 return c 4484} 4485 4486// Context sets the context to be used in this call's Do method. Any 4487// pending HTTP request will be aborted if the provided context is 4488// canceled. 4489func (c *ProjectsLocationsGlobalOperationsGetCall) Context(ctx context.Context) *ProjectsLocationsGlobalOperationsGetCall { 4490 c.ctx_ = ctx 4491 return c 4492} 4493 4494// Header returns an http.Header that can be modified by the caller to 4495// add HTTP headers to the request. 4496func (c *ProjectsLocationsGlobalOperationsGetCall) Header() http.Header { 4497 if c.header_ == nil { 4498 c.header_ = make(http.Header) 4499 } 4500 return c.header_ 4501} 4502 4503func (c *ProjectsLocationsGlobalOperationsGetCall) doRequest(alt string) (*http.Response, error) { 4504 reqHeaders := make(http.Header) 4505 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124") 4506 for k, v := range c.header_ { 4507 reqHeaders[k] = v 4508 } 4509 reqHeaders.Set("User-Agent", c.s.userAgent()) 4510 if c.ifNoneMatch_ != "" { 4511 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 4512 } 4513 var body io.Reader = nil 4514 c.urlParams_.Set("alt", alt) 4515 c.urlParams_.Set("prettyPrint", "false") 4516 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") 4517 urls += "?" + c.urlParams_.Encode() 4518 req, err := http.NewRequest("GET", urls, body) 4519 if err != nil { 4520 return nil, err 4521 } 4522 req.Header = reqHeaders 4523 googleapi.Expand(req.URL, map[string]string{ 4524 "name": c.name, 4525 }) 4526 return gensupport.SendRequest(c.ctx_, c.s.client, req) 4527} 4528 4529// Do executes the "networkmanagement.projects.locations.global.operations.get" call. 4530// Exactly one of *Operation or error will be non-nil. Any non-2xx 4531// status code is an error. Response headers are in either 4532// *Operation.ServerResponse.Header or (if a response was returned at 4533// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 4534// to check whether the returned error was because 4535// http.StatusNotModified was returned. 4536func (c *ProjectsLocationsGlobalOperationsGetCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 4537 gensupport.SetOptions(c.urlParams_, opts...) 4538 res, err := c.doRequest("json") 4539 if res != nil && res.StatusCode == http.StatusNotModified { 4540 if res.Body != nil { 4541 res.Body.Close() 4542 } 4543 return nil, &googleapi.Error{ 4544 Code: res.StatusCode, 4545 Header: res.Header, 4546 } 4547 } 4548 if err != nil { 4549 return nil, err 4550 } 4551 defer googleapi.CloseBody(res) 4552 if err := googleapi.CheckResponse(res); err != nil { 4553 return nil, err 4554 } 4555 ret := &Operation{ 4556 ServerResponse: googleapi.ServerResponse{ 4557 Header: res.Header, 4558 HTTPStatusCode: res.StatusCode, 4559 }, 4560 } 4561 target := &ret 4562 if err := gensupport.DecodeResponse(target, res); err != nil { 4563 return nil, err 4564 } 4565 return ret, nil 4566 // { 4567 // "description": "Gets the latest state of a long-running operation. Clients can use this method to poll the operation result at intervals as recommended by the API service.", 4568 // "flatPath": "v1beta1/projects/{projectsId}/locations/global/operations/{operationsId}", 4569 // "httpMethod": "GET", 4570 // "id": "networkmanagement.projects.locations.global.operations.get", 4571 // "parameterOrder": [ 4572 // "name" 4573 // ], 4574 // "parameters": { 4575 // "name": { 4576 // "description": "The name of the operation resource.", 4577 // "location": "path", 4578 // "pattern": "^projects/[^/]+/locations/global/operations/[^/]+$", 4579 // "required": true, 4580 // "type": "string" 4581 // } 4582 // }, 4583 // "path": "v1beta1/{+name}", 4584 // "response": { 4585 // "$ref": "Operation" 4586 // }, 4587 // "scopes": [ 4588 // "https://www.googleapis.com/auth/cloud-platform" 4589 // ] 4590 // } 4591 4592} 4593 4594// method id "networkmanagement.projects.locations.global.operations.list": 4595 4596type ProjectsLocationsGlobalOperationsListCall struct { 4597 s *Service 4598 name string 4599 urlParams_ gensupport.URLParams 4600 ifNoneMatch_ string 4601 ctx_ context.Context 4602 header_ http.Header 4603} 4604 4605// List: Lists operations that match the specified filter in the 4606// request. If the server doesn't support this method, it returns 4607// `UNIMPLEMENTED`. NOTE: the `name` binding allows API services to 4608// override the binding to use different resource name schemes, such as 4609// `users/*/operations`. To override the binding, API services can add a 4610// binding such as "/v1/{name=users/*}/operations" to their service 4611// configuration. For backwards compatibility, the default name includes 4612// the operations collection id, however overriding users must ensure 4613// the name binding is the parent resource, without the operations 4614// collection id. 4615func (r *ProjectsLocationsGlobalOperationsService) List(name string) *ProjectsLocationsGlobalOperationsListCall { 4616 c := &ProjectsLocationsGlobalOperationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 4617 c.name = name 4618 return c 4619} 4620 4621// Filter sets the optional parameter "filter": The standard list 4622// filter. 4623func (c *ProjectsLocationsGlobalOperationsListCall) Filter(filter string) *ProjectsLocationsGlobalOperationsListCall { 4624 c.urlParams_.Set("filter", filter) 4625 return c 4626} 4627 4628// PageSize sets the optional parameter "pageSize": The standard list 4629// page size. 4630func (c *ProjectsLocationsGlobalOperationsListCall) PageSize(pageSize int64) *ProjectsLocationsGlobalOperationsListCall { 4631 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) 4632 return c 4633} 4634 4635// PageToken sets the optional parameter "pageToken": The standard list 4636// page token. 4637func (c *ProjectsLocationsGlobalOperationsListCall) PageToken(pageToken string) *ProjectsLocationsGlobalOperationsListCall { 4638 c.urlParams_.Set("pageToken", pageToken) 4639 return c 4640} 4641 4642// Fields allows partial responses to be retrieved. See 4643// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 4644// for more information. 4645func (c *ProjectsLocationsGlobalOperationsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsGlobalOperationsListCall { 4646 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 4647 return c 4648} 4649 4650// IfNoneMatch sets the optional parameter which makes the operation 4651// fail if the object's ETag matches the given value. This is useful for 4652// getting updates only after the object has changed since the last 4653// request. Use googleapi.IsNotModified to check whether the response 4654// error from Do is the result of In-None-Match. 4655func (c *ProjectsLocationsGlobalOperationsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsGlobalOperationsListCall { 4656 c.ifNoneMatch_ = entityTag 4657 return c 4658} 4659 4660// Context sets the context to be used in this call's Do method. Any 4661// pending HTTP request will be aborted if the provided context is 4662// canceled. 4663func (c *ProjectsLocationsGlobalOperationsListCall) Context(ctx context.Context) *ProjectsLocationsGlobalOperationsListCall { 4664 c.ctx_ = ctx 4665 return c 4666} 4667 4668// Header returns an http.Header that can be modified by the caller to 4669// add HTTP headers to the request. 4670func (c *ProjectsLocationsGlobalOperationsListCall) Header() http.Header { 4671 if c.header_ == nil { 4672 c.header_ = make(http.Header) 4673 } 4674 return c.header_ 4675} 4676 4677func (c *ProjectsLocationsGlobalOperationsListCall) doRequest(alt string) (*http.Response, error) { 4678 reqHeaders := make(http.Header) 4679 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124") 4680 for k, v := range c.header_ { 4681 reqHeaders[k] = v 4682 } 4683 reqHeaders.Set("User-Agent", c.s.userAgent()) 4684 if c.ifNoneMatch_ != "" { 4685 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 4686 } 4687 var body io.Reader = nil 4688 c.urlParams_.Set("alt", alt) 4689 c.urlParams_.Set("prettyPrint", "false") 4690 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}/operations") 4691 urls += "?" + c.urlParams_.Encode() 4692 req, err := http.NewRequest("GET", urls, body) 4693 if err != nil { 4694 return nil, err 4695 } 4696 req.Header = reqHeaders 4697 googleapi.Expand(req.URL, map[string]string{ 4698 "name": c.name, 4699 }) 4700 return gensupport.SendRequest(c.ctx_, c.s.client, req) 4701} 4702 4703// Do executes the "networkmanagement.projects.locations.global.operations.list" call. 4704// Exactly one of *ListOperationsResponse or error will be non-nil. Any 4705// non-2xx status code is an error. Response headers are in either 4706// *ListOperationsResponse.ServerResponse.Header or (if a response was 4707// returned at all) in error.(*googleapi.Error).Header. Use 4708// googleapi.IsNotModified to check whether the returned error was 4709// because http.StatusNotModified was returned. 4710func (c *ProjectsLocationsGlobalOperationsListCall) Do(opts ...googleapi.CallOption) (*ListOperationsResponse, error) { 4711 gensupport.SetOptions(c.urlParams_, opts...) 4712 res, err := c.doRequest("json") 4713 if res != nil && res.StatusCode == http.StatusNotModified { 4714 if res.Body != nil { 4715 res.Body.Close() 4716 } 4717 return nil, &googleapi.Error{ 4718 Code: res.StatusCode, 4719 Header: res.Header, 4720 } 4721 } 4722 if err != nil { 4723 return nil, err 4724 } 4725 defer googleapi.CloseBody(res) 4726 if err := googleapi.CheckResponse(res); err != nil { 4727 return nil, err 4728 } 4729 ret := &ListOperationsResponse{ 4730 ServerResponse: googleapi.ServerResponse{ 4731 Header: res.Header, 4732 HTTPStatusCode: res.StatusCode, 4733 }, 4734 } 4735 target := &ret 4736 if err := gensupport.DecodeResponse(target, res); err != nil { 4737 return nil, err 4738 } 4739 return ret, nil 4740 // { 4741 // "description": "Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns `UNIMPLEMENTED`. NOTE: the `name` binding allows API services to override the binding to use different resource name schemes, such as `users/*/operations`. To override the binding, API services can add a binding such as `\"/v1/{name=users/*}/operations\"` to their service configuration. For backwards compatibility, the default name includes the operations collection id, however overriding users must ensure the name binding is the parent resource, without the operations collection id.", 4742 // "flatPath": "v1beta1/projects/{projectsId}/locations/global/operations", 4743 // "httpMethod": "GET", 4744 // "id": "networkmanagement.projects.locations.global.operations.list", 4745 // "parameterOrder": [ 4746 // "name" 4747 // ], 4748 // "parameters": { 4749 // "filter": { 4750 // "description": "The standard list filter.", 4751 // "location": "query", 4752 // "type": "string" 4753 // }, 4754 // "name": { 4755 // "description": "The name of the operation's parent resource.", 4756 // "location": "path", 4757 // "pattern": "^projects/[^/]+/locations/global$", 4758 // "required": true, 4759 // "type": "string" 4760 // }, 4761 // "pageSize": { 4762 // "description": "The standard list page size.", 4763 // "format": "int32", 4764 // "location": "query", 4765 // "type": "integer" 4766 // }, 4767 // "pageToken": { 4768 // "description": "The standard list page token.", 4769 // "location": "query", 4770 // "type": "string" 4771 // } 4772 // }, 4773 // "path": "v1beta1/{+name}/operations", 4774 // "response": { 4775 // "$ref": "ListOperationsResponse" 4776 // }, 4777 // "scopes": [ 4778 // "https://www.googleapis.com/auth/cloud-platform" 4779 // ] 4780 // } 4781 4782} 4783 4784// Pages invokes f for each page of results. 4785// A non-nil error returned from f will halt the iteration. 4786// The provided context supersedes any context provided to the Context method. 4787func (c *ProjectsLocationsGlobalOperationsListCall) Pages(ctx context.Context, f func(*ListOperationsResponse) error) error { 4788 c.ctx_ = ctx 4789 defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point 4790 for { 4791 x, err := c.Do() 4792 if err != nil { 4793 return err 4794 } 4795 if err := f(x); err != nil { 4796 return err 4797 } 4798 if x.NextPageToken == "" { 4799 return nil 4800 } 4801 c.PageToken(x.NextPageToken) 4802 } 4803} 4804