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 serviceusage provides access to the Service Usage API. 8 // 9 // For product documentation, see: https://cloud.google.com/service-usage/ 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/serviceusage/v1beta1" 27 // ... 28 // ctx := context.Background() 29 // serviceusageService, err := serviceusage.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 // By default, all available scopes (see "Constants") are used to authenticate. 38 // To restrict scopes, use [google.golang.org/api/option.WithScopes]: 39 // 40 // serviceusageService, err := serviceusage.NewService(ctx, option.WithScopes(serviceusage.ServiceManagementScope)) 41 // 42 // To use an API key for authentication (note: some APIs do not support API 43 // keys), use [google.golang.org/api/option.WithAPIKey]: 44 // 45 // serviceusageService, err := serviceusage.NewService(ctx, option.WithAPIKey("AIza...")) 46 // 47 // To use an OAuth token (e.g., a user token obtained via a three-legged OAuth 48 // flow, use [google.golang.org/api/option.WithTokenSource]: 49 // 50 // config := &oauth2.Config{...} 51 // // ... 52 // token, err := config.Exchange(ctx, ...) 53 // serviceusageService, err := serviceusage.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token))) 54 // 55 // See [google.golang.org/api/option.ClientOption] for details on options. 56 package serviceusage // import "google.golang.org/api/serviceusage/v1beta1" 57 58 import ( 59 "bytes" 60 "context" 61 "encoding/json" 62 "errors" 63 "fmt" 64 "io" 65 "net/http" 66 "net/url" 67 "strconv" 68 "strings" 69 70 googleapi "google.golang.org/api/googleapi" 71 internal "google.golang.org/api/internal" 72 gensupport "google.golang.org/api/internal/gensupport" 73 option "google.golang.org/api/option" 74 internaloption "google.golang.org/api/option/internaloption" 75 htransport "google.golang.org/api/transport/http" 76 ) 77 78 // Always reference these packages, just in case the auto-generated code 79 // below doesn't. 80 var _ = bytes.NewBuffer 81 var _ = strconv.Itoa 82 var _ = fmt.Sprintf 83 var _ = json.NewDecoder 84 var _ = io.Copy 85 var _ = url.Parse 86 var _ = gensupport.MarshalJSON 87 var _ = googleapi.Version 88 var _ = errors.New 89 var _ = strings.Replace 90 var _ = context.Canceled 91 var _ = internaloption.WithDefaultEndpoint 92 var _ = internal.Version 93 94 const apiId = "serviceusage:v1beta1" 95 const apiName = "serviceusage" 96 const apiVersion = "v1beta1" 97 const basePath = "https://serviceusage.googleapis.com/" 98 const basePathTemplate = "https://serviceusage.UNIVERSE_DOMAIN/" 99 const mtlsBasePath = "https://serviceusage.mtls.googleapis.com/" 100 101 // OAuth2 scopes used by this API. 102 const ( 103 // See, edit, configure, and delete your Google Cloud data and see the email 104 // address for your Google Account. 105 CloudPlatformScope = "https://www.googleapis.com/auth/cloud-platform" 106 107 // View your data across Google Cloud services and see the email address of 108 // your Google Account 109 CloudPlatformReadOnlyScope = "https://www.googleapis.com/auth/cloud-platform.read-only" 110 111 // Manage your Google API service configuration 112 ServiceManagementScope = "https://www.googleapis.com/auth/service.management" 113 ) 114 115 // NewService creates a new APIService. 116 func NewService(ctx context.Context, opts ...option.ClientOption) (*APIService, error) { 117 scopesOption := internaloption.WithDefaultScopes( 118 "https://www.googleapis.com/auth/cloud-platform", 119 "https://www.googleapis.com/auth/cloud-platform.read-only", 120 "https://www.googleapis.com/auth/service.management", 121 ) 122 // NOTE: prepend, so we don't override user-specified scopes. 123 opts = append([]option.ClientOption{scopesOption}, opts...) 124 opts = append(opts, internaloption.WithDefaultEndpoint(basePath)) 125 opts = append(opts, internaloption.WithDefaultEndpointTemplate(basePathTemplate)) 126 opts = append(opts, internaloption.WithDefaultMTLSEndpoint(mtlsBasePath)) 127 opts = append(opts, internaloption.EnableNewAuthLibrary()) 128 client, endpoint, err := htransport.NewClient(ctx, opts...) 129 if err != nil { 130 return nil, err 131 } 132 s, err := New(client) 133 if err != nil { 134 return nil, err 135 } 136 if endpoint != "" { 137 s.BasePath = endpoint 138 } 139 return s, nil 140 } 141 142 // New creates a new APIService. It uses the provided http.Client for requests. 143 // 144 // Deprecated: please use NewService instead. 145 // To provide a custom HTTP client, use option.WithHTTPClient. 146 // If you are using google.golang.org/api/googleapis/transport.APIKey, use option.WithAPIKey with NewService instead. 147 func New(client *http.Client) (*APIService, error) { 148 if client == nil { 149 return nil, errors.New("client is nil") 150 } 151 s := &APIService{client: client, BasePath: basePath} 152 s.Operations = NewOperationsService(s) 153 s.Services = NewServicesService(s) 154 return s, nil 155 } 156 157 type APIService struct { 158 client *http.Client 159 BasePath string // API endpoint base URL 160 UserAgent string // optional additional User-Agent fragment 161 162 Operations *OperationsService 163 164 Services *ServicesService 165 } 166 167 func (s *APIService) userAgent() string { 168 if s.UserAgent == "" { 169 return googleapi.UserAgent 170 } 171 return googleapi.UserAgent + " " + s.UserAgent 172 } 173 174 func NewOperationsService(s *APIService) *OperationsService { 175 rs := &OperationsService{s: s} 176 return rs 177 } 178 179 type OperationsService struct { 180 s *APIService 181 } 182 183 func NewServicesService(s *APIService) *ServicesService { 184 rs := &ServicesService{s: s} 185 rs.ConsumerQuotaMetrics = NewServicesConsumerQuotaMetricsService(s) 186 return rs 187 } 188 189 type ServicesService struct { 190 s *APIService 191 192 ConsumerQuotaMetrics *ServicesConsumerQuotaMetricsService 193 } 194 195 func NewServicesConsumerQuotaMetricsService(s *APIService) *ServicesConsumerQuotaMetricsService { 196 rs := &ServicesConsumerQuotaMetricsService{s: s} 197 rs.Limits = NewServicesConsumerQuotaMetricsLimitsService(s) 198 return rs 199 } 200 201 type ServicesConsumerQuotaMetricsService struct { 202 s *APIService 203 204 Limits *ServicesConsumerQuotaMetricsLimitsService 205 } 206 207 func NewServicesConsumerQuotaMetricsLimitsService(s *APIService) *ServicesConsumerQuotaMetricsLimitsService { 208 rs := &ServicesConsumerQuotaMetricsLimitsService{s: s} 209 rs.AdminOverrides = NewServicesConsumerQuotaMetricsLimitsAdminOverridesService(s) 210 rs.ConsumerOverrides = NewServicesConsumerQuotaMetricsLimitsConsumerOverridesService(s) 211 return rs 212 } 213 214 type ServicesConsumerQuotaMetricsLimitsService struct { 215 s *APIService 216 217 AdminOverrides *ServicesConsumerQuotaMetricsLimitsAdminOverridesService 218 219 ConsumerOverrides *ServicesConsumerQuotaMetricsLimitsConsumerOverridesService 220 } 221 222 func NewServicesConsumerQuotaMetricsLimitsAdminOverridesService(s *APIService) *ServicesConsumerQuotaMetricsLimitsAdminOverridesService { 223 rs := &ServicesConsumerQuotaMetricsLimitsAdminOverridesService{s: s} 224 return rs 225 } 226 227 type ServicesConsumerQuotaMetricsLimitsAdminOverridesService struct { 228 s *APIService 229 } 230 231 func NewServicesConsumerQuotaMetricsLimitsConsumerOverridesService(s *APIService) *ServicesConsumerQuotaMetricsLimitsConsumerOverridesService { 232 rs := &ServicesConsumerQuotaMetricsLimitsConsumerOverridesService{s: s} 233 return rs 234 } 235 236 type ServicesConsumerQuotaMetricsLimitsConsumerOverridesService struct { 237 s *APIService 238 } 239 240 // AddEnableRulesMetadata: Metadata for the `AddEnableRules` method. 241 type AddEnableRulesMetadata struct { 242 } 243 244 // AddEnableRulesResponse: The response message of `AddEnableRules` method. 245 type AddEnableRulesResponse struct { 246 // AddedValues: The values added to the parent consumer policy. 247 AddedValues []string `json:"addedValues,omitempty"` 248 // Parent: The parent consumer policy. It can be 249 // `projects/12345/consumerPolicies/default`, or 250 // `folders/12345/consumerPolicies/default`, or 251 // `organizations/12345/consumerPolicies/default`. 252 Parent string `json:"parent,omitempty"` 253 // ForceSendFields is a list of field names (e.g. "AddedValues") to 254 // unconditionally include in API requests. By default, fields with empty or 255 // default values are omitted from API requests. See 256 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 257 // details. 258 ForceSendFields []string `json:"-"` 259 // NullFields is a list of field names (e.g. "AddedValues") to include in API 260 // requests with the JSON null value. By default, fields with empty values are 261 // omitted from API requests. See 262 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 263 NullFields []string `json:"-"` 264 } 265 266 func (s *AddEnableRulesResponse) MarshalJSON() ([]byte, error) { 267 type NoMethod AddEnableRulesResponse 268 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 269 } 270 271 // AdminQuotaPolicy: Quota policy created by quota administrator. 272 type AdminQuotaPolicy struct { 273 // Container: The cloud resource container at which the quota policy is 274 // created. The format is `{container_type}/{container_number}` 275 Container string `json:"container,omitempty"` 276 // Dimensions: If this map is nonempty, then this policy applies only to 277 // specific values for dimensions defined in the limit unit. For example, a 278 // policy on a limit with the unit `1/{project}/{region}` could contain an 279 // entry with the key `region` and the value `us-east-1`; the policy is only 280 // applied to quota consumed in that region. This map has the following 281 // restrictions: * If `region` appears as a key, its value must be a valid 282 // Cloud region. * If `zone` appears as a key, its value must be a valid Cloud 283 // zone. * Keys other than `region` or `zone` are not valid. 284 Dimensions map[string]string `json:"dimensions,omitempty"` 285 // Metric: The name of the metric to which this policy applies. An example name 286 // would be: `compute.googleapis.com/cpus` 287 Metric string `json:"metric,omitempty"` 288 // Name: The resource name of the policy. This name is generated by the server 289 // when the policy is created. Example names would be: 290 // `organizations/123/services/compute.googleapis.com/consumerQuotaMetrics/compu 291 // te.googleapis.com%2Fcpus/limits/%2Fproject%2Fregion/adminQuotaPolicies/4a3f2c 292 // 1d` 293 Name string `json:"name,omitempty"` 294 // PolicyValue: The quota policy value. Can be any nonnegative integer, or -1 295 // (unlimited quota). 296 PolicyValue int64 `json:"policyValue,omitempty,string"` 297 // Unit: The limit unit of the limit to which this policy applies. An example 298 // unit would be: `1/{project}/{region}` Note that `{project}` and `{region}` 299 // are not placeholders in this example; the literal characters `{` and `}` 300 // occur in the string. 301 Unit string `json:"unit,omitempty"` 302 // ForceSendFields is a list of field names (e.g. "Container") to 303 // unconditionally include in API requests. By default, fields with empty or 304 // default values are omitted from API requests. See 305 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 306 // details. 307 ForceSendFields []string `json:"-"` 308 // NullFields is a list of field names (e.g. "Container") to include in API 309 // requests with the JSON null value. By default, fields with empty values are 310 // omitted from API requests. See 311 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 312 NullFields []string `json:"-"` 313 } 314 315 func (s *AdminQuotaPolicy) MarshalJSON() ([]byte, error) { 316 type NoMethod AdminQuotaPolicy 317 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 318 } 319 320 // Api: Api is a light-weight descriptor for an API Interface. Interfaces are 321 // also described as "protocol buffer services" in some contexts, such as by 322 // the "service" keyword in a .proto file, but they are different from API 323 // Services, which represent a concrete implementation of an interface as 324 // opposed to simply a description of methods and bindings. They are also 325 // sometimes simply referred to as "APIs" in other contexts, such as the name 326 // of this message itself. See https://cloud.google.com/apis/design/glossary 327 // for detailed terminology. 328 type Api struct { 329 // Methods: The methods of this interface, in unspecified order. 330 Methods []*Method `json:"methods,omitempty"` 331 // Mixins: Included interfaces. See Mixin. 332 Mixins []*Mixin `json:"mixins,omitempty"` 333 // Name: The fully qualified name of this interface, including package name 334 // followed by the interface's simple name. 335 Name string `json:"name,omitempty"` 336 // Options: Any metadata attached to the interface. 337 Options []*Option `json:"options,omitempty"` 338 // SourceContext: Source context for the protocol buffer service represented by 339 // this message. 340 SourceContext *SourceContext `json:"sourceContext,omitempty"` 341 // Syntax: The source syntax of the service. 342 // 343 // Possible values: 344 // "SYNTAX_PROTO2" - Syntax `proto2`. 345 // "SYNTAX_PROTO3" - Syntax `proto3`. 346 // "SYNTAX_EDITIONS" - Syntax `editions`. 347 Syntax string `json:"syntax,omitempty"` 348 // Version: A version string for this interface. If specified, must have the 349 // form `major-version.minor-version`, as in `1.10`. If the minor version is 350 // omitted, it defaults to zero. If the entire version field is empty, the 351 // major version is derived from the package name, as outlined below. If the 352 // field is not empty, the version in the package name will be verified to be 353 // consistent with what is provided here. The versioning schema uses semantic 354 // versioning (http://semver.org) where the major version number indicates a 355 // breaking change and the minor version an additive, non-breaking change. Both 356 // version numbers are signals to users what to expect from different versions, 357 // and should be carefully chosen based on the product plan. The major version 358 // is also reflected in the package name of the interface, which must end in 359 // `v`, as in `google.feature.v1`. For major versions 0 and 1, the suffix can 360 // be omitted. Zero major versions must only be used for experimental, non-GA 361 // interfaces. 362 Version string `json:"version,omitempty"` 363 // ForceSendFields is a list of field names (e.g. "Methods") to unconditionally 364 // include in API requests. By default, fields with empty or default values are 365 // omitted from API requests. See 366 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 367 // details. 368 ForceSendFields []string `json:"-"` 369 // NullFields is a list of field names (e.g. "Methods") to include in API 370 // requests with the JSON null value. By default, fields with empty values are 371 // omitted from API requests. See 372 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 373 NullFields []string `json:"-"` 374 } 375 376 func (s *Api) MarshalJSON() ([]byte, error) { 377 type NoMethod Api 378 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 379 } 380 381 // AuthProvider: Configuration for an authentication provider, including 382 // support for JSON Web Token (JWT) 383 // (https://tools.ietf.org/html/draft-ietf-oauth-json-web-token-32). 384 type AuthProvider struct { 385 // Audiences: The list of JWT audiences 386 // (https://tools.ietf.org/html/draft-ietf-oauth-json-web-token-32#section-4.1.3). 387 // that are allowed to access. A JWT containing any of these audiences will be 388 // accepted. When this setting is absent, JWTs with audiences: - 389 // "https://[service.name]/[google.protobuf.Api.name]" - 390 // "https://[service.name]/" will be accepted. For example, if no audiences are 391 // in the setting, LibraryService API will accept JWTs with the following 392 // audiences: - 393 // https://library-example.googleapis.com/google.example.library.v1.LibraryService 394 // - https://library-example.googleapis.com/ Example: audiences: 395 // bookstore_android.apps.googleusercontent.com, 396 // bookstore_web.apps.googleusercontent.com 397 Audiences string `json:"audiences,omitempty"` 398 // AuthorizationUrl: Redirect URL if JWT token is required but not present or 399 // is expired. Implement authorizationUrl of securityDefinitions in OpenAPI 400 // spec. 401 AuthorizationUrl string `json:"authorizationUrl,omitempty"` 402 // Id: The unique identifier of the auth provider. It will be referred to by 403 // `AuthRequirement.provider_id`. Example: "bookstore_auth". 404 Id string `json:"id,omitempty"` 405 // Issuer: Identifies the principal that issued the JWT. See 406 // https://tools.ietf.org/html/draft-ietf-oauth-json-web-token-32#section-4.1.1 407 // Usually a URL or an email address. Example: https://securetoken.google.com 408 // Example: 1234567-compute@developer.gserviceaccount.com 409 Issuer string `json:"issuer,omitempty"` 410 // JwksUri: URL of the provider's public key set to validate signature of the 411 // JWT. See OpenID Discovery 412 // (https://openid.net/specs/openid-connect-discovery-1_0.html#ProviderMetadata). 413 // Optional if the key set document: - can be retrieved from OpenID Discovery 414 // (https://openid.net/specs/openid-connect-discovery-1_0.html) of the issuer. 415 // - can be inferred from the email domain of the issuer (e.g. a Google service 416 // account). Example: https://www.googleapis.com/oauth2/v1/certs 417 JwksUri string `json:"jwksUri,omitempty"` 418 // JwtLocations: Defines the locations to extract the JWT. For now it is only 419 // used by the Cloud Endpoints to store the OpenAPI extension 420 // [x-google-jwt-locations] 421 // (https://cloud.google.com/endpoints/docs/openapi/openapi-extensions#x-google-jwt-locations) 422 // JWT locations can be one of HTTP headers, URL query parameters or cookies. 423 // The rule is that the first match wins. If not specified, default to use 424 // following 3 locations: 1) Authorization: Bearer 2) x-goog-iap-jwt-assertion 425 // 3) access_token query parameter Default locations can be specified as 426 // followings: jwt_locations: - header: Authorization value_prefix: "Bearer " - 427 // header: x-goog-iap-jwt-assertion - query: access_token 428 JwtLocations []*JwtLocation `json:"jwtLocations,omitempty"` 429 // ForceSendFields is a list of field names (e.g. "Audiences") to 430 // unconditionally include in API requests. By default, fields with empty or 431 // default values are omitted from API requests. See 432 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 433 // details. 434 ForceSendFields []string `json:"-"` 435 // NullFields is a list of field names (e.g. "Audiences") to include in API 436 // requests with the JSON null value. By default, fields with empty values are 437 // omitted from API requests. See 438 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 439 NullFields []string `json:"-"` 440 } 441 442 func (s *AuthProvider) MarshalJSON() ([]byte, error) { 443 type NoMethod AuthProvider 444 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 445 } 446 447 // AuthRequirement: User-defined authentication requirements, including support 448 // for JSON Web Token (JWT) 449 // (https://tools.ietf.org/html/draft-ietf-oauth-json-web-token-32). 450 type AuthRequirement struct { 451 // Audiences: NOTE: This will be deprecated soon, once AuthProvider.audiences 452 // is implemented and accepted in all the runtime components. The list of JWT 453 // audiences 454 // (https://tools.ietf.org/html/draft-ietf-oauth-json-web-token-32#section-4.1.3). 455 // that are allowed to access. A JWT containing any of these audiences will be 456 // accepted. When this setting is absent, only JWTs with audience 457 // "https://Service_name/API_name" will be accepted. For example, if no 458 // audiences are in the setting, LibraryService API will only accept JWTs with 459 // the following audience 460 // "https://library-example.googleapis.com/google.example.library.v1.LibraryServ 461 // ice". Example: audiences: bookstore_android.apps.googleusercontent.com, 462 // bookstore_web.apps.googleusercontent.com 463 Audiences string `json:"audiences,omitempty"` 464 // ProviderId: id from authentication provider. Example: provider_id: 465 // bookstore_auth 466 ProviderId string `json:"providerId,omitempty"` 467 // ForceSendFields is a list of field names (e.g. "Audiences") to 468 // unconditionally include in API requests. By default, fields with empty or 469 // default values are omitted from API requests. See 470 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 471 // details. 472 ForceSendFields []string `json:"-"` 473 // NullFields is a list of field names (e.g. "Audiences") to include in API 474 // requests with the JSON null value. By default, fields with empty values are 475 // omitted from API requests. See 476 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 477 NullFields []string `json:"-"` 478 } 479 480 func (s *AuthRequirement) MarshalJSON() ([]byte, error) { 481 type NoMethod AuthRequirement 482 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 483 } 484 485 // Authentication: `Authentication` defines the authentication configuration 486 // for API methods provided by an API service. Example: name: 487 // calendar.googleapis.com authentication: providers: - id: 488 // google_calendar_auth jwks_uri: https://www.googleapis.com/oauth2/v1/certs 489 // issuer: https://securetoken.google.com rules: - selector: "*" requirements: 490 // provider_id: google_calendar_auth - selector: google.calendar.Delegate 491 // oauth: canonical_scopes: https://www.googleapis.com/auth/calendar.read 492 type Authentication struct { 493 // Providers: Defines a set of authentication providers that a service 494 // supports. 495 Providers []*AuthProvider `json:"providers,omitempty"` 496 // Rules: A list of authentication rules that apply to individual API methods. 497 // **NOTE:** All service configuration rules follow "last one wins" order. 498 Rules []*AuthenticationRule `json:"rules,omitempty"` 499 // ForceSendFields is a list of field names (e.g. "Providers") to 500 // unconditionally include in API requests. By default, fields with empty or 501 // default values are omitted from API requests. See 502 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 503 // details. 504 ForceSendFields []string `json:"-"` 505 // NullFields is a list of field names (e.g. "Providers") to include in API 506 // requests with the JSON null value. By default, fields with empty values are 507 // omitted from API requests. See 508 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 509 NullFields []string `json:"-"` 510 } 511 512 func (s *Authentication) MarshalJSON() ([]byte, error) { 513 type NoMethod Authentication 514 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 515 } 516 517 // AuthenticationRule: Authentication rules for the service. By default, if a 518 // method has any authentication requirements, every request must include a 519 // valid credential matching one of the requirements. It's an error to include 520 // more than one kind of credential in a single request. If a method doesn't 521 // have any auth requirements, request credentials will be ignored. 522 type AuthenticationRule struct { 523 // AllowWithoutCredential: If true, the service accepts API keys without any 524 // other credential. This flag only applies to HTTP and gRPC requests. 525 AllowWithoutCredential bool `json:"allowWithoutCredential,omitempty"` 526 // Oauth: The requirements for OAuth credentials. 527 Oauth *OAuthRequirements `json:"oauth,omitempty"` 528 // Requirements: Requirements for additional authentication providers. 529 Requirements []*AuthRequirement `json:"requirements,omitempty"` 530 // Selector: Selects the methods to which this rule applies. Refer to selector 531 // for syntax details. 532 Selector string `json:"selector,omitempty"` 533 // ForceSendFields is a list of field names (e.g. "AllowWithoutCredential") to 534 // unconditionally include in API requests. By default, fields with empty or 535 // default values are omitted from API requests. See 536 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 537 // details. 538 ForceSendFields []string `json:"-"` 539 // NullFields is a list of field names (e.g. "AllowWithoutCredential") to 540 // include in API requests with the JSON null value. By default, fields with 541 // empty values are omitted from API requests. See 542 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 543 NullFields []string `json:"-"` 544 } 545 546 func (s *AuthenticationRule) MarshalJSON() ([]byte, error) { 547 type NoMethod AuthenticationRule 548 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 549 } 550 551 // Backend: `Backend` defines the backend configuration for a service. 552 type Backend struct { 553 // Rules: A list of API backend rules that apply to individual API methods. 554 // **NOTE:** All service configuration rules follow "last one wins" order. 555 Rules []*BackendRule `json:"rules,omitempty"` 556 // ForceSendFields is a list of field names (e.g. "Rules") to unconditionally 557 // include in API requests. By default, fields with empty or default values are 558 // omitted from API requests. See 559 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 560 // details. 561 ForceSendFields []string `json:"-"` 562 // NullFields is a list of field names (e.g. "Rules") to include in API 563 // requests with the JSON null value. By default, fields with empty values are 564 // omitted from API requests. See 565 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 566 NullFields []string `json:"-"` 567 } 568 569 func (s *Backend) MarshalJSON() ([]byte, error) { 570 type NoMethod Backend 571 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 572 } 573 574 // BackendRule: A backend rule provides configuration for an individual API 575 // element. 576 type BackendRule struct { 577 // Address: The address of the API backend. The scheme is used to determine the 578 // backend protocol and security. The following schemes are accepted: SCHEME 579 // PROTOCOL SECURITY http:// HTTP None https:// HTTP TLS grpc:// gRPC None 580 // grpcs:// gRPC TLS It is recommended to explicitly include a scheme. Leaving 581 // out the scheme may cause constrasting behaviors across platforms. If the 582 // port is unspecified, the default is: - 80 for schemes without TLS - 443 for 583 // schemes with TLS For HTTP backends, use protocol to specify the protocol 584 // version. 585 Address string `json:"address,omitempty"` 586 // Deadline: The number of seconds to wait for a response from a request. The 587 // default varies based on the request protocol and deployment environment. 588 Deadline float64 `json:"deadline,omitempty"` 589 // DisableAuth: When disable_auth is true, a JWT ID token won't be generated 590 // and the original "Authorization" HTTP header will be preserved. If the 591 // header is used to carry the original token and is expected by the backend, 592 // this field must be set to true to preserve the header. 593 DisableAuth bool `json:"disableAuth,omitempty"` 594 // JwtAudience: The JWT audience is used when generating a JWT ID token for the 595 // backend. This ID token will be added in the HTTP "authorization" header, and 596 // sent to the backend. 597 JwtAudience string `json:"jwtAudience,omitempty"` 598 // MinDeadline: Deprecated, do not use. 599 MinDeadline float64 `json:"minDeadline,omitempty"` 600 // OperationDeadline: The number of seconds to wait for the completion of a 601 // long running operation. The default is no deadline. 602 OperationDeadline float64 `json:"operationDeadline,omitempty"` 603 // OverridesByRequestProtocol: The map between request protocol and the backend 604 // address. 605 OverridesByRequestProtocol map[string]BackendRule `json:"overridesByRequestProtocol,omitempty"` 606 // Possible values: 607 // "PATH_TRANSLATION_UNSPECIFIED" 608 // "CONSTANT_ADDRESS" - Use the backend address as-is, with no modification 609 // to the path. If the URL pattern contains variables, the variable names and 610 // values will be appended to the query string. If a query string parameter and 611 // a URL pattern variable have the same name, this may result in duplicate keys 612 // in the query string. # Examples Given the following operation config: Method 613 // path: /api/company/{cid}/user/{uid} Backend address: 614 // https://example.cloudfunctions.net/getUser Requests to the following request 615 // paths will call the backend at the translated path: Request path: 616 // /api/company/widgetworks/user/johndoe Translated: 617 // https://example.cloudfunctions.net/getUser?cid=widgetworks&uid=johndoe 618 // Request path: /api/company/widgetworks/user/johndoe?timezone=EST Translated: 619 // https://example.cloudfunctions.net/getUser?timezone=EST&cid=widgetworks&uid=johndoe 620 // "APPEND_PATH_TO_ADDRESS" - The request path will be appended to the 621 // backend address. # Examples Given the following operation config: Method 622 // path: /api/company/{cid}/user/{uid} Backend address: 623 // https://example.appspot.com Requests to the following request paths will 624 // call the backend at the translated path: Request path: 625 // /api/company/widgetworks/user/johndoe Translated: 626 // https://example.appspot.com/api/company/widgetworks/user/johndoe Request 627 // path: /api/company/widgetworks/user/johndoe?timezone=EST Translated: 628 // https://example.appspot.com/api/company/widgetworks/user/johndoe?timezone=EST 629 PathTranslation string `json:"pathTranslation,omitempty"` 630 // Protocol: The protocol used for sending a request to the backend. The 631 // supported values are "http/1.1" and "h2". The default value is inferred from 632 // the scheme in the address field: SCHEME PROTOCOL http:// http/1.1 https:// 633 // http/1.1 grpc:// h2 grpcs:// h2 For secure HTTP backends (https://) that 634 // support HTTP/2, set this field to "h2" for improved performance. Configuring 635 // this field to non-default values is only supported for secure HTTP backends. 636 // This field will be ignored for all other backends. See 637 // https://www.iana.org/assignments/tls-extensiontype-values/tls-extensiontype-values.xhtml#alpn-protocol-ids 638 // for more details on the supported values. 639 Protocol string `json:"protocol,omitempty"` 640 // Selector: Selects the methods to which this rule applies. Refer to selector 641 // for syntax details. 642 Selector string `json:"selector,omitempty"` 643 // ForceSendFields is a list of field names (e.g. "Address") to unconditionally 644 // include in API requests. By default, fields with empty or default values are 645 // omitted from API requests. See 646 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 647 // details. 648 ForceSendFields []string `json:"-"` 649 // NullFields is a list of field names (e.g. "Address") to include in API 650 // requests with the JSON null value. By default, fields with empty values are 651 // omitted from API requests. See 652 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 653 NullFields []string `json:"-"` 654 } 655 656 func (s *BackendRule) MarshalJSON() ([]byte, error) { 657 type NoMethod BackendRule 658 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 659 } 660 661 func (s *BackendRule) UnmarshalJSON(data []byte) error { 662 type NoMethod BackendRule 663 var s1 struct { 664 Deadline gensupport.JSONFloat64 `json:"deadline"` 665 MinDeadline gensupport.JSONFloat64 `json:"minDeadline"` 666 OperationDeadline gensupport.JSONFloat64 `json:"operationDeadline"` 667 *NoMethod 668 } 669 s1.NoMethod = (*NoMethod)(s) 670 if err := json.Unmarshal(data, &s1); err != nil { 671 return err 672 } 673 s.Deadline = float64(s1.Deadline) 674 s.MinDeadline = float64(s1.MinDeadline) 675 s.OperationDeadline = float64(s1.OperationDeadline) 676 return nil 677 } 678 679 // BatchCreateAdminOverridesResponse: Response message for 680 // BatchCreateAdminOverrides 681 type BatchCreateAdminOverridesResponse struct { 682 // Overrides: The overrides that were created. 683 Overrides []*QuotaOverride `json:"overrides,omitempty"` 684 // ForceSendFields is a list of field names (e.g. "Overrides") to 685 // unconditionally include in API requests. By default, fields with empty or 686 // default values are omitted from API requests. See 687 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 688 // details. 689 ForceSendFields []string `json:"-"` 690 // NullFields is a list of field names (e.g. "Overrides") to include in API 691 // requests with the JSON null value. By default, fields with empty values are 692 // omitted from API requests. See 693 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 694 NullFields []string `json:"-"` 695 } 696 697 func (s *BatchCreateAdminOverridesResponse) MarshalJSON() ([]byte, error) { 698 type NoMethod BatchCreateAdminOverridesResponse 699 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 700 } 701 702 // BatchCreateConsumerOverridesResponse: Response message for 703 // BatchCreateConsumerOverrides 704 type BatchCreateConsumerOverridesResponse struct { 705 // Overrides: The overrides that were created. 706 Overrides []*QuotaOverride `json:"overrides,omitempty"` 707 // ForceSendFields is a list of field names (e.g. "Overrides") to 708 // unconditionally include in API requests. By default, fields with empty or 709 // default values are omitted from API requests. See 710 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 711 // details. 712 ForceSendFields []string `json:"-"` 713 // NullFields is a list of field names (e.g. "Overrides") to include in API 714 // requests with the JSON null value. By default, fields with empty values are 715 // omitted from API requests. See 716 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 717 NullFields []string `json:"-"` 718 } 719 720 func (s *BatchCreateConsumerOverridesResponse) MarshalJSON() ([]byte, error) { 721 type NoMethod BatchCreateConsumerOverridesResponse 722 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 723 } 724 725 // BatchEnableServicesRequest: Request message for the `BatchEnableServices` 726 // method. 727 type BatchEnableServicesRequest struct { 728 // ServiceIds: The identifiers of the services to enable on the project. A 729 // valid identifier would be: serviceusage.googleapis.com Enabling services 730 // requires that each service is public or is shared with the user enabling the 731 // service. Two or more services must be specified. To enable a single service, 732 // use the `EnableService` method instead. A single request can enable a 733 // maximum of 20 services at a time. If more than 20 services are specified, 734 // the request will fail, and no state changes will occur. 735 ServiceIds []string `json:"serviceIds,omitempty"` 736 // ForceSendFields is a list of field names (e.g. "ServiceIds") 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. "ServiceIds") 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 *BatchEnableServicesRequest) MarshalJSON() ([]byte, error) { 750 type NoMethod BatchEnableServicesRequest 751 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 752 } 753 754 // BatchEnableServicesResponse: Response message for the `BatchEnableServices` 755 // method. This response message is assigned to the `response` field of the 756 // returned Operation when that operation is done. 757 type BatchEnableServicesResponse struct { 758 // Failures: If allow_partial_success is true, and one or more services could 759 // not be enabled, this field contains the details about each failure. 760 Failures []*EnableFailure `json:"failures,omitempty"` 761 // Services: The new state of the services after enabling. 762 Services []*GoogleApiServiceusageV1Service `json:"services,omitempty"` 763 // ForceSendFields is a list of field names (e.g. "Failures") to 764 // unconditionally include in API requests. By default, fields with empty or 765 // default values are omitted from API requests. See 766 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 767 // details. 768 ForceSendFields []string `json:"-"` 769 // NullFields is a list of field names (e.g. "Failures") to include in API 770 // requests with the JSON null value. By default, fields with empty values are 771 // omitted from API requests. See 772 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 773 NullFields []string `json:"-"` 774 } 775 776 func (s *BatchEnableServicesResponse) MarshalJSON() ([]byte, error) { 777 type NoMethod BatchEnableServicesResponse 778 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 779 } 780 781 // Billing: Billing related configuration of the service. The following example 782 // shows how to configure monitored resources and metrics for billing, 783 // `consumer_destinations` is the only supported destination and the monitored 784 // resources need at least one label key `cloud.googleapis.com/location` to 785 // indicate the location of the billing usage, using different monitored 786 // resources between monitoring and billing is recommended so they can be 787 // evolved independently: monitored_resources: - type: 788 // library.googleapis.com/billing_branch labels: - key: 789 // cloud.googleapis.com/location description: | Predefined label to support 790 // billing location restriction. - key: city description: | Custom label to 791 // define the city where the library branch is located in. - key: name 792 // description: Custom label to define the name of the library branch. metrics: 793 // - name: library.googleapis.com/book/borrowed_count metric_kind: DELTA 794 // value_type: INT64 unit: "1" billing: consumer_destinations: - 795 // monitored_resource: library.googleapis.com/billing_branch metrics: - 796 // library.googleapis.com/book/borrowed_count 797 type Billing struct { 798 // ConsumerDestinations: Billing configurations for sending metrics to the 799 // consumer project. There can be multiple consumer destinations per service, 800 // each one must have a different monitored resource type. A metric can be used 801 // in at most one consumer destination. 802 ConsumerDestinations []*BillingDestination `json:"consumerDestinations,omitempty"` 803 // ForceSendFields is a list of field names (e.g. "ConsumerDestinations") to 804 // unconditionally include in API requests. By default, fields with empty or 805 // default values are omitted from API requests. See 806 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 807 // details. 808 ForceSendFields []string `json:"-"` 809 // NullFields is a list of field names (e.g. "ConsumerDestinations") to include 810 // in API requests with the JSON null value. By default, fields with empty 811 // values are omitted from API requests. See 812 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 813 NullFields []string `json:"-"` 814 } 815 816 func (s *Billing) MarshalJSON() ([]byte, error) { 817 type NoMethod Billing 818 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 819 } 820 821 // BillingDestination: Configuration of a specific billing destination 822 // (Currently only support bill against consumer project). 823 type BillingDestination struct { 824 // Metrics: Names of the metrics to report to this billing destination. Each 825 // name must be defined in Service.metrics section. 826 Metrics []string `json:"metrics,omitempty"` 827 // MonitoredResource: The monitored resource type. The type must be defined in 828 // Service.monitored_resources section. 829 MonitoredResource string `json:"monitoredResource,omitempty"` 830 // ForceSendFields is a list of field names (e.g. "Metrics") to unconditionally 831 // include in API requests. By default, fields with empty or default values are 832 // omitted from API requests. See 833 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 834 // details. 835 ForceSendFields []string `json:"-"` 836 // NullFields is a list of field names (e.g. "Metrics") to include in API 837 // requests with the JSON null value. By default, fields with empty values are 838 // omitted from API requests. See 839 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 840 NullFields []string `json:"-"` 841 } 842 843 func (s *BillingDestination) MarshalJSON() ([]byte, error) { 844 type NoMethod BillingDestination 845 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 846 } 847 848 // ClientLibrarySettings: Details about how and where to publish client 849 // libraries. 850 type ClientLibrarySettings struct { 851 // CppSettings: Settings for C++ client libraries. 852 CppSettings *CppSettings `json:"cppSettings,omitempty"` 853 // DotnetSettings: Settings for .NET client libraries. 854 DotnetSettings *DotnetSettings `json:"dotnetSettings,omitempty"` 855 // GoSettings: Settings for Go client libraries. 856 GoSettings *GoSettings `json:"goSettings,omitempty"` 857 // JavaSettings: Settings for legacy Java features, supported in the Service 858 // YAML. 859 JavaSettings *JavaSettings `json:"javaSettings,omitempty"` 860 // LaunchStage: Launch stage of this version of the API. 861 // 862 // Possible values: 863 // "LAUNCH_STAGE_UNSPECIFIED" - Do not use this default value. 864 // "UNIMPLEMENTED" - The feature is not yet implemented. Users can not use 865 // it. 866 // "PRELAUNCH" - Prelaunch features are hidden from users and are only 867 // visible internally. 868 // "EARLY_ACCESS" - Early Access features are limited to a closed group of 869 // testers. To use these features, you must sign up in advance and sign a 870 // Trusted Tester agreement (which includes confidentiality provisions). These 871 // features may be unstable, changed in backward-incompatible ways, and are not 872 // guaranteed to be released. 873 // "ALPHA" - Alpha is a limited availability test for releases before they 874 // are cleared for widespread use. By Alpha, all significant design issues are 875 // resolved and we are in the process of verifying functionality. Alpha 876 // customers need to apply for access, agree to applicable terms, and have 877 // their projects allowlisted. Alpha releases don't have to be feature 878 // complete, no SLAs are provided, and there are no technical support 879 // obligations, but they will be far enough along that customers can actually 880 // use them in test environments or for limited-use tests -- just like they 881 // would in normal production cases. 882 // "BETA" - Beta is the point at which we are ready to open a release for any 883 // customer to use. There are no SLA or technical support obligations in a Beta 884 // release. Products will be complete from a feature perspective, but may have 885 // some open outstanding issues. Beta releases are suitable for limited 886 // production use cases. 887 // "GA" - GA features are open to all developers and are considered stable 888 // and fully qualified for production use. 889 // "DEPRECATED" - Deprecated features are scheduled to be shut down and 890 // removed. For more information, see the "Deprecation Policy" section of our 891 // [Terms of Service](https://cloud.google.com/terms/) and the [Google Cloud 892 // Platform Subject to the Deprecation 893 // Policy](https://cloud.google.com/terms/deprecation) documentation. 894 LaunchStage string `json:"launchStage,omitempty"` 895 // NodeSettings: Settings for Node client libraries. 896 NodeSettings *NodeSettings `json:"nodeSettings,omitempty"` 897 // PhpSettings: Settings for PHP client libraries. 898 PhpSettings *PhpSettings `json:"phpSettings,omitempty"` 899 // PythonSettings: Settings for Python client libraries. 900 PythonSettings *PythonSettings `json:"pythonSettings,omitempty"` 901 // RestNumericEnums: When using transport=rest, the client request will encode 902 // enums as numbers rather than strings. 903 RestNumericEnums bool `json:"restNumericEnums,omitempty"` 904 // RubySettings: Settings for Ruby client libraries. 905 RubySettings *RubySettings `json:"rubySettings,omitempty"` 906 // Version: Version of the API to apply these settings to. This is the full 907 // protobuf package for the API, ending in the version element. Examples: 908 // "google.cloud.speech.v1" and "google.spanner.admin.database.v1". 909 Version string `json:"version,omitempty"` 910 // ForceSendFields is a list of field names (e.g. "CppSettings") to 911 // unconditionally include in API requests. By default, fields with empty or 912 // default values are omitted from API requests. See 913 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 914 // details. 915 ForceSendFields []string `json:"-"` 916 // NullFields is a list of field names (e.g. "CppSettings") to include in API 917 // requests with the JSON null value. By default, fields with empty values are 918 // omitted from API requests. See 919 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 920 NullFields []string `json:"-"` 921 } 922 923 func (s *ClientLibrarySettings) MarshalJSON() ([]byte, error) { 924 type NoMethod ClientLibrarySettings 925 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 926 } 927 928 // CommonLanguageSettings: Required information for every language. 929 type CommonLanguageSettings struct { 930 // Destinations: The destination where API teams want this client library to be 931 // published. 932 // 933 // Possible values: 934 // "CLIENT_LIBRARY_DESTINATION_UNSPECIFIED" - Client libraries will neither 935 // be generated nor published to package managers. 936 // "GITHUB" - Generate the client library in a repo under 937 // github.com/googleapis, but don't publish it to package managers. 938 // "PACKAGE_MANAGER" - Publish the library to package managers like nuget.org 939 // and npmjs.com. 940 Destinations []string `json:"destinations,omitempty"` 941 // ReferenceDocsUri: Link to automatically generated reference documentation. 942 // Example: https://cloud.google.com/nodejs/docs/reference/asset/latest 943 ReferenceDocsUri string `json:"referenceDocsUri,omitempty"` 944 // ForceSendFields is a list of field names (e.g. "Destinations") to 945 // unconditionally include in API requests. By default, fields with empty or 946 // default values are omitted from API requests. See 947 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 948 // details. 949 ForceSendFields []string `json:"-"` 950 // NullFields is a list of field names (e.g. "Destinations") to include in API 951 // requests with the JSON null value. By default, fields with empty values are 952 // omitted from API requests. See 953 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 954 NullFields []string `json:"-"` 955 } 956 957 func (s *CommonLanguageSettings) MarshalJSON() ([]byte, error) { 958 type NoMethod CommonLanguageSettings 959 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 960 } 961 962 // ConsumerPolicy: Consumer Policy is a set of rules that define what services 963 // or service groups can be used for a cloud resource hierarchy. 964 type ConsumerPolicy struct { 965 // Annotations: Optional. Annotations is an unstructured key-value map stored 966 // with a policy that may be set by external tools to store and retrieve 967 // arbitrary metadata. They are not queryable and should be preserved when 968 // modifying objects. AIP-128 (https://google.aip.dev/128#annotations) 969 Annotations map[string]string `json:"annotations,omitempty"` 970 // EnableRules: Enable rules define usable services and service groups. 971 EnableRules []*EnableRule `json:"enableRules,omitempty"` 972 // Etag: An opaque tag indicating the current version of the policy, used for 973 // concurrency control. 974 Etag string `json:"etag,omitempty"` 975 // Name: Output only. The resource name of the policy. We only allow consumer 976 // policy name as `default` for now: `projects/12345/consumerPolicies/default`, 977 // `folders/12345/consumerPolicies/default`, 978 // `organizations/12345/consumerPolicies/default`. 979 Name string `json:"name,omitempty"` 980 // UpdateTime: The last-modified time. 981 UpdateTime string `json:"updateTime,omitempty"` 982 // ForceSendFields is a list of field names (e.g. "Annotations") to 983 // unconditionally include in API requests. By default, fields with empty or 984 // default values are omitted from API requests. See 985 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 986 // details. 987 ForceSendFields []string `json:"-"` 988 // NullFields is a list of field names (e.g. "Annotations") to include in API 989 // requests with the JSON null value. By default, fields with empty values are 990 // omitted from API requests. See 991 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 992 NullFields []string `json:"-"` 993 } 994 995 func (s *ConsumerPolicy) MarshalJSON() ([]byte, error) { 996 type NoMethod ConsumerPolicy 997 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 998 } 999 1000 // ConsumerQuotaLimit: Consumer quota settings for a quota limit. 1001 type ConsumerQuotaLimit struct { 1002 // AllowsAdminOverrides: Whether admin overrides are allowed on this limit 1003 AllowsAdminOverrides bool `json:"allowsAdminOverrides,omitempty"` 1004 // IsPrecise: Whether this limit is precise or imprecise. 1005 IsPrecise bool `json:"isPrecise,omitempty"` 1006 // Metric: The name of the parent metric of this limit. An example name would 1007 // be: `compute.googleapis.com/cpus` 1008 Metric string `json:"metric,omitempty"` 1009 // Name: The resource name of the quota limit. An example name would be: 1010 // `projects/123/services/compute.googleapis.com/consumerQuotaMetrics/compute.go 1011 // ogleapis.com%2Fcpus/limits/%2Fproject%2Fregion` The resource name is 1012 // intended to be opaque and should not be parsed for its component strings, 1013 // since its representation could change in the future. 1014 Name string `json:"name,omitempty"` 1015 // QuotaBuckets: Summary of the enforced quota buckets, organized by quota 1016 // dimension, ordered from least specific to most specific (for example, the 1017 // global default bucket, with no quota dimensions, will always appear first). 1018 QuotaBuckets []*QuotaBucket `json:"quotaBuckets,omitempty"` 1019 // SupportedLocations: List of all supported locations. This field is present 1020 // only if the limit has a {region} or {zone} dimension. 1021 SupportedLocations []string `json:"supportedLocations,omitempty"` 1022 // Unit: The limit unit. An example unit would be `1/{project}/{region}` Note 1023 // that `{project}` and `{region}` are not placeholders in this example; the 1024 // literal characters `{` and `}` occur in the string. 1025 Unit string `json:"unit,omitempty"` 1026 1027 // ServerResponse contains the HTTP response code and headers from the server. 1028 googleapi.ServerResponse `json:"-"` 1029 // ForceSendFields is a list of field names (e.g. "AllowsAdminOverrides") to 1030 // unconditionally include in API requests. By default, fields with empty or 1031 // default values are omitted from API requests. See 1032 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1033 // details. 1034 ForceSendFields []string `json:"-"` 1035 // NullFields is a list of field names (e.g. "AllowsAdminOverrides") to include 1036 // in API requests with the JSON null value. By default, fields with empty 1037 // values are omitted from API requests. See 1038 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1039 NullFields []string `json:"-"` 1040 } 1041 1042 func (s *ConsumerQuotaLimit) MarshalJSON() ([]byte, error) { 1043 type NoMethod ConsumerQuotaLimit 1044 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1045 } 1046 1047 // ConsumerQuotaMetric: Consumer quota settings for a quota metric. 1048 type ConsumerQuotaMetric struct { 1049 // ConsumerQuotaLimits: The consumer quota for each quota limit defined on the 1050 // metric. 1051 ConsumerQuotaLimits []*ConsumerQuotaLimit `json:"consumerQuotaLimits,omitempty"` 1052 // DescendantConsumerQuotaLimits: The quota limits targeting the descendant 1053 // containers of the consumer in request. If the consumer in request is of type 1054 // `organizations` or `folders`, the field will list per-project limits in the 1055 // metric; if the consumer in request is of type `project`, the field will be 1056 // empty. The `quota_buckets` field of each descendant consumer quota limit 1057 // will not be populated. 1058 DescendantConsumerQuotaLimits []*ConsumerQuotaLimit `json:"descendantConsumerQuotaLimits,omitempty"` 1059 // DisplayName: The display name of the metric. An example name would be: 1060 // `CPUs` 1061 DisplayName string `json:"displayName,omitempty"` 1062 // Metric: The name of the metric. An example name would be: 1063 // `compute.googleapis.com/cpus` 1064 Metric string `json:"metric,omitempty"` 1065 // Name: The resource name of the quota settings on this metric for this 1066 // consumer. An example name would be: 1067 // `projects/123/services/compute.googleapis.com/consumerQuotaMetrics/compute.go 1068 // ogleapis.com%2Fcpus` The resource name is intended to be opaque and should 1069 // not be parsed for its component strings, since its representation could 1070 // change in the future. 1071 Name string `json:"name,omitempty"` 1072 // Unit: The units in which the metric value is reported. 1073 Unit string `json:"unit,omitempty"` 1074 1075 // ServerResponse contains the HTTP response code and headers from the server. 1076 googleapi.ServerResponse `json:"-"` 1077 // ForceSendFields is a list of field names (e.g. "ConsumerQuotaLimits") to 1078 // unconditionally include in API requests. By default, fields with empty or 1079 // default values are omitted from API requests. See 1080 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1081 // details. 1082 ForceSendFields []string `json:"-"` 1083 // NullFields is a list of field names (e.g. "ConsumerQuotaLimits") to include 1084 // in API requests with the JSON null value. By default, fields with empty 1085 // values are omitted from API requests. See 1086 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1087 NullFields []string `json:"-"` 1088 } 1089 1090 func (s *ConsumerQuotaMetric) MarshalJSON() ([]byte, error) { 1091 type NoMethod ConsumerQuotaMetric 1092 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1093 } 1094 1095 // Context: `Context` defines which contexts an API requests. Example: context: 1096 // rules: - selector: "*" requested: - google.rpc.context.ProjectContext - 1097 // google.rpc.context.OriginContext The above specifies that all methods in the 1098 // API request `google.rpc.context.ProjectContext` and 1099 // `google.rpc.context.OriginContext`. Available context types are defined in 1100 // package `google.rpc.context`. This also provides mechanism to allowlist any 1101 // protobuf message extension that can be sent in grpc metadata using 1102 // “x-goog-ext--bin” and “x-goog-ext--jspb” format. For example, list 1103 // any service specific protobuf types that can appear in grpc metadata as 1104 // follows in your yaml file: Example: context: rules: - selector: 1105 // "google.example.library.v1.LibraryService.CreateBook" 1106 // allowed_request_extensions: - google.foo.v1.NewExtension 1107 // allowed_response_extensions: - google.foo.v1.NewExtension You can also 1108 // specify extension ID instead of fully qualified extension name here. 1109 type Context struct { 1110 // Rules: A list of RPC context rules that apply to individual API methods. 1111 // **NOTE:** All service configuration rules follow "last one wins" order. 1112 Rules []*ContextRule `json:"rules,omitempty"` 1113 // ForceSendFields is a list of field names (e.g. "Rules") to unconditionally 1114 // include in API requests. By default, fields with empty or default values are 1115 // omitted from API requests. See 1116 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1117 // details. 1118 ForceSendFields []string `json:"-"` 1119 // NullFields is a list of field names (e.g. "Rules") to include in API 1120 // requests with the JSON null value. By default, fields with empty values are 1121 // omitted from API requests. See 1122 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1123 NullFields []string `json:"-"` 1124 } 1125 1126 func (s *Context) MarshalJSON() ([]byte, error) { 1127 type NoMethod Context 1128 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1129 } 1130 1131 // ContextRule: A context rule provides information about the context for an 1132 // individual API element. 1133 type ContextRule struct { 1134 // AllowedRequestExtensions: A list of full type names or extension IDs of 1135 // extensions allowed in grpc side channel from client to backend. 1136 AllowedRequestExtensions []string `json:"allowedRequestExtensions,omitempty"` 1137 // AllowedResponseExtensions: A list of full type names or extension IDs of 1138 // extensions allowed in grpc side channel from backend to client. 1139 AllowedResponseExtensions []string `json:"allowedResponseExtensions,omitempty"` 1140 // Provided: A list of full type names of provided contexts. 1141 Provided []string `json:"provided,omitempty"` 1142 // Requested: A list of full type names of requested contexts. 1143 Requested []string `json:"requested,omitempty"` 1144 // Selector: Selects the methods to which this rule applies. Refer to selector 1145 // for syntax details. 1146 Selector string `json:"selector,omitempty"` 1147 // ForceSendFields is a list of field names (e.g. "AllowedRequestExtensions") 1148 // to unconditionally include in API requests. By default, fields with empty or 1149 // default values are omitted from API requests. See 1150 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1151 // details. 1152 ForceSendFields []string `json:"-"` 1153 // NullFields is a list of field names (e.g. "AllowedRequestExtensions") to 1154 // include in API requests with the JSON null value. By default, fields with 1155 // empty values are omitted from API requests. See 1156 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1157 NullFields []string `json:"-"` 1158 } 1159 1160 func (s *ContextRule) MarshalJSON() ([]byte, error) { 1161 type NoMethod ContextRule 1162 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1163 } 1164 1165 // Control: Selects and configures the service controller used by the service. 1166 // Example: control: environment: servicecontrol.googleapis.com 1167 type Control struct { 1168 // Environment: The service controller environment to use. If empty, no control 1169 // plane feature (like quota and billing) will be enabled. The recommended 1170 // value for most services is servicecontrol.googleapis.com 1171 Environment string `json:"environment,omitempty"` 1172 // MethodPolicies: Defines policies applying to the API methods of the service. 1173 MethodPolicies []*MethodPolicy `json:"methodPolicies,omitempty"` 1174 // ForceSendFields is a list of field names (e.g. "Environment") to 1175 // unconditionally include in API requests. By default, fields with empty or 1176 // default values are omitted from API requests. See 1177 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1178 // details. 1179 ForceSendFields []string `json:"-"` 1180 // NullFields is a list of field names (e.g. "Environment") to include in API 1181 // requests with the JSON null value. By default, fields with empty values are 1182 // omitted from API requests. See 1183 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1184 NullFields []string `json:"-"` 1185 } 1186 1187 func (s *Control) MarshalJSON() ([]byte, error) { 1188 type NoMethod Control 1189 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1190 } 1191 1192 // CppSettings: Settings for C++ client libraries. 1193 type CppSettings struct { 1194 // Common: Some settings. 1195 Common *CommonLanguageSettings `json:"common,omitempty"` 1196 // ForceSendFields is a list of field names (e.g. "Common") to unconditionally 1197 // include in API requests. By default, fields with empty or default values are 1198 // omitted from API requests. See 1199 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1200 // details. 1201 ForceSendFields []string `json:"-"` 1202 // NullFields is a list of field names (e.g. "Common") to include in API 1203 // requests with the JSON null value. By default, fields with empty values are 1204 // omitted from API requests. See 1205 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1206 NullFields []string `json:"-"` 1207 } 1208 1209 func (s *CppSettings) MarshalJSON() ([]byte, error) { 1210 type NoMethod CppSettings 1211 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1212 } 1213 1214 // CreateAdminQuotaPolicyMetadata: Metadata message that provides information 1215 // such as progress, partial failures, and similar information on each 1216 // GetOperation call of LRO returned by CreateAdminQuotaPolicy. 1217 type CreateAdminQuotaPolicyMetadata struct { 1218 } 1219 1220 // CustomError: Customize service error responses. For example, list any 1221 // service specific protobuf types that can appear in error detail lists of 1222 // error responses. Example: custom_error: types: - google.foo.v1.CustomError - 1223 // google.foo.v1.AnotherError 1224 type CustomError struct { 1225 // Rules: The list of custom error rules that apply to individual API messages. 1226 // **NOTE:** All service configuration rules follow "last one wins" order. 1227 Rules []*CustomErrorRule `json:"rules,omitempty"` 1228 // Types: The list of custom error detail types, e.g. 1229 // 'google.foo.v1.CustomError'. 1230 Types []string `json:"types,omitempty"` 1231 // ForceSendFields is a list of field names (e.g. "Rules") to unconditionally 1232 // include in API requests. By default, fields with empty or default values are 1233 // omitted from API requests. See 1234 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1235 // details. 1236 ForceSendFields []string `json:"-"` 1237 // NullFields is a list of field names (e.g. "Rules") to include in API 1238 // requests with the JSON null value. By default, fields with empty values are 1239 // omitted from API requests. See 1240 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1241 NullFields []string `json:"-"` 1242 } 1243 1244 func (s *CustomError) MarshalJSON() ([]byte, error) { 1245 type NoMethod CustomError 1246 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1247 } 1248 1249 // CustomErrorRule: A custom error rule. 1250 type CustomErrorRule struct { 1251 // IsErrorType: Mark this message as possible payload in error response. 1252 // Otherwise, objects of this type will be filtered when they appear in error 1253 // payload. 1254 IsErrorType bool `json:"isErrorType,omitempty"` 1255 // Selector: Selects messages to which this rule applies. Refer to selector for 1256 // syntax details. 1257 Selector string `json:"selector,omitempty"` 1258 // ForceSendFields is a list of field names (e.g. "IsErrorType") to 1259 // unconditionally include in API requests. By default, fields with empty or 1260 // default values are omitted from API requests. See 1261 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1262 // details. 1263 ForceSendFields []string `json:"-"` 1264 // NullFields is a list of field names (e.g. "IsErrorType") to include in API 1265 // requests with the JSON null value. By default, fields with empty values are 1266 // omitted from API requests. See 1267 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1268 NullFields []string `json:"-"` 1269 } 1270 1271 func (s *CustomErrorRule) MarshalJSON() ([]byte, error) { 1272 type NoMethod CustomErrorRule 1273 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1274 } 1275 1276 // CustomHttpPattern: A custom pattern is used for defining custom HTTP verb. 1277 type CustomHttpPattern struct { 1278 // Kind: The name of this custom HTTP verb. 1279 Kind string `json:"kind,omitempty"` 1280 // Path: The path matched by this custom verb. 1281 Path string `json:"path,omitempty"` 1282 // ForceSendFields is a list of field names (e.g. "Kind") to unconditionally 1283 // include in API requests. By default, fields with empty or default values are 1284 // omitted from API requests. See 1285 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1286 // details. 1287 ForceSendFields []string `json:"-"` 1288 // NullFields is a list of field names (e.g. "Kind") to include in API requests 1289 // with the JSON null value. By default, fields with empty values are omitted 1290 // from API requests. See 1291 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1292 NullFields []string `json:"-"` 1293 } 1294 1295 func (s *CustomHttpPattern) MarshalJSON() ([]byte, error) { 1296 type NoMethod CustomHttpPattern 1297 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1298 } 1299 1300 // DeleteAdminQuotaPolicyMetadata: Metadata message that provides information 1301 // such as progress, partial failures, and similar information on each 1302 // GetOperation call of LRO returned by DeleteAdminQuotaPolicy. 1303 type DeleteAdminQuotaPolicyMetadata struct { 1304 } 1305 1306 // DisableServiceRequest: Request message for the `DisableService` method. 1307 type DisableServiceRequest struct { 1308 } 1309 1310 // DisableServiceResponse: Response message for the `DisableService` method. 1311 // This response message is assigned to the `response` field of the returned 1312 // Operation when that operation is done. 1313 type DisableServiceResponse struct { 1314 // Service: The new state of the service after disabling. 1315 Service *GoogleApiServiceusageV1Service `json:"service,omitempty"` 1316 // ForceSendFields is a list of field names (e.g. "Service") to unconditionally 1317 // include in API requests. By default, fields with empty or default values are 1318 // omitted from API requests. See 1319 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1320 // details. 1321 ForceSendFields []string `json:"-"` 1322 // NullFields is a list of field names (e.g. "Service") to include in API 1323 // requests with the JSON null value. By default, fields with empty values are 1324 // omitted from API requests. See 1325 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1326 NullFields []string `json:"-"` 1327 } 1328 1329 func (s *DisableServiceResponse) MarshalJSON() ([]byte, error) { 1330 type NoMethod DisableServiceResponse 1331 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1332 } 1333 1334 // Documentation: `Documentation` provides the information for describing a 1335 // service. Example: documentation: summary: > The Google Calendar API gives 1336 // access to most calendar features. pages: - name: Overview content: (== 1337 // include google/foo/overview.md ==) - name: Tutorial content: (== include 1338 // google/foo/tutorial.md ==) subpages: - name: Java content: (== include 1339 // google/foo/tutorial_java.md ==) rules: - selector: 1340 // google.calendar.Calendar.Get description: > ... - selector: 1341 // google.calendar.Calendar.Put description: > ... Documentation is provided in 1342 // markdown syntax. In addition to standard markdown features, definition 1343 // lists, tables and fenced code blocks are supported. Section headers can be 1344 // provided and are interpreted relative to the section nesting of the context 1345 // where a documentation fragment is embedded. Documentation from the IDL is 1346 // merged with documentation defined via the config at normalization time, 1347 // where documentation provided by config rules overrides IDL provided. A 1348 // number of constructs specific to the API platform are supported in 1349 // documentation text. In order to reference a proto element, the following 1350 // notation can be used: [fully.qualified.proto.name][] To override the display 1351 // text used for the link, this can be used: [display 1352 // text][fully.qualified.proto.name] Text can be excluded from doc using the 1353 // following notation: (-- internal comment --) A few directives are available 1354 // in documentation. Note that directives must appear on a single line to be 1355 // properly identified. The `include` directive includes a markdown file from 1356 // an external source: (== include path/to/file ==) The `resource_for` 1357 // directive marks a message to be the resource of a collection in REST view. 1358 // If it is not specified, tools attempt to infer the resource from the 1359 // operations in a collection: (== resource_for v1.shelves.books ==) The 1360 // directive `suppress_warning` does not directly affect documentation and is 1361 // documented together with service config validation. 1362 type Documentation struct { 1363 // DocumentationRootUrl: The URL to the root of documentation. 1364 DocumentationRootUrl string `json:"documentationRootUrl,omitempty"` 1365 // Overview: Declares a single overview page. For example: documentation: 1366 // summary: ... overview: (== include overview.md ==) This is a shortcut for 1367 // the following declaration (using pages style): documentation: summary: ... 1368 // pages: - name: Overview content: (== include overview.md ==) Note: you 1369 // cannot specify both `overview` field and `pages` field. 1370 Overview string `json:"overview,omitempty"` 1371 // Pages: The top level pages for the documentation set. 1372 Pages []*Page `json:"pages,omitempty"` 1373 // Rules: A list of documentation rules that apply to individual API elements. 1374 // **NOTE:** All service configuration rules follow "last one wins" order. 1375 Rules []*DocumentationRule `json:"rules,omitempty"` 1376 // SectionOverrides: Specifies section and content to override boilerplate 1377 // content provided by go/api-docgen. Currently overrides following sections: 1378 // 1. rest.service.client_libraries 1379 SectionOverrides []*Page `json:"sectionOverrides,omitempty"` 1380 // ServiceRootUrl: Specifies the service root url if the default one (the 1381 // service name from the yaml file) is not suitable. This can be seen in any 1382 // fully specified service urls as well as sections that show a base that other 1383 // urls are relative to. 1384 ServiceRootUrl string `json:"serviceRootUrl,omitempty"` 1385 // Summary: A short description of what the service does. The summary must be 1386 // plain text. It becomes the overview of the service displayed in Google Cloud 1387 // Console. NOTE: This field is equivalent to the standard field `description`. 1388 Summary string `json:"summary,omitempty"` 1389 // ForceSendFields is a list of field names (e.g. "DocumentationRootUrl") to 1390 // unconditionally include in API requests. By default, fields with empty or 1391 // default values are omitted from API requests. See 1392 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1393 // details. 1394 ForceSendFields []string `json:"-"` 1395 // NullFields is a list of field names (e.g. "DocumentationRootUrl") to include 1396 // in API requests with the JSON null value. By default, fields with empty 1397 // values are omitted from API requests. See 1398 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1399 NullFields []string `json:"-"` 1400 } 1401 1402 func (s *Documentation) MarshalJSON() ([]byte, error) { 1403 type NoMethod Documentation 1404 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1405 } 1406 1407 // DocumentationRule: A documentation rule provides information about 1408 // individual API elements. 1409 type DocumentationRule struct { 1410 // DeprecationDescription: Deprecation description of the selected element(s). 1411 // It can be provided if an element is marked as `deprecated`. 1412 DeprecationDescription string `json:"deprecationDescription,omitempty"` 1413 // Description: Description of the selected proto element (e.g. a message, a 1414 // method, a 'service' definition, or a field). Defaults to leading & trailing 1415 // comments taken from the proto source definition of the proto element. 1416 Description string `json:"description,omitempty"` 1417 // DisableReplacementWords: String of comma or space separated case-sensitive 1418 // words for which method/field name replacement will be disabled by 1419 // go/api-docgen. 1420 DisableReplacementWords string `json:"disableReplacementWords,omitempty"` 1421 // Selector: The selector is a comma-separated list of patterns for any element 1422 // such as a method, a field, an enum value. Each pattern is a qualified name 1423 // of the element which may end in "*", indicating a wildcard. Wildcards are 1424 // only allowed at the end and for a whole component of the qualified name, 1425 // i.e. "foo.*" is ok, but not "foo.b*" or "foo.*.bar". A wildcard will match 1426 // one or more components. To specify a default for all applicable elements, 1427 // the whole pattern "*" is used. 1428 Selector string `json:"selector,omitempty"` 1429 // ForceSendFields is a list of field names (e.g. "DeprecationDescription") to 1430 // unconditionally include in API requests. By default, fields with empty or 1431 // default values are omitted from API requests. See 1432 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1433 // details. 1434 ForceSendFields []string `json:"-"` 1435 // NullFields is a list of field names (e.g. "DeprecationDescription") to 1436 // include in API requests with the JSON null value. By default, fields with 1437 // empty values are omitted from API requests. See 1438 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1439 NullFields []string `json:"-"` 1440 } 1441 1442 func (s *DocumentationRule) MarshalJSON() ([]byte, error) { 1443 type NoMethod DocumentationRule 1444 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1445 } 1446 1447 // DotnetSettings: Settings for Dotnet client libraries. 1448 type DotnetSettings struct { 1449 // Common: Some settings. 1450 Common *CommonLanguageSettings `json:"common,omitempty"` 1451 // ForcedNamespaceAliases: Namespaces which must be aliased in snippets due to 1452 // a known (but non-generator-predictable) naming collision 1453 ForcedNamespaceAliases []string `json:"forcedNamespaceAliases,omitempty"` 1454 // HandwrittenSignatures: Method signatures (in the form 1455 // "service.method(signature)") which are provided separately, so shouldn't be 1456 // generated. Snippets *calling* these methods are still generated, however. 1457 HandwrittenSignatures []string `json:"handwrittenSignatures,omitempty"` 1458 // IgnoredResources: List of full resource types to ignore during generation. 1459 // This is typically used for API-specific Location resources, which should be 1460 // handled by the generator as if they were actually the common Location 1461 // resources. Example entry: "documentai.googleapis.com/Location" 1462 IgnoredResources []string `json:"ignoredResources,omitempty"` 1463 // RenamedResources: Map from full resource types to the effective short name 1464 // for the resource. This is used when otherwise resource named from different 1465 // services would cause naming collisions. Example entry: 1466 // "datalabeling.googleapis.com/Dataset": "DataLabelingDataset" 1467 RenamedResources map[string]string `json:"renamedResources,omitempty"` 1468 // RenamedServices: Map from original service names to renamed versions. This 1469 // is used when the default generated types would cause a naming conflict. 1470 // (Neither name is fully-qualified.) Example: Subscriber to 1471 // SubscriberServiceApi. 1472 RenamedServices map[string]string `json:"renamedServices,omitempty"` 1473 // ForceSendFields is a list of field names (e.g. "Common") to unconditionally 1474 // include in API requests. By default, fields with empty or default values are 1475 // omitted from API requests. See 1476 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1477 // details. 1478 ForceSendFields []string `json:"-"` 1479 // NullFields is a list of field names (e.g. "Common") to include in API 1480 // requests with the JSON null value. By default, fields with empty values are 1481 // omitted from API requests. See 1482 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1483 NullFields []string `json:"-"` 1484 } 1485 1486 func (s *DotnetSettings) MarshalJSON() ([]byte, error) { 1487 type NoMethod DotnetSettings 1488 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1489 } 1490 1491 // Empty: A generic empty message that you can re-use to avoid defining 1492 // duplicated empty messages in your APIs. A typical example is to use it as 1493 // the request or the response type of an API method. For instance: service Foo 1494 // { rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); } 1495 type Empty struct { 1496 } 1497 1498 // EnableFailure: Provides error messages for the failing services. 1499 type EnableFailure struct { 1500 // ErrorMessage: An error message describing why the service could not be 1501 // enabled. 1502 ErrorMessage string `json:"errorMessage,omitempty"` 1503 // ServiceId: The service id of a service that could not be enabled. 1504 ServiceId string `json:"serviceId,omitempty"` 1505 // ForceSendFields is a list of field names (e.g. "ErrorMessage") to 1506 // unconditionally include in API requests. By default, fields with empty or 1507 // default values are omitted from API requests. See 1508 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1509 // details. 1510 ForceSendFields []string `json:"-"` 1511 // NullFields is a list of field names (e.g. "ErrorMessage") to include in API 1512 // requests with the JSON null value. By default, fields with empty values are 1513 // omitted from API requests. See 1514 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1515 NullFields []string `json:"-"` 1516 } 1517 1518 func (s *EnableFailure) MarshalJSON() ([]byte, error) { 1519 type NoMethod EnableFailure 1520 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1521 } 1522 1523 // EnableRule: The consumer policy rule that defines usable services and 1524 // service groups. 1525 type EnableRule struct { 1526 // EnableType: Client and resource project enable type. 1527 // 1528 // Possible values: 1529 // "ENABLE_TYPE_UNSPECIFIED" - Unspecified enable type, which means enabled 1530 // as both client and resource project. 1531 // "CLIENT" - Enable all clients under the CRM node specified by 1532 // `ConsumerPolicy.name` to use the listed services. A client can be an API 1533 // key, an OAuth client, or a service account. 1534 // "RESOURCE" - Enable resources in the list services to be created and used 1535 // under the CRM node specified by the `ConsumerPolicy.name`. 1536 // "V1_COMPATIBLE" - Activation made by Service Usage v1 API. This will be 1537 // how consumers differentiate between policy changes made by v1 and v2 clients 1538 // and understand what is actually possible based on those different policies. 1539 EnableType string `json:"enableType,omitempty"` 1540 // Groups: DEPRECATED: Please use field `values`. Service group should have 1541 // prefix `groups/`. The names of the service groups that are enabled (Not 1542 // Implemented). Example: `groups/googleServices`. 1543 Groups []string `json:"groups,omitempty"` 1544 // Services: DEPRECATED: Please use field `values`. Service should have prefix 1545 // `services/`. The names of the services that are enabled. Example: 1546 // `storage.googleapis.com`. 1547 Services []string `json:"services,omitempty"` 1548 // Values: The names of the services or service groups that are enabled. 1549 // Example: `services/storage.googleapis.com`, `groups/googleServices`, 1550 // `groups/allServices`. 1551 Values []string `json:"values,omitempty"` 1552 // ForceSendFields is a list of field names (e.g. "EnableType") to 1553 // unconditionally include in API requests. By default, fields with empty or 1554 // default values are omitted from API requests. See 1555 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1556 // details. 1557 ForceSendFields []string `json:"-"` 1558 // NullFields is a list of field names (e.g. "EnableType") to include in API 1559 // requests with the JSON null value. By default, fields with empty values are 1560 // omitted from API requests. See 1561 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1562 NullFields []string `json:"-"` 1563 } 1564 1565 func (s *EnableRule) MarshalJSON() ([]byte, error) { 1566 type NoMethod EnableRule 1567 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1568 } 1569 1570 // EnableServiceRequest: Request message for the `EnableService` method. 1571 type EnableServiceRequest struct { 1572 } 1573 1574 // EnableServiceResponse: Response message for the `EnableService` method. This 1575 // response message is assigned to the `response` field of the returned 1576 // Operation when that operation is done. 1577 type EnableServiceResponse struct { 1578 // Service: The new state of the service after enabling. 1579 Service *GoogleApiServiceusageV1Service `json:"service,omitempty"` 1580 // ForceSendFields is a list of field names (e.g. "Service") to unconditionally 1581 // include in API requests. By default, fields with empty or default values are 1582 // omitted from API requests. See 1583 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1584 // details. 1585 ForceSendFields []string `json:"-"` 1586 // NullFields is a list of field names (e.g. "Service") to include in API 1587 // requests with the JSON null value. By default, fields with empty values are 1588 // omitted from API requests. See 1589 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1590 NullFields []string `json:"-"` 1591 } 1592 1593 func (s *EnableServiceResponse) MarshalJSON() ([]byte, error) { 1594 type NoMethod EnableServiceResponse 1595 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1596 } 1597 1598 // Endpoint: `Endpoint` describes a network address of a service that serves a 1599 // set of APIs. It is commonly known as a service endpoint. A service may 1600 // expose any number of service endpoints, and all service endpoints share the 1601 // same service definition, such as quota limits and monitoring metrics. 1602 // Example: type: google.api.Service name: library-example.googleapis.com 1603 // endpoints: # Declares network address 1604 // `https://library-example.googleapis.com` # for service 1605 // `library-example.googleapis.com`. The `https` scheme # is implicit for all 1606 // service endpoints. Other schemes may be # supported in the future. - name: 1607 // library-example.googleapis.com allow_cors: false - name: 1608 // content-staging-library-example.googleapis.com # Allows HTTP OPTIONS calls 1609 // to be passed to the API frontend, for it # to decide whether the subsequent 1610 // cross-origin request is allowed # to proceed. allow_cors: true 1611 type Endpoint struct { 1612 // Aliases: Aliases for this endpoint, these will be served by the same UrlMap 1613 // as the parent endpoint, and will be provisioned in the GCP stack for the 1614 // Regional Endpoints. 1615 Aliases []string `json:"aliases,omitempty"` 1616 // AllowCors: Allowing CORS 1617 // (https://en.wikipedia.org/wiki/Cross-origin_resource_sharing), aka 1618 // cross-domain traffic, would allow the backends served from this endpoint to 1619 // receive and respond to HTTP OPTIONS requests. The response will be used by 1620 // the browser to determine whether the subsequent cross-origin request is 1621 // allowed to proceed. 1622 AllowCors bool `json:"allowCors,omitempty"` 1623 // Name: The canonical name of this endpoint. 1624 Name string `json:"name,omitempty"` 1625 // Target: The specification of an Internet routable address of API frontend 1626 // that will handle requests to this API Endpoint 1627 // (https://cloud.google.com/apis/design/glossary). It should be either a valid 1628 // IPv4 address or a fully-qualified domain name. For example, "8.8.8.8" or 1629 // "myservice.appspot.com". 1630 Target string `json:"target,omitempty"` 1631 // ForceSendFields is a list of field names (e.g. "Aliases") to unconditionally 1632 // include in API requests. By default, fields with empty or default values are 1633 // omitted from API requests. See 1634 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1635 // details. 1636 ForceSendFields []string `json:"-"` 1637 // NullFields is a list of field names (e.g. "Aliases") to include in API 1638 // requests with the JSON null value. By default, fields with empty values are 1639 // omitted from API requests. See 1640 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1641 NullFields []string `json:"-"` 1642 } 1643 1644 func (s *Endpoint) MarshalJSON() ([]byte, error) { 1645 type NoMethod Endpoint 1646 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1647 } 1648 1649 // Enum: Enum type definition. 1650 type Enum struct { 1651 // Edition: The source edition string, only valid when syntax is 1652 // SYNTAX_EDITIONS. 1653 Edition string `json:"edition,omitempty"` 1654 // Enumvalue: Enum value definitions. 1655 Enumvalue []*EnumValue `json:"enumvalue,omitempty"` 1656 // Name: Enum type name. 1657 Name string `json:"name,omitempty"` 1658 // Options: Protocol buffer options. 1659 Options []*Option `json:"options,omitempty"` 1660 // SourceContext: The source context. 1661 SourceContext *SourceContext `json:"sourceContext,omitempty"` 1662 // Syntax: The source syntax. 1663 // 1664 // Possible values: 1665 // "SYNTAX_PROTO2" - Syntax `proto2`. 1666 // "SYNTAX_PROTO3" - Syntax `proto3`. 1667 // "SYNTAX_EDITIONS" - Syntax `editions`. 1668 Syntax string `json:"syntax,omitempty"` 1669 // ForceSendFields is a list of field names (e.g. "Edition") to unconditionally 1670 // include in API requests. By default, fields with empty or default values are 1671 // omitted from API requests. See 1672 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1673 // details. 1674 ForceSendFields []string `json:"-"` 1675 // NullFields is a list of field names (e.g. "Edition") to include in API 1676 // requests with the JSON null value. By default, fields with empty values are 1677 // omitted from API requests. See 1678 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1679 NullFields []string `json:"-"` 1680 } 1681 1682 func (s *Enum) MarshalJSON() ([]byte, error) { 1683 type NoMethod Enum 1684 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1685 } 1686 1687 // EnumValue: Enum value definition. 1688 type EnumValue struct { 1689 // Name: Enum value name. 1690 Name string `json:"name,omitempty"` 1691 // Number: Enum value number. 1692 Number int64 `json:"number,omitempty"` 1693 // Options: Protocol buffer options. 1694 Options []*Option `json:"options,omitempty"` 1695 // ForceSendFields is a list of field names (e.g. "Name") to unconditionally 1696 // include in API requests. By default, fields with empty or default values are 1697 // omitted from API requests. See 1698 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1699 // details. 1700 ForceSendFields []string `json:"-"` 1701 // NullFields is a list of field names (e.g. "Name") to include in API requests 1702 // with the JSON null value. By default, fields with empty values are omitted 1703 // from API requests. See 1704 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1705 NullFields []string `json:"-"` 1706 } 1707 1708 func (s *EnumValue) MarshalJSON() ([]byte, error) { 1709 type NoMethod EnumValue 1710 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1711 } 1712 1713 // Field: A single field of a message type. 1714 type Field struct { 1715 // Cardinality: The field cardinality. 1716 // 1717 // Possible values: 1718 // "CARDINALITY_UNKNOWN" - For fields with unknown cardinality. 1719 // "CARDINALITY_OPTIONAL" - For optional fields. 1720 // "CARDINALITY_REQUIRED" - For required fields. Proto2 syntax only. 1721 // "CARDINALITY_REPEATED" - For repeated fields. 1722 Cardinality string `json:"cardinality,omitempty"` 1723 // DefaultValue: The string value of the default value of this field. Proto2 1724 // syntax only. 1725 DefaultValue string `json:"defaultValue,omitempty"` 1726 // JsonName: The field JSON name. 1727 JsonName string `json:"jsonName,omitempty"` 1728 // Kind: The field type. 1729 // 1730 // Possible values: 1731 // "TYPE_UNKNOWN" - Field type unknown. 1732 // "TYPE_DOUBLE" - Field type double. 1733 // "TYPE_FLOAT" - Field type float. 1734 // "TYPE_INT64" - Field type int64. 1735 // "TYPE_UINT64" - Field type uint64. 1736 // "TYPE_INT32" - Field type int32. 1737 // "TYPE_FIXED64" - Field type fixed64. 1738 // "TYPE_FIXED32" - Field type fixed32. 1739 // "TYPE_BOOL" - Field type bool. 1740 // "TYPE_STRING" - Field type string. 1741 // "TYPE_GROUP" - Field type group. Proto2 syntax only, and deprecated. 1742 // "TYPE_MESSAGE" - Field type message. 1743 // "TYPE_BYTES" - Field type bytes. 1744 // "TYPE_UINT32" - Field type uint32. 1745 // "TYPE_ENUM" - Field type enum. 1746 // "TYPE_SFIXED32" - Field type sfixed32. 1747 // "TYPE_SFIXED64" - Field type sfixed64. 1748 // "TYPE_SINT32" - Field type sint32. 1749 // "TYPE_SINT64" - Field type sint64. 1750 Kind string `json:"kind,omitempty"` 1751 // Name: The field name. 1752 Name string `json:"name,omitempty"` 1753 // Number: The field number. 1754 Number int64 `json:"number,omitempty"` 1755 // OneofIndex: The index of the field type in `Type.oneofs`, for message or 1756 // enumeration types. The first type has index 1; zero means the type is not in 1757 // the list. 1758 OneofIndex int64 `json:"oneofIndex,omitempty"` 1759 // Options: The protocol buffer options. 1760 Options []*Option `json:"options,omitempty"` 1761 // Packed: Whether to use alternative packed wire representation. 1762 Packed bool `json:"packed,omitempty"` 1763 // TypeUrl: The field type URL, without the scheme, for message or enumeration 1764 // types. Example: "type.googleapis.com/google.protobuf.Timestamp". 1765 TypeUrl string `json:"typeUrl,omitempty"` 1766 // ForceSendFields is a list of field names (e.g. "Cardinality") to 1767 // unconditionally include in API requests. By default, fields with empty or 1768 // default values are omitted from API requests. See 1769 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1770 // details. 1771 ForceSendFields []string `json:"-"` 1772 // NullFields is a list of field names (e.g. "Cardinality") to include in API 1773 // requests with the JSON null value. By default, fields with empty values are 1774 // omitted from API requests. See 1775 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1776 NullFields []string `json:"-"` 1777 } 1778 1779 func (s *Field) MarshalJSON() ([]byte, error) { 1780 type NoMethod Field 1781 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1782 } 1783 1784 // FieldPolicy: Google API Policy Annotation This message defines a simple API 1785 // policy annotation that can be used to annotate API request and response 1786 // message fields with applicable policies. One field may have multiple 1787 // applicable policies that must all be satisfied before a request can be 1788 // processed. This policy annotation is used to generate the overall policy 1789 // that will be used for automatic runtime policy enforcement and documentation 1790 // generation. 1791 type FieldPolicy struct { 1792 // ResourcePermission: Specifies the required permission(s) for the resource 1793 // referred to by the field. It requires the field contains a valid resource 1794 // reference, and the request must pass the permission checks to proceed. For 1795 // example, "resourcemanager.projects.get". 1796 ResourcePermission string `json:"resourcePermission,omitempty"` 1797 // ResourceType: Specifies the resource type for the resource referred to by 1798 // the field. 1799 ResourceType string `json:"resourceType,omitempty"` 1800 // Selector: Selects one or more request or response message fields to apply 1801 // this `FieldPolicy`. When a `FieldPolicy` is used in proto annotation, the 1802 // selector must be left as empty. The service config generator will 1803 // automatically fill the correct value. When a `FieldPolicy` is used in 1804 // service config, the selector must be a comma-separated string with valid 1805 // request or response field paths, such as "foo.bar" or "foo.bar,foo.baz". 1806 Selector string `json:"selector,omitempty"` 1807 // ForceSendFields is a list of field names (e.g. "ResourcePermission") to 1808 // unconditionally include in API requests. By default, fields with empty or 1809 // default values are omitted from API requests. See 1810 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1811 // details. 1812 ForceSendFields []string `json:"-"` 1813 // NullFields is a list of field names (e.g. "ResourcePermission") to include 1814 // in API requests with the JSON null value. By default, fields with empty 1815 // values are omitted from API requests. See 1816 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1817 NullFields []string `json:"-"` 1818 } 1819 1820 func (s *FieldPolicy) MarshalJSON() ([]byte, error) { 1821 type NoMethod FieldPolicy 1822 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1823 } 1824 1825 // GetServiceIdentityMetadata: Metadata for the `GetServiceIdentity` method. 1826 type GetServiceIdentityMetadata struct { 1827 } 1828 1829 // GetServiceIdentityResponse: Response message for getting service identity. 1830 type GetServiceIdentityResponse struct { 1831 // Identity: Service identity that service producer can use to access consumer 1832 // resources. If exists is true, it contains email and unique_id. If exists is 1833 // false, it contains pre-constructed email and empty unique_id. 1834 Identity *ServiceIdentity `json:"identity,omitempty"` 1835 // State: Service identity state. 1836 // 1837 // Possible values: 1838 // "IDENTITY_STATE_UNSPECIFIED" - Default service identity state. This value 1839 // is used if the state is omitted. 1840 // "ACTIVE" - Service identity has been created and can be used. 1841 State string `json:"state,omitempty"` 1842 // ForceSendFields is a list of field names (e.g. "Identity") to 1843 // unconditionally include in API requests. By default, fields with empty or 1844 // default values are omitted from API requests. See 1845 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1846 // details. 1847 ForceSendFields []string `json:"-"` 1848 // NullFields is a list of field names (e.g. "Identity") to include in API 1849 // requests with the JSON null value. By default, fields with empty values are 1850 // omitted from API requests. See 1851 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1852 NullFields []string `json:"-"` 1853 } 1854 1855 func (s *GetServiceIdentityResponse) MarshalJSON() ([]byte, error) { 1856 type NoMethod GetServiceIdentityResponse 1857 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1858 } 1859 1860 // GoSettings: Settings for Go client libraries. 1861 type GoSettings struct { 1862 // Common: Some settings. 1863 Common *CommonLanguageSettings `json:"common,omitempty"` 1864 // ForceSendFields is a list of field names (e.g. "Common") to unconditionally 1865 // include in API requests. By default, fields with empty or default values are 1866 // omitted from API requests. See 1867 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1868 // details. 1869 ForceSendFields []string `json:"-"` 1870 // NullFields is a list of field names (e.g. "Common") to include in API 1871 // requests with the JSON null value. By default, fields with empty values are 1872 // omitted from API requests. See 1873 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1874 NullFields []string `json:"-"` 1875 } 1876 1877 func (s *GoSettings) MarshalJSON() ([]byte, error) { 1878 type NoMethod GoSettings 1879 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1880 } 1881 1882 // GoogleApiService: `Service` is the root object of Google API service 1883 // configuration (service config). It describes the basic information about a 1884 // logical service, such as the service name and the user-facing title, and 1885 // delegates other aspects to sub-sections. Each sub-section is either a proto 1886 // message or a repeated proto message that configures a specific aspect, such 1887 // as auth. For more information, see each proto message definition. Example: 1888 // type: google.api.Service name: calendar.googleapis.com title: Google 1889 // Calendar API apis: - name: google.calendar.v3.Calendar visibility: rules: - 1890 // selector: "google.calendar.v3.*" restriction: PREVIEW backend: rules: - 1891 // selector: "google.calendar.v3.*" address: calendar.example.com 1892 // authentication: providers: - id: google_calendar_auth jwks_uri: 1893 // https://www.googleapis.com/oauth2/v1/certs issuer: 1894 // https://securetoken.google.com rules: - selector: "*" requirements: 1895 // provider_id: google_calendar_auth 1896 type GoogleApiService struct { 1897 // Apis: A list of API interfaces exported by this service. Only the `name` 1898 // field of the google.protobuf.Api needs to be provided by the configuration 1899 // author, as the remaining fields will be derived from the IDL during the 1900 // normalization process. It is an error to specify an API interface here which 1901 // cannot be resolved against the associated IDL files. 1902 Apis []*Api `json:"apis,omitempty"` 1903 // Authentication: Auth configuration. 1904 Authentication *Authentication `json:"authentication,omitempty"` 1905 // Backend: API backend configuration. 1906 Backend *Backend `json:"backend,omitempty"` 1907 // Billing: Billing configuration. 1908 Billing *Billing `json:"billing,omitempty"` 1909 // ConfigVersion: Obsolete. Do not use. This field has no semantic meaning. The 1910 // service config compiler always sets this field to `3`. 1911 ConfigVersion int64 `json:"configVersion,omitempty"` 1912 // Context: Context configuration. 1913 Context *Context `json:"context,omitempty"` 1914 // Control: Configuration for the service control plane. 1915 Control *Control `json:"control,omitempty"` 1916 // CustomError: Custom error configuration. 1917 CustomError *CustomError `json:"customError,omitempty"` 1918 // Documentation: Additional API documentation. 1919 Documentation *Documentation `json:"documentation,omitempty"` 1920 // Endpoints: Configuration for network endpoints. If this is empty, then an 1921 // endpoint with the same name as the service is automatically generated to 1922 // service all defined APIs. 1923 Endpoints []*Endpoint `json:"endpoints,omitempty"` 1924 // Enums: A list of all enum types included in this API service. Enums 1925 // referenced directly or indirectly by the `apis` are automatically included. 1926 // Enums which are not referenced but shall be included should be listed here 1927 // by name by the configuration author. Example: enums: - name: 1928 // google.someapi.v1.SomeEnum 1929 Enums []*Enum `json:"enums,omitempty"` 1930 // Http: HTTP configuration. 1931 Http *Http `json:"http,omitempty"` 1932 // Id: A unique ID for a specific instance of this message, typically assigned 1933 // by the client for tracking purpose. Must be no longer than 63 characters and 1934 // only lower case letters, digits, '.', '_' and '-' are allowed. If empty, the 1935 // server may choose to generate one instead. 1936 Id string `json:"id,omitempty"` 1937 // Logging: Logging configuration. 1938 Logging *Logging `json:"logging,omitempty"` 1939 // Logs: Defines the logs used by this service. 1940 Logs []*LogDescriptor `json:"logs,omitempty"` 1941 // Metrics: Defines the metrics used by this service. 1942 Metrics []*MetricDescriptor `json:"metrics,omitempty"` 1943 // MonitoredResources: Defines the monitored resources used by this service. 1944 // This is required by the Service.monitoring and Service.logging 1945 // configurations. 1946 MonitoredResources []*MonitoredResourceDescriptor `json:"monitoredResources,omitempty"` 1947 // Monitoring: Monitoring configuration. 1948 Monitoring *Monitoring `json:"monitoring,omitempty"` 1949 // Name: The service name, which is a DNS-like logical identifier for the 1950 // service, such as `calendar.googleapis.com`. The service name typically goes 1951 // through DNS verification to make sure the owner of the service also owns the 1952 // DNS name. 1953 Name string `json:"name,omitempty"` 1954 // ProducerProjectId: The Google project that owns this service. 1955 ProducerProjectId string `json:"producerProjectId,omitempty"` 1956 // Publishing: Settings for Google Cloud Client libraries 1957 // (https://cloud.google.com/apis/docs/cloud-client-libraries) generated from 1958 // APIs defined as protocol buffers. 1959 Publishing *Publishing `json:"publishing,omitempty"` 1960 // Quota: Quota configuration. 1961 Quota *Quota `json:"quota,omitempty"` 1962 // SourceInfo: Output only. The source information for this configuration if 1963 // available. 1964 SourceInfo *SourceInfo `json:"sourceInfo,omitempty"` 1965 // SystemParameters: System parameter configuration. 1966 SystemParameters *SystemParameters `json:"systemParameters,omitempty"` 1967 // SystemTypes: A list of all proto message types included in this API service. 1968 // It serves similar purpose as [google.api.Service.types], except that these 1969 // types are not needed by user-defined APIs. Therefore, they will not show up 1970 // in the generated discovery doc. This field should only be used to define 1971 // system APIs in ESF. 1972 SystemTypes []*Type `json:"systemTypes,omitempty"` 1973 // Title: The product title for this service, it is the name displayed in 1974 // Google Cloud Console. 1975 Title string `json:"title,omitempty"` 1976 // Types: A list of all proto message types included in this API service. Types 1977 // referenced directly or indirectly by the `apis` are automatically included. 1978 // Messages which are not referenced but shall be included, such as types used 1979 // by the `google.protobuf.Any` type, should be listed here by name by the 1980 // configuration author. Example: types: - name: google.protobuf.Int32 1981 Types []*Type `json:"types,omitempty"` 1982 // Usage: Configuration controlling usage of this service. 1983 Usage *Usage `json:"usage,omitempty"` 1984 // ForceSendFields is a list of field names (e.g. "Apis") to unconditionally 1985 // include in API requests. By default, fields with empty or default values are 1986 // omitted from API requests. See 1987 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1988 // details. 1989 ForceSendFields []string `json:"-"` 1990 // NullFields is a list of field names (e.g. "Apis") to include in API requests 1991 // with the JSON null value. By default, fields with empty values are omitted 1992 // from API requests. See 1993 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1994 NullFields []string `json:"-"` 1995 } 1996 1997 func (s *GoogleApiService) MarshalJSON() ([]byte, error) { 1998 type NoMethod GoogleApiService 1999 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 2000 } 2001 2002 // GoogleApiServiceusageV1OperationMetadata: The operation metadata returned 2003 // for the batchend services operation. 2004 type GoogleApiServiceusageV1OperationMetadata struct { 2005 // ResourceNames: The full name of the resources that this operation is 2006 // directly associated with. 2007 ResourceNames []string `json:"resourceNames,omitempty"` 2008 // ForceSendFields is a list of field names (e.g. "ResourceNames") to 2009 // unconditionally include in API requests. By default, fields with empty or 2010 // default values are omitted from API requests. See 2011 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 2012 // details. 2013 ForceSendFields []string `json:"-"` 2014 // NullFields is a list of field names (e.g. "ResourceNames") to include in API 2015 // requests with the JSON null value. By default, fields with empty values are 2016 // omitted from API requests. See 2017 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 2018 NullFields []string `json:"-"` 2019 } 2020 2021 func (s *GoogleApiServiceusageV1OperationMetadata) MarshalJSON() ([]byte, error) { 2022 type NoMethod GoogleApiServiceusageV1OperationMetadata 2023 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 2024 } 2025 2026 // GoogleApiServiceusageV1Service: A service that is available for use by the 2027 // consumer. 2028 type GoogleApiServiceusageV1Service struct { 2029 // Config: The service configuration of the available service. Some fields may 2030 // be filtered out of the configuration in responses to the `ListServices` 2031 // method. These fields are present only in responses to the `GetService` 2032 // method. 2033 Config *GoogleApiServiceusageV1ServiceConfig `json:"config,omitempty"` 2034 // Name: The resource name of the consumer and service. A valid name would be: 2035 // - projects/123/services/serviceusage.googleapis.com 2036 Name string `json:"name,omitempty"` 2037 // Parent: The resource name of the consumer. A valid name would be: - 2038 // projects/123 2039 Parent string `json:"parent,omitempty"` 2040 // State: Whether or not the service has been enabled for use by the consumer. 2041 // 2042 // Possible values: 2043 // "STATE_UNSPECIFIED" - The default value, which indicates that the enabled 2044 // state of the service is unspecified or not meaningful. Currently, all 2045 // consumers other than projects (such as folders and organizations) are always 2046 // in this state. 2047 // "DISABLED" - The service cannot be used by this consumer. It has either 2048 // been explicitly disabled, or has never been enabled. 2049 // "ENABLED" - The service has been explicitly enabled for use by this 2050 // consumer. 2051 State string `json:"state,omitempty"` 2052 // ForceSendFields is a list of field names (e.g. "Config") to unconditionally 2053 // include in API requests. By default, fields with empty or default values are 2054 // omitted from API requests. See 2055 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 2056 // details. 2057 ForceSendFields []string `json:"-"` 2058 // NullFields is a list of field names (e.g. "Config") to include in API 2059 // requests with the JSON null value. By default, fields with empty values are 2060 // omitted from API requests. See 2061 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 2062 NullFields []string `json:"-"` 2063 } 2064 2065 func (s *GoogleApiServiceusageV1Service) MarshalJSON() ([]byte, error) { 2066 type NoMethod GoogleApiServiceusageV1Service 2067 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 2068 } 2069 2070 // GoogleApiServiceusageV1ServiceConfig: The configuration of the service. 2071 type GoogleApiServiceusageV1ServiceConfig struct { 2072 // Apis: A list of API interfaces exported by this service. Contains only the 2073 // names, versions, and method names of the interfaces. 2074 Apis []*Api `json:"apis,omitempty"` 2075 // Authentication: Auth configuration. Contains only the OAuth rules. 2076 Authentication *Authentication `json:"authentication,omitempty"` 2077 // Documentation: Additional API documentation. Contains only the summary and 2078 // the documentation URL. 2079 Documentation *Documentation `json:"documentation,omitempty"` 2080 // Endpoints: Configuration for network endpoints. Contains only the names and 2081 // aliases of the endpoints. 2082 Endpoints []*Endpoint `json:"endpoints,omitempty"` 2083 // MonitoredResources: Defines the monitored resources used by this service. 2084 // This is required by the Service.monitoring and Service.logging 2085 // configurations. 2086 MonitoredResources []*MonitoredResourceDescriptor `json:"monitoredResources,omitempty"` 2087 // Monitoring: Monitoring configuration. This should not include the 2088 // 'producer_destinations' field. 2089 Monitoring *Monitoring `json:"monitoring,omitempty"` 2090 // Name: The DNS address at which this service is available. An example DNS 2091 // address would be: `calendar.googleapis.com`. 2092 Name string `json:"name,omitempty"` 2093 // Quota: Quota configuration. 2094 Quota *Quota `json:"quota,omitempty"` 2095 // Title: The product title for this service. 2096 Title string `json:"title,omitempty"` 2097 // Usage: Configuration controlling usage of this service. 2098 Usage *Usage `json:"usage,omitempty"` 2099 // ForceSendFields is a list of field names (e.g. "Apis") to unconditionally 2100 // include in API requests. By default, fields with empty or default values are 2101 // omitted from API requests. See 2102 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 2103 // details. 2104 ForceSendFields []string `json:"-"` 2105 // NullFields is a list of field names (e.g. "Apis") to include in API requests 2106 // with the JSON null value. By default, fields with empty values are omitted 2107 // from API requests. See 2108 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 2109 NullFields []string `json:"-"` 2110 } 2111 2112 func (s *GoogleApiServiceusageV1ServiceConfig) MarshalJSON() ([]byte, error) { 2113 type NoMethod GoogleApiServiceusageV1ServiceConfig 2114 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 2115 } 2116 2117 // GoogleApiServiceusageV1beta1GetServiceIdentityResponse: Response message for 2118 // getting service identity. 2119 type GoogleApiServiceusageV1beta1GetServiceIdentityResponse struct { 2120 // Identity: Service identity that service producer can use to access consumer 2121 // resources. If exists is true, it contains email and unique_id. If exists is 2122 // false, it contains pre-constructed email and empty unique_id. 2123 Identity *GoogleApiServiceusageV1beta1ServiceIdentity `json:"identity,omitempty"` 2124 // State: Service identity state. 2125 // 2126 // Possible values: 2127 // "IDENTITY_STATE_UNSPECIFIED" - Default service identity state. This value 2128 // is used if the state is omitted. 2129 // "ACTIVE" - Service identity has been created and can be used. 2130 State string `json:"state,omitempty"` 2131 // ForceSendFields is a list of field names (e.g. "Identity") to 2132 // unconditionally include in API requests. By default, fields with empty or 2133 // default values are omitted from API requests. See 2134 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 2135 // details. 2136 ForceSendFields []string `json:"-"` 2137 // NullFields is a list of field names (e.g. "Identity") to include in API 2138 // requests with the JSON null value. By default, fields with empty values are 2139 // omitted from API requests. See 2140 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 2141 NullFields []string `json:"-"` 2142 } 2143 2144 func (s *GoogleApiServiceusageV1beta1GetServiceIdentityResponse) MarshalJSON() ([]byte, error) { 2145 type NoMethod GoogleApiServiceusageV1beta1GetServiceIdentityResponse 2146 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 2147 } 2148 2149 // GoogleApiServiceusageV1beta1ServiceIdentity: Service identity for a service. 2150 // This is the identity that service producer should use to access consumer 2151 // resources. 2152 type GoogleApiServiceusageV1beta1ServiceIdentity struct { 2153 // Email: The email address of the service account that a service producer 2154 // would use to access consumer resources. 2155 Email string `json:"email,omitempty"` 2156 // UniqueId: The unique and stable id of the service account. 2157 // https://cloud.google.com/iam/reference/rest/v1/projects.serviceAccounts#ServiceAccount 2158 UniqueId string `json:"uniqueId,omitempty"` 2159 // ForceSendFields is a list of field names (e.g. "Email") to unconditionally 2160 // include in API requests. By default, fields with empty or default values are 2161 // omitted from API requests. See 2162 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 2163 // details. 2164 ForceSendFields []string `json:"-"` 2165 // NullFields is a list of field names (e.g. "Email") to include in API 2166 // requests with the JSON null value. By default, fields with empty values are 2167 // omitted from API requests. See 2168 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 2169 NullFields []string `json:"-"` 2170 } 2171 2172 func (s *GoogleApiServiceusageV1beta1ServiceIdentity) MarshalJSON() ([]byte, error) { 2173 type NoMethod GoogleApiServiceusageV1beta1ServiceIdentity 2174 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 2175 } 2176 2177 // GoogleApiServiceusageV2alphaConsumerPolicy: Consumer Policy is a set of 2178 // rules that define what services or service groups can be used for a cloud 2179 // resource hierarchy. 2180 type GoogleApiServiceusageV2alphaConsumerPolicy struct { 2181 // Annotations: Optional. Annotations is an unstructured key-value map stored 2182 // with a policy that may be set by external tools to store and retrieve 2183 // arbitrary metadata. They are not queryable and should be preserved when 2184 // modifying objects. AIP-128 (https://google.aip.dev/128#annotations) 2185 Annotations map[string]string `json:"annotations,omitempty"` 2186 // CreateTime: Output only. The time the policy was created. For singleton 2187 // policies, this is the first touch of the policy. 2188 CreateTime string `json:"createTime,omitempty"` 2189 // EnableRules: Enable rules define usable services, groups, and categories. 2190 // There can currently be at most one `EnableRule`. This restriction will be 2191 // lifted in later releases. 2192 EnableRules []*GoogleApiServiceusageV2alphaEnableRule `json:"enableRules,omitempty"` 2193 // Etag: Output only. An opaque tag indicating the current version of the 2194 // policy, used for concurrency control. 2195 Etag string `json:"etag,omitempty"` 2196 // Name: Output only. The resource name of the policy. Only the `default` 2197 // policy is supported: `projects/12345/consumerPolicies/default`, 2198 // `folders/12345/consumerPolicies/default`, 2199 // `organizations/12345/consumerPolicies/default`. 2200 Name string `json:"name,omitempty"` 2201 // UpdateTime: Output only. The time the policy was last updated. 2202 UpdateTime string `json:"updateTime,omitempty"` 2203 // ForceSendFields is a list of field names (e.g. "Annotations") to 2204 // unconditionally include in API requests. By default, fields with empty or 2205 // default values are omitted from API requests. See 2206 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 2207 // details. 2208 ForceSendFields []string `json:"-"` 2209 // NullFields is a list of field names (e.g. "Annotations") to include in API 2210 // requests with the JSON null value. By default, fields with empty values are 2211 // omitted from API requests. See 2212 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 2213 NullFields []string `json:"-"` 2214 } 2215 2216 func (s *GoogleApiServiceusageV2alphaConsumerPolicy) MarshalJSON() ([]byte, error) { 2217 type NoMethod GoogleApiServiceusageV2alphaConsumerPolicy 2218 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 2219 } 2220 2221 // GoogleApiServiceusageV2alphaEnableRule: The consumer policy rule that 2222 // defines enabled services, groups, and categories. 2223 type GoogleApiServiceusageV2alphaEnableRule struct { 2224 // Services: The names of the services that are enabled. Example: 2225 // `services/storage.googleapis.com`. 2226 Services []string `json:"services,omitempty"` 2227 // ForceSendFields is a list of field names (e.g. "Services") to 2228 // unconditionally include in API requests. By default, fields with empty or 2229 // default values are omitted from API requests. See 2230 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 2231 // details. 2232 ForceSendFields []string `json:"-"` 2233 // NullFields is a list of field names (e.g. "Services") to include in API 2234 // requests with the JSON null value. By default, fields with empty values are 2235 // omitted from API requests. See 2236 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 2237 NullFields []string `json:"-"` 2238 } 2239 2240 func (s *GoogleApiServiceusageV2alphaEnableRule) MarshalJSON() ([]byte, error) { 2241 type NoMethod GoogleApiServiceusageV2alphaEnableRule 2242 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 2243 } 2244 2245 // GoogleApiServiceusageV2alphaUpdateConsumerPolicyMetadata: Metadata for the 2246 // `UpdateConsumerPolicy` method. 2247 type GoogleApiServiceusageV2alphaUpdateConsumerPolicyMetadata struct { 2248 } 2249 2250 // Http: Defines the HTTP configuration for an API service. It contains a list 2251 // of HttpRule, each specifying the mapping of an RPC method to one or more 2252 // HTTP REST API methods. 2253 type Http struct { 2254 // FullyDecodeReservedExpansion: When set to true, URL path parameters will be 2255 // fully URI-decoded except in cases of single segment matches in reserved 2256 // expansion, where "%2F" will be left encoded. The default behavior is to not 2257 // decode RFC 6570 reserved characters in multi segment matches. 2258 FullyDecodeReservedExpansion bool `json:"fullyDecodeReservedExpansion,omitempty"` 2259 // Rules: A list of HTTP configuration rules that apply to individual API 2260 // methods. **NOTE:** All service configuration rules follow "last one wins" 2261 // order. 2262 Rules []*HttpRule `json:"rules,omitempty"` 2263 // ForceSendFields is a list of field names (e.g. 2264 // "FullyDecodeReservedExpansion") to unconditionally include in API requests. 2265 // By default, fields with empty or default values are omitted from API 2266 // requests. See https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields 2267 // for more details. 2268 ForceSendFields []string `json:"-"` 2269 // NullFields is a list of field names (e.g. "FullyDecodeReservedExpansion") to 2270 // include in API requests with the JSON null value. By default, fields with 2271 // empty values are omitted from API requests. See 2272 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 2273 NullFields []string `json:"-"` 2274 } 2275 2276 func (s *Http) MarshalJSON() ([]byte, error) { 2277 type NoMethod Http 2278 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 2279 } 2280 2281 // HttpRule: # gRPC Transcoding gRPC Transcoding is a feature for mapping 2282 // between a gRPC method and one or more HTTP REST endpoints. It allows 2283 // developers to build a single API service that supports both gRPC APIs and 2284 // REST APIs. Many systems, including Google APIs 2285 // (https://github.com/googleapis/googleapis), Cloud Endpoints 2286 // (https://cloud.google.com/endpoints), gRPC Gateway 2287 // (https://github.com/grpc-ecosystem/grpc-gateway), and Envoy 2288 // (https://github.com/envoyproxy/envoy) proxy support this feature and use it 2289 // for large scale production services. `HttpRule` defines the schema of the 2290 // gRPC/REST mapping. The mapping specifies how different portions of the gRPC 2291 // request message are mapped to the URL path, URL query parameters, and HTTP 2292 // request body. It also controls how the gRPC response message is mapped to 2293 // the HTTP response body. `HttpRule` is typically specified as an 2294 // `google.api.http` annotation on the gRPC method. Each mapping specifies a 2295 // URL path template and an HTTP method. The path template may refer to one or 2296 // more fields in the gRPC request message, as long as each field is a 2297 // non-repeated field with a primitive (non-message) type. The path template 2298 // controls how fields of the request message are mapped to the URL path. 2299 // Example: service Messaging { rpc GetMessage(GetMessageRequest) returns 2300 // (Message) { option (google.api.http) = { get: "/v1/{name=messages/*}" }; } } 2301 // message GetMessageRequest { string name = 1; // Mapped to URL path. } 2302 // message Message { string text = 1; // The resource content. } This enables 2303 // an HTTP REST to gRPC mapping as below: HTTP | gRPC -----|----- `GET 2304 // /v1/messages/123456` | `GetMessage(name: "messages/123456")` Any fields in 2305 // the request message which are not bound by the path template automatically 2306 // become HTTP query parameters if there is no HTTP request body. For example: 2307 // service Messaging { rpc GetMessage(GetMessageRequest) returns (Message) { 2308 // option (google.api.http) = { get:"/v1/messages/{message_id}" }; } } message 2309 // GetMessageRequest { message SubMessage { string subfield = 1; } string 2310 // message_id = 1; // Mapped to URL path. int64 revision = 2; // Mapped to URL 2311 // query parameter `revision`. SubMessage sub = 3; // Mapped to URL query 2312 // parameter `sub.subfield`. } This enables a HTTP JSON to RPC mapping as 2313 // below: HTTP | gRPC -----|----- `GET 2314 // /v1/messages/123456?revision=2&sub.subfield=foo` | `GetMessage(message_id: 2315 // "123456" revision: 2 sub: SubMessage(subfield: "foo"))` Note that fields 2316 // which are mapped to URL query parameters must have a primitive type or a 2317 // repeated primitive type or a non-repeated message type. In the case of a 2318 // repeated type, the parameter can be repeated in the URL as 2319 // `...?param=A¶m=B`. In the case of a message type, each field of the 2320 // message is mapped to a separate parameter, such as 2321 // `...?foo.a=A&foo.b=B&foo.c=C`. For HTTP methods that allow a request body, 2322 // the `body` field specifies the mapping. Consider a REST update method on the 2323 // message resource collection: service Messaging { rpc 2324 // UpdateMessage(UpdateMessageRequest) returns (Message) { option 2325 // (google.api.http) = { patch: "/v1/messages/{message_id}" body: "message" }; 2326 // } } message UpdateMessageRequest { string message_id = 1; // mapped to the 2327 // URL Message message = 2; // mapped to the body } The following HTTP JSON to 2328 // RPC mapping is enabled, where the representation of the JSON in the request 2329 // body is determined by protos JSON encoding: HTTP | gRPC -----|----- `PATCH 2330 // /v1/messages/123456 { "text": "Hi!" }` | `UpdateMessage(message_id: "123456" 2331 // message { text: "Hi!" })` The special name `*` can be used in the body 2332 // mapping to define that every field not bound by the path template should be 2333 // mapped to the request body. This enables the following alternative 2334 // definition of the update method: service Messaging { rpc 2335 // UpdateMessage(Message) returns (Message) { option (google.api.http) = { 2336 // patch: "/v1/messages/{message_id}" body: "*" }; } } message Message { string 2337 // message_id = 1; string text = 2; } The following HTTP JSON to RPC mapping is 2338 // enabled: HTTP | gRPC -----|----- `PATCH /v1/messages/123456 { "text": "Hi!" 2339 // }` | `UpdateMessage(message_id: "123456" text: "Hi!")` Note that when using 2340 // `*` in the body mapping, it is not possible to have HTTP parameters, as all 2341 // fields not bound by the path end in the body. This makes this option more 2342 // rarely used in practice when defining REST APIs. The common usage of `*` is 2343 // in custom methods which don't use the URL at all for transferring data. It 2344 // is possible to define multiple HTTP methods for one RPC by using the 2345 // `additional_bindings` option. Example: service Messaging { rpc 2346 // GetMessage(GetMessageRequest) returns (Message) { option (google.api.http) = 2347 // { get: "/v1/messages/{message_id}" additional_bindings { get: 2348 // "/v1/users/{user_id}/messages/{message_id}" } }; } } message 2349 // GetMessageRequest { string message_id = 1; string user_id = 2; } This 2350 // enables the following two alternative HTTP JSON to RPC mappings: HTTP | gRPC 2351 // -----|----- `GET /v1/messages/123456` | `GetMessage(message_id: "123456")` 2352 // `GET /v1/users/me/messages/123456` | `GetMessage(user_id: "me" message_id: 2353 // "123456")` ## Rules for HTTP mapping 1. Leaf request fields (recursive 2354 // expansion nested messages in the request message) are classified into three 2355 // categories: - Fields referred by the path template. They are passed via the 2356 // URL path. - Fields referred by the HttpRule.body. They are passed via the 2357 // HTTP request body. - All other fields are passed via the URL query 2358 // parameters, and the parameter name is the field path in the request message. 2359 // A repeated field can be represented as multiple query parameters under the 2360 // same name. 2. If HttpRule.body is "*", there is no URL query parameter, all 2361 // fields are passed via URL path and HTTP request body. 3. If HttpRule.body is 2362 // omitted, there is no HTTP request body, all fields are passed via URL path 2363 // and URL query parameters. ### Path template syntax Template = "/" Segments [ 2364 // Verb ] ; Segments = Segment { "/" Segment } ; Segment = "*" | "**" | LITERAL 2365 // | Variable ; Variable = "{" FieldPath [ "=" Segments ] "}" ; FieldPath = 2366 // IDENT { "." IDENT } ; Verb = ":" LITERAL ; The syntax `*` matches a single 2367 // URL path segment. The syntax `**` matches zero or more URL path segments, 2368 // which must be the last part of the URL path except the `Verb`. The syntax 2369 // `Variable` matches part of the URL path as specified by its template. A 2370 // variable template must not contain other variables. If a variable matches a 2371 // single path segment, its template may be omitted, e.g. `{var}` is equivalent 2372 // to `{var=*}`. The syntax `LITERAL` matches literal text in the URL path. If 2373 // the `LITERAL` contains any reserved character, such characters should be 2374 // percent-encoded before the matching. If a variable contains exactly one path 2375 // segment, such as "{var}" or "{var=*}", when such a variable is expanded 2376 // into a URL path on the client side, all characters except `[-_.~0-9a-zA-Z]` 2377 // are percent-encoded. The server side does the reverse decoding. Such 2378 // variables show up in the Discovery Document 2379 // (https://developers.google.com/discovery/v1/reference/apis) as `{var}`. If a 2380 // variable contains multiple path segments, such as "{var=foo/*}" or 2381 // "{var=**}", when such a variable is expanded into a URL path on the client 2382 // side, all characters except `[-_.~/0-9a-zA-Z]` are percent-encoded. The 2383 // server side does the reverse decoding, except "%2F" and "%2f" are left 2384 // unchanged. Such variables show up in the Discovery Document 2385 // (https://developers.google.com/discovery/v1/reference/apis) as `{+var}`. ## 2386 // Using gRPC API Service Configuration gRPC API Service Configuration (service 2387 // config) is a configuration language for configuring a gRPC service to become 2388 // a user-facing product. The service config is simply the YAML representation 2389 // of the `google.api.Service` proto message. As an alternative to annotating 2390 // your proto file, you can configure gRPC transcoding in your service config 2391 // YAML files. You do this by specifying a `HttpRule` that maps the gRPC method 2392 // to a REST endpoint, achieving the same effect as the proto annotation. This 2393 // can be particularly useful if you have a proto that is reused in multiple 2394 // services. Note that any transcoding specified in the service config will 2395 // override any matching transcoding configuration in the proto. Example: http: 2396 // rules: # Selects a gRPC method and applies HttpRule to it. - selector: 2397 // example.v1.Messaging.GetMessage get: 2398 // /v1/messages/{message_id}/{sub.subfield} ## Special notes When gRPC 2399 // Transcoding is used to map a gRPC to JSON REST endpoints, the proto to JSON 2400 // conversion must follow the proto3 specification 2401 // (https://developers.google.com/protocol-buffers/docs/proto3#json). While the 2402 // single segment variable follows the semantics of RFC 6570 2403 // (https://tools.ietf.org/html/rfc6570) Section 3.2.2 Simple String Expansion, 2404 // the multi segment variable **does not** follow RFC 6570 Section 3.2.3 2405 // Reserved Expansion. The reason is that the Reserved Expansion does not 2406 // expand special characters like `?` and `#`, which would lead to invalid 2407 // URLs. As the result, gRPC Transcoding uses a custom encoding for multi 2408 // segment variables. The path variables **must not** refer to any repeated or 2409 // mapped field, because client libraries are not capable of handling such 2410 // variable expansion. The path variables **must not** capture the leading "/" 2411 // character. The reason is that the most common use case "{var}" does not 2412 // capture the leading "/" character. For consistency, all path variables must 2413 // share the same behavior. Repeated message fields must not be mapped to URL 2414 // query parameters, because no client library can support such complicated 2415 // mapping. If an API needs to use a JSON array for request or response body, 2416 // it can map the request or response body to a repeated field. However, some 2417 // gRPC Transcoding implementations may not support this feature. 2418 type HttpRule struct { 2419 // AdditionalBindings: Additional HTTP bindings for the selector. Nested 2420 // bindings must not contain an `additional_bindings` field themselves (that 2421 // is, the nesting may only be one level deep). 2422 AdditionalBindings []*HttpRule `json:"additionalBindings,omitempty"` 2423 // Body: The name of the request field whose value is mapped to the HTTP 2424 // request body, or `*` for mapping all request fields not captured by the path 2425 // pattern to the HTTP body, or omitted for not having any HTTP request body. 2426 // NOTE: the referred field must be present at the top-level of the request 2427 // message type. 2428 Body string `json:"body,omitempty"` 2429 // Custom: The custom pattern is used for specifying an HTTP method that is not 2430 // included in the `pattern` field, such as HEAD, or "*" to leave the HTTP 2431 // method unspecified for this rule. The wild-card rule is useful for services 2432 // that provide content to Web (HTML) clients. 2433 Custom *CustomHttpPattern `json:"custom,omitempty"` 2434 // Delete: Maps to HTTP DELETE. Used for deleting a resource. 2435 Delete string `json:"delete,omitempty"` 2436 // Get: Maps to HTTP GET. Used for listing and getting information about 2437 // resources. 2438 Get string `json:"get,omitempty"` 2439 // Patch: Maps to HTTP PATCH. Used for updating a resource. 2440 Patch string `json:"patch,omitempty"` 2441 // Post: Maps to HTTP POST. Used for creating a resource or performing an 2442 // action. 2443 Post string `json:"post,omitempty"` 2444 // Put: Maps to HTTP PUT. Used for replacing a resource. 2445 Put string `json:"put,omitempty"` 2446 // ResponseBody: Optional. The name of the response field whose value is mapped 2447 // to the HTTP response body. When omitted, the entire response message will be 2448 // used as the HTTP response body. NOTE: The referred field must be present at 2449 // the top-level of the response message type. 2450 ResponseBody string `json:"responseBody,omitempty"` 2451 // Selector: Selects a method to which this rule applies. Refer to selector for 2452 // syntax details. 2453 Selector string `json:"selector,omitempty"` 2454 // ForceSendFields is a list of field names (e.g. "AdditionalBindings") to 2455 // unconditionally include in API requests. By default, fields with empty or 2456 // default values are omitted from API requests. See 2457 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 2458 // details. 2459 ForceSendFields []string `json:"-"` 2460 // NullFields is a list of field names (e.g. "AdditionalBindings") to include 2461 // in API requests with the JSON null value. By default, fields with empty 2462 // values are omitted from API requests. See 2463 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 2464 NullFields []string `json:"-"` 2465 } 2466 2467 func (s *HttpRule) MarshalJSON() ([]byte, error) { 2468 type NoMethod HttpRule 2469 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 2470 } 2471 2472 // ImportAdminOverridesMetadata: Metadata message that provides information 2473 // such as progress, partial failures, and similar information on each 2474 // GetOperation call of LRO returned by ImportAdminOverrides. 2475 type ImportAdminOverridesMetadata struct { 2476 } 2477 2478 // ImportAdminOverridesRequest: Request message for ImportAdminOverrides 2479 type ImportAdminOverridesRequest struct { 2480 // Force: Whether to force the creation of the quota overrides. Setting the 2481 // force parameter to 'true' ignores all quota safety checks that would fail 2482 // the request. QuotaSafetyCheck lists all such validations. If force is set to 2483 // true, it is recommended to include a case id in "X-Goog-Request-Reason" 2484 // header when sending the request. 2485 Force bool `json:"force,omitempty"` 2486 // ForceOnly: The list of quota safety checks to ignore before the override 2487 // mutation. Unlike 'force' field that ignores all the quota safety checks, the 2488 // 'force_only' field ignores only the specified checks; other checks are still 2489 // enforced. The 'force' and 'force_only' fields cannot both be set. If 2490 // force_only is specified, it is recommended to include a case id in 2491 // "X-Goog-Request-Reason" header when sending the request. 2492 // 2493 // Possible values: 2494 // "QUOTA_SAFETY_CHECK_UNSPECIFIED" - Unspecified quota safety check. 2495 // "LIMIT_DECREASE_BELOW_USAGE" - Validates that a quota mutation would not 2496 // cause the consumer's effective limit to be lower than the consumer's quota 2497 // usage. 2498 // "LIMIT_DECREASE_PERCENTAGE_TOO_HIGH" - Validates that a quota mutation 2499 // would not cause the consumer's effective limit to decrease by more than 10 2500 // percent. 2501 ForceOnly []string `json:"forceOnly,omitempty"` 2502 // InlineSource: The import data is specified in the request message itself 2503 InlineSource *OverrideInlineSource `json:"inlineSource,omitempty"` 2504 // ForceSendFields is a list of field names (e.g. "Force") to unconditionally 2505 // include in API requests. By default, fields with empty or default values are 2506 // omitted from API requests. See 2507 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 2508 // details. 2509 ForceSendFields []string `json:"-"` 2510 // NullFields is a list of field names (e.g. "Force") to include in API 2511 // requests with the JSON null value. By default, fields with empty values are 2512 // omitted from API requests. See 2513 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 2514 NullFields []string `json:"-"` 2515 } 2516 2517 func (s *ImportAdminOverridesRequest) MarshalJSON() ([]byte, error) { 2518 type NoMethod ImportAdminOverridesRequest 2519 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 2520 } 2521 2522 // ImportAdminOverridesResponse: Response message for ImportAdminOverrides 2523 type ImportAdminOverridesResponse struct { 2524 // Overrides: The overrides that were created from the imported data. 2525 Overrides []*QuotaOverride `json:"overrides,omitempty"` 2526 // ForceSendFields is a list of field names (e.g. "Overrides") to 2527 // unconditionally include in API requests. By default, fields with empty or 2528 // default values are omitted from API requests. See 2529 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 2530 // details. 2531 ForceSendFields []string `json:"-"` 2532 // NullFields is a list of field names (e.g. "Overrides") to include in API 2533 // requests with the JSON null value. By default, fields with empty values are 2534 // omitted from API requests. See 2535 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 2536 NullFields []string `json:"-"` 2537 } 2538 2539 func (s *ImportAdminOverridesResponse) MarshalJSON() ([]byte, error) { 2540 type NoMethod ImportAdminOverridesResponse 2541 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 2542 } 2543 2544 // ImportAdminQuotaPoliciesMetadata: Metadata message that provides information 2545 // such as progress, partial failures, and similar information on each 2546 // GetOperation call of LRO returned by ImportAdminQuotaPolicies. 2547 type ImportAdminQuotaPoliciesMetadata struct { 2548 } 2549 2550 // ImportAdminQuotaPoliciesResponse: Response message for 2551 // ImportAdminQuotaPolicies 2552 type ImportAdminQuotaPoliciesResponse struct { 2553 // Policies: The policies that were created from the imported data. 2554 Policies []*AdminQuotaPolicy `json:"policies,omitempty"` 2555 // ForceSendFields is a list of field names (e.g. "Policies") to 2556 // unconditionally include in API requests. By default, fields with empty or 2557 // default values are omitted from API requests. See 2558 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 2559 // details. 2560 ForceSendFields []string `json:"-"` 2561 // NullFields is a list of field names (e.g. "Policies") to include in API 2562 // requests with the JSON null value. By default, fields with empty values are 2563 // omitted from API requests. See 2564 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 2565 NullFields []string `json:"-"` 2566 } 2567 2568 func (s *ImportAdminQuotaPoliciesResponse) MarshalJSON() ([]byte, error) { 2569 type NoMethod ImportAdminQuotaPoliciesResponse 2570 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 2571 } 2572 2573 // ImportConsumerOverridesMetadata: Metadata message that provides information 2574 // such as progress, partial failures, and similar information on each 2575 // GetOperation call of LRO returned by ImportConsumerOverrides. 2576 type ImportConsumerOverridesMetadata struct { 2577 } 2578 2579 // ImportConsumerOverridesRequest: Request message for ImportConsumerOverrides 2580 type ImportConsumerOverridesRequest struct { 2581 // Force: Whether to force the creation of the quota overrides. Setting the 2582 // force parameter to 'true' ignores all quota safety checks that would fail 2583 // the request. QuotaSafetyCheck lists all such validations. If force is set to 2584 // true, it is recommended to include a case id in "X-Goog-Request-Reason" 2585 // header when sending the request. 2586 Force bool `json:"force,omitempty"` 2587 // ForceOnly: The list of quota safety checks to ignore before the override 2588 // mutation. Unlike 'force' field that ignores all the quota safety checks, the 2589 // 'force_only' field ignores only the specified checks; other checks are still 2590 // enforced. The 'force' and 'force_only' fields cannot both be set. If 2591 // force_only is specified, it is recommended to include a case id in 2592 // "X-Goog-Request-Reason" header when sending the request. 2593 // 2594 // Possible values: 2595 // "QUOTA_SAFETY_CHECK_UNSPECIFIED" - Unspecified quota safety check. 2596 // "LIMIT_DECREASE_BELOW_USAGE" - Validates that a quota mutation would not 2597 // cause the consumer's effective limit to be lower than the consumer's quota 2598 // usage. 2599 // "LIMIT_DECREASE_PERCENTAGE_TOO_HIGH" - Validates that a quota mutation 2600 // would not cause the consumer's effective limit to decrease by more than 10 2601 // percent. 2602 ForceOnly []string `json:"forceOnly,omitempty"` 2603 // InlineSource: The import data is specified in the request message itself 2604 InlineSource *OverrideInlineSource `json:"inlineSource,omitempty"` 2605 // ForceSendFields is a list of field names (e.g. "Force") to unconditionally 2606 // include in API requests. By default, fields with empty or default values are 2607 // omitted from API requests. See 2608 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 2609 // details. 2610 ForceSendFields []string `json:"-"` 2611 // NullFields is a list of field names (e.g. "Force") to include in API 2612 // requests with the JSON null value. By default, fields with empty values are 2613 // omitted from API requests. See 2614 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 2615 NullFields []string `json:"-"` 2616 } 2617 2618 func (s *ImportConsumerOverridesRequest) MarshalJSON() ([]byte, error) { 2619 type NoMethod ImportConsumerOverridesRequest 2620 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 2621 } 2622 2623 // ImportConsumerOverridesResponse: Response message for 2624 // ImportConsumerOverrides 2625 type ImportConsumerOverridesResponse struct { 2626 // Overrides: The overrides that were created from the imported data. 2627 Overrides []*QuotaOverride `json:"overrides,omitempty"` 2628 // ForceSendFields is a list of field names (e.g. "Overrides") to 2629 // unconditionally include in API requests. By default, fields with empty or 2630 // default values are omitted from API requests. See 2631 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 2632 // details. 2633 ForceSendFields []string `json:"-"` 2634 // NullFields is a list of field names (e.g. "Overrides") to include in API 2635 // requests with the JSON null value. By default, fields with empty values are 2636 // omitted from API requests. See 2637 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 2638 NullFields []string `json:"-"` 2639 } 2640 2641 func (s *ImportConsumerOverridesResponse) MarshalJSON() ([]byte, error) { 2642 type NoMethod ImportConsumerOverridesResponse 2643 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 2644 } 2645 2646 // JavaSettings: Settings for Java client libraries. 2647 type JavaSettings struct { 2648 // Common: Some settings. 2649 Common *CommonLanguageSettings `json:"common,omitempty"` 2650 // LibraryPackage: The package name to use in Java. Clobbers the java_package 2651 // option set in the protobuf. This should be used **only** by APIs who have 2652 // already set the language_settings.java.package_name" field in gapic.yaml. 2653 // API teams should use the protobuf java_package option where possible. 2654 // Example of a YAML configuration:: publishing: java_settings: 2655 // library_package: com.google.cloud.pubsub.v1 2656 LibraryPackage string `json:"libraryPackage,omitempty"` 2657 // ServiceClassNames: Configure the Java class name to use instead of the 2658 // service's for its corresponding generated GAPIC client. Keys are 2659 // fully-qualified service names as they appear in the protobuf (including the 2660 // full the language_settings.java.interface_names" field in gapic.yaml. API 2661 // teams should otherwise use the service name as it appears in the protobuf. 2662 // Example of a YAML configuration:: publishing: java_settings: 2663 // service_class_names: - google.pubsub.v1.Publisher: TopicAdmin - 2664 // google.pubsub.v1.Subscriber: SubscriptionAdmin 2665 ServiceClassNames map[string]string `json:"serviceClassNames,omitempty"` 2666 // ForceSendFields is a list of field names (e.g. "Common") to unconditionally 2667 // include in API requests. By default, fields with empty or default values are 2668 // omitted from API requests. See 2669 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 2670 // details. 2671 ForceSendFields []string `json:"-"` 2672 // NullFields is a list of field names (e.g. "Common") to include in API 2673 // requests with the JSON null value. By default, fields with empty values are 2674 // omitted from API requests. See 2675 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 2676 NullFields []string `json:"-"` 2677 } 2678 2679 func (s *JavaSettings) MarshalJSON() ([]byte, error) { 2680 type NoMethod JavaSettings 2681 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 2682 } 2683 2684 // JwtLocation: Specifies a location to extract JWT from an API request. 2685 type JwtLocation struct { 2686 // Cookie: Specifies cookie name to extract JWT token. 2687 Cookie string `json:"cookie,omitempty"` 2688 // Header: Specifies HTTP header name to extract JWT token. 2689 Header string `json:"header,omitempty"` 2690 // Query: Specifies URL query parameter name to extract JWT token. 2691 Query string `json:"query,omitempty"` 2692 // ValuePrefix: The value prefix. The value format is "value_prefix{token}" 2693 // Only applies to "in" header type. Must be empty for "in" query type. If not 2694 // empty, the header value has to match (case sensitive) this prefix. If not 2695 // matched, JWT will not be extracted. If matched, JWT will be extracted after 2696 // the prefix is removed. For example, for "Authorization: Bearer {JWT}", 2697 // value_prefix="Bearer " with a space at the end. 2698 ValuePrefix string `json:"valuePrefix,omitempty"` 2699 // ForceSendFields is a list of field names (e.g. "Cookie") to unconditionally 2700 // include in API requests. By default, fields with empty or default values are 2701 // omitted from API requests. See 2702 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 2703 // details. 2704 ForceSendFields []string `json:"-"` 2705 // NullFields is a list of field names (e.g. "Cookie") to include in API 2706 // requests with the JSON null value. By default, fields with empty values are 2707 // omitted from API requests. See 2708 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 2709 NullFields []string `json:"-"` 2710 } 2711 2712 func (s *JwtLocation) MarshalJSON() ([]byte, error) { 2713 type NoMethod JwtLocation 2714 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 2715 } 2716 2717 // LabelDescriptor: A description of a label. 2718 type LabelDescriptor struct { 2719 // Description: A human-readable description for the label. 2720 Description string `json:"description,omitempty"` 2721 // Key: The label key. 2722 Key string `json:"key,omitempty"` 2723 // ValueType: The type of data that can be assigned to the label. 2724 // 2725 // Possible values: 2726 // "STRING" - A variable-length string. This is the default. 2727 // "BOOL" - Boolean; true or false. 2728 // "INT64" - A 64-bit signed integer. 2729 ValueType string `json:"valueType,omitempty"` 2730 // ForceSendFields is a list of field names (e.g. "Description") to 2731 // unconditionally include in API requests. By default, fields with empty or 2732 // default values are omitted from API requests. See 2733 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 2734 // details. 2735 ForceSendFields []string `json:"-"` 2736 // NullFields is a list of field names (e.g. "Description") to include in API 2737 // requests with the JSON null value. By default, fields with empty values are 2738 // omitted from API requests. See 2739 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 2740 NullFields []string `json:"-"` 2741 } 2742 2743 func (s *LabelDescriptor) MarshalJSON() ([]byte, error) { 2744 type NoMethod LabelDescriptor 2745 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 2746 } 2747 2748 // ListAdminOverridesResponse: Response message for ListAdminOverrides. 2749 type ListAdminOverridesResponse struct { 2750 // NextPageToken: Token identifying which result to start with; returned by a 2751 // previous list call. 2752 NextPageToken string `json:"nextPageToken,omitempty"` 2753 // Overrides: Admin overrides on this limit. 2754 Overrides []*QuotaOverride `json:"overrides,omitempty"` 2755 2756 // ServerResponse contains the HTTP response code and headers from the server. 2757 googleapi.ServerResponse `json:"-"` 2758 // ForceSendFields is a list of field names (e.g. "NextPageToken") to 2759 // unconditionally include in API requests. By default, fields with empty or 2760 // default values are omitted from API requests. See 2761 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 2762 // details. 2763 ForceSendFields []string `json:"-"` 2764 // NullFields is a list of field names (e.g. "NextPageToken") to include in API 2765 // requests with the JSON null value. By default, fields with empty values are 2766 // omitted from API requests. See 2767 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 2768 NullFields []string `json:"-"` 2769 } 2770 2771 func (s *ListAdminOverridesResponse) MarshalJSON() ([]byte, error) { 2772 type NoMethod ListAdminOverridesResponse 2773 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 2774 } 2775 2776 // ListConsumerOverridesResponse: Response message for ListConsumerOverrides. 2777 type ListConsumerOverridesResponse struct { 2778 // NextPageToken: Token identifying which result to start with; returned by a 2779 // previous list call. 2780 NextPageToken string `json:"nextPageToken,omitempty"` 2781 // Overrides: Consumer overrides on this limit. 2782 Overrides []*QuotaOverride `json:"overrides,omitempty"` 2783 2784 // ServerResponse contains the HTTP response code and headers from the server. 2785 googleapi.ServerResponse `json:"-"` 2786 // ForceSendFields is a list of field names (e.g. "NextPageToken") to 2787 // unconditionally include in API requests. By default, fields with empty or 2788 // default values are omitted from API requests. See 2789 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 2790 // details. 2791 ForceSendFields []string `json:"-"` 2792 // NullFields is a list of field names (e.g. "NextPageToken") to include in API 2793 // requests with the JSON null value. By default, fields with empty values are 2794 // omitted from API requests. See 2795 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 2796 NullFields []string `json:"-"` 2797 } 2798 2799 func (s *ListConsumerOverridesResponse) MarshalJSON() ([]byte, error) { 2800 type NoMethod ListConsumerOverridesResponse 2801 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 2802 } 2803 2804 // ListConsumerQuotaMetricsResponse: Response message for 2805 // ListConsumerQuotaMetrics 2806 type ListConsumerQuotaMetricsResponse struct { 2807 // Metrics: Quota settings for the consumer, organized by quota metric. 2808 Metrics []*ConsumerQuotaMetric `json:"metrics,omitempty"` 2809 // NextPageToken: Token identifying which result to start with; returned by a 2810 // previous list call. 2811 NextPageToken string `json:"nextPageToken,omitempty"` 2812 2813 // ServerResponse contains the HTTP response code and headers from the server. 2814 googleapi.ServerResponse `json:"-"` 2815 // ForceSendFields is a list of field names (e.g. "Metrics") to unconditionally 2816 // include in API requests. By default, fields with empty or default values are 2817 // omitted from API requests. See 2818 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 2819 // details. 2820 ForceSendFields []string `json:"-"` 2821 // NullFields is a list of field names (e.g. "Metrics") to include in API 2822 // requests with the JSON null value. By default, fields with empty values are 2823 // omitted from API requests. See 2824 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 2825 NullFields []string `json:"-"` 2826 } 2827 2828 func (s *ListConsumerQuotaMetricsResponse) MarshalJSON() ([]byte, error) { 2829 type NoMethod ListConsumerQuotaMetricsResponse 2830 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 2831 } 2832 2833 // ListOperationsResponse: The response message for Operations.ListOperations. 2834 type ListOperationsResponse struct { 2835 // NextPageToken: The standard List next-page token. 2836 NextPageToken string `json:"nextPageToken,omitempty"` 2837 // Operations: A list of operations that matches the specified filter in the 2838 // request. 2839 Operations []*Operation `json:"operations,omitempty"` 2840 2841 // ServerResponse contains the HTTP response code and headers from the server. 2842 googleapi.ServerResponse `json:"-"` 2843 // ForceSendFields is a list of field names (e.g. "NextPageToken") to 2844 // unconditionally include in API requests. By default, fields with empty or 2845 // default values are omitted from API requests. See 2846 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 2847 // details. 2848 ForceSendFields []string `json:"-"` 2849 // NullFields is a list of field names (e.g. "NextPageToken") to include in API 2850 // requests with the JSON null value. By default, fields with empty values are 2851 // omitted from API requests. See 2852 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 2853 NullFields []string `json:"-"` 2854 } 2855 2856 func (s *ListOperationsResponse) MarshalJSON() ([]byte, error) { 2857 type NoMethod ListOperationsResponse 2858 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 2859 } 2860 2861 // ListServicesResponse: Response message for the `ListServices` method. 2862 type ListServicesResponse struct { 2863 // NextPageToken: Token that can be passed to `ListServices` to resume a 2864 // paginated query. 2865 NextPageToken string `json:"nextPageToken,omitempty"` 2866 // Services: The available services for the requested project. 2867 Services []*Service `json:"services,omitempty"` 2868 2869 // ServerResponse contains the HTTP response code and headers from the server. 2870 googleapi.ServerResponse `json:"-"` 2871 // ForceSendFields is a list of field names (e.g. "NextPageToken") to 2872 // unconditionally include in API requests. By default, fields with empty or 2873 // default values are omitted from API requests. See 2874 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 2875 // details. 2876 ForceSendFields []string `json:"-"` 2877 // NullFields is a list of field names (e.g. "NextPageToken") to include in API 2878 // requests with the JSON null value. By default, fields with empty values are 2879 // omitted from API requests. See 2880 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 2881 NullFields []string `json:"-"` 2882 } 2883 2884 func (s *ListServicesResponse) MarshalJSON() ([]byte, error) { 2885 type NoMethod ListServicesResponse 2886 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 2887 } 2888 2889 // LogDescriptor: A description of a log type. Example in YAML format: - name: 2890 // library.googleapis.com/activity_history description: The history of 2891 // borrowing and returning library items. display_name: Activity labels: - key: 2892 // /customer_id description: Identifier of a library customer 2893 type LogDescriptor struct { 2894 // Description: A human-readable description of this log. This information 2895 // appears in the documentation and can contain details. 2896 Description string `json:"description,omitempty"` 2897 // DisplayName: The human-readable name for this log. This information appears 2898 // on the user interface and should be concise. 2899 DisplayName string `json:"displayName,omitempty"` 2900 // Labels: The set of labels that are available to describe a specific log 2901 // entry. Runtime requests that contain labels not specified here are 2902 // considered invalid. 2903 Labels []*LabelDescriptor `json:"labels,omitempty"` 2904 // Name: The name of the log. It must be less than 512 characters long and can 2905 // include the following characters: upper- and lower-case alphanumeric 2906 // characters [A-Za-z0-9], and punctuation characters including slash, 2907 // underscore, hyphen, period [/_-.]. 2908 Name string `json:"name,omitempty"` 2909 // ForceSendFields is a list of field names (e.g. "Description") to 2910 // unconditionally include in API requests. By default, fields with empty or 2911 // default values are omitted from API requests. See 2912 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 2913 // details. 2914 ForceSendFields []string `json:"-"` 2915 // NullFields is a list of field names (e.g. "Description") to include in API 2916 // requests with the JSON null value. By default, fields with empty values are 2917 // omitted from API requests. See 2918 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 2919 NullFields []string `json:"-"` 2920 } 2921 2922 func (s *LogDescriptor) MarshalJSON() ([]byte, error) { 2923 type NoMethod LogDescriptor 2924 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 2925 } 2926 2927 // Logging: Logging configuration of the service. The following example shows 2928 // how to configure logs to be sent to the producer and consumer projects. In 2929 // the example, the `activity_history` log is sent to both the producer and 2930 // consumer projects, whereas the `purchase_history` log is only sent to the 2931 // producer project. monitored_resources: - type: library.googleapis.com/branch 2932 // labels: - key: /city description: The city where the library branch is 2933 // located in. - key: /name description: The name of the branch. logs: - name: 2934 // activity_history labels: - key: /customer_id - name: purchase_history 2935 // logging: producer_destinations: - monitored_resource: 2936 // library.googleapis.com/branch logs: - activity_history - purchase_history 2937 // consumer_destinations: - monitored_resource: library.googleapis.com/branch 2938 // logs: - activity_history 2939 type Logging struct { 2940 // ConsumerDestinations: Logging configurations for sending logs to the 2941 // consumer project. There can be multiple consumer destinations, each one must 2942 // have a different monitored resource type. A log can be used in at most one 2943 // consumer destination. 2944 ConsumerDestinations []*LoggingDestination `json:"consumerDestinations,omitempty"` 2945 // ProducerDestinations: Logging configurations for sending logs to the 2946 // producer project. There can be multiple producer destinations, each one must 2947 // have a different monitored resource type. A log can be used in at most one 2948 // producer destination. 2949 ProducerDestinations []*LoggingDestination `json:"producerDestinations,omitempty"` 2950 // ForceSendFields is a list of field names (e.g. "ConsumerDestinations") to 2951 // unconditionally include in API requests. By default, fields with empty or 2952 // default values are omitted from API requests. See 2953 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 2954 // details. 2955 ForceSendFields []string `json:"-"` 2956 // NullFields is a list of field names (e.g. "ConsumerDestinations") to include 2957 // in API requests with the JSON null value. By default, fields with empty 2958 // values are omitted from API requests. See 2959 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 2960 NullFields []string `json:"-"` 2961 } 2962 2963 func (s *Logging) MarshalJSON() ([]byte, error) { 2964 type NoMethod Logging 2965 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 2966 } 2967 2968 // LoggingDestination: Configuration of a specific logging destination (the 2969 // producer project or the consumer project). 2970 type LoggingDestination struct { 2971 // Logs: Names of the logs to be sent to this destination. Each name must be 2972 // defined in the Service.logs section. If the log name is not a domain scoped 2973 // name, it will be automatically prefixed with the service name followed by 2974 // "/". 2975 Logs []string `json:"logs,omitempty"` 2976 // MonitoredResource: The monitored resource type. The type must be defined in 2977 // the Service.monitored_resources section. 2978 MonitoredResource string `json:"monitoredResource,omitempty"` 2979 // ForceSendFields is a list of field names (e.g. "Logs") to unconditionally 2980 // include in API requests. By default, fields with empty or default values are 2981 // omitted from API requests. See 2982 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 2983 // details. 2984 ForceSendFields []string `json:"-"` 2985 // NullFields is a list of field names (e.g. "Logs") to include in API requests 2986 // with the JSON null value. By default, fields with empty values are omitted 2987 // from API requests. See 2988 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 2989 NullFields []string `json:"-"` 2990 } 2991 2992 func (s *LoggingDestination) MarshalJSON() ([]byte, error) { 2993 type NoMethod LoggingDestination 2994 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 2995 } 2996 2997 // LongRunning: Describes settings to use when generating API methods that use 2998 // the long-running operation pattern. All default values below are from those 2999 // used in the client library generators (e.g. Java 3000 // (https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). 3001 type LongRunning struct { 3002 // InitialPollDelay: Initial delay after which the first poll request will be 3003 // made. Default value: 5 seconds. 3004 InitialPollDelay string `json:"initialPollDelay,omitempty"` 3005 // MaxPollDelay: Maximum time between two subsequent poll requests. Default 3006 // value: 45 seconds. 3007 MaxPollDelay string `json:"maxPollDelay,omitempty"` 3008 // PollDelayMultiplier: Multiplier to gradually increase delay between 3009 // subsequent polls until it reaches max_poll_delay. Default value: 1.5. 3010 PollDelayMultiplier float64 `json:"pollDelayMultiplier,omitempty"` 3011 // TotalPollTimeout: Total polling timeout. Default value: 5 minutes. 3012 TotalPollTimeout string `json:"totalPollTimeout,omitempty"` 3013 // ForceSendFields is a list of field names (e.g. "InitialPollDelay") to 3014 // unconditionally include in API requests. By default, fields with empty or 3015 // default values are omitted from API requests. See 3016 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 3017 // details. 3018 ForceSendFields []string `json:"-"` 3019 // NullFields is a list of field names (e.g. "InitialPollDelay") to include in 3020 // API requests with the JSON null value. By default, fields with empty values 3021 // are omitted from API requests. See 3022 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 3023 NullFields []string `json:"-"` 3024 } 3025 3026 func (s *LongRunning) MarshalJSON() ([]byte, error) { 3027 type NoMethod LongRunning 3028 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 3029 } 3030 3031 func (s *LongRunning) UnmarshalJSON(data []byte) error { 3032 type NoMethod LongRunning 3033 var s1 struct { 3034 PollDelayMultiplier gensupport.JSONFloat64 `json:"pollDelayMultiplier"` 3035 *NoMethod 3036 } 3037 s1.NoMethod = (*NoMethod)(s) 3038 if err := json.Unmarshal(data, &s1); err != nil { 3039 return err 3040 } 3041 s.PollDelayMultiplier = float64(s1.PollDelayMultiplier) 3042 return nil 3043 } 3044 3045 // Method: Method represents a method of an API interface. 3046 type Method struct { 3047 // Name: The simple name of this method. 3048 Name string `json:"name,omitempty"` 3049 // Options: Any metadata attached to the method. 3050 Options []*Option `json:"options,omitempty"` 3051 // RequestStreaming: If true, the request is streamed. 3052 RequestStreaming bool `json:"requestStreaming,omitempty"` 3053 // RequestTypeUrl: A URL of the input message type. 3054 RequestTypeUrl string `json:"requestTypeUrl,omitempty"` 3055 // ResponseStreaming: If true, the response is streamed. 3056 ResponseStreaming bool `json:"responseStreaming,omitempty"` 3057 // ResponseTypeUrl: The URL of the output message type. 3058 ResponseTypeUrl string `json:"responseTypeUrl,omitempty"` 3059 // Syntax: The source syntax of this method. 3060 // 3061 // Possible values: 3062 // "SYNTAX_PROTO2" - Syntax `proto2`. 3063 // "SYNTAX_PROTO3" - Syntax `proto3`. 3064 // "SYNTAX_EDITIONS" - Syntax `editions`. 3065 Syntax string `json:"syntax,omitempty"` 3066 // ForceSendFields is a list of field names (e.g. "Name") to unconditionally 3067 // include in API requests. By default, fields with empty or default values are 3068 // omitted from API requests. See 3069 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 3070 // details. 3071 ForceSendFields []string `json:"-"` 3072 // NullFields is a list of field names (e.g. "Name") to include in API requests 3073 // with the JSON null value. By default, fields with empty values are omitted 3074 // from API requests. See 3075 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 3076 NullFields []string `json:"-"` 3077 } 3078 3079 func (s *Method) MarshalJSON() ([]byte, error) { 3080 type NoMethod Method 3081 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 3082 } 3083 3084 // MethodPolicy: Defines policies applying to an RPC method. 3085 type MethodPolicy struct { 3086 // RequestPolicies: Policies that are applicable to the request message. 3087 RequestPolicies []*FieldPolicy `json:"requestPolicies,omitempty"` 3088 // Selector: Selects a method to which these policies should be enforced, for 3089 // example, "google.pubsub.v1.Subscriber.CreateSubscription". Refer to selector 3090 // for syntax details. NOTE: This field must not be set in the proto 3091 // annotation. It will be automatically filled by the service config compiler . 3092 Selector string `json:"selector,omitempty"` 3093 // ForceSendFields is a list of field names (e.g. "RequestPolicies") to 3094 // unconditionally include in API requests. By default, fields with empty or 3095 // default values are omitted from API requests. See 3096 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 3097 // details. 3098 ForceSendFields []string `json:"-"` 3099 // NullFields is a list of field names (e.g. "RequestPolicies") to include in 3100 // API requests with the JSON null value. By default, fields with empty values 3101 // are omitted from API requests. See 3102 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 3103 NullFields []string `json:"-"` 3104 } 3105 3106 func (s *MethodPolicy) MarshalJSON() ([]byte, error) { 3107 type NoMethod MethodPolicy 3108 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 3109 } 3110 3111 // MethodSettings: Describes the generator configuration for a method. 3112 type MethodSettings struct { 3113 // AutoPopulatedFields: List of top-level fields of the request message, that 3114 // should be automatically populated by the client libraries based on their 3115 // (google.api.field_info).format. Currently supported format: UUID4. Example 3116 // of a YAML configuration: publishing: method_settings: - selector: 3117 // google.example.v1.ExampleService.CreateExample auto_populated_fields: - 3118 // request_id 3119 AutoPopulatedFields []string `json:"autoPopulatedFields,omitempty"` 3120 // LongRunning: Describes settings to use for long-running operations when 3121 // generating API methods for RPCs. Complements RPCs that use the annotations 3122 // in google/longrunning/operations.proto. Example of a YAML configuration:: 3123 // publishing: method_settings: - selector: 3124 // google.cloud.speech.v2.Speech.BatchRecognize long_running: 3125 // initial_poll_delay: 60s # 1 minute poll_delay_multiplier: 1.5 3126 // max_poll_delay: 360s # 6 minutes total_poll_timeout: 54000s # 90 minutes 3127 LongRunning *LongRunning `json:"longRunning,omitempty"` 3128 // Selector: The fully qualified name of the method, for which the options 3129 // below apply. This is used to find the method to apply the options. Example: 3130 // publishing: method_settings: - selector: 3131 // google.storage.control.v2.StorageControl.CreateFolder # method settings for 3132 // CreateFolder... 3133 Selector string `json:"selector,omitempty"` 3134 // ForceSendFields is a list of field names (e.g. "AutoPopulatedFields") to 3135 // unconditionally include in API requests. By default, fields with empty or 3136 // default values are omitted from API requests. See 3137 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 3138 // details. 3139 ForceSendFields []string `json:"-"` 3140 // NullFields is a list of field names (e.g. "AutoPopulatedFields") to include 3141 // in API requests with the JSON null value. By default, fields with empty 3142 // values are omitted from API requests. See 3143 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 3144 NullFields []string `json:"-"` 3145 } 3146 3147 func (s *MethodSettings) MarshalJSON() ([]byte, error) { 3148 type NoMethod MethodSettings 3149 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 3150 } 3151 3152 // MetricDescriptor: Defines a metric type and its schema. Once a metric 3153 // descriptor is created, deleting or altering it stops data collection and 3154 // makes the metric type's existing data unusable. 3155 type MetricDescriptor struct { 3156 // Description: A detailed description of the metric, which can be used in 3157 // documentation. 3158 Description string `json:"description,omitempty"` 3159 // DisplayName: A concise name for the metric, which can be displayed in user 3160 // interfaces. Use sentence case without an ending period, for example "Request 3161 // count". This field is optional but it is recommended to be set for any 3162 // metrics associated with user-visible concepts, such as Quota. 3163 DisplayName string `json:"displayName,omitempty"` 3164 // Labels: The set of labels that can be used to describe a specific instance 3165 // of this metric type. For example, the 3166 // `appengine.googleapis.com/http/server/response_latencies` metric type has a 3167 // label for the HTTP response code, `response_code`, so you can look at 3168 // latencies for successful responses or just for responses that failed. 3169 Labels []*LabelDescriptor `json:"labels,omitempty"` 3170 // LaunchStage: Optional. The launch stage of the metric definition. 3171 // 3172 // Possible values: 3173 // "LAUNCH_STAGE_UNSPECIFIED" - Do not use this default value. 3174 // "UNIMPLEMENTED" - The feature is not yet implemented. Users can not use 3175 // it. 3176 // "PRELAUNCH" - Prelaunch features are hidden from users and are only 3177 // visible internally. 3178 // "EARLY_ACCESS" - Early Access features are limited to a closed group of 3179 // testers. To use these features, you must sign up in advance and sign a 3180 // Trusted Tester agreement (which includes confidentiality provisions). These 3181 // features may be unstable, changed in backward-incompatible ways, and are not 3182 // guaranteed to be released. 3183 // "ALPHA" - Alpha is a limited availability test for releases before they 3184 // are cleared for widespread use. By Alpha, all significant design issues are 3185 // resolved and we are in the process of verifying functionality. Alpha 3186 // customers need to apply for access, agree to applicable terms, and have 3187 // their projects allowlisted. Alpha releases don't have to be feature 3188 // complete, no SLAs are provided, and there are no technical support 3189 // obligations, but they will be far enough along that customers can actually 3190 // use them in test environments or for limited-use tests -- just like they 3191 // would in normal production cases. 3192 // "BETA" - Beta is the point at which we are ready to open a release for any 3193 // customer to use. There are no SLA or technical support obligations in a Beta 3194 // release. Products will be complete from a feature perspective, but may have 3195 // some open outstanding issues. Beta releases are suitable for limited 3196 // production use cases. 3197 // "GA" - GA features are open to all developers and are considered stable 3198 // and fully qualified for production use. 3199 // "DEPRECATED" - Deprecated features are scheduled to be shut down and 3200 // removed. For more information, see the "Deprecation Policy" section of our 3201 // [Terms of Service](https://cloud.google.com/terms/) and the [Google Cloud 3202 // Platform Subject to the Deprecation 3203 // Policy](https://cloud.google.com/terms/deprecation) documentation. 3204 LaunchStage string `json:"launchStage,omitempty"` 3205 // Metadata: Optional. Metadata which can be used to guide usage of the metric. 3206 Metadata *MetricDescriptorMetadata `json:"metadata,omitempty"` 3207 // MetricKind: Whether the metric records instantaneous values, changes to a 3208 // value, etc. Some combinations of `metric_kind` and `value_type` might not be 3209 // supported. 3210 // 3211 // Possible values: 3212 // "METRIC_KIND_UNSPECIFIED" - Do not use this default value. 3213 // "GAUGE" - An instantaneous measurement of a value. 3214 // "DELTA" - The change in a value during a time interval. 3215 // "CUMULATIVE" - A value accumulated over a time interval. Cumulative 3216 // measurements in a time series should have the same start time and increasing 3217 // end times, until an event resets the cumulative value to zero and sets a new 3218 // start time for the following points. 3219 MetricKind string `json:"metricKind,omitempty"` 3220 // MonitoredResourceTypes: Read-only. If present, then a time series, which is 3221 // identified partially by a metric type and a MonitoredResourceDescriptor, 3222 // that is associated with this metric type can only be associated with one of 3223 // the monitored resource types listed here. 3224 MonitoredResourceTypes []string `json:"monitoredResourceTypes,omitempty"` 3225 // Name: The resource name of the metric descriptor. 3226 Name string `json:"name,omitempty"` 3227 // Type: The metric type, including its DNS name prefix. The type is not 3228 // URL-encoded. All user-defined metric types have the DNS name 3229 // `custom.googleapis.com` or `external.googleapis.com`. Metric types should 3230 // use a natural hierarchical grouping. For example: 3231 // "custom.googleapis.com/invoice/paid/amount" 3232 // "external.googleapis.com/prometheus/up" 3233 // "appengine.googleapis.com/http/server/response_latencies" 3234 Type string `json:"type,omitempty"` 3235 // Unit: The units in which the metric value is reported. It is only applicable 3236 // if the `value_type` is `INT64`, `DOUBLE`, or `DISTRIBUTION`. The `unit` 3237 // defines the representation of the stored metric values. Different systems 3238 // might scale the values to be more easily displayed (so a value of `0.02kBy` 3239 // _might_ be displayed as `20By`, and a value of `3523kBy` _might_ be 3240 // displayed as `3.5MBy`). However, if the `unit` is `kBy`, then the value of 3241 // the metric is always in thousands of bytes, no matter how it might be 3242 // displayed. If you want a custom metric to record the exact number of 3243 // CPU-seconds used by a job, you can create an `INT64 CUMULATIVE` metric whose 3244 // `unit` is `s{CPU}` (or equivalently `1s{CPU}` or just `s`). If the job uses 3245 // 12,005 CPU-seconds, then the value is written as `12005`. Alternatively, if 3246 // you want a custom metric to record data in a more granular way, you can 3247 // create a `DOUBLE CUMULATIVE` metric whose `unit` is `ks{CPU}`, and then 3248 // write the value `12.005` (which is `12005/1000`), or use `Kis{CPU}` and 3249 // write `11.723` (which is `12005/1024`). The supported units are a subset of 3250 // The Unified Code for Units of Measure (https://unitsofmeasure.org/ucum.html) 3251 // standard: **Basic units (UNIT)** * `bit` bit * `By` byte * `s` second * 3252 // `min` minute * `h` hour * `d` day * `1` dimensionless **Prefixes (PREFIX)** 3253 // * `k` kilo (10^3) * `M` mega (10^6) * `G` giga (10^9) * `T` tera (10^12) * 3254 // `P` peta (10^15) * `E` exa (10^18) * `Z` zetta (10^21) * `Y` yotta (10^24) * 3255 // `m` milli (10^-3) * `u` micro (10^-6) * `n` nano (10^-9) * `p` pico (10^-12) 3256 // * `f` femto (10^-15) * `a` atto (10^-18) * `z` zepto (10^-21) * `y` yocto 3257 // (10^-24) * `Ki` kibi (2^10) * `Mi` mebi (2^20) * `Gi` gibi (2^30) * `Ti` 3258 // tebi (2^40) * `Pi` pebi (2^50) **Grammar** The grammar also includes these 3259 // connectors: * `/` division or ratio (as an infix operator). For examples, 3260 // `kBy/{email}` or `MiBy/10ms` (although you should almost never have `/s` in 3261 // a metric `unit`; rates should always be computed at query time from the 3262 // underlying cumulative or delta value). * `.` multiplication or composition 3263 // (as an infix operator). For examples, `GBy.d` or `k{watt}.h`. The grammar 3264 // for a unit is as follows: Expression = Component { "." Component } { "/" 3265 // Component } ; Component = ( [ PREFIX ] UNIT | "%" ) [ Annotation ] | 3266 // Annotation | "1" ; Annotation = "{" NAME "}" ; Notes: * `Annotation` is just 3267 // a comment if it follows a `UNIT`. If the annotation is used alone, then the 3268 // unit is equivalent to `1`. For examples, `{request}/s == 1/s`, 3269 // `By{transmitted}/s == By/s`. * `NAME` is a sequence of non-blank printable 3270 // ASCII characters not containing `{` or `}`. * `1` represents a unitary 3271 // dimensionless unit (https://en.wikipedia.org/wiki/Dimensionless_quantity) of 3272 // 1, such as in `1/s`. It is typically used when none of the basic units are 3273 // appropriate. For example, "new users per day" can be represented as `1/d` or 3274 // `{new-users}/d` (and a metric value `5` would mean "5 new users). 3275 // Alternatively, "thousands of page views per day" would be represented as 3276 // `1000/d` or `k1/d` or `k{page_views}/d` (and a metric value of `5.3` would 3277 // mean "5300 page views per day"). * `%` represents dimensionless value of 3278 // 1/100, and annotates values giving a percentage (so the metric values are 3279 // typically in the range of 0..100, and a metric value `3` means "3 percent"). 3280 // * `10^2.%` indicates a metric contains a ratio, typically in the range 0..1, 3281 // that will be multiplied by 100 and displayed as a percentage (so a metric 3282 // value `0.03` means "3 percent"). 3283 Unit string `json:"unit,omitempty"` 3284 // ValueType: Whether the measurement is an integer, a floating-point number, 3285 // etc. Some combinations of `metric_kind` and `value_type` might not be 3286 // supported. 3287 // 3288 // Possible values: 3289 // "VALUE_TYPE_UNSPECIFIED" - Do not use this default value. 3290 // "BOOL" - The value is a boolean. This value type can be used only if the 3291 // metric kind is `GAUGE`. 3292 // "INT64" - The value is a signed 64-bit integer. 3293 // "DOUBLE" - The value is a double precision floating point number. 3294 // "STRING" - The value is a text string. This value type can be used only if 3295 // the metric kind is `GAUGE`. 3296 // "DISTRIBUTION" - The value is a `Distribution`. 3297 // "MONEY" - The value is money. 3298 ValueType string `json:"valueType,omitempty"` 3299 // ForceSendFields is a list of field names (e.g. "Description") to 3300 // unconditionally include in API requests. By default, fields with empty or 3301 // default values are omitted from API requests. See 3302 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 3303 // details. 3304 ForceSendFields []string `json:"-"` 3305 // NullFields is a list of field names (e.g. "Description") to include in API 3306 // requests with the JSON null value. By default, fields with empty values are 3307 // omitted from API requests. See 3308 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 3309 NullFields []string `json:"-"` 3310 } 3311 3312 func (s *MetricDescriptor) MarshalJSON() ([]byte, error) { 3313 type NoMethod MetricDescriptor 3314 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 3315 } 3316 3317 // MetricDescriptorMetadata: Additional annotations that can be used to guide 3318 // the usage of a metric. 3319 type MetricDescriptorMetadata struct { 3320 // IngestDelay: The delay of data points caused by ingestion. Data points older 3321 // than this age are guaranteed to be ingested and available to be read, 3322 // excluding data loss due to errors. 3323 IngestDelay string `json:"ingestDelay,omitempty"` 3324 // LaunchStage: Deprecated. Must use the MetricDescriptor.launch_stage instead. 3325 // 3326 // Possible values: 3327 // "LAUNCH_STAGE_UNSPECIFIED" - Do not use this default value. 3328 // "UNIMPLEMENTED" - The feature is not yet implemented. Users can not use 3329 // it. 3330 // "PRELAUNCH" - Prelaunch features are hidden from users and are only 3331 // visible internally. 3332 // "EARLY_ACCESS" - Early Access features are limited to a closed group of 3333 // testers. To use these features, you must sign up in advance and sign a 3334 // Trusted Tester agreement (which includes confidentiality provisions). These 3335 // features may be unstable, changed in backward-incompatible ways, and are not 3336 // guaranteed to be released. 3337 // "ALPHA" - Alpha is a limited availability test for releases before they 3338 // are cleared for widespread use. By Alpha, all significant design issues are 3339 // resolved and we are in the process of verifying functionality. Alpha 3340 // customers need to apply for access, agree to applicable terms, and have 3341 // their projects allowlisted. Alpha releases don't have to be feature 3342 // complete, no SLAs are provided, and there are no technical support 3343 // obligations, but they will be far enough along that customers can actually 3344 // use them in test environments or for limited-use tests -- just like they 3345 // would in normal production cases. 3346 // "BETA" - Beta is the point at which we are ready to open a release for any 3347 // customer to use. There are no SLA or technical support obligations in a Beta 3348 // release. Products will be complete from a feature perspective, but may have 3349 // some open outstanding issues. Beta releases are suitable for limited 3350 // production use cases. 3351 // "GA" - GA features are open to all developers and are considered stable 3352 // and fully qualified for production use. 3353 // "DEPRECATED" - Deprecated features are scheduled to be shut down and 3354 // removed. For more information, see the "Deprecation Policy" section of our 3355 // [Terms of Service](https://cloud.google.com/terms/) and the [Google Cloud 3356 // Platform Subject to the Deprecation 3357 // Policy](https://cloud.google.com/terms/deprecation) documentation. 3358 LaunchStage string `json:"launchStage,omitempty"` 3359 // SamplePeriod: The sampling period of metric data points. For metrics which 3360 // are written periodically, consecutive data points are stored at this time 3361 // interval, excluding data loss due to errors. Metrics with a higher 3362 // granularity have a smaller sampling period. 3363 SamplePeriod string `json:"samplePeriod,omitempty"` 3364 // ForceSendFields is a list of field names (e.g. "IngestDelay") to 3365 // unconditionally include in API requests. By default, fields with empty or 3366 // default values are omitted from API requests. See 3367 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 3368 // details. 3369 ForceSendFields []string `json:"-"` 3370 // NullFields is a list of field names (e.g. "IngestDelay") to include in API 3371 // requests with the JSON null value. By default, fields with empty values are 3372 // omitted from API requests. See 3373 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 3374 NullFields []string `json:"-"` 3375 } 3376 3377 func (s *MetricDescriptorMetadata) MarshalJSON() ([]byte, error) { 3378 type NoMethod MetricDescriptorMetadata 3379 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 3380 } 3381 3382 // MetricRule: Bind API methods to metrics. Binding a method to a metric causes 3383 // that metric's configured quota behaviors to apply to the method call. 3384 type MetricRule struct { 3385 // MetricCosts: Metrics to update when the selected methods are called, and the 3386 // associated cost applied to each metric. The key of the map is the metric 3387 // name, and the values are the amount increased for the metric against which 3388 // the quota limits are defined. The value must not be negative. 3389 MetricCosts map[string]string `json:"metricCosts,omitempty"` 3390 // Selector: Selects the methods to which this rule applies. Refer to selector 3391 // for syntax details. 3392 Selector string `json:"selector,omitempty"` 3393 // ForceSendFields is a list of field names (e.g. "MetricCosts") to 3394 // unconditionally include in API requests. By default, fields with empty or 3395 // default values are omitted from API requests. See 3396 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 3397 // details. 3398 ForceSendFields []string `json:"-"` 3399 // NullFields is a list of field names (e.g. "MetricCosts") to include in API 3400 // requests with the JSON null value. By default, fields with empty values are 3401 // omitted from API requests. See 3402 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 3403 NullFields []string `json:"-"` 3404 } 3405 3406 func (s *MetricRule) MarshalJSON() ([]byte, error) { 3407 type NoMethod MetricRule 3408 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 3409 } 3410 3411 // Mixin: Declares an API Interface to be included in this interface. The 3412 // including interface must redeclare all the methods from the included 3413 // interface, but documentation and options are inherited as follows: - If 3414 // after comment and whitespace stripping, the documentation string of the 3415 // redeclared method is empty, it will be inherited from the original method. - 3416 // Each annotation belonging to the service config (http, visibility) which is 3417 // not set in the redeclared method will be inherited. - If an http annotation 3418 // is inherited, the path pattern will be modified as follows. Any version 3419 // prefix will be replaced by the version of the including interface plus the 3420 // root path if specified. Example of a simple mixin: package google.acl.v1; 3421 // service AccessControl { // Get the underlying ACL object. rpc 3422 // GetAcl(GetAclRequest) returns (Acl) { option (google.api.http).get = 3423 // "/v1/{resource=**}:getAcl"; } } package google.storage.v2; service Storage { 3424 // // rpc GetAcl(GetAclRequest) returns (Acl); // Get a data record. rpc 3425 // GetData(GetDataRequest) returns (Data) { option (google.api.http).get = 3426 // "/v2/{resource=**}"; } } Example of a mixin configuration: apis: - name: 3427 // google.storage.v2.Storage mixins: - name: google.acl.v1.AccessControl The 3428 // mixin construct implies that all methods in `AccessControl` are also 3429 // declared with same name and request/response types in `Storage`. A 3430 // documentation generator or annotation processor will see the effective 3431 // `Storage.GetAcl` method after inherting documentation and annotations as 3432 // follows: service Storage { // Get the underlying ACL object. rpc 3433 // GetAcl(GetAclRequest) returns (Acl) { option (google.api.http).get = 3434 // "/v2/{resource=**}:getAcl"; } ... } Note how the version in the path pattern 3435 // changed from `v1` to `v2`. If the `root` field in the mixin is specified, it 3436 // should be a relative path under which inherited HTTP paths are placed. 3437 // Example: apis: - name: google.storage.v2.Storage mixins: - name: 3438 // google.acl.v1.AccessControl root: acls This implies the following inherited 3439 // HTTP annotation: service Storage { // Get the underlying ACL object. rpc 3440 // GetAcl(GetAclRequest) returns (Acl) { option (google.api.http).get = 3441 // "/v2/acls/{resource=**}:getAcl"; } ... } 3442 type Mixin struct { 3443 // Name: The fully qualified name of the interface which is included. 3444 Name string `json:"name,omitempty"` 3445 // Root: If non-empty specifies a path under which inherited HTTP paths are 3446 // rooted. 3447 Root string `json:"root,omitempty"` 3448 // ForceSendFields is a list of field names (e.g. "Name") to unconditionally 3449 // include in API requests. By default, fields with empty or default values are 3450 // omitted from API requests. See 3451 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 3452 // details. 3453 ForceSendFields []string `json:"-"` 3454 // NullFields is a list of field names (e.g. "Name") to include in API requests 3455 // with the JSON null value. By default, fields with empty values are omitted 3456 // from API requests. See 3457 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 3458 NullFields []string `json:"-"` 3459 } 3460 3461 func (s *Mixin) MarshalJSON() ([]byte, error) { 3462 type NoMethod Mixin 3463 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 3464 } 3465 3466 // MonitoredResourceDescriptor: An object that describes the schema of a 3467 // MonitoredResource object using a type name and a set of labels. For example, 3468 // the monitored resource descriptor for Google Compute Engine VM instances has 3469 // a type of "gce_instance" and specifies the use of the labels 3470 // "instance_id" and "zone" to identify particular VM instances. Different 3471 // APIs can support different monitored resource types. APIs generally provide 3472 // a `list` method that returns the monitored resource descriptors used by the 3473 // API. 3474 type MonitoredResourceDescriptor struct { 3475 // Description: Optional. A detailed description of the monitored resource type 3476 // that might be used in documentation. 3477 Description string `json:"description,omitempty"` 3478 // DisplayName: Optional. A concise name for the monitored resource type that 3479 // might be displayed in user interfaces. It should be a Title Cased Noun 3480 // Phrase, without any article or other determiners. For example, "Google 3481 // Cloud SQL Database". 3482 DisplayName string `json:"displayName,omitempty"` 3483 // Labels: Required. A set of labels used to describe instances of this 3484 // monitored resource type. For example, an individual Google Cloud SQL 3485 // database is identified by values for the labels "database_id" and 3486 // "zone". 3487 Labels []*LabelDescriptor `json:"labels,omitempty"` 3488 // LaunchStage: Optional. The launch stage of the monitored resource 3489 // definition. 3490 // 3491 // Possible values: 3492 // "LAUNCH_STAGE_UNSPECIFIED" - Do not use this default value. 3493 // "UNIMPLEMENTED" - The feature is not yet implemented. Users can not use 3494 // it. 3495 // "PRELAUNCH" - Prelaunch features are hidden from users and are only 3496 // visible internally. 3497 // "EARLY_ACCESS" - Early Access features are limited to a closed group of 3498 // testers. To use these features, you must sign up in advance and sign a 3499 // Trusted Tester agreement (which includes confidentiality provisions). These 3500 // features may be unstable, changed in backward-incompatible ways, and are not 3501 // guaranteed to be released. 3502 // "ALPHA" - Alpha is a limited availability test for releases before they 3503 // are cleared for widespread use. By Alpha, all significant design issues are 3504 // resolved and we are in the process of verifying functionality. Alpha 3505 // customers need to apply for access, agree to applicable terms, and have 3506 // their projects allowlisted. Alpha releases don't have to be feature 3507 // complete, no SLAs are provided, and there are no technical support 3508 // obligations, but they will be far enough along that customers can actually 3509 // use them in test environments or for limited-use tests -- just like they 3510 // would in normal production cases. 3511 // "BETA" - Beta is the point at which we are ready to open a release for any 3512 // customer to use. There are no SLA or technical support obligations in a Beta 3513 // release. Products will be complete from a feature perspective, but may have 3514 // some open outstanding issues. Beta releases are suitable for limited 3515 // production use cases. 3516 // "GA" - GA features are open to all developers and are considered stable 3517 // and fully qualified for production use. 3518 // "DEPRECATED" - Deprecated features are scheduled to be shut down and 3519 // removed. For more information, see the "Deprecation Policy" section of our 3520 // [Terms of Service](https://cloud.google.com/terms/) and the [Google Cloud 3521 // Platform Subject to the Deprecation 3522 // Policy](https://cloud.google.com/terms/deprecation) documentation. 3523 LaunchStage string `json:"launchStage,omitempty"` 3524 // Name: Optional. The resource name of the monitored resource descriptor: 3525 // "projects/{project_id}/monitoredResourceDescriptors/{type}" where {type} 3526 // is the value of the `type` field in this object and {project_id} is a 3527 // project ID that provides API-specific context for accessing the type. APIs 3528 // that do not use project information can use the resource name format 3529 // "monitoredResourceDescriptors/{type}". 3530 Name string `json:"name,omitempty"` 3531 // Type: Required. The monitored resource type. For example, the type 3532 // "cloudsql_database" represents databases in Google Cloud SQL. For a list 3533 // of types, see Monitored resource types 3534 // (https://cloud.google.com/monitoring/api/resources) and Logging resource 3535 // types (https://cloud.google.com/logging/docs/api/v2/resource-list). 3536 Type string `json:"type,omitempty"` 3537 // ForceSendFields is a list of field names (e.g. "Description") to 3538 // unconditionally include in API requests. By default, fields with empty or 3539 // default values are omitted from API requests. See 3540 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 3541 // details. 3542 ForceSendFields []string `json:"-"` 3543 // NullFields is a list of field names (e.g. "Description") to include in API 3544 // requests with the JSON null value. By default, fields with empty values are 3545 // omitted from API requests. See 3546 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 3547 NullFields []string `json:"-"` 3548 } 3549 3550 func (s *MonitoredResourceDescriptor) MarshalJSON() ([]byte, error) { 3551 type NoMethod MonitoredResourceDescriptor 3552 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 3553 } 3554 3555 // Monitoring: Monitoring configuration of the service. The example below shows 3556 // how to configure monitored resources and metrics for monitoring. In the 3557 // example, a monitored resource and two metrics are defined. The 3558 // `library.googleapis.com/book/returned_count` metric is sent to both producer 3559 // and consumer projects, whereas the `library.googleapis.com/book/num_overdue` 3560 // metric is only sent to the consumer project. monitored_resources: - type: 3561 // library.googleapis.com/Branch display_name: "Library Branch" description: "A 3562 // branch of a library." launch_stage: GA labels: - key: resource_container 3563 // description: "The Cloud container (ie. project id) for the Branch." - key: 3564 // location description: "The location of the library branch." - key: branch_id 3565 // description: "The id of the branch." metrics: - name: 3566 // library.googleapis.com/book/returned_count display_name: "Books Returned" 3567 // description: "The count of books that have been returned." launch_stage: GA 3568 // metric_kind: DELTA value_type: INT64 unit: "1" labels: - key: customer_id 3569 // description: "The id of the customer." - name: 3570 // library.googleapis.com/book/num_overdue display_name: "Books Overdue" 3571 // description: "The current number of overdue books." launch_stage: GA 3572 // metric_kind: GAUGE value_type: INT64 unit: "1" labels: - key: customer_id 3573 // description: "The id of the customer." monitoring: producer_destinations: - 3574 // monitored_resource: library.googleapis.com/Branch metrics: - 3575 // library.googleapis.com/book/returned_count consumer_destinations: - 3576 // monitored_resource: library.googleapis.com/Branch metrics: - 3577 // library.googleapis.com/book/returned_count - 3578 // library.googleapis.com/book/num_overdue 3579 type Monitoring struct { 3580 // ConsumerDestinations: Monitoring configurations for sending metrics to the 3581 // consumer project. There can be multiple consumer destinations. A monitored 3582 // resource type may appear in multiple monitoring destinations if different 3583 // aggregations are needed for different sets of metrics associated with that 3584 // monitored resource type. A monitored resource and metric pair may only be 3585 // used once in the Monitoring configuration. 3586 ConsumerDestinations []*MonitoringDestination `json:"consumerDestinations,omitempty"` 3587 // ProducerDestinations: Monitoring configurations for sending metrics to the 3588 // producer project. There can be multiple producer destinations. A monitored 3589 // resource type may appear in multiple monitoring destinations if different 3590 // aggregations are needed for different sets of metrics associated with that 3591 // monitored resource type. A monitored resource and metric pair may only be 3592 // used once in the Monitoring configuration. 3593 ProducerDestinations []*MonitoringDestination `json:"producerDestinations,omitempty"` 3594 // ForceSendFields is a list of field names (e.g. "ConsumerDestinations") to 3595 // unconditionally include in API requests. By default, fields with empty or 3596 // default values are omitted from API requests. See 3597 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 3598 // details. 3599 ForceSendFields []string `json:"-"` 3600 // NullFields is a list of field names (e.g. "ConsumerDestinations") to include 3601 // in API requests with the JSON null value. By default, fields with empty 3602 // values are omitted from API requests. See 3603 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 3604 NullFields []string `json:"-"` 3605 } 3606 3607 func (s *Monitoring) MarshalJSON() ([]byte, error) { 3608 type NoMethod Monitoring 3609 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 3610 } 3611 3612 // MonitoringDestination: Configuration of a specific monitoring destination 3613 // (the producer project or the consumer project). 3614 type MonitoringDestination struct { 3615 // Metrics: Types of the metrics to report to this monitoring destination. Each 3616 // type must be defined in Service.metrics section. 3617 Metrics []string `json:"metrics,omitempty"` 3618 // MonitoredResource: The monitored resource type. The type must be defined in 3619 // Service.monitored_resources section. 3620 MonitoredResource string `json:"monitoredResource,omitempty"` 3621 // ForceSendFields is a list of field names (e.g. "Metrics") to unconditionally 3622 // include in API requests. By default, fields with empty or default values are 3623 // omitted from API requests. See 3624 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 3625 // details. 3626 ForceSendFields []string `json:"-"` 3627 // NullFields is a list of field names (e.g. "Metrics") to include in API 3628 // requests with the JSON null value. By default, fields with empty values are 3629 // omitted from API requests. See 3630 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 3631 NullFields []string `json:"-"` 3632 } 3633 3634 func (s *MonitoringDestination) MarshalJSON() ([]byte, error) { 3635 type NoMethod MonitoringDestination 3636 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 3637 } 3638 3639 // NodeSettings: Settings for Node client libraries. 3640 type NodeSettings struct { 3641 // Common: Some settings. 3642 Common *CommonLanguageSettings `json:"common,omitempty"` 3643 // ForceSendFields is a list of field names (e.g. "Common") to unconditionally 3644 // include in API requests. By default, fields with empty or default values are 3645 // omitted from API requests. See 3646 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 3647 // details. 3648 ForceSendFields []string `json:"-"` 3649 // NullFields is a list of field names (e.g. "Common") to include in API 3650 // requests with the JSON null value. By default, fields with empty values are 3651 // omitted from API requests. See 3652 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 3653 NullFields []string `json:"-"` 3654 } 3655 3656 func (s *NodeSettings) MarshalJSON() ([]byte, error) { 3657 type NoMethod NodeSettings 3658 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 3659 } 3660 3661 // OAuthRequirements: OAuth scopes are a way to define data and permissions on 3662 // data. For example, there are scopes defined for "Read-only access to Google 3663 // Calendar" and "Access to Cloud Platform". Users can consent to a scope for 3664 // an application, giving it permission to access that data on their behalf. 3665 // OAuth scope specifications should be fairly coarse grained; a user will need 3666 // to see and understand the text description of what your scope means. In most 3667 // cases: use one or at most two OAuth scopes for an entire family of products. 3668 // If your product has multiple APIs, you should probably be sharing the OAuth 3669 // scope across all of those APIs. When you need finer grained OAuth consent 3670 // screens: talk with your product management about how developers will use 3671 // them in practice. Please note that even though each of the canonical scopes 3672 // is enough for a request to be accepted and passed to the backend, a request 3673 // can still fail due to the backend requiring additional scopes or 3674 // permissions. 3675 type OAuthRequirements struct { 3676 // CanonicalScopes: The list of publicly documented OAuth scopes that are 3677 // allowed access. An OAuth token containing any of these scopes will be 3678 // accepted. Example: canonical_scopes: 3679 // https://www.googleapis.com/auth/calendar, 3680 // https://www.googleapis.com/auth/calendar.read 3681 CanonicalScopes string `json:"canonicalScopes,omitempty"` 3682 // ForceSendFields is a list of field names (e.g. "CanonicalScopes") to 3683 // unconditionally include in API requests. By default, fields with empty or 3684 // default values are omitted from API requests. See 3685 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 3686 // details. 3687 ForceSendFields []string `json:"-"` 3688 // NullFields is a list of field names (e.g. "CanonicalScopes") to include in 3689 // API requests with the JSON null value. By default, fields with empty values 3690 // are omitted from API requests. See 3691 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 3692 NullFields []string `json:"-"` 3693 } 3694 3695 func (s *OAuthRequirements) MarshalJSON() ([]byte, error) { 3696 type NoMethod OAuthRequirements 3697 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 3698 } 3699 3700 // Operation: This resource represents a long-running operation that is the 3701 // result of a network API call. 3702 type Operation struct { 3703 // Done: If the value is `false`, it means the operation is still in progress. 3704 // If `true`, the operation is completed, and either `error` or `response` is 3705 // available. 3706 Done bool `json:"done,omitempty"` 3707 // Error: The error result of the operation in case of failure or cancellation. 3708 Error *Status `json:"error,omitempty"` 3709 // Metadata: Service-specific metadata associated with the operation. It 3710 // typically contains progress information and common metadata such as create 3711 // time. Some services might not provide such metadata. Any method that returns 3712 // a long-running operation should document the metadata type, if any. 3713 Metadata googleapi.RawMessage `json:"metadata,omitempty"` 3714 // Name: The server-assigned name, which is only unique within the same service 3715 // that originally returns it. If you use the default HTTP mapping, the `name` 3716 // should be a resource name ending with `operations/{unique_id}`. 3717 Name string `json:"name,omitempty"` 3718 // Response: The normal, successful response of the operation. If the original 3719 // method returns no data on success, such as `Delete`, the response is 3720 // `google.protobuf.Empty`. If the original method is standard 3721 // `Get`/`Create`/`Update`, the response should be the resource. For other 3722 // methods, the response should have the type `XxxResponse`, where `Xxx` is the 3723 // original method name. For example, if the original method name is 3724 // `TakeSnapshot()`, the inferred response type is `TakeSnapshotResponse`. 3725 Response googleapi.RawMessage `json:"response,omitempty"` 3726 3727 // ServerResponse contains the HTTP response code and headers from the server. 3728 googleapi.ServerResponse `json:"-"` 3729 // ForceSendFields is a list of field names (e.g. "Done") to unconditionally 3730 // include in API requests. By default, fields with empty or default values are 3731 // omitted from API requests. See 3732 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 3733 // details. 3734 ForceSendFields []string `json:"-"` 3735 // NullFields is a list of field names (e.g. "Done") to include in API requests 3736 // with the JSON null value. By default, fields with empty values are omitted 3737 // from API requests. See 3738 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 3739 NullFields []string `json:"-"` 3740 } 3741 3742 func (s *Operation) MarshalJSON() ([]byte, error) { 3743 type NoMethod Operation 3744 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 3745 } 3746 3747 // OperationMetadata: The operation metadata returned for the batchend services 3748 // operation. 3749 type OperationMetadata struct { 3750 // ResourceNames: The full name of the resources that this operation is 3751 // directly associated with. 3752 ResourceNames []string `json:"resourceNames,omitempty"` 3753 // ForceSendFields is a list of field names (e.g. "ResourceNames") to 3754 // unconditionally include in API requests. By default, fields with empty or 3755 // default values are omitted from API requests. See 3756 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 3757 // details. 3758 ForceSendFields []string `json:"-"` 3759 // NullFields is a list of field names (e.g. "ResourceNames") to include in API 3760 // requests with the JSON null value. By default, fields with empty values are 3761 // omitted from API requests. See 3762 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 3763 NullFields []string `json:"-"` 3764 } 3765 3766 func (s *OperationMetadata) MarshalJSON() ([]byte, error) { 3767 type NoMethod OperationMetadata 3768 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 3769 } 3770 3771 // Option: A protocol buffer option, which can be attached to a message, field, 3772 // enumeration, etc. 3773 type Option struct { 3774 // Name: The option's name. For protobuf built-in options (options defined in 3775 // descriptor.proto), this is the short name. For example, "map_entry". For 3776 // custom options, it should be the fully-qualified name. For example, 3777 // "google.api.http". 3778 Name string `json:"name,omitempty"` 3779 // Value: The option's value packed in an Any message. If the value is a 3780 // primitive, the corresponding wrapper type defined in 3781 // google/protobuf/wrappers.proto should be used. If the value is an enum, it 3782 // should be stored as an int32 value using the google.protobuf.Int32Value 3783 // type. 3784 Value googleapi.RawMessage `json:"value,omitempty"` 3785 // ForceSendFields is a list of field names (e.g. "Name") to unconditionally 3786 // include in API requests. By default, fields with empty or default values are 3787 // omitted from API requests. See 3788 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 3789 // details. 3790 ForceSendFields []string `json:"-"` 3791 // NullFields is a list of field names (e.g. "Name") to include in API requests 3792 // with the JSON null value. By default, fields with empty values are omitted 3793 // from API requests. See 3794 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 3795 NullFields []string `json:"-"` 3796 } 3797 3798 func (s *Option) MarshalJSON() ([]byte, error) { 3799 type NoMethod Option 3800 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 3801 } 3802 3803 // OverrideInlineSource: Import data embedded in the request message 3804 type OverrideInlineSource struct { 3805 // Overrides: The overrides to create. Each override must have a value for 3806 // 'metric' and 'unit', to specify which metric and which limit the override 3807 // should be applied to. The 'name' field of the override does not need to be 3808 // set; it is ignored. 3809 Overrides []*QuotaOverride `json:"overrides,omitempty"` 3810 // ForceSendFields is a list of field names (e.g. "Overrides") to 3811 // unconditionally include in API requests. By default, fields with empty or 3812 // default values are omitted from API requests. See 3813 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 3814 // details. 3815 ForceSendFields []string `json:"-"` 3816 // NullFields is a list of field names (e.g. "Overrides") to include in API 3817 // requests with the JSON null value. By default, fields with empty values are 3818 // omitted from API requests. See 3819 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 3820 NullFields []string `json:"-"` 3821 } 3822 3823 func (s *OverrideInlineSource) MarshalJSON() ([]byte, error) { 3824 type NoMethod OverrideInlineSource 3825 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 3826 } 3827 3828 // Page: Represents a documentation page. A page can contain subpages to 3829 // represent nested documentation set structure. 3830 type Page struct { 3831 // Content: The Markdown content of the page. You can use (== include {path} 3832 // ==) to include content from a Markdown file. The content can be used to 3833 // produce the documentation page such as HTML format page. 3834 Content string `json:"content,omitempty"` 3835 // Name: The name of the page. It will be used as an identity of the page to 3836 // generate URI of the page, text of the link to this page in navigation, etc. 3837 // The full page name (start from the root page name to this page concatenated 3838 // with `.`) can be used as reference to the page in your documentation. For 3839 // example: pages: - name: Tutorial content: (== include tutorial.md ==) 3840 // subpages: - name: Java content: (== include tutorial_java.md ==) You can 3841 // reference `Java` page using Markdown reference link syntax: `Java`. 3842 Name string `json:"name,omitempty"` 3843 // Subpages: Subpages of this page. The order of subpages specified here will 3844 // be honored in the generated docset. 3845 Subpages []*Page `json:"subpages,omitempty"` 3846 // ForceSendFields is a list of field names (e.g. "Content") to unconditionally 3847 // include in API requests. By default, fields with empty or default values are 3848 // omitted from API requests. See 3849 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 3850 // details. 3851 ForceSendFields []string `json:"-"` 3852 // NullFields is a list of field names (e.g. "Content") to include in API 3853 // requests with the JSON null value. By default, fields with empty values are 3854 // omitted from API requests. See 3855 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 3856 NullFields []string `json:"-"` 3857 } 3858 3859 func (s *Page) MarshalJSON() ([]byte, error) { 3860 type NoMethod Page 3861 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 3862 } 3863 3864 // PhpSettings: Settings for Php client libraries. 3865 type PhpSettings struct { 3866 // Common: Some settings. 3867 Common *CommonLanguageSettings `json:"common,omitempty"` 3868 // ForceSendFields is a list of field names (e.g. "Common") to unconditionally 3869 // include in API requests. By default, fields with empty or default values are 3870 // omitted from API requests. See 3871 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 3872 // details. 3873 ForceSendFields []string `json:"-"` 3874 // NullFields is a list of field names (e.g. "Common") to include in API 3875 // requests with the JSON null value. By default, fields with empty values are 3876 // omitted from API requests. See 3877 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 3878 NullFields []string `json:"-"` 3879 } 3880 3881 func (s *PhpSettings) MarshalJSON() ([]byte, error) { 3882 type NoMethod PhpSettings 3883 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 3884 } 3885 3886 // ProducerQuotaPolicy: Quota policy created by service producer. 3887 type ProducerQuotaPolicy struct { 3888 // Container: The cloud resource container at which the quota policy is 3889 // created. The format is `{container_type}/{container_number}` 3890 Container string `json:"container,omitempty"` 3891 // Dimensions: If this map is nonempty, then this policy applies only to 3892 // specific values for dimensions defined in the limit unit. For example, a 3893 // policy on a limit with the unit `1/{project}/{region}` could contain an 3894 // entry with the key `region` and the value `us-east-1`; the policy is only 3895 // applied to quota consumed in that region. This map has the following 3896 // restrictions: * Keys that are not defined in the limit's unit are not valid 3897 // keys. Any string appearing in {brackets} in the unit (besides {project} or 3898 // {user}) is a defined key. * `project` is not a valid key; the project is 3899 // already specified in the parent resource name. * `user` is not a valid key; 3900 // the API does not support quota policies that apply only to a specific user. 3901 // * If `region` appears as a key, its value must be a valid Cloud region. * If 3902 // `zone` appears as a key, its value must be a valid Cloud zone. * If any 3903 // valid key other than `region` or `zone` appears in the map, then all valid 3904 // keys other than `region` or `zone` must also appear in the map. 3905 Dimensions map[string]string `json:"dimensions,omitempty"` 3906 // Metric: The name of the metric to which this policy applies. An example name 3907 // would be: `compute.googleapis.com/cpus` 3908 Metric string `json:"metric,omitempty"` 3909 // Name: The resource name of the policy. This name is generated by the server 3910 // when the policy is created. Example names would be: 3911 // `organizations/123/services/compute.googleapis.com/consumerQuotaMetrics/compu 3912 // te.googleapis.com%2Fcpus/limits/%2Fproject%2Fregion/producerQuotaPolicies/4a3 3913 // f2c1d` 3914 Name string `json:"name,omitempty"` 3915 // PolicyValue: The quota policy value. Can be any nonnegative integer, or -1 3916 // (unlimited quota). 3917 PolicyValue int64 `json:"policyValue,omitempty,string"` 3918 // Unit: The limit unit of the limit to which this policy applies. An example 3919 // unit would be: `1/{project}/{region}` Note that `{project}` and `{region}` 3920 // are not placeholders in this example; the literal characters `{` and `}` 3921 // occur in the string. 3922 Unit string `json:"unit,omitempty"` 3923 // ForceSendFields is a list of field names (e.g. "Container") to 3924 // unconditionally include in API requests. By default, fields with empty or 3925 // default values are omitted from API requests. See 3926 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 3927 // details. 3928 ForceSendFields []string `json:"-"` 3929 // NullFields is a list of field names (e.g. "Container") to include in API 3930 // requests with the JSON null value. By default, fields with empty values are 3931 // omitted from API requests. See 3932 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 3933 NullFields []string `json:"-"` 3934 } 3935 3936 func (s *ProducerQuotaPolicy) MarshalJSON() ([]byte, error) { 3937 type NoMethod ProducerQuotaPolicy 3938 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 3939 } 3940 3941 // Publishing: This message configures the settings for publishing Google Cloud 3942 // Client libraries (https://cloud.google.com/apis/docs/cloud-client-libraries) 3943 // generated from the service config. 3944 type Publishing struct { 3945 // ApiShortName: Used as a tracking tag when collecting data about the APIs 3946 // developer relations artifacts like docs, packages delivered to package 3947 // managers, etc. Example: "speech". 3948 ApiShortName string `json:"apiShortName,omitempty"` 3949 // CodeownerGithubTeams: GitHub teams to be added to CODEOWNERS in the 3950 // directory in GitHub containing source code for the client libraries for this 3951 // API. 3952 CodeownerGithubTeams []string `json:"codeownerGithubTeams,omitempty"` 3953 // DocTagPrefix: A prefix used in sample code when demarking regions to be 3954 // included in documentation. 3955 DocTagPrefix string `json:"docTagPrefix,omitempty"` 3956 // DocumentationUri: Link to product home page. Example: 3957 // https://cloud.google.com/asset-inventory/docs/overview 3958 DocumentationUri string `json:"documentationUri,omitempty"` 3959 // GithubLabel: GitHub label to apply to issues and pull requests opened for 3960 // this API. 3961 GithubLabel string `json:"githubLabel,omitempty"` 3962 // LibrarySettings: Client library settings. If the same version string appears 3963 // multiple times in this list, then the last one wins. Settings from earlier 3964 // settings with the same version string are discarded. 3965 LibrarySettings []*ClientLibrarySettings `json:"librarySettings,omitempty"` 3966 // MethodSettings: A list of API method settings, e.g. the behavior for methods 3967 // that use the long-running operation pattern. 3968 MethodSettings []*MethodSettings `json:"methodSettings,omitempty"` 3969 // NewIssueUri: Link to a *public* URI where users can report issues. Example: 3970 // https://issuetracker.google.com/issues/new?component=190865&template=1161103 3971 NewIssueUri string `json:"newIssueUri,omitempty"` 3972 // Organization: For whom the client library is being published. 3973 // 3974 // Possible values: 3975 // "CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED" - Not useful. 3976 // "CLOUD" - Google Cloud Platform Org. 3977 // "ADS" - Ads (Advertising) Org. 3978 // "PHOTOS" - Photos Org. 3979 // "STREET_VIEW" - Street View Org. 3980 // "SHOPPING" - Shopping Org. 3981 // "GEO" - Geo Org. 3982 // "GENERATIVE_AI" - Generative AI - https://developers.generativeai.google 3983 Organization string `json:"organization,omitempty"` 3984 // ProtoReferenceDocumentationUri: Optional link to proto reference 3985 // documentation. Example: 3986 // https://cloud.google.com/pubsub/lite/docs/reference/rpc 3987 ProtoReferenceDocumentationUri string `json:"protoReferenceDocumentationUri,omitempty"` 3988 // RestReferenceDocumentationUri: Optional link to REST reference 3989 // documentation. Example: 3990 // https://cloud.google.com/pubsub/lite/docs/reference/rest 3991 RestReferenceDocumentationUri string `json:"restReferenceDocumentationUri,omitempty"` 3992 // ForceSendFields is a list of field names (e.g. "ApiShortName") to 3993 // unconditionally include in API requests. By default, fields with empty or 3994 // default values are omitted from API requests. See 3995 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 3996 // details. 3997 ForceSendFields []string `json:"-"` 3998 // NullFields is a list of field names (e.g. "ApiShortName") to include in API 3999 // requests with the JSON null value. By default, fields with empty values are 4000 // omitted from API requests. See 4001 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 4002 NullFields []string `json:"-"` 4003 } 4004 4005 func (s *Publishing) MarshalJSON() ([]byte, error) { 4006 type NoMethod Publishing 4007 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 4008 } 4009 4010 // PythonSettings: Settings for Python client libraries. 4011 type PythonSettings struct { 4012 // Common: Some settings. 4013 Common *CommonLanguageSettings `json:"common,omitempty"` 4014 // ForceSendFields is a list of field names (e.g. "Common") to unconditionally 4015 // include in API requests. By default, fields with empty or default values are 4016 // omitted from API requests. See 4017 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 4018 // details. 4019 ForceSendFields []string `json:"-"` 4020 // NullFields is a list of field names (e.g. "Common") to include in API 4021 // requests with the JSON null value. By default, fields with empty values are 4022 // omitted from API requests. See 4023 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 4024 NullFields []string `json:"-"` 4025 } 4026 4027 func (s *PythonSettings) MarshalJSON() ([]byte, error) { 4028 type NoMethod PythonSettings 4029 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 4030 } 4031 4032 // Quota: Quota configuration helps to achieve fairness and budgeting in 4033 // service usage. The metric based quota configuration works this way: - The 4034 // service configuration defines a set of metrics. - For API calls, the 4035 // quota.metric_rules maps methods to metrics with corresponding costs. - The 4036 // quota.limits defines limits on the metrics, which will be used for quota 4037 // checks at runtime. An example quota configuration in yaml format: quota: 4038 // limits: - name: apiWriteQpsPerProject metric: 4039 // library.googleapis.com/write_calls unit: "1/min/{project}" # rate limit for 4040 // consumer projects values: STANDARD: 10000 (The metric rules bind all methods 4041 // to the read_calls metric, except for the UpdateBook and DeleteBook methods. 4042 // These two methods are mapped to the write_calls metric, with the UpdateBook 4043 // method consuming at twice rate as the DeleteBook method.) metric_rules: - 4044 // selector: "*" metric_costs: library.googleapis.com/read_calls: 1 - selector: 4045 // google.example.library.v1.LibraryService.UpdateBook metric_costs: 4046 // library.googleapis.com/write_calls: 2 - selector: 4047 // google.example.library.v1.LibraryService.DeleteBook metric_costs: 4048 // library.googleapis.com/write_calls: 1 Corresponding Metric definition: 4049 // metrics: - name: library.googleapis.com/read_calls display_name: Read 4050 // requests metric_kind: DELTA value_type: INT64 - name: 4051 // library.googleapis.com/write_calls display_name: Write requests metric_kind: 4052 // DELTA value_type: INT64 4053 type Quota struct { 4054 // Limits: List of QuotaLimit definitions for the service. 4055 Limits []*QuotaLimit `json:"limits,omitempty"` 4056 // MetricRules: List of MetricRule definitions, each one mapping a selected 4057 // method to one or more metrics. 4058 MetricRules []*MetricRule `json:"metricRules,omitempty"` 4059 // ForceSendFields is a list of field names (e.g. "Limits") to unconditionally 4060 // include in API requests. By default, fields with empty or default values are 4061 // omitted from API requests. See 4062 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 4063 // details. 4064 ForceSendFields []string `json:"-"` 4065 // NullFields is a list of field names (e.g. "Limits") to include in API 4066 // requests with the JSON null value. By default, fields with empty values are 4067 // omitted from API requests. See 4068 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 4069 NullFields []string `json:"-"` 4070 } 4071 4072 func (s *Quota) MarshalJSON() ([]byte, error) { 4073 type NoMethod Quota 4074 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 4075 } 4076 4077 // QuotaBucket: A quota bucket is a quota provisioning unit for a specific set 4078 // of dimensions. 4079 type QuotaBucket struct { 4080 // AdminOverride: Admin override on this quota bucket. 4081 AdminOverride *QuotaOverride `json:"adminOverride,omitempty"` 4082 // ConsumerOverride: Consumer override on this quota bucket. 4083 ConsumerOverride *QuotaOverride `json:"consumerOverride,omitempty"` 4084 // DefaultLimit: The default limit of this quota bucket, as specified by the 4085 // service configuration. 4086 DefaultLimit int64 `json:"defaultLimit,omitempty,string"` 4087 // Dimensions: The dimensions of this quota bucket. If this map is empty, this 4088 // is the global bucket, which is the default quota value applied to all 4089 // requests that do not have a more specific override. If this map is nonempty, 4090 // the default limit, effective limit, and quota overrides apply only to 4091 // requests that have the dimensions given in the map. For example, if the map 4092 // has key `region` and value `us-east-1`, then the specified effective limit 4093 // is only effective in that region, and the specified overrides apply only in 4094 // that region. 4095 Dimensions map[string]string `json:"dimensions,omitempty"` 4096 // EffectiveLimit: The effective limit of this quota bucket. Equal to 4097 // default_limit if there are no overrides. 4098 EffectiveLimit int64 `json:"effectiveLimit,omitempty,string"` 4099 // ProducerOverride: Producer override on this quota bucket. 4100 ProducerOverride *QuotaOverride `json:"producerOverride,omitempty"` 4101 // ProducerQuotaPolicy: Producer policy inherited from the closet ancestor of 4102 // the current consumer. 4103 ProducerQuotaPolicy *ProducerQuotaPolicy `json:"producerQuotaPolicy,omitempty"` 4104 // RolloutInfo: Rollout information of this quota bucket. This field is present 4105 // only if the effective limit will change due to the ongoing rollout of the 4106 // service config. 4107 RolloutInfo *RolloutInfo `json:"rolloutInfo,omitempty"` 4108 // ForceSendFields is a list of field names (e.g. "AdminOverride") to 4109 // unconditionally include in API requests. By default, fields with empty or 4110 // default values are omitted from API requests. See 4111 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 4112 // details. 4113 ForceSendFields []string `json:"-"` 4114 // NullFields is a list of field names (e.g. "AdminOverride") to include in API 4115 // requests with the JSON null value. By default, fields with empty values are 4116 // omitted from API requests. See 4117 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 4118 NullFields []string `json:"-"` 4119 } 4120 4121 func (s *QuotaBucket) MarshalJSON() ([]byte, error) { 4122 type NoMethod QuotaBucket 4123 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 4124 } 4125 4126 // QuotaLimit: `QuotaLimit` defines a specific limit that applies over a 4127 // specified duration for a limit type. There can be at most one limit for a 4128 // duration and limit type combination defined within a `QuotaGroup`. 4129 type QuotaLimit struct { 4130 // DefaultLimit: Default number of tokens that can be consumed during the 4131 // specified duration. This is the number of tokens assigned when a client 4132 // application developer activates the service for his/her project. Specifying 4133 // a value of 0 will block all requests. This can be used if you are 4134 // provisioning quota to selected consumers and blocking others. Similarly, a 4135 // value of -1 will indicate an unlimited quota. No other negative values are 4136 // allowed. Used by group-based quotas only. 4137 DefaultLimit int64 `json:"defaultLimit,omitempty,string"` 4138 // Description: Optional. User-visible, extended description for this quota 4139 // limit. Should be used only when more context is needed to understand this 4140 // limit than provided by the limit's display name (see: `display_name`). 4141 Description string `json:"description,omitempty"` 4142 // DisplayName: User-visible display name for this limit. Optional. If not set, 4143 // the UI will provide a default display name based on the quota configuration. 4144 // This field can be used to override the default display name generated from 4145 // the configuration. 4146 DisplayName string `json:"displayName,omitempty"` 4147 // Duration: Duration of this limit in textual notation. Must be "100s" or 4148 // "1d". Used by group-based quotas only. 4149 Duration string `json:"duration,omitempty"` 4150 // FreeTier: Free tier value displayed in the Developers Console for this 4151 // limit. The free tier is the number of tokens that will be subtracted from 4152 // the billed amount when billing is enabled. This field can only be set on a 4153 // limit with duration "1d", in a billable group; it is invalid on any other 4154 // limit. If this field is not set, it defaults to 0, indicating that there is 4155 // no free tier for this service. Used by group-based quotas only. 4156 FreeTier int64 `json:"freeTier,omitempty,string"` 4157 // MaxLimit: Maximum number of tokens that can be consumed during the specified 4158 // duration. Client application developers can override the default limit up to 4159 // this maximum. If specified, this value cannot be set to a value less than 4160 // the default limit. If not specified, it is set to the default limit. To 4161 // allow clients to apply overrides with no upper bound, set this to -1, 4162 // indicating unlimited maximum quota. Used by group-based quotas only. 4163 MaxLimit int64 `json:"maxLimit,omitempty,string"` 4164 // Metric: The name of the metric this quota limit applies to. The quota limits 4165 // with the same metric will be checked together during runtime. The metric 4166 // must be defined within the service config. 4167 Metric string `json:"metric,omitempty"` 4168 // Name: Name of the quota limit. The name must be provided, and it must be 4169 // unique within the service. The name can only include alphanumeric characters 4170 // as well as '-'. The maximum length of the limit name is 64 characters. 4171 Name string `json:"name,omitempty"` 4172 // Unit: Specify the unit of the quota limit. It uses the same syntax as 4173 // Metric.unit. The supported unit kinds are determined by the quota backend 4174 // system. Here are some examples: * "1/min/{project}" for quota per minute per 4175 // project. Note: the order of unit components is insignificant. The "1" at the 4176 // beginning is required to follow the metric unit syntax. 4177 Unit string `json:"unit,omitempty"` 4178 // Values: Tiered limit values. You must specify this as a key:value pair, with 4179 // an integer value that is the maximum number of requests allowed for the 4180 // specified unit. Currently only STANDARD is supported. 4181 Values map[string]string `json:"values,omitempty"` 4182 // ForceSendFields is a list of field names (e.g. "DefaultLimit") to 4183 // unconditionally include in API requests. By default, fields with empty or 4184 // default values are omitted from API requests. See 4185 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 4186 // details. 4187 ForceSendFields []string `json:"-"` 4188 // NullFields is a list of field names (e.g. "DefaultLimit") to include in API 4189 // requests with the JSON null value. By default, fields with empty values are 4190 // omitted from API requests. See 4191 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 4192 NullFields []string `json:"-"` 4193 } 4194 4195 func (s *QuotaLimit) MarshalJSON() ([]byte, error) { 4196 type NoMethod QuotaLimit 4197 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 4198 } 4199 4200 // QuotaOverride: A quota override 4201 type QuotaOverride struct { 4202 // AdminOverrideAncestor: The resource name of the ancestor that requested the 4203 // override. For example: `organizations/12345` or `folders/67890`. Used by 4204 // admin overrides only. 4205 AdminOverrideAncestor string `json:"adminOverrideAncestor,omitempty"` 4206 // Dimensions: If this map is nonempty, then this override applies only to 4207 // specific values for dimensions defined in the limit unit. For example, an 4208 // override on a limit with the unit `1/{project}/{region}` could contain an 4209 // entry with the key `region` and the value `us-east-1`; the override is only 4210 // applied to quota consumed in that region. This map has the following 4211 // restrictions: * Keys that are not defined in the limit's unit are not valid 4212 // keys. Any string appearing in `{brackets}` in the unit (besides `{project}` 4213 // or `{user}`) is a defined key. * `project` is not a valid key; the project 4214 // is already specified in the parent resource name. * `user` is not a valid 4215 // key; the API does not support quota overrides that apply only to a specific 4216 // user. * If `region` appears as a key, its value must be a valid Cloud 4217 // region. * If `zone` appears as a key, its value must be a valid Cloud zone. 4218 // * If any valid key other than `region` or `zone` appears in the map, then 4219 // all valid keys other than `region` or `zone` must also appear in the map. 4220 Dimensions map[string]string `json:"dimensions,omitempty"` 4221 // Metric: The name of the metric to which this override applies. An example 4222 // name would be: `compute.googleapis.com/cpus` 4223 Metric string `json:"metric,omitempty"` 4224 // Name: The resource name of the override. This name is generated by the 4225 // server when the override is created. Example names would be: 4226 // `projects/123/services/compute.googleapis.com/consumerQuotaMetrics/compute.go 4227 // ogleapis.com%2Fcpus/limits/%2Fproject%2Fregion/adminOverrides/4a3f2c1d` 4228 // `projects/123/services/compute.googleapis.com/consumerQuotaMetrics/compute.go 4229 // ogleapis.com%2Fcpus/limits/%2Fproject%2Fregion/consumerOverrides/4a3f2c1d` 4230 // The resource name is intended to be opaque and should not be parsed for its 4231 // component strings, since its representation could change in the future. 4232 Name string `json:"name,omitempty"` 4233 // OverrideValue: The overriding quota limit value. Can be any nonnegative 4234 // integer, or -1 (unlimited quota). 4235 OverrideValue int64 `json:"overrideValue,omitempty,string"` 4236 // Unit: The limit unit of the limit to which this override applies. An example 4237 // unit would be: `1/{project}/{region}` Note that `{project}` and `{region}` 4238 // are not placeholders in this example; the literal characters `{` and `}` 4239 // occur in the string. 4240 Unit string `json:"unit,omitempty"` 4241 // ForceSendFields is a list of field names (e.g. "AdminOverrideAncestor") to 4242 // unconditionally include in API requests. By default, fields with empty or 4243 // default values are omitted from API requests. See 4244 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 4245 // details. 4246 ForceSendFields []string `json:"-"` 4247 // NullFields is a list of field names (e.g. "AdminOverrideAncestor") to 4248 // include in API requests with the JSON null value. By default, fields with 4249 // empty values are omitted from API requests. See 4250 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 4251 NullFields []string `json:"-"` 4252 } 4253 4254 func (s *QuotaOverride) MarshalJSON() ([]byte, error) { 4255 type NoMethod QuotaOverride 4256 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 4257 } 4258 4259 // RemoveEnableRulesMetadata: Metadata for the `RemoveEnableRules` method. 4260 type RemoveEnableRulesMetadata struct { 4261 } 4262 4263 // RemoveEnableRulesResponse: The response message of `RemoveEnableRules` 4264 // method. 4265 type RemoveEnableRulesResponse struct { 4266 // Parent: The parent consumer policy. It can be 4267 // `projects/12345/consumerPolicies/default`, or 4268 // `folders/12345/consumerPolicies/default`, or 4269 // `organizations/12345/consumerPolicies/default`. 4270 Parent string `json:"parent,omitempty"` 4271 // RemovedValues: The values removed from the parent consumer policy. 4272 RemovedValues []string `json:"removedValues,omitempty"` 4273 // ForceSendFields is a list of field names (e.g. "Parent") to unconditionally 4274 // include in API requests. By default, fields with empty or default values are 4275 // omitted from API requests. See 4276 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 4277 // details. 4278 ForceSendFields []string `json:"-"` 4279 // NullFields is a list of field names (e.g. "Parent") to include in API 4280 // requests with the JSON null value. By default, fields with empty values are 4281 // omitted from API requests. See 4282 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 4283 NullFields []string `json:"-"` 4284 } 4285 4286 func (s *RemoveEnableRulesResponse) MarshalJSON() ([]byte, error) { 4287 type NoMethod RemoveEnableRulesResponse 4288 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 4289 } 4290 4291 // RolloutInfo: [Output only] Rollout information of a quota. 4292 type RolloutInfo struct { 4293 // DefaultLimitOngoingRollout: Whether there is an ongoing rollout for the 4294 // default limit or not. 4295 DefaultLimitOngoingRollout bool `json:"defaultLimitOngoingRollout,omitempty"` 4296 // ForceSendFields is a list of field names (e.g. "DefaultLimitOngoingRollout") 4297 // to unconditionally include in API requests. By default, fields with empty or 4298 // default values are omitted from API requests. See 4299 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 4300 // details. 4301 ForceSendFields []string `json:"-"` 4302 // NullFields is a list of field names (e.g. "DefaultLimitOngoingRollout") to 4303 // include in API requests with the JSON null value. By default, fields with 4304 // empty values are omitted from API requests. See 4305 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 4306 NullFields []string `json:"-"` 4307 } 4308 4309 func (s *RolloutInfo) MarshalJSON() ([]byte, error) { 4310 type NoMethod RolloutInfo 4311 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 4312 } 4313 4314 // RubySettings: Settings for Ruby client libraries. 4315 type RubySettings struct { 4316 // Common: Some settings. 4317 Common *CommonLanguageSettings `json:"common,omitempty"` 4318 // ForceSendFields is a list of field names (e.g. "Common") to unconditionally 4319 // include in API requests. By default, fields with empty or default values are 4320 // omitted from API requests. See 4321 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 4322 // details. 4323 ForceSendFields []string `json:"-"` 4324 // NullFields is a list of field names (e.g. "Common") to include in API 4325 // requests with the JSON null value. By default, fields with empty values are 4326 // omitted from API requests. See 4327 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 4328 NullFields []string `json:"-"` 4329 } 4330 4331 func (s *RubySettings) MarshalJSON() ([]byte, error) { 4332 type NoMethod RubySettings 4333 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 4334 } 4335 4336 // Service: A service that is available for use by the consumer. 4337 type Service struct { 4338 // Config: The service configuration of the available service. Some fields may 4339 // be filtered out of the configuration in responses to the `ListServices` 4340 // method. These fields are present only in responses to the `GetService` 4341 // method. 4342 Config *ServiceConfig `json:"config,omitempty"` 4343 // Name: The resource name of the consumer and service. A valid name would be: 4344 // - `projects/123/services/serviceusage.googleapis.com` 4345 Name string `json:"name,omitempty"` 4346 // Parent: The resource name of the consumer. A valid name would be: - 4347 // `projects/123` 4348 Parent string `json:"parent,omitempty"` 4349 // State: Whether or not the service has been enabled for use by the consumer. 4350 // 4351 // Possible values: 4352 // "STATE_UNSPECIFIED" - The default value, which indicates that the enabled 4353 // state of the service is unspecified or not meaningful. Currently, all 4354 // consumers other than projects (such as folders and organizations) are always 4355 // in this state. 4356 // "DISABLED" - The service cannot be used by this consumer. It has either 4357 // been explicitly disabled, or has never been enabled. 4358 // "ENABLED" - The service has been explicitly enabled for use by this 4359 // consumer. 4360 State string `json:"state,omitempty"` 4361 4362 // ServerResponse contains the HTTP response code and headers from the server. 4363 googleapi.ServerResponse `json:"-"` 4364 // ForceSendFields is a list of field names (e.g. "Config") to unconditionally 4365 // include in API requests. By default, fields with empty or default values are 4366 // omitted from API requests. See 4367 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 4368 // details. 4369 ForceSendFields []string `json:"-"` 4370 // NullFields is a list of field names (e.g. "Config") to include in API 4371 // requests with the JSON null value. By default, fields with empty values are 4372 // omitted from API requests. See 4373 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 4374 NullFields []string `json:"-"` 4375 } 4376 4377 func (s *Service) MarshalJSON() ([]byte, error) { 4378 type NoMethod Service 4379 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 4380 } 4381 4382 // ServiceConfig: The configuration of the service. 4383 type ServiceConfig struct { 4384 // Apis: A list of API interfaces exported by this service. Contains only the 4385 // names, versions, and method names of the interfaces. 4386 Apis []*Api `json:"apis,omitempty"` 4387 // Authentication: Auth configuration. Contains only the OAuth rules. 4388 Authentication *Authentication `json:"authentication,omitempty"` 4389 // Documentation: Additional API documentation. Contains only the summary and 4390 // the documentation URL. 4391 Documentation *Documentation `json:"documentation,omitempty"` 4392 // Endpoints: Configuration for network endpoints. Contains only the names and 4393 // aliases of the endpoints. 4394 Endpoints []*Endpoint `json:"endpoints,omitempty"` 4395 // MonitoredResources: Defines the monitored resources used by this service. 4396 // This is required by the Service.monitoring and Service.logging 4397 // configurations. 4398 MonitoredResources []*MonitoredResourceDescriptor `json:"monitoredResources,omitempty"` 4399 // Monitoring: Monitoring configuration. This should not include the 4400 // 'producer_destinations' field. 4401 Monitoring *Monitoring `json:"monitoring,omitempty"` 4402 // Name: The DNS address at which this service is available. An example DNS 4403 // address would be: `calendar.googleapis.com`. 4404 Name string `json:"name,omitempty"` 4405 // Quota: Quota configuration. 4406 Quota *Quota `json:"quota,omitempty"` 4407 // Title: The product title for this service. 4408 Title string `json:"title,omitempty"` 4409 // Usage: Configuration controlling usage of this service. 4410 Usage *Usage `json:"usage,omitempty"` 4411 // ForceSendFields is a list of field names (e.g. "Apis") to unconditionally 4412 // include in API requests. By default, fields with empty or default values are 4413 // omitted from API requests. See 4414 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 4415 // details. 4416 ForceSendFields []string `json:"-"` 4417 // NullFields is a list of field names (e.g. "Apis") to include in API requests 4418 // with the JSON null value. By default, fields with empty values are omitted 4419 // from API requests. See 4420 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 4421 NullFields []string `json:"-"` 4422 } 4423 4424 func (s *ServiceConfig) MarshalJSON() ([]byte, error) { 4425 type NoMethod ServiceConfig 4426 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 4427 } 4428 4429 // ServiceIdentity: Service identity for a service. This is the identity that 4430 // service producer should use to access consumer resources. 4431 type ServiceIdentity struct { 4432 // Email: The email address of the service account that a service producer 4433 // would use to access consumer resources. 4434 Email string `json:"email,omitempty"` 4435 // UniqueId: The unique and stable id of the service account. 4436 // https://cloud.google.com/iam/reference/rest/v1/projects.serviceAccounts#ServiceAccount 4437 UniqueId string `json:"uniqueId,omitempty"` 4438 // ForceSendFields is a list of field names (e.g. "Email") to unconditionally 4439 // include in API requests. By default, fields with empty or default values are 4440 // omitted from API requests. See 4441 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 4442 // details. 4443 ForceSendFields []string `json:"-"` 4444 // NullFields is a list of field names (e.g. "Email") to include in API 4445 // requests with the JSON null value. By default, fields with empty values are 4446 // omitted from API requests. See 4447 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 4448 NullFields []string `json:"-"` 4449 } 4450 4451 func (s *ServiceIdentity) MarshalJSON() ([]byte, error) { 4452 type NoMethod ServiceIdentity 4453 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 4454 } 4455 4456 // SourceContext: `SourceContext` represents information about the source of a 4457 // protobuf element, like the file in which it is defined. 4458 type SourceContext struct { 4459 // FileName: The path-qualified name of the .proto file that contained the 4460 // associated protobuf element. For example: 4461 // "google/protobuf/source_context.proto". 4462 FileName string `json:"fileName,omitempty"` 4463 // ForceSendFields is a list of field names (e.g. "FileName") to 4464 // unconditionally include in API requests. By default, fields with empty or 4465 // default values are omitted from API requests. See 4466 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 4467 // details. 4468 ForceSendFields []string `json:"-"` 4469 // NullFields is a list of field names (e.g. "FileName") to include in API 4470 // requests with the JSON null value. By default, fields with empty values are 4471 // omitted from API requests. See 4472 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 4473 NullFields []string `json:"-"` 4474 } 4475 4476 func (s *SourceContext) MarshalJSON() ([]byte, error) { 4477 type NoMethod SourceContext 4478 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 4479 } 4480 4481 // SourceInfo: Source information used to create a Service Config 4482 type SourceInfo struct { 4483 // SourceFiles: All files used during config generation. 4484 SourceFiles []googleapi.RawMessage `json:"sourceFiles,omitempty"` 4485 // ForceSendFields is a list of field names (e.g. "SourceFiles") to 4486 // unconditionally include in API requests. By default, fields with empty or 4487 // default values are omitted from API requests. See 4488 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 4489 // details. 4490 ForceSendFields []string `json:"-"` 4491 // NullFields is a list of field names (e.g. "SourceFiles") to include in API 4492 // requests with the JSON null value. By default, fields with empty values are 4493 // omitted from API requests. See 4494 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 4495 NullFields []string `json:"-"` 4496 } 4497 4498 func (s *SourceInfo) MarshalJSON() ([]byte, error) { 4499 type NoMethod SourceInfo 4500 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 4501 } 4502 4503 // Status: The `Status` type defines a logical error model that is suitable for 4504 // different programming environments, including REST APIs and RPC APIs. It is 4505 // used by gRPC (https://github.com/grpc). Each `Status` message contains three 4506 // pieces of data: error code, error message, and error details. You can find 4507 // out more about this error model and how to work with it in the API Design 4508 // Guide (https://cloud.google.com/apis/design/errors). 4509 type Status struct { 4510 // Code: The status code, which should be an enum value of google.rpc.Code. 4511 Code int64 `json:"code,omitempty"` 4512 // Details: A list of messages that carry the error details. There is a common 4513 // set of message types for APIs to use. 4514 Details []googleapi.RawMessage `json:"details,omitempty"` 4515 // Message: A developer-facing error message, which should be in English. Any 4516 // user-facing error message should be localized and sent in the 4517 // google.rpc.Status.details field, or localized by the client. 4518 Message string `json:"message,omitempty"` 4519 // ForceSendFields is a list of field names (e.g. "Code") to unconditionally 4520 // include in API requests. By default, fields with empty or default values are 4521 // omitted from API requests. See 4522 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 4523 // details. 4524 ForceSendFields []string `json:"-"` 4525 // NullFields is a list of field names (e.g. "Code") to include in API requests 4526 // with the JSON null value. By default, fields with empty values are omitted 4527 // from API requests. See 4528 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 4529 NullFields []string `json:"-"` 4530 } 4531 4532 func (s *Status) MarshalJSON() ([]byte, error) { 4533 type NoMethod Status 4534 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 4535 } 4536 4537 // SystemParameter: Define a parameter's name and location. The parameter may 4538 // be passed as either an HTTP header or a URL query parameter, and if both are 4539 // passed the behavior is implementation-dependent. 4540 type SystemParameter struct { 4541 // HttpHeader: Define the HTTP header name to use for the parameter. It is case 4542 // insensitive. 4543 HttpHeader string `json:"httpHeader,omitempty"` 4544 // Name: Define the name of the parameter, such as "api_key" . It is case 4545 // sensitive. 4546 Name string `json:"name,omitempty"` 4547 // UrlQueryParameter: Define the URL query parameter name to use for the 4548 // parameter. It is case sensitive. 4549 UrlQueryParameter string `json:"urlQueryParameter,omitempty"` 4550 // ForceSendFields is a list of field names (e.g. "HttpHeader") to 4551 // unconditionally include in API requests. By default, fields with empty or 4552 // default values are omitted from API requests. See 4553 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 4554 // details. 4555 ForceSendFields []string `json:"-"` 4556 // NullFields is a list of field names (e.g. "HttpHeader") to include in API 4557 // requests with the JSON null value. By default, fields with empty values are 4558 // omitted from API requests. See 4559 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 4560 NullFields []string `json:"-"` 4561 } 4562 4563 func (s *SystemParameter) MarshalJSON() ([]byte, error) { 4564 type NoMethod SystemParameter 4565 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 4566 } 4567 4568 // SystemParameterRule: Define a system parameter rule mapping system parameter 4569 // definitions to methods. 4570 type SystemParameterRule struct { 4571 // Parameters: Define parameters. Multiple names may be defined for a 4572 // parameter. For a given method call, only one of them should be used. If 4573 // multiple names are used the behavior is implementation-dependent. If none of 4574 // the specified names are present the behavior is parameter-dependent. 4575 Parameters []*SystemParameter `json:"parameters,omitempty"` 4576 // Selector: Selects the methods to which this rule applies. Use '*' to 4577 // indicate all methods in all APIs. Refer to selector for syntax details. 4578 Selector string `json:"selector,omitempty"` 4579 // ForceSendFields is a list of field names (e.g. "Parameters") to 4580 // unconditionally include in API requests. By default, fields with empty or 4581 // default values are omitted from API requests. See 4582 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 4583 // details. 4584 ForceSendFields []string `json:"-"` 4585 // NullFields is a list of field names (e.g. "Parameters") to include in API 4586 // requests with the JSON null value. By default, fields with empty values are 4587 // omitted from API requests. See 4588 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 4589 NullFields []string `json:"-"` 4590 } 4591 4592 func (s *SystemParameterRule) MarshalJSON() ([]byte, error) { 4593 type NoMethod SystemParameterRule 4594 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 4595 } 4596 4597 // SystemParameters: ### System parameter configuration A system parameter is a 4598 // special kind of parameter defined by the API system, not by an individual 4599 // API. It is typically mapped to an HTTP header and/or a URL query parameter. 4600 // This configuration specifies which methods change the names of the system 4601 // parameters. 4602 type SystemParameters struct { 4603 // Rules: Define system parameters. The parameters defined here will override 4604 // the default parameters implemented by the system. If this field is missing 4605 // from the service config, default system parameters will be used. Default 4606 // system parameters and names is implementation-dependent. Example: define api 4607 // key for all methods system_parameters rules: - selector: "*" parameters: - 4608 // name: api_key url_query_parameter: api_key Example: define 2 api key names 4609 // for a specific method. system_parameters rules: - selector: "/ListShelves" 4610 // parameters: - name: api_key http_header: Api-Key1 - name: api_key 4611 // http_header: Api-Key2 **NOTE:** All service configuration rules follow "last 4612 // one wins" order. 4613 Rules []*SystemParameterRule `json:"rules,omitempty"` 4614 // ForceSendFields is a list of field names (e.g. "Rules") to unconditionally 4615 // include in API requests. By default, fields with empty or default values are 4616 // omitted from API requests. See 4617 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 4618 // details. 4619 ForceSendFields []string `json:"-"` 4620 // NullFields is a list of field names (e.g. "Rules") to include in API 4621 // requests with the JSON null value. By default, fields with empty values are 4622 // omitted from API requests. See 4623 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 4624 NullFields []string `json:"-"` 4625 } 4626 4627 func (s *SystemParameters) MarshalJSON() ([]byte, error) { 4628 type NoMethod SystemParameters 4629 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 4630 } 4631 4632 // Type: A protocol buffer message type. 4633 type Type struct { 4634 // Edition: The source edition string, only valid when syntax is 4635 // SYNTAX_EDITIONS. 4636 Edition string `json:"edition,omitempty"` 4637 // Fields: The list of fields. 4638 Fields []*Field `json:"fields,omitempty"` 4639 // Name: The fully qualified message name. 4640 Name string `json:"name,omitempty"` 4641 // Oneofs: The list of types appearing in `oneof` definitions in this type. 4642 Oneofs []string `json:"oneofs,omitempty"` 4643 // Options: The protocol buffer options. 4644 Options []*Option `json:"options,omitempty"` 4645 // SourceContext: The source context. 4646 SourceContext *SourceContext `json:"sourceContext,omitempty"` 4647 // Syntax: The source syntax. 4648 // 4649 // Possible values: 4650 // "SYNTAX_PROTO2" - Syntax `proto2`. 4651 // "SYNTAX_PROTO3" - Syntax `proto3`. 4652 // "SYNTAX_EDITIONS" - Syntax `editions`. 4653 Syntax string `json:"syntax,omitempty"` 4654 // ForceSendFields is a list of field names (e.g. "Edition") to unconditionally 4655 // include in API requests. By default, fields with empty or default values are 4656 // omitted from API requests. See 4657 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 4658 // details. 4659 ForceSendFields []string `json:"-"` 4660 // NullFields is a list of field names (e.g. "Edition") to include in API 4661 // requests with the JSON null value. By default, fields with empty values are 4662 // omitted from API requests. See 4663 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 4664 NullFields []string `json:"-"` 4665 } 4666 4667 func (s *Type) MarshalJSON() ([]byte, error) { 4668 type NoMethod Type 4669 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 4670 } 4671 4672 // UpdateAdminQuotaPolicyMetadata: Metadata message that provides information 4673 // such as progress, partial failures, and similar information on each 4674 // GetOperation call of LRO returned by UpdateAdminQuotaPolicy. 4675 type UpdateAdminQuotaPolicyMetadata struct { 4676 } 4677 4678 // UpdateConsumerPolicyMetadata: Metadata for the `UpdateConsumerPolicy` 4679 // method. 4680 type UpdateConsumerPolicyMetadata struct { 4681 } 4682 4683 // Usage: Configuration controlling usage of a service. 4684 type Usage struct { 4685 // ProducerNotificationChannel: The full resource name of a channel used for 4686 // sending notifications to the service producer. Google Service Management 4687 // currently only supports Google Cloud Pub/Sub 4688 // (https://cloud.google.com/pubsub) as a notification channel. To use Google 4689 // Cloud Pub/Sub as the channel, this must be the name of a Cloud Pub/Sub topic 4690 // that uses the Cloud Pub/Sub topic name format documented in 4691 // https://cloud.google.com/pubsub/docs/overview. 4692 ProducerNotificationChannel string `json:"producerNotificationChannel,omitempty"` 4693 // Requirements: Requirements that must be satisfied before a consumer project 4694 // can use the service. Each requirement is of the form /; for example 4695 // 'serviceusage.googleapis.com/billing-enabled'. For Google APIs, a Terms of 4696 // Service requirement must be included here. Google Cloud APIs must include 4697 // "serviceusage.googleapis.com/tos/cloud". Other Google APIs should include 4698 // "serviceusage.googleapis.com/tos/universal". Additional ToS can be included 4699 // based on the business needs. 4700 Requirements []string `json:"requirements,omitempty"` 4701 // Rules: A list of usage rules that apply to individual API methods. **NOTE:** 4702 // All service configuration rules follow "last one wins" order. 4703 Rules []*UsageRule `json:"rules,omitempty"` 4704 // ForceSendFields is a list of field names (e.g. 4705 // "ProducerNotificationChannel") to unconditionally include in API requests. 4706 // By default, fields with empty or default values are omitted from API 4707 // requests. See https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields 4708 // for more details. 4709 ForceSendFields []string `json:"-"` 4710 // NullFields is a list of field names (e.g. "ProducerNotificationChannel") to 4711 // include in API requests with the JSON null value. By default, fields with 4712 // empty values are omitted from API requests. See 4713 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 4714 NullFields []string `json:"-"` 4715 } 4716 4717 func (s *Usage) MarshalJSON() ([]byte, error) { 4718 type NoMethod Usage 4719 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 4720 } 4721 4722 // UsageRule: Usage configuration rules for the service. NOTE: Under 4723 // development. Use this rule to configure unregistered calls for the service. 4724 // Unregistered calls are calls that do not contain consumer project identity. 4725 // (Example: calls that do not contain an API key). By default, API methods do 4726 // not allow unregistered calls, and each method call must be identified by a 4727 // consumer project identity. Use this rule to allow/disallow unregistered 4728 // calls. Example of an API that wants to allow unregistered calls for entire 4729 // service. usage: rules: - selector: "*" allow_unregistered_calls: true 4730 // Example of a method that wants to allow unregistered calls. usage: rules: - 4731 // selector: "google.example.library.v1.LibraryService.CreateBook" 4732 // allow_unregistered_calls: true 4733 type UsageRule struct { 4734 // AllowUnregisteredCalls: If true, the selected method allows unregistered 4735 // calls, e.g. calls that don't identify any user or application. 4736 AllowUnregisteredCalls bool `json:"allowUnregisteredCalls,omitempty"` 4737 // Selector: Selects the methods to which this rule applies. Use '*' to 4738 // indicate all methods in all APIs. Refer to selector for syntax details. 4739 Selector string `json:"selector,omitempty"` 4740 // SkipServiceControl: If true, the selected method should skip service control 4741 // and the control plane features, such as quota and billing, will not be 4742 // available. This flag is used by Google Cloud Endpoints to bypass checks for 4743 // internal methods, such as service health check methods. 4744 SkipServiceControl bool `json:"skipServiceControl,omitempty"` 4745 // ForceSendFields is a list of field names (e.g. "AllowUnregisteredCalls") to 4746 // unconditionally include in API requests. By default, fields with empty or 4747 // default values are omitted from API requests. See 4748 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 4749 // details. 4750 ForceSendFields []string `json:"-"` 4751 // NullFields is a list of field names (e.g. "AllowUnregisteredCalls") to 4752 // include in API requests with the JSON null value. By default, fields with 4753 // empty values are omitted from API requests. See 4754 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 4755 NullFields []string `json:"-"` 4756 } 4757 4758 func (s *UsageRule) MarshalJSON() ([]byte, error) { 4759 type NoMethod UsageRule 4760 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 4761 } 4762 4763 type OperationsGetCall struct { 4764 s *APIService 4765 name string 4766 urlParams_ gensupport.URLParams 4767 ifNoneMatch_ string 4768 ctx_ context.Context 4769 header_ http.Header 4770 } 4771 4772 // Get: Gets the latest state of a long-running operation. Clients can use this 4773 // method to poll the operation result at intervals as recommended by the API 4774 // service. 4775 // 4776 // - name: The name of the operation resource. 4777 func (r *OperationsService) Get(name string) *OperationsGetCall { 4778 c := &OperationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 4779 c.name = name 4780 return c 4781 } 4782 4783 // Fields allows partial responses to be retrieved. See 4784 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 4785 // details. 4786 func (c *OperationsGetCall) Fields(s ...googleapi.Field) *OperationsGetCall { 4787 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 4788 return c 4789 } 4790 4791 // IfNoneMatch sets an optional parameter which makes the operation fail if the 4792 // object's ETag matches the given value. This is useful for getting updates 4793 // only after the object has changed since the last request. 4794 func (c *OperationsGetCall) IfNoneMatch(entityTag string) *OperationsGetCall { 4795 c.ifNoneMatch_ = entityTag 4796 return c 4797 } 4798 4799 // Context sets the context to be used in this call's Do method. 4800 func (c *OperationsGetCall) Context(ctx context.Context) *OperationsGetCall { 4801 c.ctx_ = ctx 4802 return c 4803 } 4804 4805 // Header returns a http.Header that can be modified by the caller to add 4806 // headers to the request. 4807 func (c *OperationsGetCall) Header() http.Header { 4808 if c.header_ == nil { 4809 c.header_ = make(http.Header) 4810 } 4811 return c.header_ 4812 } 4813 4814 func (c *OperationsGetCall) doRequest(alt string) (*http.Response, error) { 4815 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) 4816 if c.ifNoneMatch_ != "" { 4817 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 4818 } 4819 var body io.Reader = nil 4820 c.urlParams_.Set("alt", alt) 4821 c.urlParams_.Set("prettyPrint", "false") 4822 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") 4823 urls += "?" + c.urlParams_.Encode() 4824 req, err := http.NewRequest("GET", urls, body) 4825 if err != nil { 4826 return nil, err 4827 } 4828 req.Header = reqHeaders 4829 googleapi.Expand(req.URL, map[string]string{ 4830 "name": c.name, 4831 }) 4832 return gensupport.SendRequest(c.ctx_, c.s.client, req) 4833 } 4834 4835 // Do executes the "serviceusage.operations.get" call. 4836 // Any non-2xx status code is an error. Response headers are in either 4837 // *Operation.ServerResponse.Header or (if a response was returned at all) in 4838 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 4839 // whether the returned error was because http.StatusNotModified was returned. 4840 func (c *OperationsGetCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 4841 gensupport.SetOptions(c.urlParams_, opts...) 4842 res, err := c.doRequest("json") 4843 if res != nil && res.StatusCode == http.StatusNotModified { 4844 if res.Body != nil { 4845 res.Body.Close() 4846 } 4847 return nil, gensupport.WrapError(&googleapi.Error{ 4848 Code: res.StatusCode, 4849 Header: res.Header, 4850 }) 4851 } 4852 if err != nil { 4853 return nil, err 4854 } 4855 defer googleapi.CloseBody(res) 4856 if err := googleapi.CheckResponse(res); err != nil { 4857 return nil, gensupport.WrapError(err) 4858 } 4859 ret := &Operation{ 4860 ServerResponse: googleapi.ServerResponse{ 4861 Header: res.Header, 4862 HTTPStatusCode: res.StatusCode, 4863 }, 4864 } 4865 target := &ret 4866 if err := gensupport.DecodeResponse(target, res); err != nil { 4867 return nil, err 4868 } 4869 return ret, nil 4870 } 4871 4872 type OperationsListCall struct { 4873 s *APIService 4874 urlParams_ gensupport.URLParams 4875 ifNoneMatch_ string 4876 ctx_ context.Context 4877 header_ http.Header 4878 } 4879 4880 // List: Lists operations that match the specified filter in the request. If 4881 // the server doesn't support this method, it returns `UNIMPLEMENTED`. 4882 func (r *OperationsService) List() *OperationsListCall { 4883 c := &OperationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 4884 return c 4885 } 4886 4887 // Filter sets the optional parameter "filter": The standard list filter. 4888 func (c *OperationsListCall) Filter(filter string) *OperationsListCall { 4889 c.urlParams_.Set("filter", filter) 4890 return c 4891 } 4892 4893 // Name sets the optional parameter "name": The name of the operation's parent 4894 // resource. 4895 func (c *OperationsListCall) Name(name string) *OperationsListCall { 4896 c.urlParams_.Set("name", name) 4897 return c 4898 } 4899 4900 // PageSize sets the optional parameter "pageSize": The standard list page 4901 // size. 4902 func (c *OperationsListCall) PageSize(pageSize int64) *OperationsListCall { 4903 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) 4904 return c 4905 } 4906 4907 // PageToken sets the optional parameter "pageToken": The standard list page 4908 // token. 4909 func (c *OperationsListCall) PageToken(pageToken string) *OperationsListCall { 4910 c.urlParams_.Set("pageToken", pageToken) 4911 return c 4912 } 4913 4914 // Fields allows partial responses to be retrieved. See 4915 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 4916 // details. 4917 func (c *OperationsListCall) Fields(s ...googleapi.Field) *OperationsListCall { 4918 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 4919 return c 4920 } 4921 4922 // IfNoneMatch sets an optional parameter which makes the operation fail if the 4923 // object's ETag matches the given value. This is useful for getting updates 4924 // only after the object has changed since the last request. 4925 func (c *OperationsListCall) IfNoneMatch(entityTag string) *OperationsListCall { 4926 c.ifNoneMatch_ = entityTag 4927 return c 4928 } 4929 4930 // Context sets the context to be used in this call's Do method. 4931 func (c *OperationsListCall) Context(ctx context.Context) *OperationsListCall { 4932 c.ctx_ = ctx 4933 return c 4934 } 4935 4936 // Header returns a http.Header that can be modified by the caller to add 4937 // headers to the request. 4938 func (c *OperationsListCall) Header() http.Header { 4939 if c.header_ == nil { 4940 c.header_ = make(http.Header) 4941 } 4942 return c.header_ 4943 } 4944 4945 func (c *OperationsListCall) doRequest(alt string) (*http.Response, error) { 4946 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) 4947 if c.ifNoneMatch_ != "" { 4948 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 4949 } 4950 var body io.Reader = nil 4951 c.urlParams_.Set("alt", alt) 4952 c.urlParams_.Set("prettyPrint", "false") 4953 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/operations") 4954 urls += "?" + c.urlParams_.Encode() 4955 req, err := http.NewRequest("GET", urls, body) 4956 if err != nil { 4957 return nil, err 4958 } 4959 req.Header = reqHeaders 4960 return gensupport.SendRequest(c.ctx_, c.s.client, req) 4961 } 4962 4963 // Do executes the "serviceusage.operations.list" call. 4964 // Any non-2xx status code is an error. Response headers are in either 4965 // *ListOperationsResponse.ServerResponse.Header or (if a response was returned 4966 // at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 4967 // check whether the returned error was because http.StatusNotModified was 4968 // returned. 4969 func (c *OperationsListCall) Do(opts ...googleapi.CallOption) (*ListOperationsResponse, error) { 4970 gensupport.SetOptions(c.urlParams_, opts...) 4971 res, err := c.doRequest("json") 4972 if res != nil && res.StatusCode == http.StatusNotModified { 4973 if res.Body != nil { 4974 res.Body.Close() 4975 } 4976 return nil, gensupport.WrapError(&googleapi.Error{ 4977 Code: res.StatusCode, 4978 Header: res.Header, 4979 }) 4980 } 4981 if err != nil { 4982 return nil, err 4983 } 4984 defer googleapi.CloseBody(res) 4985 if err := googleapi.CheckResponse(res); err != nil { 4986 return nil, gensupport.WrapError(err) 4987 } 4988 ret := &ListOperationsResponse{ 4989 ServerResponse: googleapi.ServerResponse{ 4990 Header: res.Header, 4991 HTTPStatusCode: res.StatusCode, 4992 }, 4993 } 4994 target := &ret 4995 if err := gensupport.DecodeResponse(target, res); err != nil { 4996 return nil, err 4997 } 4998 return ret, nil 4999 } 5000 5001 // Pages invokes f for each page of results. 5002 // A non-nil error returned from f will halt the iteration. 5003 // The provided context supersedes any context provided to the Context method. 5004 func (c *OperationsListCall) Pages(ctx context.Context, f func(*ListOperationsResponse) error) error { 5005 c.ctx_ = ctx 5006 defer c.PageToken(c.urlParams_.Get("pageToken")) 5007 for { 5008 x, err := c.Do() 5009 if err != nil { 5010 return err 5011 } 5012 if err := f(x); err != nil { 5013 return err 5014 } 5015 if x.NextPageToken == "" { 5016 return nil 5017 } 5018 c.PageToken(x.NextPageToken) 5019 } 5020 } 5021 5022 type ServicesBatchEnableCall struct { 5023 s *APIService 5024 parent string 5025 batchenableservicesrequest *BatchEnableServicesRequest 5026 urlParams_ gensupport.URLParams 5027 ctx_ context.Context 5028 header_ http.Header 5029 } 5030 5031 // BatchEnable: Enables multiple services on a project. The operation is 5032 // atomic: if enabling any service fails, then the entire batch fails, and no 5033 // state changes occur. Operation response type: `google.protobuf.Empty` 5034 // 5035 // - parent: Parent to enable services on. An example name would be: 5036 // `projects/123` where `123` is the project number (not project ID). The 5037 // `BatchEnableServices` method currently only supports projects. 5038 func (r *ServicesService) BatchEnable(parent string, batchenableservicesrequest *BatchEnableServicesRequest) *ServicesBatchEnableCall { 5039 c := &ServicesBatchEnableCall{s: r.s, urlParams_: make(gensupport.URLParams)} 5040 c.parent = parent 5041 c.batchenableservicesrequest = batchenableservicesrequest 5042 return c 5043 } 5044 5045 // Fields allows partial responses to be retrieved. See 5046 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 5047 // details. 5048 func (c *ServicesBatchEnableCall) Fields(s ...googleapi.Field) *ServicesBatchEnableCall { 5049 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 5050 return c 5051 } 5052 5053 // Context sets the context to be used in this call's Do method. 5054 func (c *ServicesBatchEnableCall) Context(ctx context.Context) *ServicesBatchEnableCall { 5055 c.ctx_ = ctx 5056 return c 5057 } 5058 5059 // Header returns a http.Header that can be modified by the caller to add 5060 // headers to the request. 5061 func (c *ServicesBatchEnableCall) Header() http.Header { 5062 if c.header_ == nil { 5063 c.header_ = make(http.Header) 5064 } 5065 return c.header_ 5066 } 5067 5068 func (c *ServicesBatchEnableCall) doRequest(alt string) (*http.Response, error) { 5069 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) 5070 var body io.Reader = nil 5071 body, err := googleapi.WithoutDataWrapper.JSONReader(c.batchenableservicesrequest) 5072 if err != nil { 5073 return nil, err 5074 } 5075 c.urlParams_.Set("alt", alt) 5076 c.urlParams_.Set("prettyPrint", "false") 5077 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/services:batchEnable") 5078 urls += "?" + c.urlParams_.Encode() 5079 req, err := http.NewRequest("POST", urls, body) 5080 if err != nil { 5081 return nil, err 5082 } 5083 req.Header = reqHeaders 5084 googleapi.Expand(req.URL, map[string]string{ 5085 "parent": c.parent, 5086 }) 5087 return gensupport.SendRequest(c.ctx_, c.s.client, req) 5088 } 5089 5090 // Do executes the "serviceusage.services.batchEnable" call. 5091 // Any non-2xx status code is an error. Response headers are in either 5092 // *Operation.ServerResponse.Header or (if a response was returned at all) in 5093 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 5094 // whether the returned error was because http.StatusNotModified was returned. 5095 func (c *ServicesBatchEnableCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 5096 gensupport.SetOptions(c.urlParams_, opts...) 5097 res, err := c.doRequest("json") 5098 if res != nil && res.StatusCode == http.StatusNotModified { 5099 if res.Body != nil { 5100 res.Body.Close() 5101 } 5102 return nil, gensupport.WrapError(&googleapi.Error{ 5103 Code: res.StatusCode, 5104 Header: res.Header, 5105 }) 5106 } 5107 if err != nil { 5108 return nil, err 5109 } 5110 defer googleapi.CloseBody(res) 5111 if err := googleapi.CheckResponse(res); err != nil { 5112 return nil, gensupport.WrapError(err) 5113 } 5114 ret := &Operation{ 5115 ServerResponse: googleapi.ServerResponse{ 5116 Header: res.Header, 5117 HTTPStatusCode: res.StatusCode, 5118 }, 5119 } 5120 target := &ret 5121 if err := gensupport.DecodeResponse(target, res); err != nil { 5122 return nil, err 5123 } 5124 return ret, nil 5125 } 5126 5127 type ServicesDisableCall struct { 5128 s *APIService 5129 name string 5130 disableservicerequest *DisableServiceRequest 5131 urlParams_ gensupport.URLParams 5132 ctx_ context.Context 5133 header_ http.Header 5134 } 5135 5136 // Disable: Disables a service so that it can no longer be used with a project. 5137 // This prevents unintended usage that may cause unexpected billing charges or 5138 // security leaks. It is not valid to call the disable method on a service that 5139 // is not currently enabled. Callers will receive a `FAILED_PRECONDITION` 5140 // status if the target service is not currently enabled. Operation response 5141 // type: `google.protobuf.Empty` 5142 // 5143 // - name: Name of the consumer and service to disable the service on. The 5144 // enable and disable methods currently only support projects. An example 5145 // name would be: `projects/123/services/serviceusage.googleapis.com` where 5146 // `123` is the project number (not project ID). 5147 func (r *ServicesService) Disable(name string, disableservicerequest *DisableServiceRequest) *ServicesDisableCall { 5148 c := &ServicesDisableCall{s: r.s, urlParams_: make(gensupport.URLParams)} 5149 c.name = name 5150 c.disableservicerequest = disableservicerequest 5151 return c 5152 } 5153 5154 // Fields allows partial responses to be retrieved. See 5155 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 5156 // details. 5157 func (c *ServicesDisableCall) Fields(s ...googleapi.Field) *ServicesDisableCall { 5158 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 5159 return c 5160 } 5161 5162 // Context sets the context to be used in this call's Do method. 5163 func (c *ServicesDisableCall) Context(ctx context.Context) *ServicesDisableCall { 5164 c.ctx_ = ctx 5165 return c 5166 } 5167 5168 // Header returns a http.Header that can be modified by the caller to add 5169 // headers to the request. 5170 func (c *ServicesDisableCall) Header() http.Header { 5171 if c.header_ == nil { 5172 c.header_ = make(http.Header) 5173 } 5174 return c.header_ 5175 } 5176 5177 func (c *ServicesDisableCall) doRequest(alt string) (*http.Response, error) { 5178 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) 5179 var body io.Reader = nil 5180 body, err := googleapi.WithoutDataWrapper.JSONReader(c.disableservicerequest) 5181 if err != nil { 5182 return nil, err 5183 } 5184 c.urlParams_.Set("alt", alt) 5185 c.urlParams_.Set("prettyPrint", "false") 5186 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}:disable") 5187 urls += "?" + c.urlParams_.Encode() 5188 req, err := http.NewRequest("POST", urls, body) 5189 if err != nil { 5190 return nil, err 5191 } 5192 req.Header = reqHeaders 5193 googleapi.Expand(req.URL, map[string]string{ 5194 "name": c.name, 5195 }) 5196 return gensupport.SendRequest(c.ctx_, c.s.client, req) 5197 } 5198 5199 // Do executes the "serviceusage.services.disable" call. 5200 // Any non-2xx status code is an error. Response headers are in either 5201 // *Operation.ServerResponse.Header or (if a response was returned at all) in 5202 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 5203 // whether the returned error was because http.StatusNotModified was returned. 5204 func (c *ServicesDisableCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 5205 gensupport.SetOptions(c.urlParams_, opts...) 5206 res, err := c.doRequest("json") 5207 if res != nil && res.StatusCode == http.StatusNotModified { 5208 if res.Body != nil { 5209 res.Body.Close() 5210 } 5211 return nil, gensupport.WrapError(&googleapi.Error{ 5212 Code: res.StatusCode, 5213 Header: res.Header, 5214 }) 5215 } 5216 if err != nil { 5217 return nil, err 5218 } 5219 defer googleapi.CloseBody(res) 5220 if err := googleapi.CheckResponse(res); err != nil { 5221 return nil, gensupport.WrapError(err) 5222 } 5223 ret := &Operation{ 5224 ServerResponse: googleapi.ServerResponse{ 5225 Header: res.Header, 5226 HTTPStatusCode: res.StatusCode, 5227 }, 5228 } 5229 target := &ret 5230 if err := gensupport.DecodeResponse(target, res); err != nil { 5231 return nil, err 5232 } 5233 return ret, nil 5234 } 5235 5236 type ServicesEnableCall struct { 5237 s *APIService 5238 name string 5239 enableservicerequest *EnableServiceRequest 5240 urlParams_ gensupport.URLParams 5241 ctx_ context.Context 5242 header_ http.Header 5243 } 5244 5245 // Enable: Enables a service so that it can be used with a project. Operation 5246 // response type: `google.protobuf.Empty` 5247 // 5248 // - name: Name of the consumer and service to enable the service on. The 5249 // `EnableService` and `DisableService` methods currently only support 5250 // projects. Enabling a service requires that the service is public or is 5251 // shared with the user enabling the service. An example name would be: 5252 // `projects/123/services/serviceusage.googleapis.com` where `123` is the 5253 // project number (not project ID). 5254 func (r *ServicesService) Enable(name string, enableservicerequest *EnableServiceRequest) *ServicesEnableCall { 5255 c := &ServicesEnableCall{s: r.s, urlParams_: make(gensupport.URLParams)} 5256 c.name = name 5257 c.enableservicerequest = enableservicerequest 5258 return c 5259 } 5260 5261 // Fields allows partial responses to be retrieved. See 5262 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 5263 // details. 5264 func (c *ServicesEnableCall) Fields(s ...googleapi.Field) *ServicesEnableCall { 5265 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 5266 return c 5267 } 5268 5269 // Context sets the context to be used in this call's Do method. 5270 func (c *ServicesEnableCall) Context(ctx context.Context) *ServicesEnableCall { 5271 c.ctx_ = ctx 5272 return c 5273 } 5274 5275 // Header returns a http.Header that can be modified by the caller to add 5276 // headers to the request. 5277 func (c *ServicesEnableCall) Header() http.Header { 5278 if c.header_ == nil { 5279 c.header_ = make(http.Header) 5280 } 5281 return c.header_ 5282 } 5283 5284 func (c *ServicesEnableCall) doRequest(alt string) (*http.Response, error) { 5285 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) 5286 var body io.Reader = nil 5287 body, err := googleapi.WithoutDataWrapper.JSONReader(c.enableservicerequest) 5288 if err != nil { 5289 return nil, err 5290 } 5291 c.urlParams_.Set("alt", alt) 5292 c.urlParams_.Set("prettyPrint", "false") 5293 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}:enable") 5294 urls += "?" + c.urlParams_.Encode() 5295 req, err := http.NewRequest("POST", urls, body) 5296 if err != nil { 5297 return nil, err 5298 } 5299 req.Header = reqHeaders 5300 googleapi.Expand(req.URL, map[string]string{ 5301 "name": c.name, 5302 }) 5303 return gensupport.SendRequest(c.ctx_, c.s.client, req) 5304 } 5305 5306 // Do executes the "serviceusage.services.enable" call. 5307 // Any non-2xx status code is an error. Response headers are in either 5308 // *Operation.ServerResponse.Header or (if a response was returned at all) in 5309 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 5310 // whether the returned error was because http.StatusNotModified was returned. 5311 func (c *ServicesEnableCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 5312 gensupport.SetOptions(c.urlParams_, opts...) 5313 res, err := c.doRequest("json") 5314 if res != nil && res.StatusCode == http.StatusNotModified { 5315 if res.Body != nil { 5316 res.Body.Close() 5317 } 5318 return nil, gensupport.WrapError(&googleapi.Error{ 5319 Code: res.StatusCode, 5320 Header: res.Header, 5321 }) 5322 } 5323 if err != nil { 5324 return nil, err 5325 } 5326 defer googleapi.CloseBody(res) 5327 if err := googleapi.CheckResponse(res); err != nil { 5328 return nil, gensupport.WrapError(err) 5329 } 5330 ret := &Operation{ 5331 ServerResponse: googleapi.ServerResponse{ 5332 Header: res.Header, 5333 HTTPStatusCode: res.StatusCode, 5334 }, 5335 } 5336 target := &ret 5337 if err := gensupport.DecodeResponse(target, res); err != nil { 5338 return nil, err 5339 } 5340 return ret, nil 5341 } 5342 5343 type ServicesGenerateServiceIdentityCall struct { 5344 s *APIService 5345 parent string 5346 urlParams_ gensupport.URLParams 5347 ctx_ context.Context 5348 header_ http.Header 5349 } 5350 5351 // GenerateServiceIdentity: Generates service identity for service. 5352 // 5353 // - parent: Name of the consumer and service to generate an identity for. The 5354 // `GenerateServiceIdentity` methods currently support projects, folders, 5355 // organizations. Example parents would be: 5356 // `projects/123/services/example.googleapis.com` 5357 // `folders/123/services/example.googleapis.com` 5358 // `organizations/123/services/example.googleapis.com`. 5359 func (r *ServicesService) GenerateServiceIdentity(parent string) *ServicesGenerateServiceIdentityCall { 5360 c := &ServicesGenerateServiceIdentityCall{s: r.s, urlParams_: make(gensupport.URLParams)} 5361 c.parent = parent 5362 return c 5363 } 5364 5365 // Fields allows partial responses to be retrieved. See 5366 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 5367 // details. 5368 func (c *ServicesGenerateServiceIdentityCall) Fields(s ...googleapi.Field) *ServicesGenerateServiceIdentityCall { 5369 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 5370 return c 5371 } 5372 5373 // Context sets the context to be used in this call's Do method. 5374 func (c *ServicesGenerateServiceIdentityCall) Context(ctx context.Context) *ServicesGenerateServiceIdentityCall { 5375 c.ctx_ = ctx 5376 return c 5377 } 5378 5379 // Header returns a http.Header that can be modified by the caller to add 5380 // headers to the request. 5381 func (c *ServicesGenerateServiceIdentityCall) Header() http.Header { 5382 if c.header_ == nil { 5383 c.header_ = make(http.Header) 5384 } 5385 return c.header_ 5386 } 5387 5388 func (c *ServicesGenerateServiceIdentityCall) doRequest(alt string) (*http.Response, error) { 5389 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) 5390 var body io.Reader = nil 5391 c.urlParams_.Set("alt", alt) 5392 c.urlParams_.Set("prettyPrint", "false") 5393 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}:generateServiceIdentity") 5394 urls += "?" + c.urlParams_.Encode() 5395 req, err := http.NewRequest("POST", urls, body) 5396 if err != nil { 5397 return nil, err 5398 } 5399 req.Header = reqHeaders 5400 googleapi.Expand(req.URL, map[string]string{ 5401 "parent": c.parent, 5402 }) 5403 return gensupport.SendRequest(c.ctx_, c.s.client, req) 5404 } 5405 5406 // Do executes the "serviceusage.services.generateServiceIdentity" call. 5407 // Any non-2xx status code is an error. Response headers are in either 5408 // *Operation.ServerResponse.Header or (if a response was returned at all) in 5409 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 5410 // whether the returned error was because http.StatusNotModified was returned. 5411 func (c *ServicesGenerateServiceIdentityCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 5412 gensupport.SetOptions(c.urlParams_, opts...) 5413 res, err := c.doRequest("json") 5414 if res != nil && res.StatusCode == http.StatusNotModified { 5415 if res.Body != nil { 5416 res.Body.Close() 5417 } 5418 return nil, gensupport.WrapError(&googleapi.Error{ 5419 Code: res.StatusCode, 5420 Header: res.Header, 5421 }) 5422 } 5423 if err != nil { 5424 return nil, err 5425 } 5426 defer googleapi.CloseBody(res) 5427 if err := googleapi.CheckResponse(res); err != nil { 5428 return nil, gensupport.WrapError(err) 5429 } 5430 ret := &Operation{ 5431 ServerResponse: googleapi.ServerResponse{ 5432 Header: res.Header, 5433 HTTPStatusCode: res.StatusCode, 5434 }, 5435 } 5436 target := &ret 5437 if err := gensupport.DecodeResponse(target, res); err != nil { 5438 return nil, err 5439 } 5440 return ret, nil 5441 } 5442 5443 type ServicesGetCall struct { 5444 s *APIService 5445 name string 5446 urlParams_ gensupport.URLParams 5447 ifNoneMatch_ string 5448 ctx_ context.Context 5449 header_ http.Header 5450 } 5451 5452 // Get: Returns the service configuration and enabled state for a given 5453 // service. 5454 // 5455 // - name: Name of the consumer and service to get the `ConsumerState` for. An 5456 // example name would be: `projects/123/services/serviceusage.googleapis.com` 5457 // where `123` is the project number (not project ID). 5458 func (r *ServicesService) Get(name string) *ServicesGetCall { 5459 c := &ServicesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 5460 c.name = name 5461 return c 5462 } 5463 5464 // Fields allows partial responses to be retrieved. See 5465 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 5466 // details. 5467 func (c *ServicesGetCall) Fields(s ...googleapi.Field) *ServicesGetCall { 5468 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 5469 return c 5470 } 5471 5472 // IfNoneMatch sets an optional parameter which makes the operation fail if the 5473 // object's ETag matches the given value. This is useful for getting updates 5474 // only after the object has changed since the last request. 5475 func (c *ServicesGetCall) IfNoneMatch(entityTag string) *ServicesGetCall { 5476 c.ifNoneMatch_ = entityTag 5477 return c 5478 } 5479 5480 // Context sets the context to be used in this call's Do method. 5481 func (c *ServicesGetCall) Context(ctx context.Context) *ServicesGetCall { 5482 c.ctx_ = ctx 5483 return c 5484 } 5485 5486 // Header returns a http.Header that can be modified by the caller to add 5487 // headers to the request. 5488 func (c *ServicesGetCall) Header() http.Header { 5489 if c.header_ == nil { 5490 c.header_ = make(http.Header) 5491 } 5492 return c.header_ 5493 } 5494 5495 func (c *ServicesGetCall) doRequest(alt string) (*http.Response, error) { 5496 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) 5497 if c.ifNoneMatch_ != "" { 5498 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 5499 } 5500 var body io.Reader = nil 5501 c.urlParams_.Set("alt", alt) 5502 c.urlParams_.Set("prettyPrint", "false") 5503 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") 5504 urls += "?" + c.urlParams_.Encode() 5505 req, err := http.NewRequest("GET", urls, body) 5506 if err != nil { 5507 return nil, err 5508 } 5509 req.Header = reqHeaders 5510 googleapi.Expand(req.URL, map[string]string{ 5511 "name": c.name, 5512 }) 5513 return gensupport.SendRequest(c.ctx_, c.s.client, req) 5514 } 5515 5516 // Do executes the "serviceusage.services.get" call. 5517 // Any non-2xx status code is an error. Response headers are in either 5518 // *Service.ServerResponse.Header or (if a response was returned at all) in 5519 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 5520 // whether the returned error was because http.StatusNotModified was returned. 5521 func (c *ServicesGetCall) Do(opts ...googleapi.CallOption) (*Service, error) { 5522 gensupport.SetOptions(c.urlParams_, opts...) 5523 res, err := c.doRequest("json") 5524 if res != nil && res.StatusCode == http.StatusNotModified { 5525 if res.Body != nil { 5526 res.Body.Close() 5527 } 5528 return nil, gensupport.WrapError(&googleapi.Error{ 5529 Code: res.StatusCode, 5530 Header: res.Header, 5531 }) 5532 } 5533 if err != nil { 5534 return nil, err 5535 } 5536 defer googleapi.CloseBody(res) 5537 if err := googleapi.CheckResponse(res); err != nil { 5538 return nil, gensupport.WrapError(err) 5539 } 5540 ret := &Service{ 5541 ServerResponse: googleapi.ServerResponse{ 5542 Header: res.Header, 5543 HTTPStatusCode: res.StatusCode, 5544 }, 5545 } 5546 target := &ret 5547 if err := gensupport.DecodeResponse(target, res); err != nil { 5548 return nil, err 5549 } 5550 return ret, nil 5551 } 5552 5553 type ServicesListCall struct { 5554 s *APIService 5555 parent string 5556 urlParams_ gensupport.URLParams 5557 ifNoneMatch_ string 5558 ctx_ context.Context 5559 header_ http.Header 5560 } 5561 5562 // List: Lists all services available to the specified project, and the current 5563 // state of those services with respect to the project. The list includes all 5564 // public services, all services for which the calling user has the 5565 // `servicemanagement.services.bind` permission, and all services that have 5566 // already been enabled on the project. The list can be filtered to only 5567 // include services in a specific state, for example to only include services 5568 // enabled on the project. 5569 // 5570 // - parent: Parent to search for services on. An example name would be: 5571 // `projects/123` where `123` is the project number (not project ID). 5572 func (r *ServicesService) List(parent string) *ServicesListCall { 5573 c := &ServicesListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 5574 c.parent = parent 5575 return c 5576 } 5577 5578 // Filter sets the optional parameter "filter": Only list services that conform 5579 // to the given filter. The allowed filter strings are `state:ENABLED` and 5580 // `state:DISABLED`. 5581 func (c *ServicesListCall) Filter(filter string) *ServicesListCall { 5582 c.urlParams_.Set("filter", filter) 5583 return c 5584 } 5585 5586 // PageSize sets the optional parameter "pageSize": Requested size of the next 5587 // page of data. Requested page size cannot exceed 200. If not set, the default 5588 // page size is 50. 5589 func (c *ServicesListCall) PageSize(pageSize int64) *ServicesListCall { 5590 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) 5591 return c 5592 } 5593 5594 // PageToken sets the optional parameter "pageToken": Token identifying which 5595 // result to start with, which is returned by a previous list call. 5596 func (c *ServicesListCall) PageToken(pageToken string) *ServicesListCall { 5597 c.urlParams_.Set("pageToken", pageToken) 5598 return c 5599 } 5600 5601 // Fields allows partial responses to be retrieved. See 5602 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 5603 // details. 5604 func (c *ServicesListCall) Fields(s ...googleapi.Field) *ServicesListCall { 5605 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 5606 return c 5607 } 5608 5609 // IfNoneMatch sets an optional parameter which makes the operation fail if the 5610 // object's ETag matches the given value. This is useful for getting updates 5611 // only after the object has changed since the last request. 5612 func (c *ServicesListCall) IfNoneMatch(entityTag string) *ServicesListCall { 5613 c.ifNoneMatch_ = entityTag 5614 return c 5615 } 5616 5617 // Context sets the context to be used in this call's Do method. 5618 func (c *ServicesListCall) Context(ctx context.Context) *ServicesListCall { 5619 c.ctx_ = ctx 5620 return c 5621 } 5622 5623 // Header returns a http.Header that can be modified by the caller to add 5624 // headers to the request. 5625 func (c *ServicesListCall) Header() http.Header { 5626 if c.header_ == nil { 5627 c.header_ = make(http.Header) 5628 } 5629 return c.header_ 5630 } 5631 5632 func (c *ServicesListCall) doRequest(alt string) (*http.Response, error) { 5633 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) 5634 if c.ifNoneMatch_ != "" { 5635 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 5636 } 5637 var body io.Reader = nil 5638 c.urlParams_.Set("alt", alt) 5639 c.urlParams_.Set("prettyPrint", "false") 5640 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/services") 5641 urls += "?" + c.urlParams_.Encode() 5642 req, err := http.NewRequest("GET", urls, body) 5643 if err != nil { 5644 return nil, err 5645 } 5646 req.Header = reqHeaders 5647 googleapi.Expand(req.URL, map[string]string{ 5648 "parent": c.parent, 5649 }) 5650 return gensupport.SendRequest(c.ctx_, c.s.client, req) 5651 } 5652 5653 // Do executes the "serviceusage.services.list" call. 5654 // Any non-2xx status code is an error. Response headers are in either 5655 // *ListServicesResponse.ServerResponse.Header or (if a response was returned 5656 // at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 5657 // check whether the returned error was because http.StatusNotModified was 5658 // returned. 5659 func (c *ServicesListCall) Do(opts ...googleapi.CallOption) (*ListServicesResponse, error) { 5660 gensupport.SetOptions(c.urlParams_, opts...) 5661 res, err := c.doRequest("json") 5662 if res != nil && res.StatusCode == http.StatusNotModified { 5663 if res.Body != nil { 5664 res.Body.Close() 5665 } 5666 return nil, gensupport.WrapError(&googleapi.Error{ 5667 Code: res.StatusCode, 5668 Header: res.Header, 5669 }) 5670 } 5671 if err != nil { 5672 return nil, err 5673 } 5674 defer googleapi.CloseBody(res) 5675 if err := googleapi.CheckResponse(res); err != nil { 5676 return nil, gensupport.WrapError(err) 5677 } 5678 ret := &ListServicesResponse{ 5679 ServerResponse: googleapi.ServerResponse{ 5680 Header: res.Header, 5681 HTTPStatusCode: res.StatusCode, 5682 }, 5683 } 5684 target := &ret 5685 if err := gensupport.DecodeResponse(target, res); err != nil { 5686 return nil, err 5687 } 5688 return ret, nil 5689 } 5690 5691 // Pages invokes f for each page of results. 5692 // A non-nil error returned from f will halt the iteration. 5693 // The provided context supersedes any context provided to the Context method. 5694 func (c *ServicesListCall) Pages(ctx context.Context, f func(*ListServicesResponse) error) error { 5695 c.ctx_ = ctx 5696 defer c.PageToken(c.urlParams_.Get("pageToken")) 5697 for { 5698 x, err := c.Do() 5699 if err != nil { 5700 return err 5701 } 5702 if err := f(x); err != nil { 5703 return err 5704 } 5705 if x.NextPageToken == "" { 5706 return nil 5707 } 5708 c.PageToken(x.NextPageToken) 5709 } 5710 } 5711 5712 type ServicesConsumerQuotaMetricsGetCall struct { 5713 s *APIService 5714 name string 5715 urlParams_ gensupport.URLParams 5716 ifNoneMatch_ string 5717 ctx_ context.Context 5718 header_ http.Header 5719 } 5720 5721 // Get: Retrieves a summary of quota information for a specific quota metric 5722 // 5723 // - name: The resource name of the quota limit. An example name would be: 5724 // `projects/123/services/serviceusage.googleapis.com/quotas/metrics/serviceus 5725 // age.googleapis.com%2Fmutate_requests`. 5726 func (r *ServicesConsumerQuotaMetricsService) Get(name string) *ServicesConsumerQuotaMetricsGetCall { 5727 c := &ServicesConsumerQuotaMetricsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 5728 c.name = name 5729 return c 5730 } 5731 5732 // View sets the optional parameter "view": Specifies the level of detail for 5733 // quota information in the response. 5734 // 5735 // Possible values: 5736 // 5737 // "QUOTA_VIEW_UNSPECIFIED" - No quota view specified. Requests that do not 5738 // 5739 // specify a quota view will typically default to the BASIC view. 5740 // 5741 // "BASIC" - Only buckets with overrides are shown in the response. 5742 // "FULL" - Include per-location buckets even if they do not have overrides. 5743 // 5744 // When the view is FULL, and a limit has regional or zonal quota, the limit 5745 // will include buckets for all regions or zones that could support overrides, 5746 // even if none are currently present. In some cases this will cause the 5747 // response to become very large; callers that do not need this extra 5748 // information should use the BASIC view instead. 5749 func (c *ServicesConsumerQuotaMetricsGetCall) View(view string) *ServicesConsumerQuotaMetricsGetCall { 5750 c.urlParams_.Set("view", view) 5751 return c 5752 } 5753 5754 // Fields allows partial responses to be retrieved. See 5755 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 5756 // details. 5757 func (c *ServicesConsumerQuotaMetricsGetCall) Fields(s ...googleapi.Field) *ServicesConsumerQuotaMetricsGetCall { 5758 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 5759 return c 5760 } 5761 5762 // IfNoneMatch sets an optional parameter which makes the operation fail if the 5763 // object's ETag matches the given value. This is useful for getting updates 5764 // only after the object has changed since the last request. 5765 func (c *ServicesConsumerQuotaMetricsGetCall) IfNoneMatch(entityTag string) *ServicesConsumerQuotaMetricsGetCall { 5766 c.ifNoneMatch_ = entityTag 5767 return c 5768 } 5769 5770 // Context sets the context to be used in this call's Do method. 5771 func (c *ServicesConsumerQuotaMetricsGetCall) Context(ctx context.Context) *ServicesConsumerQuotaMetricsGetCall { 5772 c.ctx_ = ctx 5773 return c 5774 } 5775 5776 // Header returns a http.Header that can be modified by the caller to add 5777 // headers to the request. 5778 func (c *ServicesConsumerQuotaMetricsGetCall) Header() http.Header { 5779 if c.header_ == nil { 5780 c.header_ = make(http.Header) 5781 } 5782 return c.header_ 5783 } 5784 5785 func (c *ServicesConsumerQuotaMetricsGetCall) doRequest(alt string) (*http.Response, error) { 5786 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) 5787 if c.ifNoneMatch_ != "" { 5788 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 5789 } 5790 var body io.Reader = nil 5791 c.urlParams_.Set("alt", alt) 5792 c.urlParams_.Set("prettyPrint", "false") 5793 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") 5794 urls += "?" + c.urlParams_.Encode() 5795 req, err := http.NewRequest("GET", urls, body) 5796 if err != nil { 5797 return nil, err 5798 } 5799 req.Header = reqHeaders 5800 googleapi.Expand(req.URL, map[string]string{ 5801 "name": c.name, 5802 }) 5803 return gensupport.SendRequest(c.ctx_, c.s.client, req) 5804 } 5805 5806 // Do executes the "serviceusage.services.consumerQuotaMetrics.get" call. 5807 // Any non-2xx status code is an error. Response headers are in either 5808 // *ConsumerQuotaMetric.ServerResponse.Header or (if a response was returned at 5809 // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 5810 // check whether the returned error was because http.StatusNotModified was 5811 // returned. 5812 func (c *ServicesConsumerQuotaMetricsGetCall) Do(opts ...googleapi.CallOption) (*ConsumerQuotaMetric, error) { 5813 gensupport.SetOptions(c.urlParams_, opts...) 5814 res, err := c.doRequest("json") 5815 if res != nil && res.StatusCode == http.StatusNotModified { 5816 if res.Body != nil { 5817 res.Body.Close() 5818 } 5819 return nil, gensupport.WrapError(&googleapi.Error{ 5820 Code: res.StatusCode, 5821 Header: res.Header, 5822 }) 5823 } 5824 if err != nil { 5825 return nil, err 5826 } 5827 defer googleapi.CloseBody(res) 5828 if err := googleapi.CheckResponse(res); err != nil { 5829 return nil, gensupport.WrapError(err) 5830 } 5831 ret := &ConsumerQuotaMetric{ 5832 ServerResponse: googleapi.ServerResponse{ 5833 Header: res.Header, 5834 HTTPStatusCode: res.StatusCode, 5835 }, 5836 } 5837 target := &ret 5838 if err := gensupport.DecodeResponse(target, res); err != nil { 5839 return nil, err 5840 } 5841 return ret, nil 5842 } 5843 5844 type ServicesConsumerQuotaMetricsImportAdminOverridesCall struct { 5845 s *APIService 5846 parent string 5847 importadminoverridesrequest *ImportAdminOverridesRequest 5848 urlParams_ gensupport.URLParams 5849 ctx_ context.Context 5850 header_ http.Header 5851 } 5852 5853 // ImportAdminOverrides: Creates or updates multiple admin overrides 5854 // atomically, all on the same consumer, but on many different metrics or 5855 // limits. The name field in the quota override message should not be set. 5856 // 5857 // - parent: The resource name of the consumer. An example name would be: 5858 // `projects/123/services/compute.googleapis.com`. 5859 func (r *ServicesConsumerQuotaMetricsService) ImportAdminOverrides(parent string, importadminoverridesrequest *ImportAdminOverridesRequest) *ServicesConsumerQuotaMetricsImportAdminOverridesCall { 5860 c := &ServicesConsumerQuotaMetricsImportAdminOverridesCall{s: r.s, urlParams_: make(gensupport.URLParams)} 5861 c.parent = parent 5862 c.importadminoverridesrequest = importadminoverridesrequest 5863 return c 5864 } 5865 5866 // Fields allows partial responses to be retrieved. See 5867 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 5868 // details. 5869 func (c *ServicesConsumerQuotaMetricsImportAdminOverridesCall) Fields(s ...googleapi.Field) *ServicesConsumerQuotaMetricsImportAdminOverridesCall { 5870 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 5871 return c 5872 } 5873 5874 // Context sets the context to be used in this call's Do method. 5875 func (c *ServicesConsumerQuotaMetricsImportAdminOverridesCall) Context(ctx context.Context) *ServicesConsumerQuotaMetricsImportAdminOverridesCall { 5876 c.ctx_ = ctx 5877 return c 5878 } 5879 5880 // Header returns a http.Header that can be modified by the caller to add 5881 // headers to the request. 5882 func (c *ServicesConsumerQuotaMetricsImportAdminOverridesCall) Header() http.Header { 5883 if c.header_ == nil { 5884 c.header_ = make(http.Header) 5885 } 5886 return c.header_ 5887 } 5888 5889 func (c *ServicesConsumerQuotaMetricsImportAdminOverridesCall) doRequest(alt string) (*http.Response, error) { 5890 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) 5891 var body io.Reader = nil 5892 body, err := googleapi.WithoutDataWrapper.JSONReader(c.importadminoverridesrequest) 5893 if err != nil { 5894 return nil, err 5895 } 5896 c.urlParams_.Set("alt", alt) 5897 c.urlParams_.Set("prettyPrint", "false") 5898 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/consumerQuotaMetrics:importAdminOverrides") 5899 urls += "?" + c.urlParams_.Encode() 5900 req, err := http.NewRequest("POST", urls, body) 5901 if err != nil { 5902 return nil, err 5903 } 5904 req.Header = reqHeaders 5905 googleapi.Expand(req.URL, map[string]string{ 5906 "parent": c.parent, 5907 }) 5908 return gensupport.SendRequest(c.ctx_, c.s.client, req) 5909 } 5910 5911 // Do executes the "serviceusage.services.consumerQuotaMetrics.importAdminOverrides" call. 5912 // Any non-2xx status code is an error. Response headers are in either 5913 // *Operation.ServerResponse.Header or (if a response was returned at all) in 5914 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 5915 // whether the returned error was because http.StatusNotModified was returned. 5916 func (c *ServicesConsumerQuotaMetricsImportAdminOverridesCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 5917 gensupport.SetOptions(c.urlParams_, opts...) 5918 res, err := c.doRequest("json") 5919 if res != nil && res.StatusCode == http.StatusNotModified { 5920 if res.Body != nil { 5921 res.Body.Close() 5922 } 5923 return nil, gensupport.WrapError(&googleapi.Error{ 5924 Code: res.StatusCode, 5925 Header: res.Header, 5926 }) 5927 } 5928 if err != nil { 5929 return nil, err 5930 } 5931 defer googleapi.CloseBody(res) 5932 if err := googleapi.CheckResponse(res); err != nil { 5933 return nil, gensupport.WrapError(err) 5934 } 5935 ret := &Operation{ 5936 ServerResponse: googleapi.ServerResponse{ 5937 Header: res.Header, 5938 HTTPStatusCode: res.StatusCode, 5939 }, 5940 } 5941 target := &ret 5942 if err := gensupport.DecodeResponse(target, res); err != nil { 5943 return nil, err 5944 } 5945 return ret, nil 5946 } 5947 5948 type ServicesConsumerQuotaMetricsImportConsumerOverridesCall struct { 5949 s *APIService 5950 parent string 5951 importconsumeroverridesrequest *ImportConsumerOverridesRequest 5952 urlParams_ gensupport.URLParams 5953 ctx_ context.Context 5954 header_ http.Header 5955 } 5956 5957 // ImportConsumerOverrides: Creates or updates multiple consumer overrides 5958 // atomically, all on the same consumer, but on many different metrics or 5959 // limits. The name field in the quota override message should not be set. 5960 // 5961 // - parent: The resource name of the consumer. An example name would be: 5962 // `projects/123/services/compute.googleapis.com`. 5963 func (r *ServicesConsumerQuotaMetricsService) ImportConsumerOverrides(parent string, importconsumeroverridesrequest *ImportConsumerOverridesRequest) *ServicesConsumerQuotaMetricsImportConsumerOverridesCall { 5964 c := &ServicesConsumerQuotaMetricsImportConsumerOverridesCall{s: r.s, urlParams_: make(gensupport.URLParams)} 5965 c.parent = parent 5966 c.importconsumeroverridesrequest = importconsumeroverridesrequest 5967 return c 5968 } 5969 5970 // Fields allows partial responses to be retrieved. See 5971 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 5972 // details. 5973 func (c *ServicesConsumerQuotaMetricsImportConsumerOverridesCall) Fields(s ...googleapi.Field) *ServicesConsumerQuotaMetricsImportConsumerOverridesCall { 5974 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 5975 return c 5976 } 5977 5978 // Context sets the context to be used in this call's Do method. 5979 func (c *ServicesConsumerQuotaMetricsImportConsumerOverridesCall) Context(ctx context.Context) *ServicesConsumerQuotaMetricsImportConsumerOverridesCall { 5980 c.ctx_ = ctx 5981 return c 5982 } 5983 5984 // Header returns a http.Header that can be modified by the caller to add 5985 // headers to the request. 5986 func (c *ServicesConsumerQuotaMetricsImportConsumerOverridesCall) Header() http.Header { 5987 if c.header_ == nil { 5988 c.header_ = make(http.Header) 5989 } 5990 return c.header_ 5991 } 5992 5993 func (c *ServicesConsumerQuotaMetricsImportConsumerOverridesCall) doRequest(alt string) (*http.Response, error) { 5994 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) 5995 var body io.Reader = nil 5996 body, err := googleapi.WithoutDataWrapper.JSONReader(c.importconsumeroverridesrequest) 5997 if err != nil { 5998 return nil, err 5999 } 6000 c.urlParams_.Set("alt", alt) 6001 c.urlParams_.Set("prettyPrint", "false") 6002 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/consumerQuotaMetrics:importConsumerOverrides") 6003 urls += "?" + c.urlParams_.Encode() 6004 req, err := http.NewRequest("POST", urls, body) 6005 if err != nil { 6006 return nil, err 6007 } 6008 req.Header = reqHeaders 6009 googleapi.Expand(req.URL, map[string]string{ 6010 "parent": c.parent, 6011 }) 6012 return gensupport.SendRequest(c.ctx_, c.s.client, req) 6013 } 6014 6015 // Do executes the "serviceusage.services.consumerQuotaMetrics.importConsumerOverrides" call. 6016 // Any non-2xx status code is an error. Response headers are in either 6017 // *Operation.ServerResponse.Header or (if a response was returned at all) in 6018 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 6019 // whether the returned error was because http.StatusNotModified was returned. 6020 func (c *ServicesConsumerQuotaMetricsImportConsumerOverridesCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 6021 gensupport.SetOptions(c.urlParams_, opts...) 6022 res, err := c.doRequest("json") 6023 if res != nil && res.StatusCode == http.StatusNotModified { 6024 if res.Body != nil { 6025 res.Body.Close() 6026 } 6027 return nil, gensupport.WrapError(&googleapi.Error{ 6028 Code: res.StatusCode, 6029 Header: res.Header, 6030 }) 6031 } 6032 if err != nil { 6033 return nil, err 6034 } 6035 defer googleapi.CloseBody(res) 6036 if err := googleapi.CheckResponse(res); err != nil { 6037 return nil, gensupport.WrapError(err) 6038 } 6039 ret := &Operation{ 6040 ServerResponse: googleapi.ServerResponse{ 6041 Header: res.Header, 6042 HTTPStatusCode: res.StatusCode, 6043 }, 6044 } 6045 target := &ret 6046 if err := gensupport.DecodeResponse(target, res); err != nil { 6047 return nil, err 6048 } 6049 return ret, nil 6050 } 6051 6052 type ServicesConsumerQuotaMetricsListCall struct { 6053 s *APIService 6054 parent string 6055 urlParams_ gensupport.URLParams 6056 ifNoneMatch_ string 6057 ctx_ context.Context 6058 header_ http.Header 6059 } 6060 6061 // List: Retrieves a summary of all quota information visible to the service 6062 // consumer, organized by service metric. Each metric includes information 6063 // about all of its defined limits. Each limit includes the limit configuration 6064 // (quota unit, preciseness, default value), the current effective limit value, 6065 // and all of the overrides applied to the limit. 6066 // 6067 // - parent: Parent of the quotas resource. Some example names would be: 6068 // `projects/123/services/serviceconsumermanagement.googleapis.com` 6069 // `folders/345/services/serviceconsumermanagement.googleapis.com` 6070 // `organizations/456/services/serviceconsumermanagement.googleapis.com`. 6071 func (r *ServicesConsumerQuotaMetricsService) List(parent string) *ServicesConsumerQuotaMetricsListCall { 6072 c := &ServicesConsumerQuotaMetricsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 6073 c.parent = parent 6074 return c 6075 } 6076 6077 // PageSize sets the optional parameter "pageSize": Requested size of the next 6078 // page of data. 6079 func (c *ServicesConsumerQuotaMetricsListCall) PageSize(pageSize int64) *ServicesConsumerQuotaMetricsListCall { 6080 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) 6081 return c 6082 } 6083 6084 // PageToken sets the optional parameter "pageToken": Token identifying which 6085 // result to start with; returned by a previous list call. 6086 func (c *ServicesConsumerQuotaMetricsListCall) PageToken(pageToken string) *ServicesConsumerQuotaMetricsListCall { 6087 c.urlParams_.Set("pageToken", pageToken) 6088 return c 6089 } 6090 6091 // View sets the optional parameter "view": Specifies the level of detail for 6092 // quota information in the response. 6093 // 6094 // Possible values: 6095 // 6096 // "QUOTA_VIEW_UNSPECIFIED" - No quota view specified. Requests that do not 6097 // 6098 // specify a quota view will typically default to the BASIC view. 6099 // 6100 // "BASIC" - Only buckets with overrides are shown in the response. 6101 // "FULL" - Include per-location buckets even if they do not have overrides. 6102 // 6103 // When the view is FULL, and a limit has regional or zonal quota, the limit 6104 // will include buckets for all regions or zones that could support overrides, 6105 // even if none are currently present. In some cases this will cause the 6106 // response to become very large; callers that do not need this extra 6107 // information should use the BASIC view instead. 6108 func (c *ServicesConsumerQuotaMetricsListCall) View(view string) *ServicesConsumerQuotaMetricsListCall { 6109 c.urlParams_.Set("view", view) 6110 return c 6111 } 6112 6113 // Fields allows partial responses to be retrieved. See 6114 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 6115 // details. 6116 func (c *ServicesConsumerQuotaMetricsListCall) Fields(s ...googleapi.Field) *ServicesConsumerQuotaMetricsListCall { 6117 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 6118 return c 6119 } 6120 6121 // IfNoneMatch sets an optional parameter which makes the operation fail if the 6122 // object's ETag matches the given value. This is useful for getting updates 6123 // only after the object has changed since the last request. 6124 func (c *ServicesConsumerQuotaMetricsListCall) IfNoneMatch(entityTag string) *ServicesConsumerQuotaMetricsListCall { 6125 c.ifNoneMatch_ = entityTag 6126 return c 6127 } 6128 6129 // Context sets the context to be used in this call's Do method. 6130 func (c *ServicesConsumerQuotaMetricsListCall) Context(ctx context.Context) *ServicesConsumerQuotaMetricsListCall { 6131 c.ctx_ = ctx 6132 return c 6133 } 6134 6135 // Header returns a http.Header that can be modified by the caller to add 6136 // headers to the request. 6137 func (c *ServicesConsumerQuotaMetricsListCall) Header() http.Header { 6138 if c.header_ == nil { 6139 c.header_ = make(http.Header) 6140 } 6141 return c.header_ 6142 } 6143 6144 func (c *ServicesConsumerQuotaMetricsListCall) doRequest(alt string) (*http.Response, error) { 6145 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) 6146 if c.ifNoneMatch_ != "" { 6147 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 6148 } 6149 var body io.Reader = nil 6150 c.urlParams_.Set("alt", alt) 6151 c.urlParams_.Set("prettyPrint", "false") 6152 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/consumerQuotaMetrics") 6153 urls += "?" + c.urlParams_.Encode() 6154 req, err := http.NewRequest("GET", urls, body) 6155 if err != nil { 6156 return nil, err 6157 } 6158 req.Header = reqHeaders 6159 googleapi.Expand(req.URL, map[string]string{ 6160 "parent": c.parent, 6161 }) 6162 return gensupport.SendRequest(c.ctx_, c.s.client, req) 6163 } 6164 6165 // Do executes the "serviceusage.services.consumerQuotaMetrics.list" call. 6166 // Any non-2xx status code is an error. Response headers are in either 6167 // *ListConsumerQuotaMetricsResponse.ServerResponse.Header or (if a response 6168 // was returned at all) in error.(*googleapi.Error).Header. Use 6169 // googleapi.IsNotModified to check whether the returned error was because 6170 // http.StatusNotModified was returned. 6171 func (c *ServicesConsumerQuotaMetricsListCall) Do(opts ...googleapi.CallOption) (*ListConsumerQuotaMetricsResponse, error) { 6172 gensupport.SetOptions(c.urlParams_, opts...) 6173 res, err := c.doRequest("json") 6174 if res != nil && res.StatusCode == http.StatusNotModified { 6175 if res.Body != nil { 6176 res.Body.Close() 6177 } 6178 return nil, gensupport.WrapError(&googleapi.Error{ 6179 Code: res.StatusCode, 6180 Header: res.Header, 6181 }) 6182 } 6183 if err != nil { 6184 return nil, err 6185 } 6186 defer googleapi.CloseBody(res) 6187 if err := googleapi.CheckResponse(res); err != nil { 6188 return nil, gensupport.WrapError(err) 6189 } 6190 ret := &ListConsumerQuotaMetricsResponse{ 6191 ServerResponse: googleapi.ServerResponse{ 6192 Header: res.Header, 6193 HTTPStatusCode: res.StatusCode, 6194 }, 6195 } 6196 target := &ret 6197 if err := gensupport.DecodeResponse(target, res); err != nil { 6198 return nil, err 6199 } 6200 return ret, nil 6201 } 6202 6203 // Pages invokes f for each page of results. 6204 // A non-nil error returned from f will halt the iteration. 6205 // The provided context supersedes any context provided to the Context method. 6206 func (c *ServicesConsumerQuotaMetricsListCall) Pages(ctx context.Context, f func(*ListConsumerQuotaMetricsResponse) error) error { 6207 c.ctx_ = ctx 6208 defer c.PageToken(c.urlParams_.Get("pageToken")) 6209 for { 6210 x, err := c.Do() 6211 if err != nil { 6212 return err 6213 } 6214 if err := f(x); err != nil { 6215 return err 6216 } 6217 if x.NextPageToken == "" { 6218 return nil 6219 } 6220 c.PageToken(x.NextPageToken) 6221 } 6222 } 6223 6224 type ServicesConsumerQuotaMetricsLimitsGetCall struct { 6225 s *APIService 6226 name string 6227 urlParams_ gensupport.URLParams 6228 ifNoneMatch_ string 6229 ctx_ context.Context 6230 header_ http.Header 6231 } 6232 6233 // Get: Retrieves a summary of quota information for a specific quota limit. 6234 // 6235 // - name: The resource name of the quota limit. Use the quota limit resource 6236 // name returned by previous ListConsumerQuotaMetrics and 6237 // GetConsumerQuotaMetric API calls. 6238 func (r *ServicesConsumerQuotaMetricsLimitsService) Get(name string) *ServicesConsumerQuotaMetricsLimitsGetCall { 6239 c := &ServicesConsumerQuotaMetricsLimitsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 6240 c.name = name 6241 return c 6242 } 6243 6244 // View sets the optional parameter "view": Specifies the level of detail for 6245 // quota information in the response. 6246 // 6247 // Possible values: 6248 // 6249 // "QUOTA_VIEW_UNSPECIFIED" - No quota view specified. Requests that do not 6250 // 6251 // specify a quota view will typically default to the BASIC view. 6252 // 6253 // "BASIC" - Only buckets with overrides are shown in the response. 6254 // "FULL" - Include per-location buckets even if they do not have overrides. 6255 // 6256 // When the view is FULL, and a limit has regional or zonal quota, the limit 6257 // will include buckets for all regions or zones that could support overrides, 6258 // even if none are currently present. In some cases this will cause the 6259 // response to become very large; callers that do not need this extra 6260 // information should use the BASIC view instead. 6261 func (c *ServicesConsumerQuotaMetricsLimitsGetCall) View(view string) *ServicesConsumerQuotaMetricsLimitsGetCall { 6262 c.urlParams_.Set("view", view) 6263 return c 6264 } 6265 6266 // Fields allows partial responses to be retrieved. See 6267 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 6268 // details. 6269 func (c *ServicesConsumerQuotaMetricsLimitsGetCall) Fields(s ...googleapi.Field) *ServicesConsumerQuotaMetricsLimitsGetCall { 6270 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 6271 return c 6272 } 6273 6274 // IfNoneMatch sets an optional parameter which makes the operation fail if the 6275 // object's ETag matches the given value. This is useful for getting updates 6276 // only after the object has changed since the last request. 6277 func (c *ServicesConsumerQuotaMetricsLimitsGetCall) IfNoneMatch(entityTag string) *ServicesConsumerQuotaMetricsLimitsGetCall { 6278 c.ifNoneMatch_ = entityTag 6279 return c 6280 } 6281 6282 // Context sets the context to be used in this call's Do method. 6283 func (c *ServicesConsumerQuotaMetricsLimitsGetCall) Context(ctx context.Context) *ServicesConsumerQuotaMetricsLimitsGetCall { 6284 c.ctx_ = ctx 6285 return c 6286 } 6287 6288 // Header returns a http.Header that can be modified by the caller to add 6289 // headers to the request. 6290 func (c *ServicesConsumerQuotaMetricsLimitsGetCall) Header() http.Header { 6291 if c.header_ == nil { 6292 c.header_ = make(http.Header) 6293 } 6294 return c.header_ 6295 } 6296 6297 func (c *ServicesConsumerQuotaMetricsLimitsGetCall) doRequest(alt string) (*http.Response, error) { 6298 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) 6299 if c.ifNoneMatch_ != "" { 6300 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 6301 } 6302 var body io.Reader = nil 6303 c.urlParams_.Set("alt", alt) 6304 c.urlParams_.Set("prettyPrint", "false") 6305 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") 6306 urls += "?" + c.urlParams_.Encode() 6307 req, err := http.NewRequest("GET", urls, body) 6308 if err != nil { 6309 return nil, err 6310 } 6311 req.Header = reqHeaders 6312 googleapi.Expand(req.URL, map[string]string{ 6313 "name": c.name, 6314 }) 6315 return gensupport.SendRequest(c.ctx_, c.s.client, req) 6316 } 6317 6318 // Do executes the "serviceusage.services.consumerQuotaMetrics.limits.get" call. 6319 // Any non-2xx status code is an error. Response headers are in either 6320 // *ConsumerQuotaLimit.ServerResponse.Header or (if a response was returned at 6321 // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 6322 // check whether the returned error was because http.StatusNotModified was 6323 // returned. 6324 func (c *ServicesConsumerQuotaMetricsLimitsGetCall) Do(opts ...googleapi.CallOption) (*ConsumerQuotaLimit, error) { 6325 gensupport.SetOptions(c.urlParams_, opts...) 6326 res, err := c.doRequest("json") 6327 if res != nil && res.StatusCode == http.StatusNotModified { 6328 if res.Body != nil { 6329 res.Body.Close() 6330 } 6331 return nil, gensupport.WrapError(&googleapi.Error{ 6332 Code: res.StatusCode, 6333 Header: res.Header, 6334 }) 6335 } 6336 if err != nil { 6337 return nil, err 6338 } 6339 defer googleapi.CloseBody(res) 6340 if err := googleapi.CheckResponse(res); err != nil { 6341 return nil, gensupport.WrapError(err) 6342 } 6343 ret := &ConsumerQuotaLimit{ 6344 ServerResponse: googleapi.ServerResponse{ 6345 Header: res.Header, 6346 HTTPStatusCode: res.StatusCode, 6347 }, 6348 } 6349 target := &ret 6350 if err := gensupport.DecodeResponse(target, res); err != nil { 6351 return nil, err 6352 } 6353 return ret, nil 6354 } 6355 6356 type ServicesConsumerQuotaMetricsLimitsAdminOverridesCreateCall struct { 6357 s *APIService 6358 parent string 6359 quotaoverride *QuotaOverride 6360 urlParams_ gensupport.URLParams 6361 ctx_ context.Context 6362 header_ http.Header 6363 } 6364 6365 // Create: Creates an admin override. An admin override is applied by an 6366 // administrator of a parent folder or parent organization of the consumer 6367 // receiving the override. An admin override is intended to limit the amount of 6368 // quota the consumer can use out of the total quota pool allocated to all 6369 // children of the folder or organization. 6370 // 6371 // - parent: The resource name of the parent quota limit, returned by a 6372 // ListConsumerQuotaMetrics or GetConsumerQuotaMetric call. An example name 6373 // would be: 6374 // `projects/123/services/compute.googleapis.com/consumerQuotaMetrics/compute. 6375 // googleapis.com%2Fcpus/limits/%2Fproject%2Fregion`. 6376 func (r *ServicesConsumerQuotaMetricsLimitsAdminOverridesService) Create(parent string, quotaoverride *QuotaOverride) *ServicesConsumerQuotaMetricsLimitsAdminOverridesCreateCall { 6377 c := &ServicesConsumerQuotaMetricsLimitsAdminOverridesCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 6378 c.parent = parent 6379 c.quotaoverride = quotaoverride 6380 return c 6381 } 6382 6383 // Force sets the optional parameter "force": Whether to force the creation of 6384 // the quota override. Setting the force parameter to 'true' ignores all quota 6385 // safety checks that would fail the request. QuotaSafetyCheck lists all such 6386 // validations. If force is set to true, it is recommended to include a case id 6387 // in "X-Goog-Request-Reason" header when sending the request. 6388 func (c *ServicesConsumerQuotaMetricsLimitsAdminOverridesCreateCall) Force(force bool) *ServicesConsumerQuotaMetricsLimitsAdminOverridesCreateCall { 6389 c.urlParams_.Set("force", fmt.Sprint(force)) 6390 return c 6391 } 6392 6393 // ForceOnly sets the optional parameter "forceOnly": The list of quota safety 6394 // checks to ignore before the override mutation. Unlike 'force' field that 6395 // ignores all the quota safety checks, the 'force_only' field ignores only the 6396 // specified checks; other checks are still enforced. The 'force' and 6397 // 'force_only' fields cannot both be set. If force_only is specified, it is 6398 // recommended to include a case id in "X-Goog-Request-Reason" header when 6399 // sending the request. 6400 // 6401 // Possible values: 6402 // 6403 // "QUOTA_SAFETY_CHECK_UNSPECIFIED" - Unspecified quota safety check. 6404 // "LIMIT_DECREASE_BELOW_USAGE" - Validates that a quota mutation would not 6405 // 6406 // cause the consumer's effective limit to be lower than the consumer's quota 6407 // usage. 6408 // 6409 // "LIMIT_DECREASE_PERCENTAGE_TOO_HIGH" - Validates that a quota mutation 6410 // 6411 // would not cause the consumer's effective limit to decrease by more than 10 6412 // percent. 6413 func (c *ServicesConsumerQuotaMetricsLimitsAdminOverridesCreateCall) ForceOnly(forceOnly ...string) *ServicesConsumerQuotaMetricsLimitsAdminOverridesCreateCall { 6414 c.urlParams_.SetMulti("forceOnly", append([]string{}, forceOnly...)) 6415 return c 6416 } 6417 6418 // Fields allows partial responses to be retrieved. See 6419 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 6420 // details. 6421 func (c *ServicesConsumerQuotaMetricsLimitsAdminOverridesCreateCall) Fields(s ...googleapi.Field) *ServicesConsumerQuotaMetricsLimitsAdminOverridesCreateCall { 6422 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 6423 return c 6424 } 6425 6426 // Context sets the context to be used in this call's Do method. 6427 func (c *ServicesConsumerQuotaMetricsLimitsAdminOverridesCreateCall) Context(ctx context.Context) *ServicesConsumerQuotaMetricsLimitsAdminOverridesCreateCall { 6428 c.ctx_ = ctx 6429 return c 6430 } 6431 6432 // Header returns a http.Header that can be modified by the caller to add 6433 // headers to the request. 6434 func (c *ServicesConsumerQuotaMetricsLimitsAdminOverridesCreateCall) Header() http.Header { 6435 if c.header_ == nil { 6436 c.header_ = make(http.Header) 6437 } 6438 return c.header_ 6439 } 6440 6441 func (c *ServicesConsumerQuotaMetricsLimitsAdminOverridesCreateCall) doRequest(alt string) (*http.Response, error) { 6442 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) 6443 var body io.Reader = nil 6444 body, err := googleapi.WithoutDataWrapper.JSONReader(c.quotaoverride) 6445 if err != nil { 6446 return nil, err 6447 } 6448 c.urlParams_.Set("alt", alt) 6449 c.urlParams_.Set("prettyPrint", "false") 6450 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/adminOverrides") 6451 urls += "?" + c.urlParams_.Encode() 6452 req, err := http.NewRequest("POST", urls, body) 6453 if err != nil { 6454 return nil, err 6455 } 6456 req.Header = reqHeaders 6457 googleapi.Expand(req.URL, map[string]string{ 6458 "parent": c.parent, 6459 }) 6460 return gensupport.SendRequest(c.ctx_, c.s.client, req) 6461 } 6462 6463 // Do executes the "serviceusage.services.consumerQuotaMetrics.limits.adminOverrides.create" call. 6464 // Any non-2xx status code is an error. Response headers are in either 6465 // *Operation.ServerResponse.Header or (if a response was returned at all) in 6466 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 6467 // whether the returned error was because http.StatusNotModified was returned. 6468 func (c *ServicesConsumerQuotaMetricsLimitsAdminOverridesCreateCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 6469 gensupport.SetOptions(c.urlParams_, opts...) 6470 res, err := c.doRequest("json") 6471 if res != nil && res.StatusCode == http.StatusNotModified { 6472 if res.Body != nil { 6473 res.Body.Close() 6474 } 6475 return nil, gensupport.WrapError(&googleapi.Error{ 6476 Code: res.StatusCode, 6477 Header: res.Header, 6478 }) 6479 } 6480 if err != nil { 6481 return nil, err 6482 } 6483 defer googleapi.CloseBody(res) 6484 if err := googleapi.CheckResponse(res); err != nil { 6485 return nil, gensupport.WrapError(err) 6486 } 6487 ret := &Operation{ 6488 ServerResponse: googleapi.ServerResponse{ 6489 Header: res.Header, 6490 HTTPStatusCode: res.StatusCode, 6491 }, 6492 } 6493 target := &ret 6494 if err := gensupport.DecodeResponse(target, res); err != nil { 6495 return nil, err 6496 } 6497 return ret, nil 6498 } 6499 6500 type ServicesConsumerQuotaMetricsLimitsAdminOverridesDeleteCall struct { 6501 s *APIService 6502 name string 6503 urlParams_ gensupport.URLParams 6504 ctx_ context.Context 6505 header_ http.Header 6506 } 6507 6508 // Delete: Deletes an admin override. 6509 // 6510 // - name: The resource name of the override to delete. An example name would 6511 // be: 6512 // `projects/123/services/compute.googleapis.com/consumerQuotaMetrics/compute. 6513 // googleapis.com%2Fcpus/limits/%2Fproject%2Fregion/adminOverrides/4a3f2c1d`. 6514 func (r *ServicesConsumerQuotaMetricsLimitsAdminOverridesService) Delete(name string) *ServicesConsumerQuotaMetricsLimitsAdminOverridesDeleteCall { 6515 c := &ServicesConsumerQuotaMetricsLimitsAdminOverridesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} 6516 c.name = name 6517 return c 6518 } 6519 6520 // Force sets the optional parameter "force": Whether to force the deletion of 6521 // the quota override. Setting the force parameter to 'true' ignores all quota 6522 // safety checks that would fail the request. QuotaSafetyCheck lists all such 6523 // validations. If force is set to true, it is recommended to include a case id 6524 // in "X-Goog-Request-Reason" header when sending the request. 6525 func (c *ServicesConsumerQuotaMetricsLimitsAdminOverridesDeleteCall) Force(force bool) *ServicesConsumerQuotaMetricsLimitsAdminOverridesDeleteCall { 6526 c.urlParams_.Set("force", fmt.Sprint(force)) 6527 return c 6528 } 6529 6530 // ForceOnly sets the optional parameter "forceOnly": The list of quota safety 6531 // checks to ignore before the override mutation. Unlike 'force' field that 6532 // ignores all the quota safety checks, the 'force_only' field ignores only the 6533 // specified checks; other checks are still enforced. The 'force' and 6534 // 'force_only' fields cannot both be set. If force_only is specified, it is 6535 // recommended to include a case id in "X-Goog-Request-Reason" header when 6536 // sending the request. 6537 // 6538 // Possible values: 6539 // 6540 // "QUOTA_SAFETY_CHECK_UNSPECIFIED" - Unspecified quota safety check. 6541 // "LIMIT_DECREASE_BELOW_USAGE" - Validates that a quota mutation would not 6542 // 6543 // cause the consumer's effective limit to be lower than the consumer's quota 6544 // usage. 6545 // 6546 // "LIMIT_DECREASE_PERCENTAGE_TOO_HIGH" - Validates that a quota mutation 6547 // 6548 // would not cause the consumer's effective limit to decrease by more than 10 6549 // percent. 6550 func (c *ServicesConsumerQuotaMetricsLimitsAdminOverridesDeleteCall) ForceOnly(forceOnly ...string) *ServicesConsumerQuotaMetricsLimitsAdminOverridesDeleteCall { 6551 c.urlParams_.SetMulti("forceOnly", append([]string{}, forceOnly...)) 6552 return c 6553 } 6554 6555 // Fields allows partial responses to be retrieved. See 6556 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 6557 // details. 6558 func (c *ServicesConsumerQuotaMetricsLimitsAdminOverridesDeleteCall) Fields(s ...googleapi.Field) *ServicesConsumerQuotaMetricsLimitsAdminOverridesDeleteCall { 6559 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 6560 return c 6561 } 6562 6563 // Context sets the context to be used in this call's Do method. 6564 func (c *ServicesConsumerQuotaMetricsLimitsAdminOverridesDeleteCall) Context(ctx context.Context) *ServicesConsumerQuotaMetricsLimitsAdminOverridesDeleteCall { 6565 c.ctx_ = ctx 6566 return c 6567 } 6568 6569 // Header returns a http.Header that can be modified by the caller to add 6570 // headers to the request. 6571 func (c *ServicesConsumerQuotaMetricsLimitsAdminOverridesDeleteCall) Header() http.Header { 6572 if c.header_ == nil { 6573 c.header_ = make(http.Header) 6574 } 6575 return c.header_ 6576 } 6577 6578 func (c *ServicesConsumerQuotaMetricsLimitsAdminOverridesDeleteCall) doRequest(alt string) (*http.Response, error) { 6579 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) 6580 var body io.Reader = nil 6581 c.urlParams_.Set("alt", alt) 6582 c.urlParams_.Set("prettyPrint", "false") 6583 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") 6584 urls += "?" + c.urlParams_.Encode() 6585 req, err := http.NewRequest("DELETE", urls, body) 6586 if err != nil { 6587 return nil, err 6588 } 6589 req.Header = reqHeaders 6590 googleapi.Expand(req.URL, map[string]string{ 6591 "name": c.name, 6592 }) 6593 return gensupport.SendRequest(c.ctx_, c.s.client, req) 6594 } 6595 6596 // Do executes the "serviceusage.services.consumerQuotaMetrics.limits.adminOverrides.delete" call. 6597 // Any non-2xx status code is an error. Response headers are in either 6598 // *Operation.ServerResponse.Header or (if a response was returned at all) in 6599 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 6600 // whether the returned error was because http.StatusNotModified was returned. 6601 func (c *ServicesConsumerQuotaMetricsLimitsAdminOverridesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 6602 gensupport.SetOptions(c.urlParams_, opts...) 6603 res, err := c.doRequest("json") 6604 if res != nil && res.StatusCode == http.StatusNotModified { 6605 if res.Body != nil { 6606 res.Body.Close() 6607 } 6608 return nil, gensupport.WrapError(&googleapi.Error{ 6609 Code: res.StatusCode, 6610 Header: res.Header, 6611 }) 6612 } 6613 if err != nil { 6614 return nil, err 6615 } 6616 defer googleapi.CloseBody(res) 6617 if err := googleapi.CheckResponse(res); err != nil { 6618 return nil, gensupport.WrapError(err) 6619 } 6620 ret := &Operation{ 6621 ServerResponse: googleapi.ServerResponse{ 6622 Header: res.Header, 6623 HTTPStatusCode: res.StatusCode, 6624 }, 6625 } 6626 target := &ret 6627 if err := gensupport.DecodeResponse(target, res); err != nil { 6628 return nil, err 6629 } 6630 return ret, nil 6631 } 6632 6633 type ServicesConsumerQuotaMetricsLimitsAdminOverridesListCall struct { 6634 s *APIService 6635 parent string 6636 urlParams_ gensupport.URLParams 6637 ifNoneMatch_ string 6638 ctx_ context.Context 6639 header_ http.Header 6640 } 6641 6642 // List: Lists all admin overrides on this limit. 6643 // 6644 // - parent: The resource name of the parent quota limit, returned by a 6645 // ListConsumerQuotaMetrics or GetConsumerQuotaMetric call. An example name 6646 // would be: 6647 // `projects/123/services/compute.googleapis.com/consumerQuotaMetrics/compute. 6648 // googleapis.com%2Fcpus/limits/%2Fproject%2Fregion`. 6649 func (r *ServicesConsumerQuotaMetricsLimitsAdminOverridesService) List(parent string) *ServicesConsumerQuotaMetricsLimitsAdminOverridesListCall { 6650 c := &ServicesConsumerQuotaMetricsLimitsAdminOverridesListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 6651 c.parent = parent 6652 return c 6653 } 6654 6655 // PageSize sets the optional parameter "pageSize": Requested size of the next 6656 // page of data. 6657 func (c *ServicesConsumerQuotaMetricsLimitsAdminOverridesListCall) PageSize(pageSize int64) *ServicesConsumerQuotaMetricsLimitsAdminOverridesListCall { 6658 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) 6659 return c 6660 } 6661 6662 // PageToken sets the optional parameter "pageToken": Token identifying which 6663 // result to start with; returned by a previous list call. 6664 func (c *ServicesConsumerQuotaMetricsLimitsAdminOverridesListCall) PageToken(pageToken string) *ServicesConsumerQuotaMetricsLimitsAdminOverridesListCall { 6665 c.urlParams_.Set("pageToken", pageToken) 6666 return c 6667 } 6668 6669 // Fields allows partial responses to be retrieved. See 6670 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 6671 // details. 6672 func (c *ServicesConsumerQuotaMetricsLimitsAdminOverridesListCall) Fields(s ...googleapi.Field) *ServicesConsumerQuotaMetricsLimitsAdminOverridesListCall { 6673 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 6674 return c 6675 } 6676 6677 // IfNoneMatch sets an optional parameter which makes the operation fail if the 6678 // object's ETag matches the given value. This is useful for getting updates 6679 // only after the object has changed since the last request. 6680 func (c *ServicesConsumerQuotaMetricsLimitsAdminOverridesListCall) IfNoneMatch(entityTag string) *ServicesConsumerQuotaMetricsLimitsAdminOverridesListCall { 6681 c.ifNoneMatch_ = entityTag 6682 return c 6683 } 6684 6685 // Context sets the context to be used in this call's Do method. 6686 func (c *ServicesConsumerQuotaMetricsLimitsAdminOverridesListCall) Context(ctx context.Context) *ServicesConsumerQuotaMetricsLimitsAdminOverridesListCall { 6687 c.ctx_ = ctx 6688 return c 6689 } 6690 6691 // Header returns a http.Header that can be modified by the caller to add 6692 // headers to the request. 6693 func (c *ServicesConsumerQuotaMetricsLimitsAdminOverridesListCall) Header() http.Header { 6694 if c.header_ == nil { 6695 c.header_ = make(http.Header) 6696 } 6697 return c.header_ 6698 } 6699 6700 func (c *ServicesConsumerQuotaMetricsLimitsAdminOverridesListCall) doRequest(alt string) (*http.Response, error) { 6701 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) 6702 if c.ifNoneMatch_ != "" { 6703 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 6704 } 6705 var body io.Reader = nil 6706 c.urlParams_.Set("alt", alt) 6707 c.urlParams_.Set("prettyPrint", "false") 6708 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/adminOverrides") 6709 urls += "?" + c.urlParams_.Encode() 6710 req, err := http.NewRequest("GET", urls, body) 6711 if err != nil { 6712 return nil, err 6713 } 6714 req.Header = reqHeaders 6715 googleapi.Expand(req.URL, map[string]string{ 6716 "parent": c.parent, 6717 }) 6718 return gensupport.SendRequest(c.ctx_, c.s.client, req) 6719 } 6720 6721 // Do executes the "serviceusage.services.consumerQuotaMetrics.limits.adminOverrides.list" call. 6722 // Any non-2xx status code is an error. Response headers are in either 6723 // *ListAdminOverridesResponse.ServerResponse.Header or (if a response was 6724 // returned at all) in error.(*googleapi.Error).Header. Use 6725 // googleapi.IsNotModified to check whether the returned error was because 6726 // http.StatusNotModified was returned. 6727 func (c *ServicesConsumerQuotaMetricsLimitsAdminOverridesListCall) Do(opts ...googleapi.CallOption) (*ListAdminOverridesResponse, error) { 6728 gensupport.SetOptions(c.urlParams_, opts...) 6729 res, err := c.doRequest("json") 6730 if res != nil && res.StatusCode == http.StatusNotModified { 6731 if res.Body != nil { 6732 res.Body.Close() 6733 } 6734 return nil, gensupport.WrapError(&googleapi.Error{ 6735 Code: res.StatusCode, 6736 Header: res.Header, 6737 }) 6738 } 6739 if err != nil { 6740 return nil, err 6741 } 6742 defer googleapi.CloseBody(res) 6743 if err := googleapi.CheckResponse(res); err != nil { 6744 return nil, gensupport.WrapError(err) 6745 } 6746 ret := &ListAdminOverridesResponse{ 6747 ServerResponse: googleapi.ServerResponse{ 6748 Header: res.Header, 6749 HTTPStatusCode: res.StatusCode, 6750 }, 6751 } 6752 target := &ret 6753 if err := gensupport.DecodeResponse(target, res); err != nil { 6754 return nil, err 6755 } 6756 return ret, nil 6757 } 6758 6759 // Pages invokes f for each page of results. 6760 // A non-nil error returned from f will halt the iteration. 6761 // The provided context supersedes any context provided to the Context method. 6762 func (c *ServicesConsumerQuotaMetricsLimitsAdminOverridesListCall) Pages(ctx context.Context, f func(*ListAdminOverridesResponse) error) error { 6763 c.ctx_ = ctx 6764 defer c.PageToken(c.urlParams_.Get("pageToken")) 6765 for { 6766 x, err := c.Do() 6767 if err != nil { 6768 return err 6769 } 6770 if err := f(x); err != nil { 6771 return err 6772 } 6773 if x.NextPageToken == "" { 6774 return nil 6775 } 6776 c.PageToken(x.NextPageToken) 6777 } 6778 } 6779 6780 type ServicesConsumerQuotaMetricsLimitsAdminOverridesPatchCall struct { 6781 s *APIService 6782 name string 6783 quotaoverride *QuotaOverride 6784 urlParams_ gensupport.URLParams 6785 ctx_ context.Context 6786 header_ http.Header 6787 } 6788 6789 // Patch: Updates an admin override. 6790 // 6791 // - name: The resource name of the override to update. An example name would 6792 // be: 6793 // `projects/123/services/compute.googleapis.com/consumerQuotaMetrics/compute. 6794 // googleapis.com%2Fcpus/limits/%2Fproject%2Fregion/adminOverrides/4a3f2c1d`. 6795 func (r *ServicesConsumerQuotaMetricsLimitsAdminOverridesService) Patch(name string, quotaoverride *QuotaOverride) *ServicesConsumerQuotaMetricsLimitsAdminOverridesPatchCall { 6796 c := &ServicesConsumerQuotaMetricsLimitsAdminOverridesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} 6797 c.name = name 6798 c.quotaoverride = quotaoverride 6799 return c 6800 } 6801 6802 // Force sets the optional parameter "force": Whether to force the update of 6803 // the quota override. Setting the force parameter to 'true' ignores all quota 6804 // safety checks that would fail the request. QuotaSafetyCheck lists all such 6805 // validations. If force is set to true, it is recommended to include a case id 6806 // in "X-Goog-Request-Reason" header when sending the request. 6807 func (c *ServicesConsumerQuotaMetricsLimitsAdminOverridesPatchCall) Force(force bool) *ServicesConsumerQuotaMetricsLimitsAdminOverridesPatchCall { 6808 c.urlParams_.Set("force", fmt.Sprint(force)) 6809 return c 6810 } 6811 6812 // ForceOnly sets the optional parameter "forceOnly": The list of quota safety 6813 // checks to ignore before the override mutation. Unlike 'force' field that 6814 // ignores all the quota safety checks, the 'force_only' field ignores only the 6815 // specified checks; other checks are still enforced. The 'force' and 6816 // 'force_only' fields cannot both be set. If force_only is specified, it is 6817 // recommended to include a case id in "X-Goog-Request-Reason" header when 6818 // sending the request. 6819 // 6820 // Possible values: 6821 // 6822 // "QUOTA_SAFETY_CHECK_UNSPECIFIED" - Unspecified quota safety check. 6823 // "LIMIT_DECREASE_BELOW_USAGE" - Validates that a quota mutation would not 6824 // 6825 // cause the consumer's effective limit to be lower than the consumer's quota 6826 // usage. 6827 // 6828 // "LIMIT_DECREASE_PERCENTAGE_TOO_HIGH" - Validates that a quota mutation 6829 // 6830 // would not cause the consumer's effective limit to decrease by more than 10 6831 // percent. 6832 func (c *ServicesConsumerQuotaMetricsLimitsAdminOverridesPatchCall) ForceOnly(forceOnly ...string) *ServicesConsumerQuotaMetricsLimitsAdminOverridesPatchCall { 6833 c.urlParams_.SetMulti("forceOnly", append([]string{}, forceOnly...)) 6834 return c 6835 } 6836 6837 // UpdateMask sets the optional parameter "updateMask": Update only the 6838 // specified fields of the override. If unset, all fields will be updated. 6839 func (c *ServicesConsumerQuotaMetricsLimitsAdminOverridesPatchCall) UpdateMask(updateMask string) *ServicesConsumerQuotaMetricsLimitsAdminOverridesPatchCall { 6840 c.urlParams_.Set("updateMask", updateMask) 6841 return c 6842 } 6843 6844 // Fields allows partial responses to be retrieved. See 6845 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 6846 // details. 6847 func (c *ServicesConsumerQuotaMetricsLimitsAdminOverridesPatchCall) Fields(s ...googleapi.Field) *ServicesConsumerQuotaMetricsLimitsAdminOverridesPatchCall { 6848 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 6849 return c 6850 } 6851 6852 // Context sets the context to be used in this call's Do method. 6853 func (c *ServicesConsumerQuotaMetricsLimitsAdminOverridesPatchCall) Context(ctx context.Context) *ServicesConsumerQuotaMetricsLimitsAdminOverridesPatchCall { 6854 c.ctx_ = ctx 6855 return c 6856 } 6857 6858 // Header returns a http.Header that can be modified by the caller to add 6859 // headers to the request. 6860 func (c *ServicesConsumerQuotaMetricsLimitsAdminOverridesPatchCall) Header() http.Header { 6861 if c.header_ == nil { 6862 c.header_ = make(http.Header) 6863 } 6864 return c.header_ 6865 } 6866 6867 func (c *ServicesConsumerQuotaMetricsLimitsAdminOverridesPatchCall) doRequest(alt string) (*http.Response, error) { 6868 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) 6869 var body io.Reader = nil 6870 body, err := googleapi.WithoutDataWrapper.JSONReader(c.quotaoverride) 6871 if err != nil { 6872 return nil, err 6873 } 6874 c.urlParams_.Set("alt", alt) 6875 c.urlParams_.Set("prettyPrint", "false") 6876 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") 6877 urls += "?" + c.urlParams_.Encode() 6878 req, err := http.NewRequest("PATCH", urls, body) 6879 if err != nil { 6880 return nil, err 6881 } 6882 req.Header = reqHeaders 6883 googleapi.Expand(req.URL, map[string]string{ 6884 "name": c.name, 6885 }) 6886 return gensupport.SendRequest(c.ctx_, c.s.client, req) 6887 } 6888 6889 // Do executes the "serviceusage.services.consumerQuotaMetrics.limits.adminOverrides.patch" call. 6890 // Any non-2xx status code is an error. Response headers are in either 6891 // *Operation.ServerResponse.Header or (if a response was returned at all) in 6892 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 6893 // whether the returned error was because http.StatusNotModified was returned. 6894 func (c *ServicesConsumerQuotaMetricsLimitsAdminOverridesPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 6895 gensupport.SetOptions(c.urlParams_, opts...) 6896 res, err := c.doRequest("json") 6897 if res != nil && res.StatusCode == http.StatusNotModified { 6898 if res.Body != nil { 6899 res.Body.Close() 6900 } 6901 return nil, gensupport.WrapError(&googleapi.Error{ 6902 Code: res.StatusCode, 6903 Header: res.Header, 6904 }) 6905 } 6906 if err != nil { 6907 return nil, err 6908 } 6909 defer googleapi.CloseBody(res) 6910 if err := googleapi.CheckResponse(res); err != nil { 6911 return nil, gensupport.WrapError(err) 6912 } 6913 ret := &Operation{ 6914 ServerResponse: googleapi.ServerResponse{ 6915 Header: res.Header, 6916 HTTPStatusCode: res.StatusCode, 6917 }, 6918 } 6919 target := &ret 6920 if err := gensupport.DecodeResponse(target, res); err != nil { 6921 return nil, err 6922 } 6923 return ret, nil 6924 } 6925 6926 type ServicesConsumerQuotaMetricsLimitsConsumerOverridesCreateCall struct { 6927 s *APIService 6928 parent string 6929 quotaoverride *QuotaOverride 6930 urlParams_ gensupport.URLParams 6931 ctx_ context.Context 6932 header_ http.Header 6933 } 6934 6935 // Create: Creates a consumer override. A consumer override is applied to the 6936 // consumer on its own authority to limit its own quota usage. Consumer 6937 // overrides cannot be used to grant more quota than would be allowed by admin 6938 // overrides, producer overrides, or the default limit of the service. 6939 // 6940 // - parent: The resource name of the parent quota limit, returned by a 6941 // ListConsumerQuotaMetrics or GetConsumerQuotaMetric call. An example name 6942 // would be: 6943 // `projects/123/services/compute.googleapis.com/consumerQuotaMetrics/compute. 6944 // googleapis.com%2Fcpus/limits/%2Fproject%2Fregion`. 6945 func (r *ServicesConsumerQuotaMetricsLimitsConsumerOverridesService) Create(parent string, quotaoverride *QuotaOverride) *ServicesConsumerQuotaMetricsLimitsConsumerOverridesCreateCall { 6946 c := &ServicesConsumerQuotaMetricsLimitsConsumerOverridesCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 6947 c.parent = parent 6948 c.quotaoverride = quotaoverride 6949 return c 6950 } 6951 6952 // Force sets the optional parameter "force": Whether to force the creation of 6953 // the quota override. Setting the force parameter to 'true' ignores all quota 6954 // safety checks that would fail the request. QuotaSafetyCheck lists all such 6955 // validations. If force is set to true, it is recommended to include a case id 6956 // in "X-Goog-Request-Reason" header when sending the request. 6957 func (c *ServicesConsumerQuotaMetricsLimitsConsumerOverridesCreateCall) Force(force bool) *ServicesConsumerQuotaMetricsLimitsConsumerOverridesCreateCall { 6958 c.urlParams_.Set("force", fmt.Sprint(force)) 6959 return c 6960 } 6961 6962 // ForceOnly sets the optional parameter "forceOnly": The list of quota safety 6963 // checks to ignore before the override mutation. Unlike 'force' field that 6964 // ignores all the quota safety checks, the 'force_only' field ignores only the 6965 // specified checks; other checks are still enforced. The 'force' and 6966 // 'force_only' fields cannot both be set. If force_only is specified, it is 6967 // recommended to include a case id in "X-Goog-Request-Reason" header when 6968 // sending the request. 6969 // 6970 // Possible values: 6971 // 6972 // "QUOTA_SAFETY_CHECK_UNSPECIFIED" - Unspecified quota safety check. 6973 // "LIMIT_DECREASE_BELOW_USAGE" - Validates that a quota mutation would not 6974 // 6975 // cause the consumer's effective limit to be lower than the consumer's quota 6976 // usage. 6977 // 6978 // "LIMIT_DECREASE_PERCENTAGE_TOO_HIGH" - Validates that a quota mutation 6979 // 6980 // would not cause the consumer's effective limit to decrease by more than 10 6981 // percent. 6982 func (c *ServicesConsumerQuotaMetricsLimitsConsumerOverridesCreateCall) ForceOnly(forceOnly ...string) *ServicesConsumerQuotaMetricsLimitsConsumerOverridesCreateCall { 6983 c.urlParams_.SetMulti("forceOnly", append([]string{}, forceOnly...)) 6984 return c 6985 } 6986 6987 // Fields allows partial responses to be retrieved. See 6988 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 6989 // details. 6990 func (c *ServicesConsumerQuotaMetricsLimitsConsumerOverridesCreateCall) Fields(s ...googleapi.Field) *ServicesConsumerQuotaMetricsLimitsConsumerOverridesCreateCall { 6991 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 6992 return c 6993 } 6994 6995 // Context sets the context to be used in this call's Do method. 6996 func (c *ServicesConsumerQuotaMetricsLimitsConsumerOverridesCreateCall) Context(ctx context.Context) *ServicesConsumerQuotaMetricsLimitsConsumerOverridesCreateCall { 6997 c.ctx_ = ctx 6998 return c 6999 } 7000 7001 // Header returns a http.Header that can be modified by the caller to add 7002 // headers to the request. 7003 func (c *ServicesConsumerQuotaMetricsLimitsConsumerOverridesCreateCall) Header() http.Header { 7004 if c.header_ == nil { 7005 c.header_ = make(http.Header) 7006 } 7007 return c.header_ 7008 } 7009 7010 func (c *ServicesConsumerQuotaMetricsLimitsConsumerOverridesCreateCall) doRequest(alt string) (*http.Response, error) { 7011 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) 7012 var body io.Reader = nil 7013 body, err := googleapi.WithoutDataWrapper.JSONReader(c.quotaoverride) 7014 if err != nil { 7015 return nil, err 7016 } 7017 c.urlParams_.Set("alt", alt) 7018 c.urlParams_.Set("prettyPrint", "false") 7019 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/consumerOverrides") 7020 urls += "?" + c.urlParams_.Encode() 7021 req, err := http.NewRequest("POST", urls, body) 7022 if err != nil { 7023 return nil, err 7024 } 7025 req.Header = reqHeaders 7026 googleapi.Expand(req.URL, map[string]string{ 7027 "parent": c.parent, 7028 }) 7029 return gensupport.SendRequest(c.ctx_, c.s.client, req) 7030 } 7031 7032 // Do executes the "serviceusage.services.consumerQuotaMetrics.limits.consumerOverrides.create" call. 7033 // Any non-2xx status code is an error. Response headers are in either 7034 // *Operation.ServerResponse.Header or (if a response was returned at all) in 7035 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 7036 // whether the returned error was because http.StatusNotModified was returned. 7037 func (c *ServicesConsumerQuotaMetricsLimitsConsumerOverridesCreateCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 7038 gensupport.SetOptions(c.urlParams_, opts...) 7039 res, err := c.doRequest("json") 7040 if res != nil && res.StatusCode == http.StatusNotModified { 7041 if res.Body != nil { 7042 res.Body.Close() 7043 } 7044 return nil, gensupport.WrapError(&googleapi.Error{ 7045 Code: res.StatusCode, 7046 Header: res.Header, 7047 }) 7048 } 7049 if err != nil { 7050 return nil, err 7051 } 7052 defer googleapi.CloseBody(res) 7053 if err := googleapi.CheckResponse(res); err != nil { 7054 return nil, gensupport.WrapError(err) 7055 } 7056 ret := &Operation{ 7057 ServerResponse: googleapi.ServerResponse{ 7058 Header: res.Header, 7059 HTTPStatusCode: res.StatusCode, 7060 }, 7061 } 7062 target := &ret 7063 if err := gensupport.DecodeResponse(target, res); err != nil { 7064 return nil, err 7065 } 7066 return ret, nil 7067 } 7068 7069 type ServicesConsumerQuotaMetricsLimitsConsumerOverridesDeleteCall struct { 7070 s *APIService 7071 name string 7072 urlParams_ gensupport.URLParams 7073 ctx_ context.Context 7074 header_ http.Header 7075 } 7076 7077 // Delete: Deletes a consumer override. 7078 // 7079 // - name: The resource name of the override to delete. An example name would 7080 // be: 7081 // `projects/123/services/compute.googleapis.com/consumerQuotaMetrics/compute. 7082 // googleapis.com%2Fcpus/limits/%2Fproject%2Fregion/consumerOverrides/4a3f2c1d 7083 // `. 7084 func (r *ServicesConsumerQuotaMetricsLimitsConsumerOverridesService) Delete(name string) *ServicesConsumerQuotaMetricsLimitsConsumerOverridesDeleteCall { 7085 c := &ServicesConsumerQuotaMetricsLimitsConsumerOverridesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} 7086 c.name = name 7087 return c 7088 } 7089 7090 // Force sets the optional parameter "force": Whether to force the deletion of 7091 // the quota override. Setting the force parameter to 'true' ignores all quota 7092 // safety checks that would fail the request. QuotaSafetyCheck lists all such 7093 // validations. If force is set to true, it is recommended to include a case id 7094 // in "X-Goog-Request-Reason" header when sending the request. 7095 func (c *ServicesConsumerQuotaMetricsLimitsConsumerOverridesDeleteCall) Force(force bool) *ServicesConsumerQuotaMetricsLimitsConsumerOverridesDeleteCall { 7096 c.urlParams_.Set("force", fmt.Sprint(force)) 7097 return c 7098 } 7099 7100 // ForceOnly sets the optional parameter "forceOnly": The list of quota safety 7101 // checks to ignore before the override mutation. Unlike 'force' field that 7102 // ignores all the quota safety checks, the 'force_only' field ignores only the 7103 // specified checks; other checks are still enforced. The 'force' and 7104 // 'force_only' fields cannot both be set. If force_only is specified, it is 7105 // recommended to include a case id in "X-Goog-Request-Reason" header when 7106 // sending the request. 7107 // 7108 // Possible values: 7109 // 7110 // "QUOTA_SAFETY_CHECK_UNSPECIFIED" - Unspecified quota safety check. 7111 // "LIMIT_DECREASE_BELOW_USAGE" - Validates that a quota mutation would not 7112 // 7113 // cause the consumer's effective limit to be lower than the consumer's quota 7114 // usage. 7115 // 7116 // "LIMIT_DECREASE_PERCENTAGE_TOO_HIGH" - Validates that a quota mutation 7117 // 7118 // would not cause the consumer's effective limit to decrease by more than 10 7119 // percent. 7120 func (c *ServicesConsumerQuotaMetricsLimitsConsumerOverridesDeleteCall) ForceOnly(forceOnly ...string) *ServicesConsumerQuotaMetricsLimitsConsumerOverridesDeleteCall { 7121 c.urlParams_.SetMulti("forceOnly", append([]string{}, forceOnly...)) 7122 return c 7123 } 7124 7125 // Fields allows partial responses to be retrieved. See 7126 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 7127 // details. 7128 func (c *ServicesConsumerQuotaMetricsLimitsConsumerOverridesDeleteCall) Fields(s ...googleapi.Field) *ServicesConsumerQuotaMetricsLimitsConsumerOverridesDeleteCall { 7129 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 7130 return c 7131 } 7132 7133 // Context sets the context to be used in this call's Do method. 7134 func (c *ServicesConsumerQuotaMetricsLimitsConsumerOverridesDeleteCall) Context(ctx context.Context) *ServicesConsumerQuotaMetricsLimitsConsumerOverridesDeleteCall { 7135 c.ctx_ = ctx 7136 return c 7137 } 7138 7139 // Header returns a http.Header that can be modified by the caller to add 7140 // headers to the request. 7141 func (c *ServicesConsumerQuotaMetricsLimitsConsumerOverridesDeleteCall) Header() http.Header { 7142 if c.header_ == nil { 7143 c.header_ = make(http.Header) 7144 } 7145 return c.header_ 7146 } 7147 7148 func (c *ServicesConsumerQuotaMetricsLimitsConsumerOverridesDeleteCall) doRequest(alt string) (*http.Response, error) { 7149 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) 7150 var body io.Reader = nil 7151 c.urlParams_.Set("alt", alt) 7152 c.urlParams_.Set("prettyPrint", "false") 7153 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") 7154 urls += "?" + c.urlParams_.Encode() 7155 req, err := http.NewRequest("DELETE", urls, body) 7156 if err != nil { 7157 return nil, err 7158 } 7159 req.Header = reqHeaders 7160 googleapi.Expand(req.URL, map[string]string{ 7161 "name": c.name, 7162 }) 7163 return gensupport.SendRequest(c.ctx_, c.s.client, req) 7164 } 7165 7166 // Do executes the "serviceusage.services.consumerQuotaMetrics.limits.consumerOverrides.delete" call. 7167 // Any non-2xx status code is an error. Response headers are in either 7168 // *Operation.ServerResponse.Header or (if a response was returned at all) in 7169 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 7170 // whether the returned error was because http.StatusNotModified was returned. 7171 func (c *ServicesConsumerQuotaMetricsLimitsConsumerOverridesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 7172 gensupport.SetOptions(c.urlParams_, opts...) 7173 res, err := c.doRequest("json") 7174 if res != nil && res.StatusCode == http.StatusNotModified { 7175 if res.Body != nil { 7176 res.Body.Close() 7177 } 7178 return nil, gensupport.WrapError(&googleapi.Error{ 7179 Code: res.StatusCode, 7180 Header: res.Header, 7181 }) 7182 } 7183 if err != nil { 7184 return nil, err 7185 } 7186 defer googleapi.CloseBody(res) 7187 if err := googleapi.CheckResponse(res); err != nil { 7188 return nil, gensupport.WrapError(err) 7189 } 7190 ret := &Operation{ 7191 ServerResponse: googleapi.ServerResponse{ 7192 Header: res.Header, 7193 HTTPStatusCode: res.StatusCode, 7194 }, 7195 } 7196 target := &ret 7197 if err := gensupport.DecodeResponse(target, res); err != nil { 7198 return nil, err 7199 } 7200 return ret, nil 7201 } 7202 7203 type ServicesConsumerQuotaMetricsLimitsConsumerOverridesListCall struct { 7204 s *APIService 7205 parent string 7206 urlParams_ gensupport.URLParams 7207 ifNoneMatch_ string 7208 ctx_ context.Context 7209 header_ http.Header 7210 } 7211 7212 // List: Lists all consumer overrides on this limit. 7213 // 7214 // - parent: The resource name of the parent quota limit, returned by a 7215 // ListConsumerQuotaMetrics or GetConsumerQuotaMetric call. An example name 7216 // would be: 7217 // `projects/123/services/compute.googleapis.com/consumerQuotaMetrics/compute. 7218 // googleapis.com%2Fcpus/limits/%2Fproject%2Fregion`. 7219 func (r *ServicesConsumerQuotaMetricsLimitsConsumerOverridesService) List(parent string) *ServicesConsumerQuotaMetricsLimitsConsumerOverridesListCall { 7220 c := &ServicesConsumerQuotaMetricsLimitsConsumerOverridesListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 7221 c.parent = parent 7222 return c 7223 } 7224 7225 // PageSize sets the optional parameter "pageSize": Requested size of the next 7226 // page of data. 7227 func (c *ServicesConsumerQuotaMetricsLimitsConsumerOverridesListCall) PageSize(pageSize int64) *ServicesConsumerQuotaMetricsLimitsConsumerOverridesListCall { 7228 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) 7229 return c 7230 } 7231 7232 // PageToken sets the optional parameter "pageToken": Token identifying which 7233 // result to start with; returned by a previous list call. 7234 func (c *ServicesConsumerQuotaMetricsLimitsConsumerOverridesListCall) PageToken(pageToken string) *ServicesConsumerQuotaMetricsLimitsConsumerOverridesListCall { 7235 c.urlParams_.Set("pageToken", pageToken) 7236 return c 7237 } 7238 7239 // Fields allows partial responses to be retrieved. See 7240 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 7241 // details. 7242 func (c *ServicesConsumerQuotaMetricsLimitsConsumerOverridesListCall) Fields(s ...googleapi.Field) *ServicesConsumerQuotaMetricsLimitsConsumerOverridesListCall { 7243 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 7244 return c 7245 } 7246 7247 // IfNoneMatch sets an optional parameter which makes the operation fail if the 7248 // object's ETag matches the given value. This is useful for getting updates 7249 // only after the object has changed since the last request. 7250 func (c *ServicesConsumerQuotaMetricsLimitsConsumerOverridesListCall) IfNoneMatch(entityTag string) *ServicesConsumerQuotaMetricsLimitsConsumerOverridesListCall { 7251 c.ifNoneMatch_ = entityTag 7252 return c 7253 } 7254 7255 // Context sets the context to be used in this call's Do method. 7256 func (c *ServicesConsumerQuotaMetricsLimitsConsumerOverridesListCall) Context(ctx context.Context) *ServicesConsumerQuotaMetricsLimitsConsumerOverridesListCall { 7257 c.ctx_ = ctx 7258 return c 7259 } 7260 7261 // Header returns a http.Header that can be modified by the caller to add 7262 // headers to the request. 7263 func (c *ServicesConsumerQuotaMetricsLimitsConsumerOverridesListCall) Header() http.Header { 7264 if c.header_ == nil { 7265 c.header_ = make(http.Header) 7266 } 7267 return c.header_ 7268 } 7269 7270 func (c *ServicesConsumerQuotaMetricsLimitsConsumerOverridesListCall) doRequest(alt string) (*http.Response, error) { 7271 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) 7272 if c.ifNoneMatch_ != "" { 7273 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 7274 } 7275 var body io.Reader = nil 7276 c.urlParams_.Set("alt", alt) 7277 c.urlParams_.Set("prettyPrint", "false") 7278 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/consumerOverrides") 7279 urls += "?" + c.urlParams_.Encode() 7280 req, err := http.NewRequest("GET", urls, body) 7281 if err != nil { 7282 return nil, err 7283 } 7284 req.Header = reqHeaders 7285 googleapi.Expand(req.URL, map[string]string{ 7286 "parent": c.parent, 7287 }) 7288 return gensupport.SendRequest(c.ctx_, c.s.client, req) 7289 } 7290 7291 // Do executes the "serviceusage.services.consumerQuotaMetrics.limits.consumerOverrides.list" call. 7292 // Any non-2xx status code is an error. Response headers are in either 7293 // *ListConsumerOverridesResponse.ServerResponse.Header or (if a response was 7294 // returned at all) in error.(*googleapi.Error).Header. Use 7295 // googleapi.IsNotModified to check whether the returned error was because 7296 // http.StatusNotModified was returned. 7297 func (c *ServicesConsumerQuotaMetricsLimitsConsumerOverridesListCall) Do(opts ...googleapi.CallOption) (*ListConsumerOverridesResponse, error) { 7298 gensupport.SetOptions(c.urlParams_, opts...) 7299 res, err := c.doRequest("json") 7300 if res != nil && res.StatusCode == http.StatusNotModified { 7301 if res.Body != nil { 7302 res.Body.Close() 7303 } 7304 return nil, gensupport.WrapError(&googleapi.Error{ 7305 Code: res.StatusCode, 7306 Header: res.Header, 7307 }) 7308 } 7309 if err != nil { 7310 return nil, err 7311 } 7312 defer googleapi.CloseBody(res) 7313 if err := googleapi.CheckResponse(res); err != nil { 7314 return nil, gensupport.WrapError(err) 7315 } 7316 ret := &ListConsumerOverridesResponse{ 7317 ServerResponse: googleapi.ServerResponse{ 7318 Header: res.Header, 7319 HTTPStatusCode: res.StatusCode, 7320 }, 7321 } 7322 target := &ret 7323 if err := gensupport.DecodeResponse(target, res); err != nil { 7324 return nil, err 7325 } 7326 return ret, nil 7327 } 7328 7329 // Pages invokes f for each page of results. 7330 // A non-nil error returned from f will halt the iteration. 7331 // The provided context supersedes any context provided to the Context method. 7332 func (c *ServicesConsumerQuotaMetricsLimitsConsumerOverridesListCall) Pages(ctx context.Context, f func(*ListConsumerOverridesResponse) error) error { 7333 c.ctx_ = ctx 7334 defer c.PageToken(c.urlParams_.Get("pageToken")) 7335 for { 7336 x, err := c.Do() 7337 if err != nil { 7338 return err 7339 } 7340 if err := f(x); err != nil { 7341 return err 7342 } 7343 if x.NextPageToken == "" { 7344 return nil 7345 } 7346 c.PageToken(x.NextPageToken) 7347 } 7348 } 7349 7350 type ServicesConsumerQuotaMetricsLimitsConsumerOverridesPatchCall struct { 7351 s *APIService 7352 name string 7353 quotaoverride *QuotaOverride 7354 urlParams_ gensupport.URLParams 7355 ctx_ context.Context 7356 header_ http.Header 7357 } 7358 7359 // Patch: Updates a consumer override. 7360 // 7361 // - name: The resource name of the override to update. An example name would 7362 // be: 7363 // `projects/123/services/compute.googleapis.com/consumerQuotaMetrics/compute. 7364 // googleapis.com%2Fcpus/limits/%2Fproject%2Fregion/consumerOverrides/4a3f2c1d 7365 // `. 7366 func (r *ServicesConsumerQuotaMetricsLimitsConsumerOverridesService) Patch(name string, quotaoverride *QuotaOverride) *ServicesConsumerQuotaMetricsLimitsConsumerOverridesPatchCall { 7367 c := &ServicesConsumerQuotaMetricsLimitsConsumerOverridesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} 7368 c.name = name 7369 c.quotaoverride = quotaoverride 7370 return c 7371 } 7372 7373 // Force sets the optional parameter "force": Whether to force the update of 7374 // the quota override. Setting the force parameter to 'true' ignores all quota 7375 // safety checks that would fail the request. QuotaSafetyCheck lists all such 7376 // validations. If force is set to true, it is recommended to include a case id 7377 // in "X-Goog-Request-Reason" header when sending the request. 7378 func (c *ServicesConsumerQuotaMetricsLimitsConsumerOverridesPatchCall) Force(force bool) *ServicesConsumerQuotaMetricsLimitsConsumerOverridesPatchCall { 7379 c.urlParams_.Set("force", fmt.Sprint(force)) 7380 return c 7381 } 7382 7383 // ForceOnly sets the optional parameter "forceOnly": The list of quota safety 7384 // checks to ignore before the override mutation. Unlike 'force' field that 7385 // ignores all the quota safety checks, the 'force_only' field ignores only the 7386 // specified checks; other checks are still enforced. The 'force' and 7387 // 'force_only' fields cannot both be set. If force_only is specified, it is 7388 // recommended to include a case id in "X-Goog-Request-Reason" header when 7389 // sending the request. 7390 // 7391 // Possible values: 7392 // 7393 // "QUOTA_SAFETY_CHECK_UNSPECIFIED" - Unspecified quota safety check. 7394 // "LIMIT_DECREASE_BELOW_USAGE" - Validates that a quota mutation would not 7395 // 7396 // cause the consumer's effective limit to be lower than the consumer's quota 7397 // usage. 7398 // 7399 // "LIMIT_DECREASE_PERCENTAGE_TOO_HIGH" - Validates that a quota mutation 7400 // 7401 // would not cause the consumer's effective limit to decrease by more than 10 7402 // percent. 7403 func (c *ServicesConsumerQuotaMetricsLimitsConsumerOverridesPatchCall) ForceOnly(forceOnly ...string) *ServicesConsumerQuotaMetricsLimitsConsumerOverridesPatchCall { 7404 c.urlParams_.SetMulti("forceOnly", append([]string{}, forceOnly...)) 7405 return c 7406 } 7407 7408 // UpdateMask sets the optional parameter "updateMask": Update only the 7409 // specified fields of the override. If unset, all fields will be updated. 7410 func (c *ServicesConsumerQuotaMetricsLimitsConsumerOverridesPatchCall) UpdateMask(updateMask string) *ServicesConsumerQuotaMetricsLimitsConsumerOverridesPatchCall { 7411 c.urlParams_.Set("updateMask", updateMask) 7412 return c 7413 } 7414 7415 // Fields allows partial responses to be retrieved. See 7416 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 7417 // details. 7418 func (c *ServicesConsumerQuotaMetricsLimitsConsumerOverridesPatchCall) Fields(s ...googleapi.Field) *ServicesConsumerQuotaMetricsLimitsConsumerOverridesPatchCall { 7419 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 7420 return c 7421 } 7422 7423 // Context sets the context to be used in this call's Do method. 7424 func (c *ServicesConsumerQuotaMetricsLimitsConsumerOverridesPatchCall) Context(ctx context.Context) *ServicesConsumerQuotaMetricsLimitsConsumerOverridesPatchCall { 7425 c.ctx_ = ctx 7426 return c 7427 } 7428 7429 // Header returns a http.Header that can be modified by the caller to add 7430 // headers to the request. 7431 func (c *ServicesConsumerQuotaMetricsLimitsConsumerOverridesPatchCall) Header() http.Header { 7432 if c.header_ == nil { 7433 c.header_ = make(http.Header) 7434 } 7435 return c.header_ 7436 } 7437 7438 func (c *ServicesConsumerQuotaMetricsLimitsConsumerOverridesPatchCall) doRequest(alt string) (*http.Response, error) { 7439 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) 7440 var body io.Reader = nil 7441 body, err := googleapi.WithoutDataWrapper.JSONReader(c.quotaoverride) 7442 if err != nil { 7443 return nil, err 7444 } 7445 c.urlParams_.Set("alt", alt) 7446 c.urlParams_.Set("prettyPrint", "false") 7447 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") 7448 urls += "?" + c.urlParams_.Encode() 7449 req, err := http.NewRequest("PATCH", urls, body) 7450 if err != nil { 7451 return nil, err 7452 } 7453 req.Header = reqHeaders 7454 googleapi.Expand(req.URL, map[string]string{ 7455 "name": c.name, 7456 }) 7457 return gensupport.SendRequest(c.ctx_, c.s.client, req) 7458 } 7459 7460 // Do executes the "serviceusage.services.consumerQuotaMetrics.limits.consumerOverrides.patch" call. 7461 // Any non-2xx status code is an error. Response headers are in either 7462 // *Operation.ServerResponse.Header or (if a response was returned at all) in 7463 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 7464 // whether the returned error was because http.StatusNotModified was returned. 7465 func (c *ServicesConsumerQuotaMetricsLimitsConsumerOverridesPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 7466 gensupport.SetOptions(c.urlParams_, opts...) 7467 res, err := c.doRequest("json") 7468 if res != nil && res.StatusCode == http.StatusNotModified { 7469 if res.Body != nil { 7470 res.Body.Close() 7471 } 7472 return nil, gensupport.WrapError(&googleapi.Error{ 7473 Code: res.StatusCode, 7474 Header: res.Header, 7475 }) 7476 } 7477 if err != nil { 7478 return nil, err 7479 } 7480 defer googleapi.CloseBody(res) 7481 if err := googleapi.CheckResponse(res); err != nil { 7482 return nil, gensupport.WrapError(err) 7483 } 7484 ret := &Operation{ 7485 ServerResponse: googleapi.ServerResponse{ 7486 Header: res.Header, 7487 HTTPStatusCode: res.StatusCode, 7488 }, 7489 } 7490 target := &ret 7491 if err := gensupport.DecodeResponse(target, res); err != nil { 7492 return nil, err 7493 } 7494 return ret, nil 7495 } 7496