Debian Codegraph @

gkehub/v1alpha2/gkehub-gen.go

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