1 // Copyright 2024 Google LLC. 2 // Use of this source code is governed by a BSD-style 3 // license that can be found in the LICENSE file. 4 5 // Code generated file. DO NOT EDIT. 6 7 // Package serviceconsumermanagement provides access to the Service Consumer Management API. 8 // 9 // For product documentation, see: https://cloud.google.com/service-consumer-management/docs/overview 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/serviceconsumermanagement/v1beta1" 27 // ... 28 // ctx := context.Background() 29 // serviceconsumermanagementService, err := serviceconsumermanagement.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 // serviceconsumermanagementService, err := serviceconsumermanagement.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 // serviceconsumermanagementService, err := serviceconsumermanagement.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token))) 49 // 50 // See [google.golang.org/api/option.ClientOption] for details on options. 51 package serviceconsumermanagement // import "google.golang.org/api/serviceconsumermanagement/v1beta1" 52 53 import ( 54 "bytes" 55 "context" 56 "encoding/json" 57 "errors" 58 "fmt" 59 "io" 60 "net/http" 61 "net/url" 62 "strconv" 63 "strings" 64 65 googleapi "google.golang.org/api/googleapi" 66 internal "google.golang.org/api/internal" 67 gensupport "google.golang.org/api/internal/gensupport" 68 option "google.golang.org/api/option" 69 internaloption "google.golang.org/api/option/internaloption" 70 htransport "google.golang.org/api/transport/http" 71 ) 72 73 // Always reference these packages, just in case the auto-generated code 74 // below doesn't. 75 var _ = bytes.NewBuffer 76 var _ = strconv.Itoa 77 var _ = fmt.Sprintf 78 var _ = json.NewDecoder 79 var _ = io.Copy 80 var _ = url.Parse 81 var _ = gensupport.MarshalJSON 82 var _ = googleapi.Version 83 var _ = errors.New 84 var _ = strings.Replace 85 var _ = context.Canceled 86 var _ = internaloption.WithDefaultEndpoint 87 var _ = internal.Version 88 89 const apiId = "serviceconsumermanagement:v1beta1" 90 const apiName = "serviceconsumermanagement" 91 const apiVersion = "v1beta1" 92 const basePath = "https://serviceconsumermanagement.googleapis.com/" 93 const basePathTemplate = "https://serviceconsumermanagement.UNIVERSE_DOMAIN/" 94 const mtlsBasePath = "https://serviceconsumermanagement.mtls.googleapis.com/" 95 96 // OAuth2 scopes used by this API. 97 const ( 98 // See, edit, configure, and delete your Google Cloud data and see the email 99 // address for your Google Account. 100 CloudPlatformScope = "https://www.googleapis.com/auth/cloud-platform" 101 ) 102 103 // NewService creates a new APIService. 104 func NewService(ctx context.Context, opts ...option.ClientOption) (*APIService, error) { 105 scopesOption := internaloption.WithDefaultScopes( 106 "https://www.googleapis.com/auth/cloud-platform", 107 ) 108 // NOTE: prepend, so we don't override user-specified scopes. 109 opts = append([]option.ClientOption{scopesOption}, opts...) 110 opts = append(opts, internaloption.WithDefaultEndpoint(basePath)) 111 opts = append(opts, internaloption.WithDefaultEndpointTemplate(basePathTemplate)) 112 opts = append(opts, internaloption.WithDefaultMTLSEndpoint(mtlsBasePath)) 113 opts = append(opts, internaloption.EnableNewAuthLibrary()) 114 client, endpoint, err := htransport.NewClient(ctx, opts...) 115 if err != nil { 116 return nil, err 117 } 118 s, err := New(client) 119 if err != nil { 120 return nil, err 121 } 122 if endpoint != "" { 123 s.BasePath = endpoint 124 } 125 return s, nil 126 } 127 128 // New creates a new APIService. It uses the provided http.Client for requests. 129 // 130 // Deprecated: please use NewService instead. 131 // To provide a custom HTTP client, use option.WithHTTPClient. 132 // If you are using google.golang.org/api/googleapis/transport.APIKey, use option.WithAPIKey with NewService instead. 133 func New(client *http.Client) (*APIService, error) { 134 if client == nil { 135 return nil, errors.New("client is nil") 136 } 137 s := &APIService{client: client, BasePath: basePath} 138 s.Operations = NewOperationsService(s) 139 s.Services = NewServicesService(s) 140 return s, nil 141 } 142 143 type APIService struct { 144 client *http.Client 145 BasePath string // API endpoint base URL 146 UserAgent string // optional additional User-Agent fragment 147 148 Operations *OperationsService 149 150 Services *ServicesService 151 } 152 153 func (s *APIService) userAgent() string { 154 if s.UserAgent == "" { 155 return googleapi.UserAgent 156 } 157 return googleapi.UserAgent + " " + s.UserAgent 158 } 159 160 func NewOperationsService(s *APIService) *OperationsService { 161 rs := &OperationsService{s: s} 162 return rs 163 } 164 165 type OperationsService struct { 166 s *APIService 167 } 168 169 func NewServicesService(s *APIService) *ServicesService { 170 rs := &ServicesService{s: s} 171 rs.ConsumerQuotaMetrics = NewServicesConsumerQuotaMetricsService(s) 172 return rs 173 } 174 175 type ServicesService struct { 176 s *APIService 177 178 ConsumerQuotaMetrics *ServicesConsumerQuotaMetricsService 179 } 180 181 func NewServicesConsumerQuotaMetricsService(s *APIService) *ServicesConsumerQuotaMetricsService { 182 rs := &ServicesConsumerQuotaMetricsService{s: s} 183 rs.Limits = NewServicesConsumerQuotaMetricsLimitsService(s) 184 return rs 185 } 186 187 type ServicesConsumerQuotaMetricsService struct { 188 s *APIService 189 190 Limits *ServicesConsumerQuotaMetricsLimitsService 191 } 192 193 func NewServicesConsumerQuotaMetricsLimitsService(s *APIService) *ServicesConsumerQuotaMetricsLimitsService { 194 rs := &ServicesConsumerQuotaMetricsLimitsService{s: s} 195 rs.ProducerOverrides = NewServicesConsumerQuotaMetricsLimitsProducerOverridesService(s) 196 return rs 197 } 198 199 type ServicesConsumerQuotaMetricsLimitsService struct { 200 s *APIService 201 202 ProducerOverrides *ServicesConsumerQuotaMetricsLimitsProducerOverridesService 203 } 204 205 func NewServicesConsumerQuotaMetricsLimitsProducerOverridesService(s *APIService) *ServicesConsumerQuotaMetricsLimitsProducerOverridesService { 206 rs := &ServicesConsumerQuotaMetricsLimitsProducerOverridesService{s: s} 207 return rs 208 } 209 210 type ServicesConsumerQuotaMetricsLimitsProducerOverridesService struct { 211 s *APIService 212 } 213 214 // Api: Api is a light-weight descriptor for an API Interface. Interfaces are 215 // also described as "protocol buffer services" in some contexts, such as by 216 // the "service" keyword in a .proto file, but they are different from API 217 // Services, which represent a concrete implementation of an interface as 218 // opposed to simply a description of methods and bindings. They are also 219 // sometimes simply referred to as "APIs" in other contexts, such as the name 220 // of this message itself. See https://cloud.google.com/apis/design/glossary 221 // for detailed terminology. 222 type Api struct { 223 // Methods: The methods of this interface, in unspecified order. 224 Methods []*Method `json:"methods,omitempty"` 225 // Mixins: Included interfaces. See Mixin. 226 Mixins []*Mixin `json:"mixins,omitempty"` 227 // Name: The fully qualified name of this interface, including package name 228 // followed by the interface's simple name. 229 Name string `json:"name,omitempty"` 230 // Options: Any metadata attached to the interface. 231 Options []*Option `json:"options,omitempty"` 232 // SourceContext: Source context for the protocol buffer service represented by 233 // this message. 234 SourceContext *SourceContext `json:"sourceContext,omitempty"` 235 // Syntax: The source syntax of the service. 236 // 237 // Possible values: 238 // "SYNTAX_PROTO2" - Syntax `proto2`. 239 // "SYNTAX_PROTO3" - Syntax `proto3`. 240 // "SYNTAX_EDITIONS" - Syntax `editions`. 241 Syntax string `json:"syntax,omitempty"` 242 // Version: A version string for this interface. If specified, must have the 243 // form `major-version.minor-version`, as in `1.10`. If the minor version is 244 // omitted, it defaults to zero. If the entire version field is empty, the 245 // major version is derived from the package name, as outlined below. If the 246 // field is not empty, the version in the package name will be verified to be 247 // consistent with what is provided here. The versioning schema uses semantic 248 // versioning (http://semver.org) where the major version number indicates a 249 // breaking change and the minor version an additive, non-breaking change. Both 250 // version numbers are signals to users what to expect from different versions, 251 // and should be carefully chosen based on the product plan. The major version 252 // is also reflected in the package name of the interface, which must end in 253 // `v`, as in `google.feature.v1`. For major versions 0 and 1, the suffix can 254 // be omitted. Zero major versions must only be used for experimental, non-GA 255 // interfaces. 256 Version string `json:"version,omitempty"` 257 // ForceSendFields is a list of field names (e.g. "Methods") to unconditionally 258 // include in API requests. By default, fields with empty or default values are 259 // omitted from API requests. See 260 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 261 // details. 262 ForceSendFields []string `json:"-"` 263 // NullFields is a list of field names (e.g. "Methods") to include in API 264 // requests with the JSON null value. By default, fields with empty values are 265 // omitted from API requests. See 266 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 267 NullFields []string `json:"-"` 268 } 269 270 func (s *Api) MarshalJSON() ([]byte, error) { 271 type NoMethod Api 272 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 273 } 274 275 // AuthProvider: Configuration for an authentication provider, including 276 // support for JSON Web Token (JWT) 277 // (https://tools.ietf.org/html/draft-ietf-oauth-json-web-token-32). 278 type AuthProvider struct { 279 // Audiences: The list of JWT audiences 280 // (https://tools.ietf.org/html/draft-ietf-oauth-json-web-token-32#section-4.1.3). 281 // that are allowed to access. A JWT containing any of these audiences will be 282 // accepted. When this setting is absent, JWTs with audiences: - 283 // "https://[service.name]/[google.protobuf.Api.name]" - 284 // "https://[service.name]/" will be accepted. For example, if no audiences are 285 // in the setting, LibraryService API will accept JWTs with the following 286 // audiences: - 287 // https://library-example.googleapis.com/google.example.library.v1.LibraryService 288 // - https://library-example.googleapis.com/ Example: audiences: 289 // bookstore_android.apps.googleusercontent.com, 290 // bookstore_web.apps.googleusercontent.com 291 Audiences string `json:"audiences,omitempty"` 292 // AuthorizationUrl: Redirect URL if JWT token is required but not present or 293 // is expired. Implement authorizationUrl of securityDefinitions in OpenAPI 294 // spec. 295 AuthorizationUrl string `json:"authorizationUrl,omitempty"` 296 // Id: The unique identifier of the auth provider. It will be referred to by 297 // `AuthRequirement.provider_id`. Example: "bookstore_auth". 298 Id string `json:"id,omitempty"` 299 // Issuer: Identifies the principal that issued the JWT. See 300 // https://tools.ietf.org/html/draft-ietf-oauth-json-web-token-32#section-4.1.1 301 // Usually a URL or an email address. Example: https://securetoken.google.com 302 // Example: 1234567-compute@developer.gserviceaccount.com 303 Issuer string `json:"issuer,omitempty"` 304 // JwksUri: URL of the provider's public key set to validate signature of the 305 // JWT. See OpenID Discovery 306 // (https://openid.net/specs/openid-connect-discovery-1_0.html#ProviderMetadata). 307 // Optional if the key set document: - can be retrieved from OpenID Discovery 308 // (https://openid.net/specs/openid-connect-discovery-1_0.html) of the issuer. 309 // - can be inferred from the email domain of the issuer (e.g. a Google service 310 // account). Example: https://www.googleapis.com/oauth2/v1/certs 311 JwksUri string `json:"jwksUri,omitempty"` 312 // JwtLocations: Defines the locations to extract the JWT. For now it is only 313 // used by the Cloud Endpoints to store the OpenAPI extension 314 // [x-google-jwt-locations] 315 // (https://cloud.google.com/endpoints/docs/openapi/openapi-extensions#x-google-jwt-locations) 316 // JWT locations can be one of HTTP headers, URL query parameters or cookies. 317 // The rule is that the first match wins. If not specified, default to use 318 // following 3 locations: 1) Authorization: Bearer 2) x-goog-iap-jwt-assertion 319 // 3) access_token query parameter Default locations can be specified as 320 // followings: jwt_locations: - header: Authorization value_prefix: "Bearer " - 321 // header: x-goog-iap-jwt-assertion - query: access_token 322 JwtLocations []*JwtLocation `json:"jwtLocations,omitempty"` 323 // ForceSendFields is a list of field names (e.g. "Audiences") to 324 // unconditionally include in API requests. By default, fields with empty or 325 // default values are omitted from API requests. See 326 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 327 // details. 328 ForceSendFields []string `json:"-"` 329 // NullFields is a list of field names (e.g. "Audiences") to include in API 330 // requests with the JSON null value. By default, fields with empty values are 331 // omitted from API requests. See 332 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 333 NullFields []string `json:"-"` 334 } 335 336 func (s *AuthProvider) MarshalJSON() ([]byte, error) { 337 type NoMethod AuthProvider 338 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 339 } 340 341 // AuthRequirement: User-defined authentication requirements, including support 342 // for JSON Web Token (JWT) 343 // (https://tools.ietf.org/html/draft-ietf-oauth-json-web-token-32). 344 type AuthRequirement struct { 345 // Audiences: NOTE: This will be deprecated soon, once AuthProvider.audiences 346 // is implemented and accepted in all the runtime components. The list of JWT 347 // audiences 348 // (https://tools.ietf.org/html/draft-ietf-oauth-json-web-token-32#section-4.1.3). 349 // that are allowed to access. A JWT containing any of these audiences will be 350 // accepted. When this setting is absent, only JWTs with audience 351 // "https://Service_name/API_name" will be accepted. For example, if no 352 // audiences are in the setting, LibraryService API will only accept JWTs with 353 // the following audience 354 // "https://library-example.googleapis.com/google.example.library.v1.LibraryServ 355 // ice". Example: audiences: bookstore_android.apps.googleusercontent.com, 356 // bookstore_web.apps.googleusercontent.com 357 Audiences string `json:"audiences,omitempty"` 358 // ProviderId: id from authentication provider. Example: provider_id: 359 // bookstore_auth 360 ProviderId string `json:"providerId,omitempty"` 361 // ForceSendFields is a list of field names (e.g. "Audiences") to 362 // unconditionally include in API requests. By default, fields with empty or 363 // default values are omitted from API requests. See 364 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 365 // details. 366 ForceSendFields []string `json:"-"` 367 // NullFields is a list of field names (e.g. "Audiences") to include in API 368 // requests with the JSON null value. By default, fields with empty values are 369 // omitted from API requests. See 370 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 371 NullFields []string `json:"-"` 372 } 373 374 func (s *AuthRequirement) MarshalJSON() ([]byte, error) { 375 type NoMethod AuthRequirement 376 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 377 } 378 379 // Authentication: `Authentication` defines the authentication configuration 380 // for API methods provided by an API service. Example: name: 381 // calendar.googleapis.com authentication: providers: - id: 382 // google_calendar_auth jwks_uri: https://www.googleapis.com/oauth2/v1/certs 383 // issuer: https://securetoken.google.com rules: - selector: "*" requirements: 384 // provider_id: google_calendar_auth - selector: google.calendar.Delegate 385 // oauth: canonical_scopes: https://www.googleapis.com/auth/calendar.read 386 type Authentication struct { 387 // Providers: Defines a set of authentication providers that a service 388 // supports. 389 Providers []*AuthProvider `json:"providers,omitempty"` 390 // Rules: A list of authentication rules that apply to individual API methods. 391 // **NOTE:** All service configuration rules follow "last one wins" order. 392 Rules []*AuthenticationRule `json:"rules,omitempty"` 393 // ForceSendFields is a list of field names (e.g. "Providers") to 394 // unconditionally include in API requests. By default, fields with empty or 395 // default values are omitted from API requests. See 396 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 397 // details. 398 ForceSendFields []string `json:"-"` 399 // NullFields is a list of field names (e.g. "Providers") to include in API 400 // requests with the JSON null value. By default, fields with empty values are 401 // omitted from API requests. See 402 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 403 NullFields []string `json:"-"` 404 } 405 406 func (s *Authentication) MarshalJSON() ([]byte, error) { 407 type NoMethod Authentication 408 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 409 } 410 411 // AuthenticationRule: Authentication rules for the service. By default, if a 412 // method has any authentication requirements, every request must include a 413 // valid credential matching one of the requirements. It's an error to include 414 // more than one kind of credential in a single request. If a method doesn't 415 // have any auth requirements, request credentials will be ignored. 416 type AuthenticationRule struct { 417 // AllowWithoutCredential: If true, the service accepts API keys without any 418 // other credential. This flag only applies to HTTP and gRPC requests. 419 AllowWithoutCredential bool `json:"allowWithoutCredential,omitempty"` 420 // Oauth: The requirements for OAuth credentials. 421 Oauth *OAuthRequirements `json:"oauth,omitempty"` 422 // Requirements: Requirements for additional authentication providers. 423 Requirements []*AuthRequirement `json:"requirements,omitempty"` 424 // Selector: Selects the methods to which this rule applies. Refer to selector 425 // for syntax details. 426 Selector string `json:"selector,omitempty"` 427 // ForceSendFields is a list of field names (e.g. "AllowWithoutCredential") to 428 // unconditionally include in API requests. By default, fields with empty or 429 // default values are omitted from API requests. See 430 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 431 // details. 432 ForceSendFields []string `json:"-"` 433 // NullFields is a list of field names (e.g. "AllowWithoutCredential") to 434 // include in API requests with the JSON null value. By default, fields with 435 // empty values are omitted from API requests. See 436 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 437 NullFields []string `json:"-"` 438 } 439 440 func (s *AuthenticationRule) MarshalJSON() ([]byte, error) { 441 type NoMethod AuthenticationRule 442 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 443 } 444 445 // Backend: `Backend` defines the backend configuration for a service. 446 type Backend struct { 447 // Rules: A list of API backend rules that apply to individual API methods. 448 // **NOTE:** All service configuration rules follow "last one wins" order. 449 Rules []*BackendRule `json:"rules,omitempty"` 450 // ForceSendFields is a list of field names (e.g. "Rules") to unconditionally 451 // include in API requests. By default, fields with empty or default values are 452 // omitted from API requests. See 453 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 454 // details. 455 ForceSendFields []string `json:"-"` 456 // NullFields is a list of field names (e.g. "Rules") to include in API 457 // requests with the JSON null value. By default, fields with empty values are 458 // omitted from API requests. See 459 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 460 NullFields []string `json:"-"` 461 } 462 463 func (s *Backend) MarshalJSON() ([]byte, error) { 464 type NoMethod Backend 465 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 466 } 467 468 // BackendRule: A backend rule provides configuration for an individual API 469 // element. 470 type BackendRule struct { 471 // Address: The address of the API backend. The scheme is used to determine the 472 // backend protocol and security. The following schemes are accepted: SCHEME 473 // PROTOCOL SECURITY http:// HTTP None https:// HTTP TLS grpc:// gRPC None 474 // grpcs:// gRPC TLS It is recommended to explicitly include a scheme. Leaving 475 // out the scheme may cause constrasting behaviors across platforms. If the 476 // port is unspecified, the default is: - 80 for schemes without TLS - 443 for 477 // schemes with TLS For HTTP backends, use protocol to specify the protocol 478 // version. 479 Address string `json:"address,omitempty"` 480 // Deadline: The number of seconds to wait for a response from a request. The 481 // default varies based on the request protocol and deployment environment. 482 Deadline float64 `json:"deadline,omitempty"` 483 // DisableAuth: When disable_auth is true, a JWT ID token won't be generated 484 // and the original "Authorization" HTTP header will be preserved. If the 485 // header is used to carry the original token and is expected by the backend, 486 // this field must be set to true to preserve the header. 487 DisableAuth bool `json:"disableAuth,omitempty"` 488 // JwtAudience: The JWT audience is used when generating a JWT ID token for the 489 // backend. This ID token will be added in the HTTP "authorization" header, and 490 // sent to the backend. 491 JwtAudience string `json:"jwtAudience,omitempty"` 492 // MinDeadline: Deprecated, do not use. 493 MinDeadline float64 `json:"minDeadline,omitempty"` 494 // OperationDeadline: The number of seconds to wait for the completion of a 495 // long running operation. The default is no deadline. 496 OperationDeadline float64 `json:"operationDeadline,omitempty"` 497 // OverridesByRequestProtocol: The map between request protocol and the backend 498 // address. 499 OverridesByRequestProtocol map[string]BackendRule `json:"overridesByRequestProtocol,omitempty"` 500 // Possible values: 501 // "PATH_TRANSLATION_UNSPECIFIED" 502 // "CONSTANT_ADDRESS" - Use the backend address as-is, with no modification 503 // to the path. If the URL pattern contains variables, the variable names and 504 // values will be appended to the query string. If a query string parameter and 505 // a URL pattern variable have the same name, this may result in duplicate keys 506 // in the query string. # Examples Given the following operation config: Method 507 // path: /api/company/{cid}/user/{uid} Backend address: 508 // https://example.cloudfunctions.net/getUser Requests to the following request 509 // paths will call the backend at the translated path: Request path: 510 // /api/company/widgetworks/user/johndoe Translated: 511 // https://example.cloudfunctions.net/getUser?cid=widgetworks&uid=johndoe 512 // Request path: /api/company/widgetworks/user/johndoe?timezone=EST Translated: 513 // https://example.cloudfunctions.net/getUser?timezone=EST&cid=widgetworks&uid=johndoe 514 // "APPEND_PATH_TO_ADDRESS" - The request path will be appended to the 515 // backend address. # Examples Given the following operation config: Method 516 // path: /api/company/{cid}/user/{uid} Backend address: 517 // https://example.appspot.com Requests to the following request paths will 518 // call the backend at the translated path: Request path: 519 // /api/company/widgetworks/user/johndoe Translated: 520 // https://example.appspot.com/api/company/widgetworks/user/johndoe Request 521 // path: /api/company/widgetworks/user/johndoe?timezone=EST Translated: 522 // https://example.appspot.com/api/company/widgetworks/user/johndoe?timezone=EST 523 PathTranslation string `json:"pathTranslation,omitempty"` 524 // Protocol: The protocol used for sending a request to the backend. The 525 // supported values are "http/1.1" and "h2". The default value is inferred from 526 // the scheme in the address field: SCHEME PROTOCOL http:// http/1.1 https:// 527 // http/1.1 grpc:// h2 grpcs:// h2 For secure HTTP backends (https://) that 528 // support HTTP/2, set this field to "h2" for improved performance. Configuring 529 // this field to non-default values is only supported for secure HTTP backends. 530 // This field will be ignored for all other backends. See 531 // https://www.iana.org/assignments/tls-extensiontype-values/tls-extensiontype-values.xhtml#alpn-protocol-ids 532 // for more details on the supported values. 533 Protocol string `json:"protocol,omitempty"` 534 // Selector: Selects the methods to which this rule applies. Refer to selector 535 // for syntax details. 536 Selector string `json:"selector,omitempty"` 537 // ForceSendFields is a list of field names (e.g. "Address") to unconditionally 538 // include in API requests. By default, fields with empty or default values are 539 // omitted from API requests. See 540 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 541 // details. 542 ForceSendFields []string `json:"-"` 543 // NullFields is a list of field names (e.g. "Address") to include in API 544 // requests with the JSON null value. By default, fields with empty values are 545 // omitted from API requests. See 546 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 547 NullFields []string `json:"-"` 548 } 549 550 func (s *BackendRule) MarshalJSON() ([]byte, error) { 551 type NoMethod BackendRule 552 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 553 } 554 555 func (s *BackendRule) UnmarshalJSON(data []byte) error { 556 type NoMethod BackendRule 557 var s1 struct { 558 Deadline gensupport.JSONFloat64 `json:"deadline"` 559 MinDeadline gensupport.JSONFloat64 `json:"minDeadline"` 560 OperationDeadline gensupport.JSONFloat64 `json:"operationDeadline"` 561 *NoMethod 562 } 563 s1.NoMethod = (*NoMethod)(s) 564 if err := json.Unmarshal(data, &s1); err != nil { 565 return err 566 } 567 s.Deadline = float64(s1.Deadline) 568 s.MinDeadline = float64(s1.MinDeadline) 569 s.OperationDeadline = float64(s1.OperationDeadline) 570 return nil 571 } 572 573 // Billing: Billing related configuration of the service. The following example 574 // shows how to configure monitored resources and metrics for billing, 575 // `consumer_destinations` is the only supported destination and the monitored 576 // resources need at least one label key `cloud.googleapis.com/location` to 577 // indicate the location of the billing usage, using different monitored 578 // resources between monitoring and billing is recommended so they can be 579 // evolved independently: monitored_resources: - type: 580 // library.googleapis.com/billing_branch labels: - key: 581 // cloud.googleapis.com/location description: | Predefined label to support 582 // billing location restriction. - key: city description: | Custom label to 583 // define the city where the library branch is located in. - key: name 584 // description: Custom label to define the name of the library branch. metrics: 585 // - name: library.googleapis.com/book/borrowed_count metric_kind: DELTA 586 // value_type: INT64 unit: "1" billing: consumer_destinations: - 587 // monitored_resource: library.googleapis.com/billing_branch metrics: - 588 // library.googleapis.com/book/borrowed_count 589 type Billing struct { 590 // ConsumerDestinations: Billing configurations for sending metrics to the 591 // consumer project. There can be multiple consumer destinations per service, 592 // each one must have a different monitored resource type. A metric can be used 593 // in at most one consumer destination. 594 ConsumerDestinations []*BillingDestination `json:"consumerDestinations,omitempty"` 595 // ForceSendFields is a list of field names (e.g. "ConsumerDestinations") to 596 // unconditionally include in API requests. By default, fields with empty or 597 // default values are omitted from API requests. See 598 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 599 // details. 600 ForceSendFields []string `json:"-"` 601 // NullFields is a list of field names (e.g. "ConsumerDestinations") to include 602 // in API requests with the JSON null value. By default, fields with empty 603 // values are omitted from API requests. See 604 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 605 NullFields []string `json:"-"` 606 } 607 608 func (s *Billing) MarshalJSON() ([]byte, error) { 609 type NoMethod Billing 610 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 611 } 612 613 // BillingDestination: Configuration of a specific billing destination 614 // (Currently only support bill against consumer project). 615 type BillingDestination struct { 616 // Metrics: Names of the metrics to report to this billing destination. Each 617 // name must be defined in Service.metrics section. 618 Metrics []string `json:"metrics,omitempty"` 619 // MonitoredResource: The monitored resource type. The type must be defined in 620 // Service.monitored_resources section. 621 MonitoredResource string `json:"monitoredResource,omitempty"` 622 // ForceSendFields is a list of field names (e.g. "Metrics") to unconditionally 623 // include in API requests. By default, fields with empty or default values are 624 // omitted from API requests. See 625 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 626 // details. 627 ForceSendFields []string `json:"-"` 628 // NullFields is a list of field names (e.g. "Metrics") to include in API 629 // requests with the JSON null value. By default, fields with empty values are 630 // omitted from API requests. See 631 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 632 NullFields []string `json:"-"` 633 } 634 635 func (s *BillingDestination) MarshalJSON() ([]byte, error) { 636 type NoMethod BillingDestination 637 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 638 } 639 640 // ClientLibrarySettings: Details about how and where to publish client 641 // libraries. 642 type ClientLibrarySettings struct { 643 // CppSettings: Settings for C++ client libraries. 644 CppSettings *CppSettings `json:"cppSettings,omitempty"` 645 // DotnetSettings: Settings for .NET client libraries. 646 DotnetSettings *DotnetSettings `json:"dotnetSettings,omitempty"` 647 // GoSettings: Settings for Go client libraries. 648 GoSettings *GoSettings `json:"goSettings,omitempty"` 649 // JavaSettings: Settings for legacy Java features, supported in the Service 650 // YAML. 651 JavaSettings *JavaSettings `json:"javaSettings,omitempty"` 652 // LaunchStage: Launch stage of this version of the API. 653 // 654 // Possible values: 655 // "LAUNCH_STAGE_UNSPECIFIED" - Do not use this default value. 656 // "UNIMPLEMENTED" - The feature is not yet implemented. Users can not use 657 // it. 658 // "PRELAUNCH" - Prelaunch features are hidden from users and are only 659 // visible internally. 660 // "EARLY_ACCESS" - Early Access features are limited to a closed group of 661 // testers. To use these features, you must sign up in advance and sign a 662 // Trusted Tester agreement (which includes confidentiality provisions). These 663 // features may be unstable, changed in backward-incompatible ways, and are not 664 // guaranteed to be released. 665 // "ALPHA" - Alpha is a limited availability test for releases before they 666 // are cleared for widespread use. By Alpha, all significant design issues are 667 // resolved and we are in the process of verifying functionality. Alpha 668 // customers need to apply for access, agree to applicable terms, and have 669 // their projects allowlisted. Alpha releases don't have to be feature 670 // complete, no SLAs are provided, and there are no technical support 671 // obligations, but they will be far enough along that customers can actually 672 // use them in test environments or for limited-use tests -- just like they 673 // would in normal production cases. 674 // "BETA" - Beta is the point at which we are ready to open a release for any 675 // customer to use. There are no SLA or technical support obligations in a Beta 676 // release. Products will be complete from a feature perspective, but may have 677 // some open outstanding issues. Beta releases are suitable for limited 678 // production use cases. 679 // "GA" - GA features are open to all developers and are considered stable 680 // and fully qualified for production use. 681 // "DEPRECATED" - Deprecated features are scheduled to be shut down and 682 // removed. For more information, see the "Deprecation Policy" section of our 683 // [Terms of Service](https://cloud.google.com/terms/) and the [Google Cloud 684 // Platform Subject to the Deprecation 685 // Policy](https://cloud.google.com/terms/deprecation) documentation. 686 LaunchStage string `json:"launchStage,omitempty"` 687 // NodeSettings: Settings for Node client libraries. 688 NodeSettings *NodeSettings `json:"nodeSettings,omitempty"` 689 // PhpSettings: Settings for PHP client libraries. 690 PhpSettings *PhpSettings `json:"phpSettings,omitempty"` 691 // PythonSettings: Settings for Python client libraries. 692 PythonSettings *PythonSettings `json:"pythonSettings,omitempty"` 693 // RestNumericEnums: When using transport=rest, the client request will encode 694 // enums as numbers rather than strings. 695 RestNumericEnums bool `json:"restNumericEnums,omitempty"` 696 // RubySettings: Settings for Ruby client libraries. 697 RubySettings *RubySettings `json:"rubySettings,omitempty"` 698 // Version: Version of the API to apply these settings to. This is the full 699 // protobuf package for the API, ending in the version element. Examples: 700 // "google.cloud.speech.v1" and "google.spanner.admin.database.v1". 701 Version string `json:"version,omitempty"` 702 // ForceSendFields is a list of field names (e.g. "CppSettings") to 703 // unconditionally include in API requests. By default, fields with empty or 704 // default values are omitted from API requests. See 705 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 706 // details. 707 ForceSendFields []string `json:"-"` 708 // NullFields is a list of field names (e.g. "CppSettings") to include in API 709 // requests with the JSON null value. By default, fields with empty values are 710 // omitted from API requests. See 711 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 712 NullFields []string `json:"-"` 713 } 714 715 func (s *ClientLibrarySettings) MarshalJSON() ([]byte, error) { 716 type NoMethod ClientLibrarySettings 717 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 718 } 719 720 // CommonLanguageSettings: Required information for every language. 721 type CommonLanguageSettings struct { 722 // Destinations: The destination where API teams want this client library to be 723 // published. 724 // 725 // Possible values: 726 // "CLIENT_LIBRARY_DESTINATION_UNSPECIFIED" - Client libraries will neither 727 // be generated nor published to package managers. 728 // "GITHUB" - Generate the client library in a repo under 729 // github.com/googleapis, but don't publish it to package managers. 730 // "PACKAGE_MANAGER" - Publish the library to package managers like nuget.org 731 // and npmjs.com. 732 Destinations []string `json:"destinations,omitempty"` 733 // ReferenceDocsUri: Link to automatically generated reference documentation. 734 // Example: https://cloud.google.com/nodejs/docs/reference/asset/latest 735 ReferenceDocsUri string `json:"referenceDocsUri,omitempty"` 736 // ForceSendFields is a list of field names (e.g. "Destinations") to 737 // unconditionally include in API requests. By default, fields with empty or 738 // default values are omitted from API requests. See 739 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 740 // details. 741 ForceSendFields []string `json:"-"` 742 // NullFields is a list of field names (e.g. "Destinations") to include in API 743 // requests with the JSON null value. By default, fields with empty values are 744 // omitted from API requests. See 745 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 746 NullFields []string `json:"-"` 747 } 748 749 func (s *CommonLanguageSettings) MarshalJSON() ([]byte, error) { 750 type NoMethod CommonLanguageSettings 751 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 752 } 753 754 // Context: `Context` defines which contexts an API requests. Example: context: 755 // rules: - selector: "*" requested: - google.rpc.context.ProjectContext - 756 // google.rpc.context.OriginContext The above specifies that all methods in the 757 // API request `google.rpc.context.ProjectContext` and 758 // `google.rpc.context.OriginContext`. Available context types are defined in 759 // package `google.rpc.context`. This also provides mechanism to allowlist any 760 // protobuf message extension that can be sent in grpc metadata using 761 // “x-goog-ext--bin” and “x-goog-ext--jspb” format. For example, list 762 // any service specific protobuf types that can appear in grpc metadata as 763 // follows in your yaml file: Example: context: rules: - selector: 764 // "google.example.library.v1.LibraryService.CreateBook" 765 // allowed_request_extensions: - google.foo.v1.NewExtension 766 // allowed_response_extensions: - google.foo.v1.NewExtension You can also 767 // specify extension ID instead of fully qualified extension name here. 768 type Context struct { 769 // Rules: A list of RPC context rules that apply to individual API methods. 770 // **NOTE:** All service configuration rules follow "last one wins" order. 771 Rules []*ContextRule `json:"rules,omitempty"` 772 // ForceSendFields is a list of field names (e.g. "Rules") to unconditionally 773 // include in API requests. By default, fields with empty or default values are 774 // omitted from API requests. See 775 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 776 // details. 777 ForceSendFields []string `json:"-"` 778 // NullFields is a list of field names (e.g. "Rules") to include in API 779 // requests with the JSON null value. By default, fields with empty values are 780 // omitted from API requests. See 781 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 782 NullFields []string `json:"-"` 783 } 784 785 func (s *Context) MarshalJSON() ([]byte, error) { 786 type NoMethod Context 787 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 788 } 789 790 // ContextRule: A context rule provides information about the context for an 791 // individual API element. 792 type ContextRule struct { 793 // AllowedRequestExtensions: A list of full type names or extension IDs of 794 // extensions allowed in grpc side channel from client to backend. 795 AllowedRequestExtensions []string `json:"allowedRequestExtensions,omitempty"` 796 // AllowedResponseExtensions: A list of full type names or extension IDs of 797 // extensions allowed in grpc side channel from backend to client. 798 AllowedResponseExtensions []string `json:"allowedResponseExtensions,omitempty"` 799 // Provided: A list of full type names of provided contexts. 800 Provided []string `json:"provided,omitempty"` 801 // Requested: A list of full type names of requested contexts. 802 Requested []string `json:"requested,omitempty"` 803 // Selector: Selects the methods to which this rule applies. Refer to selector 804 // for syntax details. 805 Selector string `json:"selector,omitempty"` 806 // ForceSendFields is a list of field names (e.g. "AllowedRequestExtensions") 807 // to unconditionally include in API requests. By default, fields with empty or 808 // default values are omitted from API requests. See 809 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 810 // details. 811 ForceSendFields []string `json:"-"` 812 // NullFields is a list of field names (e.g. "AllowedRequestExtensions") to 813 // include in API requests with the JSON null value. By default, fields with 814 // empty values are omitted from API requests. See 815 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 816 NullFields []string `json:"-"` 817 } 818 819 func (s *ContextRule) MarshalJSON() ([]byte, error) { 820 type NoMethod ContextRule 821 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 822 } 823 824 // Control: Selects and configures the service controller used by the service. 825 // Example: control: environment: servicecontrol.googleapis.com 826 type Control struct { 827 // Environment: The service controller environment to use. If empty, no control 828 // plane feature (like quota and billing) will be enabled. The recommended 829 // value for most services is servicecontrol.googleapis.com 830 Environment string `json:"environment,omitempty"` 831 // MethodPolicies: Defines policies applying to the API methods of the service. 832 MethodPolicies []*MethodPolicy `json:"methodPolicies,omitempty"` 833 // ForceSendFields is a list of field names (e.g. "Environment") to 834 // unconditionally include in API requests. By default, fields with empty or 835 // default values are omitted from API requests. See 836 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 837 // details. 838 ForceSendFields []string `json:"-"` 839 // NullFields is a list of field names (e.g. "Environment") to include in API 840 // requests with the JSON null value. By default, fields with empty values are 841 // omitted from API requests. See 842 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 843 NullFields []string `json:"-"` 844 } 845 846 func (s *Control) MarshalJSON() ([]byte, error) { 847 type NoMethod Control 848 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 849 } 850 851 // CppSettings: Settings for C++ client libraries. 852 type CppSettings struct { 853 // Common: Some settings. 854 Common *CommonLanguageSettings `json:"common,omitempty"` 855 // ForceSendFields is a list of field names (e.g. "Common") to unconditionally 856 // include in API requests. By default, fields with empty or default values are 857 // omitted from API requests. See 858 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 859 // details. 860 ForceSendFields []string `json:"-"` 861 // NullFields is a list of field names (e.g. "Common") to include in API 862 // requests with the JSON null value. By default, fields with empty values are 863 // omitted from API requests. See 864 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 865 NullFields []string `json:"-"` 866 } 867 868 func (s *CppSettings) MarshalJSON() ([]byte, error) { 869 type NoMethod CppSettings 870 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 871 } 872 873 // CustomError: Customize service error responses. For example, list any 874 // service specific protobuf types that can appear in error detail lists of 875 // error responses. Example: custom_error: types: - google.foo.v1.CustomError - 876 // google.foo.v1.AnotherError 877 type CustomError struct { 878 // Rules: The list of custom error rules that apply to individual API messages. 879 // **NOTE:** All service configuration rules follow "last one wins" order. 880 Rules []*CustomErrorRule `json:"rules,omitempty"` 881 // Types: The list of custom error detail types, e.g. 882 // 'google.foo.v1.CustomError'. 883 Types []string `json:"types,omitempty"` 884 // ForceSendFields is a list of field names (e.g. "Rules") to unconditionally 885 // include in API requests. By default, fields with empty or default values are 886 // omitted from API requests. See 887 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 888 // details. 889 ForceSendFields []string `json:"-"` 890 // NullFields is a list of field names (e.g. "Rules") to include in API 891 // requests with the JSON null value. By default, fields with empty values are 892 // omitted from API requests. See 893 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 894 NullFields []string `json:"-"` 895 } 896 897 func (s *CustomError) MarshalJSON() ([]byte, error) { 898 type NoMethod CustomError 899 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 900 } 901 902 // CustomErrorRule: A custom error rule. 903 type CustomErrorRule struct { 904 // IsErrorType: Mark this message as possible payload in error response. 905 // Otherwise, objects of this type will be filtered when they appear in error 906 // payload. 907 IsErrorType bool `json:"isErrorType,omitempty"` 908 // Selector: Selects messages to which this rule applies. Refer to selector for 909 // syntax details. 910 Selector string `json:"selector,omitempty"` 911 // ForceSendFields is a list of field names (e.g. "IsErrorType") to 912 // unconditionally include in API requests. By default, fields with empty or 913 // default values are omitted from API requests. See 914 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 915 // details. 916 ForceSendFields []string `json:"-"` 917 // NullFields is a list of field names (e.g. "IsErrorType") to include in API 918 // requests with the JSON null value. By default, fields with empty values are 919 // omitted from API requests. See 920 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 921 NullFields []string `json:"-"` 922 } 923 924 func (s *CustomErrorRule) MarshalJSON() ([]byte, error) { 925 type NoMethod CustomErrorRule 926 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 927 } 928 929 // CustomHttpPattern: A custom pattern is used for defining custom HTTP verb. 930 type CustomHttpPattern struct { 931 // Kind: The name of this custom HTTP verb. 932 Kind string `json:"kind,omitempty"` 933 // Path: The path matched by this custom verb. 934 Path string `json:"path,omitempty"` 935 // ForceSendFields is a list of field names (e.g. "Kind") to unconditionally 936 // include in API requests. By default, fields with empty or default values are 937 // omitted from API requests. See 938 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 939 // details. 940 ForceSendFields []string `json:"-"` 941 // NullFields is a list of field names (e.g. "Kind") to include in API requests 942 // with the JSON null value. By default, fields with empty values are omitted 943 // from API requests. See 944 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 945 NullFields []string `json:"-"` 946 } 947 948 func (s *CustomHttpPattern) MarshalJSON() ([]byte, error) { 949 type NoMethod CustomHttpPattern 950 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 951 } 952 953 // Documentation: `Documentation` provides the information for describing a 954 // service. Example: documentation: summary: > The Google Calendar API gives 955 // access to most calendar features. pages: - name: Overview content: (== 956 // include google/foo/overview.md ==) - name: Tutorial content: (== include 957 // google/foo/tutorial.md ==) subpages: - name: Java content: (== include 958 // google/foo/tutorial_java.md ==) rules: - selector: 959 // google.calendar.Calendar.Get description: > ... - selector: 960 // google.calendar.Calendar.Put description: > ... Documentation is provided in 961 // markdown syntax. In addition to standard markdown features, definition 962 // lists, tables and fenced code blocks are supported. Section headers can be 963 // provided and are interpreted relative to the section nesting of the context 964 // where a documentation fragment is embedded. Documentation from the IDL is 965 // merged with documentation defined via the config at normalization time, 966 // where documentation provided by config rules overrides IDL provided. A 967 // number of constructs specific to the API platform are supported in 968 // documentation text. In order to reference a proto element, the following 969 // notation can be used: [fully.qualified.proto.name][] To override the display 970 // text used for the link, this can be used: [display 971 // text][fully.qualified.proto.name] Text can be excluded from doc using the 972 // following notation: (-- internal comment --) A few directives are available 973 // in documentation. Note that directives must appear on a single line to be 974 // properly identified. The `include` directive includes a markdown file from 975 // an external source: (== include path/to/file ==) The `resource_for` 976 // directive marks a message to be the resource of a collection in REST view. 977 // If it is not specified, tools attempt to infer the resource from the 978 // operations in a collection: (== resource_for v1.shelves.books ==) The 979 // directive `suppress_warning` does not directly affect documentation and is 980 // documented together with service config validation. 981 type Documentation struct { 982 // DocumentationRootUrl: The URL to the root of documentation. 983 DocumentationRootUrl string `json:"documentationRootUrl,omitempty"` 984 // Overview: Declares a single overview page. For example: documentation: 985 // summary: ... overview: (== include overview.md ==) This is a shortcut for 986 // the following declaration (using pages style): documentation: summary: ... 987 // pages: - name: Overview content: (== include overview.md ==) Note: you 988 // cannot specify both `overview` field and `pages` field. 989 Overview string `json:"overview,omitempty"` 990 // Pages: The top level pages for the documentation set. 991 Pages []*Page `json:"pages,omitempty"` 992 // Rules: A list of documentation rules that apply to individual API elements. 993 // **NOTE:** All service configuration rules follow "last one wins" order. 994 Rules []*DocumentationRule `json:"rules,omitempty"` 995 // SectionOverrides: Specifies section and content to override boilerplate 996 // content provided by go/api-docgen. Currently overrides following sections: 997 // 1. rest.service.client_libraries 998 SectionOverrides []*Page `json:"sectionOverrides,omitempty"` 999 // ServiceRootUrl: Specifies the service root url if the default one (the 1000 // service name from the yaml file) is not suitable. This can be seen in any 1001 // fully specified service urls as well as sections that show a base that other 1002 // urls are relative to. 1003 ServiceRootUrl string `json:"serviceRootUrl,omitempty"` 1004 // Summary: A short description of what the service does. The summary must be 1005 // plain text. It becomes the overview of the service displayed in Google Cloud 1006 // Console. NOTE: This field is equivalent to the standard field `description`. 1007 Summary string `json:"summary,omitempty"` 1008 // ForceSendFields is a list of field names (e.g. "DocumentationRootUrl") to 1009 // unconditionally include in API requests. By default, fields with empty or 1010 // default values are omitted from API requests. See 1011 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1012 // details. 1013 ForceSendFields []string `json:"-"` 1014 // NullFields is a list of field names (e.g. "DocumentationRootUrl") to include 1015 // in API requests with the JSON null value. By default, fields with empty 1016 // values are omitted from API requests. See 1017 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1018 NullFields []string `json:"-"` 1019 } 1020 1021 func (s *Documentation) MarshalJSON() ([]byte, error) { 1022 type NoMethod Documentation 1023 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1024 } 1025 1026 // DocumentationRule: A documentation rule provides information about 1027 // individual API elements. 1028 type DocumentationRule struct { 1029 // DeprecationDescription: Deprecation description of the selected element(s). 1030 // It can be provided if an element is marked as `deprecated`. 1031 DeprecationDescription string `json:"deprecationDescription,omitempty"` 1032 // Description: Description of the selected proto element (e.g. a message, a 1033 // method, a 'service' definition, or a field). Defaults to leading & trailing 1034 // comments taken from the proto source definition of the proto element. 1035 Description string `json:"description,omitempty"` 1036 // DisableReplacementWords: String of comma or space separated case-sensitive 1037 // words for which method/field name replacement will be disabled by 1038 // go/api-docgen. 1039 DisableReplacementWords string `json:"disableReplacementWords,omitempty"` 1040 // Selector: The selector is a comma-separated list of patterns for any element 1041 // such as a method, a field, an enum value. Each pattern is a qualified name 1042 // of the element which may end in "*", indicating a wildcard. Wildcards are 1043 // only allowed at the end and for a whole component of the qualified name, 1044 // i.e. "foo.*" is ok, but not "foo.b*" or "foo.*.bar". A wildcard will match 1045 // one or more components. To specify a default for all applicable elements, 1046 // the whole pattern "*" is used. 1047 Selector string `json:"selector,omitempty"` 1048 // ForceSendFields is a list of field names (e.g. "DeprecationDescription") to 1049 // unconditionally include in API requests. By default, fields with empty or 1050 // default values are omitted from API requests. See 1051 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1052 // details. 1053 ForceSendFields []string `json:"-"` 1054 // NullFields is a list of field names (e.g. "DeprecationDescription") to 1055 // include in API requests with the JSON null value. By default, fields with 1056 // empty values are omitted from API requests. See 1057 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1058 NullFields []string `json:"-"` 1059 } 1060 1061 func (s *DocumentationRule) MarshalJSON() ([]byte, error) { 1062 type NoMethod DocumentationRule 1063 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1064 } 1065 1066 // DotnetSettings: Settings for Dotnet client libraries. 1067 type DotnetSettings struct { 1068 // Common: Some settings. 1069 Common *CommonLanguageSettings `json:"common,omitempty"` 1070 // ForcedNamespaceAliases: Namespaces which must be aliased in snippets due to 1071 // a known (but non-generator-predictable) naming collision 1072 ForcedNamespaceAliases []string `json:"forcedNamespaceAliases,omitempty"` 1073 // HandwrittenSignatures: Method signatures (in the form 1074 // "service.method(signature)") which are provided separately, so shouldn't be 1075 // generated. Snippets *calling* these methods are still generated, however. 1076 HandwrittenSignatures []string `json:"handwrittenSignatures,omitempty"` 1077 // IgnoredResources: List of full resource types to ignore during generation. 1078 // This is typically used for API-specific Location resources, which should be 1079 // handled by the generator as if they were actually the common Location 1080 // resources. Example entry: "documentai.googleapis.com/Location" 1081 IgnoredResources []string `json:"ignoredResources,omitempty"` 1082 // RenamedResources: Map from full resource types to the effective short name 1083 // for the resource. This is used when otherwise resource named from different 1084 // services would cause naming collisions. Example entry: 1085 // "datalabeling.googleapis.com/Dataset": "DataLabelingDataset" 1086 RenamedResources map[string]string `json:"renamedResources,omitempty"` 1087 // RenamedServices: Map from original service names to renamed versions. This 1088 // is used when the default generated types would cause a naming conflict. 1089 // (Neither name is fully-qualified.) Example: Subscriber to 1090 // SubscriberServiceApi. 1091 RenamedServices map[string]string `json:"renamedServices,omitempty"` 1092 // ForceSendFields is a list of field names (e.g. "Common") to unconditionally 1093 // include in API requests. By default, fields with empty or default values are 1094 // omitted from API requests. See 1095 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1096 // details. 1097 ForceSendFields []string `json:"-"` 1098 // NullFields is a list of field names (e.g. "Common") to include in API 1099 // requests with the JSON null value. By default, fields with empty values are 1100 // omitted from API requests. See 1101 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1102 NullFields []string `json:"-"` 1103 } 1104 1105 func (s *DotnetSettings) MarshalJSON() ([]byte, error) { 1106 type NoMethod DotnetSettings 1107 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1108 } 1109 1110 // Empty: A generic empty message that you can re-use to avoid defining 1111 // duplicated empty messages in your APIs. A typical example is to use it as 1112 // the request or the response type of an API method. For instance: service Foo 1113 // { rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); } 1114 type Empty struct { 1115 } 1116 1117 // Endpoint: `Endpoint` describes a network address of a service that serves a 1118 // set of APIs. It is commonly known as a service endpoint. A service may 1119 // expose any number of service endpoints, and all service endpoints share the 1120 // same service definition, such as quota limits and monitoring metrics. 1121 // Example: type: google.api.Service name: library-example.googleapis.com 1122 // endpoints: # Declares network address 1123 // `https://library-example.googleapis.com` # for service 1124 // `library-example.googleapis.com`. The `https` scheme # is implicit for all 1125 // service endpoints. Other schemes may be # supported in the future. - name: 1126 // library-example.googleapis.com allow_cors: false - name: 1127 // content-staging-library-example.googleapis.com # Allows HTTP OPTIONS calls 1128 // to be passed to the API frontend, for it # to decide whether the subsequent 1129 // cross-origin request is allowed # to proceed. allow_cors: true 1130 type Endpoint struct { 1131 // Aliases: Aliases for this endpoint, these will be served by the same UrlMap 1132 // as the parent endpoint, and will be provisioned in the GCP stack for the 1133 // Regional Endpoints. 1134 Aliases []string `json:"aliases,omitempty"` 1135 // AllowCors: Allowing CORS 1136 // (https://en.wikipedia.org/wiki/Cross-origin_resource_sharing), aka 1137 // cross-domain traffic, would allow the backends served from this endpoint to 1138 // receive and respond to HTTP OPTIONS requests. The response will be used by 1139 // the browser to determine whether the subsequent cross-origin request is 1140 // allowed to proceed. 1141 AllowCors bool `json:"allowCors,omitempty"` 1142 // Name: The canonical name of this endpoint. 1143 Name string `json:"name,omitempty"` 1144 // Target: The specification of an Internet routable address of API frontend 1145 // that will handle requests to this API Endpoint 1146 // (https://cloud.google.com/apis/design/glossary). It should be either a valid 1147 // IPv4 address or a fully-qualified domain name. For example, "8.8.8.8" or 1148 // "myservice.appspot.com". 1149 Target string `json:"target,omitempty"` 1150 // ForceSendFields is a list of field names (e.g. "Aliases") to unconditionally 1151 // include in API requests. By default, fields with empty or default values are 1152 // omitted from API requests. See 1153 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1154 // details. 1155 ForceSendFields []string `json:"-"` 1156 // NullFields is a list of field names (e.g. "Aliases") to include in API 1157 // requests with the JSON null value. By default, fields with empty values are 1158 // omitted from API requests. See 1159 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1160 NullFields []string `json:"-"` 1161 } 1162 1163 func (s *Endpoint) MarshalJSON() ([]byte, error) { 1164 type NoMethod Endpoint 1165 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1166 } 1167 1168 // Enum: Enum type definition. 1169 type Enum struct { 1170 // Edition: The source edition string, only valid when syntax is 1171 // SYNTAX_EDITIONS. 1172 Edition string `json:"edition,omitempty"` 1173 // Enumvalue: Enum value definitions. 1174 Enumvalue []*EnumValue `json:"enumvalue,omitempty"` 1175 // Name: Enum type name. 1176 Name string `json:"name,omitempty"` 1177 // Options: Protocol buffer options. 1178 Options []*Option `json:"options,omitempty"` 1179 // SourceContext: The source context. 1180 SourceContext *SourceContext `json:"sourceContext,omitempty"` 1181 // Syntax: The source syntax. 1182 // 1183 // Possible values: 1184 // "SYNTAX_PROTO2" - Syntax `proto2`. 1185 // "SYNTAX_PROTO3" - Syntax `proto3`. 1186 // "SYNTAX_EDITIONS" - Syntax `editions`. 1187 Syntax string `json:"syntax,omitempty"` 1188 // ForceSendFields is a list of field names (e.g. "Edition") to unconditionally 1189 // include in API requests. By default, fields with empty or default values are 1190 // omitted from API requests. See 1191 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1192 // details. 1193 ForceSendFields []string `json:"-"` 1194 // NullFields is a list of field names (e.g. "Edition") to include in API 1195 // requests with the JSON null value. By default, fields with empty values are 1196 // omitted from API requests. See 1197 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1198 NullFields []string `json:"-"` 1199 } 1200 1201 func (s *Enum) MarshalJSON() ([]byte, error) { 1202 type NoMethod Enum 1203 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1204 } 1205 1206 // EnumValue: Enum value definition. 1207 type EnumValue struct { 1208 // Name: Enum value name. 1209 Name string `json:"name,omitempty"` 1210 // Number: Enum value number. 1211 Number int64 `json:"number,omitempty"` 1212 // Options: Protocol buffer options. 1213 Options []*Option `json:"options,omitempty"` 1214 // ForceSendFields is a list of field names (e.g. "Name") to unconditionally 1215 // include in API requests. By default, fields with empty or default values are 1216 // omitted from API requests. See 1217 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1218 // details. 1219 ForceSendFields []string `json:"-"` 1220 // NullFields is a list of field names (e.g. "Name") to include in API requests 1221 // with the JSON null value. By default, fields with empty values are omitted 1222 // from API requests. See 1223 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1224 NullFields []string `json:"-"` 1225 } 1226 1227 func (s *EnumValue) MarshalJSON() ([]byte, error) { 1228 type NoMethod EnumValue 1229 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1230 } 1231 1232 // Field: A single field of a message type. 1233 type Field struct { 1234 // Cardinality: The field cardinality. 1235 // 1236 // Possible values: 1237 // "CARDINALITY_UNKNOWN" - For fields with unknown cardinality. 1238 // "CARDINALITY_OPTIONAL" - For optional fields. 1239 // "CARDINALITY_REQUIRED" - For required fields. Proto2 syntax only. 1240 // "CARDINALITY_REPEATED" - For repeated fields. 1241 Cardinality string `json:"cardinality,omitempty"` 1242 // DefaultValue: The string value of the default value of this field. Proto2 1243 // syntax only. 1244 DefaultValue string `json:"defaultValue,omitempty"` 1245 // JsonName: The field JSON name. 1246 JsonName string `json:"jsonName,omitempty"` 1247 // Kind: The field type. 1248 // 1249 // Possible values: 1250 // "TYPE_UNKNOWN" - Field type unknown. 1251 // "TYPE_DOUBLE" - Field type double. 1252 // "TYPE_FLOAT" - Field type float. 1253 // "TYPE_INT64" - Field type int64. 1254 // "TYPE_UINT64" - Field type uint64. 1255 // "TYPE_INT32" - Field type int32. 1256 // "TYPE_FIXED64" - Field type fixed64. 1257 // "TYPE_FIXED32" - Field type fixed32. 1258 // "TYPE_BOOL" - Field type bool. 1259 // "TYPE_STRING" - Field type string. 1260 // "TYPE_GROUP" - Field type group. Proto2 syntax only, and deprecated. 1261 // "TYPE_MESSAGE" - Field type message. 1262 // "TYPE_BYTES" - Field type bytes. 1263 // "TYPE_UINT32" - Field type uint32. 1264 // "TYPE_ENUM" - Field type enum. 1265 // "TYPE_SFIXED32" - Field type sfixed32. 1266 // "TYPE_SFIXED64" - Field type sfixed64. 1267 // "TYPE_SINT32" - Field type sint32. 1268 // "TYPE_SINT64" - Field type sint64. 1269 Kind string `json:"kind,omitempty"` 1270 // Name: The field name. 1271 Name string `json:"name,omitempty"` 1272 // Number: The field number. 1273 Number int64 `json:"number,omitempty"` 1274 // OneofIndex: The index of the field type in `Type.oneofs`, for message or 1275 // enumeration types. The first type has index 1; zero means the type is not in 1276 // the list. 1277 OneofIndex int64 `json:"oneofIndex,omitempty"` 1278 // Options: The protocol buffer options. 1279 Options []*Option `json:"options,omitempty"` 1280 // Packed: Whether to use alternative packed wire representation. 1281 Packed bool `json:"packed,omitempty"` 1282 // TypeUrl: The field type URL, without the scheme, for message or enumeration 1283 // types. Example: "type.googleapis.com/google.protobuf.Timestamp". 1284 TypeUrl string `json:"typeUrl,omitempty"` 1285 // ForceSendFields is a list of field names (e.g. "Cardinality") to 1286 // unconditionally include in API requests. By default, fields with empty or 1287 // default values are omitted from API requests. See 1288 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1289 // details. 1290 ForceSendFields []string `json:"-"` 1291 // NullFields is a list of field names (e.g. "Cardinality") to include in API 1292 // requests with the JSON null value. By default, fields with empty values are 1293 // omitted from API requests. See 1294 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1295 NullFields []string `json:"-"` 1296 } 1297 1298 func (s *Field) MarshalJSON() ([]byte, error) { 1299 type NoMethod Field 1300 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1301 } 1302 1303 // FieldPolicy: Google API Policy Annotation This message defines a simple API 1304 // policy annotation that can be used to annotate API request and response 1305 // message fields with applicable policies. One field may have multiple 1306 // applicable policies that must all be satisfied before a request can be 1307 // processed. This policy annotation is used to generate the overall policy 1308 // that will be used for automatic runtime policy enforcement and documentation 1309 // generation. 1310 type FieldPolicy struct { 1311 // ResourcePermission: Specifies the required permission(s) for the resource 1312 // referred to by the field. It requires the field contains a valid resource 1313 // reference, and the request must pass the permission checks to proceed. For 1314 // example, "resourcemanager.projects.get". 1315 ResourcePermission string `json:"resourcePermission,omitempty"` 1316 // ResourceType: Specifies the resource type for the resource referred to by 1317 // the field. 1318 ResourceType string `json:"resourceType,omitempty"` 1319 // Selector: Selects one or more request or response message fields to apply 1320 // this `FieldPolicy`. When a `FieldPolicy` is used in proto annotation, the 1321 // selector must be left as empty. The service config generator will 1322 // automatically fill the correct value. When a `FieldPolicy` is used in 1323 // service config, the selector must be a comma-separated string with valid 1324 // request or response field paths, such as "foo.bar" or "foo.bar,foo.baz". 1325 Selector string `json:"selector,omitempty"` 1326 // ForceSendFields is a list of field names (e.g. "ResourcePermission") to 1327 // unconditionally include in API requests. By default, fields with empty or 1328 // default values are omitted from API requests. See 1329 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1330 // details. 1331 ForceSendFields []string `json:"-"` 1332 // NullFields is a list of field names (e.g. "ResourcePermission") to include 1333 // in API requests with the JSON null value. By default, fields with empty 1334 // values are omitted from API requests. See 1335 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1336 NullFields []string `json:"-"` 1337 } 1338 1339 func (s *FieldPolicy) MarshalJSON() ([]byte, error) { 1340 type NoMethod FieldPolicy 1341 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1342 } 1343 1344 // GoSettings: Settings for Go client libraries. 1345 type GoSettings struct { 1346 // Common: Some settings. 1347 Common *CommonLanguageSettings `json:"common,omitempty"` 1348 // ForceSendFields is a list of field names (e.g. "Common") to unconditionally 1349 // include in API requests. By default, fields with empty or default values are 1350 // omitted from API requests. See 1351 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1352 // details. 1353 ForceSendFields []string `json:"-"` 1354 // NullFields is a list of field names (e.g. "Common") to include in API 1355 // requests with the JSON null value. By default, fields with empty values are 1356 // omitted from API requests. See 1357 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1358 NullFields []string `json:"-"` 1359 } 1360 1361 func (s *GoSettings) MarshalJSON() ([]byte, error) { 1362 type NoMethod GoSettings 1363 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1364 } 1365 1366 // Http: Defines the HTTP configuration for an API service. It contains a list 1367 // of HttpRule, each specifying the mapping of an RPC method to one or more 1368 // HTTP REST API methods. 1369 type Http struct { 1370 // FullyDecodeReservedExpansion: When set to true, URL path parameters will be 1371 // fully URI-decoded except in cases of single segment matches in reserved 1372 // expansion, where "%2F" will be left encoded. The default behavior is to not 1373 // decode RFC 6570 reserved characters in multi segment matches. 1374 FullyDecodeReservedExpansion bool `json:"fullyDecodeReservedExpansion,omitempty"` 1375 // Rules: A list of HTTP configuration rules that apply to individual API 1376 // methods. **NOTE:** All service configuration rules follow "last one wins" 1377 // order. 1378 Rules []*HttpRule `json:"rules,omitempty"` 1379 // ForceSendFields is a list of field names (e.g. 1380 // "FullyDecodeReservedExpansion") to unconditionally include in API requests. 1381 // By default, fields with empty or default values are omitted from API 1382 // requests. See https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields 1383 // for more details. 1384 ForceSendFields []string `json:"-"` 1385 // NullFields is a list of field names (e.g. "FullyDecodeReservedExpansion") to 1386 // include in API requests with the JSON null value. By default, fields with 1387 // empty values are omitted from API requests. See 1388 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1389 NullFields []string `json:"-"` 1390 } 1391 1392 func (s *Http) MarshalJSON() ([]byte, error) { 1393 type NoMethod Http 1394 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1395 } 1396 1397 // HttpRule: # gRPC Transcoding gRPC Transcoding is a feature for mapping 1398 // between a gRPC method and one or more HTTP REST endpoints. It allows 1399 // developers to build a single API service that supports both gRPC APIs and 1400 // REST APIs. Many systems, including Google APIs 1401 // (https://github.com/googleapis/googleapis), Cloud Endpoints 1402 // (https://cloud.google.com/endpoints), gRPC Gateway 1403 // (https://github.com/grpc-ecosystem/grpc-gateway), and Envoy 1404 // (https://github.com/envoyproxy/envoy) proxy support this feature and use it 1405 // for large scale production services. `HttpRule` defines the schema of the 1406 // gRPC/REST mapping. The mapping specifies how different portions of the gRPC 1407 // request message are mapped to the URL path, URL query parameters, and HTTP 1408 // request body. It also controls how the gRPC response message is mapped to 1409 // the HTTP response body. `HttpRule` is typically specified as an 1410 // `google.api.http` annotation on the gRPC method. Each mapping specifies a 1411 // URL path template and an HTTP method. The path template may refer to one or 1412 // more fields in the gRPC request message, as long as each field is a 1413 // non-repeated field with a primitive (non-message) type. The path template 1414 // controls how fields of the request message are mapped to the URL path. 1415 // Example: service Messaging { rpc GetMessage(GetMessageRequest) returns 1416 // (Message) { option (google.api.http) = { get: "/v1/{name=messages/*}" }; } } 1417 // message GetMessageRequest { string name = 1; // Mapped to URL path. } 1418 // message Message { string text = 1; // The resource content. } This enables 1419 // an HTTP REST to gRPC mapping as below: HTTP | gRPC -----|----- `GET 1420 // /v1/messages/123456` | `GetMessage(name: "messages/123456")` Any fields in 1421 // the request message which are not bound by the path template automatically 1422 // become HTTP query parameters if there is no HTTP request body. For example: 1423 // service Messaging { rpc GetMessage(GetMessageRequest) returns (Message) { 1424 // option (google.api.http) = { get:"/v1/messages/{message_id}" }; } } message 1425 // GetMessageRequest { message SubMessage { string subfield = 1; } string 1426 // message_id = 1; // Mapped to URL path. int64 revision = 2; // Mapped to URL 1427 // query parameter `revision`. SubMessage sub = 3; // Mapped to URL query 1428 // parameter `sub.subfield`. } This enables a HTTP JSON to RPC mapping as 1429 // below: HTTP | gRPC -----|----- `GET 1430 // /v1/messages/123456?revision=2&sub.subfield=foo` | `GetMessage(message_id: 1431 // "123456" revision: 2 sub: SubMessage(subfield: "foo"))` Note that fields 1432 // which are mapped to URL query parameters must have a primitive type or a 1433 // repeated primitive type or a non-repeated message type. In the case of a 1434 // repeated type, the parameter can be repeated in the URL as 1435 // `...?param=A¶m=B`. In the case of a message type, each field of the 1436 // message is mapped to a separate parameter, such as 1437 // `...?foo.a=A&foo.b=B&foo.c=C`. For HTTP methods that allow a request body, 1438 // the `body` field specifies the mapping. Consider a REST update method on the 1439 // message resource collection: service Messaging { rpc 1440 // UpdateMessage(UpdateMessageRequest) returns (Message) { option 1441 // (google.api.http) = { patch: "/v1/messages/{message_id}" body: "message" }; 1442 // } } message UpdateMessageRequest { string message_id = 1; // mapped to the 1443 // URL Message message = 2; // mapped to the body } The following HTTP JSON to 1444 // RPC mapping is enabled, where the representation of the JSON in the request 1445 // body is determined by protos JSON encoding: HTTP | gRPC -----|----- `PATCH 1446 // /v1/messages/123456 { "text": "Hi!" }` | `UpdateMessage(message_id: "123456" 1447 // message { text: "Hi!" })` The special name `*` can be used in the body 1448 // mapping to define that every field not bound by the path template should be 1449 // mapped to the request body. This enables the following alternative 1450 // definition of the update method: service Messaging { rpc 1451 // UpdateMessage(Message) returns (Message) { option (google.api.http) = { 1452 // patch: "/v1/messages/{message_id}" body: "*" }; } } message Message { string 1453 // message_id = 1; string text = 2; } The following HTTP JSON to RPC mapping is 1454 // enabled: HTTP | gRPC -----|----- `PATCH /v1/messages/123456 { "text": "Hi!" 1455 // }` | `UpdateMessage(message_id: "123456" text: "Hi!")` Note that when using 1456 // `*` in the body mapping, it is not possible to have HTTP parameters, as all 1457 // fields not bound by the path end in the body. This makes this option more 1458 // rarely used in practice when defining REST APIs. The common usage of `*` is 1459 // in custom methods which don't use the URL at all for transferring data. It 1460 // is possible to define multiple HTTP methods for one RPC by using the 1461 // `additional_bindings` option. Example: service Messaging { rpc 1462 // GetMessage(GetMessageRequest) returns (Message) { option (google.api.http) = 1463 // { get: "/v1/messages/{message_id}" additional_bindings { get: 1464 // "/v1/users/{user_id}/messages/{message_id}" } }; } } message 1465 // GetMessageRequest { string message_id = 1; string user_id = 2; } This 1466 // enables the following two alternative HTTP JSON to RPC mappings: HTTP | gRPC 1467 // -----|----- `GET /v1/messages/123456` | `GetMessage(message_id: "123456")` 1468 // `GET /v1/users/me/messages/123456` | `GetMessage(user_id: "me" message_id: 1469 // "123456")` ## Rules for HTTP mapping 1. Leaf request fields (recursive 1470 // expansion nested messages in the request message) are classified into three 1471 // categories: - Fields referred by the path template. They are passed via the 1472 // URL path. - Fields referred by the HttpRule.body. They are passed via the 1473 // HTTP request body. - All other fields are passed via the URL query 1474 // parameters, and the parameter name is the field path in the request message. 1475 // A repeated field can be represented as multiple query parameters under the 1476 // same name. 2. If HttpRule.body is "*", there is no URL query parameter, all 1477 // fields are passed via URL path and HTTP request body. 3. If HttpRule.body is 1478 // omitted, there is no HTTP request body, all fields are passed via URL path 1479 // and URL query parameters. ### Path template syntax Template = "/" Segments [ 1480 // Verb ] ; Segments = Segment { "/" Segment } ; Segment = "*" | "**" | LITERAL 1481 // | Variable ; Variable = "{" FieldPath [ "=" Segments ] "}" ; FieldPath = 1482 // IDENT { "." IDENT } ; Verb = ":" LITERAL ; The syntax `*` matches a single 1483 // URL path segment. The syntax `**` matches zero or more URL path segments, 1484 // which must be the last part of the URL path except the `Verb`. The syntax 1485 // `Variable` matches part of the URL path as specified by its template. A 1486 // variable template must not contain other variables. If a variable matches a 1487 // single path segment, its template may be omitted, e.g. `{var}` is equivalent 1488 // to `{var=*}`. The syntax `LITERAL` matches literal text in the URL path. If 1489 // the `LITERAL` contains any reserved character, such characters should be 1490 // percent-encoded before the matching. If a variable contains exactly one path 1491 // segment, such as "{var}" or "{var=*}", when such a variable is expanded 1492 // into a URL path on the client side, all characters except `[-_.~0-9a-zA-Z]` 1493 // are percent-encoded. The server side does the reverse decoding. Such 1494 // variables show up in the Discovery Document 1495 // (https://developers.google.com/discovery/v1/reference/apis) as `{var}`. If a 1496 // variable contains multiple path segments, such as "{var=foo/*}" or 1497 // "{var=**}", when such a variable is expanded into a URL path on the client 1498 // side, all characters except `[-_.~/0-9a-zA-Z]` are percent-encoded. The 1499 // server side does the reverse decoding, except "%2F" and "%2f" are left 1500 // unchanged. Such variables show up in the Discovery Document 1501 // (https://developers.google.com/discovery/v1/reference/apis) as `{+var}`. ## 1502 // Using gRPC API Service Configuration gRPC API Service Configuration (service 1503 // config) is a configuration language for configuring a gRPC service to become 1504 // a user-facing product. The service config is simply the YAML representation 1505 // of the `google.api.Service` proto message. As an alternative to annotating 1506 // your proto file, you can configure gRPC transcoding in your service config 1507 // YAML files. You do this by specifying a `HttpRule` that maps the gRPC method 1508 // to a REST endpoint, achieving the same effect as the proto annotation. This 1509 // can be particularly useful if you have a proto that is reused in multiple 1510 // services. Note that any transcoding specified in the service config will 1511 // override any matching transcoding configuration in the proto. Example: http: 1512 // rules: # Selects a gRPC method and applies HttpRule to it. - selector: 1513 // example.v1.Messaging.GetMessage get: 1514 // /v1/messages/{message_id}/{sub.subfield} ## Special notes When gRPC 1515 // Transcoding is used to map a gRPC to JSON REST endpoints, the proto to JSON 1516 // conversion must follow the proto3 specification 1517 // (https://developers.google.com/protocol-buffers/docs/proto3#json). While the 1518 // single segment variable follows the semantics of RFC 6570 1519 // (https://tools.ietf.org/html/rfc6570) Section 3.2.2 Simple String Expansion, 1520 // the multi segment variable **does not** follow RFC 6570 Section 3.2.3 1521 // Reserved Expansion. The reason is that the Reserved Expansion does not 1522 // expand special characters like `?` and `#`, which would lead to invalid 1523 // URLs. As the result, gRPC Transcoding uses a custom encoding for multi 1524 // segment variables. The path variables **must not** refer to any repeated or 1525 // mapped field, because client libraries are not capable of handling such 1526 // variable expansion. The path variables **must not** capture the leading "/" 1527 // character. The reason is that the most common use case "{var}" does not 1528 // capture the leading "/" character. For consistency, all path variables must 1529 // share the same behavior. Repeated message fields must not be mapped to URL 1530 // query parameters, because no client library can support such complicated 1531 // mapping. If an API needs to use a JSON array for request or response body, 1532 // it can map the request or response body to a repeated field. However, some 1533 // gRPC Transcoding implementations may not support this feature. 1534 type HttpRule struct { 1535 // AdditionalBindings: Additional HTTP bindings for the selector. Nested 1536 // bindings must not contain an `additional_bindings` field themselves (that 1537 // is, the nesting may only be one level deep). 1538 AdditionalBindings []*HttpRule `json:"additionalBindings,omitempty"` 1539 // Body: The name of the request field whose value is mapped to the HTTP 1540 // request body, or `*` for mapping all request fields not captured by the path 1541 // pattern to the HTTP body, or omitted for not having any HTTP request body. 1542 // NOTE: the referred field must be present at the top-level of the request 1543 // message type. 1544 Body string `json:"body,omitempty"` 1545 // Custom: The custom pattern is used for specifying an HTTP method that is not 1546 // included in the `pattern` field, such as HEAD, or "*" to leave the HTTP 1547 // method unspecified for this rule. The wild-card rule is useful for services 1548 // that provide content to Web (HTML) clients. 1549 Custom *CustomHttpPattern `json:"custom,omitempty"` 1550 // Delete: Maps to HTTP DELETE. Used for deleting a resource. 1551 Delete string `json:"delete,omitempty"` 1552 // Get: Maps to HTTP GET. Used for listing and getting information about 1553 // resources. 1554 Get string `json:"get,omitempty"` 1555 // Patch: Maps to HTTP PATCH. Used for updating a resource. 1556 Patch string `json:"patch,omitempty"` 1557 // Post: Maps to HTTP POST. Used for creating a resource or performing an 1558 // action. 1559 Post string `json:"post,omitempty"` 1560 // Put: Maps to HTTP PUT. Used for replacing a resource. 1561 Put string `json:"put,omitempty"` 1562 // ResponseBody: Optional. The name of the response field whose value is mapped 1563 // to the HTTP response body. When omitted, the entire response message will be 1564 // used as the HTTP response body. NOTE: The referred field must be present at 1565 // the top-level of the response message type. 1566 ResponseBody string `json:"responseBody,omitempty"` 1567 // Selector: Selects a method to which this rule applies. Refer to selector for 1568 // syntax details. 1569 Selector string `json:"selector,omitempty"` 1570 // ForceSendFields is a list of field names (e.g. "AdditionalBindings") to 1571 // unconditionally include in API requests. By default, fields with empty or 1572 // default values are omitted from API requests. See 1573 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1574 // details. 1575 ForceSendFields []string `json:"-"` 1576 // NullFields is a list of field names (e.g. "AdditionalBindings") to include 1577 // in API requests with the JSON null value. By default, fields with empty 1578 // values are omitted from API requests. See 1579 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1580 NullFields []string `json:"-"` 1581 } 1582 1583 func (s *HttpRule) MarshalJSON() ([]byte, error) { 1584 type NoMethod HttpRule 1585 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1586 } 1587 1588 // JavaSettings: Settings for Java client libraries. 1589 type JavaSettings struct { 1590 // Common: Some settings. 1591 Common *CommonLanguageSettings `json:"common,omitempty"` 1592 // LibraryPackage: The package name to use in Java. Clobbers the java_package 1593 // option set in the protobuf. This should be used **only** by APIs who have 1594 // already set the language_settings.java.package_name" field in gapic.yaml. 1595 // API teams should use the protobuf java_package option where possible. 1596 // Example of a YAML configuration:: publishing: java_settings: 1597 // library_package: com.google.cloud.pubsub.v1 1598 LibraryPackage string `json:"libraryPackage,omitempty"` 1599 // ServiceClassNames: Configure the Java class name to use instead of the 1600 // service's for its corresponding generated GAPIC client. Keys are 1601 // fully-qualified service names as they appear in the protobuf (including the 1602 // full the language_settings.java.interface_names" field in gapic.yaml. API 1603 // teams should otherwise use the service name as it appears in the protobuf. 1604 // Example of a YAML configuration:: publishing: java_settings: 1605 // service_class_names: - google.pubsub.v1.Publisher: TopicAdmin - 1606 // google.pubsub.v1.Subscriber: SubscriptionAdmin 1607 ServiceClassNames map[string]string `json:"serviceClassNames,omitempty"` 1608 // ForceSendFields is a list of field names (e.g. "Common") to unconditionally 1609 // include in API requests. By default, fields with empty or default values are 1610 // omitted from API requests. See 1611 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1612 // details. 1613 ForceSendFields []string `json:"-"` 1614 // NullFields is a list of field names (e.g. "Common") to include in API 1615 // requests with the JSON null value. By default, fields with empty values are 1616 // omitted from API requests. See 1617 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1618 NullFields []string `json:"-"` 1619 } 1620 1621 func (s *JavaSettings) MarshalJSON() ([]byte, error) { 1622 type NoMethod JavaSettings 1623 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1624 } 1625 1626 // JwtLocation: Specifies a location to extract JWT from an API request. 1627 type JwtLocation struct { 1628 // Cookie: Specifies cookie name to extract JWT token. 1629 Cookie string `json:"cookie,omitempty"` 1630 // Header: Specifies HTTP header name to extract JWT token. 1631 Header string `json:"header,omitempty"` 1632 // Query: Specifies URL query parameter name to extract JWT token. 1633 Query string `json:"query,omitempty"` 1634 // ValuePrefix: The value prefix. The value format is "value_prefix{token}" 1635 // Only applies to "in" header type. Must be empty for "in" query type. If not 1636 // empty, the header value has to match (case sensitive) this prefix. If not 1637 // matched, JWT will not be extracted. If matched, JWT will be extracted after 1638 // the prefix is removed. For example, for "Authorization: Bearer {JWT}", 1639 // value_prefix="Bearer " with a space at the end. 1640 ValuePrefix string `json:"valuePrefix,omitempty"` 1641 // ForceSendFields is a list of field names (e.g. "Cookie") to unconditionally 1642 // include in API requests. By default, fields with empty or default values are 1643 // omitted from API requests. See 1644 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1645 // details. 1646 ForceSendFields []string `json:"-"` 1647 // NullFields is a list of field names (e.g. "Cookie") to include in API 1648 // requests with the JSON null value. By default, fields with empty values are 1649 // omitted from API requests. See 1650 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1651 NullFields []string `json:"-"` 1652 } 1653 1654 func (s *JwtLocation) MarshalJSON() ([]byte, error) { 1655 type NoMethod JwtLocation 1656 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1657 } 1658 1659 // LabelDescriptor: A description of a label. 1660 type LabelDescriptor struct { 1661 // Description: A human-readable description for the label. 1662 Description string `json:"description,omitempty"` 1663 // Key: The label key. 1664 Key string `json:"key,omitempty"` 1665 // ValueType: The type of data that can be assigned to the label. 1666 // 1667 // Possible values: 1668 // "STRING" - A variable-length string. This is the default. 1669 // "BOOL" - Boolean; true or false. 1670 // "INT64" - A 64-bit signed integer. 1671 ValueType string `json:"valueType,omitempty"` 1672 // ForceSendFields is a list of field names (e.g. "Description") to 1673 // unconditionally include in API requests. By default, fields with empty or 1674 // default values are omitted from API requests. See 1675 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1676 // details. 1677 ForceSendFields []string `json:"-"` 1678 // NullFields is a list of field names (e.g. "Description") to include in API 1679 // requests with the JSON null value. By default, fields with empty values are 1680 // omitted from API requests. See 1681 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1682 NullFields []string `json:"-"` 1683 } 1684 1685 func (s *LabelDescriptor) MarshalJSON() ([]byte, error) { 1686 type NoMethod LabelDescriptor 1687 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1688 } 1689 1690 // LogDescriptor: A description of a log type. Example in YAML format: - name: 1691 // library.googleapis.com/activity_history description: The history of 1692 // borrowing and returning library items. display_name: Activity labels: - key: 1693 // /customer_id description: Identifier of a library customer 1694 type LogDescriptor struct { 1695 // Description: A human-readable description of this log. This information 1696 // appears in the documentation and can contain details. 1697 Description string `json:"description,omitempty"` 1698 // DisplayName: The human-readable name for this log. This information appears 1699 // on the user interface and should be concise. 1700 DisplayName string `json:"displayName,omitempty"` 1701 // Labels: The set of labels that are available to describe a specific log 1702 // entry. Runtime requests that contain labels not specified here are 1703 // considered invalid. 1704 Labels []*LabelDescriptor `json:"labels,omitempty"` 1705 // Name: The name of the log. It must be less than 512 characters long and can 1706 // include the following characters: upper- and lower-case alphanumeric 1707 // characters [A-Za-z0-9], and punctuation characters including slash, 1708 // underscore, hyphen, period [/_-.]. 1709 Name string `json:"name,omitempty"` 1710 // ForceSendFields is a list of field names (e.g. "Description") to 1711 // unconditionally include in API requests. By default, fields with empty or 1712 // default values are omitted from API requests. See 1713 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1714 // details. 1715 ForceSendFields []string `json:"-"` 1716 // NullFields is a list of field names (e.g. "Description") to include in API 1717 // requests with the JSON null value. By default, fields with empty values are 1718 // omitted from API requests. See 1719 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1720 NullFields []string `json:"-"` 1721 } 1722 1723 func (s *LogDescriptor) MarshalJSON() ([]byte, error) { 1724 type NoMethod LogDescriptor 1725 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1726 } 1727 1728 // Logging: Logging configuration of the service. The following example shows 1729 // how to configure logs to be sent to the producer and consumer projects. In 1730 // the example, the `activity_history` log is sent to both the producer and 1731 // consumer projects, whereas the `purchase_history` log is only sent to the 1732 // producer project. monitored_resources: - type: library.googleapis.com/branch 1733 // labels: - key: /city description: The city where the library branch is 1734 // located in. - key: /name description: The name of the branch. logs: - name: 1735 // activity_history labels: - key: /customer_id - name: purchase_history 1736 // logging: producer_destinations: - monitored_resource: 1737 // library.googleapis.com/branch logs: - activity_history - purchase_history 1738 // consumer_destinations: - monitored_resource: library.googleapis.com/branch 1739 // logs: - activity_history 1740 type Logging struct { 1741 // ConsumerDestinations: Logging configurations for sending logs to the 1742 // consumer project. There can be multiple consumer destinations, each one must 1743 // have a different monitored resource type. A log can be used in at most one 1744 // consumer destination. 1745 ConsumerDestinations []*LoggingDestination `json:"consumerDestinations,omitempty"` 1746 // ProducerDestinations: Logging configurations for sending logs to the 1747 // producer project. There can be multiple producer destinations, each one must 1748 // have a different monitored resource type. A log can be used in at most one 1749 // producer destination. 1750 ProducerDestinations []*LoggingDestination `json:"producerDestinations,omitempty"` 1751 // ForceSendFields is a list of field names (e.g. "ConsumerDestinations") to 1752 // unconditionally include in API requests. By default, fields with empty or 1753 // default values are omitted from API requests. See 1754 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1755 // details. 1756 ForceSendFields []string `json:"-"` 1757 // NullFields is a list of field names (e.g. "ConsumerDestinations") to include 1758 // in API requests with the JSON null value. By default, fields with empty 1759 // values are omitted from API requests. See 1760 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1761 NullFields []string `json:"-"` 1762 } 1763 1764 func (s *Logging) MarshalJSON() ([]byte, error) { 1765 type NoMethod Logging 1766 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1767 } 1768 1769 // LoggingDestination: Configuration of a specific logging destination (the 1770 // producer project or the consumer project). 1771 type LoggingDestination struct { 1772 // Logs: Names of the logs to be sent to this destination. Each name must be 1773 // defined in the Service.logs section. If the log name is not a domain scoped 1774 // name, it will be automatically prefixed with the service name followed by 1775 // "/". 1776 Logs []string `json:"logs,omitempty"` 1777 // MonitoredResource: The monitored resource type. The type must be defined in 1778 // the Service.monitored_resources section. 1779 MonitoredResource string `json:"monitoredResource,omitempty"` 1780 // ForceSendFields is a list of field names (e.g. "Logs") to unconditionally 1781 // include in API requests. By default, fields with empty or default values are 1782 // omitted from API requests. See 1783 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1784 // details. 1785 ForceSendFields []string `json:"-"` 1786 // NullFields is a list of field names (e.g. "Logs") to include in API requests 1787 // with the JSON null value. By default, fields with empty values are omitted 1788 // from API requests. See 1789 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1790 NullFields []string `json:"-"` 1791 } 1792 1793 func (s *LoggingDestination) MarshalJSON() ([]byte, error) { 1794 type NoMethod LoggingDestination 1795 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1796 } 1797 1798 // LongRunning: Describes settings to use when generating API methods that use 1799 // the long-running operation pattern. All default values below are from those 1800 // used in the client library generators (e.g. Java 1801 // (https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). 1802 type LongRunning struct { 1803 // InitialPollDelay: Initial delay after which the first poll request will be 1804 // made. Default value: 5 seconds. 1805 InitialPollDelay string `json:"initialPollDelay,omitempty"` 1806 // MaxPollDelay: Maximum time between two subsequent poll requests. Default 1807 // value: 45 seconds. 1808 MaxPollDelay string `json:"maxPollDelay,omitempty"` 1809 // PollDelayMultiplier: Multiplier to gradually increase delay between 1810 // subsequent polls until it reaches max_poll_delay. Default value: 1.5. 1811 PollDelayMultiplier float64 `json:"pollDelayMultiplier,omitempty"` 1812 // TotalPollTimeout: Total polling timeout. Default value: 5 minutes. 1813 TotalPollTimeout string `json:"totalPollTimeout,omitempty"` 1814 // ForceSendFields is a list of field names (e.g. "InitialPollDelay") to 1815 // unconditionally include in API requests. By default, fields with empty or 1816 // default values are omitted from API requests. See 1817 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1818 // details. 1819 ForceSendFields []string `json:"-"` 1820 // NullFields is a list of field names (e.g. "InitialPollDelay") to include in 1821 // API requests with the JSON null value. By default, fields with empty values 1822 // are omitted from API requests. See 1823 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1824 NullFields []string `json:"-"` 1825 } 1826 1827 func (s *LongRunning) MarshalJSON() ([]byte, error) { 1828 type NoMethod LongRunning 1829 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1830 } 1831 1832 func (s *LongRunning) UnmarshalJSON(data []byte) error { 1833 type NoMethod LongRunning 1834 var s1 struct { 1835 PollDelayMultiplier gensupport.JSONFloat64 `json:"pollDelayMultiplier"` 1836 *NoMethod 1837 } 1838 s1.NoMethod = (*NoMethod)(s) 1839 if err := json.Unmarshal(data, &s1); err != nil { 1840 return err 1841 } 1842 s.PollDelayMultiplier = float64(s1.PollDelayMultiplier) 1843 return nil 1844 } 1845 1846 // Method: Method represents a method of an API interface. 1847 type Method struct { 1848 // Name: The simple name of this method. 1849 Name string `json:"name,omitempty"` 1850 // Options: Any metadata attached to the method. 1851 Options []*Option `json:"options,omitempty"` 1852 // RequestStreaming: If true, the request is streamed. 1853 RequestStreaming bool `json:"requestStreaming,omitempty"` 1854 // RequestTypeUrl: A URL of the input message type. 1855 RequestTypeUrl string `json:"requestTypeUrl,omitempty"` 1856 // ResponseStreaming: If true, the response is streamed. 1857 ResponseStreaming bool `json:"responseStreaming,omitempty"` 1858 // ResponseTypeUrl: The URL of the output message type. 1859 ResponseTypeUrl string `json:"responseTypeUrl,omitempty"` 1860 // Syntax: The source syntax of this method. 1861 // 1862 // Possible values: 1863 // "SYNTAX_PROTO2" - Syntax `proto2`. 1864 // "SYNTAX_PROTO3" - Syntax `proto3`. 1865 // "SYNTAX_EDITIONS" - Syntax `editions`. 1866 Syntax string `json:"syntax,omitempty"` 1867 // ForceSendFields is a list of field names (e.g. "Name") to unconditionally 1868 // include in API requests. By default, fields with empty or default values are 1869 // omitted from API requests. See 1870 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1871 // details. 1872 ForceSendFields []string `json:"-"` 1873 // NullFields is a list of field names (e.g. "Name") to include in API requests 1874 // with the JSON null value. By default, fields with empty values are omitted 1875 // from API requests. See 1876 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1877 NullFields []string `json:"-"` 1878 } 1879 1880 func (s *Method) MarshalJSON() ([]byte, error) { 1881 type NoMethod Method 1882 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1883 } 1884 1885 // MethodPolicy: Defines policies applying to an RPC method. 1886 type MethodPolicy struct { 1887 // RequestPolicies: Policies that are applicable to the request message. 1888 RequestPolicies []*FieldPolicy `json:"requestPolicies,omitempty"` 1889 // Selector: Selects a method to which these policies should be enforced, for 1890 // example, "google.pubsub.v1.Subscriber.CreateSubscription". Refer to selector 1891 // for syntax details. NOTE: This field must not be set in the proto 1892 // annotation. It will be automatically filled by the service config compiler . 1893 Selector string `json:"selector,omitempty"` 1894 // ForceSendFields is a list of field names (e.g. "RequestPolicies") to 1895 // unconditionally include in API requests. By default, fields with empty or 1896 // default values are omitted from API requests. See 1897 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1898 // details. 1899 ForceSendFields []string `json:"-"` 1900 // NullFields is a list of field names (e.g. "RequestPolicies") to include in 1901 // API requests with the JSON null value. By default, fields with empty values 1902 // are omitted from API requests. See 1903 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1904 NullFields []string `json:"-"` 1905 } 1906 1907 func (s *MethodPolicy) MarshalJSON() ([]byte, error) { 1908 type NoMethod MethodPolicy 1909 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1910 } 1911 1912 // MethodSettings: Describes the generator configuration for a method. 1913 type MethodSettings struct { 1914 // AutoPopulatedFields: List of top-level fields of the request message, that 1915 // should be automatically populated by the client libraries based on their 1916 // (google.api.field_info).format. Currently supported format: UUID4. Example 1917 // of a YAML configuration: publishing: method_settings: - selector: 1918 // google.example.v1.ExampleService.CreateExample auto_populated_fields: - 1919 // request_id 1920 AutoPopulatedFields []string `json:"autoPopulatedFields,omitempty"` 1921 // LongRunning: Describes settings to use for long-running operations when 1922 // generating API methods for RPCs. Complements RPCs that use the annotations 1923 // in google/longrunning/operations.proto. Example of a YAML configuration:: 1924 // publishing: method_settings: - selector: 1925 // google.cloud.speech.v2.Speech.BatchRecognize long_running: 1926 // initial_poll_delay: 60s # 1 minute poll_delay_multiplier: 1.5 1927 // max_poll_delay: 360s # 6 minutes total_poll_timeout: 54000s # 90 minutes 1928 LongRunning *LongRunning `json:"longRunning,omitempty"` 1929 // Selector: The fully qualified name of the method, for which the options 1930 // below apply. This is used to find the method to apply the options. Example: 1931 // publishing: method_settings: - selector: 1932 // google.storage.control.v2.StorageControl.CreateFolder # method settings for 1933 // CreateFolder... 1934 Selector string `json:"selector,omitempty"` 1935 // ForceSendFields is a list of field names (e.g. "AutoPopulatedFields") to 1936 // unconditionally include in API requests. By default, fields with empty or 1937 // default values are omitted from API requests. See 1938 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1939 // details. 1940 ForceSendFields []string `json:"-"` 1941 // NullFields is a list of field names (e.g. "AutoPopulatedFields") to include 1942 // in API requests with the JSON null value. By default, fields with empty 1943 // values are omitted from API requests. See 1944 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1945 NullFields []string `json:"-"` 1946 } 1947 1948 func (s *MethodSettings) MarshalJSON() ([]byte, error) { 1949 type NoMethod MethodSettings 1950 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1951 } 1952 1953 // MetricDescriptor: Defines a metric type and its schema. Once a metric 1954 // descriptor is created, deleting or altering it stops data collection and 1955 // makes the metric type's existing data unusable. 1956 type MetricDescriptor struct { 1957 // Description: A detailed description of the metric, which can be used in 1958 // documentation. 1959 Description string `json:"description,omitempty"` 1960 // DisplayName: A concise name for the metric, which can be displayed in user 1961 // interfaces. Use sentence case without an ending period, for example "Request 1962 // count". This field is optional but it is recommended to be set for any 1963 // metrics associated with user-visible concepts, such as Quota. 1964 DisplayName string `json:"displayName,omitempty"` 1965 // Labels: The set of labels that can be used to describe a specific instance 1966 // of this metric type. For example, the 1967 // `appengine.googleapis.com/http/server/response_latencies` metric type has a 1968 // label for the HTTP response code, `response_code`, so you can look at 1969 // latencies for successful responses or just for responses that failed. 1970 Labels []*LabelDescriptor `json:"labels,omitempty"` 1971 // LaunchStage: Optional. The launch stage of the metric definition. 1972 // 1973 // Possible values: 1974 // "LAUNCH_STAGE_UNSPECIFIED" - Do not use this default value. 1975 // "UNIMPLEMENTED" - The feature is not yet implemented. Users can not use 1976 // it. 1977 // "PRELAUNCH" - Prelaunch features are hidden from users and are only 1978 // visible internally. 1979 // "EARLY_ACCESS" - Early Access features are limited to a closed group of 1980 // testers. To use these features, you must sign up in advance and sign a 1981 // Trusted Tester agreement (which includes confidentiality provisions). These 1982 // features may be unstable, changed in backward-incompatible ways, and are not 1983 // guaranteed to be released. 1984 // "ALPHA" - Alpha is a limited availability test for releases before they 1985 // are cleared for widespread use. By Alpha, all significant design issues are 1986 // resolved and we are in the process of verifying functionality. Alpha 1987 // customers need to apply for access, agree to applicable terms, and have 1988 // their projects allowlisted. Alpha releases don't have to be feature 1989 // complete, no SLAs are provided, and there are no technical support 1990 // obligations, but they will be far enough along that customers can actually 1991 // use them in test environments or for limited-use tests -- just like they 1992 // would in normal production cases. 1993 // "BETA" - Beta is the point at which we are ready to open a release for any 1994 // customer to use. There are no SLA or technical support obligations in a Beta 1995 // release. Products will be complete from a feature perspective, but may have 1996 // some open outstanding issues. Beta releases are suitable for limited 1997 // production use cases. 1998 // "GA" - GA features are open to all developers and are considered stable 1999 // and fully qualified for production use. 2000 // "DEPRECATED" - Deprecated features are scheduled to be shut down and 2001 // removed. For more information, see the "Deprecation Policy" section of our 2002 // [Terms of Service](https://cloud.google.com/terms/) and the [Google Cloud 2003 // Platform Subject to the Deprecation 2004 // Policy](https://cloud.google.com/terms/deprecation) documentation. 2005 LaunchStage string `json:"launchStage,omitempty"` 2006 // Metadata: Optional. Metadata which can be used to guide usage of the metric. 2007 Metadata *MetricDescriptorMetadata `json:"metadata,omitempty"` 2008 // MetricKind: Whether the metric records instantaneous values, changes to a 2009 // value, etc. Some combinations of `metric_kind` and `value_type` might not be 2010 // supported. 2011 // 2012 // Possible values: 2013 // "METRIC_KIND_UNSPECIFIED" - Do not use this default value. 2014 // "GAUGE" - An instantaneous measurement of a value. 2015 // "DELTA" - The change in a value during a time interval. 2016 // "CUMULATIVE" - A value accumulated over a time interval. Cumulative 2017 // measurements in a time series should have the same start time and increasing 2018 // end times, until an event resets the cumulative value to zero and sets a new 2019 // start time for the following points. 2020 MetricKind string `json:"metricKind,omitempty"` 2021 // MonitoredResourceTypes: Read-only. If present, then a time series, which is 2022 // identified partially by a metric type and a MonitoredResourceDescriptor, 2023 // that is associated with this metric type can only be associated with one of 2024 // the monitored resource types listed here. 2025 MonitoredResourceTypes []string `json:"monitoredResourceTypes,omitempty"` 2026 // Name: The resource name of the metric descriptor. 2027 Name string `json:"name,omitempty"` 2028 // Type: The metric type, including its DNS name prefix. The type is not 2029 // URL-encoded. All user-defined metric types have the DNS name 2030 // `custom.googleapis.com` or `external.googleapis.com`. Metric types should 2031 // use a natural hierarchical grouping. For example: 2032 // "custom.googleapis.com/invoice/paid/amount" 2033 // "external.googleapis.com/prometheus/up" 2034 // "appengine.googleapis.com/http/server/response_latencies" 2035 Type string `json:"type,omitempty"` 2036 // Unit: The units in which the metric value is reported. It is only applicable 2037 // if the `value_type` is `INT64`, `DOUBLE`, or `DISTRIBUTION`. The `unit` 2038 // defines the representation of the stored metric values. Different systems 2039 // might scale the values to be more easily displayed (so a value of `0.02kBy` 2040 // _might_ be displayed as `20By`, and a value of `3523kBy` _might_ be 2041 // displayed as `3.5MBy`). However, if the `unit` is `kBy`, then the value of 2042 // the metric is always in thousands of bytes, no matter how it might be 2043 // displayed. If you want a custom metric to record the exact number of 2044 // CPU-seconds used by a job, you can create an `INT64 CUMULATIVE` metric whose 2045 // `unit` is `s{CPU}` (or equivalently `1s{CPU}` or just `s`). If the job uses 2046 // 12,005 CPU-seconds, then the value is written as `12005`. Alternatively, if 2047 // you want a custom metric to record data in a more granular way, you can 2048 // create a `DOUBLE CUMULATIVE` metric whose `unit` is `ks{CPU}`, and then 2049 // write the value `12.005` (which is `12005/1000`), or use `Kis{CPU}` and 2050 // write `11.723` (which is `12005/1024`). The supported units are a subset of 2051 // The Unified Code for Units of Measure (https://unitsofmeasure.org/ucum.html) 2052 // standard: **Basic units (UNIT)** * `bit` bit * `By` byte * `s` second * 2053 // `min` minute * `h` hour * `d` day * `1` dimensionless **Prefixes (PREFIX)** 2054 // * `k` kilo (10^3) * `M` mega (10^6) * `G` giga (10^9) * `T` tera (10^12) * 2055 // `P` peta (10^15) * `E` exa (10^18) * `Z` zetta (10^21) * `Y` yotta (10^24) * 2056 // `m` milli (10^-3) * `u` micro (10^-6) * `n` nano (10^-9) * `p` pico (10^-12) 2057 // * `f` femto (10^-15) * `a` atto (10^-18) * `z` zepto (10^-21) * `y` yocto 2058 // (10^-24) * `Ki` kibi (2^10) * `Mi` mebi (2^20) * `Gi` gibi (2^30) * `Ti` 2059 // tebi (2^40) * `Pi` pebi (2^50) **Grammar** The grammar also includes these 2060 // connectors: * `/` division or ratio (as an infix operator). For examples, 2061 // `kBy/{email}` or `MiBy/10ms` (although you should almost never have `/s` in 2062 // a metric `unit`; rates should always be computed at query time from the 2063 // underlying cumulative or delta value). * `.` multiplication or composition 2064 // (as an infix operator). For examples, `GBy.d` or `k{watt}.h`. The grammar 2065 // for a unit is as follows: Expression = Component { "." Component } { "/" 2066 // Component } ; Component = ( [ PREFIX ] UNIT | "%" ) [ Annotation ] | 2067 // Annotation | "1" ; Annotation = "{" NAME "}" ; Notes: * `Annotation` is just 2068 // a comment if it follows a `UNIT`. If the annotation is used alone, then the 2069 // unit is equivalent to `1`. For examples, `{request}/s == 1/s`, 2070 // `By{transmitted}/s == By/s`. * `NAME` is a sequence of non-blank printable 2071 // ASCII characters not containing `{` or `}`. * `1` represents a unitary 2072 // dimensionless unit (https://en.wikipedia.org/wiki/Dimensionless_quantity) of 2073 // 1, such as in `1/s`. It is typically used when none of the basic units are 2074 // appropriate. For example, "new users per day" can be represented as `1/d` or 2075 // `{new-users}/d` (and a metric value `5` would mean "5 new users). 2076 // Alternatively, "thousands of page views per day" would be represented as 2077 // `1000/d` or `k1/d` or `k{page_views}/d` (and a metric value of `5.3` would 2078 // mean "5300 page views per day"). * `%` represents dimensionless value of 2079 // 1/100, and annotates values giving a percentage (so the metric values are 2080 // typically in the range of 0..100, and a metric value `3` means "3 percent"). 2081 // * `10^2.%` indicates a metric contains a ratio, typically in the range 0..1, 2082 // that will be multiplied by 100 and displayed as a percentage (so a metric 2083 // value `0.03` means "3 percent"). 2084 Unit string `json:"unit,omitempty"` 2085 // ValueType: Whether the measurement is an integer, a floating-point number, 2086 // etc. Some combinations of `metric_kind` and `value_type` might not be 2087 // supported. 2088 // 2089 // Possible values: 2090 // "VALUE_TYPE_UNSPECIFIED" - Do not use this default value. 2091 // "BOOL" - The value is a boolean. This value type can be used only if the 2092 // metric kind is `GAUGE`. 2093 // "INT64" - The value is a signed 64-bit integer. 2094 // "DOUBLE" - The value is a double precision floating point number. 2095 // "STRING" - The value is a text string. This value type can be used only if 2096 // the metric kind is `GAUGE`. 2097 // "DISTRIBUTION" - The value is a `Distribution`. 2098 // "MONEY" - The value is money. 2099 ValueType string `json:"valueType,omitempty"` 2100 // ForceSendFields is a list of field names (e.g. "Description") to 2101 // unconditionally include in API requests. By default, fields with empty or 2102 // default values are omitted from API requests. See 2103 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 2104 // details. 2105 ForceSendFields []string `json:"-"` 2106 // NullFields is a list of field names (e.g. "Description") to include in API 2107 // requests with the JSON null value. By default, fields with empty values are 2108 // omitted from API requests. See 2109 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 2110 NullFields []string `json:"-"` 2111 } 2112 2113 func (s *MetricDescriptor) MarshalJSON() ([]byte, error) { 2114 type NoMethod MetricDescriptor 2115 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 2116 } 2117 2118 // MetricDescriptorMetadata: Additional annotations that can be used to guide 2119 // the usage of a metric. 2120 type MetricDescriptorMetadata struct { 2121 // IngestDelay: The delay of data points caused by ingestion. Data points older 2122 // than this age are guaranteed to be ingested and available to be read, 2123 // excluding data loss due to errors. 2124 IngestDelay string `json:"ingestDelay,omitempty"` 2125 // LaunchStage: Deprecated. Must use the MetricDescriptor.launch_stage instead. 2126 // 2127 // Possible values: 2128 // "LAUNCH_STAGE_UNSPECIFIED" - Do not use this default value. 2129 // "UNIMPLEMENTED" - The feature is not yet implemented. Users can not use 2130 // it. 2131 // "PRELAUNCH" - Prelaunch features are hidden from users and are only 2132 // visible internally. 2133 // "EARLY_ACCESS" - Early Access features are limited to a closed group of 2134 // testers. To use these features, you must sign up in advance and sign a 2135 // Trusted Tester agreement (which includes confidentiality provisions). These 2136 // features may be unstable, changed in backward-incompatible ways, and are not 2137 // guaranteed to be released. 2138 // "ALPHA" - Alpha is a limited availability test for releases before they 2139 // are cleared for widespread use. By Alpha, all significant design issues are 2140 // resolved and we are in the process of verifying functionality. Alpha 2141 // customers need to apply for access, agree to applicable terms, and have 2142 // their projects allowlisted. Alpha releases don't have to be feature 2143 // complete, no SLAs are provided, and there are no technical support 2144 // obligations, but they will be far enough along that customers can actually 2145 // use them in test environments or for limited-use tests -- just like they 2146 // would in normal production cases. 2147 // "BETA" - Beta is the point at which we are ready to open a release for any 2148 // customer to use. There are no SLA or technical support obligations in a Beta 2149 // release. Products will be complete from a feature perspective, but may have 2150 // some open outstanding issues. Beta releases are suitable for limited 2151 // production use cases. 2152 // "GA" - GA features are open to all developers and are considered stable 2153 // and fully qualified for production use. 2154 // "DEPRECATED" - Deprecated features are scheduled to be shut down and 2155 // removed. For more information, see the "Deprecation Policy" section of our 2156 // [Terms of Service](https://cloud.google.com/terms/) and the [Google Cloud 2157 // Platform Subject to the Deprecation 2158 // Policy](https://cloud.google.com/terms/deprecation) documentation. 2159 LaunchStage string `json:"launchStage,omitempty"` 2160 // SamplePeriod: The sampling period of metric data points. For metrics which 2161 // are written periodically, consecutive data points are stored at this time 2162 // interval, excluding data loss due to errors. Metrics with a higher 2163 // granularity have a smaller sampling period. 2164 SamplePeriod string `json:"samplePeriod,omitempty"` 2165 // ForceSendFields is a list of field names (e.g. "IngestDelay") to 2166 // unconditionally include in API requests. By default, fields with empty or 2167 // default values are omitted from API requests. See 2168 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 2169 // details. 2170 ForceSendFields []string `json:"-"` 2171 // NullFields is a list of field names (e.g. "IngestDelay") to include in API 2172 // requests with the JSON null value. By default, fields with empty values are 2173 // omitted from API requests. See 2174 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 2175 NullFields []string `json:"-"` 2176 } 2177 2178 func (s *MetricDescriptorMetadata) MarshalJSON() ([]byte, error) { 2179 type NoMethod MetricDescriptorMetadata 2180 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 2181 } 2182 2183 // MetricRule: Bind API methods to metrics. Binding a method to a metric causes 2184 // that metric's configured quota behaviors to apply to the method call. 2185 type MetricRule struct { 2186 // MetricCosts: Metrics to update when the selected methods are called, and the 2187 // associated cost applied to each metric. The key of the map is the metric 2188 // name, and the values are the amount increased for the metric against which 2189 // the quota limits are defined. The value must not be negative. 2190 MetricCosts map[string]string `json:"metricCosts,omitempty"` 2191 // Selector: Selects the methods to which this rule applies. Refer to selector 2192 // for syntax details. 2193 Selector string `json:"selector,omitempty"` 2194 // ForceSendFields is a list of field names (e.g. "MetricCosts") to 2195 // unconditionally include in API requests. By default, fields with empty or 2196 // default values are omitted from API requests. See 2197 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 2198 // details. 2199 ForceSendFields []string `json:"-"` 2200 // NullFields is a list of field names (e.g. "MetricCosts") to include in API 2201 // requests with the JSON null value. By default, fields with empty values are 2202 // omitted from API requests. See 2203 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 2204 NullFields []string `json:"-"` 2205 } 2206 2207 func (s *MetricRule) MarshalJSON() ([]byte, error) { 2208 type NoMethod MetricRule 2209 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 2210 } 2211 2212 // Mixin: Declares an API Interface to be included in this interface. The 2213 // including interface must redeclare all the methods from the included 2214 // interface, but documentation and options are inherited as follows: - If 2215 // after comment and whitespace stripping, the documentation string of the 2216 // redeclared method is empty, it will be inherited from the original method. - 2217 // Each annotation belonging to the service config (http, visibility) which is 2218 // not set in the redeclared method will be inherited. - If an http annotation 2219 // is inherited, the path pattern will be modified as follows. Any version 2220 // prefix will be replaced by the version of the including interface plus the 2221 // root path if specified. Example of a simple mixin: package google.acl.v1; 2222 // service AccessControl { // Get the underlying ACL object. rpc 2223 // GetAcl(GetAclRequest) returns (Acl) { option (google.api.http).get = 2224 // "/v1/{resource=**}:getAcl"; } } package google.storage.v2; service Storage { 2225 // // rpc GetAcl(GetAclRequest) returns (Acl); // Get a data record. rpc 2226 // GetData(GetDataRequest) returns (Data) { option (google.api.http).get = 2227 // "/v2/{resource=**}"; } } Example of a mixin configuration: apis: - name: 2228 // google.storage.v2.Storage mixins: - name: google.acl.v1.AccessControl The 2229 // mixin construct implies that all methods in `AccessControl` are also 2230 // declared with same name and request/response types in `Storage`. A 2231 // documentation generator or annotation processor will see the effective 2232 // `Storage.GetAcl` method after inherting documentation and annotations as 2233 // follows: service Storage { // Get the underlying ACL object. rpc 2234 // GetAcl(GetAclRequest) returns (Acl) { option (google.api.http).get = 2235 // "/v2/{resource=**}:getAcl"; } ... } Note how the version in the path pattern 2236 // changed from `v1` to `v2`. If the `root` field in the mixin is specified, it 2237 // should be a relative path under which inherited HTTP paths are placed. 2238 // Example: apis: - name: google.storage.v2.Storage mixins: - name: 2239 // google.acl.v1.AccessControl root: acls This implies the following inherited 2240 // HTTP annotation: service Storage { // Get the underlying ACL object. rpc 2241 // GetAcl(GetAclRequest) returns (Acl) { option (google.api.http).get = 2242 // "/v2/acls/{resource=**}:getAcl"; } ... } 2243 type Mixin struct { 2244 // Name: The fully qualified name of the interface which is included. 2245 Name string `json:"name,omitempty"` 2246 // Root: If non-empty specifies a path under which inherited HTTP paths are 2247 // rooted. 2248 Root string `json:"root,omitempty"` 2249 // ForceSendFields is a list of field names (e.g. "Name") to unconditionally 2250 // include in API requests. By default, fields with empty or default values are 2251 // omitted from API requests. See 2252 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 2253 // details. 2254 ForceSendFields []string `json:"-"` 2255 // NullFields is a list of field names (e.g. "Name") to include in API requests 2256 // with the JSON null value. By default, fields with empty values are omitted 2257 // from API requests. See 2258 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 2259 NullFields []string `json:"-"` 2260 } 2261 2262 func (s *Mixin) MarshalJSON() ([]byte, error) { 2263 type NoMethod Mixin 2264 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 2265 } 2266 2267 // MonitoredResourceDescriptor: An object that describes the schema of a 2268 // MonitoredResource object using a type name and a set of labels. For example, 2269 // the monitored resource descriptor for Google Compute Engine VM instances has 2270 // a type of "gce_instance" and specifies the use of the labels 2271 // "instance_id" and "zone" to identify particular VM instances. Different 2272 // APIs can support different monitored resource types. APIs generally provide 2273 // a `list` method that returns the monitored resource descriptors used by the 2274 // API. 2275 type MonitoredResourceDescriptor struct { 2276 // Description: Optional. A detailed description of the monitored resource type 2277 // that might be used in documentation. 2278 Description string `json:"description,omitempty"` 2279 // DisplayName: Optional. A concise name for the monitored resource type that 2280 // might be displayed in user interfaces. It should be a Title Cased Noun 2281 // Phrase, without any article or other determiners. For example, "Google 2282 // Cloud SQL Database". 2283 DisplayName string `json:"displayName,omitempty"` 2284 // Labels: Required. A set of labels used to describe instances of this 2285 // monitored resource type. For example, an individual Google Cloud SQL 2286 // database is identified by values for the labels "database_id" and 2287 // "zone". 2288 Labels []*LabelDescriptor `json:"labels,omitempty"` 2289 // LaunchStage: Optional. The launch stage of the monitored resource 2290 // definition. 2291 // 2292 // Possible values: 2293 // "LAUNCH_STAGE_UNSPECIFIED" - Do not use this default value. 2294 // "UNIMPLEMENTED" - The feature is not yet implemented. Users can not use 2295 // it. 2296 // "PRELAUNCH" - Prelaunch features are hidden from users and are only 2297 // visible internally. 2298 // "EARLY_ACCESS" - Early Access features are limited to a closed group of 2299 // testers. To use these features, you must sign up in advance and sign a 2300 // Trusted Tester agreement (which includes confidentiality provisions). These 2301 // features may be unstable, changed in backward-incompatible ways, and are not 2302 // guaranteed to be released. 2303 // "ALPHA" - Alpha is a limited availability test for releases before they 2304 // are cleared for widespread use. By Alpha, all significant design issues are 2305 // resolved and we are in the process of verifying functionality. Alpha 2306 // customers need to apply for access, agree to applicable terms, and have 2307 // their projects allowlisted. Alpha releases don't have to be feature 2308 // complete, no SLAs are provided, and there are no technical support 2309 // obligations, but they will be far enough along that customers can actually 2310 // use them in test environments or for limited-use tests -- just like they 2311 // would in normal production cases. 2312 // "BETA" - Beta is the point at which we are ready to open a release for any 2313 // customer to use. There are no SLA or technical support obligations in a Beta 2314 // release. Products will be complete from a feature perspective, but may have 2315 // some open outstanding issues. Beta releases are suitable for limited 2316 // production use cases. 2317 // "GA" - GA features are open to all developers and are considered stable 2318 // and fully qualified for production use. 2319 // "DEPRECATED" - Deprecated features are scheduled to be shut down and 2320 // removed. For more information, see the "Deprecation Policy" section of our 2321 // [Terms of Service](https://cloud.google.com/terms/) and the [Google Cloud 2322 // Platform Subject to the Deprecation 2323 // Policy](https://cloud.google.com/terms/deprecation) documentation. 2324 LaunchStage string `json:"launchStage,omitempty"` 2325 // Name: Optional. The resource name of the monitored resource descriptor: 2326 // "projects/{project_id}/monitoredResourceDescriptors/{type}" where {type} 2327 // is the value of the `type` field in this object and {project_id} is a 2328 // project ID that provides API-specific context for accessing the type. APIs 2329 // that do not use project information can use the resource name format 2330 // "monitoredResourceDescriptors/{type}". 2331 Name string `json:"name,omitempty"` 2332 // Type: Required. The monitored resource type. For example, the type 2333 // "cloudsql_database" represents databases in Google Cloud SQL. For a list 2334 // of types, see Monitored resource types 2335 // (https://cloud.google.com/monitoring/api/resources) and Logging resource 2336 // types (https://cloud.google.com/logging/docs/api/v2/resource-list). 2337 Type string `json:"type,omitempty"` 2338 // ForceSendFields is a list of field names (e.g. "Description") to 2339 // unconditionally include in API requests. By default, fields with empty or 2340 // default values are omitted from API requests. See 2341 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 2342 // details. 2343 ForceSendFields []string `json:"-"` 2344 // NullFields is a list of field names (e.g. "Description") to include in API 2345 // requests with the JSON null value. By default, fields with empty values are 2346 // omitted from API requests. See 2347 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 2348 NullFields []string `json:"-"` 2349 } 2350 2351 func (s *MonitoredResourceDescriptor) MarshalJSON() ([]byte, error) { 2352 type NoMethod MonitoredResourceDescriptor 2353 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 2354 } 2355 2356 // Monitoring: Monitoring configuration of the service. The example below shows 2357 // how to configure monitored resources and metrics for monitoring. In the 2358 // example, a monitored resource and two metrics are defined. The 2359 // `library.googleapis.com/book/returned_count` metric is sent to both producer 2360 // and consumer projects, whereas the `library.googleapis.com/book/num_overdue` 2361 // metric is only sent to the consumer project. monitored_resources: - type: 2362 // library.googleapis.com/Branch display_name: "Library Branch" description: "A 2363 // branch of a library." launch_stage: GA labels: - key: resource_container 2364 // description: "The Cloud container (ie. project id) for the Branch." - key: 2365 // location description: "The location of the library branch." - key: branch_id 2366 // description: "The id of the branch." metrics: - name: 2367 // library.googleapis.com/book/returned_count display_name: "Books Returned" 2368 // description: "The count of books that have been returned." launch_stage: GA 2369 // metric_kind: DELTA value_type: INT64 unit: "1" labels: - key: customer_id 2370 // description: "The id of the customer." - name: 2371 // library.googleapis.com/book/num_overdue display_name: "Books Overdue" 2372 // description: "The current number of overdue books." launch_stage: GA 2373 // metric_kind: GAUGE value_type: INT64 unit: "1" labels: - key: customer_id 2374 // description: "The id of the customer." monitoring: producer_destinations: - 2375 // monitored_resource: library.googleapis.com/Branch metrics: - 2376 // library.googleapis.com/book/returned_count consumer_destinations: - 2377 // monitored_resource: library.googleapis.com/Branch metrics: - 2378 // library.googleapis.com/book/returned_count - 2379 // library.googleapis.com/book/num_overdue 2380 type Monitoring struct { 2381 // ConsumerDestinations: Monitoring configurations for sending metrics to the 2382 // consumer project. There can be multiple consumer destinations. A monitored 2383 // resource type may appear in multiple monitoring destinations if different 2384 // aggregations are needed for different sets of metrics associated with that 2385 // monitored resource type. A monitored resource and metric pair may only be 2386 // used once in the Monitoring configuration. 2387 ConsumerDestinations []*MonitoringDestination `json:"consumerDestinations,omitempty"` 2388 // ProducerDestinations: Monitoring configurations for sending metrics to the 2389 // producer project. There can be multiple producer destinations. A monitored 2390 // resource type may appear in multiple monitoring destinations if different 2391 // aggregations are needed for different sets of metrics associated with that 2392 // monitored resource type. A monitored resource and metric pair may only be 2393 // used once in the Monitoring configuration. 2394 ProducerDestinations []*MonitoringDestination `json:"producerDestinations,omitempty"` 2395 // ForceSendFields is a list of field names (e.g. "ConsumerDestinations") to 2396 // unconditionally include in API requests. By default, fields with empty or 2397 // default values are omitted from API requests. See 2398 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 2399 // details. 2400 ForceSendFields []string `json:"-"` 2401 // NullFields is a list of field names (e.g. "ConsumerDestinations") to include 2402 // in API requests with the JSON null value. By default, fields with empty 2403 // values are omitted from API requests. See 2404 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 2405 NullFields []string `json:"-"` 2406 } 2407 2408 func (s *Monitoring) MarshalJSON() ([]byte, error) { 2409 type NoMethod Monitoring 2410 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 2411 } 2412 2413 // MonitoringDestination: Configuration of a specific monitoring destination 2414 // (the producer project or the consumer project). 2415 type MonitoringDestination struct { 2416 // Metrics: Types of the metrics to report to this monitoring destination. Each 2417 // type must be defined in Service.metrics section. 2418 Metrics []string `json:"metrics,omitempty"` 2419 // MonitoredResource: The monitored resource type. The type must be defined in 2420 // Service.monitored_resources section. 2421 MonitoredResource string `json:"monitoredResource,omitempty"` 2422 // ForceSendFields is a list of field names (e.g. "Metrics") to unconditionally 2423 // include in API requests. By default, fields with empty or default values are 2424 // omitted from API requests. See 2425 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 2426 // details. 2427 ForceSendFields []string `json:"-"` 2428 // NullFields is a list of field names (e.g. "Metrics") to include in API 2429 // requests with the JSON null value. By default, fields with empty values are 2430 // omitted from API requests. See 2431 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 2432 NullFields []string `json:"-"` 2433 } 2434 2435 func (s *MonitoringDestination) MarshalJSON() ([]byte, error) { 2436 type NoMethod MonitoringDestination 2437 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 2438 } 2439 2440 // NodeSettings: Settings for Node client libraries. 2441 type NodeSettings struct { 2442 // Common: Some settings. 2443 Common *CommonLanguageSettings `json:"common,omitempty"` 2444 // ForceSendFields is a list of field names (e.g. "Common") to unconditionally 2445 // include in API requests. By default, fields with empty or default values are 2446 // omitted from API requests. See 2447 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 2448 // details. 2449 ForceSendFields []string `json:"-"` 2450 // NullFields is a list of field names (e.g. "Common") to include in API 2451 // requests with the JSON null value. By default, fields with empty values are 2452 // omitted from API requests. See 2453 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 2454 NullFields []string `json:"-"` 2455 } 2456 2457 func (s *NodeSettings) MarshalJSON() ([]byte, error) { 2458 type NoMethod NodeSettings 2459 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 2460 } 2461 2462 // OAuthRequirements: OAuth scopes are a way to define data and permissions on 2463 // data. For example, there are scopes defined for "Read-only access to Google 2464 // Calendar" and "Access to Cloud Platform". Users can consent to a scope for 2465 // an application, giving it permission to access that data on their behalf. 2466 // OAuth scope specifications should be fairly coarse grained; a user will need 2467 // to see and understand the text description of what your scope means. In most 2468 // cases: use one or at most two OAuth scopes for an entire family of products. 2469 // If your product has multiple APIs, you should probably be sharing the OAuth 2470 // scope across all of those APIs. When you need finer grained OAuth consent 2471 // screens: talk with your product management about how developers will use 2472 // them in practice. Please note that even though each of the canonical scopes 2473 // is enough for a request to be accepted and passed to the backend, a request 2474 // can still fail due to the backend requiring additional scopes or 2475 // permissions. 2476 type OAuthRequirements struct { 2477 // CanonicalScopes: The list of publicly documented OAuth scopes that are 2478 // allowed access. An OAuth token containing any of these scopes will be 2479 // accepted. Example: canonical_scopes: 2480 // https://www.googleapis.com/auth/calendar, 2481 // https://www.googleapis.com/auth/calendar.read 2482 CanonicalScopes string `json:"canonicalScopes,omitempty"` 2483 // ForceSendFields is a list of field names (e.g. "CanonicalScopes") to 2484 // unconditionally include in API requests. By default, fields with empty or 2485 // default values are omitted from API requests. See 2486 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 2487 // details. 2488 ForceSendFields []string `json:"-"` 2489 // NullFields is a list of field names (e.g. "CanonicalScopes") to include in 2490 // API requests with the JSON null value. By default, fields with empty values 2491 // are omitted from API requests. See 2492 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 2493 NullFields []string `json:"-"` 2494 } 2495 2496 func (s *OAuthRequirements) MarshalJSON() ([]byte, error) { 2497 type NoMethod OAuthRequirements 2498 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 2499 } 2500 2501 // Operation: This resource represents a long-running operation that is the 2502 // result of a network API call. 2503 type Operation struct { 2504 // Done: If the value is `false`, it means the operation is still in progress. 2505 // If `true`, the operation is completed, and either `error` or `response` is 2506 // available. 2507 Done bool `json:"done,omitempty"` 2508 // Error: The error result of the operation in case of failure or cancellation. 2509 Error *Status `json:"error,omitempty"` 2510 // Metadata: Service-specific metadata associated with the operation. It 2511 // typically contains progress information and common metadata such as create 2512 // time. Some services might not provide such metadata. Any method that returns 2513 // a long-running operation should document the metadata type, if any. 2514 Metadata googleapi.RawMessage `json:"metadata,omitempty"` 2515 // Name: The server-assigned name, which is only unique within the same service 2516 // that originally returns it. If you use the default HTTP mapping, the `name` 2517 // should be a resource name ending with `operations/{unique_id}`. 2518 Name string `json:"name,omitempty"` 2519 // Response: The normal, successful response of the operation. If the original 2520 // method returns no data on success, such as `Delete`, the response is 2521 // `google.protobuf.Empty`. If the original method is standard 2522 // `Get`/`Create`/`Update`, the response should be the resource. For other 2523 // methods, the response should have the type `XxxResponse`, where `Xxx` is the 2524 // original method name. For example, if the original method name is 2525 // `TakeSnapshot()`, the inferred response type is `TakeSnapshotResponse`. 2526 Response googleapi.RawMessage `json:"response,omitempty"` 2527 2528 // ServerResponse contains the HTTP response code and headers from the server. 2529 googleapi.ServerResponse `json:"-"` 2530 // ForceSendFields is a list of field names (e.g. "Done") to unconditionally 2531 // include in API requests. By default, fields with empty or default values are 2532 // omitted from API requests. See 2533 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 2534 // details. 2535 ForceSendFields []string `json:"-"` 2536 // NullFields is a list of field names (e.g. "Done") to include in API requests 2537 // with the JSON null value. By default, fields with empty values are omitted 2538 // from API requests. See 2539 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 2540 NullFields []string `json:"-"` 2541 } 2542 2543 func (s *Operation) MarshalJSON() ([]byte, error) { 2544 type NoMethod Operation 2545 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 2546 } 2547 2548 // Option: A protocol buffer option, which can be attached to a message, field, 2549 // enumeration, etc. 2550 type Option struct { 2551 // Name: The option's name. For protobuf built-in options (options defined in 2552 // descriptor.proto), this is the short name. For example, "map_entry". For 2553 // custom options, it should be the fully-qualified name. For example, 2554 // "google.api.http". 2555 Name string `json:"name,omitempty"` 2556 // Value: The option's value packed in an Any message. If the value is a 2557 // primitive, the corresponding wrapper type defined in 2558 // google/protobuf/wrappers.proto should be used. If the value is an enum, it 2559 // should be stored as an int32 value using the google.protobuf.Int32Value 2560 // type. 2561 Value googleapi.RawMessage `json:"value,omitempty"` 2562 // ForceSendFields is a list of field names (e.g. "Name") to unconditionally 2563 // include in API requests. By default, fields with empty or default values are 2564 // omitted from API requests. See 2565 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 2566 // details. 2567 ForceSendFields []string `json:"-"` 2568 // NullFields is a list of field names (e.g. "Name") to include in API requests 2569 // with the JSON null value. By default, fields with empty values are omitted 2570 // from API requests. See 2571 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 2572 NullFields []string `json:"-"` 2573 } 2574 2575 func (s *Option) MarshalJSON() ([]byte, error) { 2576 type NoMethod Option 2577 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 2578 } 2579 2580 // Page: Represents a documentation page. A page can contain subpages to 2581 // represent nested documentation set structure. 2582 type Page struct { 2583 // Content: The Markdown content of the page. You can use (== include {path} 2584 // ==) to include content from a Markdown file. The content can be used to 2585 // produce the documentation page such as HTML format page. 2586 Content string `json:"content,omitempty"` 2587 // Name: The name of the page. It will be used as an identity of the page to 2588 // generate URI of the page, text of the link to this page in navigation, etc. 2589 // The full page name (start from the root page name to this page concatenated 2590 // with `.`) can be used as reference to the page in your documentation. For 2591 // example: pages: - name: Tutorial content: (== include tutorial.md ==) 2592 // subpages: - name: Java content: (== include tutorial_java.md ==) You can 2593 // reference `Java` page using Markdown reference link syntax: `Java`. 2594 Name string `json:"name,omitempty"` 2595 // Subpages: Subpages of this page. The order of subpages specified here will 2596 // be honored in the generated docset. 2597 Subpages []*Page `json:"subpages,omitempty"` 2598 // ForceSendFields is a list of field names (e.g. "Content") to unconditionally 2599 // include in API requests. By default, fields with empty or default values are 2600 // omitted from API requests. See 2601 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 2602 // details. 2603 ForceSendFields []string `json:"-"` 2604 // NullFields is a list of field names (e.g. "Content") to include in API 2605 // requests with the JSON null value. By default, fields with empty values are 2606 // omitted from API requests. See 2607 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 2608 NullFields []string `json:"-"` 2609 } 2610 2611 func (s *Page) MarshalJSON() ([]byte, error) { 2612 type NoMethod Page 2613 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 2614 } 2615 2616 // PhpSettings: Settings for Php client libraries. 2617 type PhpSettings struct { 2618 // Common: Some settings. 2619 Common *CommonLanguageSettings `json:"common,omitempty"` 2620 // ForceSendFields is a list of field names (e.g. "Common") to unconditionally 2621 // include in API requests. By default, fields with empty or default values are 2622 // omitted from API requests. See 2623 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 2624 // details. 2625 ForceSendFields []string `json:"-"` 2626 // NullFields is a list of field names (e.g. "Common") to include in API 2627 // requests with the JSON null value. By default, fields with empty values are 2628 // omitted from API requests. See 2629 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 2630 NullFields []string `json:"-"` 2631 } 2632 2633 func (s *PhpSettings) MarshalJSON() ([]byte, error) { 2634 type NoMethod PhpSettings 2635 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 2636 } 2637 2638 // Publishing: This message configures the settings for publishing Google Cloud 2639 // Client libraries (https://cloud.google.com/apis/docs/cloud-client-libraries) 2640 // generated from the service config. 2641 type Publishing struct { 2642 // ApiShortName: Used as a tracking tag when collecting data about the APIs 2643 // developer relations artifacts like docs, packages delivered to package 2644 // managers, etc. Example: "speech". 2645 ApiShortName string `json:"apiShortName,omitempty"` 2646 // CodeownerGithubTeams: GitHub teams to be added to CODEOWNERS in the 2647 // directory in GitHub containing source code for the client libraries for this 2648 // API. 2649 CodeownerGithubTeams []string `json:"codeownerGithubTeams,omitempty"` 2650 // DocTagPrefix: A prefix used in sample code when demarking regions to be 2651 // included in documentation. 2652 DocTagPrefix string `json:"docTagPrefix,omitempty"` 2653 // DocumentationUri: Link to product home page. Example: 2654 // https://cloud.google.com/asset-inventory/docs/overview 2655 DocumentationUri string `json:"documentationUri,omitempty"` 2656 // GithubLabel: GitHub label to apply to issues and pull requests opened for 2657 // this API. 2658 GithubLabel string `json:"githubLabel,omitempty"` 2659 // LibrarySettings: Client library settings. If the same version string appears 2660 // multiple times in this list, then the last one wins. Settings from earlier 2661 // settings with the same version string are discarded. 2662 LibrarySettings []*ClientLibrarySettings `json:"librarySettings,omitempty"` 2663 // MethodSettings: A list of API method settings, e.g. the behavior for methods 2664 // that use the long-running operation pattern. 2665 MethodSettings []*MethodSettings `json:"methodSettings,omitempty"` 2666 // NewIssueUri: Link to a *public* URI where users can report issues. Example: 2667 // https://issuetracker.google.com/issues/new?component=190865&template=1161103 2668 NewIssueUri string `json:"newIssueUri,omitempty"` 2669 // Organization: For whom the client library is being published. 2670 // 2671 // Possible values: 2672 // "CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED" - Not useful. 2673 // "CLOUD" - Google Cloud Platform Org. 2674 // "ADS" - Ads (Advertising) Org. 2675 // "PHOTOS" - Photos Org. 2676 // "STREET_VIEW" - Street View Org. 2677 // "SHOPPING" - Shopping Org. 2678 // "GEO" - Geo Org. 2679 // "GENERATIVE_AI" - Generative AI - https://developers.generativeai.google 2680 Organization string `json:"organization,omitempty"` 2681 // ProtoReferenceDocumentationUri: Optional link to proto reference 2682 // documentation. Example: 2683 // https://cloud.google.com/pubsub/lite/docs/reference/rpc 2684 ProtoReferenceDocumentationUri string `json:"protoReferenceDocumentationUri,omitempty"` 2685 // RestReferenceDocumentationUri: Optional link to REST reference 2686 // documentation. Example: 2687 // https://cloud.google.com/pubsub/lite/docs/reference/rest 2688 RestReferenceDocumentationUri string `json:"restReferenceDocumentationUri,omitempty"` 2689 // ForceSendFields is a list of field names (e.g. "ApiShortName") to 2690 // unconditionally include in API requests. By default, fields with empty or 2691 // default values are omitted from API requests. See 2692 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 2693 // details. 2694 ForceSendFields []string `json:"-"` 2695 // NullFields is a list of field names (e.g. "ApiShortName") to include in API 2696 // requests with the JSON null value. By default, fields with empty values are 2697 // omitted from API requests. See 2698 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 2699 NullFields []string `json:"-"` 2700 } 2701 2702 func (s *Publishing) MarshalJSON() ([]byte, error) { 2703 type NoMethod Publishing 2704 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 2705 } 2706 2707 // PythonSettings: Settings for Python client libraries. 2708 type PythonSettings struct { 2709 // Common: Some settings. 2710 Common *CommonLanguageSettings `json:"common,omitempty"` 2711 // ForceSendFields is a list of field names (e.g. "Common") to unconditionally 2712 // include in API requests. By default, fields with empty or default values are 2713 // omitted from API requests. See 2714 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 2715 // details. 2716 ForceSendFields []string `json:"-"` 2717 // NullFields is a list of field names (e.g. "Common") to include in API 2718 // requests with the JSON null value. By default, fields with empty values are 2719 // omitted from API requests. See 2720 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 2721 NullFields []string `json:"-"` 2722 } 2723 2724 func (s *PythonSettings) MarshalJSON() ([]byte, error) { 2725 type NoMethod PythonSettings 2726 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 2727 } 2728 2729 // Quota: Quota configuration helps to achieve fairness and budgeting in 2730 // service usage. The metric based quota configuration works this way: - The 2731 // service configuration defines a set of metrics. - For API calls, the 2732 // quota.metric_rules maps methods to metrics with corresponding costs. - The 2733 // quota.limits defines limits on the metrics, which will be used for quota 2734 // checks at runtime. An example quota configuration in yaml format: quota: 2735 // limits: - name: apiWriteQpsPerProject metric: 2736 // library.googleapis.com/write_calls unit: "1/min/{project}" # rate limit for 2737 // consumer projects values: STANDARD: 10000 (The metric rules bind all methods 2738 // to the read_calls metric, except for the UpdateBook and DeleteBook methods. 2739 // These two methods are mapped to the write_calls metric, with the UpdateBook 2740 // method consuming at twice rate as the DeleteBook method.) metric_rules: - 2741 // selector: "*" metric_costs: library.googleapis.com/read_calls: 1 - selector: 2742 // google.example.library.v1.LibraryService.UpdateBook metric_costs: 2743 // library.googleapis.com/write_calls: 2 - selector: 2744 // google.example.library.v1.LibraryService.DeleteBook metric_costs: 2745 // library.googleapis.com/write_calls: 1 Corresponding Metric definition: 2746 // metrics: - name: library.googleapis.com/read_calls display_name: Read 2747 // requests metric_kind: DELTA value_type: INT64 - name: 2748 // library.googleapis.com/write_calls display_name: Write requests metric_kind: 2749 // DELTA value_type: INT64 2750 type Quota struct { 2751 // Limits: List of QuotaLimit definitions for the service. 2752 Limits []*QuotaLimit `json:"limits,omitempty"` 2753 // MetricRules: List of MetricRule definitions, each one mapping a selected 2754 // method to one or more metrics. 2755 MetricRules []*MetricRule `json:"metricRules,omitempty"` 2756 // ForceSendFields is a list of field names (e.g. "Limits") to unconditionally 2757 // include in API requests. By default, fields with empty or default values are 2758 // omitted from API requests. See 2759 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 2760 // details. 2761 ForceSendFields []string `json:"-"` 2762 // NullFields is a list of field names (e.g. "Limits") to include in API 2763 // requests with the JSON null value. By default, fields with empty values are 2764 // omitted from API requests. See 2765 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 2766 NullFields []string `json:"-"` 2767 } 2768 2769 func (s *Quota) MarshalJSON() ([]byte, error) { 2770 type NoMethod Quota 2771 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 2772 } 2773 2774 // QuotaLimit: `QuotaLimit` defines a specific limit that applies over a 2775 // specified duration for a limit type. There can be at most one limit for a 2776 // duration and limit type combination defined within a `QuotaGroup`. 2777 type QuotaLimit struct { 2778 // DefaultLimit: Default number of tokens that can be consumed during the 2779 // specified duration. This is the number of tokens assigned when a client 2780 // application developer activates the service for his/her project. Specifying 2781 // a value of 0 will block all requests. This can be used if you are 2782 // provisioning quota to selected consumers and blocking others. Similarly, a 2783 // value of -1 will indicate an unlimited quota. No other negative values are 2784 // allowed. Used by group-based quotas only. 2785 DefaultLimit int64 `json:"defaultLimit,omitempty,string"` 2786 // Description: Optional. User-visible, extended description for this quota 2787 // limit. Should be used only when more context is needed to understand this 2788 // limit than provided by the limit's display name (see: `display_name`). 2789 Description string `json:"description,omitempty"` 2790 // DisplayName: User-visible display name for this limit. Optional. If not set, 2791 // the UI will provide a default display name based on the quota configuration. 2792 // This field can be used to override the default display name generated from 2793 // the configuration. 2794 DisplayName string `json:"displayName,omitempty"` 2795 // Duration: Duration of this limit in textual notation. Must be "100s" or 2796 // "1d". Used by group-based quotas only. 2797 Duration string `json:"duration,omitempty"` 2798 // FreeTier: Free tier value displayed in the Developers Console for this 2799 // limit. The free tier is the number of tokens that will be subtracted from 2800 // the billed amount when billing is enabled. This field can only be set on a 2801 // limit with duration "1d", in a billable group; it is invalid on any other 2802 // limit. If this field is not set, it defaults to 0, indicating that there is 2803 // no free tier for this service. Used by group-based quotas only. 2804 FreeTier int64 `json:"freeTier,omitempty,string"` 2805 // MaxLimit: Maximum number of tokens that can be consumed during the specified 2806 // duration. Client application developers can override the default limit up to 2807 // this maximum. If specified, this value cannot be set to a value less than 2808 // the default limit. If not specified, it is set to the default limit. To 2809 // allow clients to apply overrides with no upper bound, set this to -1, 2810 // indicating unlimited maximum quota. Used by group-based quotas only. 2811 MaxLimit int64 `json:"maxLimit,omitempty,string"` 2812 // Metric: The name of the metric this quota limit applies to. The quota limits 2813 // with the same metric will be checked together during runtime. The metric 2814 // must be defined within the service config. 2815 Metric string `json:"metric,omitempty"` 2816 // Name: Name of the quota limit. The name must be provided, and it must be 2817 // unique within the service. The name can only include alphanumeric characters 2818 // as well as '-'. The maximum length of the limit name is 64 characters. 2819 Name string `json:"name,omitempty"` 2820 // Unit: Specify the unit of the quota limit. It uses the same syntax as 2821 // Metric.unit. The supported unit kinds are determined by the quota backend 2822 // system. Here are some examples: * "1/min/{project}" for quota per minute per 2823 // project. Note: the order of unit components is insignificant. The "1" at the 2824 // beginning is required to follow the metric unit syntax. 2825 Unit string `json:"unit,omitempty"` 2826 // Values: Tiered limit values. You must specify this as a key:value pair, with 2827 // an integer value that is the maximum number of requests allowed for the 2828 // specified unit. Currently only STANDARD is supported. 2829 Values map[string]string `json:"values,omitempty"` 2830 // ForceSendFields is a list of field names (e.g. "DefaultLimit") to 2831 // unconditionally include in API requests. By default, fields with empty or 2832 // default values are omitted from API requests. See 2833 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 2834 // details. 2835 ForceSendFields []string `json:"-"` 2836 // NullFields is a list of field names (e.g. "DefaultLimit") to include in API 2837 // requests with the JSON null value. By default, fields with empty values are 2838 // omitted from API requests. See 2839 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 2840 NullFields []string `json:"-"` 2841 } 2842 2843 func (s *QuotaLimit) MarshalJSON() ([]byte, error) { 2844 type NoMethod QuotaLimit 2845 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 2846 } 2847 2848 // RubySettings: Settings for Ruby client libraries. 2849 type RubySettings struct { 2850 // Common: Some settings. 2851 Common *CommonLanguageSettings `json:"common,omitempty"` 2852 // ForceSendFields is a list of field names (e.g. "Common") to unconditionally 2853 // include in API requests. By default, fields with empty or default values are 2854 // omitted from API requests. See 2855 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 2856 // details. 2857 ForceSendFields []string `json:"-"` 2858 // NullFields is a list of field names (e.g. "Common") to include in API 2859 // requests with the JSON null value. By default, fields with empty values are 2860 // omitted from API requests. See 2861 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 2862 NullFields []string `json:"-"` 2863 } 2864 2865 func (s *RubySettings) MarshalJSON() ([]byte, error) { 2866 type NoMethod RubySettings 2867 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 2868 } 2869 2870 // Service: `Service` is the root object of Google API service configuration 2871 // (service config). It describes the basic information about a logical 2872 // service, such as the service name and the user-facing title, and delegates 2873 // other aspects to sub-sections. Each sub-section is either a proto message or 2874 // a repeated proto message that configures a specific aspect, such as auth. 2875 // For more information, see each proto message definition. Example: type: 2876 // google.api.Service name: calendar.googleapis.com title: Google Calendar API 2877 // apis: - name: google.calendar.v3.Calendar visibility: rules: - selector: 2878 // "google.calendar.v3.*" restriction: PREVIEW backend: rules: - selector: 2879 // "google.calendar.v3.*" address: calendar.example.com authentication: 2880 // providers: - id: google_calendar_auth jwks_uri: 2881 // https://www.googleapis.com/oauth2/v1/certs issuer: 2882 // https://securetoken.google.com rules: - selector: "*" requirements: 2883 // provider_id: google_calendar_auth 2884 type Service struct { 2885 // Apis: A list of API interfaces exported by this service. Only the `name` 2886 // field of the google.protobuf.Api needs to be provided by the configuration 2887 // author, as the remaining fields will be derived from the IDL during the 2888 // normalization process. It is an error to specify an API interface here which 2889 // cannot be resolved against the associated IDL files. 2890 Apis []*Api `json:"apis,omitempty"` 2891 // Authentication: Auth configuration. 2892 Authentication *Authentication `json:"authentication,omitempty"` 2893 // Backend: API backend configuration. 2894 Backend *Backend `json:"backend,omitempty"` 2895 // Billing: Billing configuration. 2896 Billing *Billing `json:"billing,omitempty"` 2897 // ConfigVersion: Obsolete. Do not use. This field has no semantic meaning. The 2898 // service config compiler always sets this field to `3`. 2899 ConfigVersion int64 `json:"configVersion,omitempty"` 2900 // Context: Context configuration. 2901 Context *Context `json:"context,omitempty"` 2902 // Control: Configuration for the service control plane. 2903 Control *Control `json:"control,omitempty"` 2904 // CustomError: Custom error configuration. 2905 CustomError *CustomError `json:"customError,omitempty"` 2906 // Documentation: Additional API documentation. 2907 Documentation *Documentation `json:"documentation,omitempty"` 2908 // Endpoints: Configuration for network endpoints. If this is empty, then an 2909 // endpoint with the same name as the service is automatically generated to 2910 // service all defined APIs. 2911 Endpoints []*Endpoint `json:"endpoints,omitempty"` 2912 // Enums: A list of all enum types included in this API service. Enums 2913 // referenced directly or indirectly by the `apis` are automatically included. 2914 // Enums which are not referenced but shall be included should be listed here 2915 // by name by the configuration author. Example: enums: - name: 2916 // google.someapi.v1.SomeEnum 2917 Enums []*Enum `json:"enums,omitempty"` 2918 // Http: HTTP configuration. 2919 Http *Http `json:"http,omitempty"` 2920 // Id: A unique ID for a specific instance of this message, typically assigned 2921 // by the client for tracking purpose. Must be no longer than 63 characters and 2922 // only lower case letters, digits, '.', '_' and '-' are allowed. If empty, the 2923 // server may choose to generate one instead. 2924 Id string `json:"id,omitempty"` 2925 // Logging: Logging configuration. 2926 Logging *Logging `json:"logging,omitempty"` 2927 // Logs: Defines the logs used by this service. 2928 Logs []*LogDescriptor `json:"logs,omitempty"` 2929 // Metrics: Defines the metrics used by this service. 2930 Metrics []*MetricDescriptor `json:"metrics,omitempty"` 2931 // MonitoredResources: Defines the monitored resources used by this service. 2932 // This is required by the Service.monitoring and Service.logging 2933 // configurations. 2934 MonitoredResources []*MonitoredResourceDescriptor `json:"monitoredResources,omitempty"` 2935 // Monitoring: Monitoring configuration. 2936 Monitoring *Monitoring `json:"monitoring,omitempty"` 2937 // Name: The service name, which is a DNS-like logical identifier for the 2938 // service, such as `calendar.googleapis.com`. The service name typically goes 2939 // through DNS verification to make sure the owner of the service also owns the 2940 // DNS name. 2941 Name string `json:"name,omitempty"` 2942 // ProducerProjectId: The Google project that owns this service. 2943 ProducerProjectId string `json:"producerProjectId,omitempty"` 2944 // Publishing: Settings for Google Cloud Client libraries 2945 // (https://cloud.google.com/apis/docs/cloud-client-libraries) generated from 2946 // APIs defined as protocol buffers. 2947 Publishing *Publishing `json:"publishing,omitempty"` 2948 // Quota: Quota configuration. 2949 Quota *Quota `json:"quota,omitempty"` 2950 // SourceInfo: Output only. The source information for this configuration if 2951 // available. 2952 SourceInfo *SourceInfo `json:"sourceInfo,omitempty"` 2953 // SystemParameters: System parameter configuration. 2954 SystemParameters *SystemParameters `json:"systemParameters,omitempty"` 2955 // SystemTypes: A list of all proto message types included in this API service. 2956 // It serves similar purpose as [google.api.Service.types], except that these 2957 // types are not needed by user-defined APIs. Therefore, they will not show up 2958 // in the generated discovery doc. This field should only be used to define 2959 // system APIs in ESF. 2960 SystemTypes []*Type `json:"systemTypes,omitempty"` 2961 // Title: The product title for this service, it is the name displayed in 2962 // Google Cloud Console. 2963 Title string `json:"title,omitempty"` 2964 // Types: A list of all proto message types included in this API service. Types 2965 // referenced directly or indirectly by the `apis` are automatically included. 2966 // Messages which are not referenced but shall be included, such as types used 2967 // by the `google.protobuf.Any` type, should be listed here by name by the 2968 // configuration author. Example: types: - name: google.protobuf.Int32 2969 Types []*Type `json:"types,omitempty"` 2970 // Usage: Configuration controlling usage of this service. 2971 Usage *Usage `json:"usage,omitempty"` 2972 // ForceSendFields is a list of field names (e.g. "Apis") to unconditionally 2973 // include in API requests. By default, fields with empty or default values are 2974 // omitted from API requests. See 2975 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 2976 // details. 2977 ForceSendFields []string `json:"-"` 2978 // NullFields is a list of field names (e.g. "Apis") to include in API requests 2979 // with the JSON null value. By default, fields with empty values are omitted 2980 // from API requests. See 2981 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 2982 NullFields []string `json:"-"` 2983 } 2984 2985 func (s *Service) MarshalJSON() ([]byte, error) { 2986 type NoMethod Service 2987 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 2988 } 2989 2990 // SourceContext: `SourceContext` represents information about the source of a 2991 // protobuf element, like the file in which it is defined. 2992 type SourceContext struct { 2993 // FileName: The path-qualified name of the .proto file that contained the 2994 // associated protobuf element. For example: 2995 // "google/protobuf/source_context.proto". 2996 FileName string `json:"fileName,omitempty"` 2997 // ForceSendFields is a list of field names (e.g. "FileName") to 2998 // unconditionally include in API requests. By default, fields with empty or 2999 // default values are omitted from API requests. See 3000 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 3001 // details. 3002 ForceSendFields []string `json:"-"` 3003 // NullFields is a list of field names (e.g. "FileName") to include in API 3004 // requests with the JSON null value. By default, fields with empty values are 3005 // omitted from API requests. See 3006 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 3007 NullFields []string `json:"-"` 3008 } 3009 3010 func (s *SourceContext) MarshalJSON() ([]byte, error) { 3011 type NoMethod SourceContext 3012 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 3013 } 3014 3015 // SourceInfo: Source information used to create a Service Config 3016 type SourceInfo struct { 3017 // SourceFiles: All files used during config generation. 3018 SourceFiles []googleapi.RawMessage `json:"sourceFiles,omitempty"` 3019 // ForceSendFields is a list of field names (e.g. "SourceFiles") to 3020 // unconditionally include in API requests. By default, fields with empty or 3021 // default values are omitted from API requests. See 3022 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 3023 // details. 3024 ForceSendFields []string `json:"-"` 3025 // NullFields is a list of field names (e.g. "SourceFiles") to include in API 3026 // requests with the JSON null value. By default, fields with empty values are 3027 // omitted from API requests. See 3028 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 3029 NullFields []string `json:"-"` 3030 } 3031 3032 func (s *SourceInfo) MarshalJSON() ([]byte, error) { 3033 type NoMethod SourceInfo 3034 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 3035 } 3036 3037 // Status: The `Status` type defines a logical error model that is suitable for 3038 // different programming environments, including REST APIs and RPC APIs. It is 3039 // used by gRPC (https://github.com/grpc). Each `Status` message contains three 3040 // pieces of data: error code, error message, and error details. You can find 3041 // out more about this error model and how to work with it in the API Design 3042 // Guide (https://cloud.google.com/apis/design/errors). 3043 type Status struct { 3044 // Code: The status code, which should be an enum value of google.rpc.Code. 3045 Code int64 `json:"code,omitempty"` 3046 // Details: A list of messages that carry the error details. There is a common 3047 // set of message types for APIs to use. 3048 Details []googleapi.RawMessage `json:"details,omitempty"` 3049 // Message: A developer-facing error message, which should be in English. Any 3050 // user-facing error message should be localized and sent in the 3051 // google.rpc.Status.details field, or localized by the client. 3052 Message string `json:"message,omitempty"` 3053 // ForceSendFields is a list of field names (e.g. "Code") to unconditionally 3054 // include in API requests. By default, fields with empty or default values are 3055 // omitted from API requests. See 3056 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 3057 // details. 3058 ForceSendFields []string `json:"-"` 3059 // NullFields is a list of field names (e.g. "Code") to include in API requests 3060 // with the JSON null value. By default, fields with empty values are omitted 3061 // from API requests. See 3062 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 3063 NullFields []string `json:"-"` 3064 } 3065 3066 func (s *Status) MarshalJSON() ([]byte, error) { 3067 type NoMethod Status 3068 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 3069 } 3070 3071 // SystemParameter: Define a parameter's name and location. The parameter may 3072 // be passed as either an HTTP header or a URL query parameter, and if both are 3073 // passed the behavior is implementation-dependent. 3074 type SystemParameter struct { 3075 // HttpHeader: Define the HTTP header name to use for the parameter. It is case 3076 // insensitive. 3077 HttpHeader string `json:"httpHeader,omitempty"` 3078 // Name: Define the name of the parameter, such as "api_key" . It is case 3079 // sensitive. 3080 Name string `json:"name,omitempty"` 3081 // UrlQueryParameter: Define the URL query parameter name to use for the 3082 // parameter. It is case sensitive. 3083 UrlQueryParameter string `json:"urlQueryParameter,omitempty"` 3084 // ForceSendFields is a list of field names (e.g. "HttpHeader") to 3085 // unconditionally include in API requests. By default, fields with empty or 3086 // default values are omitted from API requests. See 3087 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 3088 // details. 3089 ForceSendFields []string `json:"-"` 3090 // NullFields is a list of field names (e.g. "HttpHeader") to include in API 3091 // requests with the JSON null value. By default, fields with empty values are 3092 // omitted from API requests. See 3093 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 3094 NullFields []string `json:"-"` 3095 } 3096 3097 func (s *SystemParameter) MarshalJSON() ([]byte, error) { 3098 type NoMethod SystemParameter 3099 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 3100 } 3101 3102 // SystemParameterRule: Define a system parameter rule mapping system parameter 3103 // definitions to methods. 3104 type SystemParameterRule struct { 3105 // Parameters: Define parameters. Multiple names may be defined for a 3106 // parameter. For a given method call, only one of them should be used. If 3107 // multiple names are used the behavior is implementation-dependent. If none of 3108 // the specified names are present the behavior is parameter-dependent. 3109 Parameters []*SystemParameter `json:"parameters,omitempty"` 3110 // Selector: Selects the methods to which this rule applies. Use '*' to 3111 // indicate all methods in all APIs. Refer to selector for syntax details. 3112 Selector string `json:"selector,omitempty"` 3113 // ForceSendFields is a list of field names (e.g. "Parameters") to 3114 // unconditionally include in API requests. By default, fields with empty or 3115 // default values are omitted from API requests. See 3116 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 3117 // details. 3118 ForceSendFields []string `json:"-"` 3119 // NullFields is a list of field names (e.g. "Parameters") to include in API 3120 // requests with the JSON null value. By default, fields with empty values are 3121 // omitted from API requests. See 3122 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 3123 NullFields []string `json:"-"` 3124 } 3125 3126 func (s *SystemParameterRule) MarshalJSON() ([]byte, error) { 3127 type NoMethod SystemParameterRule 3128 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 3129 } 3130 3131 // SystemParameters: ### System parameter configuration A system parameter is a 3132 // special kind of parameter defined by the API system, not by an individual 3133 // API. It is typically mapped to an HTTP header and/or a URL query parameter. 3134 // This configuration specifies which methods change the names of the system 3135 // parameters. 3136 type SystemParameters struct { 3137 // Rules: Define system parameters. The parameters defined here will override 3138 // the default parameters implemented by the system. If this field is missing 3139 // from the service config, default system parameters will be used. Default 3140 // system parameters and names is implementation-dependent. Example: define api 3141 // key for all methods system_parameters rules: - selector: "*" parameters: - 3142 // name: api_key url_query_parameter: api_key Example: define 2 api key names 3143 // for a specific method. system_parameters rules: - selector: "/ListShelves" 3144 // parameters: - name: api_key http_header: Api-Key1 - name: api_key 3145 // http_header: Api-Key2 **NOTE:** All service configuration rules follow "last 3146 // one wins" order. 3147 Rules []*SystemParameterRule `json:"rules,omitempty"` 3148 // ForceSendFields is a list of field names (e.g. "Rules") to unconditionally 3149 // include in API requests. By default, fields with empty or default values are 3150 // omitted from API requests. See 3151 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 3152 // details. 3153 ForceSendFields []string `json:"-"` 3154 // NullFields is a list of field names (e.g. "Rules") to include in API 3155 // requests with the JSON null value. By default, fields with empty values are 3156 // omitted from API requests. See 3157 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 3158 NullFields []string `json:"-"` 3159 } 3160 3161 func (s *SystemParameters) MarshalJSON() ([]byte, error) { 3162 type NoMethod SystemParameters 3163 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 3164 } 3165 3166 // Type: A protocol buffer message type. 3167 type Type struct { 3168 // Edition: The source edition string, only valid when syntax is 3169 // SYNTAX_EDITIONS. 3170 Edition string `json:"edition,omitempty"` 3171 // Fields: The list of fields. 3172 Fields []*Field `json:"fields,omitempty"` 3173 // Name: The fully qualified message name. 3174 Name string `json:"name,omitempty"` 3175 // Oneofs: The list of types appearing in `oneof` definitions in this type. 3176 Oneofs []string `json:"oneofs,omitempty"` 3177 // Options: The protocol buffer options. 3178 Options []*Option `json:"options,omitempty"` 3179 // SourceContext: The source context. 3180 SourceContext *SourceContext `json:"sourceContext,omitempty"` 3181 // Syntax: The source syntax. 3182 // 3183 // Possible values: 3184 // "SYNTAX_PROTO2" - Syntax `proto2`. 3185 // "SYNTAX_PROTO3" - Syntax `proto3`. 3186 // "SYNTAX_EDITIONS" - Syntax `editions`. 3187 Syntax string `json:"syntax,omitempty"` 3188 // ForceSendFields is a list of field names (e.g. "Edition") to unconditionally 3189 // include in API requests. By default, fields with empty or default values are 3190 // omitted from API requests. See 3191 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 3192 // details. 3193 ForceSendFields []string `json:"-"` 3194 // NullFields is a list of field names (e.g. "Edition") to include in API 3195 // requests with the JSON null value. By default, fields with empty values are 3196 // omitted from API requests. See 3197 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 3198 NullFields []string `json:"-"` 3199 } 3200 3201 func (s *Type) MarshalJSON() ([]byte, error) { 3202 type NoMethod Type 3203 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 3204 } 3205 3206 // Usage: Configuration controlling usage of a service. 3207 type Usage struct { 3208 // ProducerNotificationChannel: The full resource name of a channel used for 3209 // sending notifications to the service producer. Google Service Management 3210 // currently only supports Google Cloud Pub/Sub 3211 // (https://cloud.google.com/pubsub) as a notification channel. To use Google 3212 // Cloud Pub/Sub as the channel, this must be the name of a Cloud Pub/Sub topic 3213 // that uses the Cloud Pub/Sub topic name format documented in 3214 // https://cloud.google.com/pubsub/docs/overview. 3215 ProducerNotificationChannel string `json:"producerNotificationChannel,omitempty"` 3216 // Requirements: Requirements that must be satisfied before a consumer project 3217 // can use the service. Each requirement is of the form /; for example 3218 // 'serviceusage.googleapis.com/billing-enabled'. For Google APIs, a Terms of 3219 // Service requirement must be included here. Google Cloud APIs must include 3220 // "serviceusage.googleapis.com/tos/cloud". Other Google APIs should include 3221 // "serviceusage.googleapis.com/tos/universal". Additional ToS can be included 3222 // based on the business needs. 3223 Requirements []string `json:"requirements,omitempty"` 3224 // Rules: A list of usage rules that apply to individual API methods. **NOTE:** 3225 // All service configuration rules follow "last one wins" order. 3226 Rules []*UsageRule `json:"rules,omitempty"` 3227 // ForceSendFields is a list of field names (e.g. 3228 // "ProducerNotificationChannel") to unconditionally include in API requests. 3229 // By default, fields with empty or default values are omitted from API 3230 // requests. See https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields 3231 // for more details. 3232 ForceSendFields []string `json:"-"` 3233 // NullFields is a list of field names (e.g. "ProducerNotificationChannel") to 3234 // include in API requests with the JSON null value. By default, fields with 3235 // empty values are omitted from API requests. See 3236 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 3237 NullFields []string `json:"-"` 3238 } 3239 3240 func (s *Usage) MarshalJSON() ([]byte, error) { 3241 type NoMethod Usage 3242 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 3243 } 3244 3245 // UsageRule: Usage configuration rules for the service. NOTE: Under 3246 // development. Use this rule to configure unregistered calls for the service. 3247 // Unregistered calls are calls that do not contain consumer project identity. 3248 // (Example: calls that do not contain an API key). By default, API methods do 3249 // not allow unregistered calls, and each method call must be identified by a 3250 // consumer project identity. Use this rule to allow/disallow unregistered 3251 // calls. Example of an API that wants to allow unregistered calls for entire 3252 // service. usage: rules: - selector: "*" allow_unregistered_calls: true 3253 // Example of a method that wants to allow unregistered calls. usage: rules: - 3254 // selector: "google.example.library.v1.LibraryService.CreateBook" 3255 // allow_unregistered_calls: true 3256 type UsageRule struct { 3257 // AllowUnregisteredCalls: If true, the selected method allows unregistered 3258 // calls, e.g. calls that don't identify any user or application. 3259 AllowUnregisteredCalls bool `json:"allowUnregisteredCalls,omitempty"` 3260 // Selector: Selects the methods to which this rule applies. Use '*' to 3261 // indicate all methods in all APIs. Refer to selector for syntax details. 3262 Selector string `json:"selector,omitempty"` 3263 // SkipServiceControl: If true, the selected method should skip service control 3264 // and the control plane features, such as quota and billing, will not be 3265 // available. This flag is used by Google Cloud Endpoints to bypass checks for 3266 // internal methods, such as service health check methods. 3267 SkipServiceControl bool `json:"skipServiceControl,omitempty"` 3268 // ForceSendFields is a list of field names (e.g. "AllowUnregisteredCalls") to 3269 // unconditionally include in API requests. By default, fields with empty or 3270 // default values are omitted from API requests. See 3271 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 3272 // details. 3273 ForceSendFields []string `json:"-"` 3274 // NullFields is a list of field names (e.g. "AllowUnregisteredCalls") to 3275 // include in API requests with the JSON null value. By default, fields with 3276 // empty values are omitted from API requests. See 3277 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 3278 NullFields []string `json:"-"` 3279 } 3280 3281 func (s *UsageRule) MarshalJSON() ([]byte, error) { 3282 type NoMethod UsageRule 3283 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 3284 } 3285 3286 // V1Beta1BatchCreateProducerOverridesResponse: Response message for 3287 // BatchCreateProducerOverrides 3288 type V1Beta1BatchCreateProducerOverridesResponse struct { 3289 // Overrides: The overrides that were created. 3290 Overrides []*V1Beta1QuotaOverride `json:"overrides,omitempty"` 3291 // ForceSendFields is a list of field names (e.g. "Overrides") to 3292 // unconditionally include in API requests. By default, fields with empty or 3293 // default values are omitted from API requests. See 3294 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 3295 // details. 3296 ForceSendFields []string `json:"-"` 3297 // NullFields is a list of field names (e.g. "Overrides") to include in API 3298 // requests with the JSON null value. By default, fields with empty values are 3299 // omitted from API requests. See 3300 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 3301 NullFields []string `json:"-"` 3302 } 3303 3304 func (s *V1Beta1BatchCreateProducerOverridesResponse) MarshalJSON() ([]byte, error) { 3305 type NoMethod V1Beta1BatchCreateProducerOverridesResponse 3306 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 3307 } 3308 3309 // V1Beta1ConsumerQuotaLimit: Consumer quota settings for a quota limit. 3310 type V1Beta1ConsumerQuotaLimit struct { 3311 // IsPrecise: Whether this limit is precise or imprecise. 3312 IsPrecise bool `json:"isPrecise,omitempty"` 3313 // Metric: The name of the parent metric of this limit. An example name would 3314 // be: `compute.googleapis.com/cpus` 3315 Metric string `json:"metric,omitempty"` 3316 // Name: The resource name of the quota limit. An example name would be: 3317 // `services/compute.googleapis.com/projects/123/consumerQuotaMetrics/compute.go 3318 // ogleapis.com%2Fcpus/limits/%2Fproject%2Fregion` The resource name is 3319 // intended to be opaque and should not be parsed for its component strings, 3320 // since its representation could change in the future. 3321 Name string `json:"name,omitempty"` 3322 // QuotaBuckets: Summary of the enforced quota buckets, organized by quota 3323 // dimension, ordered from least specific to most specific (for example, the 3324 // global default bucket, with no quota dimensions, will always appear first). 3325 QuotaBuckets []*V1Beta1QuotaBucket `json:"quotaBuckets,omitempty"` 3326 // SupportedLocations: List of all supported locations. This field is present 3327 // only if the limit has a {region} or {zone} dimension. 3328 SupportedLocations []string `json:"supportedLocations,omitempty"` 3329 // Unit: The limit unit. An example unit would be: `1/{project}/{region}` Note 3330 // that `{project}` and `{region}` are not placeholders in this example; the 3331 // literal characters `{` and `}` occur in the string. 3332 Unit string `json:"unit,omitempty"` 3333 3334 // ServerResponse contains the HTTP response code and headers from the server. 3335 googleapi.ServerResponse `json:"-"` 3336 // ForceSendFields is a list of field names (e.g. "IsPrecise") to 3337 // unconditionally include in API requests. By default, fields with empty or 3338 // default values are omitted from API requests. See 3339 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 3340 // details. 3341 ForceSendFields []string `json:"-"` 3342 // NullFields is a list of field names (e.g. "IsPrecise") to include in API 3343 // requests with the JSON null value. By default, fields with empty values are 3344 // omitted from API requests. See 3345 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 3346 NullFields []string `json:"-"` 3347 } 3348 3349 func (s *V1Beta1ConsumerQuotaLimit) MarshalJSON() ([]byte, error) { 3350 type NoMethod V1Beta1ConsumerQuotaLimit 3351 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 3352 } 3353 3354 // V1Beta1ConsumerQuotaMetric: Consumer quota settings for a quota metric. 3355 type V1Beta1ConsumerQuotaMetric struct { 3356 // ConsumerQuotaLimits: The consumer quota for each quota limit defined on the 3357 // metric. 3358 ConsumerQuotaLimits []*V1Beta1ConsumerQuotaLimit `json:"consumerQuotaLimits,omitempty"` 3359 // DescendantConsumerQuotaLimits: The quota limits targeting the descendant 3360 // containers of the consumer in request. If the consumer in request is of type 3361 // `organizations` or `folders`, the field will list per-project limits in the 3362 // metric; if the consumer in request is of type `project`, the field will be 3363 // empty. The `quota_buckets` field of each descendant consumer quota limit 3364 // will not be populated. 3365 DescendantConsumerQuotaLimits []*V1Beta1ConsumerQuotaLimit `json:"descendantConsumerQuotaLimits,omitempty"` 3366 // DisplayName: The display name of the metric. An example name would be: 3367 // "CPUs" 3368 DisplayName string `json:"displayName,omitempty"` 3369 // Metric: The name of the metric. An example name would be: 3370 // `compute.googleapis.com/cpus` 3371 Metric string `json:"metric,omitempty"` 3372 // Name: The resource name of the quota settings on this metric for this 3373 // consumer. An example name would be: 3374 // `services/serviceconsumermanagement.googleapis.com/projects/123/consumerQuota 3375 // Metrics/compute.googleapis.com%2Fcpus` The resource name is intended to be 3376 // opaque and should not be parsed for its component strings, since its 3377 // representation could change in the future. 3378 Name string `json:"name,omitempty"` 3379 // Unit: The units in which the metric value is reported. 3380 Unit string `json:"unit,omitempty"` 3381 3382 // ServerResponse contains the HTTP response code and headers from the server. 3383 googleapi.ServerResponse `json:"-"` 3384 // ForceSendFields is a list of field names (e.g. "ConsumerQuotaLimits") to 3385 // unconditionally include in API requests. By default, fields with empty or 3386 // default values are omitted from API requests. See 3387 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 3388 // details. 3389 ForceSendFields []string `json:"-"` 3390 // NullFields is a list of field names (e.g. "ConsumerQuotaLimits") to include 3391 // in API requests with the JSON null value. By default, fields with empty 3392 // values are omitted from API requests. See 3393 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 3394 NullFields []string `json:"-"` 3395 } 3396 3397 func (s *V1Beta1ConsumerQuotaMetric) MarshalJSON() ([]byte, error) { 3398 type NoMethod V1Beta1ConsumerQuotaMetric 3399 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 3400 } 3401 3402 // V1Beta1DisableConsumerResponse: Response message for the `DisableConsumer` 3403 // method. This response message is assigned to the `response` field of the 3404 // returned Operation when that operation is done. 3405 type V1Beta1DisableConsumerResponse struct { 3406 } 3407 3408 // V1Beta1EnableConsumerResponse: Response message for the `EnableConsumer` 3409 // method. This response message is assigned to the `response` field of the 3410 // returned Operation when that operation is done. 3411 type V1Beta1EnableConsumerResponse struct { 3412 } 3413 3414 // V1Beta1GenerateServiceIdentityResponse: Response message for the 3415 // `GenerateServiceIdentity` method. This response message is assigned to the 3416 // `response` field of the returned Operation when that operation is done. 3417 type V1Beta1GenerateServiceIdentityResponse struct { 3418 // Identity: ServiceIdentity that was created or retrieved. 3419 Identity *V1Beta1ServiceIdentity `json:"identity,omitempty"` 3420 // ForceSendFields is a list of field names (e.g. "Identity") to 3421 // unconditionally include in API requests. By default, fields with empty or 3422 // default values are omitted from API requests. See 3423 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 3424 // details. 3425 ForceSendFields []string `json:"-"` 3426 // NullFields is a list of field names (e.g. "Identity") to include in API 3427 // requests with the JSON null value. By default, fields with empty values are 3428 // omitted from API requests. See 3429 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 3430 NullFields []string `json:"-"` 3431 } 3432 3433 func (s *V1Beta1GenerateServiceIdentityResponse) MarshalJSON() ([]byte, error) { 3434 type NoMethod V1Beta1GenerateServiceIdentityResponse 3435 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 3436 } 3437 3438 // V1Beta1ImportProducerOverridesRequest: Request message for 3439 // ImportProducerOverrides 3440 type V1Beta1ImportProducerOverridesRequest struct { 3441 // Force: Whether to force the creation of the quota overrides. Setting the 3442 // force parameter to 'true' ignores all quota safety checks that would fail 3443 // the request. QuotaSafetyCheck lists all such validations. 3444 Force bool `json:"force,omitempty"` 3445 // ForceJustification: If force option is set to true, force_justification is 3446 // suggested to be set to log the reason in audit logs. 3447 ForceJustification string `json:"forceJustification,omitempty"` 3448 // ForceOnly: The list of quota safety checks to ignore before the override 3449 // mutation. Unlike 'force' field that ignores all the quota safety checks, the 3450 // 'force_only' field ignores only the specified checks; other checks are still 3451 // enforced. The 'force' and 'force_only' fields cannot both be set. 3452 // 3453 // Possible values: 3454 // "QUOTA_SAFETY_CHECK_UNSPECIFIED" - Unspecified quota safety check. 3455 // "LIMIT_DECREASE_BELOW_USAGE" - Validates that a quota mutation would not 3456 // cause the consumer's effective limit to be lower than the consumer's quota 3457 // usage. 3458 // "LIMIT_DECREASE_PERCENTAGE_TOO_HIGH" - Validates that a quota mutation 3459 // would not cause the consumer's effective limit to decrease by more than 10 3460 // percent. 3461 ForceOnly []string `json:"forceOnly,omitempty"` 3462 // InlineSource: The import data is specified in the request message itself 3463 InlineSource *V1Beta1OverrideInlineSource `json:"inlineSource,omitempty"` 3464 // ForceSendFields is a list of field names (e.g. "Force") to unconditionally 3465 // include in API requests. By default, fields with empty or default values are 3466 // omitted from API requests. See 3467 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 3468 // details. 3469 ForceSendFields []string `json:"-"` 3470 // NullFields is a list of field names (e.g. "Force") to include in API 3471 // requests with the JSON null value. By default, fields with empty values are 3472 // omitted from API requests. See 3473 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 3474 NullFields []string `json:"-"` 3475 } 3476 3477 func (s *V1Beta1ImportProducerOverridesRequest) MarshalJSON() ([]byte, error) { 3478 type NoMethod V1Beta1ImportProducerOverridesRequest 3479 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 3480 } 3481 3482 // V1Beta1ImportProducerOverridesResponse: Response message for 3483 // ImportProducerOverrides 3484 type V1Beta1ImportProducerOverridesResponse struct { 3485 // Overrides: The overrides that were created from the imported data. 3486 Overrides []*V1Beta1QuotaOverride `json:"overrides,omitempty"` 3487 // ForceSendFields is a list of field names (e.g. "Overrides") to 3488 // unconditionally include in API requests. By default, fields with empty or 3489 // default values are omitted from API requests. See 3490 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 3491 // details. 3492 ForceSendFields []string `json:"-"` 3493 // NullFields is a list of field names (e.g. "Overrides") to include in API 3494 // requests with the JSON null value. By default, fields with empty values are 3495 // omitted from API requests. See 3496 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 3497 NullFields []string `json:"-"` 3498 } 3499 3500 func (s *V1Beta1ImportProducerOverridesResponse) MarshalJSON() ([]byte, error) { 3501 type NoMethod V1Beta1ImportProducerOverridesResponse 3502 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 3503 } 3504 3505 // V1Beta1ImportProducerQuotaPoliciesResponse: Response message for 3506 // ImportProducerQuotaPolicies 3507 type V1Beta1ImportProducerQuotaPoliciesResponse struct { 3508 // Policies: The policies that were created from the imported data. 3509 Policies []*V1Beta1ProducerQuotaPolicy `json:"policies,omitempty"` 3510 // ForceSendFields is a list of field names (e.g. "Policies") to 3511 // unconditionally include in API requests. By default, fields with empty or 3512 // default values are omitted from API requests. See 3513 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 3514 // details. 3515 ForceSendFields []string `json:"-"` 3516 // NullFields is a list of field names (e.g. "Policies") to include in API 3517 // requests with the JSON null value. By default, fields with empty values are 3518 // omitted from API requests. See 3519 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 3520 NullFields []string `json:"-"` 3521 } 3522 3523 func (s *V1Beta1ImportProducerQuotaPoliciesResponse) MarshalJSON() ([]byte, error) { 3524 type NoMethod V1Beta1ImportProducerQuotaPoliciesResponse 3525 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 3526 } 3527 3528 // V1Beta1ListConsumerQuotaMetricsResponse: Response message for 3529 // ListConsumerQuotaMetrics. 3530 type V1Beta1ListConsumerQuotaMetricsResponse struct { 3531 // Metrics: Quota settings for the consumer, organized by quota metric. 3532 Metrics []*V1Beta1ConsumerQuotaMetric `json:"metrics,omitempty"` 3533 // NextPageToken: Token identifying which result to start with; returned by a 3534 // previous list call. 3535 NextPageToken string `json:"nextPageToken,omitempty"` 3536 3537 // ServerResponse contains the HTTP response code and headers from the server. 3538 googleapi.ServerResponse `json:"-"` 3539 // ForceSendFields is a list of field names (e.g. "Metrics") to unconditionally 3540 // include in API requests. By default, fields with empty or default values are 3541 // omitted from API requests. See 3542 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 3543 // details. 3544 ForceSendFields []string `json:"-"` 3545 // NullFields is a list of field names (e.g. "Metrics") to include in API 3546 // requests with the JSON null value. By default, fields with empty values are 3547 // omitted from API requests. See 3548 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 3549 NullFields []string `json:"-"` 3550 } 3551 3552 func (s *V1Beta1ListConsumerQuotaMetricsResponse) MarshalJSON() ([]byte, error) { 3553 type NoMethod V1Beta1ListConsumerQuotaMetricsResponse 3554 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 3555 } 3556 3557 // V1Beta1ListProducerOverridesResponse: Response message for 3558 // ListProducerOverrides. 3559 type V1Beta1ListProducerOverridesResponse struct { 3560 // NextPageToken: Token identifying which result to start with; returned by a 3561 // previous list call. 3562 NextPageToken string `json:"nextPageToken,omitempty"` 3563 // Overrides: Producer overrides on this limit. 3564 Overrides []*V1Beta1QuotaOverride `json:"overrides,omitempty"` 3565 3566 // ServerResponse contains the HTTP response code and headers from the server. 3567 googleapi.ServerResponse `json:"-"` 3568 // ForceSendFields is a list of field names (e.g. "NextPageToken") to 3569 // unconditionally include in API requests. By default, fields with empty or 3570 // default values are omitted from API requests. See 3571 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 3572 // details. 3573 ForceSendFields []string `json:"-"` 3574 // NullFields is a list of field names (e.g. "NextPageToken") to include in API 3575 // requests with the JSON null value. By default, fields with empty values are 3576 // omitted from API requests. See 3577 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 3578 NullFields []string `json:"-"` 3579 } 3580 3581 func (s *V1Beta1ListProducerOverridesResponse) MarshalJSON() ([]byte, error) { 3582 type NoMethod V1Beta1ListProducerOverridesResponse 3583 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 3584 } 3585 3586 // V1Beta1OverrideInlineSource: Import data embedded in the request message 3587 type V1Beta1OverrideInlineSource struct { 3588 // Overrides: The overrides to create. Each override must have a value for 3589 // 'metric' and 'unit', to specify which metric and which limit the override 3590 // should be applied to. The 'name' field of the override does not need to be 3591 // set; it is ignored. 3592 Overrides []*V1Beta1QuotaOverride `json:"overrides,omitempty"` 3593 // ForceSendFields is a list of field names (e.g. "Overrides") to 3594 // unconditionally include in API requests. By default, fields with empty or 3595 // default values are omitted from API requests. See 3596 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 3597 // details. 3598 ForceSendFields []string `json:"-"` 3599 // NullFields is a list of field names (e.g. "Overrides") to include in API 3600 // requests with the JSON null value. By default, fields with empty values are 3601 // omitted from API requests. See 3602 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 3603 NullFields []string `json:"-"` 3604 } 3605 3606 func (s *V1Beta1OverrideInlineSource) MarshalJSON() ([]byte, error) { 3607 type NoMethod V1Beta1OverrideInlineSource 3608 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 3609 } 3610 3611 // V1Beta1ProducerQuotaPolicy: Quota policy created by service producer. 3612 type V1Beta1ProducerQuotaPolicy struct { 3613 // Container: The cloud resource container at which the quota policy is 3614 // created. The format is {container_type}/{container_number} 3615 Container string `json:"container,omitempty"` 3616 // Dimensions: If this map is nonempty, then this policy applies only to 3617 // specific values for dimensions defined in the limit unit. For example, a 3618 // policy on a limit with the unit 1/{project}/{region} could contain an entry 3619 // with the key "region" and the value "us-east-1"; the policy is only applied 3620 // to quota consumed in that region. This map has the following restrictions: * 3621 // Keys that are not defined in the limit's unit are not valid keys. Any string 3622 // appearing in {brackets} in the unit (besides {project} or {user}) is a 3623 // defined key. * "project" is not a valid key; the project is already 3624 // specified in the parent resource name. * "user" is not a valid key; the API 3625 // does not support quota polcies that apply only to a specific user. * If 3626 // "region" appears as a key, its value must be a valid Cloud region. * If 3627 // "zone" appears as a key, its value must be a valid Cloud zone. * If any 3628 // valid key other than "region" or "zone" appears in the map, then all valid 3629 // keys other than "region" or "zone" must also appear in the map. 3630 Dimensions map[string]string `json:"dimensions,omitempty"` 3631 // Metric: The name of the metric to which this policy applies. An example name 3632 // would be: `compute.googleapis.com/cpus` 3633 Metric string `json:"metric,omitempty"` 3634 // Name: The resource name of the producer policy. An example name would be: 3635 // `services/compute.googleapis.com/organizations/123/consumerQuotaMetrics/compu 3636 // te.googleapis.com%2Fcpus/limits/%2Fproject%2Fregion/producerQuotaPolicies/4a3 3637 // f2c1d` 3638 Name string `json:"name,omitempty"` 3639 // PolicyValue: The quota policy value. Can be any nonnegative integer, or -1 3640 // (unlimited quota). 3641 PolicyValue int64 `json:"policyValue,omitempty,string"` 3642 // Unit: The limit unit of the limit to which this policy applies. An example 3643 // unit would be: `1/{project}/{region}` Note that `{project}` and `{region}` 3644 // are not placeholders in this example; the literal characters `{` and `}` 3645 // occur in the string. 3646 Unit string `json:"unit,omitempty"` 3647 // ForceSendFields is a list of field names (e.g. "Container") to 3648 // unconditionally include in API requests. By default, fields with empty or 3649 // default values are omitted from API requests. See 3650 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 3651 // details. 3652 ForceSendFields []string `json:"-"` 3653 // NullFields is a list of field names (e.g. "Container") to include in API 3654 // requests with the JSON null value. By default, fields with empty values are 3655 // omitted from API requests. See 3656 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 3657 NullFields []string `json:"-"` 3658 } 3659 3660 func (s *V1Beta1ProducerQuotaPolicy) MarshalJSON() ([]byte, error) { 3661 type NoMethod V1Beta1ProducerQuotaPolicy 3662 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 3663 } 3664 3665 // V1Beta1QuotaBucket: A quota bucket is a quota provisioning unit for a 3666 // specific set of dimensions. 3667 type V1Beta1QuotaBucket struct { 3668 // AdminOverride: Admin override on this quota bucket. 3669 AdminOverride *V1Beta1QuotaOverride `json:"adminOverride,omitempty"` 3670 // ConsumerOverride: Consumer override on this quota bucket. 3671 ConsumerOverride *V1Beta1QuotaOverride `json:"consumerOverride,omitempty"` 3672 // DefaultLimit: The default limit of this quota bucket, as specified by the 3673 // service configuration. 3674 DefaultLimit int64 `json:"defaultLimit,omitempty,string"` 3675 // Dimensions: The dimensions of this quota bucket. If this map is empty, this 3676 // is the global bucket, which is the default quota value applied to all 3677 // requests that do not have a more specific override. If this map is nonempty, 3678 // the default limit, effective limit, and quota overrides apply only to 3679 // requests that have the dimensions given in the map. For example, if the map 3680 // has key "region" and value "us-east-1", then the specified effective limit 3681 // is only effective in that region, and the specified overrides apply only in 3682 // that region. 3683 Dimensions map[string]string `json:"dimensions,omitempty"` 3684 // EffectiveLimit: The effective limit of this quota bucket. Equal to 3685 // default_limit if there are no overrides. 3686 EffectiveLimit int64 `json:"effectiveLimit,omitempty,string"` 3687 // ProducerOverride: Producer override on this quota bucket. 3688 ProducerOverride *V1Beta1QuotaOverride `json:"producerOverride,omitempty"` 3689 // ProducerQuotaPolicy: Producer policy inherited from the closet ancestor of 3690 // the current consumer. 3691 ProducerQuotaPolicy *V1Beta1ProducerQuotaPolicy `json:"producerQuotaPolicy,omitempty"` 3692 // RolloutInfo: Rollout information of this quota bucket. This field is present 3693 // only if the effective limit will change due to the ongoing rollout of the 3694 // service config. 3695 RolloutInfo *V1Beta1RolloutInfo `json:"rolloutInfo,omitempty"` 3696 // ForceSendFields is a list of field names (e.g. "AdminOverride") to 3697 // unconditionally include in API requests. By default, fields with empty or 3698 // default values are omitted from API requests. See 3699 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 3700 // details. 3701 ForceSendFields []string `json:"-"` 3702 // NullFields is a list of field names (e.g. "AdminOverride") to include in API 3703 // requests with the JSON null value. By default, fields with empty values are 3704 // omitted from API requests. See 3705 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 3706 NullFields []string `json:"-"` 3707 } 3708 3709 func (s *V1Beta1QuotaBucket) MarshalJSON() ([]byte, error) { 3710 type NoMethod V1Beta1QuotaBucket 3711 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 3712 } 3713 3714 // V1Beta1QuotaOverride: A quota override 3715 type V1Beta1QuotaOverride struct { 3716 // AdminOverrideAncestor: The resource name of the ancestor that requested the 3717 // override. For example: "organizations/12345" or "folders/67890". Used by 3718 // admin overrides only. 3719 AdminOverrideAncestor string `json:"adminOverrideAncestor,omitempty"` 3720 // Dimensions: If this map is nonempty, then this override applies only to 3721 // specific values for dimensions defined in the limit unit. For example, an 3722 // override on a limit with the unit 1/{project}/{region} could contain an 3723 // entry with the key "region" and the value "us-east-1"; the override is only 3724 // applied to quota consumed in that region. This map has the following 3725 // restrictions: * Keys that are not defined in the limit's unit are not valid 3726 // keys. Any string appearing in {brackets} in the unit (besides {project} or 3727 // {user}) is a defined key. * "project" is not a valid key; the project is 3728 // already specified in the parent resource name. * "user" is not a valid key; 3729 // the API does not support quota overrides that apply only to a specific user. 3730 // * If "region" appears as a key, its value must be a valid Cloud region. * If 3731 // "zone" appears as a key, its value must be a valid Cloud zone. * If any 3732 // valid key other than "region" or "zone" appears in the map, then all valid 3733 // keys other than "region" or "zone" must also appear in the map. 3734 Dimensions map[string]string `json:"dimensions,omitempty"` 3735 // Metric: The name of the metric to which this override applies. An example 3736 // name would be: `compute.googleapis.com/cpus` 3737 Metric string `json:"metric,omitempty"` 3738 // Name: The resource name of the producer override. An example name would be: 3739 // `services/compute.googleapis.com/projects/123/consumerQuotaMetrics/compute.go 3740 // ogleapis.com%2Fcpus/limits/%2Fproject%2Fregion/producerOverrides/4a3f2c1d` 3741 Name string `json:"name,omitempty"` 3742 // OverrideValue: The overriding quota limit value. Can be any nonnegative 3743 // integer, or -1 (unlimited quota). 3744 OverrideValue int64 `json:"overrideValue,omitempty,string"` 3745 // Unit: The limit unit of the limit to which this override applies. An example 3746 // unit would be: `1/{project}/{region}` Note that `{project}` and `{region}` 3747 // are not placeholders in this example; the literal characters `{` and `}` 3748 // occur in the string. 3749 Unit string `json:"unit,omitempty"` 3750 // ForceSendFields is a list of field names (e.g. "AdminOverrideAncestor") to 3751 // unconditionally include in API requests. By default, fields with empty or 3752 // default values are omitted from API requests. See 3753 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 3754 // details. 3755 ForceSendFields []string `json:"-"` 3756 // NullFields is a list of field names (e.g. "AdminOverrideAncestor") to 3757 // include in API requests with the JSON null value. By default, fields with 3758 // empty values are omitted from API requests. See 3759 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 3760 NullFields []string `json:"-"` 3761 } 3762 3763 func (s *V1Beta1QuotaOverride) MarshalJSON() ([]byte, error) { 3764 type NoMethod V1Beta1QuotaOverride 3765 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 3766 } 3767 3768 // V1Beta1RefreshConsumerResponse: Response message for the `RefreshConsumer` 3769 // method. This response message is assigned to the `response` field of the 3770 // returned Operation when that operation is done. 3771 type V1Beta1RefreshConsumerResponse struct { 3772 } 3773 3774 // V1Beta1RolloutInfo: [Output only] Rollout information of a quota. 3775 type V1Beta1RolloutInfo struct { 3776 // DefaultLimitOngoingRollout: Whether there is an ongoing rollout for the 3777 // default limit or not. 3778 DefaultLimitOngoingRollout bool `json:"defaultLimitOngoingRollout,omitempty"` 3779 // ForceSendFields is a list of field names (e.g. "DefaultLimitOngoingRollout") 3780 // to unconditionally include in API requests. By default, fields with empty or 3781 // default values are omitted from API requests. See 3782 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 3783 // details. 3784 ForceSendFields []string `json:"-"` 3785 // NullFields is a list of field names (e.g. "DefaultLimitOngoingRollout") to 3786 // include in API requests with the JSON null value. By default, fields with 3787 // empty values are omitted from API requests. See 3788 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 3789 NullFields []string `json:"-"` 3790 } 3791 3792 func (s *V1Beta1RolloutInfo) MarshalJSON() ([]byte, error) { 3793 type NoMethod V1Beta1RolloutInfo 3794 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 3795 } 3796 3797 // V1Beta1ServiceIdentity: A service identity in the Identity and Access 3798 // Management API. 3799 type V1Beta1ServiceIdentity struct { 3800 // Email: The email address of the service identity. 3801 Email string `json:"email,omitempty"` 3802 // Name: P4 service identity resource name. An example name would be: 3803 // `services/serviceconsumermanagement.googleapis.com/projects/123/serviceIdenti 3804 // ties/default` 3805 Name string `json:"name,omitempty"` 3806 // Tag: The P4 service identity configuration tag. This must be defined in 3807 // activation_grants. If not specified when creating the account, the tag is 3808 // set to "default". 3809 Tag string `json:"tag,omitempty"` 3810 // UniqueId: The unique and stable id of the service identity. 3811 UniqueId string `json:"uniqueId,omitempty"` 3812 // ForceSendFields is a list of field names (e.g. "Email") to unconditionally 3813 // include in API requests. By default, fields with empty or default values are 3814 // omitted from API requests. See 3815 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 3816 // details. 3817 ForceSendFields []string `json:"-"` 3818 // NullFields is a list of field names (e.g. "Email") to include in API 3819 // requests with the JSON null value. By default, fields with empty values are 3820 // omitted from API requests. See 3821 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 3822 NullFields []string `json:"-"` 3823 } 3824 3825 func (s *V1Beta1ServiceIdentity) MarshalJSON() ([]byte, error) { 3826 type NoMethod V1Beta1ServiceIdentity 3827 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 3828 } 3829 3830 // V1beta1AddVisibilityLabelsResponse: Response message for the 3831 // `AddVisibilityLabels` method. This response message is assigned to the 3832 // `response` field of the returned Operation when that operation is done. 3833 type V1beta1AddVisibilityLabelsResponse struct { 3834 // Labels: The updated set of visibility labels for this consumer on this 3835 // service. 3836 Labels []string `json:"labels,omitempty"` 3837 // ForceSendFields is a list of field names (e.g. "Labels") to unconditionally 3838 // include in API requests. By default, fields with empty or default values are 3839 // omitted from API requests. See 3840 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 3841 // details. 3842 ForceSendFields []string `json:"-"` 3843 // NullFields is a list of field names (e.g. "Labels") to include in API 3844 // requests with the JSON null value. By default, fields with empty values are 3845 // omitted from API requests. See 3846 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 3847 NullFields []string `json:"-"` 3848 } 3849 3850 func (s *V1beta1AddVisibilityLabelsResponse) MarshalJSON() ([]byte, error) { 3851 type NoMethod V1beta1AddVisibilityLabelsResponse 3852 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 3853 } 3854 3855 // V1beta1DefaultIdentity: A default identity in the Identity and Access 3856 // Management API. 3857 type V1beta1DefaultIdentity struct { 3858 // Email: The email address of the default identity. 3859 Email string `json:"email,omitempty"` 3860 // Name: Default identity resource name. An example name would be: 3861 // `services/serviceconsumermanagement.googleapis.com/projects/123/defaultIdenti 3862 // ty` 3863 Name string `json:"name,omitempty"` 3864 // Tag: The Default Identity tag. If specified when creating the account, the 3865 // tag must be present in activation_grants. If not specified when creating the 3866 // account, the tag is set to the tag specified in activation_grants. 3867 Tag string `json:"tag,omitempty"` 3868 // UniqueId: The unique and stable id of the default identity. 3869 UniqueId string `json:"uniqueId,omitempty"` 3870 // ForceSendFields is a list of field names (e.g. "Email") to unconditionally 3871 // include in API requests. By default, fields with empty or default values are 3872 // omitted from API requests. See 3873 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 3874 // details. 3875 ForceSendFields []string `json:"-"` 3876 // NullFields is a list of field names (e.g. "Email") to include in API 3877 // requests with the JSON null value. By default, fields with empty values are 3878 // omitted from API requests. See 3879 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 3880 NullFields []string `json:"-"` 3881 } 3882 3883 func (s *V1beta1DefaultIdentity) MarshalJSON() ([]byte, error) { 3884 type NoMethod V1beta1DefaultIdentity 3885 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 3886 } 3887 3888 // V1beta1DisableConsumerResponse: Response message for the `DisableConsumer` 3889 // method. This response message is assigned to the `response` field of the 3890 // returned Operation when that operation is done. 3891 type V1beta1DisableConsumerResponse struct { 3892 } 3893 3894 // V1beta1EnableConsumerResponse: Response message for the `EnableConsumer` 3895 // method. This response message is assigned to the `response` field of the 3896 // returned Operation when that operation is done. 3897 type V1beta1EnableConsumerResponse struct { 3898 } 3899 3900 // V1beta1GenerateDefaultIdentityResponse: Response message for the 3901 // `GenerateDefaultIdentity` method. This response message is assigned to the 3902 // `response` field of the returned Operation when that operation is done. 3903 type V1beta1GenerateDefaultIdentityResponse struct { 3904 // AttachStatus: Status of the role attachment. Under development 3905 // (go/si-attach-role), currently always return ATTACH_STATUS_UNSPECIFIED) 3906 // 3907 // Possible values: 3908 // "ATTACH_STATUS_UNSPECIFIED" - Indicates that the AttachStatus was not set. 3909 // "ATTACHED" - The default identity was attached to a role successfully in 3910 // this request. 3911 // "ATTACH_SKIPPED" - The request specified that no attempt should be made to 3912 // attach the role. 3913 // "PREVIOUSLY_ATTACHED" - Role was attached to the consumer project at some 3914 // point in time. Tenant manager doesn't make assertion about the current state 3915 // of the identity with respect to the consumer. Role attachment should happen 3916 // only once after activation and cannot be reattached after customer removes 3917 // it. (go/si-attach-role) 3918 // "ATTACH_DENIED_BY_ORG_POLICY" - Role attachment was denied in this request 3919 // by customer set org policy. (go/si-attach-role) 3920 AttachStatus string `json:"attachStatus,omitempty"` 3921 // Identity: DefaultIdentity that was created or retrieved. 3922 Identity *V1beta1DefaultIdentity `json:"identity,omitempty"` 3923 // Role: Role attached to consumer project. Empty if not attached in this 3924 // request. (Under development, currently always return empty.) 3925 Role string `json:"role,omitempty"` 3926 // ForceSendFields is a list of field names (e.g. "AttachStatus") to 3927 // unconditionally include in API requests. By default, fields with empty or 3928 // default values are omitted from API requests. See 3929 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 3930 // details. 3931 ForceSendFields []string `json:"-"` 3932 // NullFields is a list of field names (e.g. "AttachStatus") to include in API 3933 // requests with the JSON null value. By default, fields with empty values are 3934 // omitted from API requests. See 3935 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 3936 NullFields []string `json:"-"` 3937 } 3938 3939 func (s *V1beta1GenerateDefaultIdentityResponse) MarshalJSON() ([]byte, error) { 3940 type NoMethod V1beta1GenerateDefaultIdentityResponse 3941 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 3942 } 3943 3944 // V1beta1GenerateServiceAccountResponse: Response message for the 3945 // `GenerateServiceAccount` method. This response message is assigned to the 3946 // `response` field of the returned Operation when that operation is done. 3947 type V1beta1GenerateServiceAccountResponse struct { 3948 // Account: ServiceAccount that was created or retrieved. 3949 Account *V1beta1ServiceAccount `json:"account,omitempty"` 3950 // ForceSendFields is a list of field names (e.g. "Account") to unconditionally 3951 // include in API requests. By default, fields with empty or default values are 3952 // omitted from API requests. See 3953 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 3954 // details. 3955 ForceSendFields []string `json:"-"` 3956 // NullFields is a list of field names (e.g. "Account") to include in API 3957 // requests with the JSON null value. By default, fields with empty values are 3958 // omitted from API requests. See 3959 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 3960 NullFields []string `json:"-"` 3961 } 3962 3963 func (s *V1beta1GenerateServiceAccountResponse) MarshalJSON() ([]byte, error) { 3964 type NoMethod V1beta1GenerateServiceAccountResponse 3965 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 3966 } 3967 3968 // V1beta1RefreshConsumerResponse: Response message for the `RefreshConsumer` 3969 // method. This response message is assigned to the `response` field of the 3970 // returned Operation when that operation is done. 3971 type V1beta1RefreshConsumerResponse struct { 3972 } 3973 3974 // V1beta1RemoveVisibilityLabelsResponse: Response message for the 3975 // `RemoveVisibilityLabels` method. This response message is assigned to the 3976 // `response` field of the returned Operation when that operation is done. 3977 type V1beta1RemoveVisibilityLabelsResponse struct { 3978 // Labels: The updated set of visibility labels for this consumer on this 3979 // service. 3980 Labels []string `json:"labels,omitempty"` 3981 // ForceSendFields is a list of field names (e.g. "Labels") to unconditionally 3982 // include in API requests. By default, fields with empty or default values are 3983 // omitted from API requests. See 3984 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 3985 // details. 3986 ForceSendFields []string `json:"-"` 3987 // NullFields is a list of field names (e.g. "Labels") to include in API 3988 // requests with the JSON null value. By default, fields with empty values are 3989 // omitted from API requests. See 3990 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 3991 NullFields []string `json:"-"` 3992 } 3993 3994 func (s *V1beta1RemoveVisibilityLabelsResponse) MarshalJSON() ([]byte, error) { 3995 type NoMethod V1beta1RemoveVisibilityLabelsResponse 3996 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 3997 } 3998 3999 // V1beta1ServiceAccount: A service account in the Identity and Access 4000 // Management API. 4001 type V1beta1ServiceAccount struct { 4002 // Email: The email address of the service account. 4003 Email string `json:"email,omitempty"` 4004 // IamAccountName: Deprecated. See b/136209818. 4005 IamAccountName string `json:"iamAccountName,omitempty"` 4006 // Name: P4 SA resource name. An example name would be: 4007 // `services/serviceconsumermanagement.googleapis.com/projects/123/serviceAccoun 4008 // ts/default` 4009 Name string `json:"name,omitempty"` 4010 // Tag: The P4 SA configuration tag. This must be defined in activation_grants. 4011 // If not specified when creating the account, the tag is set to "default". 4012 Tag string `json:"tag,omitempty"` 4013 // UniqueId: The unique and stable id of the service account. 4014 UniqueId string `json:"uniqueId,omitempty"` 4015 // ForceSendFields is a list of field names (e.g. "Email") to unconditionally 4016 // include in API requests. By default, fields with empty or default values are 4017 // omitted from API requests. See 4018 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 4019 // details. 4020 ForceSendFields []string `json:"-"` 4021 // NullFields is a list of field names (e.g. "Email") to include in API 4022 // requests with the JSON null value. By default, fields with empty values are 4023 // omitted from API requests. See 4024 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 4025 NullFields []string `json:"-"` 4026 } 4027 4028 func (s *V1beta1ServiceAccount) MarshalJSON() ([]byte, error) { 4029 type NoMethod V1beta1ServiceAccount 4030 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 4031 } 4032 4033 type OperationsGetCall struct { 4034 s *APIService 4035 name string 4036 urlParams_ gensupport.URLParams 4037 ifNoneMatch_ string 4038 ctx_ context.Context 4039 header_ http.Header 4040 } 4041 4042 // Get: Gets the latest state of a long-running operation. Clients can use this 4043 // method to poll the operation result at intervals as recommended by the API 4044 // service. 4045 // 4046 // - name: The name of the operation resource. 4047 func (r *OperationsService) Get(name string) *OperationsGetCall { 4048 c := &OperationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 4049 c.name = name 4050 return c 4051 } 4052 4053 // Fields allows partial responses to be retrieved. See 4054 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 4055 // details. 4056 func (c *OperationsGetCall) Fields(s ...googleapi.Field) *OperationsGetCall { 4057 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 4058 return c 4059 } 4060 4061 // IfNoneMatch sets an optional parameter which makes the operation fail if the 4062 // object's ETag matches the given value. This is useful for getting updates 4063 // only after the object has changed since the last request. 4064 func (c *OperationsGetCall) IfNoneMatch(entityTag string) *OperationsGetCall { 4065 c.ifNoneMatch_ = entityTag 4066 return c 4067 } 4068 4069 // Context sets the context to be used in this call's Do method. 4070 func (c *OperationsGetCall) Context(ctx context.Context) *OperationsGetCall { 4071 c.ctx_ = ctx 4072 return c 4073 } 4074 4075 // Header returns a http.Header that can be modified by the caller to add 4076 // headers to the request. 4077 func (c *OperationsGetCall) Header() http.Header { 4078 if c.header_ == nil { 4079 c.header_ = make(http.Header) 4080 } 4081 return c.header_ 4082 } 4083 4084 func (c *OperationsGetCall) doRequest(alt string) (*http.Response, error) { 4085 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) 4086 if c.ifNoneMatch_ != "" { 4087 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 4088 } 4089 var body io.Reader = nil 4090 c.urlParams_.Set("alt", alt) 4091 c.urlParams_.Set("prettyPrint", "false") 4092 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") 4093 urls += "?" + c.urlParams_.Encode() 4094 req, err := http.NewRequest("GET", urls, body) 4095 if err != nil { 4096 return nil, err 4097 } 4098 req.Header = reqHeaders 4099 googleapi.Expand(req.URL, map[string]string{ 4100 "name": c.name, 4101 }) 4102 return gensupport.SendRequest(c.ctx_, c.s.client, req) 4103 } 4104 4105 // Do executes the "serviceconsumermanagement.operations.get" call. 4106 // Any non-2xx status code is an error. Response headers are in either 4107 // *Operation.ServerResponse.Header or (if a response was returned at all) in 4108 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 4109 // whether the returned error was because http.StatusNotModified was returned. 4110 func (c *OperationsGetCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 4111 gensupport.SetOptions(c.urlParams_, opts...) 4112 res, err := c.doRequest("json") 4113 if res != nil && res.StatusCode == http.StatusNotModified { 4114 if res.Body != nil { 4115 res.Body.Close() 4116 } 4117 return nil, gensupport.WrapError(&googleapi.Error{ 4118 Code: res.StatusCode, 4119 Header: res.Header, 4120 }) 4121 } 4122 if err != nil { 4123 return nil, err 4124 } 4125 defer googleapi.CloseBody(res) 4126 if err := googleapi.CheckResponse(res); err != nil { 4127 return nil, gensupport.WrapError(err) 4128 } 4129 ret := &Operation{ 4130 ServerResponse: googleapi.ServerResponse{ 4131 Header: res.Header, 4132 HTTPStatusCode: res.StatusCode, 4133 }, 4134 } 4135 target := &ret 4136 if err := gensupport.DecodeResponse(target, res); err != nil { 4137 return nil, err 4138 } 4139 return ret, nil 4140 } 4141 4142 type ServicesConsumerQuotaMetricsGetCall struct { 4143 s *APIService 4144 name string 4145 urlParams_ gensupport.URLParams 4146 ifNoneMatch_ string 4147 ctx_ context.Context 4148 header_ http.Header 4149 } 4150 4151 // Get: Retrieves a summary of quota information for a specific quota metric. 4152 // 4153 // - name: The resource name of the quota metric, returned by a 4154 // ListConsumerQuotaMetrics call. An example name would be: 4155 // `services/compute.googleapis.com/projects/123/consumerQuotaMetrics/compute. 4156 // googleapis.com%2Fcpus`. 4157 func (r *ServicesConsumerQuotaMetricsService) Get(name string) *ServicesConsumerQuotaMetricsGetCall { 4158 c := &ServicesConsumerQuotaMetricsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 4159 c.name = name 4160 return c 4161 } 4162 4163 // View sets the optional parameter "view": Specifies the level of detail for 4164 // quota information in the response. 4165 // 4166 // Possible values: 4167 // 4168 // "QUOTA_VIEW_UNSPECIFIED" - No quota view specified. Requests that do not 4169 // 4170 // specify a quota view will typically default to the BASIC view. 4171 // 4172 // "BASIC" - Only buckets with overrides are shown in the response. 4173 // "FULL" - Include per-location buckets even if they do not have overrides. 4174 // 4175 // When the view is FULL, and a limit has regional or zonal quota, the limit 4176 // will include buckets for all regions or zones that could support overrides, 4177 // even if none are currently present. In some cases this will cause the 4178 // response to become very large; callers that do not need this extra 4179 // information should use the BASIC view instead. 4180 func (c *ServicesConsumerQuotaMetricsGetCall) View(view string) *ServicesConsumerQuotaMetricsGetCall { 4181 c.urlParams_.Set("view", view) 4182 return c 4183 } 4184 4185 // Fields allows partial responses to be retrieved. See 4186 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 4187 // details. 4188 func (c *ServicesConsumerQuotaMetricsGetCall) Fields(s ...googleapi.Field) *ServicesConsumerQuotaMetricsGetCall { 4189 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 4190 return c 4191 } 4192 4193 // IfNoneMatch sets an optional parameter which makes the operation fail if the 4194 // object's ETag matches the given value. This is useful for getting updates 4195 // only after the object has changed since the last request. 4196 func (c *ServicesConsumerQuotaMetricsGetCall) IfNoneMatch(entityTag string) *ServicesConsumerQuotaMetricsGetCall { 4197 c.ifNoneMatch_ = entityTag 4198 return c 4199 } 4200 4201 // Context sets the context to be used in this call's Do method. 4202 func (c *ServicesConsumerQuotaMetricsGetCall) Context(ctx context.Context) *ServicesConsumerQuotaMetricsGetCall { 4203 c.ctx_ = ctx 4204 return c 4205 } 4206 4207 // Header returns a http.Header that can be modified by the caller to add 4208 // headers to the request. 4209 func (c *ServicesConsumerQuotaMetricsGetCall) Header() http.Header { 4210 if c.header_ == nil { 4211 c.header_ = make(http.Header) 4212 } 4213 return c.header_ 4214 } 4215 4216 func (c *ServicesConsumerQuotaMetricsGetCall) doRequest(alt string) (*http.Response, error) { 4217 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) 4218 if c.ifNoneMatch_ != "" { 4219 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 4220 } 4221 var body io.Reader = nil 4222 c.urlParams_.Set("alt", alt) 4223 c.urlParams_.Set("prettyPrint", "false") 4224 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") 4225 urls += "?" + c.urlParams_.Encode() 4226 req, err := http.NewRequest("GET", urls, body) 4227 if err != nil { 4228 return nil, err 4229 } 4230 req.Header = reqHeaders 4231 googleapi.Expand(req.URL, map[string]string{ 4232 "name": c.name, 4233 }) 4234 return gensupport.SendRequest(c.ctx_, c.s.client, req) 4235 } 4236 4237 // Do executes the "serviceconsumermanagement.services.consumerQuotaMetrics.get" call. 4238 // Any non-2xx status code is an error. Response headers are in either 4239 // *V1Beta1ConsumerQuotaMetric.ServerResponse.Header or (if a response was 4240 // returned at all) in error.(*googleapi.Error).Header. Use 4241 // googleapi.IsNotModified to check whether the returned error was because 4242 // http.StatusNotModified was returned. 4243 func (c *ServicesConsumerQuotaMetricsGetCall) Do(opts ...googleapi.CallOption) (*V1Beta1ConsumerQuotaMetric, error) { 4244 gensupport.SetOptions(c.urlParams_, opts...) 4245 res, err := c.doRequest("json") 4246 if res != nil && res.StatusCode == http.StatusNotModified { 4247 if res.Body != nil { 4248 res.Body.Close() 4249 } 4250 return nil, gensupport.WrapError(&googleapi.Error{ 4251 Code: res.StatusCode, 4252 Header: res.Header, 4253 }) 4254 } 4255 if err != nil { 4256 return nil, err 4257 } 4258 defer googleapi.CloseBody(res) 4259 if err := googleapi.CheckResponse(res); err != nil { 4260 return nil, gensupport.WrapError(err) 4261 } 4262 ret := &V1Beta1ConsumerQuotaMetric{ 4263 ServerResponse: googleapi.ServerResponse{ 4264 Header: res.Header, 4265 HTTPStatusCode: res.StatusCode, 4266 }, 4267 } 4268 target := &ret 4269 if err := gensupport.DecodeResponse(target, res); err != nil { 4270 return nil, err 4271 } 4272 return ret, nil 4273 } 4274 4275 type ServicesConsumerQuotaMetricsImportProducerOverridesCall struct { 4276 s *APIService 4277 parent string 4278 v1beta1importproduceroverridesrequest *V1Beta1ImportProducerOverridesRequest 4279 urlParams_ gensupport.URLParams 4280 ctx_ context.Context 4281 header_ http.Header 4282 } 4283 4284 // ImportProducerOverrides: Create or update multiple producer overrides 4285 // atomically, all on the same consumer, but on many different metrics or 4286 // limits. The name field in the quota override message should not be set. 4287 // 4288 // - parent: The resource name of the consumer. An example name would be: 4289 // `services/compute.googleapis.com/projects/123`. 4290 func (r *ServicesConsumerQuotaMetricsService) ImportProducerOverrides(parent string, v1beta1importproduceroverridesrequest *V1Beta1ImportProducerOverridesRequest) *ServicesConsumerQuotaMetricsImportProducerOverridesCall { 4291 c := &ServicesConsumerQuotaMetricsImportProducerOverridesCall{s: r.s, urlParams_: make(gensupport.URLParams)} 4292 c.parent = parent 4293 c.v1beta1importproduceroverridesrequest = v1beta1importproduceroverridesrequest 4294 return c 4295 } 4296 4297 // Fields allows partial responses to be retrieved. See 4298 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 4299 // details. 4300 func (c *ServicesConsumerQuotaMetricsImportProducerOverridesCall) Fields(s ...googleapi.Field) *ServicesConsumerQuotaMetricsImportProducerOverridesCall { 4301 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 4302 return c 4303 } 4304 4305 // Context sets the context to be used in this call's Do method. 4306 func (c *ServicesConsumerQuotaMetricsImportProducerOverridesCall) Context(ctx context.Context) *ServicesConsumerQuotaMetricsImportProducerOverridesCall { 4307 c.ctx_ = ctx 4308 return c 4309 } 4310 4311 // Header returns a http.Header that can be modified by the caller to add 4312 // headers to the request. 4313 func (c *ServicesConsumerQuotaMetricsImportProducerOverridesCall) Header() http.Header { 4314 if c.header_ == nil { 4315 c.header_ = make(http.Header) 4316 } 4317 return c.header_ 4318 } 4319 4320 func (c *ServicesConsumerQuotaMetricsImportProducerOverridesCall) doRequest(alt string) (*http.Response, error) { 4321 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) 4322 var body io.Reader = nil 4323 body, err := googleapi.WithoutDataWrapper.JSONReader(c.v1beta1importproduceroverridesrequest) 4324 if err != nil { 4325 return nil, err 4326 } 4327 c.urlParams_.Set("alt", alt) 4328 c.urlParams_.Set("prettyPrint", "false") 4329 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/consumerQuotaMetrics:importProducerOverrides") 4330 urls += "?" + c.urlParams_.Encode() 4331 req, err := http.NewRequest("POST", urls, body) 4332 if err != nil { 4333 return nil, err 4334 } 4335 req.Header = reqHeaders 4336 googleapi.Expand(req.URL, map[string]string{ 4337 "parent": c.parent, 4338 }) 4339 return gensupport.SendRequest(c.ctx_, c.s.client, req) 4340 } 4341 4342 // Do executes the "serviceconsumermanagement.services.consumerQuotaMetrics.importProducerOverrides" call. 4343 // Any non-2xx status code is an error. Response headers are in either 4344 // *Operation.ServerResponse.Header or (if a response was returned at all) in 4345 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 4346 // whether the returned error was because http.StatusNotModified was returned. 4347 func (c *ServicesConsumerQuotaMetricsImportProducerOverridesCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 4348 gensupport.SetOptions(c.urlParams_, opts...) 4349 res, err := c.doRequest("json") 4350 if res != nil && res.StatusCode == http.StatusNotModified { 4351 if res.Body != nil { 4352 res.Body.Close() 4353 } 4354 return nil, gensupport.WrapError(&googleapi.Error{ 4355 Code: res.StatusCode, 4356 Header: res.Header, 4357 }) 4358 } 4359 if err != nil { 4360 return nil, err 4361 } 4362 defer googleapi.CloseBody(res) 4363 if err := googleapi.CheckResponse(res); err != nil { 4364 return nil, gensupport.WrapError(err) 4365 } 4366 ret := &Operation{ 4367 ServerResponse: googleapi.ServerResponse{ 4368 Header: res.Header, 4369 HTTPStatusCode: res.StatusCode, 4370 }, 4371 } 4372 target := &ret 4373 if err := gensupport.DecodeResponse(target, res); err != nil { 4374 return nil, err 4375 } 4376 return ret, nil 4377 } 4378 4379 type ServicesConsumerQuotaMetricsListCall struct { 4380 s *APIService 4381 parent string 4382 urlParams_ gensupport.URLParams 4383 ifNoneMatch_ string 4384 ctx_ context.Context 4385 header_ http.Header 4386 } 4387 4388 // List: Retrieves a summary of all quota information about this consumer that 4389 // is visible to the service producer, for each quota metric defined by the 4390 // service. Each metric includes information about all of its defined limits. 4391 // Each limit includes the limit configuration (quota unit, preciseness, 4392 // default value), the current effective limit value, and all of the overrides 4393 // applied to the limit. 4394 // 4395 // - parent: Parent of the quotas resource. An example parent would be: 4396 // `services/serviceconsumermanagement.googleapis.com/projects/123`. 4397 func (r *ServicesConsumerQuotaMetricsService) List(parent string) *ServicesConsumerQuotaMetricsListCall { 4398 c := &ServicesConsumerQuotaMetricsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 4399 c.parent = parent 4400 return c 4401 } 4402 4403 // PageSize sets the optional parameter "pageSize": Requested size of the next 4404 // page of data. 4405 func (c *ServicesConsumerQuotaMetricsListCall) PageSize(pageSize int64) *ServicesConsumerQuotaMetricsListCall { 4406 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) 4407 return c 4408 } 4409 4410 // PageToken sets the optional parameter "pageToken": Token identifying which 4411 // result to start with; returned by a previous list call. 4412 func (c *ServicesConsumerQuotaMetricsListCall) PageToken(pageToken string) *ServicesConsumerQuotaMetricsListCall { 4413 c.urlParams_.Set("pageToken", pageToken) 4414 return c 4415 } 4416 4417 // View sets the optional parameter "view": Specifies the level of detail for 4418 // quota information in the response. 4419 // 4420 // Possible values: 4421 // 4422 // "QUOTA_VIEW_UNSPECIFIED" - No quota view specified. Requests that do not 4423 // 4424 // specify a quota view will typically default to the BASIC view. 4425 // 4426 // "BASIC" - Only buckets with overrides are shown in the response. 4427 // "FULL" - Include per-location buckets even if they do not have overrides. 4428 // 4429 // When the view is FULL, and a limit has regional or zonal quota, the limit 4430 // will include buckets for all regions or zones that could support overrides, 4431 // even if none are currently present. In some cases this will cause the 4432 // response to become very large; callers that do not need this extra 4433 // information should use the BASIC view instead. 4434 func (c *ServicesConsumerQuotaMetricsListCall) View(view string) *ServicesConsumerQuotaMetricsListCall { 4435 c.urlParams_.Set("view", view) 4436 return c 4437 } 4438 4439 // Fields allows partial responses to be retrieved. See 4440 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 4441 // details. 4442 func (c *ServicesConsumerQuotaMetricsListCall) Fields(s ...googleapi.Field) *ServicesConsumerQuotaMetricsListCall { 4443 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 4444 return c 4445 } 4446 4447 // IfNoneMatch sets an optional parameter which makes the operation fail if the 4448 // object's ETag matches the given value. This is useful for getting updates 4449 // only after the object has changed since the last request. 4450 func (c *ServicesConsumerQuotaMetricsListCall) IfNoneMatch(entityTag string) *ServicesConsumerQuotaMetricsListCall { 4451 c.ifNoneMatch_ = entityTag 4452 return c 4453 } 4454 4455 // Context sets the context to be used in this call's Do method. 4456 func (c *ServicesConsumerQuotaMetricsListCall) Context(ctx context.Context) *ServicesConsumerQuotaMetricsListCall { 4457 c.ctx_ = ctx 4458 return c 4459 } 4460 4461 // Header returns a http.Header that can be modified by the caller to add 4462 // headers to the request. 4463 func (c *ServicesConsumerQuotaMetricsListCall) Header() http.Header { 4464 if c.header_ == nil { 4465 c.header_ = make(http.Header) 4466 } 4467 return c.header_ 4468 } 4469 4470 func (c *ServicesConsumerQuotaMetricsListCall) doRequest(alt string) (*http.Response, error) { 4471 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) 4472 if c.ifNoneMatch_ != "" { 4473 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 4474 } 4475 var body io.Reader = nil 4476 c.urlParams_.Set("alt", alt) 4477 c.urlParams_.Set("prettyPrint", "false") 4478 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/consumerQuotaMetrics") 4479 urls += "?" + c.urlParams_.Encode() 4480 req, err := http.NewRequest("GET", urls, body) 4481 if err != nil { 4482 return nil, err 4483 } 4484 req.Header = reqHeaders 4485 googleapi.Expand(req.URL, map[string]string{ 4486 "parent": c.parent, 4487 }) 4488 return gensupport.SendRequest(c.ctx_, c.s.client, req) 4489 } 4490 4491 // Do executes the "serviceconsumermanagement.services.consumerQuotaMetrics.list" call. 4492 // Any non-2xx status code is an error. Response headers are in either 4493 // *V1Beta1ListConsumerQuotaMetricsResponse.ServerResponse.Header or (if a 4494 // response was returned at all) in error.(*googleapi.Error).Header. Use 4495 // googleapi.IsNotModified to check whether the returned error was because 4496 // http.StatusNotModified was returned. 4497 func (c *ServicesConsumerQuotaMetricsListCall) Do(opts ...googleapi.CallOption) (*V1Beta1ListConsumerQuotaMetricsResponse, error) { 4498 gensupport.SetOptions(c.urlParams_, opts...) 4499 res, err := c.doRequest("json") 4500 if res != nil && res.StatusCode == http.StatusNotModified { 4501 if res.Body != nil { 4502 res.Body.Close() 4503 } 4504 return nil, gensupport.WrapError(&googleapi.Error{ 4505 Code: res.StatusCode, 4506 Header: res.Header, 4507 }) 4508 } 4509 if err != nil { 4510 return nil, err 4511 } 4512 defer googleapi.CloseBody(res) 4513 if err := googleapi.CheckResponse(res); err != nil { 4514 return nil, gensupport.WrapError(err) 4515 } 4516 ret := &V1Beta1ListConsumerQuotaMetricsResponse{ 4517 ServerResponse: googleapi.ServerResponse{ 4518 Header: res.Header, 4519 HTTPStatusCode: res.StatusCode, 4520 }, 4521 } 4522 target := &ret 4523 if err := gensupport.DecodeResponse(target, res); err != nil { 4524 return nil, err 4525 } 4526 return ret, nil 4527 } 4528 4529 // Pages invokes f for each page of results. 4530 // A non-nil error returned from f will halt the iteration. 4531 // The provided context supersedes any context provided to the Context method. 4532 func (c *ServicesConsumerQuotaMetricsListCall) Pages(ctx context.Context, f func(*V1Beta1ListConsumerQuotaMetricsResponse) error) error { 4533 c.ctx_ = ctx 4534 defer c.PageToken(c.urlParams_.Get("pageToken")) 4535 for { 4536 x, err := c.Do() 4537 if err != nil { 4538 return err 4539 } 4540 if err := f(x); err != nil { 4541 return err 4542 } 4543 if x.NextPageToken == "" { 4544 return nil 4545 } 4546 c.PageToken(x.NextPageToken) 4547 } 4548 } 4549 4550 type ServicesConsumerQuotaMetricsLimitsGetCall struct { 4551 s *APIService 4552 name string 4553 urlParams_ gensupport.URLParams 4554 ifNoneMatch_ string 4555 ctx_ context.Context 4556 header_ http.Header 4557 } 4558 4559 // Get: Retrieves a summary of quota information for a specific quota limit. 4560 // 4561 // - name: The resource name of the quota limit, returned by a 4562 // ListConsumerQuotaMetrics or GetConsumerQuotaMetric call. An example name 4563 // would be: 4564 // `services/compute.googleapis.com/projects/123/consumerQuotaMetrics/compute. 4565 // googleapis.com%2Fcpus/limits/%2Fproject%2Fregion`. 4566 func (r *ServicesConsumerQuotaMetricsLimitsService) Get(name string) *ServicesConsumerQuotaMetricsLimitsGetCall { 4567 c := &ServicesConsumerQuotaMetricsLimitsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 4568 c.name = name 4569 return c 4570 } 4571 4572 // View sets the optional parameter "view": Specifies the level of detail for 4573 // quota information in the response. 4574 // 4575 // Possible values: 4576 // 4577 // "QUOTA_VIEW_UNSPECIFIED" - No quota view specified. Requests that do not 4578 // 4579 // specify a quota view will typically default to the BASIC view. 4580 // 4581 // "BASIC" - Only buckets with overrides are shown in the response. 4582 // "FULL" - Include per-location buckets even if they do not have overrides. 4583 // 4584 // When the view is FULL, and a limit has regional or zonal quota, the limit 4585 // will include buckets for all regions or zones that could support overrides, 4586 // even if none are currently present. In some cases this will cause the 4587 // response to become very large; callers that do not need this extra 4588 // information should use the BASIC view instead. 4589 func (c *ServicesConsumerQuotaMetricsLimitsGetCall) View(view string) *ServicesConsumerQuotaMetricsLimitsGetCall { 4590 c.urlParams_.Set("view", view) 4591 return c 4592 } 4593 4594 // Fields allows partial responses to be retrieved. See 4595 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 4596 // details. 4597 func (c *ServicesConsumerQuotaMetricsLimitsGetCall) Fields(s ...googleapi.Field) *ServicesConsumerQuotaMetricsLimitsGetCall { 4598 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 4599 return c 4600 } 4601 4602 // IfNoneMatch sets an optional parameter which makes the operation fail if the 4603 // object's ETag matches the given value. This is useful for getting updates 4604 // only after the object has changed since the last request. 4605 func (c *ServicesConsumerQuotaMetricsLimitsGetCall) IfNoneMatch(entityTag string) *ServicesConsumerQuotaMetricsLimitsGetCall { 4606 c.ifNoneMatch_ = entityTag 4607 return c 4608 } 4609 4610 // Context sets the context to be used in this call's Do method. 4611 func (c *ServicesConsumerQuotaMetricsLimitsGetCall) Context(ctx context.Context) *ServicesConsumerQuotaMetricsLimitsGetCall { 4612 c.ctx_ = ctx 4613 return c 4614 } 4615 4616 // Header returns a http.Header that can be modified by the caller to add 4617 // headers to the request. 4618 func (c *ServicesConsumerQuotaMetricsLimitsGetCall) Header() http.Header { 4619 if c.header_ == nil { 4620 c.header_ = make(http.Header) 4621 } 4622 return c.header_ 4623 } 4624 4625 func (c *ServicesConsumerQuotaMetricsLimitsGetCall) doRequest(alt string) (*http.Response, error) { 4626 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) 4627 if c.ifNoneMatch_ != "" { 4628 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 4629 } 4630 var body io.Reader = nil 4631 c.urlParams_.Set("alt", alt) 4632 c.urlParams_.Set("prettyPrint", "false") 4633 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") 4634 urls += "?" + c.urlParams_.Encode() 4635 req, err := http.NewRequest("GET", urls, body) 4636 if err != nil { 4637 return nil, err 4638 } 4639 req.Header = reqHeaders 4640 googleapi.Expand(req.URL, map[string]string{ 4641 "name": c.name, 4642 }) 4643 return gensupport.SendRequest(c.ctx_, c.s.client, req) 4644 } 4645 4646 // Do executes the "serviceconsumermanagement.services.consumerQuotaMetrics.limits.get" call. 4647 // Any non-2xx status code is an error. Response headers are in either 4648 // *V1Beta1ConsumerQuotaLimit.ServerResponse.Header or (if a response was 4649 // returned at all) in error.(*googleapi.Error).Header. Use 4650 // googleapi.IsNotModified to check whether the returned error was because 4651 // http.StatusNotModified was returned. 4652 func (c *ServicesConsumerQuotaMetricsLimitsGetCall) Do(opts ...googleapi.CallOption) (*V1Beta1ConsumerQuotaLimit, error) { 4653 gensupport.SetOptions(c.urlParams_, opts...) 4654 res, err := c.doRequest("json") 4655 if res != nil && res.StatusCode == http.StatusNotModified { 4656 if res.Body != nil { 4657 res.Body.Close() 4658 } 4659 return nil, gensupport.WrapError(&googleapi.Error{ 4660 Code: res.StatusCode, 4661 Header: res.Header, 4662 }) 4663 } 4664 if err != nil { 4665 return nil, err 4666 } 4667 defer googleapi.CloseBody(res) 4668 if err := googleapi.CheckResponse(res); err != nil { 4669 return nil, gensupport.WrapError(err) 4670 } 4671 ret := &V1Beta1ConsumerQuotaLimit{ 4672 ServerResponse: googleapi.ServerResponse{ 4673 Header: res.Header, 4674 HTTPStatusCode: res.StatusCode, 4675 }, 4676 } 4677 target := &ret 4678 if err := gensupport.DecodeResponse(target, res); err != nil { 4679 return nil, err 4680 } 4681 return ret, nil 4682 } 4683 4684 type ServicesConsumerQuotaMetricsLimitsProducerOverridesCreateCall struct { 4685 s *APIService 4686 parent string 4687 v1beta1quotaoverride *V1Beta1QuotaOverride 4688 urlParams_ gensupport.URLParams 4689 ctx_ context.Context 4690 header_ http.Header 4691 } 4692 4693 // Create: Creates a producer override. A producer override is applied by the 4694 // owner or administrator of a service to increase or decrease the amount of 4695 // quota a consumer of the service is allowed to use. To create multiple 4696 // overrides at once, use ImportProducerOverrides instead. If an override with 4697 // the specified dimensions already exists, this call will fail. To overwrite 4698 // an existing override if one is already present ("upsert" semantics), use 4699 // ImportProducerOverrides instead. 4700 // 4701 // - parent: The resource name of the parent quota limit, returned by a 4702 // ListConsumerQuotaMetrics or GetConsumerQuotaMetric call. An example name 4703 // would be: 4704 // `services/compute.googleapis.com/projects/123/consumerQuotaMetrics/compute. 4705 // googleapis.com%2Fcpus/limits/%2Fproject%2Fregion`. 4706 func (r *ServicesConsumerQuotaMetricsLimitsProducerOverridesService) Create(parent string, v1beta1quotaoverride *V1Beta1QuotaOverride) *ServicesConsumerQuotaMetricsLimitsProducerOverridesCreateCall { 4707 c := &ServicesConsumerQuotaMetricsLimitsProducerOverridesCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 4708 c.parent = parent 4709 c.v1beta1quotaoverride = v1beta1quotaoverride 4710 return c 4711 } 4712 4713 // Force sets the optional parameter "force": Whether to force the creation of 4714 // the quota override. Setting the force parameter to 'true' ignores all quota 4715 // safety checks that would fail the request. QuotaSafetyCheck lists all such 4716 // validations. 4717 func (c *ServicesConsumerQuotaMetricsLimitsProducerOverridesCreateCall) Force(force bool) *ServicesConsumerQuotaMetricsLimitsProducerOverridesCreateCall { 4718 c.urlParams_.Set("force", fmt.Sprint(force)) 4719 return c 4720 } 4721 4722 // ForceJustification sets the optional parameter "forceJustification": If 4723 // force option is set to true, force_justification is suggested to be set to 4724 // log the reason in audit logs. 4725 func (c *ServicesConsumerQuotaMetricsLimitsProducerOverridesCreateCall) ForceJustification(forceJustification string) *ServicesConsumerQuotaMetricsLimitsProducerOverridesCreateCall { 4726 c.urlParams_.Set("forceJustification", forceJustification) 4727 return c 4728 } 4729 4730 // ForceOnly sets the optional parameter "forceOnly": The list of quota safety 4731 // checks to ignore before the override mutation. Unlike 'force' field that 4732 // ignores all the quota safety checks, the 'force_only' field ignores only the 4733 // specified checks; other checks are still enforced. The 'force' and 4734 // 'force_only' fields cannot both be set. 4735 // 4736 // Possible values: 4737 // 4738 // "QUOTA_SAFETY_CHECK_UNSPECIFIED" - Unspecified quota safety check. 4739 // "LIMIT_DECREASE_BELOW_USAGE" - Validates that a quota mutation would not 4740 // 4741 // cause the consumer's effective limit to be lower than the consumer's quota 4742 // usage. 4743 // 4744 // "LIMIT_DECREASE_PERCENTAGE_TOO_HIGH" - Validates that a quota mutation 4745 // 4746 // would not cause the consumer's effective limit to decrease by more than 10 4747 // percent. 4748 func (c *ServicesConsumerQuotaMetricsLimitsProducerOverridesCreateCall) ForceOnly(forceOnly ...string) *ServicesConsumerQuotaMetricsLimitsProducerOverridesCreateCall { 4749 c.urlParams_.SetMulti("forceOnly", append([]string{}, forceOnly...)) 4750 return c 4751 } 4752 4753 // Fields allows partial responses to be retrieved. See 4754 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 4755 // details. 4756 func (c *ServicesConsumerQuotaMetricsLimitsProducerOverridesCreateCall) Fields(s ...googleapi.Field) *ServicesConsumerQuotaMetricsLimitsProducerOverridesCreateCall { 4757 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 4758 return c 4759 } 4760 4761 // Context sets the context to be used in this call's Do method. 4762 func (c *ServicesConsumerQuotaMetricsLimitsProducerOverridesCreateCall) Context(ctx context.Context) *ServicesConsumerQuotaMetricsLimitsProducerOverridesCreateCall { 4763 c.ctx_ = ctx 4764 return c 4765 } 4766 4767 // Header returns a http.Header that can be modified by the caller to add 4768 // headers to the request. 4769 func (c *ServicesConsumerQuotaMetricsLimitsProducerOverridesCreateCall) Header() http.Header { 4770 if c.header_ == nil { 4771 c.header_ = make(http.Header) 4772 } 4773 return c.header_ 4774 } 4775 4776 func (c *ServicesConsumerQuotaMetricsLimitsProducerOverridesCreateCall) doRequest(alt string) (*http.Response, error) { 4777 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) 4778 var body io.Reader = nil 4779 body, err := googleapi.WithoutDataWrapper.JSONReader(c.v1beta1quotaoverride) 4780 if err != nil { 4781 return nil, err 4782 } 4783 c.urlParams_.Set("alt", alt) 4784 c.urlParams_.Set("prettyPrint", "false") 4785 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/producerOverrides") 4786 urls += "?" + c.urlParams_.Encode() 4787 req, err := http.NewRequest("POST", urls, body) 4788 if err != nil { 4789 return nil, err 4790 } 4791 req.Header = reqHeaders 4792 googleapi.Expand(req.URL, map[string]string{ 4793 "parent": c.parent, 4794 }) 4795 return gensupport.SendRequest(c.ctx_, c.s.client, req) 4796 } 4797 4798 // Do executes the "serviceconsumermanagement.services.consumerQuotaMetrics.limits.producerOverrides.create" call. 4799 // Any non-2xx status code is an error. Response headers are in either 4800 // *Operation.ServerResponse.Header or (if a response was returned at all) in 4801 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 4802 // whether the returned error was because http.StatusNotModified was returned. 4803 func (c *ServicesConsumerQuotaMetricsLimitsProducerOverridesCreateCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 4804 gensupport.SetOptions(c.urlParams_, opts...) 4805 res, err := c.doRequest("json") 4806 if res != nil && res.StatusCode == http.StatusNotModified { 4807 if res.Body != nil { 4808 res.Body.Close() 4809 } 4810 return nil, gensupport.WrapError(&googleapi.Error{ 4811 Code: res.StatusCode, 4812 Header: res.Header, 4813 }) 4814 } 4815 if err != nil { 4816 return nil, err 4817 } 4818 defer googleapi.CloseBody(res) 4819 if err := googleapi.CheckResponse(res); err != nil { 4820 return nil, gensupport.WrapError(err) 4821 } 4822 ret := &Operation{ 4823 ServerResponse: googleapi.ServerResponse{ 4824 Header: res.Header, 4825 HTTPStatusCode: res.StatusCode, 4826 }, 4827 } 4828 target := &ret 4829 if err := gensupport.DecodeResponse(target, res); err != nil { 4830 return nil, err 4831 } 4832 return ret, nil 4833 } 4834 4835 type ServicesConsumerQuotaMetricsLimitsProducerOverridesDeleteCall struct { 4836 s *APIService 4837 name string 4838 urlParams_ gensupport.URLParams 4839 ctx_ context.Context 4840 header_ http.Header 4841 } 4842 4843 // Delete: Deletes a producer override. 4844 // 4845 // - name: The resource name of the override to delete. An example name would 4846 // be: 4847 // `services/compute.googleapis.com/projects/123/consumerQuotaMetrics/compute. 4848 // googleapis.com%2Fcpus/limits/%2Fproject%2Fregion/producerOverrides/4a3f2c1d 4849 // `. 4850 func (r *ServicesConsumerQuotaMetricsLimitsProducerOverridesService) Delete(name string) *ServicesConsumerQuotaMetricsLimitsProducerOverridesDeleteCall { 4851 c := &ServicesConsumerQuotaMetricsLimitsProducerOverridesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} 4852 c.name = name 4853 return c 4854 } 4855 4856 // Force sets the optional parameter "force": Whether to force the deletion of 4857 // the quota override. Setting the force parameter to 'true' ignores all quota 4858 // safety checks that would fail the request. QuotaSafetyCheck lists all such 4859 // validations. 4860 func (c *ServicesConsumerQuotaMetricsLimitsProducerOverridesDeleteCall) Force(force bool) *ServicesConsumerQuotaMetricsLimitsProducerOverridesDeleteCall { 4861 c.urlParams_.Set("force", fmt.Sprint(force)) 4862 return c 4863 } 4864 4865 // ForceJustification sets the optional parameter "forceJustification": If 4866 // force option is set to true, force_justification is suggested to be set to 4867 // log the reason in audit logs. 4868 func (c *ServicesConsumerQuotaMetricsLimitsProducerOverridesDeleteCall) ForceJustification(forceJustification string) *ServicesConsumerQuotaMetricsLimitsProducerOverridesDeleteCall { 4869 c.urlParams_.Set("forceJustification", forceJustification) 4870 return c 4871 } 4872 4873 // ForceOnly sets the optional parameter "forceOnly": The list of quota safety 4874 // checks to ignore before the override mutation. Unlike 'force' field that 4875 // ignores all the quota safety checks, the 'force_only' field ignores only the 4876 // specified checks; other checks are still enforced. The 'force' and 4877 // 'force_only' fields cannot both be set. 4878 // 4879 // Possible values: 4880 // 4881 // "QUOTA_SAFETY_CHECK_UNSPECIFIED" - Unspecified quota safety check. 4882 // "LIMIT_DECREASE_BELOW_USAGE" - Validates that a quota mutation would not 4883 // 4884 // cause the consumer's effective limit to be lower than the consumer's quota 4885 // usage. 4886 // 4887 // "LIMIT_DECREASE_PERCENTAGE_TOO_HIGH" - Validates that a quota mutation 4888 // 4889 // would not cause the consumer's effective limit to decrease by more than 10 4890 // percent. 4891 func (c *ServicesConsumerQuotaMetricsLimitsProducerOverridesDeleteCall) ForceOnly(forceOnly ...string) *ServicesConsumerQuotaMetricsLimitsProducerOverridesDeleteCall { 4892 c.urlParams_.SetMulti("forceOnly", append([]string{}, forceOnly...)) 4893 return c 4894 } 4895 4896 // Fields allows partial responses to be retrieved. See 4897 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 4898 // details. 4899 func (c *ServicesConsumerQuotaMetricsLimitsProducerOverridesDeleteCall) Fields(s ...googleapi.Field) *ServicesConsumerQuotaMetricsLimitsProducerOverridesDeleteCall { 4900 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 4901 return c 4902 } 4903 4904 // Context sets the context to be used in this call's Do method. 4905 func (c *ServicesConsumerQuotaMetricsLimitsProducerOverridesDeleteCall) Context(ctx context.Context) *ServicesConsumerQuotaMetricsLimitsProducerOverridesDeleteCall { 4906 c.ctx_ = ctx 4907 return c 4908 } 4909 4910 // Header returns a http.Header that can be modified by the caller to add 4911 // headers to the request. 4912 func (c *ServicesConsumerQuotaMetricsLimitsProducerOverridesDeleteCall) Header() http.Header { 4913 if c.header_ == nil { 4914 c.header_ = make(http.Header) 4915 } 4916 return c.header_ 4917 } 4918 4919 func (c *ServicesConsumerQuotaMetricsLimitsProducerOverridesDeleteCall) doRequest(alt string) (*http.Response, error) { 4920 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) 4921 var body io.Reader = nil 4922 c.urlParams_.Set("alt", alt) 4923 c.urlParams_.Set("prettyPrint", "false") 4924 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") 4925 urls += "?" + c.urlParams_.Encode() 4926 req, err := http.NewRequest("DELETE", urls, body) 4927 if err != nil { 4928 return nil, err 4929 } 4930 req.Header = reqHeaders 4931 googleapi.Expand(req.URL, map[string]string{ 4932 "name": c.name, 4933 }) 4934 return gensupport.SendRequest(c.ctx_, c.s.client, req) 4935 } 4936 4937 // Do executes the "serviceconsumermanagement.services.consumerQuotaMetrics.limits.producerOverrides.delete" call. 4938 // Any non-2xx status code is an error. Response headers are in either 4939 // *Operation.ServerResponse.Header or (if a response was returned at all) in 4940 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 4941 // whether the returned error was because http.StatusNotModified was returned. 4942 func (c *ServicesConsumerQuotaMetricsLimitsProducerOverridesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 4943 gensupport.SetOptions(c.urlParams_, opts...) 4944 res, err := c.doRequest("json") 4945 if res != nil && res.StatusCode == http.StatusNotModified { 4946 if res.Body != nil { 4947 res.Body.Close() 4948 } 4949 return nil, gensupport.WrapError(&googleapi.Error{ 4950 Code: res.StatusCode, 4951 Header: res.Header, 4952 }) 4953 } 4954 if err != nil { 4955 return nil, err 4956 } 4957 defer googleapi.CloseBody(res) 4958 if err := googleapi.CheckResponse(res); err != nil { 4959 return nil, gensupport.WrapError(err) 4960 } 4961 ret := &Operation{ 4962 ServerResponse: googleapi.ServerResponse{ 4963 Header: res.Header, 4964 HTTPStatusCode: res.StatusCode, 4965 }, 4966 } 4967 target := &ret 4968 if err := gensupport.DecodeResponse(target, res); err != nil { 4969 return nil, err 4970 } 4971 return ret, nil 4972 } 4973 4974 type ServicesConsumerQuotaMetricsLimitsProducerOverridesListCall struct { 4975 s *APIService 4976 parent string 4977 urlParams_ gensupport.URLParams 4978 ifNoneMatch_ string 4979 ctx_ context.Context 4980 header_ http.Header 4981 } 4982 4983 // List: Lists all producer overrides on this limit. 4984 // 4985 // - parent: The resource name of the parent quota limit, returned by a 4986 // ListConsumerQuotaMetrics or GetConsumerQuotaMetric call. An example name 4987 // would be: 4988 // `services/compute.googleapis.com/projects/123/consumerQuotaMetrics/compute. 4989 // googleapis.com%2Fcpus/limits/%2Fproject%2Fregion`. 4990 func (r *ServicesConsumerQuotaMetricsLimitsProducerOverridesService) List(parent string) *ServicesConsumerQuotaMetricsLimitsProducerOverridesListCall { 4991 c := &ServicesConsumerQuotaMetricsLimitsProducerOverridesListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 4992 c.parent = parent 4993 return c 4994 } 4995 4996 // PageSize sets the optional parameter "pageSize": Requested size of the next 4997 // page of data. 4998 func (c *ServicesConsumerQuotaMetricsLimitsProducerOverridesListCall) PageSize(pageSize int64) *ServicesConsumerQuotaMetricsLimitsProducerOverridesListCall { 4999 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) 5000 return c 5001 } 5002 5003 // PageToken sets the optional parameter "pageToken": Token identifying which 5004 // result to start with; returned by a previous list call. 5005 func (c *ServicesConsumerQuotaMetricsLimitsProducerOverridesListCall) PageToken(pageToken string) *ServicesConsumerQuotaMetricsLimitsProducerOverridesListCall { 5006 c.urlParams_.Set("pageToken", pageToken) 5007 return c 5008 } 5009 5010 // Fields allows partial responses to be retrieved. See 5011 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 5012 // details. 5013 func (c *ServicesConsumerQuotaMetricsLimitsProducerOverridesListCall) Fields(s ...googleapi.Field) *ServicesConsumerQuotaMetricsLimitsProducerOverridesListCall { 5014 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 5015 return c 5016 } 5017 5018 // IfNoneMatch sets an optional parameter which makes the operation fail if the 5019 // object's ETag matches the given value. This is useful for getting updates 5020 // only after the object has changed since the last request. 5021 func (c *ServicesConsumerQuotaMetricsLimitsProducerOverridesListCall) IfNoneMatch(entityTag string) *ServicesConsumerQuotaMetricsLimitsProducerOverridesListCall { 5022 c.ifNoneMatch_ = entityTag 5023 return c 5024 } 5025 5026 // Context sets the context to be used in this call's Do method. 5027 func (c *ServicesConsumerQuotaMetricsLimitsProducerOverridesListCall) Context(ctx context.Context) *ServicesConsumerQuotaMetricsLimitsProducerOverridesListCall { 5028 c.ctx_ = ctx 5029 return c 5030 } 5031 5032 // Header returns a http.Header that can be modified by the caller to add 5033 // headers to the request. 5034 func (c *ServicesConsumerQuotaMetricsLimitsProducerOverridesListCall) Header() http.Header { 5035 if c.header_ == nil { 5036 c.header_ = make(http.Header) 5037 } 5038 return c.header_ 5039 } 5040 5041 func (c *ServicesConsumerQuotaMetricsLimitsProducerOverridesListCall) doRequest(alt string) (*http.Response, error) { 5042 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) 5043 if c.ifNoneMatch_ != "" { 5044 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 5045 } 5046 var body io.Reader = nil 5047 c.urlParams_.Set("alt", alt) 5048 c.urlParams_.Set("prettyPrint", "false") 5049 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/producerOverrides") 5050 urls += "?" + c.urlParams_.Encode() 5051 req, err := http.NewRequest("GET", urls, body) 5052 if err != nil { 5053 return nil, err 5054 } 5055 req.Header = reqHeaders 5056 googleapi.Expand(req.URL, map[string]string{ 5057 "parent": c.parent, 5058 }) 5059 return gensupport.SendRequest(c.ctx_, c.s.client, req) 5060 } 5061 5062 // Do executes the "serviceconsumermanagement.services.consumerQuotaMetrics.limits.producerOverrides.list" call. 5063 // Any non-2xx status code is an error. Response headers are in either 5064 // *V1Beta1ListProducerOverridesResponse.ServerResponse.Header or (if a 5065 // response was returned at all) in error.(*googleapi.Error).Header. Use 5066 // googleapi.IsNotModified to check whether the returned error was because 5067 // http.StatusNotModified was returned. 5068 func (c *ServicesConsumerQuotaMetricsLimitsProducerOverridesListCall) Do(opts ...googleapi.CallOption) (*V1Beta1ListProducerOverridesResponse, error) { 5069 gensupport.SetOptions(c.urlParams_, opts...) 5070 res, err := c.doRequest("json") 5071 if res != nil && res.StatusCode == http.StatusNotModified { 5072 if res.Body != nil { 5073 res.Body.Close() 5074 } 5075 return nil, gensupport.WrapError(&googleapi.Error{ 5076 Code: res.StatusCode, 5077 Header: res.Header, 5078 }) 5079 } 5080 if err != nil { 5081 return nil, err 5082 } 5083 defer googleapi.CloseBody(res) 5084 if err := googleapi.CheckResponse(res); err != nil { 5085 return nil, gensupport.WrapError(err) 5086 } 5087 ret := &V1Beta1ListProducerOverridesResponse{ 5088 ServerResponse: googleapi.ServerResponse{ 5089 Header: res.Header, 5090 HTTPStatusCode: res.StatusCode, 5091 }, 5092 } 5093 target := &ret 5094 if err := gensupport.DecodeResponse(target, res); err != nil { 5095 return nil, err 5096 } 5097 return ret, nil 5098 } 5099 5100 // Pages invokes f for each page of results. 5101 // A non-nil error returned from f will halt the iteration. 5102 // The provided context supersedes any context provided to the Context method. 5103 func (c *ServicesConsumerQuotaMetricsLimitsProducerOverridesListCall) Pages(ctx context.Context, f func(*V1Beta1ListProducerOverridesResponse) error) error { 5104 c.ctx_ = ctx 5105 defer c.PageToken(c.urlParams_.Get("pageToken")) 5106 for { 5107 x, err := c.Do() 5108 if err != nil { 5109 return err 5110 } 5111 if err := f(x); err != nil { 5112 return err 5113 } 5114 if x.NextPageToken == "" { 5115 return nil 5116 } 5117 c.PageToken(x.NextPageToken) 5118 } 5119 } 5120 5121 type ServicesConsumerQuotaMetricsLimitsProducerOverridesPatchCall struct { 5122 s *APIService 5123 name string 5124 v1beta1quotaoverride *V1Beta1QuotaOverride 5125 urlParams_ gensupport.URLParams 5126 ctx_ context.Context 5127 header_ http.Header 5128 } 5129 5130 // Patch: Updates a producer override. 5131 // 5132 // - name: The resource name of the override to update. An example name would 5133 // be: 5134 // `services/compute.googleapis.com/projects/123/consumerQuotaMetrics/compute. 5135 // googleapis.com%2Fcpus/limits/%2Fproject%2Fregion/producerOverrides/4a3f2c1d 5136 // `. 5137 func (r *ServicesConsumerQuotaMetricsLimitsProducerOverridesService) Patch(name string, v1beta1quotaoverride *V1Beta1QuotaOverride) *ServicesConsumerQuotaMetricsLimitsProducerOverridesPatchCall { 5138 c := &ServicesConsumerQuotaMetricsLimitsProducerOverridesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} 5139 c.name = name 5140 c.v1beta1quotaoverride = v1beta1quotaoverride 5141 return c 5142 } 5143 5144 // Force sets the optional parameter "force": Whether to force the update of 5145 // the quota override. Setting the force parameter to 'true' ignores all quota 5146 // safety checks that would fail the request. QuotaSafetyCheck lists all such 5147 // validations. 5148 func (c *ServicesConsumerQuotaMetricsLimitsProducerOverridesPatchCall) Force(force bool) *ServicesConsumerQuotaMetricsLimitsProducerOverridesPatchCall { 5149 c.urlParams_.Set("force", fmt.Sprint(force)) 5150 return c 5151 } 5152 5153 // ForceJustification sets the optional parameter "forceJustification": If 5154 // force option is set to true, force_justification is suggested to be set to 5155 // log the reason in audit logs. 5156 func (c *ServicesConsumerQuotaMetricsLimitsProducerOverridesPatchCall) ForceJustification(forceJustification string) *ServicesConsumerQuotaMetricsLimitsProducerOverridesPatchCall { 5157 c.urlParams_.Set("forceJustification", forceJustification) 5158 return c 5159 } 5160 5161 // ForceOnly sets the optional parameter "forceOnly": The list of quota safety 5162 // checks to ignore before the override mutation. Unlike 'force' field that 5163 // ignores all the quota safety checks, the 'force_only' field ignores only the 5164 // specified checks; other checks are still enforced. The 'force' and 5165 // 'force_only' fields cannot both be set. 5166 // 5167 // Possible values: 5168 // 5169 // "QUOTA_SAFETY_CHECK_UNSPECIFIED" - Unspecified quota safety check. 5170 // "LIMIT_DECREASE_BELOW_USAGE" - Validates that a quota mutation would not 5171 // 5172 // cause the consumer's effective limit to be lower than the consumer's quota 5173 // usage. 5174 // 5175 // "LIMIT_DECREASE_PERCENTAGE_TOO_HIGH" - Validates that a quota mutation 5176 // 5177 // would not cause the consumer's effective limit to decrease by more than 10 5178 // percent. 5179 func (c *ServicesConsumerQuotaMetricsLimitsProducerOverridesPatchCall) ForceOnly(forceOnly ...string) *ServicesConsumerQuotaMetricsLimitsProducerOverridesPatchCall { 5180 c.urlParams_.SetMulti("forceOnly", append([]string{}, forceOnly...)) 5181 return c 5182 } 5183 5184 // UpdateMask sets the optional parameter "updateMask": Update only the 5185 // specified fields. If unset, all modifiable fields will be updated. 5186 func (c *ServicesConsumerQuotaMetricsLimitsProducerOverridesPatchCall) UpdateMask(updateMask string) *ServicesConsumerQuotaMetricsLimitsProducerOverridesPatchCall { 5187 c.urlParams_.Set("updateMask", updateMask) 5188 return c 5189 } 5190 5191 // Fields allows partial responses to be retrieved. See 5192 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 5193 // details. 5194 func (c *ServicesConsumerQuotaMetricsLimitsProducerOverridesPatchCall) Fields(s ...googleapi.Field) *ServicesConsumerQuotaMetricsLimitsProducerOverridesPatchCall { 5195 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 5196 return c 5197 } 5198 5199 // Context sets the context to be used in this call's Do method. 5200 func (c *ServicesConsumerQuotaMetricsLimitsProducerOverridesPatchCall) Context(ctx context.Context) *ServicesConsumerQuotaMetricsLimitsProducerOverridesPatchCall { 5201 c.ctx_ = ctx 5202 return c 5203 } 5204 5205 // Header returns a http.Header that can be modified by the caller to add 5206 // headers to the request. 5207 func (c *ServicesConsumerQuotaMetricsLimitsProducerOverridesPatchCall) Header() http.Header { 5208 if c.header_ == nil { 5209 c.header_ = make(http.Header) 5210 } 5211 return c.header_ 5212 } 5213 5214 func (c *ServicesConsumerQuotaMetricsLimitsProducerOverridesPatchCall) doRequest(alt string) (*http.Response, error) { 5215 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) 5216 var body io.Reader = nil 5217 body, err := googleapi.WithoutDataWrapper.JSONReader(c.v1beta1quotaoverride) 5218 if err != nil { 5219 return nil, err 5220 } 5221 c.urlParams_.Set("alt", alt) 5222 c.urlParams_.Set("prettyPrint", "false") 5223 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") 5224 urls += "?" + c.urlParams_.Encode() 5225 req, err := http.NewRequest("PATCH", urls, body) 5226 if err != nil { 5227 return nil, err 5228 } 5229 req.Header = reqHeaders 5230 googleapi.Expand(req.URL, map[string]string{ 5231 "name": c.name, 5232 }) 5233 return gensupport.SendRequest(c.ctx_, c.s.client, req) 5234 } 5235 5236 // Do executes the "serviceconsumermanagement.services.consumerQuotaMetrics.limits.producerOverrides.patch" call. 5237 // Any non-2xx status code is an error. Response headers are in either 5238 // *Operation.ServerResponse.Header or (if a response was returned at all) in 5239 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 5240 // whether the returned error was because http.StatusNotModified was returned. 5241 func (c *ServicesConsumerQuotaMetricsLimitsProducerOverridesPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 5242 gensupport.SetOptions(c.urlParams_, opts...) 5243 res, err := c.doRequest("json") 5244 if res != nil && res.StatusCode == http.StatusNotModified { 5245 if res.Body != nil { 5246 res.Body.Close() 5247 } 5248 return nil, gensupport.WrapError(&googleapi.Error{ 5249 Code: res.StatusCode, 5250 Header: res.Header, 5251 }) 5252 } 5253 if err != nil { 5254 return nil, err 5255 } 5256 defer googleapi.CloseBody(res) 5257 if err := googleapi.CheckResponse(res); err != nil { 5258 return nil, gensupport.WrapError(err) 5259 } 5260 ret := &Operation{ 5261 ServerResponse: googleapi.ServerResponse{ 5262 Header: res.Header, 5263 HTTPStatusCode: res.StatusCode, 5264 }, 5265 } 5266 target := &ret 5267 if err := gensupport.DecodeResponse(target, res); err != nil { 5268 return nil, err 5269 } 5270 return ret, nil 5271 } 5272