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