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