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