1 // Copyright 2024 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 gkehub provides access to the GKE Hub API. 8 // 9 // For product documentation, see: https://cloud.google.com/anthos/multicluster-management/connect/registering-a-cluster 10 // 11 // # Library status 12 // 13 // These client libraries are officially supported by Google. However, this 14 // library is considered complete and is in maintenance mode. This means 15 // that we will address critical bugs and security issues but will not add 16 // any new features. 17 // 18 // When possible, we recommend using our newer 19 // [Cloud Client Libraries for Go](https://pkg.go.dev/cloud.google.com/go) 20 // that are still actively being worked and iterated on. 21 // 22 // # Creating a client 23 // 24 // Usage example: 25 // 26 // import "google.golang.org/api/gkehub/v1beta1" 27 // ... 28 // ctx := context.Background() 29 // gkehubService, err := gkehub.NewService(ctx) 30 // 31 // In this example, Google Application Default Credentials are used for 32 // authentication. For information on how to create and obtain Application 33 // Default Credentials, see https://developers.google.com/identity/protocols/application-default-credentials. 34 // 35 // # Other authentication options 36 // 37 // To use an API key for authentication (note: some APIs do not support API 38 // keys), use [google.golang.org/api/option.WithAPIKey]: 39 // 40 // gkehubService, err := gkehub.NewService(ctx, option.WithAPIKey("AIza...")) 41 // 42 // To use an OAuth token (e.g., a user token obtained via a three-legged OAuth 43 // flow, use [google.golang.org/api/option.WithTokenSource]: 44 // 45 // config := &oauth2.Config{...} 46 // // ... 47 // token, err := config.Exchange(ctx, ...) 48 // gkehubService, err := gkehub.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token))) 49 // 50 // See [google.golang.org/api/option.ClientOption] for details on options. 51 package gkehub // import "google.golang.org/api/gkehub/v1beta1" 52 53 import ( 54 "bytes" 55 "context" 56 "encoding/json" 57 "errors" 58 "fmt" 59 "io" 60 "net/http" 61 "net/url" 62 "strconv" 63 "strings" 64 65 googleapi "google.golang.org/api/googleapi" 66 internal "google.golang.org/api/internal" 67 gensupport "google.golang.org/api/internal/gensupport" 68 option "google.golang.org/api/option" 69 internaloption "google.golang.org/api/option/internaloption" 70 htransport "google.golang.org/api/transport/http" 71 ) 72 73 // Always reference these packages, just in case the auto-generated code 74 // below doesn't. 75 var _ = bytes.NewBuffer 76 var _ = strconv.Itoa 77 var _ = fmt.Sprintf 78 var _ = json.NewDecoder 79 var _ = io.Copy 80 var _ = url.Parse 81 var _ = gensupport.MarshalJSON 82 var _ = googleapi.Version 83 var _ = errors.New 84 var _ = strings.Replace 85 var _ = context.Canceled 86 var _ = internaloption.WithDefaultEndpoint 87 var _ = internal.Version 88 89 const apiId = "gkehub:v1beta1" 90 const apiName = "gkehub" 91 const apiVersion = "v1beta1" 92 const basePath = "https://gkehub.googleapis.com/" 93 const basePathTemplate = "https://gkehub.UNIVERSE_DOMAIN/" 94 const mtlsBasePath = "https://gkehub.mtls.googleapis.com/" 95 96 // OAuth2 scopes used by this API. 97 const ( 98 // See, edit, configure, and delete your Google Cloud data and see the email 99 // address for your Google Account. 100 CloudPlatformScope = "https://www.googleapis.com/auth/cloud-platform" 101 ) 102 103 // NewService creates a new Service. 104 func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, error) { 105 scopesOption := internaloption.WithDefaultScopes( 106 "https://www.googleapis.com/auth/cloud-platform", 107 ) 108 // NOTE: prepend, so we don't override user-specified scopes. 109 opts = append([]option.ClientOption{scopesOption}, opts...) 110 opts = append(opts, internaloption.WithDefaultEndpoint(basePath)) 111 opts = append(opts, internaloption.WithDefaultEndpointTemplate(basePathTemplate)) 112 opts = append(opts, internaloption.WithDefaultMTLSEndpoint(mtlsBasePath)) 113 opts = append(opts, internaloption.EnableNewAuthLibrary()) 114 client, endpoint, err := htransport.NewClient(ctx, opts...) 115 if err != nil { 116 return nil, err 117 } 118 s, err := New(client) 119 if err != nil { 120 return nil, err 121 } 122 if endpoint != "" { 123 s.BasePath = endpoint 124 } 125 return s, nil 126 } 127 128 // New creates a new Service. It uses the provided http.Client for requests. 129 // 130 // Deprecated: please use NewService instead. 131 // To provide a custom HTTP client, use option.WithHTTPClient. 132 // If you are using google.golang.org/api/googleapis/transport.APIKey, use option.WithAPIKey with NewService instead. 133 func New(client *http.Client) (*Service, error) { 134 if client == nil { 135 return nil, errors.New("client is nil") 136 } 137 s := &Service{client: client, BasePath: basePath} 138 s.Projects = NewProjectsService(s) 139 return s, nil 140 } 141 142 type Service struct { 143 client *http.Client 144 BasePath string // API endpoint base URL 145 UserAgent string // optional additional User-Agent fragment 146 147 Projects *ProjectsService 148 } 149 150 func (s *Service) userAgent() string { 151 if s.UserAgent == "" { 152 return googleapi.UserAgent 153 } 154 return googleapi.UserAgent + " " + s.UserAgent 155 } 156 157 func NewProjectsService(s *Service) *ProjectsService { 158 rs := &ProjectsService{s: s} 159 rs.Locations = NewProjectsLocationsService(s) 160 return rs 161 } 162 163 type ProjectsService struct { 164 s *Service 165 166 Locations *ProjectsLocationsService 167 } 168 169 func NewProjectsLocationsService(s *Service) *ProjectsLocationsService { 170 rs := &ProjectsLocationsService{s: s} 171 rs.Memberships = NewProjectsLocationsMembershipsService(s) 172 rs.Operations = NewProjectsLocationsOperationsService(s) 173 return rs 174 } 175 176 type ProjectsLocationsService struct { 177 s *Service 178 179 Memberships *ProjectsLocationsMembershipsService 180 181 Operations *ProjectsLocationsOperationsService 182 } 183 184 func NewProjectsLocationsMembershipsService(s *Service) *ProjectsLocationsMembershipsService { 185 rs := &ProjectsLocationsMembershipsService{s: s} 186 return rs 187 } 188 189 type ProjectsLocationsMembershipsService struct { 190 s *Service 191 } 192 193 func NewProjectsLocationsOperationsService(s *Service) *ProjectsLocationsOperationsService { 194 rs := &ProjectsLocationsOperationsService{s: s} 195 return rs 196 } 197 198 type ProjectsLocationsOperationsService struct { 199 s *Service 200 } 201 202 // ApplianceCluster: ApplianceCluster contains information specific to GDC Edge 203 // Appliance Clusters. 204 type ApplianceCluster struct { 205 // ResourceLink: Immutable. Self-link of the GCP resource for the Appliance 206 // Cluster. For example: 207 // //transferappliance.googleapis.com/projects/my-project/locations/us-west1-a/a 208 // ppliances/my-appliance 209 ResourceLink string `json:"resourceLink,omitempty"` 210 // ForceSendFields is a list of field names (e.g. "ResourceLink") to 211 // unconditionally include in API requests. By default, fields with empty or 212 // default values are omitted from API requests. See 213 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 214 // details. 215 ForceSendFields []string `json:"-"` 216 // NullFields is a list of field names (e.g. "ResourceLink") to include in API 217 // requests with the JSON null value. By default, fields with empty values are 218 // omitted from API requests. See 219 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 220 NullFields []string `json:"-"` 221 } 222 223 func (s *ApplianceCluster) MarshalJSON() ([]byte, error) { 224 type NoMethod ApplianceCluster 225 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 226 } 227 228 // AuditConfig: Specifies the audit configuration for a service. The 229 // configuration determines which permission types are logged, and what 230 // identities, if any, are exempted from logging. An AuditConfig must have one 231 // or more AuditLogConfigs. If there are AuditConfigs for both `allServices` 232 // and a specific service, the union of the two AuditConfigs is used for that 233 // service: the log_types specified in each AuditConfig are enabled, and the 234 // exempted_members in each AuditLogConfig are exempted. Example Policy with 235 // multiple AuditConfigs: { "audit_configs": [ { "service": "allServices", 236 // "audit_log_configs": [ { "log_type": "DATA_READ", "exempted_members": [ 237 // "user:jose@example.com" ] }, { "log_type": "DATA_WRITE" }, { "log_type": 238 // "ADMIN_READ" } ] }, { "service": "sampleservice.googleapis.com", 239 // "audit_log_configs": [ { "log_type": "DATA_READ" }, { "log_type": 240 // "DATA_WRITE", "exempted_members": [ "user:aliya@example.com" ] } ] } ] } For 241 // sampleservice, this policy enables DATA_READ, DATA_WRITE and ADMIN_READ 242 // logging. It also exempts `jose@example.com` from DATA_READ logging, and 243 // `aliya@example.com` from DATA_WRITE logging. 244 type AuditConfig struct { 245 // AuditLogConfigs: The configuration for logging of each type of permission. 246 AuditLogConfigs []*AuditLogConfig `json:"auditLogConfigs,omitempty"` 247 // Service: Specifies a service that will be enabled for audit logging. For 248 // example, `storage.googleapis.com`, `cloudsql.googleapis.com`. `allServices` 249 // is a special value that covers all services. 250 Service string `json:"service,omitempty"` 251 // ForceSendFields is a list of field names (e.g. "AuditLogConfigs") to 252 // unconditionally include in API requests. By default, fields with empty or 253 // default values are omitted from API requests. See 254 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 255 // details. 256 ForceSendFields []string `json:"-"` 257 // NullFields is a list of field names (e.g. "AuditLogConfigs") to include in 258 // API requests with the JSON null value. By default, fields with empty values 259 // are omitted from API requests. See 260 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 261 NullFields []string `json:"-"` 262 } 263 264 func (s *AuditConfig) MarshalJSON() ([]byte, error) { 265 type NoMethod AuditConfig 266 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 267 } 268 269 // AuditLogConfig: Provides the configuration for logging a type of 270 // permissions. Example: { "audit_log_configs": [ { "log_type": "DATA_READ", 271 // "exempted_members": [ "user:jose@example.com" ] }, { "log_type": 272 // "DATA_WRITE" } ] } This enables 'DATA_READ' and 'DATA_WRITE' logging, while 273 // exempting jose@example.com from DATA_READ logging. 274 type AuditLogConfig struct { 275 // ExemptedMembers: Specifies the identities that do not cause logging for this 276 // type of permission. Follows the same format of Binding.members. 277 ExemptedMembers []string `json:"exemptedMembers,omitempty"` 278 // LogType: The log type that this config enables. 279 // 280 // Possible values: 281 // "LOG_TYPE_UNSPECIFIED" - Default case. Should never be this. 282 // "ADMIN_READ" - Admin reads. Example: CloudIAM getIamPolicy 283 // "DATA_WRITE" - Data writes. Example: CloudSQL Users create 284 // "DATA_READ" - Data reads. Example: CloudSQL Users list 285 LogType string `json:"logType,omitempty"` 286 // ForceSendFields is a list of field names (e.g. "ExemptedMembers") to 287 // unconditionally include in API requests. By default, fields with empty or 288 // default values are omitted from API requests. See 289 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 290 // details. 291 ForceSendFields []string `json:"-"` 292 // NullFields is a list of field names (e.g. "ExemptedMembers") to include in 293 // API requests with the JSON null value. By default, fields with empty values 294 // are omitted from API requests. See 295 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 296 NullFields []string `json:"-"` 297 } 298 299 func (s *AuditLogConfig) MarshalJSON() ([]byte, error) { 300 type NoMethod AuditLogConfig 301 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 302 } 303 304 // Authority: Authority encodes how Google will recognize identities from this 305 // Membership. See the workload identity documentation for more details: 306 // https://cloud.google.com/kubernetes-engine/docs/how-to/workload-identity 307 type Authority struct { 308 // IdentityProvider: Output only. An identity provider that reflects the 309 // `issuer` in the workload identity pool. 310 IdentityProvider string `json:"identityProvider,omitempty"` 311 // Issuer: Optional. A JSON Web Token (JWT) issuer URI. `issuer` must start 312 // with `https://` and be a valid URL with length <2000 characters. If set, 313 // then Google will allow valid OIDC tokens from this issuer to authenticate 314 // within the workload_identity_pool. OIDC discovery will be performed on this 315 // URI to validate tokens from the issuer. Clearing `issuer` disables Workload 316 // Identity. `issuer` cannot be directly modified; it must be cleared (and 317 // Workload Identity disabled) before using a new issuer (and re-enabling 318 // Workload Identity). 319 Issuer string `json:"issuer,omitempty"` 320 // OidcJwks: Optional. OIDC verification keys for this Membership in JWKS 321 // format (RFC 7517). When this field is set, OIDC discovery will NOT be 322 // performed on `issuer`, and instead OIDC tokens will be validated using this 323 // field. 324 OidcJwks string `json:"oidcJwks,omitempty"` 325 // WorkloadIdentityPool: Output only. The name of the workload identity pool in 326 // which `issuer` will be recognized. There is a single Workload Identity Pool 327 // per Hub that is shared between all Memberships that belong to that Hub. For 328 // a Hub hosted in {PROJECT_ID}, the workload pool format is 329 // `{PROJECT_ID}.hub.id.goog`, although this is subject to change in newer 330 // versions of this API. 331 WorkloadIdentityPool string `json:"workloadIdentityPool,omitempty"` 332 // ForceSendFields is a list of field names (e.g. "IdentityProvider") to 333 // unconditionally include in API requests. By default, fields with empty or 334 // default values are omitted from API requests. See 335 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 336 // details. 337 ForceSendFields []string `json:"-"` 338 // NullFields is a list of field names (e.g. "IdentityProvider") to include in 339 // API requests with the JSON null value. By default, fields with empty values 340 // are omitted from API requests. See 341 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 342 NullFields []string `json:"-"` 343 } 344 345 func (s *Authority) MarshalJSON() ([]byte, error) { 346 type NoMethod Authority 347 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 348 } 349 350 // Binding: Associates `members`, or principals, with a `role`. 351 type Binding struct { 352 // Condition: The condition that is associated with this binding. If the 353 // condition evaluates to `true`, then this binding applies to the current 354 // request. If the condition evaluates to `false`, then this binding does not 355 // apply to the current request. However, a different role binding might grant 356 // the same role to one or more of the principals in this binding. To learn 357 // which resources support conditions in their IAM policies, see the IAM 358 // documentation 359 // (https://cloud.google.com/iam/help/conditions/resource-policies). 360 Condition *Expr `json:"condition,omitempty"` 361 // Members: Specifies the principals requesting access for a Google Cloud 362 // resource. `members` can have the following values: * `allUsers`: A special 363 // identifier that represents anyone who is on the internet; with or without a 364 // Google account. * `allAuthenticatedUsers`: A special identifier that 365 // represents anyone who is authenticated with a Google account or a service 366 // account. Does not include identities that come from external identity 367 // providers (IdPs) through identity federation. * `user:{emailid}`: An email 368 // address that represents a specific Google account. For example, 369 // `alice@example.com` . * `serviceAccount:{emailid}`: An email address that 370 // represents a Google service account. For example, 371 // `my-other-app@appspot.gserviceaccount.com`. * 372 // `serviceAccount:{projectid}.svc.id.goog[{namespace}/{kubernetes-sa}]`: An 373 // identifier for a Kubernetes service account 374 // (https://cloud.google.com/kubernetes-engine/docs/how-to/kubernetes-service-accounts). 375 // For example, `my-project.svc.id.goog[my-namespace/my-kubernetes-sa]`. * 376 // `group:{emailid}`: An email address that represents a Google group. For 377 // example, `admins@example.com`. * `domain:{domain}`: The G Suite domain 378 // (primary) that represents all the users of that domain. For example, 379 // `google.com` or `example.com`. * 380 // `principal://iam.googleapis.com/locations/global/workforcePools/{pool_id}/sub 381 // ject/{subject_attribute_value}`: A single identity in a workforce identity 382 // pool. * 383 // `principalSet://iam.googleapis.com/locations/global/workforcePools/{pool_id}/ 384 // group/{group_id}`: All workforce identities in a group. * 385 // `principalSet://iam.googleapis.com/locations/global/workforcePools/{pool_id}/ 386 // attribute.{attribute_name}/{attribute_value}`: All workforce identities with 387 // a specific attribute value. * 388 // `principalSet://iam.googleapis.com/locations/global/workforcePools/{pool_id}/ 389 // *`: All identities in a workforce identity pool. * 390 // `principal://iam.googleapis.com/projects/{project_number}/locations/global/wo 391 // rkloadIdentityPools/{pool_id}/subject/{subject_attribute_value}`: A single 392 // identity in a workload identity pool. * 393 // `principalSet://iam.googleapis.com/projects/{project_number}/locations/global 394 // /workloadIdentityPools/{pool_id}/group/{group_id}`: A workload identity pool 395 // group. * 396 // `principalSet://iam.googleapis.com/projects/{project_number}/locations/global 397 // /workloadIdentityPools/{pool_id}/attribute.{attribute_name}/{attribute_value} 398 // `: All identities in a workload identity pool with a certain attribute. * 399 // `principalSet://iam.googleapis.com/projects/{project_number}/locations/global 400 // /workloadIdentityPools/{pool_id}/*`: All identities in a workload identity 401 // pool. * `deleted:user:{emailid}?uid={uniqueid}`: An email address (plus 402 // unique identifier) representing a user that has been recently deleted. For 403 // example, `alice@example.com?uid=123456789012345678901`. If the user is 404 // recovered, this value reverts to `user:{emailid}` and the recovered user 405 // retains the role in the binding. * 406 // `deleted:serviceAccount:{emailid}?uid={uniqueid}`: An email address (plus 407 // unique identifier) representing a service account that has been recently 408 // deleted. For example, 409 // `my-other-app@appspot.gserviceaccount.com?uid=123456789012345678901`. If the 410 // service account is undeleted, this value reverts to 411 // `serviceAccount:{emailid}` and the undeleted service account retains the 412 // role in the binding. * `deleted:group:{emailid}?uid={uniqueid}`: An email 413 // address (plus unique identifier) representing a Google group that has been 414 // recently deleted. For example, 415 // `admins@example.com?uid=123456789012345678901`. If the group is recovered, 416 // this value reverts to `group:{emailid}` and the recovered group retains the 417 // role in the binding. * 418 // `deleted:principal://iam.googleapis.com/locations/global/workforcePools/{pool 419 // _id}/subject/{subject_attribute_value}`: Deleted single identity in a 420 // workforce identity pool. For example, 421 // `deleted:principal://iam.googleapis.com/locations/global/workforcePools/my-po 422 // ol-id/subject/my-subject-attribute-value`. 423 Members []string `json:"members,omitempty"` 424 // Role: Role that is assigned to the list of `members`, or principals. For 425 // example, `roles/viewer`, `roles/editor`, or `roles/owner`. For an overview 426 // of the IAM roles and permissions, see the IAM documentation 427 // (https://cloud.google.com/iam/docs/roles-overview). For a list of the 428 // available pre-defined roles, see here 429 // (https://cloud.google.com/iam/docs/understanding-roles). 430 Role string `json:"role,omitempty"` 431 // ForceSendFields is a list of field names (e.g. "Condition") to 432 // unconditionally include in API requests. By default, fields with empty or 433 // default values are omitted from API requests. See 434 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 435 // details. 436 ForceSendFields []string `json:"-"` 437 // NullFields is a list of field names (e.g. "Condition") to include in API 438 // requests with the JSON null value. By default, fields with empty values are 439 // omitted from API requests. See 440 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 441 NullFields []string `json:"-"` 442 } 443 444 func (s *Binding) MarshalJSON() ([]byte, error) { 445 type NoMethod Binding 446 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 447 } 448 449 // CancelOperationRequest: The request message for Operations.CancelOperation. 450 type CancelOperationRequest struct { 451 } 452 453 // ConnectAgentResource: ConnectAgentResource represents a Kubernetes resource 454 // manifest for Connect Agent deployment. 455 type ConnectAgentResource struct { 456 // Manifest: YAML manifest of the resource. 457 Manifest string `json:"manifest,omitempty"` 458 // Type: Kubernetes type of the resource. 459 Type *TypeMeta `json:"type,omitempty"` 460 // ForceSendFields is a list of field names (e.g. "Manifest") to 461 // unconditionally include in API requests. By default, fields with empty or 462 // default values are omitted from API requests. See 463 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 464 // details. 465 ForceSendFields []string `json:"-"` 466 // NullFields is a list of field names (e.g. "Manifest") to include in API 467 // requests with the JSON null value. By default, fields with empty values are 468 // omitted from API requests. See 469 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 470 NullFields []string `json:"-"` 471 } 472 473 func (s *ConnectAgentResource) MarshalJSON() ([]byte, error) { 474 type NoMethod ConnectAgentResource 475 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 476 } 477 478 // EdgeCluster: EdgeCluster contains information specific to Google Edge 479 // Clusters. 480 type EdgeCluster struct { 481 // ResourceLink: Immutable. Self-link of the GCP resource for the Edge Cluster. 482 // For example: 483 // //edgecontainer.googleapis.com/projects/my-project/locations/us-west1-a/clust 484 // ers/my-cluster 485 ResourceLink string `json:"resourceLink,omitempty"` 486 // ForceSendFields is a list of field names (e.g. "ResourceLink") to 487 // unconditionally include in API requests. By default, fields with empty or 488 // default values are omitted from API requests. See 489 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 490 // details. 491 ForceSendFields []string `json:"-"` 492 // NullFields is a list of field names (e.g. "ResourceLink") to include in API 493 // requests with the JSON null value. By default, fields with empty values are 494 // omitted from API requests. See 495 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 496 NullFields []string `json:"-"` 497 } 498 499 func (s *EdgeCluster) MarshalJSON() ([]byte, error) { 500 type NoMethod EdgeCluster 501 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 502 } 503 504 // Empty: A generic empty message that you can re-use to avoid defining 505 // duplicated empty messages in your APIs. A typical example is to use it as 506 // the request or the response type of an API method. For instance: service Foo 507 // { rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); } 508 type Empty struct { 509 // ServerResponse contains the HTTP response code and headers from the server. 510 googleapi.ServerResponse `json:"-"` 511 } 512 513 // Expr: Represents a textual expression in the Common Expression Language 514 // (CEL) syntax. CEL is a C-like expression language. The syntax and semantics 515 // of CEL are documented at https://github.com/google/cel-spec. Example 516 // (Comparison): title: "Summary size limit" description: "Determines if a 517 // summary is less than 100 chars" expression: "document.summary.size() < 100" 518 // Example (Equality): title: "Requestor is owner" description: "Determines if 519 // requestor is the document owner" expression: "document.owner == 520 // request.auth.claims.email" Example (Logic): title: "Public documents" 521 // description: "Determine whether the document should be publicly visible" 522 // expression: "document.type != 'private' && document.type != 'internal'" 523 // Example (Data Manipulation): title: "Notification string" description: 524 // "Create a notification string with a timestamp." expression: "'New message 525 // received at ' + string(document.create_time)" The exact variables and 526 // functions that may be referenced within an expression are determined by the 527 // service that evaluates it. See the service documentation for additional 528 // information. 529 type Expr struct { 530 // Description: Optional. Description of the expression. This is a longer text 531 // which describes the expression, e.g. when hovered over it in a UI. 532 Description string `json:"description,omitempty"` 533 // Expression: Textual representation of an expression in Common Expression 534 // Language syntax. 535 Expression string `json:"expression,omitempty"` 536 // Location: Optional. String indicating the location of the expression for 537 // error reporting, e.g. a file name and a position in the file. 538 Location string `json:"location,omitempty"` 539 // Title: Optional. Title for the expression, i.e. a short string describing 540 // its purpose. This can be used e.g. in UIs which allow to enter the 541 // expression. 542 Title string `json:"title,omitempty"` 543 // ForceSendFields is a list of field names (e.g. "Description") to 544 // unconditionally include in API requests. By default, fields with empty or 545 // default values are omitted from API requests. See 546 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 547 // details. 548 ForceSendFields []string `json:"-"` 549 // NullFields is a list of field names (e.g. "Description") to include in API 550 // requests with the JSON null value. By default, fields with empty values are 551 // omitted from API requests. See 552 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 553 NullFields []string `json:"-"` 554 } 555 556 func (s *Expr) MarshalJSON() ([]byte, error) { 557 type NoMethod Expr 558 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 559 } 560 561 // GenerateConnectManifestResponse: GenerateConnectManifestResponse contains 562 // manifest information for installing/upgrading a Connect agent. 563 type GenerateConnectManifestResponse struct { 564 // Manifest: The ordered list of Kubernetes resources that need to be applied 565 // to the cluster for GKE Connect agent installation/upgrade. 566 Manifest []*ConnectAgentResource `json:"manifest,omitempty"` 567 568 // ServerResponse contains the HTTP response code and headers from the server. 569 googleapi.ServerResponse `json:"-"` 570 // ForceSendFields is a list of field names (e.g. "Manifest") to 571 // unconditionally include in API requests. By default, fields with empty or 572 // default values are omitted from API requests. See 573 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 574 // details. 575 ForceSendFields []string `json:"-"` 576 // NullFields is a list of field names (e.g. "Manifest") to include in API 577 // requests with the JSON null value. By default, fields with empty values are 578 // omitted from API requests. See 579 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 580 NullFields []string `json:"-"` 581 } 582 583 func (s *GenerateConnectManifestResponse) MarshalJSON() ([]byte, error) { 584 type NoMethod GenerateConnectManifestResponse 585 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 586 } 587 588 // GenerateExclusivityManifestResponse: The response of the exclusivity 589 // artifacts manifests for the client to apply. 590 type GenerateExclusivityManifestResponse struct { 591 // CrManifest: The YAML manifest of the membership CR to apply if a new version 592 // of the CR is available. Empty if no update needs to be applied. 593 CrManifest string `json:"crManifest,omitempty"` 594 // CrdManifest: The YAML manifest of the membership CRD to apply if a newer 595 // version of the CRD is available. Empty if no update needs to be applied. 596 CrdManifest string `json:"crdManifest,omitempty"` 597 598 // ServerResponse contains the HTTP response code and headers from the server. 599 googleapi.ServerResponse `json:"-"` 600 // ForceSendFields is a list of field names (e.g. "CrManifest") to 601 // unconditionally include in API requests. By default, fields with empty or 602 // default values are omitted from API requests. See 603 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 604 // details. 605 ForceSendFields []string `json:"-"` 606 // NullFields is a list of field names (e.g. "CrManifest") to include in API 607 // requests with the JSON null value. By default, fields with empty values are 608 // omitted from API requests. See 609 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 610 NullFields []string `json:"-"` 611 } 612 613 func (s *GenerateExclusivityManifestResponse) MarshalJSON() ([]byte, error) { 614 type NoMethod GenerateExclusivityManifestResponse 615 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 616 } 617 618 // GkeCluster: GkeCluster contains information specific to GKE clusters. 619 type GkeCluster struct { 620 // ClusterMissing: Output only. If cluster_missing is set then it denotes that 621 // the GKE cluster no longer exists in the GKE Control Plane. 622 ClusterMissing bool `json:"clusterMissing,omitempty"` 623 // ResourceLink: Immutable. Self-link of the GCP resource for the GKE cluster. 624 // For example: 625 // //container.googleapis.com/projects/my-project/locations/us-west1-a/clusters/ 626 // my-cluster Zonal clusters are also supported. 627 ResourceLink string `json:"resourceLink,omitempty"` 628 // ForceSendFields is a list of field names (e.g. "ClusterMissing") to 629 // unconditionally include in API requests. By default, fields with empty or 630 // default values are omitted from API requests. See 631 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 632 // details. 633 ForceSendFields []string `json:"-"` 634 // NullFields is a list of field names (e.g. "ClusterMissing") to include in 635 // API requests with the JSON null value. By default, fields with empty values 636 // are omitted from API requests. See 637 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 638 NullFields []string `json:"-"` 639 } 640 641 func (s *GkeCluster) MarshalJSON() ([]byte, error) { 642 type NoMethod GkeCluster 643 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 644 } 645 646 // GoogleRpcStatus: The `Status` type defines a logical error model that is 647 // suitable for different programming environments, including REST APIs and RPC 648 // APIs. It is used by gRPC (https://github.com/grpc). Each `Status` message 649 // contains three pieces of data: error code, error message, and error details. 650 // You can find out more about this error model and how to work with it in the 651 // API Design Guide (https://cloud.google.com/apis/design/errors). 652 type GoogleRpcStatus struct { 653 // Code: The status code, which should be an enum value of google.rpc.Code. 654 Code int64 `json:"code,omitempty"` 655 // Details: A list of messages that carry the error details. There is a common 656 // set of message types for APIs to use. 657 Details []googleapi.RawMessage `json:"details,omitempty"` 658 // Message: A developer-facing error message, which should be in English. Any 659 // user-facing error message should be localized and sent in the 660 // google.rpc.Status.details field, or localized by the client. 661 Message string `json:"message,omitempty"` 662 // ForceSendFields is a list of field names (e.g. "Code") to unconditionally 663 // include in API requests. By default, fields with empty or default values are 664 // omitted from API requests. See 665 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 666 // details. 667 ForceSendFields []string `json:"-"` 668 // NullFields is a list of field names (e.g. "Code") to include in API requests 669 // with the JSON null value. By default, fields with empty values are omitted 670 // from API requests. See 671 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 672 NullFields []string `json:"-"` 673 } 674 675 func (s *GoogleRpcStatus) MarshalJSON() ([]byte, error) { 676 type NoMethod GoogleRpcStatus 677 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 678 } 679 680 // KubernetesMetadata: KubernetesMetadata provides informational metadata for 681 // Memberships representing Kubernetes clusters. 682 type KubernetesMetadata struct { 683 // KubernetesApiServerVersion: Output only. Kubernetes API server version 684 // string as reported by '/version'. 685 KubernetesApiServerVersion string `json:"kubernetesApiServerVersion,omitempty"` 686 // MemoryMb: Output only. The total memory capacity as reported by the sum of 687 // all Kubernetes nodes resources, defined in MB. 688 MemoryMb int64 `json:"memoryMb,omitempty"` 689 // NodeCount: Output only. Node count as reported by Kubernetes nodes 690 // resources. 691 NodeCount int64 `json:"nodeCount,omitempty"` 692 // NodeProviderId: Output only. Node providerID as reported by the first node 693 // in the list of nodes on the Kubernetes endpoint. On Kubernetes platforms 694 // that support zero-node clusters (like GKE-on-GCP), the node_count will be 695 // zero and the node_provider_id will be empty. 696 NodeProviderId string `json:"nodeProviderId,omitempty"` 697 // UpdateTime: Output only. The time at which these details were last updated. 698 // This update_time is different from the Membership-level update_time since 699 // EndpointDetails are updated internally for API consumers. 700 UpdateTime string `json:"updateTime,omitempty"` 701 // VcpuCount: Output only. vCPU count as reported by Kubernetes nodes 702 // resources. 703 VcpuCount int64 `json:"vcpuCount,omitempty"` 704 // ForceSendFields is a list of field names (e.g. "KubernetesApiServerVersion") 705 // to unconditionally include in API requests. By default, fields with empty or 706 // default values are omitted from API requests. See 707 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 708 // details. 709 ForceSendFields []string `json:"-"` 710 // NullFields is a list of field names (e.g. "KubernetesApiServerVersion") to 711 // include in API requests with the JSON null value. By default, fields with 712 // empty values are omitted from API requests. See 713 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 714 NullFields []string `json:"-"` 715 } 716 717 func (s *KubernetesMetadata) MarshalJSON() ([]byte, error) { 718 type NoMethod KubernetesMetadata 719 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 720 } 721 722 // KubernetesResource: KubernetesResource contains the YAML manifests and 723 // configuration for Membership Kubernetes resources in the cluster. After 724 // CreateMembership or UpdateMembership, these resources should be re-applied 725 // in the cluster. 726 type KubernetesResource struct { 727 // ConnectResources: Output only. The Kubernetes resources for installing the 728 // GKE Connect agent This field is only populated in the Membership returned 729 // from a successful long-running operation from CreateMembership or 730 // UpdateMembership. It is not populated during normal GetMembership or 731 // ListMemberships requests. To get the resource manifest after the initial 732 // registration, the caller should make a UpdateMembership call with an empty 733 // field mask. 734 ConnectResources []*ResourceManifest `json:"connectResources,omitempty"` 735 // MembershipCrManifest: Input only. The YAML representation of the Membership 736 // CR. This field is ignored for GKE clusters where Hub can read the CR 737 // directly. Callers should provide the CR that is currently present in the 738 // cluster during CreateMembership or UpdateMembership, or leave this field 739 // empty if none exists. The CR manifest is used to validate the cluster has 740 // not been registered with another Membership. 741 MembershipCrManifest string `json:"membershipCrManifest,omitempty"` 742 // MembershipResources: Output only. Additional Kubernetes resources that need 743 // to be applied to the cluster after Membership creation, and after every 744 // update. This field is only populated in the Membership returned from a 745 // successful long-running operation from CreateMembership or UpdateMembership. 746 // It is not populated during normal GetMembership or ListMemberships requests. 747 // To get the resource manifest after the initial registration, the caller 748 // should make a UpdateMembership call with an empty field mask. 749 MembershipResources []*ResourceManifest `json:"membershipResources,omitempty"` 750 // ResourceOptions: Optional. Options for Kubernetes resource generation. 751 ResourceOptions *ResourceOptions `json:"resourceOptions,omitempty"` 752 // ForceSendFields is a list of field names (e.g. "ConnectResources") to 753 // unconditionally include in API requests. By default, fields with empty or 754 // default values are omitted from API requests. See 755 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 756 // details. 757 ForceSendFields []string `json:"-"` 758 // NullFields is a list of field names (e.g. "ConnectResources") to include in 759 // API requests with the JSON null value. By default, fields with empty values 760 // are omitted from API requests. See 761 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 762 NullFields []string `json:"-"` 763 } 764 765 func (s *KubernetesResource) MarshalJSON() ([]byte, error) { 766 type NoMethod KubernetesResource 767 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 768 } 769 770 // ListLocationsResponse: The response message for Locations.ListLocations. 771 type ListLocationsResponse struct { 772 // Locations: A list of locations that matches the specified filter in the 773 // request. 774 Locations []*Location `json:"locations,omitempty"` 775 // NextPageToken: The standard List next-page token. 776 NextPageToken string `json:"nextPageToken,omitempty"` 777 778 // ServerResponse contains the HTTP response code and headers from the server. 779 googleapi.ServerResponse `json:"-"` 780 // ForceSendFields is a list of field names (e.g. "Locations") to 781 // unconditionally include in API requests. By default, fields with empty or 782 // default values are omitted from API requests. See 783 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 784 // details. 785 ForceSendFields []string `json:"-"` 786 // NullFields is a list of field names (e.g. "Locations") to include in API 787 // requests with the JSON null value. By default, fields with empty values are 788 // omitted from API requests. See 789 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 790 NullFields []string `json:"-"` 791 } 792 793 func (s *ListLocationsResponse) MarshalJSON() ([]byte, error) { 794 type NoMethod ListLocationsResponse 795 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 796 } 797 798 // ListMembershipsResponse: Response message for the 799 // `GkeHubMembershipService.ListMemberships` method. 800 type ListMembershipsResponse struct { 801 // NextPageToken: A token to request the next page of resources from the 802 // `ListMemberships` method. The value of an empty string means that there are 803 // no more resources to return. 804 NextPageToken string `json:"nextPageToken,omitempty"` 805 // Resources: The list of matching Memberships. 806 Resources []*Membership `json:"resources,omitempty"` 807 // Unreachable: List of locations that could not be reached while fetching this 808 // list. 809 Unreachable []string `json:"unreachable,omitempty"` 810 811 // ServerResponse contains the HTTP response code and headers from the server. 812 googleapi.ServerResponse `json:"-"` 813 // ForceSendFields is a list of field names (e.g. "NextPageToken") to 814 // unconditionally include in API requests. By default, fields with empty or 815 // default values are omitted from API requests. See 816 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 817 // details. 818 ForceSendFields []string `json:"-"` 819 // NullFields is a list of field names (e.g. "NextPageToken") to include in API 820 // requests with the JSON null value. By default, fields with empty values are 821 // omitted from API requests. See 822 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 823 NullFields []string `json:"-"` 824 } 825 826 func (s *ListMembershipsResponse) MarshalJSON() ([]byte, error) { 827 type NoMethod ListMembershipsResponse 828 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 829 } 830 831 // ListOperationsResponse: The response message for Operations.ListOperations. 832 type ListOperationsResponse struct { 833 // NextPageToken: The standard List next-page token. 834 NextPageToken string `json:"nextPageToken,omitempty"` 835 // Operations: A list of operations that matches the specified filter in the 836 // request. 837 Operations []*Operation `json:"operations,omitempty"` 838 839 // ServerResponse contains the HTTP response code and headers from the server. 840 googleapi.ServerResponse `json:"-"` 841 // ForceSendFields is a list of field names (e.g. "NextPageToken") to 842 // unconditionally include in API requests. By default, fields with empty or 843 // default values are omitted from API requests. See 844 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 845 // details. 846 ForceSendFields []string `json:"-"` 847 // NullFields is a list of field names (e.g. "NextPageToken") to include in API 848 // requests with the JSON null value. By default, fields with empty values are 849 // omitted from API requests. See 850 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 851 NullFields []string `json:"-"` 852 } 853 854 func (s *ListOperationsResponse) MarshalJSON() ([]byte, error) { 855 type NoMethod ListOperationsResponse 856 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 857 } 858 859 // Location: A resource that represents a Google Cloud location. 860 type Location struct { 861 // DisplayName: The friendly name for this location, typically a nearby city 862 // name. For example, "Tokyo". 863 DisplayName string `json:"displayName,omitempty"` 864 // Labels: Cross-service attributes for the location. For example 865 // {"cloud.googleapis.com/region": "us-east1"} 866 Labels map[string]string `json:"labels,omitempty"` 867 // LocationId: The canonical id for this location. For example: "us-east1". 868 LocationId string `json:"locationId,omitempty"` 869 // Metadata: Service-specific metadata. For example the available capacity at 870 // the given location. 871 Metadata googleapi.RawMessage `json:"metadata,omitempty"` 872 // Name: Resource name for the location, which may vary between 873 // implementations. For example: 874 // "projects/example-project/locations/us-east1" 875 Name string `json:"name,omitempty"` 876 877 // ServerResponse contains the HTTP response code and headers from the server. 878 googleapi.ServerResponse `json:"-"` 879 // ForceSendFields is a list of field names (e.g. "DisplayName") to 880 // unconditionally include in API requests. By default, fields with empty or 881 // default values are omitted from API requests. See 882 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 883 // details. 884 ForceSendFields []string `json:"-"` 885 // NullFields is a list of field names (e.g. "DisplayName") to include in API 886 // requests with the JSON null value. By default, fields with empty values are 887 // omitted from API requests. See 888 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 889 NullFields []string `json:"-"` 890 } 891 892 func (s *Location) MarshalJSON() ([]byte, error) { 893 type NoMethod Location 894 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 895 } 896 897 // Membership: Membership contains information about a member cluster. 898 type Membership struct { 899 // Authority: Optional. How to identify workloads from this Membership. See the 900 // documentation on Workload Identity for more details: 901 // https://cloud.google.com/kubernetes-engine/docs/how-to/workload-identity 902 Authority *Authority `json:"authority,omitempty"` 903 // CreateTime: Output only. When the Membership was created. 904 CreateTime string `json:"createTime,omitempty"` 905 // DeleteTime: Output only. When the Membership was deleted. 906 DeleteTime string `json:"deleteTime,omitempty"` 907 // Description: Optional. Description of this membership, limited to 63 908 // characters. Must match the regex: `a-zA-Z0-9*` 909 Description string `json:"description,omitempty"` 910 // Endpoint: Optional. Endpoint information to reach this member. 911 Endpoint *MembershipEndpoint `json:"endpoint,omitempty"` 912 // ExternalId: Optional. An externally-generated and managed ID for this 913 // Membership. This ID may be modified after creation, but this is not 914 // recommended. For GKE clusters, external_id is managed by the Hub API and 915 // updates will be ignored. The ID must match the regex: `a-zA-Z0-9*` If this 916 // Membership represents a Kubernetes cluster, this value should be set to the 917 // UID of the `kube-system` namespace object. 918 ExternalId string `json:"externalId,omitempty"` 919 // InfrastructureType: Optional. The infrastructure type this Membership is 920 // running on. 921 // 922 // Possible values: 923 // "INFRASTRUCTURE_TYPE_UNSPECIFIED" - No type was specified. Some Hub 924 // functionality may require a type be specified, and will not support 925 // Memberships with this value. 926 // "ON_PREM" - Private infrastructure that is owned or operated by customer. 927 // This includes GKE distributions such as GKE-OnPrem and GKE-OnBareMetal. 928 // "MULTI_CLOUD" - Public cloud infrastructure. 929 InfrastructureType string `json:"infrastructureType,omitempty"` 930 // Labels: Optional. GCP labels for this membership. 931 Labels map[string]string `json:"labels,omitempty"` 932 // LastConnectionTime: Output only. For clusters using Connect, the timestamp 933 // of the most recent connection established with Google Cloud. This time is 934 // updated every several minutes, not continuously. For clusters that do not 935 // use GKE Connect, or that have never connected successfully, this field will 936 // be unset. 937 LastConnectionTime string `json:"lastConnectionTime,omitempty"` 938 // MonitoringConfig: Optional. The monitoring config information for this 939 // membership. 940 MonitoringConfig *MonitoringConfig `json:"monitoringConfig,omitempty"` 941 // Name: Output only. The full, unique name of this Membership resource in the 942 // format `projects/*/locations/*/memberships/{membership_id}`, set during 943 // creation. `membership_id` must be a valid RFC 1123 compliant DNS label: 1. 944 // At most 63 characters in length 2. It must consist of lower case 945 // alphanumeric characters or `-` 3. It must start and end with an alphanumeric 946 // character Which can be expressed as the regex: 947 // `[a-z0-9]([-a-z0-9]*[a-z0-9])?`, with a maximum length of 63 characters. 948 Name string `json:"name,omitempty"` 949 // State: Output only. State of the Membership resource. 950 State *MembershipState `json:"state,omitempty"` 951 // UniqueId: Output only. Google-generated UUID for this resource. This is 952 // unique across all Membership resources. If a Membership resource is deleted 953 // and another resource with the same name is created, it gets a different 954 // unique_id. 955 UniqueId string `json:"uniqueId,omitempty"` 956 // UpdateTime: Output only. When the Membership was last updated. 957 UpdateTime string `json:"updateTime,omitempty"` 958 959 // ServerResponse contains the HTTP response code and headers from the server. 960 googleapi.ServerResponse `json:"-"` 961 // ForceSendFields is a list of field names (e.g. "Authority") to 962 // unconditionally include in API requests. By default, fields with empty or 963 // default values are omitted from API requests. See 964 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 965 // details. 966 ForceSendFields []string `json:"-"` 967 // NullFields is a list of field names (e.g. "Authority") to include in API 968 // requests with the JSON null value. By default, fields with empty values are 969 // omitted from API requests. See 970 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 971 NullFields []string `json:"-"` 972 } 973 974 func (s *Membership) MarshalJSON() ([]byte, error) { 975 type NoMethod Membership 976 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 977 } 978 979 // MembershipEndpoint: MembershipEndpoint contains information needed to 980 // contact a Kubernetes API, endpoint and any additional Kubernetes metadata. 981 type MembershipEndpoint struct { 982 // ApplianceCluster: Optional. Specific information for a GDC Edge Appliance 983 // cluster. 984 ApplianceCluster *ApplianceCluster `json:"applianceCluster,omitempty"` 985 // EdgeCluster: Optional. Specific information for a Google Edge cluster. 986 EdgeCluster *EdgeCluster `json:"edgeCluster,omitempty"` 987 // GkeCluster: Optional. Specific information for a GKE-on-GCP cluster. 988 GkeCluster *GkeCluster `json:"gkeCluster,omitempty"` 989 // KubernetesMetadata: Output only. Useful Kubernetes-specific metadata. 990 KubernetesMetadata *KubernetesMetadata `json:"kubernetesMetadata,omitempty"` 991 // KubernetesResource: Optional. The in-cluster Kubernetes Resources that 992 // should be applied for a correctly registered cluster, in the steady state. 993 // These resources: * Ensure that the cluster is exclusively registered to one 994 // and only one Hub Membership. * Propagate Workload Pool Information available 995 // in the Membership Authority field. * Ensure proper initial configuration of 996 // default Hub Features. 997 KubernetesResource *KubernetesResource `json:"kubernetesResource,omitempty"` 998 // MultiCloudCluster: Optional. Specific information for a GKE Multi-Cloud 999 // cluster. 1000 MultiCloudCluster *MultiCloudCluster `json:"multiCloudCluster,omitempty"` 1001 // OnPremCluster: Optional. Specific information for a GKE On-Prem cluster. An 1002 // onprem user-cluster who has no resourceLink is not allowed to use this 1003 // field, it should have a nil "type" instead. 1004 OnPremCluster *OnPremCluster `json:"onPremCluster,omitempty"` 1005 // ForceSendFields is a list of field names (e.g. "ApplianceCluster") to 1006 // unconditionally include in API requests. By default, fields with empty or 1007 // default values are omitted from API requests. See 1008 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1009 // details. 1010 ForceSendFields []string `json:"-"` 1011 // NullFields is a list of field names (e.g. "ApplianceCluster") to include in 1012 // API requests with the JSON null value. By default, fields with empty values 1013 // are omitted from API requests. See 1014 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1015 NullFields []string `json:"-"` 1016 } 1017 1018 func (s *MembershipEndpoint) MarshalJSON() ([]byte, error) { 1019 type NoMethod MembershipEndpoint 1020 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1021 } 1022 1023 // MembershipState: State of the Membership resource. 1024 type MembershipState struct { 1025 // Code: Output only. The current state of the Membership resource. 1026 // 1027 // Possible values: 1028 // "CODE_UNSPECIFIED" - The code is not set. 1029 // "CREATING" - The cluster is being registered. 1030 // "READY" - The cluster is registered. 1031 // "DELETING" - The cluster is being unregistered. 1032 // "UPDATING" - The Membership is being updated. 1033 // "SERVICE_UPDATING" - The Membership is being updated by the Hub Service. 1034 Code string `json:"code,omitempty"` 1035 // Description: This field is never set by the Hub Service. 1036 Description string `json:"description,omitempty"` 1037 // UpdateTime: This field is never set by the Hub Service. 1038 UpdateTime string `json:"updateTime,omitempty"` 1039 // ForceSendFields is a list of field names (e.g. "Code") to unconditionally 1040 // include in API requests. By default, fields with empty or default values are 1041 // omitted from API requests. See 1042 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1043 // details. 1044 ForceSendFields []string `json:"-"` 1045 // NullFields is a list of field names (e.g. "Code") to include in API requests 1046 // with the JSON null value. By default, fields with empty values are omitted 1047 // from API requests. See 1048 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1049 NullFields []string `json:"-"` 1050 } 1051 1052 func (s *MembershipState) MarshalJSON() ([]byte, error) { 1053 type NoMethod MembershipState 1054 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1055 } 1056 1057 // MonitoringConfig: MonitoringConfig informs Fleet-based 1058 // applications/services/UIs how the metrics for the underlying cluster is 1059 // reported to cloud monitoring services. It can be set from empty to 1060 // non-empty, but can't be mutated directly to prevent accidentally breaking 1061 // the constinousty of metrics. 1062 type MonitoringConfig struct { 1063 // Cluster: Optional. Cluster name used to report metrics. For Anthos on 1064 // VMWare/Baremetal/MultiCloud clusters, it would be in format 1065 // {cluster_type}/{cluster_name}, e.g., "awsClusters/cluster_1". 1066 Cluster string `json:"cluster,omitempty"` 1067 // ClusterHash: Optional. For GKE and Multicloud clusters, this is the UUID of 1068 // the cluster resource. For VMWare and Baremetal clusters, this is the 1069 // kube-system UID. 1070 ClusterHash string `json:"clusterHash,omitempty"` 1071 // KubernetesMetricsPrefix: Optional. Kubernetes system metrics, if available, 1072 // are written to this prefix. This defaults to kubernetes.io for GKE, and 1073 // kubernetes.io/anthos for Anthos eventually. Noted: Anthos MultiCloud will 1074 // have kubernetes.io prefix today but will migration to be under 1075 // kubernetes.io/anthos. 1076 KubernetesMetricsPrefix string `json:"kubernetesMetricsPrefix,omitempty"` 1077 // Location: Optional. Location used to report Metrics 1078 Location string `json:"location,omitempty"` 1079 // ProjectId: Optional. Project used to report Metrics 1080 ProjectId string `json:"projectId,omitempty"` 1081 // ForceSendFields is a list of field names (e.g. "Cluster") to unconditionally 1082 // include in API requests. By default, fields with empty or default values are 1083 // omitted from API requests. See 1084 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1085 // details. 1086 ForceSendFields []string `json:"-"` 1087 // NullFields is a list of field names (e.g. "Cluster") to include in API 1088 // requests with the JSON null value. By default, fields with empty values are 1089 // omitted from API requests. See 1090 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1091 NullFields []string `json:"-"` 1092 } 1093 1094 func (s *MonitoringConfig) MarshalJSON() ([]byte, error) { 1095 type NoMethod MonitoringConfig 1096 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1097 } 1098 1099 // MultiCloudCluster: MultiCloudCluster contains information specific to GKE 1100 // Multi-Cloud clusters. 1101 type MultiCloudCluster struct { 1102 // ClusterMissing: Output only. If cluster_missing is set then it denotes that 1103 // API(gkemulticloud.googleapis.com) resource for this GKE Multi-Cloud cluster 1104 // no longer exists. 1105 ClusterMissing bool `json:"clusterMissing,omitempty"` 1106 // ResourceLink: Immutable. Self-link of the GCP resource for the GKE 1107 // Multi-Cloud cluster. For example: 1108 // //gkemulticloud.googleapis.com/projects/my-project/locations/us-west1-a/awsCl 1109 // usters/my-cluster 1110 // //gkemulticloud.googleapis.com/projects/my-project/locations/us-west1-a/azure 1111 // Clusters/my-cluster 1112 // //gkemulticloud.googleapis.com/projects/my-project/locations/us-west1-a/attac 1113 // hedClusters/my-cluster 1114 ResourceLink string `json:"resourceLink,omitempty"` 1115 // ForceSendFields is a list of field names (e.g. "ClusterMissing") to 1116 // unconditionally include in API requests. By default, fields with empty or 1117 // default values are omitted from API requests. See 1118 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1119 // details. 1120 ForceSendFields []string `json:"-"` 1121 // NullFields is a list of field names (e.g. "ClusterMissing") to include in 1122 // API requests with the JSON null value. By default, fields with empty values 1123 // are omitted from API requests. See 1124 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1125 NullFields []string `json:"-"` 1126 } 1127 1128 func (s *MultiCloudCluster) MarshalJSON() ([]byte, error) { 1129 type NoMethod MultiCloudCluster 1130 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1131 } 1132 1133 // OnPremCluster: OnPremCluster contains information specific to GKE On-Prem 1134 // clusters. 1135 type OnPremCluster struct { 1136 // AdminCluster: Immutable. Whether the cluster is an admin cluster. 1137 AdminCluster bool `json:"adminCluster,omitempty"` 1138 // ClusterMissing: Output only. If cluster_missing is set then it denotes that 1139 // API(gkeonprem.googleapis.com) resource for this GKE On-Prem cluster no 1140 // longer exists. 1141 ClusterMissing bool `json:"clusterMissing,omitempty"` 1142 // ClusterType: Immutable. The on prem cluster's type. 1143 // 1144 // Possible values: 1145 // "CLUSTERTYPE_UNSPECIFIED" - The ClusterType is not set. 1146 // "BOOTSTRAP" - The ClusterType is bootstrap cluster. 1147 // "HYBRID" - The ClusterType is baremetal hybrid cluster. 1148 // "STANDALONE" - The ClusterType is baremetal standalone cluster. 1149 // "USER" - The ClusterType is user cluster. 1150 ClusterType string `json:"clusterType,omitempty"` 1151 // ResourceLink: Immutable. Self-link of the GCP resource for the GKE On-Prem 1152 // cluster. For example: 1153 // //gkeonprem.googleapis.com/projects/my-project/locations/us-west1-a/vmwareClu 1154 // sters/my-cluster 1155 // //gkeonprem.googleapis.com/projects/my-project/locations/us-west1-a/bareMetal 1156 // Clusters/my-cluster 1157 ResourceLink string `json:"resourceLink,omitempty"` 1158 // ForceSendFields is a list of field names (e.g. "AdminCluster") to 1159 // unconditionally include in API requests. By default, fields with empty or 1160 // default values are omitted from API requests. See 1161 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1162 // details. 1163 ForceSendFields []string `json:"-"` 1164 // NullFields is a list of field names (e.g. "AdminCluster") to include in API 1165 // requests with the JSON null value. By default, fields with empty values are 1166 // omitted from API requests. See 1167 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1168 NullFields []string `json:"-"` 1169 } 1170 1171 func (s *OnPremCluster) MarshalJSON() ([]byte, error) { 1172 type NoMethod OnPremCluster 1173 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1174 } 1175 1176 // Operation: This resource represents a long-running operation that is the 1177 // result of a network API call. 1178 type Operation struct { 1179 // Done: If the value is `false`, it means the operation is still in progress. 1180 // If `true`, the operation is completed, and either `error` or `response` is 1181 // available. 1182 Done bool `json:"done,omitempty"` 1183 // Error: The error result of the operation in case of failure or cancellation. 1184 Error *GoogleRpcStatus `json:"error,omitempty"` 1185 // Metadata: Service-specific metadata associated with the operation. It 1186 // typically contains progress information and common metadata such as create 1187 // time. Some services might not provide such metadata. Any method that returns 1188 // a long-running operation should document the metadata type, if any. 1189 Metadata googleapi.RawMessage `json:"metadata,omitempty"` 1190 // Name: The server-assigned name, which is only unique within the same service 1191 // that originally returns it. If you use the default HTTP mapping, the `name` 1192 // should be a resource name ending with `operations/{unique_id}`. 1193 Name string `json:"name,omitempty"` 1194 // Response: The normal, successful response of the operation. If the original 1195 // method returns no data on success, such as `Delete`, the response is 1196 // `google.protobuf.Empty`. If the original method is standard 1197 // `Get`/`Create`/`Update`, the response should be the resource. For other 1198 // methods, the response should have the type `XxxResponse`, where `Xxx` is the 1199 // original method name. For example, if the original method name is 1200 // `TakeSnapshot()`, the inferred response type is `TakeSnapshotResponse`. 1201 Response googleapi.RawMessage `json:"response,omitempty"` 1202 1203 // ServerResponse contains the HTTP response code and headers from the server. 1204 googleapi.ServerResponse `json:"-"` 1205 // ForceSendFields is a list of field names (e.g. "Done") to unconditionally 1206 // include in API requests. By default, fields with empty or default values are 1207 // omitted from API requests. See 1208 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1209 // details. 1210 ForceSendFields []string `json:"-"` 1211 // NullFields is a list of field names (e.g. "Done") to include in API requests 1212 // with the JSON null value. By default, fields with empty values are omitted 1213 // from API requests. See 1214 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1215 NullFields []string `json:"-"` 1216 } 1217 1218 func (s *Operation) MarshalJSON() ([]byte, error) { 1219 type NoMethod Operation 1220 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1221 } 1222 1223 // OperationMetadata: Represents the metadata of the long-running operation. 1224 type OperationMetadata struct { 1225 // ApiVersion: Output only. API version used to start the operation. 1226 ApiVersion string `json:"apiVersion,omitempty"` 1227 // CancelRequested: Output only. Identifies whether the user has requested 1228 // cancellation of the operation. Operations that have successfully been 1229 // cancelled have Operation.error value with a google.rpc.Status.code of 1, 1230 // corresponding to `Code.CANCELLED`. 1231 CancelRequested bool `json:"cancelRequested,omitempty"` 1232 // CreateTime: Output only. The time the operation was created. 1233 CreateTime string `json:"createTime,omitempty"` 1234 // EndTime: Output only. The time the operation finished running. 1235 EndTime string `json:"endTime,omitempty"` 1236 // StatusDetail: Output only. Human-readable status of the operation, if any. 1237 StatusDetail string `json:"statusDetail,omitempty"` 1238 // Target: Output only. Server-defined resource path for the target of the 1239 // operation. 1240 Target string `json:"target,omitempty"` 1241 // Verb: Output only. Name of the verb executed by the operation. 1242 Verb string `json:"verb,omitempty"` 1243 // ForceSendFields is a list of field names (e.g. "ApiVersion") to 1244 // unconditionally include in API requests. By default, fields with empty or 1245 // default values are omitted from API requests. See 1246 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1247 // details. 1248 ForceSendFields []string `json:"-"` 1249 // NullFields is a list of field names (e.g. "ApiVersion") to include in API 1250 // requests with the JSON null value. By default, fields with empty values are 1251 // omitted from API requests. See 1252 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1253 NullFields []string `json:"-"` 1254 } 1255 1256 func (s *OperationMetadata) MarshalJSON() ([]byte, error) { 1257 type NoMethod OperationMetadata 1258 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1259 } 1260 1261 // Policy: An Identity and Access Management (IAM) policy, which specifies 1262 // access controls for Google Cloud resources. A `Policy` is a collection of 1263 // `bindings`. A `binding` binds one or more `members`, or principals, to a 1264 // single `role`. Principals can be user accounts, service accounts, Google 1265 // groups, and domains (such as G Suite). A `role` is a named list of 1266 // permissions; each `role` can be an IAM predefined role or a user-created 1267 // custom role. For some types of Google Cloud resources, a `binding` can also 1268 // specify a `condition`, which is a logical expression that allows access to a 1269 // resource only if the expression evaluates to `true`. A condition can add 1270 // constraints based on attributes of the request, the resource, or both. To 1271 // learn which resources support conditions in their IAM policies, see the IAM 1272 // documentation 1273 // (https://cloud.google.com/iam/help/conditions/resource-policies). **JSON 1274 // example:** ``` { "bindings": [ { "role": 1275 // "roles/resourcemanager.organizationAdmin", "members": [ 1276 // "user:mike@example.com", "group:admins@example.com", "domain:google.com", 1277 // "serviceAccount:my-project-id@appspot.gserviceaccount.com" ] }, { "role": 1278 // "roles/resourcemanager.organizationViewer", "members": [ 1279 // "user:eve@example.com" ], "condition": { "title": "expirable access", 1280 // "description": "Does not grant access after Sep 2020", "expression": 1281 // "request.time < timestamp('2020-10-01T00:00:00.000Z')", } } ], "etag": 1282 // "BwWWja0YfJA=", "version": 3 } ``` **YAML example:** ``` bindings: - 1283 // members: - user:mike@example.com - group:admins@example.com - 1284 // domain:google.com - serviceAccount:my-project-id@appspot.gserviceaccount.com 1285 // role: roles/resourcemanager.organizationAdmin - members: - 1286 // user:eve@example.com role: roles/resourcemanager.organizationViewer 1287 // condition: title: expirable access description: Does not grant access after 1288 // Sep 2020 expression: request.time < timestamp('2020-10-01T00:00:00.000Z') 1289 // etag: BwWWja0YfJA= version: 3 ``` For a description of IAM and its features, 1290 // see the IAM documentation (https://cloud.google.com/iam/docs/). 1291 type Policy struct { 1292 // AuditConfigs: Specifies cloud audit logging configuration for this policy. 1293 AuditConfigs []*AuditConfig `json:"auditConfigs,omitempty"` 1294 // Bindings: Associates a list of `members`, or principals, with a `role`. 1295 // Optionally, may specify a `condition` that determines how and when the 1296 // `bindings` are applied. Each of the `bindings` must contain at least one 1297 // principal. The `bindings` in a `Policy` can refer to up to 1,500 principals; 1298 // up to 250 of these principals can be Google groups. Each occurrence of a 1299 // principal counts towards these limits. For example, if the `bindings` grant 1300 // 50 different roles to `user:alice@example.com`, and not to any other 1301 // principal, then you can add another 1,450 principals to the `bindings` in 1302 // the `Policy`. 1303 Bindings []*Binding `json:"bindings,omitempty"` 1304 // Etag: `etag` is used for optimistic concurrency control as a way to help 1305 // prevent simultaneous updates of a policy from overwriting each other. It is 1306 // strongly suggested that systems make use of the `etag` in the 1307 // read-modify-write cycle to perform policy updates in order to avoid race 1308 // conditions: An `etag` is returned in the response to `getIamPolicy`, and 1309 // systems are expected to put that etag in the request to `setIamPolicy` to 1310 // ensure that their change will be applied to the same version of the policy. 1311 // **Important:** If you use IAM Conditions, you must include the `etag` field 1312 // whenever you call `setIamPolicy`. If you omit this field, then IAM allows 1313 // you to overwrite a version `3` policy with a version `1` policy, and all of 1314 // the conditions in the version `3` policy are lost. 1315 Etag string `json:"etag,omitempty"` 1316 // Version: Specifies the format of the policy. Valid values are `0`, `1`, and 1317 // `3`. Requests that specify an invalid value are rejected. Any operation that 1318 // affects conditional role bindings must specify version `3`. This requirement 1319 // applies to the following operations: * Getting a policy that includes a 1320 // conditional role binding * Adding a conditional role binding to a policy * 1321 // Changing a conditional role binding in a policy * Removing any role binding, 1322 // with or without a condition, from a policy that includes conditions 1323 // **Important:** If you use IAM Conditions, you must include the `etag` field 1324 // whenever you call `setIamPolicy`. If you omit this field, then IAM allows 1325 // you to overwrite a version `3` policy with a version `1` policy, and all of 1326 // the conditions in the version `3` policy are lost. If a policy does not 1327 // include any conditions, operations on that policy may specify any valid 1328 // version or leave the field unset. To learn which resources support 1329 // conditions in their IAM policies, see the IAM documentation 1330 // (https://cloud.google.com/iam/help/conditions/resource-policies). 1331 Version int64 `json:"version,omitempty"` 1332 1333 // ServerResponse contains the HTTP response code and headers from the server. 1334 googleapi.ServerResponse `json:"-"` 1335 // ForceSendFields is a list of field names (e.g. "AuditConfigs") to 1336 // unconditionally include in API requests. By default, fields with empty or 1337 // default values are omitted from API requests. See 1338 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1339 // details. 1340 ForceSendFields []string `json:"-"` 1341 // NullFields is a list of field names (e.g. "AuditConfigs") to include in API 1342 // requests with the JSON null value. By default, fields with empty values are 1343 // omitted from API requests. See 1344 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1345 NullFields []string `json:"-"` 1346 } 1347 1348 func (s *Policy) MarshalJSON() ([]byte, error) { 1349 type NoMethod Policy 1350 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1351 } 1352 1353 // ResourceManifest: ResourceManifest represents a single Kubernetes resource 1354 // to be applied to the cluster. 1355 type ResourceManifest struct { 1356 // ClusterScoped: Whether the resource provided in the manifest is 1357 // `cluster_scoped`. If unset, the manifest is assumed to be namespace scoped. 1358 // This field is used for REST mapping when applying the resource in a cluster. 1359 ClusterScoped bool `json:"clusterScoped,omitempty"` 1360 // Manifest: YAML manifest of the resource. 1361 Manifest string `json:"manifest,omitempty"` 1362 // ForceSendFields is a list of field names (e.g. "ClusterScoped") to 1363 // unconditionally include in API requests. By default, fields with empty or 1364 // default values are omitted from API requests. See 1365 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1366 // details. 1367 ForceSendFields []string `json:"-"` 1368 // NullFields is a list of field names (e.g. "ClusterScoped") to include in API 1369 // requests with the JSON null value. By default, fields with empty values are 1370 // omitted from API requests. See 1371 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1372 NullFields []string `json:"-"` 1373 } 1374 1375 func (s *ResourceManifest) MarshalJSON() ([]byte, error) { 1376 type NoMethod ResourceManifest 1377 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1378 } 1379 1380 // ResourceOptions: ResourceOptions represent options for Kubernetes resource 1381 // generation. 1382 type ResourceOptions struct { 1383 // ConnectVersion: Optional. The Connect agent version to use for 1384 // connect_resources. Defaults to the latest GKE Connect version. The version 1385 // must be a currently supported version, obsolete versions will be rejected. 1386 ConnectVersion string `json:"connectVersion,omitempty"` 1387 // K8sVersion: Optional. Major version of the Kubernetes cluster. This is only 1388 // used to determine which version to use for the CustomResourceDefinition 1389 // resources, `apiextensions/v1beta1` or`apiextensions/v1`. 1390 K8sVersion string `json:"k8sVersion,omitempty"` 1391 // V1beta1Crd: Optional. Use `apiextensions/v1beta1` instead of 1392 // `apiextensions/v1` for CustomResourceDefinition resources. This option 1393 // should be set for clusters with Kubernetes apiserver versions <1.16. 1394 V1beta1Crd bool `json:"v1beta1Crd,omitempty"` 1395 // ForceSendFields is a list of field names (e.g. "ConnectVersion") to 1396 // unconditionally include in API requests. By default, fields with empty or 1397 // default values are omitted from API requests. See 1398 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1399 // details. 1400 ForceSendFields []string `json:"-"` 1401 // NullFields is a list of field names (e.g. "ConnectVersion") to include in 1402 // API requests with the JSON null value. By default, fields with empty values 1403 // are omitted from API requests. See 1404 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1405 NullFields []string `json:"-"` 1406 } 1407 1408 func (s *ResourceOptions) MarshalJSON() ([]byte, error) { 1409 type NoMethod ResourceOptions 1410 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1411 } 1412 1413 // SetIamPolicyRequest: Request message for `SetIamPolicy` method. 1414 type SetIamPolicyRequest struct { 1415 // Policy: REQUIRED: The complete policy to be applied to the `resource`. The 1416 // size of the policy is limited to a few 10s of KB. An empty policy is a valid 1417 // policy but certain Google Cloud services (such as Projects) might reject 1418 // them. 1419 Policy *Policy `json:"policy,omitempty"` 1420 // UpdateMask: OPTIONAL: A FieldMask specifying which fields of the policy to 1421 // modify. Only the fields in the mask will be modified. If no mask is 1422 // provided, the following default mask is used: `paths: "bindings, etag" 1423 UpdateMask string `json:"updateMask,omitempty"` 1424 // ForceSendFields is a list of field names (e.g. "Policy") to unconditionally 1425 // include in API requests. By default, fields with empty or default values are 1426 // omitted from API requests. See 1427 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1428 // details. 1429 ForceSendFields []string `json:"-"` 1430 // NullFields is a list of field names (e.g. "Policy") to include in API 1431 // requests with the JSON null value. By default, fields with empty values are 1432 // omitted from API requests. See 1433 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1434 NullFields []string `json:"-"` 1435 } 1436 1437 func (s *SetIamPolicyRequest) MarshalJSON() ([]byte, error) { 1438 type NoMethod SetIamPolicyRequest 1439 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1440 } 1441 1442 // TestIamPermissionsRequest: Request message for `TestIamPermissions` method. 1443 type TestIamPermissionsRequest struct { 1444 // Permissions: The set of permissions to check for the `resource`. Permissions 1445 // with wildcards (such as `*` or `storage.*`) are not allowed. For more 1446 // information see IAM Overview 1447 // (https://cloud.google.com/iam/docs/overview#permissions). 1448 Permissions []string `json:"permissions,omitempty"` 1449 // ForceSendFields is a list of field names (e.g. "Permissions") to 1450 // unconditionally include in API requests. By default, fields with empty or 1451 // default values are omitted from API requests. See 1452 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1453 // details. 1454 ForceSendFields []string `json:"-"` 1455 // NullFields is a list of field names (e.g. "Permissions") to include in API 1456 // requests with the JSON null value. By default, fields with empty values are 1457 // omitted from API requests. See 1458 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1459 NullFields []string `json:"-"` 1460 } 1461 1462 func (s *TestIamPermissionsRequest) MarshalJSON() ([]byte, error) { 1463 type NoMethod TestIamPermissionsRequest 1464 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1465 } 1466 1467 // TestIamPermissionsResponse: Response message for `TestIamPermissions` 1468 // method. 1469 type TestIamPermissionsResponse struct { 1470 // Permissions: A subset of `TestPermissionsRequest.permissions` that the 1471 // caller is allowed. 1472 Permissions []string `json:"permissions,omitempty"` 1473 1474 // ServerResponse contains the HTTP response code and headers from the server. 1475 googleapi.ServerResponse `json:"-"` 1476 // ForceSendFields is a list of field names (e.g. "Permissions") to 1477 // unconditionally include in API requests. By default, fields with empty or 1478 // default values are omitted from API requests. See 1479 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1480 // details. 1481 ForceSendFields []string `json:"-"` 1482 // NullFields is a list of field names (e.g. "Permissions") to include in API 1483 // requests with the JSON null value. By default, fields with empty values are 1484 // omitted from API requests. See 1485 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1486 NullFields []string `json:"-"` 1487 } 1488 1489 func (s *TestIamPermissionsResponse) MarshalJSON() ([]byte, error) { 1490 type NoMethod TestIamPermissionsResponse 1491 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1492 } 1493 1494 // TypeMeta: TypeMeta is the type information needed for content unmarshalling 1495 // of Kubernetes resources in the manifest. 1496 type TypeMeta struct { 1497 // ApiVersion: APIVersion of the resource (e.g. v1). 1498 ApiVersion string `json:"apiVersion,omitempty"` 1499 // Kind: Kind of the resource (e.g. Deployment). 1500 Kind string `json:"kind,omitempty"` 1501 // ForceSendFields is a list of field names (e.g. "ApiVersion") to 1502 // unconditionally include in API requests. By default, fields with empty or 1503 // default values are omitted from API requests. See 1504 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1505 // details. 1506 ForceSendFields []string `json:"-"` 1507 // NullFields is a list of field names (e.g. "ApiVersion") to include in API 1508 // requests with the JSON null value. By default, fields with empty values are 1509 // omitted from API requests. See 1510 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1511 NullFields []string `json:"-"` 1512 } 1513 1514 func (s *TypeMeta) MarshalJSON() ([]byte, error) { 1515 type NoMethod TypeMeta 1516 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1517 } 1518 1519 // ValidateExclusivityResponse: The response of exclusivity artifacts 1520 // validation result status. 1521 type ValidateExclusivityResponse struct { 1522 // Status: The validation result. * `OK` means that exclusivity is validated, 1523 // assuming the manifest produced by GenerateExclusivityManifest is 1524 // successfully applied. * `ALREADY_EXISTS` means that the Membership CRD is 1525 // already owned by another Hub. See `status.message` for more information. 1526 Status *GoogleRpcStatus `json:"status,omitempty"` 1527 1528 // ServerResponse contains the HTTP response code and headers from the server. 1529 googleapi.ServerResponse `json:"-"` 1530 // ForceSendFields is a list of field names (e.g. "Status") to unconditionally 1531 // include in API requests. By default, fields with empty or default values are 1532 // omitted from API requests. See 1533 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1534 // details. 1535 ForceSendFields []string `json:"-"` 1536 // NullFields is a list of field names (e.g. "Status") to include in API 1537 // requests with the JSON null value. By default, fields with empty values are 1538 // omitted from API requests. See 1539 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1540 NullFields []string `json:"-"` 1541 } 1542 1543 func (s *ValidateExclusivityResponse) MarshalJSON() ([]byte, error) { 1544 type NoMethod ValidateExclusivityResponse 1545 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1546 } 1547 1548 type ProjectsLocationsGetCall struct { 1549 s *Service 1550 name string 1551 urlParams_ gensupport.URLParams 1552 ifNoneMatch_ string 1553 ctx_ context.Context 1554 header_ http.Header 1555 } 1556 1557 // Get: Gets information about a location. 1558 // 1559 // - name: Resource name for the location. 1560 func (r *ProjectsLocationsService) Get(name string) *ProjectsLocationsGetCall { 1561 c := &ProjectsLocationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 1562 c.name = name 1563 return c 1564 } 1565 1566 // Fields allows partial responses to be retrieved. See 1567 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 1568 // details. 1569 func (c *ProjectsLocationsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsGetCall { 1570 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 1571 return c 1572 } 1573 1574 // IfNoneMatch sets an optional parameter which makes the operation fail if the 1575 // object's ETag matches the given value. This is useful for getting updates 1576 // only after the object has changed since the last request. 1577 func (c *ProjectsLocationsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsGetCall { 1578 c.ifNoneMatch_ = entityTag 1579 return c 1580 } 1581 1582 // Context sets the context to be used in this call's Do method. 1583 func (c *ProjectsLocationsGetCall) Context(ctx context.Context) *ProjectsLocationsGetCall { 1584 c.ctx_ = ctx 1585 return c 1586 } 1587 1588 // Header returns a http.Header that can be modified by the caller to add 1589 // headers to the request. 1590 func (c *ProjectsLocationsGetCall) Header() http.Header { 1591 if c.header_ == nil { 1592 c.header_ = make(http.Header) 1593 } 1594 return c.header_ 1595 } 1596 1597 func (c *ProjectsLocationsGetCall) doRequest(alt string) (*http.Response, error) { 1598 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) 1599 if c.ifNoneMatch_ != "" { 1600 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 1601 } 1602 var body io.Reader = nil 1603 c.urlParams_.Set("alt", alt) 1604 c.urlParams_.Set("prettyPrint", "false") 1605 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") 1606 urls += "?" + c.urlParams_.Encode() 1607 req, err := http.NewRequest("GET", urls, body) 1608 if err != nil { 1609 return nil, err 1610 } 1611 req.Header = reqHeaders 1612 googleapi.Expand(req.URL, map[string]string{ 1613 "name": c.name, 1614 }) 1615 return gensupport.SendRequest(c.ctx_, c.s.client, req) 1616 } 1617 1618 // Do executes the "gkehub.projects.locations.get" call. 1619 // Any non-2xx status code is an error. Response headers are in either 1620 // *Location.ServerResponse.Header or (if a response was returned at all) in 1621 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 1622 // whether the returned error was because http.StatusNotModified was returned. 1623 func (c *ProjectsLocationsGetCall) Do(opts ...googleapi.CallOption) (*Location, error) { 1624 gensupport.SetOptions(c.urlParams_, opts...) 1625 res, err := c.doRequest("json") 1626 if res != nil && res.StatusCode == http.StatusNotModified { 1627 if res.Body != nil { 1628 res.Body.Close() 1629 } 1630 return nil, gensupport.WrapError(&googleapi.Error{ 1631 Code: res.StatusCode, 1632 Header: res.Header, 1633 }) 1634 } 1635 if err != nil { 1636 return nil, err 1637 } 1638 defer googleapi.CloseBody(res) 1639 if err := googleapi.CheckResponse(res); err != nil { 1640 return nil, gensupport.WrapError(err) 1641 } 1642 ret := &Location{ 1643 ServerResponse: googleapi.ServerResponse{ 1644 Header: res.Header, 1645 HTTPStatusCode: res.StatusCode, 1646 }, 1647 } 1648 target := &ret 1649 if err := gensupport.DecodeResponse(target, res); err != nil { 1650 return nil, err 1651 } 1652 return ret, nil 1653 } 1654 1655 type ProjectsLocationsListCall struct { 1656 s *Service 1657 name string 1658 urlParams_ gensupport.URLParams 1659 ifNoneMatch_ string 1660 ctx_ context.Context 1661 header_ http.Header 1662 } 1663 1664 // List: Lists information about the supported locations for this service. 1665 // 1666 // - name: The resource that owns the locations collection, if applicable. 1667 func (r *ProjectsLocationsService) List(name string) *ProjectsLocationsListCall { 1668 c := &ProjectsLocationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 1669 c.name = name 1670 return c 1671 } 1672 1673 // Filter sets the optional parameter "filter": A filter to narrow down results 1674 // to a preferred subset. The filtering language accepts strings like 1675 // "displayName=tokyo", and is documented in more detail in AIP-160 1676 // (https://google.aip.dev/160). 1677 func (c *ProjectsLocationsListCall) Filter(filter string) *ProjectsLocationsListCall { 1678 c.urlParams_.Set("filter", filter) 1679 return c 1680 } 1681 1682 // PageSize sets the optional parameter "pageSize": The maximum number of 1683 // results to return. If not set, the service selects a default. 1684 func (c *ProjectsLocationsListCall) PageSize(pageSize int64) *ProjectsLocationsListCall { 1685 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) 1686 return c 1687 } 1688 1689 // PageToken sets the optional parameter "pageToken": A page token received 1690 // from the `next_page_token` field in the response. Send that page token to 1691 // receive the subsequent page. 1692 func (c *ProjectsLocationsListCall) PageToken(pageToken string) *ProjectsLocationsListCall { 1693 c.urlParams_.Set("pageToken", pageToken) 1694 return c 1695 } 1696 1697 // Fields allows partial responses to be retrieved. See 1698 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 1699 // details. 1700 func (c *ProjectsLocationsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsListCall { 1701 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 1702 return c 1703 } 1704 1705 // IfNoneMatch sets an optional parameter which makes the operation fail if the 1706 // object's ETag matches the given value. This is useful for getting updates 1707 // only after the object has changed since the last request. 1708 func (c *ProjectsLocationsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsListCall { 1709 c.ifNoneMatch_ = entityTag 1710 return c 1711 } 1712 1713 // Context sets the context to be used in this call's Do method. 1714 func (c *ProjectsLocationsListCall) Context(ctx context.Context) *ProjectsLocationsListCall { 1715 c.ctx_ = ctx 1716 return c 1717 } 1718 1719 // Header returns a http.Header that can be modified by the caller to add 1720 // headers to the request. 1721 func (c *ProjectsLocationsListCall) Header() http.Header { 1722 if c.header_ == nil { 1723 c.header_ = make(http.Header) 1724 } 1725 return c.header_ 1726 } 1727 1728 func (c *ProjectsLocationsListCall) doRequest(alt string) (*http.Response, error) { 1729 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) 1730 if c.ifNoneMatch_ != "" { 1731 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 1732 } 1733 var body io.Reader = nil 1734 c.urlParams_.Set("alt", alt) 1735 c.urlParams_.Set("prettyPrint", "false") 1736 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}/locations") 1737 urls += "?" + c.urlParams_.Encode() 1738 req, err := http.NewRequest("GET", urls, body) 1739 if err != nil { 1740 return nil, err 1741 } 1742 req.Header = reqHeaders 1743 googleapi.Expand(req.URL, map[string]string{ 1744 "name": c.name, 1745 }) 1746 return gensupport.SendRequest(c.ctx_, c.s.client, req) 1747 } 1748 1749 // Do executes the "gkehub.projects.locations.list" call. 1750 // Any non-2xx status code is an error. Response headers are in either 1751 // *ListLocationsResponse.ServerResponse.Header or (if a response was returned 1752 // at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 1753 // check whether the returned error was because http.StatusNotModified was 1754 // returned. 1755 func (c *ProjectsLocationsListCall) Do(opts ...googleapi.CallOption) (*ListLocationsResponse, error) { 1756 gensupport.SetOptions(c.urlParams_, opts...) 1757 res, err := c.doRequest("json") 1758 if res != nil && res.StatusCode == http.StatusNotModified { 1759 if res.Body != nil { 1760 res.Body.Close() 1761 } 1762 return nil, gensupport.WrapError(&googleapi.Error{ 1763 Code: res.StatusCode, 1764 Header: res.Header, 1765 }) 1766 } 1767 if err != nil { 1768 return nil, err 1769 } 1770 defer googleapi.CloseBody(res) 1771 if err := googleapi.CheckResponse(res); err != nil { 1772 return nil, gensupport.WrapError(err) 1773 } 1774 ret := &ListLocationsResponse{ 1775 ServerResponse: googleapi.ServerResponse{ 1776 Header: res.Header, 1777 HTTPStatusCode: res.StatusCode, 1778 }, 1779 } 1780 target := &ret 1781 if err := gensupport.DecodeResponse(target, res); err != nil { 1782 return nil, err 1783 } 1784 return ret, nil 1785 } 1786 1787 // Pages invokes f for each page of results. 1788 // A non-nil error returned from f will halt the iteration. 1789 // The provided context supersedes any context provided to the Context method. 1790 func (c *ProjectsLocationsListCall) Pages(ctx context.Context, f func(*ListLocationsResponse) error) error { 1791 c.ctx_ = ctx 1792 defer c.PageToken(c.urlParams_.Get("pageToken")) 1793 for { 1794 x, err := c.Do() 1795 if err != nil { 1796 return err 1797 } 1798 if err := f(x); err != nil { 1799 return err 1800 } 1801 if x.NextPageToken == "" { 1802 return nil 1803 } 1804 c.PageToken(x.NextPageToken) 1805 } 1806 } 1807 1808 type ProjectsLocationsMembershipsCreateCall struct { 1809 s *Service 1810 parent string 1811 membership *Membership 1812 urlParams_ gensupport.URLParams 1813 ctx_ context.Context 1814 header_ http.Header 1815 } 1816 1817 // Create: Creates a new Membership. **This is currently only supported for GKE 1818 // clusters on Google Cloud**. To register other clusters, follow the 1819 // instructions at 1820 // https://cloud.google.com/anthos/multicluster-management/connect/registering-a-cluster. 1821 // 1822 // - parent: The parent (project and location) where the Memberships will be 1823 // created. Specified in the format `projects/*/locations/*`. 1824 func (r *ProjectsLocationsMembershipsService) Create(parent string, membership *Membership) *ProjectsLocationsMembershipsCreateCall { 1825 c := &ProjectsLocationsMembershipsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 1826 c.parent = parent 1827 c.membership = membership 1828 return c 1829 } 1830 1831 // MembershipId sets the optional parameter "membershipId": Required. Client 1832 // chosen ID for the membership. `membership_id` must be a valid RFC 1123 1833 // compliant DNS label: 1. At most 63 characters in length 2. It must consist 1834 // of lower case alphanumeric characters or `-` 3. It must start and end with 1835 // an alphanumeric character Which can be expressed as the regex: 1836 // `[a-z0-9]([-a-z0-9]*[a-z0-9])?`, with a maximum length of 63 characters. 1837 func (c *ProjectsLocationsMembershipsCreateCall) MembershipId(membershipId string) *ProjectsLocationsMembershipsCreateCall { 1838 c.urlParams_.Set("membershipId", membershipId) 1839 return c 1840 } 1841 1842 // RequestId sets the optional parameter "requestId": A request ID to identify 1843 // requests. Specify a unique request ID so that if you must retry your 1844 // request, the server will know to ignore the request if it has already been 1845 // completed. The server will guarantee that for at least 60 minutes after the 1846 // first request. For example, consider a situation where you make an initial 1847 // request and the request times out. If you make the request again with the 1848 // same request ID, the server can check if original operation with the same 1849 // request ID was received, and if so, will ignore the second request. This 1850 // prevents clients from accidentally creating duplicate commitments. The 1851 // request ID must be a valid UUID with the exception that zero UUID is not 1852 // supported (00000000-0000-0000-0000-000000000000). 1853 func (c *ProjectsLocationsMembershipsCreateCall) RequestId(requestId string) *ProjectsLocationsMembershipsCreateCall { 1854 c.urlParams_.Set("requestId", requestId) 1855 return c 1856 } 1857 1858 // Fields allows partial responses to be retrieved. See 1859 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 1860 // details. 1861 func (c *ProjectsLocationsMembershipsCreateCall) Fields(s ...googleapi.Field) *ProjectsLocationsMembershipsCreateCall { 1862 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 1863 return c 1864 } 1865 1866 // Context sets the context to be used in this call's Do method. 1867 func (c *ProjectsLocationsMembershipsCreateCall) Context(ctx context.Context) *ProjectsLocationsMembershipsCreateCall { 1868 c.ctx_ = ctx 1869 return c 1870 } 1871 1872 // Header returns a http.Header that can be modified by the caller to add 1873 // headers to the request. 1874 func (c *ProjectsLocationsMembershipsCreateCall) Header() http.Header { 1875 if c.header_ == nil { 1876 c.header_ = make(http.Header) 1877 } 1878 return c.header_ 1879 } 1880 1881 func (c *ProjectsLocationsMembershipsCreateCall) doRequest(alt string) (*http.Response, error) { 1882 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) 1883 var body io.Reader = nil 1884 body, err := googleapi.WithoutDataWrapper.JSONReader(c.membership) 1885 if err != nil { 1886 return nil, err 1887 } 1888 c.urlParams_.Set("alt", alt) 1889 c.urlParams_.Set("prettyPrint", "false") 1890 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/memberships") 1891 urls += "?" + c.urlParams_.Encode() 1892 req, err := http.NewRequest("POST", urls, body) 1893 if err != nil { 1894 return nil, err 1895 } 1896 req.Header = reqHeaders 1897 googleapi.Expand(req.URL, map[string]string{ 1898 "parent": c.parent, 1899 }) 1900 return gensupport.SendRequest(c.ctx_, c.s.client, req) 1901 } 1902 1903 // Do executes the "gkehub.projects.locations.memberships.create" call. 1904 // Any non-2xx status code is an error. Response headers are in either 1905 // *Operation.ServerResponse.Header or (if a response was returned at all) in 1906 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 1907 // whether the returned error was because http.StatusNotModified was returned. 1908 func (c *ProjectsLocationsMembershipsCreateCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 1909 gensupport.SetOptions(c.urlParams_, opts...) 1910 res, err := c.doRequest("json") 1911 if res != nil && res.StatusCode == http.StatusNotModified { 1912 if res.Body != nil { 1913 res.Body.Close() 1914 } 1915 return nil, gensupport.WrapError(&googleapi.Error{ 1916 Code: res.StatusCode, 1917 Header: res.Header, 1918 }) 1919 } 1920 if err != nil { 1921 return nil, err 1922 } 1923 defer googleapi.CloseBody(res) 1924 if err := googleapi.CheckResponse(res); err != nil { 1925 return nil, gensupport.WrapError(err) 1926 } 1927 ret := &Operation{ 1928 ServerResponse: googleapi.ServerResponse{ 1929 Header: res.Header, 1930 HTTPStatusCode: res.StatusCode, 1931 }, 1932 } 1933 target := &ret 1934 if err := gensupport.DecodeResponse(target, res); err != nil { 1935 return nil, err 1936 } 1937 return ret, nil 1938 } 1939 1940 type ProjectsLocationsMembershipsDeleteCall struct { 1941 s *Service 1942 name string 1943 urlParams_ gensupport.URLParams 1944 ctx_ context.Context 1945 header_ http.Header 1946 } 1947 1948 // Delete: Removes a Membership. **This is currently only supported for GKE 1949 // clusters on Google Cloud**. To unregister other clusters, follow the 1950 // instructions at 1951 // https://cloud.google.com/anthos/multicluster-management/connect/unregistering-a-cluster. 1952 // 1953 // - name: The Membership resource name in the format 1954 // `projects/*/locations/*/memberships/*`. 1955 func (r *ProjectsLocationsMembershipsService) Delete(name string) *ProjectsLocationsMembershipsDeleteCall { 1956 c := &ProjectsLocationsMembershipsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} 1957 c.name = name 1958 return c 1959 } 1960 1961 // Force sets the optional parameter "force": If set to true, any subresource 1962 // from this Membership will also be deleted. Otherwise, the request will only 1963 // work if the Membership has no subresource. 1964 func (c *ProjectsLocationsMembershipsDeleteCall) Force(force bool) *ProjectsLocationsMembershipsDeleteCall { 1965 c.urlParams_.Set("force", fmt.Sprint(force)) 1966 return c 1967 } 1968 1969 // RequestId sets the optional parameter "requestId": A request ID to identify 1970 // requests. Specify a unique request ID so that if you must retry your 1971 // request, the server will know to ignore the request if it has already been 1972 // completed. The server will guarantee that for at least 60 minutes after the 1973 // first request. For example, consider a situation where you make an initial 1974 // request and the request times out. If you make the request again with the 1975 // same request ID, the server can check if original operation with the same 1976 // request ID was received, and if so, will ignore the second request. This 1977 // prevents clients from accidentally creating duplicate commitments. The 1978 // request ID must be a valid UUID with the exception that zero UUID is not 1979 // supported (00000000-0000-0000-0000-000000000000). 1980 func (c *ProjectsLocationsMembershipsDeleteCall) RequestId(requestId string) *ProjectsLocationsMembershipsDeleteCall { 1981 c.urlParams_.Set("requestId", requestId) 1982 return c 1983 } 1984 1985 // Fields allows partial responses to be retrieved. See 1986 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 1987 // details. 1988 func (c *ProjectsLocationsMembershipsDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsMembershipsDeleteCall { 1989 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 1990 return c 1991 } 1992 1993 // Context sets the context to be used in this call's Do method. 1994 func (c *ProjectsLocationsMembershipsDeleteCall) Context(ctx context.Context) *ProjectsLocationsMembershipsDeleteCall { 1995 c.ctx_ = ctx 1996 return c 1997 } 1998 1999 // Header returns a http.Header that can be modified by the caller to add 2000 // headers to the request. 2001 func (c *ProjectsLocationsMembershipsDeleteCall) Header() http.Header { 2002 if c.header_ == nil { 2003 c.header_ = make(http.Header) 2004 } 2005 return c.header_ 2006 } 2007 2008 func (c *ProjectsLocationsMembershipsDeleteCall) doRequest(alt string) (*http.Response, error) { 2009 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) 2010 var body io.Reader = nil 2011 c.urlParams_.Set("alt", alt) 2012 c.urlParams_.Set("prettyPrint", "false") 2013 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") 2014 urls += "?" + c.urlParams_.Encode() 2015 req, err := http.NewRequest("DELETE", urls, body) 2016 if err != nil { 2017 return nil, err 2018 } 2019 req.Header = reqHeaders 2020 googleapi.Expand(req.URL, map[string]string{ 2021 "name": c.name, 2022 }) 2023 return gensupport.SendRequest(c.ctx_, c.s.client, req) 2024 } 2025 2026 // Do executes the "gkehub.projects.locations.memberships.delete" call. 2027 // Any non-2xx status code is an error. Response headers are in either 2028 // *Operation.ServerResponse.Header or (if a response was returned at all) in 2029 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 2030 // whether the returned error was because http.StatusNotModified was returned. 2031 func (c *ProjectsLocationsMembershipsDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 2032 gensupport.SetOptions(c.urlParams_, opts...) 2033 res, err := c.doRequest("json") 2034 if res != nil && res.StatusCode == http.StatusNotModified { 2035 if res.Body != nil { 2036 res.Body.Close() 2037 } 2038 return nil, gensupport.WrapError(&googleapi.Error{ 2039 Code: res.StatusCode, 2040 Header: res.Header, 2041 }) 2042 } 2043 if err != nil { 2044 return nil, err 2045 } 2046 defer googleapi.CloseBody(res) 2047 if err := googleapi.CheckResponse(res); err != nil { 2048 return nil, gensupport.WrapError(err) 2049 } 2050 ret := &Operation{ 2051 ServerResponse: googleapi.ServerResponse{ 2052 Header: res.Header, 2053 HTTPStatusCode: res.StatusCode, 2054 }, 2055 } 2056 target := &ret 2057 if err := gensupport.DecodeResponse(target, res); err != nil { 2058 return nil, err 2059 } 2060 return ret, nil 2061 } 2062 2063 type ProjectsLocationsMembershipsGenerateConnectManifestCall struct { 2064 s *Service 2065 name string 2066 urlParams_ gensupport.URLParams 2067 ifNoneMatch_ string 2068 ctx_ context.Context 2069 header_ http.Header 2070 } 2071 2072 // GenerateConnectManifest: Generates the manifest for deployment of the GKE 2073 // connect agent. **This method is used internally by Google-provided 2074 // libraries.** Most clients should not need to call this method directly. 2075 // 2076 // - name: The Membership resource name the Agent will associate with, in the 2077 // format `projects/*/locations/*/memberships/*`. 2078 func (r *ProjectsLocationsMembershipsService) GenerateConnectManifest(name string) *ProjectsLocationsMembershipsGenerateConnectManifestCall { 2079 c := &ProjectsLocationsMembershipsGenerateConnectManifestCall{s: r.s, urlParams_: make(gensupport.URLParams)} 2080 c.name = name 2081 return c 2082 } 2083 2084 // ConnectAgentName sets the optional parameter "connectAgent.name": Do not 2085 // set. 2086 func (c *ProjectsLocationsMembershipsGenerateConnectManifestCall) ConnectAgentName(connectAgentName string) *ProjectsLocationsMembershipsGenerateConnectManifestCall { 2087 c.urlParams_.Set("connectAgent.name", connectAgentName) 2088 return c 2089 } 2090 2091 // ConnectAgentNamespace sets the optional parameter "connectAgent.namespace": 2092 // Namespace for GKE Connect agent resources. Defaults to `gke-connect`. The 2093 // Connect Agent is authorized automatically when run in the default namespace. 2094 // Otherwise, explicit authorization must be granted with an additional IAM 2095 // binding. 2096 func (c *ProjectsLocationsMembershipsGenerateConnectManifestCall) ConnectAgentNamespace(connectAgentNamespace string) *ProjectsLocationsMembershipsGenerateConnectManifestCall { 2097 c.urlParams_.Set("connectAgent.namespace", connectAgentNamespace) 2098 return c 2099 } 2100 2101 // ConnectAgentProxy sets the optional parameter "connectAgent.proxy": URI of a 2102 // proxy if connectivity from the agent to gkeconnect.googleapis.com requires 2103 // the use of a proxy. Format must be in the form `http(s)://{proxy_address}`, 2104 // depending on the HTTP/HTTPS protocol supported by the proxy. This will 2105 // direct the connect agent's outbound traffic through a HTTP(S) proxy. 2106 func (c *ProjectsLocationsMembershipsGenerateConnectManifestCall) ConnectAgentProxy(connectAgentProxy string) *ProjectsLocationsMembershipsGenerateConnectManifestCall { 2107 c.urlParams_.Set("connectAgent.proxy", connectAgentProxy) 2108 return c 2109 } 2110 2111 // ImagePullSecretContent sets the optional parameter "imagePullSecretContent": 2112 // The image pull secret content for the registry, if not public. 2113 func (c *ProjectsLocationsMembershipsGenerateConnectManifestCall) ImagePullSecretContent(imagePullSecretContent string) *ProjectsLocationsMembershipsGenerateConnectManifestCall { 2114 c.urlParams_.Set("imagePullSecretContent", imagePullSecretContent) 2115 return c 2116 } 2117 2118 // IsUpgrade sets the optional parameter "isUpgrade": If true, generate the 2119 // resources for upgrade only. Some resources generated only for installation 2120 // (e.g. secrets) will be excluded. 2121 func (c *ProjectsLocationsMembershipsGenerateConnectManifestCall) IsUpgrade(isUpgrade bool) *ProjectsLocationsMembershipsGenerateConnectManifestCall { 2122 c.urlParams_.Set("isUpgrade", fmt.Sprint(isUpgrade)) 2123 return c 2124 } 2125 2126 // Registry sets the optional parameter "registry": The registry to fetch the 2127 // connect agent image from. Defaults to gcr.io/gkeconnect. 2128 func (c *ProjectsLocationsMembershipsGenerateConnectManifestCall) Registry(registry string) *ProjectsLocationsMembershipsGenerateConnectManifestCall { 2129 c.urlParams_.Set("registry", registry) 2130 return c 2131 } 2132 2133 // Version sets the optional parameter "version": The Connect agent version to 2134 // use. Defaults to the most current version. 2135 func (c *ProjectsLocationsMembershipsGenerateConnectManifestCall) Version(version string) *ProjectsLocationsMembershipsGenerateConnectManifestCall { 2136 c.urlParams_.Set("version", version) 2137 return c 2138 } 2139 2140 // Fields allows partial responses to be retrieved. See 2141 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 2142 // details. 2143 func (c *ProjectsLocationsMembershipsGenerateConnectManifestCall) Fields(s ...googleapi.Field) *ProjectsLocationsMembershipsGenerateConnectManifestCall { 2144 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 2145 return c 2146 } 2147 2148 // IfNoneMatch sets an optional parameter which makes the operation fail if the 2149 // object's ETag matches the given value. This is useful for getting updates 2150 // only after the object has changed since the last request. 2151 func (c *ProjectsLocationsMembershipsGenerateConnectManifestCall) IfNoneMatch(entityTag string) *ProjectsLocationsMembershipsGenerateConnectManifestCall { 2152 c.ifNoneMatch_ = entityTag 2153 return c 2154 } 2155 2156 // Context sets the context to be used in this call's Do method. 2157 func (c *ProjectsLocationsMembershipsGenerateConnectManifestCall) Context(ctx context.Context) *ProjectsLocationsMembershipsGenerateConnectManifestCall { 2158 c.ctx_ = ctx 2159 return c 2160 } 2161 2162 // Header returns a http.Header that can be modified by the caller to add 2163 // headers to the request. 2164 func (c *ProjectsLocationsMembershipsGenerateConnectManifestCall) Header() http.Header { 2165 if c.header_ == nil { 2166 c.header_ = make(http.Header) 2167 } 2168 return c.header_ 2169 } 2170 2171 func (c *ProjectsLocationsMembershipsGenerateConnectManifestCall) doRequest(alt string) (*http.Response, error) { 2172 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) 2173 if c.ifNoneMatch_ != "" { 2174 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 2175 } 2176 var body io.Reader = nil 2177 c.urlParams_.Set("alt", alt) 2178 c.urlParams_.Set("prettyPrint", "false") 2179 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}:generateConnectManifest") 2180 urls += "?" + c.urlParams_.Encode() 2181 req, err := http.NewRequest("GET", urls, body) 2182 if err != nil { 2183 return nil, err 2184 } 2185 req.Header = reqHeaders 2186 googleapi.Expand(req.URL, map[string]string{ 2187 "name": c.name, 2188 }) 2189 return gensupport.SendRequest(c.ctx_, c.s.client, req) 2190 } 2191 2192 // Do executes the "gkehub.projects.locations.memberships.generateConnectManifest" call. 2193 // Any non-2xx status code is an error. Response headers are in either 2194 // *GenerateConnectManifestResponse.ServerResponse.Header or (if a response was 2195 // returned at all) in error.(*googleapi.Error).Header. Use 2196 // googleapi.IsNotModified to check whether the returned error was because 2197 // http.StatusNotModified was returned. 2198 func (c *ProjectsLocationsMembershipsGenerateConnectManifestCall) Do(opts ...googleapi.CallOption) (*GenerateConnectManifestResponse, error) { 2199 gensupport.SetOptions(c.urlParams_, opts...) 2200 res, err := c.doRequest("json") 2201 if res != nil && res.StatusCode == http.StatusNotModified { 2202 if res.Body != nil { 2203 res.Body.Close() 2204 } 2205 return nil, gensupport.WrapError(&googleapi.Error{ 2206 Code: res.StatusCode, 2207 Header: res.Header, 2208 }) 2209 } 2210 if err != nil { 2211 return nil, err 2212 } 2213 defer googleapi.CloseBody(res) 2214 if err := googleapi.CheckResponse(res); err != nil { 2215 return nil, gensupport.WrapError(err) 2216 } 2217 ret := &GenerateConnectManifestResponse{ 2218 ServerResponse: googleapi.ServerResponse{ 2219 Header: res.Header, 2220 HTTPStatusCode: res.StatusCode, 2221 }, 2222 } 2223 target := &ret 2224 if err := gensupport.DecodeResponse(target, res); err != nil { 2225 return nil, err 2226 } 2227 return ret, nil 2228 } 2229 2230 type ProjectsLocationsMembershipsGenerateExclusivityManifestCall struct { 2231 s *Service 2232 name string 2233 urlParams_ gensupport.URLParams 2234 ifNoneMatch_ string 2235 ctx_ context.Context 2236 header_ http.Header 2237 } 2238 2239 // GenerateExclusivityManifest: GenerateExclusivityManifest generates the 2240 // manifests to update the exclusivity artifacts in the cluster if needed. 2241 // Exclusivity artifacts include the Membership custom resource definition 2242 // (CRD) and the singleton Membership custom resource (CR). Combined with 2243 // ValidateExclusivity, exclusivity artifacts guarantee that a Kubernetes 2244 // cluster is only registered to a single GKE Hub. The Membership CRD is 2245 // versioned, and may require conversion when the GKE Hub API server begins 2246 // serving a newer version of the CRD and corresponding CR. The response will 2247 // be the converted CRD and CR if there are any differences between the 2248 // versions. 2249 // 2250 // - name: The Membership resource name in the format 2251 // `projects/*/locations/*/memberships/*`. 2252 func (r *ProjectsLocationsMembershipsService) GenerateExclusivityManifest(name string) *ProjectsLocationsMembershipsGenerateExclusivityManifestCall { 2253 c := &ProjectsLocationsMembershipsGenerateExclusivityManifestCall{s: r.s, urlParams_: make(gensupport.URLParams)} 2254 c.name = name 2255 return c 2256 } 2257 2258 // CrManifest sets the optional parameter "crManifest": The YAML manifest of 2259 // the membership CR retrieved by `kubectl get memberships membership`. Leave 2260 // empty if the resource does not exist. 2261 func (c *ProjectsLocationsMembershipsGenerateExclusivityManifestCall) CrManifest(crManifest string) *ProjectsLocationsMembershipsGenerateExclusivityManifestCall { 2262 c.urlParams_.Set("crManifest", crManifest) 2263 return c 2264 } 2265 2266 // CrdManifest sets the optional parameter "crdManifest": The YAML manifest of 2267 // the membership CRD retrieved by `kubectl get customresourcedefinitions 2268 // membership`. Leave empty if the resource does not exist. 2269 func (c *ProjectsLocationsMembershipsGenerateExclusivityManifestCall) CrdManifest(crdManifest string) *ProjectsLocationsMembershipsGenerateExclusivityManifestCall { 2270 c.urlParams_.Set("crdManifest", crdManifest) 2271 return c 2272 } 2273 2274 // Fields allows partial responses to be retrieved. See 2275 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 2276 // details. 2277 func (c *ProjectsLocationsMembershipsGenerateExclusivityManifestCall) Fields(s ...googleapi.Field) *ProjectsLocationsMembershipsGenerateExclusivityManifestCall { 2278 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 2279 return c 2280 } 2281 2282 // IfNoneMatch sets an optional parameter which makes the operation fail if the 2283 // object's ETag matches the given value. This is useful for getting updates 2284 // only after the object has changed since the last request. 2285 func (c *ProjectsLocationsMembershipsGenerateExclusivityManifestCall) IfNoneMatch(entityTag string) *ProjectsLocationsMembershipsGenerateExclusivityManifestCall { 2286 c.ifNoneMatch_ = entityTag 2287 return c 2288 } 2289 2290 // Context sets the context to be used in this call's Do method. 2291 func (c *ProjectsLocationsMembershipsGenerateExclusivityManifestCall) Context(ctx context.Context) *ProjectsLocationsMembershipsGenerateExclusivityManifestCall { 2292 c.ctx_ = ctx 2293 return c 2294 } 2295 2296 // Header returns a http.Header that can be modified by the caller to add 2297 // headers to the request. 2298 func (c *ProjectsLocationsMembershipsGenerateExclusivityManifestCall) Header() http.Header { 2299 if c.header_ == nil { 2300 c.header_ = make(http.Header) 2301 } 2302 return c.header_ 2303 } 2304 2305 func (c *ProjectsLocationsMembershipsGenerateExclusivityManifestCall) doRequest(alt string) (*http.Response, error) { 2306 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) 2307 if c.ifNoneMatch_ != "" { 2308 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 2309 } 2310 var body io.Reader = nil 2311 c.urlParams_.Set("alt", alt) 2312 c.urlParams_.Set("prettyPrint", "false") 2313 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}:generateExclusivityManifest") 2314 urls += "?" + c.urlParams_.Encode() 2315 req, err := http.NewRequest("GET", urls, body) 2316 if err != nil { 2317 return nil, err 2318 } 2319 req.Header = reqHeaders 2320 googleapi.Expand(req.URL, map[string]string{ 2321 "name": c.name, 2322 }) 2323 return gensupport.SendRequest(c.ctx_, c.s.client, req) 2324 } 2325 2326 // Do executes the "gkehub.projects.locations.memberships.generateExclusivityManifest" call. 2327 // Any non-2xx status code is an error. Response headers are in either 2328 // *GenerateExclusivityManifestResponse.ServerResponse.Header or (if a response 2329 // was returned at all) in error.(*googleapi.Error).Header. Use 2330 // googleapi.IsNotModified to check whether the returned error was because 2331 // http.StatusNotModified was returned. 2332 func (c *ProjectsLocationsMembershipsGenerateExclusivityManifestCall) Do(opts ...googleapi.CallOption) (*GenerateExclusivityManifestResponse, error) { 2333 gensupport.SetOptions(c.urlParams_, opts...) 2334 res, err := c.doRequest("json") 2335 if res != nil && res.StatusCode == http.StatusNotModified { 2336 if res.Body != nil { 2337 res.Body.Close() 2338 } 2339 return nil, gensupport.WrapError(&googleapi.Error{ 2340 Code: res.StatusCode, 2341 Header: res.Header, 2342 }) 2343 } 2344 if err != nil { 2345 return nil, err 2346 } 2347 defer googleapi.CloseBody(res) 2348 if err := googleapi.CheckResponse(res); err != nil { 2349 return nil, gensupport.WrapError(err) 2350 } 2351 ret := &GenerateExclusivityManifestResponse{ 2352 ServerResponse: googleapi.ServerResponse{ 2353 Header: res.Header, 2354 HTTPStatusCode: res.StatusCode, 2355 }, 2356 } 2357 target := &ret 2358 if err := gensupport.DecodeResponse(target, res); err != nil { 2359 return nil, err 2360 } 2361 return ret, nil 2362 } 2363 2364 type ProjectsLocationsMembershipsGetCall struct { 2365 s *Service 2366 name string 2367 urlParams_ gensupport.URLParams 2368 ifNoneMatch_ string 2369 ctx_ context.Context 2370 header_ http.Header 2371 } 2372 2373 // Get: Gets the details of a Membership. 2374 // 2375 // - name: The Membership resource name in the format 2376 // `projects/*/locations/*/memberships/*`. 2377 func (r *ProjectsLocationsMembershipsService) Get(name string) *ProjectsLocationsMembershipsGetCall { 2378 c := &ProjectsLocationsMembershipsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 2379 c.name = name 2380 return c 2381 } 2382 2383 // Fields allows partial responses to be retrieved. See 2384 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 2385 // details. 2386 func (c *ProjectsLocationsMembershipsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsMembershipsGetCall { 2387 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 2388 return c 2389 } 2390 2391 // IfNoneMatch sets an optional parameter which makes the operation fail if the 2392 // object's ETag matches the given value. This is useful for getting updates 2393 // only after the object has changed since the last request. 2394 func (c *ProjectsLocationsMembershipsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsMembershipsGetCall { 2395 c.ifNoneMatch_ = entityTag 2396 return c 2397 } 2398 2399 // Context sets the context to be used in this call's Do method. 2400 func (c *ProjectsLocationsMembershipsGetCall) Context(ctx context.Context) *ProjectsLocationsMembershipsGetCall { 2401 c.ctx_ = ctx 2402 return c 2403 } 2404 2405 // Header returns a http.Header that can be modified by the caller to add 2406 // headers to the request. 2407 func (c *ProjectsLocationsMembershipsGetCall) Header() http.Header { 2408 if c.header_ == nil { 2409 c.header_ = make(http.Header) 2410 } 2411 return c.header_ 2412 } 2413 2414 func (c *ProjectsLocationsMembershipsGetCall) doRequest(alt string) (*http.Response, error) { 2415 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) 2416 if c.ifNoneMatch_ != "" { 2417 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 2418 } 2419 var body io.Reader = nil 2420 c.urlParams_.Set("alt", alt) 2421 c.urlParams_.Set("prettyPrint", "false") 2422 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") 2423 urls += "?" + c.urlParams_.Encode() 2424 req, err := http.NewRequest("GET", urls, body) 2425 if err != nil { 2426 return nil, err 2427 } 2428 req.Header = reqHeaders 2429 googleapi.Expand(req.URL, map[string]string{ 2430 "name": c.name, 2431 }) 2432 return gensupport.SendRequest(c.ctx_, c.s.client, req) 2433 } 2434 2435 // Do executes the "gkehub.projects.locations.memberships.get" call. 2436 // Any non-2xx status code is an error. Response headers are in either 2437 // *Membership.ServerResponse.Header or (if a response was returned at all) in 2438 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 2439 // whether the returned error was because http.StatusNotModified was returned. 2440 func (c *ProjectsLocationsMembershipsGetCall) Do(opts ...googleapi.CallOption) (*Membership, error) { 2441 gensupport.SetOptions(c.urlParams_, opts...) 2442 res, err := c.doRequest("json") 2443 if res != nil && res.StatusCode == http.StatusNotModified { 2444 if res.Body != nil { 2445 res.Body.Close() 2446 } 2447 return nil, gensupport.WrapError(&googleapi.Error{ 2448 Code: res.StatusCode, 2449 Header: res.Header, 2450 }) 2451 } 2452 if err != nil { 2453 return nil, err 2454 } 2455 defer googleapi.CloseBody(res) 2456 if err := googleapi.CheckResponse(res); err != nil { 2457 return nil, gensupport.WrapError(err) 2458 } 2459 ret := &Membership{ 2460 ServerResponse: googleapi.ServerResponse{ 2461 Header: res.Header, 2462 HTTPStatusCode: res.StatusCode, 2463 }, 2464 } 2465 target := &ret 2466 if err := gensupport.DecodeResponse(target, res); err != nil { 2467 return nil, err 2468 } 2469 return ret, nil 2470 } 2471 2472 type ProjectsLocationsMembershipsGetIamPolicyCall struct { 2473 s *Service 2474 resource string 2475 urlParams_ gensupport.URLParams 2476 ifNoneMatch_ string 2477 ctx_ context.Context 2478 header_ http.Header 2479 } 2480 2481 // GetIamPolicy: Gets the access control policy for a resource. Returns an 2482 // empty policy if the resource exists and does not have a policy set. 2483 // 2484 // - resource: REQUIRED: The resource for which the policy is being requested. 2485 // See Resource names (https://cloud.google.com/apis/design/resource_names) 2486 // for the appropriate value for this field. 2487 func (r *ProjectsLocationsMembershipsService) GetIamPolicy(resource string) *ProjectsLocationsMembershipsGetIamPolicyCall { 2488 c := &ProjectsLocationsMembershipsGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)} 2489 c.resource = resource 2490 return c 2491 } 2492 2493 // OptionsRequestedPolicyVersion sets the optional parameter 2494 // "options.requestedPolicyVersion": The maximum policy version that will be 2495 // used to format the policy. Valid values are 0, 1, and 3. Requests specifying 2496 // an invalid value will be rejected. Requests for policies with any 2497 // conditional role bindings must specify version 3. Policies with no 2498 // conditional role bindings may specify any valid value or leave the field 2499 // unset. The policy in the response might use the policy version that you 2500 // specified, or it might use a lower policy version. For example, if you 2501 // specify version 3, but the policy has no conditional role bindings, the 2502 // response uses version 1. To learn which resources support conditions in 2503 // their IAM policies, see the IAM documentation 2504 // (https://cloud.google.com/iam/help/conditions/resource-policies). 2505 func (c *ProjectsLocationsMembershipsGetIamPolicyCall) OptionsRequestedPolicyVersion(optionsRequestedPolicyVersion int64) *ProjectsLocationsMembershipsGetIamPolicyCall { 2506 c.urlParams_.Set("options.requestedPolicyVersion", fmt.Sprint(optionsRequestedPolicyVersion)) 2507 return c 2508 } 2509 2510 // Fields allows partial responses to be retrieved. See 2511 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 2512 // details. 2513 func (c *ProjectsLocationsMembershipsGetIamPolicyCall) Fields(s ...googleapi.Field) *ProjectsLocationsMembershipsGetIamPolicyCall { 2514 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 2515 return c 2516 } 2517 2518 // IfNoneMatch sets an optional parameter which makes the operation fail if the 2519 // object's ETag matches the given value. This is useful for getting updates 2520 // only after the object has changed since the last request. 2521 func (c *ProjectsLocationsMembershipsGetIamPolicyCall) IfNoneMatch(entityTag string) *ProjectsLocationsMembershipsGetIamPolicyCall { 2522 c.ifNoneMatch_ = entityTag 2523 return c 2524 } 2525 2526 // Context sets the context to be used in this call's Do method. 2527 func (c *ProjectsLocationsMembershipsGetIamPolicyCall) Context(ctx context.Context) *ProjectsLocationsMembershipsGetIamPolicyCall { 2528 c.ctx_ = ctx 2529 return c 2530 } 2531 2532 // Header returns a http.Header that can be modified by the caller to add 2533 // headers to the request. 2534 func (c *ProjectsLocationsMembershipsGetIamPolicyCall) Header() http.Header { 2535 if c.header_ == nil { 2536 c.header_ = make(http.Header) 2537 } 2538 return c.header_ 2539 } 2540 2541 func (c *ProjectsLocationsMembershipsGetIamPolicyCall) doRequest(alt string) (*http.Response, error) { 2542 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) 2543 if c.ifNoneMatch_ != "" { 2544 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 2545 } 2546 var body io.Reader = nil 2547 c.urlParams_.Set("alt", alt) 2548 c.urlParams_.Set("prettyPrint", "false") 2549 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+resource}:getIamPolicy") 2550 urls += "?" + c.urlParams_.Encode() 2551 req, err := http.NewRequest("GET", urls, body) 2552 if err != nil { 2553 return nil, err 2554 } 2555 req.Header = reqHeaders 2556 googleapi.Expand(req.URL, map[string]string{ 2557 "resource": c.resource, 2558 }) 2559 return gensupport.SendRequest(c.ctx_, c.s.client, req) 2560 } 2561 2562 // Do executes the "gkehub.projects.locations.memberships.getIamPolicy" call. 2563 // Any non-2xx status code is an error. Response headers are in either 2564 // *Policy.ServerResponse.Header or (if a response was returned at all) in 2565 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 2566 // whether the returned error was because http.StatusNotModified was returned. 2567 func (c *ProjectsLocationsMembershipsGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) { 2568 gensupport.SetOptions(c.urlParams_, opts...) 2569 res, err := c.doRequest("json") 2570 if res != nil && res.StatusCode == http.StatusNotModified { 2571 if res.Body != nil { 2572 res.Body.Close() 2573 } 2574 return nil, gensupport.WrapError(&googleapi.Error{ 2575 Code: res.StatusCode, 2576 Header: res.Header, 2577 }) 2578 } 2579 if err != nil { 2580 return nil, err 2581 } 2582 defer googleapi.CloseBody(res) 2583 if err := googleapi.CheckResponse(res); err != nil { 2584 return nil, gensupport.WrapError(err) 2585 } 2586 ret := &Policy{ 2587 ServerResponse: googleapi.ServerResponse{ 2588 Header: res.Header, 2589 HTTPStatusCode: res.StatusCode, 2590 }, 2591 } 2592 target := &ret 2593 if err := gensupport.DecodeResponse(target, res); err != nil { 2594 return nil, err 2595 } 2596 return ret, nil 2597 } 2598 2599 type ProjectsLocationsMembershipsListCall struct { 2600 s *Service 2601 parent string 2602 urlParams_ gensupport.URLParams 2603 ifNoneMatch_ string 2604 ctx_ context.Context 2605 header_ http.Header 2606 } 2607 2608 // List: Lists Memberships in a given project and location. 2609 // 2610 // - parent: The parent (project and location) where the Memberships will be 2611 // listed. Specified in the format `projects/*/locations/*`. 2612 // `projects/*/locations/-` list memberships in all the regions. 2613 func (r *ProjectsLocationsMembershipsService) List(parent string) *ProjectsLocationsMembershipsListCall { 2614 c := &ProjectsLocationsMembershipsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 2615 c.parent = parent 2616 return c 2617 } 2618 2619 // Filter sets the optional parameter "filter": Lists Memberships that match 2620 // the filter expression, following the syntax outlined in 2621 // https://google.aip.dev/160. Examples: - Name is `bar` in project `foo-proj` 2622 // and location `global`: name = 2623 // "projects/foo-proj/locations/global/membership/bar" - Memberships that have 2624 // a label called `foo`: labels.foo:* - Memberships that have a label called 2625 // `foo` whose value is `bar`: labels.foo = bar - Memberships in the CREATING 2626 // state: state = CREATING 2627 func (c *ProjectsLocationsMembershipsListCall) Filter(filter string) *ProjectsLocationsMembershipsListCall { 2628 c.urlParams_.Set("filter", filter) 2629 return c 2630 } 2631 2632 // OrderBy sets the optional parameter "orderBy": One or more fields to compare 2633 // and use to sort the output. See https://google.aip.dev/132#ordering. 2634 func (c *ProjectsLocationsMembershipsListCall) OrderBy(orderBy string) *ProjectsLocationsMembershipsListCall { 2635 c.urlParams_.Set("orderBy", orderBy) 2636 return c 2637 } 2638 2639 // PageSize sets the optional parameter "pageSize": When requesting a 'page' of 2640 // resources, `page_size` specifies number of resources to return. If 2641 // unspecified or set to 0, all resources will be returned. 2642 func (c *ProjectsLocationsMembershipsListCall) PageSize(pageSize int64) *ProjectsLocationsMembershipsListCall { 2643 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) 2644 return c 2645 } 2646 2647 // PageToken sets the optional parameter "pageToken": Token returned by 2648 // previous call to `ListMemberships` which specifies the position in the list 2649 // from where to continue listing the resources. 2650 func (c *ProjectsLocationsMembershipsListCall) PageToken(pageToken string) *ProjectsLocationsMembershipsListCall { 2651 c.urlParams_.Set("pageToken", pageToken) 2652 return c 2653 } 2654 2655 // Fields allows partial responses to be retrieved. See 2656 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 2657 // details. 2658 func (c *ProjectsLocationsMembershipsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsMembershipsListCall { 2659 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 2660 return c 2661 } 2662 2663 // IfNoneMatch sets an optional parameter which makes the operation fail if the 2664 // object's ETag matches the given value. This is useful for getting updates 2665 // only after the object has changed since the last request. 2666 func (c *ProjectsLocationsMembershipsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsMembershipsListCall { 2667 c.ifNoneMatch_ = entityTag 2668 return c 2669 } 2670 2671 // Context sets the context to be used in this call's Do method. 2672 func (c *ProjectsLocationsMembershipsListCall) Context(ctx context.Context) *ProjectsLocationsMembershipsListCall { 2673 c.ctx_ = ctx 2674 return c 2675 } 2676 2677 // Header returns a http.Header that can be modified by the caller to add 2678 // headers to the request. 2679 func (c *ProjectsLocationsMembershipsListCall) Header() http.Header { 2680 if c.header_ == nil { 2681 c.header_ = make(http.Header) 2682 } 2683 return c.header_ 2684 } 2685 2686 func (c *ProjectsLocationsMembershipsListCall) doRequest(alt string) (*http.Response, error) { 2687 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) 2688 if c.ifNoneMatch_ != "" { 2689 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 2690 } 2691 var body io.Reader = nil 2692 c.urlParams_.Set("alt", alt) 2693 c.urlParams_.Set("prettyPrint", "false") 2694 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/memberships") 2695 urls += "?" + c.urlParams_.Encode() 2696 req, err := http.NewRequest("GET", urls, body) 2697 if err != nil { 2698 return nil, err 2699 } 2700 req.Header = reqHeaders 2701 googleapi.Expand(req.URL, map[string]string{ 2702 "parent": c.parent, 2703 }) 2704 return gensupport.SendRequest(c.ctx_, c.s.client, req) 2705 } 2706 2707 // Do executes the "gkehub.projects.locations.memberships.list" call. 2708 // Any non-2xx status code is an error. Response headers are in either 2709 // *ListMembershipsResponse.ServerResponse.Header or (if a response was 2710 // returned at all) in error.(*googleapi.Error).Header. Use 2711 // googleapi.IsNotModified to check whether the returned error was because 2712 // http.StatusNotModified was returned. 2713 func (c *ProjectsLocationsMembershipsListCall) Do(opts ...googleapi.CallOption) (*ListMembershipsResponse, error) { 2714 gensupport.SetOptions(c.urlParams_, opts...) 2715 res, err := c.doRequest("json") 2716 if res != nil && res.StatusCode == http.StatusNotModified { 2717 if res.Body != nil { 2718 res.Body.Close() 2719 } 2720 return nil, gensupport.WrapError(&googleapi.Error{ 2721 Code: res.StatusCode, 2722 Header: res.Header, 2723 }) 2724 } 2725 if err != nil { 2726 return nil, err 2727 } 2728 defer googleapi.CloseBody(res) 2729 if err := googleapi.CheckResponse(res); err != nil { 2730 return nil, gensupport.WrapError(err) 2731 } 2732 ret := &ListMembershipsResponse{ 2733 ServerResponse: googleapi.ServerResponse{ 2734 Header: res.Header, 2735 HTTPStatusCode: res.StatusCode, 2736 }, 2737 } 2738 target := &ret 2739 if err := gensupport.DecodeResponse(target, res); err != nil { 2740 return nil, err 2741 } 2742 return ret, nil 2743 } 2744 2745 // Pages invokes f for each page of results. 2746 // A non-nil error returned from f will halt the iteration. 2747 // The provided context supersedes any context provided to the Context method. 2748 func (c *ProjectsLocationsMembershipsListCall) Pages(ctx context.Context, f func(*ListMembershipsResponse) error) error { 2749 c.ctx_ = ctx 2750 defer c.PageToken(c.urlParams_.Get("pageToken")) 2751 for { 2752 x, err := c.Do() 2753 if err != nil { 2754 return err 2755 } 2756 if err := f(x); err != nil { 2757 return err 2758 } 2759 if x.NextPageToken == "" { 2760 return nil 2761 } 2762 c.PageToken(x.NextPageToken) 2763 } 2764 } 2765 2766 type ProjectsLocationsMembershipsPatchCall struct { 2767 s *Service 2768 name string 2769 membership *Membership 2770 urlParams_ gensupport.URLParams 2771 ctx_ context.Context 2772 header_ http.Header 2773 } 2774 2775 // Patch: Updates an existing Membership. 2776 // 2777 // - name: The membership resource name in the format: 2778 // `projects/[project_id]/locations/global/memberships/[membership_id]`. 2779 func (r *ProjectsLocationsMembershipsService) Patch(name string, membership *Membership) *ProjectsLocationsMembershipsPatchCall { 2780 c := &ProjectsLocationsMembershipsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} 2781 c.name = name 2782 c.membership = membership 2783 return c 2784 } 2785 2786 // RequestId sets the optional parameter "requestId": A request ID to identify 2787 // requests. Specify a unique request ID so that if you must retry your 2788 // request, the server will know to ignore the request if it has already been 2789 // completed. The server will guarantee that for at least 60 minutes after the 2790 // first request. For example, consider a situation where you make an initial 2791 // request and the request times out. If you make the request again with the 2792 // same request ID, the server can check if original operation with the same 2793 // request ID was received, and if so, will ignore the second request. This 2794 // prevents clients from accidentally creating duplicate commitments. The 2795 // request ID must be a valid UUID with the exception that zero UUID is not 2796 // supported (00000000-0000-0000-0000-000000000000). 2797 func (c *ProjectsLocationsMembershipsPatchCall) RequestId(requestId string) *ProjectsLocationsMembershipsPatchCall { 2798 c.urlParams_.Set("requestId", requestId) 2799 return c 2800 } 2801 2802 // UpdateMask sets the optional parameter "updateMask": Required. Mask of 2803 // fields to update. At least one field path must be specified in this mask. 2804 func (c *ProjectsLocationsMembershipsPatchCall) UpdateMask(updateMask string) *ProjectsLocationsMembershipsPatchCall { 2805 c.urlParams_.Set("updateMask", updateMask) 2806 return c 2807 } 2808 2809 // Fields allows partial responses to be retrieved. See 2810 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 2811 // details. 2812 func (c *ProjectsLocationsMembershipsPatchCall) Fields(s ...googleapi.Field) *ProjectsLocationsMembershipsPatchCall { 2813 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 2814 return c 2815 } 2816 2817 // Context sets the context to be used in this call's Do method. 2818 func (c *ProjectsLocationsMembershipsPatchCall) Context(ctx context.Context) *ProjectsLocationsMembershipsPatchCall { 2819 c.ctx_ = ctx 2820 return c 2821 } 2822 2823 // Header returns a http.Header that can be modified by the caller to add 2824 // headers to the request. 2825 func (c *ProjectsLocationsMembershipsPatchCall) Header() http.Header { 2826 if c.header_ == nil { 2827 c.header_ = make(http.Header) 2828 } 2829 return c.header_ 2830 } 2831 2832 func (c *ProjectsLocationsMembershipsPatchCall) doRequest(alt string) (*http.Response, error) { 2833 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) 2834 var body io.Reader = nil 2835 body, err := googleapi.WithoutDataWrapper.JSONReader(c.membership) 2836 if err != nil { 2837 return nil, err 2838 } 2839 c.urlParams_.Set("alt", alt) 2840 c.urlParams_.Set("prettyPrint", "false") 2841 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") 2842 urls += "?" + c.urlParams_.Encode() 2843 req, err := http.NewRequest("PATCH", urls, body) 2844 if err != nil { 2845 return nil, err 2846 } 2847 req.Header = reqHeaders 2848 googleapi.Expand(req.URL, map[string]string{ 2849 "name": c.name, 2850 }) 2851 return gensupport.SendRequest(c.ctx_, c.s.client, req) 2852 } 2853 2854 // Do executes the "gkehub.projects.locations.memberships.patch" call. 2855 // Any non-2xx status code is an error. Response headers are in either 2856 // *Operation.ServerResponse.Header or (if a response was returned at all) in 2857 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 2858 // whether the returned error was because http.StatusNotModified was returned. 2859 func (c *ProjectsLocationsMembershipsPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 2860 gensupport.SetOptions(c.urlParams_, opts...) 2861 res, err := c.doRequest("json") 2862 if res != nil && res.StatusCode == http.StatusNotModified { 2863 if res.Body != nil { 2864 res.Body.Close() 2865 } 2866 return nil, gensupport.WrapError(&googleapi.Error{ 2867 Code: res.StatusCode, 2868 Header: res.Header, 2869 }) 2870 } 2871 if err != nil { 2872 return nil, err 2873 } 2874 defer googleapi.CloseBody(res) 2875 if err := googleapi.CheckResponse(res); err != nil { 2876 return nil, gensupport.WrapError(err) 2877 } 2878 ret := &Operation{ 2879 ServerResponse: googleapi.ServerResponse{ 2880 Header: res.Header, 2881 HTTPStatusCode: res.StatusCode, 2882 }, 2883 } 2884 target := &ret 2885 if err := gensupport.DecodeResponse(target, res); err != nil { 2886 return nil, err 2887 } 2888 return ret, nil 2889 } 2890 2891 type ProjectsLocationsMembershipsSetIamPolicyCall struct { 2892 s *Service 2893 resource string 2894 setiampolicyrequest *SetIamPolicyRequest 2895 urlParams_ gensupport.URLParams 2896 ctx_ context.Context 2897 header_ http.Header 2898 } 2899 2900 // SetIamPolicy: Sets the access control policy on the specified resource. 2901 // Replaces any existing policy. Can return `NOT_FOUND`, `INVALID_ARGUMENT`, 2902 // and `PERMISSION_DENIED` errors. 2903 // 2904 // - resource: REQUIRED: The resource for which the policy is being specified. 2905 // See Resource names (https://cloud.google.com/apis/design/resource_names) 2906 // for the appropriate value for this field. 2907 func (r *ProjectsLocationsMembershipsService) SetIamPolicy(resource string, setiampolicyrequest *SetIamPolicyRequest) *ProjectsLocationsMembershipsSetIamPolicyCall { 2908 c := &ProjectsLocationsMembershipsSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)} 2909 c.resource = resource 2910 c.setiampolicyrequest = setiampolicyrequest 2911 return c 2912 } 2913 2914 // Fields allows partial responses to be retrieved. See 2915 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 2916 // details. 2917 func (c *ProjectsLocationsMembershipsSetIamPolicyCall) Fields(s ...googleapi.Field) *ProjectsLocationsMembershipsSetIamPolicyCall { 2918 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 2919 return c 2920 } 2921 2922 // Context sets the context to be used in this call's Do method. 2923 func (c *ProjectsLocationsMembershipsSetIamPolicyCall) Context(ctx context.Context) *ProjectsLocationsMembershipsSetIamPolicyCall { 2924 c.ctx_ = ctx 2925 return c 2926 } 2927 2928 // Header returns a http.Header that can be modified by the caller to add 2929 // headers to the request. 2930 func (c *ProjectsLocationsMembershipsSetIamPolicyCall) Header() http.Header { 2931 if c.header_ == nil { 2932 c.header_ = make(http.Header) 2933 } 2934 return c.header_ 2935 } 2936 2937 func (c *ProjectsLocationsMembershipsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { 2938 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) 2939 var body io.Reader = nil 2940 body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest) 2941 if err != nil { 2942 return nil, err 2943 } 2944 c.urlParams_.Set("alt", alt) 2945 c.urlParams_.Set("prettyPrint", "false") 2946 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+resource}:setIamPolicy") 2947 urls += "?" + c.urlParams_.Encode() 2948 req, err := http.NewRequest("POST", urls, body) 2949 if err != nil { 2950 return nil, err 2951 } 2952 req.Header = reqHeaders 2953 googleapi.Expand(req.URL, map[string]string{ 2954 "resource": c.resource, 2955 }) 2956 return gensupport.SendRequest(c.ctx_, c.s.client, req) 2957 } 2958 2959 // Do executes the "gkehub.projects.locations.memberships.setIamPolicy" call. 2960 // Any non-2xx status code is an error. Response headers are in either 2961 // *Policy.ServerResponse.Header or (if a response was returned at all) in 2962 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 2963 // whether the returned error was because http.StatusNotModified was returned. 2964 func (c *ProjectsLocationsMembershipsSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) { 2965 gensupport.SetOptions(c.urlParams_, opts...) 2966 res, err := c.doRequest("json") 2967 if res != nil && res.StatusCode == http.StatusNotModified { 2968 if res.Body != nil { 2969 res.Body.Close() 2970 } 2971 return nil, gensupport.WrapError(&googleapi.Error{ 2972 Code: res.StatusCode, 2973 Header: res.Header, 2974 }) 2975 } 2976 if err != nil { 2977 return nil, err 2978 } 2979 defer googleapi.CloseBody(res) 2980 if err := googleapi.CheckResponse(res); err != nil { 2981 return nil, gensupport.WrapError(err) 2982 } 2983 ret := &Policy{ 2984 ServerResponse: googleapi.ServerResponse{ 2985 Header: res.Header, 2986 HTTPStatusCode: res.StatusCode, 2987 }, 2988 } 2989 target := &ret 2990 if err := gensupport.DecodeResponse(target, res); err != nil { 2991 return nil, err 2992 } 2993 return ret, nil 2994 } 2995 2996 type ProjectsLocationsMembershipsTestIamPermissionsCall struct { 2997 s *Service 2998 resource string 2999 testiampermissionsrequest *TestIamPermissionsRequest 3000 urlParams_ gensupport.URLParams 3001 ctx_ context.Context 3002 header_ http.Header 3003 } 3004 3005 // TestIamPermissions: Returns permissions that a caller has on the specified 3006 // resource. If the resource does not exist, this will return an empty set of 3007 // permissions, not a `NOT_FOUND` error. Note: This operation is designed to be 3008 // used for building permission-aware UIs and command-line tools, not for 3009 // authorization checking. This operation may "fail open" without warning. 3010 // 3011 // - resource: REQUIRED: The resource for which the policy detail is being 3012 // requested. See Resource names 3013 // (https://cloud.google.com/apis/design/resource_names) for the appropriate 3014 // value for this field. 3015 func (r *ProjectsLocationsMembershipsService) TestIamPermissions(resource string, testiampermissionsrequest *TestIamPermissionsRequest) *ProjectsLocationsMembershipsTestIamPermissionsCall { 3016 c := &ProjectsLocationsMembershipsTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)} 3017 c.resource = resource 3018 c.testiampermissionsrequest = testiampermissionsrequest 3019 return c 3020 } 3021 3022 // Fields allows partial responses to be retrieved. See 3023 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 3024 // details. 3025 func (c *ProjectsLocationsMembershipsTestIamPermissionsCall) Fields(s ...googleapi.Field) *ProjectsLocationsMembershipsTestIamPermissionsCall { 3026 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 3027 return c 3028 } 3029 3030 // Context sets the context to be used in this call's Do method. 3031 func (c *ProjectsLocationsMembershipsTestIamPermissionsCall) Context(ctx context.Context) *ProjectsLocationsMembershipsTestIamPermissionsCall { 3032 c.ctx_ = ctx 3033 return c 3034 } 3035 3036 // Header returns a http.Header that can be modified by the caller to add 3037 // headers to the request. 3038 func (c *ProjectsLocationsMembershipsTestIamPermissionsCall) Header() http.Header { 3039 if c.header_ == nil { 3040 c.header_ = make(http.Header) 3041 } 3042 return c.header_ 3043 } 3044 3045 func (c *ProjectsLocationsMembershipsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { 3046 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) 3047 var body io.Reader = nil 3048 body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest) 3049 if err != nil { 3050 return nil, err 3051 } 3052 c.urlParams_.Set("alt", alt) 3053 c.urlParams_.Set("prettyPrint", "false") 3054 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+resource}:testIamPermissions") 3055 urls += "?" + c.urlParams_.Encode() 3056 req, err := http.NewRequest("POST", urls, body) 3057 if err != nil { 3058 return nil, err 3059 } 3060 req.Header = reqHeaders 3061 googleapi.Expand(req.URL, map[string]string{ 3062 "resource": c.resource, 3063 }) 3064 return gensupport.SendRequest(c.ctx_, c.s.client, req) 3065 } 3066 3067 // Do executes the "gkehub.projects.locations.memberships.testIamPermissions" call. 3068 // Any non-2xx status code is an error. Response headers are in either 3069 // *TestIamPermissionsResponse.ServerResponse.Header or (if a response was 3070 // returned at all) in error.(*googleapi.Error).Header. Use 3071 // googleapi.IsNotModified to check whether the returned error was because 3072 // http.StatusNotModified was returned. 3073 func (c *ProjectsLocationsMembershipsTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestIamPermissionsResponse, error) { 3074 gensupport.SetOptions(c.urlParams_, opts...) 3075 res, err := c.doRequest("json") 3076 if res != nil && res.StatusCode == http.StatusNotModified { 3077 if res.Body != nil { 3078 res.Body.Close() 3079 } 3080 return nil, gensupport.WrapError(&googleapi.Error{ 3081 Code: res.StatusCode, 3082 Header: res.Header, 3083 }) 3084 } 3085 if err != nil { 3086 return nil, err 3087 } 3088 defer googleapi.CloseBody(res) 3089 if err := googleapi.CheckResponse(res); err != nil { 3090 return nil, gensupport.WrapError(err) 3091 } 3092 ret := &TestIamPermissionsResponse{ 3093 ServerResponse: googleapi.ServerResponse{ 3094 Header: res.Header, 3095 HTTPStatusCode: res.StatusCode, 3096 }, 3097 } 3098 target := &ret 3099 if err := gensupport.DecodeResponse(target, res); err != nil { 3100 return nil, err 3101 } 3102 return ret, nil 3103 } 3104 3105 type ProjectsLocationsMembershipsValidateExclusivityCall struct { 3106 s *Service 3107 parent string 3108 urlParams_ gensupport.URLParams 3109 ifNoneMatch_ string 3110 ctx_ context.Context 3111 header_ http.Header 3112 } 3113 3114 // ValidateExclusivity: ValidateExclusivity validates the state of exclusivity 3115 // in the cluster. The validation does not depend on an existing Hub membership 3116 // resource. 3117 // 3118 // - parent: The parent (project and location) where the Memberships will be 3119 // created. Specified in the format `projects/*/locations/*`. 3120 func (r *ProjectsLocationsMembershipsService) ValidateExclusivity(parent string) *ProjectsLocationsMembershipsValidateExclusivityCall { 3121 c := &ProjectsLocationsMembershipsValidateExclusivityCall{s: r.s, urlParams_: make(gensupport.URLParams)} 3122 c.parent = parent 3123 return c 3124 } 3125 3126 // CrManifest sets the optional parameter "crManifest": The YAML of the 3127 // membership CR in the cluster. Empty if the membership CR does not exist. 3128 func (c *ProjectsLocationsMembershipsValidateExclusivityCall) CrManifest(crManifest string) *ProjectsLocationsMembershipsValidateExclusivityCall { 3129 c.urlParams_.Set("crManifest", crManifest) 3130 return c 3131 } 3132 3133 // IntendedMembership sets the optional parameter "intendedMembership": 3134 // Required. The intended membership name under the `parent`. This method only 3135 // does validation in anticipation of a CreateMembership call with the same 3136 // name. 3137 func (c *ProjectsLocationsMembershipsValidateExclusivityCall) IntendedMembership(intendedMembership string) *ProjectsLocationsMembershipsValidateExclusivityCall { 3138 c.urlParams_.Set("intendedMembership", intendedMembership) 3139 return c 3140 } 3141 3142 // Fields allows partial responses to be retrieved. See 3143 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 3144 // details. 3145 func (c *ProjectsLocationsMembershipsValidateExclusivityCall) Fields(s ...googleapi.Field) *ProjectsLocationsMembershipsValidateExclusivityCall { 3146 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 3147 return c 3148 } 3149 3150 // IfNoneMatch sets an optional parameter which makes the operation fail if the 3151 // object's ETag matches the given value. This is useful for getting updates 3152 // only after the object has changed since the last request. 3153 func (c *ProjectsLocationsMembershipsValidateExclusivityCall) IfNoneMatch(entityTag string) *ProjectsLocationsMembershipsValidateExclusivityCall { 3154 c.ifNoneMatch_ = entityTag 3155 return c 3156 } 3157 3158 // Context sets the context to be used in this call's Do method. 3159 func (c *ProjectsLocationsMembershipsValidateExclusivityCall) Context(ctx context.Context) *ProjectsLocationsMembershipsValidateExclusivityCall { 3160 c.ctx_ = ctx 3161 return c 3162 } 3163 3164 // Header returns a http.Header that can be modified by the caller to add 3165 // headers to the request. 3166 func (c *ProjectsLocationsMembershipsValidateExclusivityCall) Header() http.Header { 3167 if c.header_ == nil { 3168 c.header_ = make(http.Header) 3169 } 3170 return c.header_ 3171 } 3172 3173 func (c *ProjectsLocationsMembershipsValidateExclusivityCall) doRequest(alt string) (*http.Response, error) { 3174 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) 3175 if c.ifNoneMatch_ != "" { 3176 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 3177 } 3178 var body io.Reader = nil 3179 c.urlParams_.Set("alt", alt) 3180 c.urlParams_.Set("prettyPrint", "false") 3181 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/memberships:validateExclusivity") 3182 urls += "?" + c.urlParams_.Encode() 3183 req, err := http.NewRequest("GET", urls, body) 3184 if err != nil { 3185 return nil, err 3186 } 3187 req.Header = reqHeaders 3188 googleapi.Expand(req.URL, map[string]string{ 3189 "parent": c.parent, 3190 }) 3191 return gensupport.SendRequest(c.ctx_, c.s.client, req) 3192 } 3193 3194 // Do executes the "gkehub.projects.locations.memberships.validateExclusivity" call. 3195 // Any non-2xx status code is an error. Response headers are in either 3196 // *ValidateExclusivityResponse.ServerResponse.Header or (if a response was 3197 // returned at all) in error.(*googleapi.Error).Header. Use 3198 // googleapi.IsNotModified to check whether the returned error was because 3199 // http.StatusNotModified was returned. 3200 func (c *ProjectsLocationsMembershipsValidateExclusivityCall) Do(opts ...googleapi.CallOption) (*ValidateExclusivityResponse, error) { 3201 gensupport.SetOptions(c.urlParams_, opts...) 3202 res, err := c.doRequest("json") 3203 if res != nil && res.StatusCode == http.StatusNotModified { 3204 if res.Body != nil { 3205 res.Body.Close() 3206 } 3207 return nil, gensupport.WrapError(&googleapi.Error{ 3208 Code: res.StatusCode, 3209 Header: res.Header, 3210 }) 3211 } 3212 if err != nil { 3213 return nil, err 3214 } 3215 defer googleapi.CloseBody(res) 3216 if err := googleapi.CheckResponse(res); err != nil { 3217 return nil, gensupport.WrapError(err) 3218 } 3219 ret := &ValidateExclusivityResponse{ 3220 ServerResponse: googleapi.ServerResponse{ 3221 Header: res.Header, 3222 HTTPStatusCode: res.StatusCode, 3223 }, 3224 } 3225 target := &ret 3226 if err := gensupport.DecodeResponse(target, res); err != nil { 3227 return nil, err 3228 } 3229 return ret, nil 3230 } 3231 3232 type ProjectsLocationsOperationsCancelCall struct { 3233 s *Service 3234 name string 3235 canceloperationrequest *CancelOperationRequest 3236 urlParams_ gensupport.URLParams 3237 ctx_ context.Context 3238 header_ http.Header 3239 } 3240 3241 // Cancel: Starts asynchronous cancellation on a long-running operation. The 3242 // server makes a best effort to cancel the operation, but success is not 3243 // guaranteed. If the server doesn't support this method, it returns 3244 // `google.rpc.Code.UNIMPLEMENTED`. Clients can use Operations.GetOperation or 3245 // other methods to check whether the cancellation succeeded or whether the 3246 // operation completed despite cancellation. On successful cancellation, the 3247 // operation is not deleted; instead, it becomes an operation with an 3248 // Operation.error value with a google.rpc.Status.code of 1, corresponding to 3249 // `Code.CANCELLED`. 3250 // 3251 // - name: The name of the operation resource to be cancelled. 3252 func (r *ProjectsLocationsOperationsService) Cancel(name string, canceloperationrequest *CancelOperationRequest) *ProjectsLocationsOperationsCancelCall { 3253 c := &ProjectsLocationsOperationsCancelCall{s: r.s, urlParams_: make(gensupport.URLParams)} 3254 c.name = name 3255 c.canceloperationrequest = canceloperationrequest 3256 return c 3257 } 3258 3259 // Fields allows partial responses to be retrieved. See 3260 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 3261 // details. 3262 func (c *ProjectsLocationsOperationsCancelCall) Fields(s ...googleapi.Field) *ProjectsLocationsOperationsCancelCall { 3263 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 3264 return c 3265 } 3266 3267 // Context sets the context to be used in this call's Do method. 3268 func (c *ProjectsLocationsOperationsCancelCall) Context(ctx context.Context) *ProjectsLocationsOperationsCancelCall { 3269 c.ctx_ = ctx 3270 return c 3271 } 3272 3273 // Header returns a http.Header that can be modified by the caller to add 3274 // headers to the request. 3275 func (c *ProjectsLocationsOperationsCancelCall) Header() http.Header { 3276 if c.header_ == nil { 3277 c.header_ = make(http.Header) 3278 } 3279 return c.header_ 3280 } 3281 3282 func (c *ProjectsLocationsOperationsCancelCall) doRequest(alt string) (*http.Response, error) { 3283 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) 3284 var body io.Reader = nil 3285 body, err := googleapi.WithoutDataWrapper.JSONReader(c.canceloperationrequest) 3286 if err != nil { 3287 return nil, err 3288 } 3289 c.urlParams_.Set("alt", alt) 3290 c.urlParams_.Set("prettyPrint", "false") 3291 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}:cancel") 3292 urls += "?" + c.urlParams_.Encode() 3293 req, err := http.NewRequest("POST", urls, body) 3294 if err != nil { 3295 return nil, err 3296 } 3297 req.Header = reqHeaders 3298 googleapi.Expand(req.URL, map[string]string{ 3299 "name": c.name, 3300 }) 3301 return gensupport.SendRequest(c.ctx_, c.s.client, req) 3302 } 3303 3304 // Do executes the "gkehub.projects.locations.operations.cancel" call. 3305 // Any non-2xx status code is an error. Response headers are in either 3306 // *Empty.ServerResponse.Header or (if a response was returned at all) in 3307 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 3308 // whether the returned error was because http.StatusNotModified was returned. 3309 func (c *ProjectsLocationsOperationsCancelCall) Do(opts ...googleapi.CallOption) (*Empty, error) { 3310 gensupport.SetOptions(c.urlParams_, opts...) 3311 res, err := c.doRequest("json") 3312 if res != nil && res.StatusCode == http.StatusNotModified { 3313 if res.Body != nil { 3314 res.Body.Close() 3315 } 3316 return nil, gensupport.WrapError(&googleapi.Error{ 3317 Code: res.StatusCode, 3318 Header: res.Header, 3319 }) 3320 } 3321 if err != nil { 3322 return nil, err 3323 } 3324 defer googleapi.CloseBody(res) 3325 if err := googleapi.CheckResponse(res); err != nil { 3326 return nil, gensupport.WrapError(err) 3327 } 3328 ret := &Empty{ 3329 ServerResponse: googleapi.ServerResponse{ 3330 Header: res.Header, 3331 HTTPStatusCode: res.StatusCode, 3332 }, 3333 } 3334 target := &ret 3335 if err := gensupport.DecodeResponse(target, res); err != nil { 3336 return nil, err 3337 } 3338 return ret, nil 3339 } 3340 3341 type ProjectsLocationsOperationsDeleteCall struct { 3342 s *Service 3343 name string 3344 urlParams_ gensupport.URLParams 3345 ctx_ context.Context 3346 header_ http.Header 3347 } 3348 3349 // Delete: Deletes a long-running operation. This method indicates that the 3350 // client is no longer interested in the operation result. It does not cancel 3351 // the operation. If the server doesn't support this method, it returns 3352 // `google.rpc.Code.UNIMPLEMENTED`. 3353 // 3354 // - name: The name of the operation resource to be deleted. 3355 func (r *ProjectsLocationsOperationsService) Delete(name string) *ProjectsLocationsOperationsDeleteCall { 3356 c := &ProjectsLocationsOperationsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} 3357 c.name = name 3358 return c 3359 } 3360 3361 // Fields allows partial responses to be retrieved. See 3362 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 3363 // details. 3364 func (c *ProjectsLocationsOperationsDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsOperationsDeleteCall { 3365 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 3366 return c 3367 } 3368 3369 // Context sets the context to be used in this call's Do method. 3370 func (c *ProjectsLocationsOperationsDeleteCall) Context(ctx context.Context) *ProjectsLocationsOperationsDeleteCall { 3371 c.ctx_ = ctx 3372 return c 3373 } 3374 3375 // Header returns a http.Header that can be modified by the caller to add 3376 // headers to the request. 3377 func (c *ProjectsLocationsOperationsDeleteCall) Header() http.Header { 3378 if c.header_ == nil { 3379 c.header_ = make(http.Header) 3380 } 3381 return c.header_ 3382 } 3383 3384 func (c *ProjectsLocationsOperationsDeleteCall) doRequest(alt string) (*http.Response, error) { 3385 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) 3386 var body io.Reader = nil 3387 c.urlParams_.Set("alt", alt) 3388 c.urlParams_.Set("prettyPrint", "false") 3389 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") 3390 urls += "?" + c.urlParams_.Encode() 3391 req, err := http.NewRequest("DELETE", urls, body) 3392 if err != nil { 3393 return nil, err 3394 } 3395 req.Header = reqHeaders 3396 googleapi.Expand(req.URL, map[string]string{ 3397 "name": c.name, 3398 }) 3399 return gensupport.SendRequest(c.ctx_, c.s.client, req) 3400 } 3401 3402 // Do executes the "gkehub.projects.locations.operations.delete" call. 3403 // Any non-2xx status code is an error. Response headers are in either 3404 // *Empty.ServerResponse.Header or (if a response was returned at all) in 3405 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 3406 // whether the returned error was because http.StatusNotModified was returned. 3407 func (c *ProjectsLocationsOperationsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) { 3408 gensupport.SetOptions(c.urlParams_, opts...) 3409 res, err := c.doRequest("json") 3410 if res != nil && res.StatusCode == http.StatusNotModified { 3411 if res.Body != nil { 3412 res.Body.Close() 3413 } 3414 return nil, gensupport.WrapError(&googleapi.Error{ 3415 Code: res.StatusCode, 3416 Header: res.Header, 3417 }) 3418 } 3419 if err != nil { 3420 return nil, err 3421 } 3422 defer googleapi.CloseBody(res) 3423 if err := googleapi.CheckResponse(res); err != nil { 3424 return nil, gensupport.WrapError(err) 3425 } 3426 ret := &Empty{ 3427 ServerResponse: googleapi.ServerResponse{ 3428 Header: res.Header, 3429 HTTPStatusCode: res.StatusCode, 3430 }, 3431 } 3432 target := &ret 3433 if err := gensupport.DecodeResponse(target, res); err != nil { 3434 return nil, err 3435 } 3436 return ret, nil 3437 } 3438 3439 type ProjectsLocationsOperationsGetCall struct { 3440 s *Service 3441 name string 3442 urlParams_ gensupport.URLParams 3443 ifNoneMatch_ string 3444 ctx_ context.Context 3445 header_ http.Header 3446 } 3447 3448 // Get: Gets the latest state of a long-running operation. Clients can use this 3449 // method to poll the operation result at intervals as recommended by the API 3450 // service. 3451 // 3452 // - name: The name of the operation resource. 3453 func (r *ProjectsLocationsOperationsService) Get(name string) *ProjectsLocationsOperationsGetCall { 3454 c := &ProjectsLocationsOperationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 3455 c.name = name 3456 return c 3457 } 3458 3459 // Fields allows partial responses to be retrieved. See 3460 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 3461 // details. 3462 func (c *ProjectsLocationsOperationsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsOperationsGetCall { 3463 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 3464 return c 3465 } 3466 3467 // IfNoneMatch sets an optional parameter which makes the operation fail if the 3468 // object's ETag matches the given value. This is useful for getting updates 3469 // only after the object has changed since the last request. 3470 func (c *ProjectsLocationsOperationsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsOperationsGetCall { 3471 c.ifNoneMatch_ = entityTag 3472 return c 3473 } 3474 3475 // Context sets the context to be used in this call's Do method. 3476 func (c *ProjectsLocationsOperationsGetCall) Context(ctx context.Context) *ProjectsLocationsOperationsGetCall { 3477 c.ctx_ = ctx 3478 return c 3479 } 3480 3481 // Header returns a http.Header that can be modified by the caller to add 3482 // headers to the request. 3483 func (c *ProjectsLocationsOperationsGetCall) Header() http.Header { 3484 if c.header_ == nil { 3485 c.header_ = make(http.Header) 3486 } 3487 return c.header_ 3488 } 3489 3490 func (c *ProjectsLocationsOperationsGetCall) doRequest(alt string) (*http.Response, error) { 3491 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) 3492 if c.ifNoneMatch_ != "" { 3493 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 3494 } 3495 var body io.Reader = nil 3496 c.urlParams_.Set("alt", alt) 3497 c.urlParams_.Set("prettyPrint", "false") 3498 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") 3499 urls += "?" + c.urlParams_.Encode() 3500 req, err := http.NewRequest("GET", urls, body) 3501 if err != nil { 3502 return nil, err 3503 } 3504 req.Header = reqHeaders 3505 googleapi.Expand(req.URL, map[string]string{ 3506 "name": c.name, 3507 }) 3508 return gensupport.SendRequest(c.ctx_, c.s.client, req) 3509 } 3510 3511 // Do executes the "gkehub.projects.locations.operations.get" call. 3512 // Any non-2xx status code is an error. Response headers are in either 3513 // *Operation.ServerResponse.Header or (if a response was returned at all) in 3514 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 3515 // whether the returned error was because http.StatusNotModified was returned. 3516 func (c *ProjectsLocationsOperationsGetCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 3517 gensupport.SetOptions(c.urlParams_, opts...) 3518 res, err := c.doRequest("json") 3519 if res != nil && res.StatusCode == http.StatusNotModified { 3520 if res.Body != nil { 3521 res.Body.Close() 3522 } 3523 return nil, gensupport.WrapError(&googleapi.Error{ 3524 Code: res.StatusCode, 3525 Header: res.Header, 3526 }) 3527 } 3528 if err != nil { 3529 return nil, err 3530 } 3531 defer googleapi.CloseBody(res) 3532 if err := googleapi.CheckResponse(res); err != nil { 3533 return nil, gensupport.WrapError(err) 3534 } 3535 ret := &Operation{ 3536 ServerResponse: googleapi.ServerResponse{ 3537 Header: res.Header, 3538 HTTPStatusCode: res.StatusCode, 3539 }, 3540 } 3541 target := &ret 3542 if err := gensupport.DecodeResponse(target, res); err != nil { 3543 return nil, err 3544 } 3545 return ret, nil 3546 } 3547 3548 type ProjectsLocationsOperationsListCall struct { 3549 s *Service 3550 name string 3551 urlParams_ gensupport.URLParams 3552 ifNoneMatch_ string 3553 ctx_ context.Context 3554 header_ http.Header 3555 } 3556 3557 // List: Lists operations that match the specified filter in the request. If 3558 // the server doesn't support this method, it returns `UNIMPLEMENTED`. 3559 // 3560 // - name: The name of the operation's parent resource. 3561 func (r *ProjectsLocationsOperationsService) List(name string) *ProjectsLocationsOperationsListCall { 3562 c := &ProjectsLocationsOperationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 3563 c.name = name 3564 return c 3565 } 3566 3567 // Filter sets the optional parameter "filter": The standard list filter. 3568 func (c *ProjectsLocationsOperationsListCall) Filter(filter string) *ProjectsLocationsOperationsListCall { 3569 c.urlParams_.Set("filter", filter) 3570 return c 3571 } 3572 3573 // PageSize sets the optional parameter "pageSize": The standard list page 3574 // size. 3575 func (c *ProjectsLocationsOperationsListCall) PageSize(pageSize int64) *ProjectsLocationsOperationsListCall { 3576 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) 3577 return c 3578 } 3579 3580 // PageToken sets the optional parameter "pageToken": The standard list page 3581 // token. 3582 func (c *ProjectsLocationsOperationsListCall) PageToken(pageToken string) *ProjectsLocationsOperationsListCall { 3583 c.urlParams_.Set("pageToken", pageToken) 3584 return c 3585 } 3586 3587 // Fields allows partial responses to be retrieved. See 3588 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 3589 // details. 3590 func (c *ProjectsLocationsOperationsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsOperationsListCall { 3591 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 3592 return c 3593 } 3594 3595 // IfNoneMatch sets an optional parameter which makes the operation fail if the 3596 // object's ETag matches the given value. This is useful for getting updates 3597 // only after the object has changed since the last request. 3598 func (c *ProjectsLocationsOperationsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsOperationsListCall { 3599 c.ifNoneMatch_ = entityTag 3600 return c 3601 } 3602 3603 // Context sets the context to be used in this call's Do method. 3604 func (c *ProjectsLocationsOperationsListCall) Context(ctx context.Context) *ProjectsLocationsOperationsListCall { 3605 c.ctx_ = ctx 3606 return c 3607 } 3608 3609 // Header returns a http.Header that can be modified by the caller to add 3610 // headers to the request. 3611 func (c *ProjectsLocationsOperationsListCall) Header() http.Header { 3612 if c.header_ == nil { 3613 c.header_ = make(http.Header) 3614 } 3615 return c.header_ 3616 } 3617 3618 func (c *ProjectsLocationsOperationsListCall) doRequest(alt string) (*http.Response, error) { 3619 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) 3620 if c.ifNoneMatch_ != "" { 3621 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 3622 } 3623 var body io.Reader = nil 3624 c.urlParams_.Set("alt", alt) 3625 c.urlParams_.Set("prettyPrint", "false") 3626 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}/operations") 3627 urls += "?" + c.urlParams_.Encode() 3628 req, err := http.NewRequest("GET", urls, body) 3629 if err != nil { 3630 return nil, err 3631 } 3632 req.Header = reqHeaders 3633 googleapi.Expand(req.URL, map[string]string{ 3634 "name": c.name, 3635 }) 3636 return gensupport.SendRequest(c.ctx_, c.s.client, req) 3637 } 3638 3639 // Do executes the "gkehub.projects.locations.operations.list" call. 3640 // Any non-2xx status code is an error. Response headers are in either 3641 // *ListOperationsResponse.ServerResponse.Header or (if a response was returned 3642 // at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 3643 // check whether the returned error was because http.StatusNotModified was 3644 // returned. 3645 func (c *ProjectsLocationsOperationsListCall) Do(opts ...googleapi.CallOption) (*ListOperationsResponse, error) { 3646 gensupport.SetOptions(c.urlParams_, opts...) 3647 res, err := c.doRequest("json") 3648 if res != nil && res.StatusCode == http.StatusNotModified { 3649 if res.Body != nil { 3650 res.Body.Close() 3651 } 3652 return nil, gensupport.WrapError(&googleapi.Error{ 3653 Code: res.StatusCode, 3654 Header: res.Header, 3655 }) 3656 } 3657 if err != nil { 3658 return nil, err 3659 } 3660 defer googleapi.CloseBody(res) 3661 if err := googleapi.CheckResponse(res); err != nil { 3662 return nil, gensupport.WrapError(err) 3663 } 3664 ret := &ListOperationsResponse{ 3665 ServerResponse: googleapi.ServerResponse{ 3666 Header: res.Header, 3667 HTTPStatusCode: res.StatusCode, 3668 }, 3669 } 3670 target := &ret 3671 if err := gensupport.DecodeResponse(target, res); err != nil { 3672 return nil, err 3673 } 3674 return ret, nil 3675 } 3676 3677 // Pages invokes f for each page of results. 3678 // A non-nil error returned from f will halt the iteration. 3679 // The provided context supersedes any context provided to the Context method. 3680 func (c *ProjectsLocationsOperationsListCall) Pages(ctx context.Context, f func(*ListOperationsResponse) error) error { 3681 c.ctx_ = ctx 3682 defer c.PageToken(c.urlParams_.Get("pageToken")) 3683 for { 3684 x, err := c.Do() 3685 if err != nil { 3686 return err 3687 } 3688 if err := f(x); err != nil { 3689 return err 3690 } 3691 if x.NextPageToken == "" { 3692 return nil 3693 } 3694 c.PageToken(x.NextPageToken) 3695 } 3696 } 3697