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