1// Copyright 2019 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 servicecontrol provides access to the Service Control API. 8// 9// For product documentation, see: https://cloud.google.com/service-control/ 10// 11// Creating a client 12// 13// Usage example: 14// 15// import "google.golang.org/api/servicecontrol/v1" 16// ... 17// ctx := context.Background() 18// servicecontrolService, err := servicecontrol.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// servicecontrolService, err := servicecontrol.NewService(ctx, option.WithScopes(servicecontrol.ServicecontrolScope)) 29// 30// To use an API key for authentication (note: some APIs do not support API keys), use option.WithAPIKey: 31// 32// servicecontrolService, err := servicecontrol.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// servicecontrolService, err := servicecontrol.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token))) 40// 41// See https://godoc.org/google.golang.org/api/option/ for details on options. 42package servicecontrol // import "google.golang.org/api/servicecontrol/v1" 43 44import ( 45 "bytes" 46 "context" 47 "encoding/json" 48 "errors" 49 "fmt" 50 "io" 51 "net/http" 52 "net/url" 53 "strconv" 54 "strings" 55 56 googleapi "google.golang.org/api/googleapi" 57 gensupport "google.golang.org/api/internal/gensupport" 58 option "google.golang.org/api/option" 59 htransport "google.golang.org/api/transport/http" 60) 61 62// Always reference these packages, just in case the auto-generated code 63// below doesn't. 64var _ = bytes.NewBuffer 65var _ = strconv.Itoa 66var _ = fmt.Sprintf 67var _ = json.NewDecoder 68var _ = io.Copy 69var _ = url.Parse 70var _ = gensupport.MarshalJSON 71var _ = googleapi.Version 72var _ = errors.New 73var _ = strings.Replace 74var _ = context.Canceled 75 76const apiId = "servicecontrol:v1" 77const apiName = "servicecontrol" 78const apiVersion = "v1" 79const basePath = "https://servicecontrol.googleapis.com/" 80 81// OAuth2 scopes used by this API. 82const ( 83 // View and manage your data across Google Cloud Platform services 84 CloudPlatformScope = "https://www.googleapis.com/auth/cloud-platform" 85 86 // Manage your Google Service Control data 87 ServicecontrolScope = "https://www.googleapis.com/auth/servicecontrol" 88) 89 90// NewService creates a new Service. 91func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, error) { 92 scopesOption := option.WithScopes( 93 "https://www.googleapis.com/auth/cloud-platform", 94 "https://www.googleapis.com/auth/servicecontrol", 95 ) 96 // NOTE: prepend, so we don't override user-specified scopes. 97 opts = append([]option.ClientOption{scopesOption}, opts...) 98 client, endpoint, err := htransport.NewClient(ctx, opts...) 99 if err != nil { 100 return nil, err 101 } 102 s, err := New(client) 103 if err != nil { 104 return nil, err 105 } 106 if endpoint != "" { 107 s.BasePath = endpoint 108 } 109 return s, nil 110} 111 112// New creates a new Service. It uses the provided http.Client for requests. 113// 114// Deprecated: please use NewService instead. 115// To provide a custom HTTP client, use option.WithHTTPClient. 116// If you are using google.golang.org/api/googleapis/transport.APIKey, use option.WithAPIKey with NewService instead. 117func New(client *http.Client) (*Service, error) { 118 if client == nil { 119 return nil, errors.New("client is nil") 120 } 121 s := &Service{client: client, BasePath: basePath} 122 s.Services = NewServicesService(s) 123 return s, nil 124} 125 126type Service struct { 127 client *http.Client 128 BasePath string // API endpoint base URL 129 UserAgent string // optional additional User-Agent fragment 130 131 Services *ServicesService 132} 133 134func (s *Service) userAgent() string { 135 if s.UserAgent == "" { 136 return googleapi.UserAgent 137 } 138 return googleapi.UserAgent + " " + s.UserAgent 139} 140 141func NewServicesService(s *Service) *ServicesService { 142 rs := &ServicesService{s: s} 143 return rs 144} 145 146type ServicesService struct { 147 s *Service 148} 149 150type AllocateInfo struct { 151 // UnusedArguments: A list of label keys that were unused by the server 152 // in processing the 153 // request. Thus, for similar requests repeated in a certain future 154 // time 155 // window, the caller can choose to ignore these labels in the 156 // requests 157 // to achieve better client-side cache hits and quota aggregation for 158 // rate 159 // quota. This field is not populated for allocation quota checks. 160 UnusedArguments []string `json:"unusedArguments,omitempty"` 161 162 // ForceSendFields is a list of field names (e.g. "UnusedArguments") to 163 // unconditionally include in API requests. By default, fields with 164 // empty values are omitted from API requests. However, any non-pointer, 165 // non-interface field appearing in ForceSendFields will be sent to the 166 // server regardless of whether the field is empty or not. This may be 167 // used to include empty fields in Patch requests. 168 ForceSendFields []string `json:"-"` 169 170 // NullFields is a list of field names (e.g. "UnusedArguments") to 171 // include in API requests with the JSON null value. By default, fields 172 // with empty values are omitted from API requests. However, any field 173 // with an empty value appearing in NullFields will be sent to the 174 // server as null. It is an error if a field in this list has a 175 // non-empty value. This may be used to include null fields in Patch 176 // requests. 177 NullFields []string `json:"-"` 178} 179 180func (s *AllocateInfo) MarshalJSON() ([]byte, error) { 181 type NoMethod AllocateInfo 182 raw := NoMethod(*s) 183 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 184} 185 186// AllocateQuotaRequest: Request message for the AllocateQuota method. 187type AllocateQuotaRequest struct { 188 // AllocateOperation: Operation that describes the quota allocation. 189 AllocateOperation *QuotaOperation `json:"allocateOperation,omitempty"` 190 191 // ServiceConfigId: Specifies which version of service configuration 192 // should be used to process 193 // the request. If unspecified or no matching version can be found, the 194 // latest 195 // one will be used. 196 ServiceConfigId string `json:"serviceConfigId,omitempty"` 197 198 // ForceSendFields is a list of field names (e.g. "AllocateOperation") 199 // to unconditionally include in API requests. By default, fields with 200 // empty values are omitted from API requests. However, any non-pointer, 201 // non-interface field appearing in ForceSendFields will be sent to the 202 // server regardless of whether the field is empty or not. This may be 203 // used to include empty fields in Patch requests. 204 ForceSendFields []string `json:"-"` 205 206 // NullFields is a list of field names (e.g. "AllocateOperation") to 207 // include in API requests with the JSON null value. By default, fields 208 // with empty values are omitted from API requests. However, any field 209 // with an empty value appearing in NullFields will be sent to the 210 // server as null. It is an error if a field in this list has a 211 // non-empty value. This may be used to include null fields in Patch 212 // requests. 213 NullFields []string `json:"-"` 214} 215 216func (s *AllocateQuotaRequest) MarshalJSON() ([]byte, error) { 217 type NoMethod AllocateQuotaRequest 218 raw := NoMethod(*s) 219 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 220} 221 222// AllocateQuotaResponse: Response message for the AllocateQuota method. 223type AllocateQuotaResponse struct { 224 // AllocateErrors: Indicates the decision of the allocate. 225 AllocateErrors []*QuotaError `json:"allocateErrors,omitempty"` 226 227 // AllocateInfo: WARNING: DO NOT use this field until this warning 228 // message is removed. 229 AllocateInfo *AllocateInfo `json:"allocateInfo,omitempty"` 230 231 // OperationId: The same operation_id value used in the 232 // AllocateQuotaRequest. Used for 233 // logging and diagnostics purposes. 234 OperationId string `json:"operationId,omitempty"` 235 236 // QuotaMetrics: Quota metrics to indicate the result of allocation. 237 // Depending on the 238 // request, one or more of the following metrics will be included: 239 // 240 // 1. Per quota group or per quota metric incremental usage will be 241 // specified 242 // using the following delta metric : 243 // "serviceruntime.googleapis.com/api/consumer/quota_used_count" 244 // 245 // 2. The quota limit reached condition will be specified using the 246 // following 247 // boolean metric : 248 // "serviceruntime.googleapis.com/quota/exceeded" 249 QuotaMetrics []*MetricValueSet `json:"quotaMetrics,omitempty"` 250 251 // ServiceConfigId: ID of the actual config used to process the request. 252 ServiceConfigId string `json:"serviceConfigId,omitempty"` 253 254 // ServerResponse contains the HTTP response code and headers from the 255 // server. 256 googleapi.ServerResponse `json:"-"` 257 258 // ForceSendFields is a list of field names (e.g. "AllocateErrors") to 259 // unconditionally include in API requests. By default, fields with 260 // empty values are omitted from API requests. However, any non-pointer, 261 // non-interface field appearing in ForceSendFields will be sent to the 262 // server regardless of whether the field is empty or not. This may be 263 // used to include empty fields in Patch requests. 264 ForceSendFields []string `json:"-"` 265 266 // NullFields is a list of field names (e.g. "AllocateErrors") to 267 // include in API requests with the JSON null value. By default, fields 268 // with empty values are omitted from API requests. However, any field 269 // with an empty value appearing in NullFields will be sent to the 270 // server as null. It is an error if a field in this list has a 271 // non-empty value. This may be used to include null fields in Patch 272 // requests. 273 NullFields []string `json:"-"` 274} 275 276func (s *AllocateQuotaResponse) MarshalJSON() ([]byte, error) { 277 type NoMethod AllocateQuotaResponse 278 raw := NoMethod(*s) 279 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 280} 281 282// AuditLog: Common audit log format for Google Cloud Platform API 283// operations. 284// 285// 286// 287type AuditLog struct { 288 // AuthenticationInfo: Authentication information. 289 AuthenticationInfo *AuthenticationInfo `json:"authenticationInfo,omitempty"` 290 291 // AuthorizationInfo: Authorization information. If there are 292 // multiple 293 // resources or permissions involved, then there is 294 // one AuthorizationInfo element for each {resource, permission} tuple. 295 AuthorizationInfo []*AuthorizationInfo `json:"authorizationInfo,omitempty"` 296 297 // Metadata: Other service-specific data about the request, response, 298 // and other 299 // information associated with the current audited event. 300 Metadata googleapi.RawMessage `json:"metadata,omitempty"` 301 302 // MethodName: The name of the service method or operation. 303 // For API calls, this should be the name of the API method. 304 // For example, 305 // 306 // "google.datastore.v1.Datastore.RunQuery" 307 // "google.logging.v1.LoggingService.DeleteLog" 308 MethodName string `json:"methodName,omitempty"` 309 310 // NumResponseItems: The number of items returned from a List or Query 311 // API method, 312 // if applicable. 313 NumResponseItems int64 `json:"numResponseItems,omitempty,string"` 314 315 // Request: The operation request. This may not include all request 316 // parameters, 317 // such as those that are too large, privacy-sensitive, or 318 // duplicated 319 // elsewhere in the log record. 320 // It should never include user-generated data, such as file 321 // contents. 322 // When the JSON object represented here has a proto equivalent, the 323 // proto 324 // name will be indicated in the `@type` property. 325 Request googleapi.RawMessage `json:"request,omitempty"` 326 327 // RequestMetadata: Metadata about the operation. 328 RequestMetadata *RequestMetadata `json:"requestMetadata,omitempty"` 329 330 // ResourceLocation: The resource location information. 331 ResourceLocation *ResourceLocation `json:"resourceLocation,omitempty"` 332 333 // ResourceName: The resource or collection that is the target of the 334 // operation. 335 // The name is a scheme-less URI, not including the API service 336 // name. 337 // For example: 338 // 339 // "shelves/SHELF_ID/books" 340 // "shelves/SHELF_ID/books/BOOK_ID" 341 ResourceName string `json:"resourceName,omitempty"` 342 343 // ResourceOriginalState: The resource's original state before mutation. 344 // Present only for 345 // operations which have successfully modified the targeted 346 // resource(s). 347 // In general, this field should contain all changed fields, except 348 // those 349 // that are already been included in `request`, `response`, `metadata` 350 // or 351 // `service_data` fields. 352 // When the JSON object represented here has a proto equivalent, 353 // the proto name will be indicated in the `@type` property. 354 ResourceOriginalState googleapi.RawMessage `json:"resourceOriginalState,omitempty"` 355 356 // Response: The operation response. This may not include all response 357 // elements, 358 // such as those that are too large, privacy-sensitive, or 359 // duplicated 360 // elsewhere in the log record. 361 // It should never include user-generated data, such as file 362 // contents. 363 // When the JSON object represented here has a proto equivalent, the 364 // proto 365 // name will be indicated in the `@type` property. 366 Response googleapi.RawMessage `json:"response,omitempty"` 367 368 // ServiceData: Deprecated, use `metadata` field instead. 369 // Other service-specific data about the request, response, and 370 // other 371 // activities. 372 ServiceData googleapi.RawMessage `json:"serviceData,omitempty"` 373 374 // ServiceName: The name of the API service performing the operation. 375 // For example, 376 // "datastore.googleapis.com". 377 ServiceName string `json:"serviceName,omitempty"` 378 379 // Status: The status of the overall operation. 380 Status *Status `json:"status,omitempty"` 381 382 // ForceSendFields is a list of field names (e.g. "AuthenticationInfo") 383 // to unconditionally include in API requests. By default, fields with 384 // empty values are omitted from API requests. However, any non-pointer, 385 // non-interface field appearing in ForceSendFields will be sent to the 386 // server regardless of whether the field is empty or not. This may be 387 // used to include empty fields in Patch requests. 388 ForceSendFields []string `json:"-"` 389 390 // NullFields is a list of field names (e.g. "AuthenticationInfo") to 391 // include in API requests with the JSON null value. By default, fields 392 // with empty values are omitted from API requests. However, any field 393 // with an empty value appearing in NullFields will be sent to the 394 // server as null. It is an error if a field in this list has a 395 // non-empty value. This may be used to include null fields in Patch 396 // requests. 397 NullFields []string `json:"-"` 398} 399 400func (s *AuditLog) MarshalJSON() ([]byte, error) { 401 type NoMethod AuditLog 402 raw := NoMethod(*s) 403 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 404} 405 406// Auth: This message defines request authentication attributes. 407// Terminology is 408// based on the JSON Web Token (JWT) standard, but the terms 409// also 410// correlate to concepts in other standards. 411type Auth struct { 412 // AccessLevels: A list of access level resource names that allow 413 // resources to be 414 // accessed by authenticated requester. It is part of Secure GCP 415 // processing 416 // for the incoming request. An access level string has the 417 // format: 418 // "//{api_service_name}/accessPolicies/{policy_id}/accessLevels/ 419 // {short_name}" 420 // 421 // Example: 422 // "//accesscontextmanager.googleapis.com/accessP 423 // olicies/MY_POLICY_ID/accessLevels/MY_LEVEL" 424 AccessLevels []string `json:"accessLevels,omitempty"` 425 426 // Audiences: The intended audience(s) for this authentication 427 // information. Reflects 428 // the audience (`aud`) claim within a JWT. The audience 429 // value(s) depends on the `issuer`, but typically include one or more 430 // of 431 // the following pieces of information: 432 // 433 // * The services intended to receive the credential such as 434 // ["pubsub.googleapis.com", "storage.googleapis.com"] 435 // * A set of service-based scopes. For example, 436 // ["https://www.googleapis.com/auth/cloud-platform"] 437 // * The client id of an app, such as the Firebase project id for JWTs 438 // from Firebase Auth. 439 // 440 // Consult the documentation for the credential issuer to determine 441 // the 442 // information provided. 443 Audiences []string `json:"audiences,omitempty"` 444 445 // Claims: Structured claims presented with the credential. JWTs 446 // include 447 // `{key: value}` pairs for standard and private claims. The 448 // following 449 // is a subset of the standard required and optional claims that 450 // would 451 // typically be presented for a Google-based JWT: 452 // 453 // {'iss': 'accounts.google.com', 454 // 'sub': '113289723416554971153', 455 // 'aud': ['123456789012', 'pubsub.googleapis.com'], 456 // 'azp': '123456789012.apps.googleusercontent.com', 457 // 'email': 'jsmith@example.com', 458 // 'iat': 1353601026, 459 // 'exp': 1353604926} 460 // 461 // SAML assertions are similarly specified, but with an identity 462 // provider 463 // dependent structure. 464 Claims googleapi.RawMessage `json:"claims,omitempty"` 465 466 // Presenter: The authorized presenter of the credential. Reflects the 467 // optional 468 // Authorized Presenter (`azp`) claim within a JWT or the 469 // OAuth client id. For example, a Google Cloud Platform client id 470 // looks 471 // as follows: "123456789012.apps.googleusercontent.com". 472 Presenter string `json:"presenter,omitempty"` 473 474 // Principal: The authenticated principal. Reflects the issuer (`iss`) 475 // and subject 476 // (`sub`) claims within a JWT. The issuer and subject should be 477 // `/` 478 // delimited, with `/` percent-encoded within the subject fragment. 479 // For 480 // Google accounts, the principal format 481 // is: 482 // "https://accounts.google.com/{id}" 483 Principal string `json:"principal,omitempty"` 484 485 // ForceSendFields is a list of field names (e.g. "AccessLevels") to 486 // unconditionally include in API requests. By default, fields with 487 // empty values are omitted from API requests. However, any non-pointer, 488 // non-interface field appearing in ForceSendFields will be sent to the 489 // server regardless of whether the field is empty or not. This may be 490 // used to include empty fields in Patch requests. 491 ForceSendFields []string `json:"-"` 492 493 // NullFields is a list of field names (e.g. "AccessLevels") to include 494 // in API requests with the JSON null value. By default, fields with 495 // empty values are omitted from API requests. However, any field with 496 // an empty value appearing in NullFields will be sent to the server as 497 // null. It is an error if a field in this list has a non-empty value. 498 // This may be used to include null fields in Patch requests. 499 NullFields []string `json:"-"` 500} 501 502func (s *Auth) MarshalJSON() ([]byte, error) { 503 type NoMethod Auth 504 raw := NoMethod(*s) 505 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 506} 507 508// AuthenticationInfo: Authentication information for the operation. 509type AuthenticationInfo struct { 510 // AuthoritySelector: The authority selector specified by the requestor, 511 // if any. 512 // It is not guaranteed that the principal was allowed to use this 513 // authority. 514 AuthoritySelector string `json:"authoritySelector,omitempty"` 515 516 // PrincipalEmail: The email address of the authenticated user (or 517 // service account on behalf 518 // of third party principal) making the request. For privacy reasons, 519 // the 520 // principal email address is redacted for all read-only operations that 521 // fail 522 // with a "permission denied" error. 523 PrincipalEmail string `json:"principalEmail,omitempty"` 524 525 // ServiceAccountDelegationInfo: Identity delegation history of an 526 // authenticated service account that makes 527 // the request. It contains information on the real authorities that try 528 // to 529 // access GCP resources by delegating on a service account. When 530 // multiple 531 // authorities present, they are guaranteed to be sorted based on the 532 // original 533 // ordering of the identity delegation events. 534 ServiceAccountDelegationInfo []*ServiceAccountDelegationInfo `json:"serviceAccountDelegationInfo,omitempty"` 535 536 // ServiceAccountKeyName: The name of the service account key used to 537 // create or exchange 538 // credentials for authenticating the service account making the 539 // request. 540 // This is a scheme-less URI full resource name. For 541 // example: 542 // 543 // "//iam.googleapis.com/projects/{PROJECT_ID}/serviceAccounts/ 544 // {ACCOUNT}/keys/{key}" 545 ServiceAccountKeyName string `json:"serviceAccountKeyName,omitempty"` 546 547 // ThirdPartyPrincipal: The third party identification (if any) of the 548 // authenticated user making 549 // the request. 550 // When the JSON object represented here has a proto equivalent, the 551 // proto 552 // name will be indicated in the `@type` property. 553 ThirdPartyPrincipal googleapi.RawMessage `json:"thirdPartyPrincipal,omitempty"` 554 555 // ForceSendFields is a list of field names (e.g. "AuthoritySelector") 556 // to unconditionally include in API requests. By default, fields with 557 // empty values are omitted from API requests. However, any non-pointer, 558 // non-interface field appearing in ForceSendFields will be sent to the 559 // server regardless of whether the field is empty or not. This may be 560 // used to include empty fields in Patch requests. 561 ForceSendFields []string `json:"-"` 562 563 // NullFields is a list of field names (e.g. "AuthoritySelector") to 564 // include in API requests with the JSON null value. By default, fields 565 // with empty values are omitted from API requests. However, any field 566 // with an empty value appearing in NullFields will be sent to the 567 // server as null. It is an error if a field in this list has a 568 // non-empty value. This may be used to include null fields in Patch 569 // requests. 570 NullFields []string `json:"-"` 571} 572 573func (s *AuthenticationInfo) MarshalJSON() ([]byte, error) { 574 type NoMethod AuthenticationInfo 575 raw := NoMethod(*s) 576 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 577} 578 579// AuthorizationInfo: Authorization information for the operation. 580type AuthorizationInfo struct { 581 // Granted: Whether or not authorization for `resource` and 582 // `permission` 583 // was granted. 584 Granted bool `json:"granted,omitempty"` 585 586 // Permission: The required IAM permission. 587 Permission string `json:"permission,omitempty"` 588 589 // Resource: The resource being accessed, as a REST-style string. For 590 // example: 591 // 592 // bigquery.googleapis.com/projects/PROJECTID/datasets/DATASETID 593 Resource string `json:"resource,omitempty"` 594 595 // ResourceAttributes: Resource attributes used in IAM condition 596 // evaluation. This field contains 597 // resource attributes like resource type and resource name. 598 // 599 // To get the whole view of the attributes used in IAM 600 // condition evaluation, the user must also look 601 // into 602 // `AuditLog.request_metadata.request_attributes`. 603 ResourceAttributes *Resource `json:"resourceAttributes,omitempty"` 604 605 // ForceSendFields is a list of field names (e.g. "Granted") to 606 // unconditionally include in API requests. By default, fields with 607 // empty values are omitted from API requests. However, any non-pointer, 608 // non-interface field appearing in ForceSendFields will be sent to the 609 // server regardless of whether the field is empty or not. This may be 610 // used to include empty fields in Patch requests. 611 ForceSendFields []string `json:"-"` 612 613 // NullFields is a list of field names (e.g. "Granted") to include in 614 // API requests with the JSON null value. By default, fields with empty 615 // values are omitted from API requests. However, any field with an 616 // empty value appearing in NullFields will be sent to the server as 617 // null. It is an error if a field in this list has a non-empty value. 618 // This may be used to include null fields in Patch requests. 619 NullFields []string `json:"-"` 620} 621 622func (s *AuthorizationInfo) MarshalJSON() ([]byte, error) { 623 type NoMethod AuthorizationInfo 624 raw := NoMethod(*s) 625 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 626} 627 628// CheckError: Defines the errors to be returned 629// in 630// google.api.servicecontrol.v1.CheckResponse.check_errors. 631type CheckError struct { 632 // Code: The error code. 633 // 634 // Possible values: 635 // "ERROR_CODE_UNSPECIFIED" - This is never used in `CheckResponse`. 636 // "NOT_FOUND" - The consumer's project id, network container, or 637 // resource container was 638 // not found. Same as google.rpc.Code.NOT_FOUND. 639 // "PERMISSION_DENIED" - The consumer doesn't have access to the 640 // specified resource. 641 // Same as google.rpc.Code.PERMISSION_DENIED. 642 // "RESOURCE_EXHAUSTED" - Quota check failed. Same as 643 // google.rpc.Code.RESOURCE_EXHAUSTED. 644 // "BUDGET_EXCEEDED" - Budget check failed. 645 // "DENIAL_OF_SERVICE_DETECTED" - The consumer's request has been 646 // flagged as a DoS attack. 647 // "LOAD_SHEDDING" - The consumer's request should be rejected in 648 // order to protect the service 649 // from being overloaded. 650 // "ABUSER_DETECTED" - The consumer has been flagged as an abuser. 651 // "SERVICE_NOT_ACTIVATED" - The consumer hasn't activated the 652 // service. 653 // "VISIBILITY_DENIED" - The consumer cannot access the service due to 654 // visibility configuration. 655 // "BILLING_DISABLED" - The consumer cannot access the service because 656 // billing is disabled. 657 // "PROJECT_DELETED" - The consumer's project has been marked as 658 // deleted (soft deletion). 659 // "PROJECT_INVALID" - The consumer's project number or id does not 660 // represent a valid project. 661 // "CONSUMER_INVALID" - The input consumer info does not represent a 662 // valid consumer folder or 663 // organization. 664 // "IP_ADDRESS_BLOCKED" - The IP address of the consumer is invalid 665 // for the specific consumer 666 // project. 667 // "REFERER_BLOCKED" - The referer address of the consumer request is 668 // invalid for the specific 669 // consumer project. 670 // "CLIENT_APP_BLOCKED" - The client application of the consumer 671 // request is invalid for the 672 // specific consumer project. 673 // "API_TARGET_BLOCKED" - The API targeted by this request is invalid 674 // for the specified consumer 675 // project. 676 // "API_KEY_INVALID" - The consumer's API key is invalid. 677 // "API_KEY_EXPIRED" - The consumer's API Key has expired. 678 // "API_KEY_NOT_FOUND" - The consumer's API Key was not found in 679 // config record. 680 // "SPATULA_HEADER_INVALID" - The consumer's spatula header is 681 // invalid. 682 // "LOAS_ROLE_INVALID" - The consumer's LOAS role is invalid. 683 // "NO_LOAS_PROJECT" - The consumer's LOAS role has no associated 684 // project. 685 // "LOAS_PROJECT_DISABLED" - The consumer's LOAS project is not 686 // `ACTIVE` in LoquatV2. 687 // "SECURITY_POLICY_VIOLATED" - Request is not allowed as per security 688 // policies defined in Org Policy. 689 // "INVALID_CREDENTIAL" - The credential in the request can not be 690 // verified. 691 // "LOCATION_POLICY_VIOLATED" - Request is not allowed as per location 692 // policies defined in Org Policy. 693 // "NAMESPACE_LOOKUP_UNAVAILABLE" - The backend server for looking up 694 // project id/number is unavailable. 695 // "SERVICE_STATUS_UNAVAILABLE" - The backend server for checking 696 // service status is unavailable. 697 // "BILLING_STATUS_UNAVAILABLE" - The backend server for checking 698 // billing status is unavailable. 699 // "QUOTA_CHECK_UNAVAILABLE" - The backend server for checking quota 700 // limits is unavailable. 701 // "LOAS_PROJECT_LOOKUP_UNAVAILABLE" - The Spanner for looking up LOAS 702 // project is unavailable. 703 // "CLOUD_RESOURCE_MANAGER_BACKEND_UNAVAILABLE" - Cloud Resource 704 // Manager backend server is unavailable. 705 // "SECURITY_POLICY_BACKEND_UNAVAILABLE" - NOTE: for customers in the 706 // scope of Beta/GA of 707 // https://cloud.google.com/vpc-service-controls, this error 708 // is no longer returned. If the security backend is unavailable, 709 // rpc 710 // UNAVAILABLE status will be returned instead. It should be ignored 711 // and 712 // should not be used to reject client requests. 713 // "LOCATION_POLICY_BACKEND_UNAVAILABLE" - Backend server for 714 // evaluating location policy is unavailable. 715 Code string `json:"code,omitempty"` 716 717 // Detail: Free-form text providing details on the error cause of the 718 // error. 719 Detail string `json:"detail,omitempty"` 720 721 // Status: Contains public information about the check error. If 722 // available, 723 // `status.code` will be non zero and client can propagate it out as 724 // public 725 // error. 726 Status *Status `json:"status,omitempty"` 727 728 // Subject: Subject to whom this error applies. See the specific code 729 // enum for more 730 // details on this field. For example: 731 // - “project:<project-id or project-number>” 732 // - “folder:<folder-id>” 733 // - “organization:<organization-id>” 734 Subject string `json:"subject,omitempty"` 735 736 // ForceSendFields is a list of field names (e.g. "Code") 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. "Code") to include in API 745 // 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 *CheckError) MarshalJSON() ([]byte, error) { 754 type NoMethod CheckError 755 raw := NoMethod(*s) 756 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 757} 758 759// CheckInfo: Contains additional information about the check operation. 760type CheckInfo struct { 761 // ConsumerInfo: Consumer info of this check. 762 ConsumerInfo *ConsumerInfo `json:"consumerInfo,omitempty"` 763 764 // UnusedArguments: A list of fields and label keys that are ignored by 765 // the server. 766 // The client doesn't need to send them for following requests to 767 // improve 768 // performance and allow better aggregation. 769 UnusedArguments []string `json:"unusedArguments,omitempty"` 770 771 // ForceSendFields is a list of field names (e.g. "ConsumerInfo") to 772 // unconditionally include in API requests. By default, fields with 773 // empty values are omitted from API requests. However, any non-pointer, 774 // non-interface field appearing in ForceSendFields will be sent to the 775 // server regardless of whether the field is empty or not. This may be 776 // used to include empty fields in Patch requests. 777 ForceSendFields []string `json:"-"` 778 779 // NullFields is a list of field names (e.g. "ConsumerInfo") to include 780 // in API requests with the JSON null value. By default, fields with 781 // empty values are omitted from API requests. However, any field with 782 // an empty value appearing in NullFields will be sent to the server as 783 // null. It is an error if a field in this list has a non-empty value. 784 // This may be used to include null fields in Patch requests. 785 NullFields []string `json:"-"` 786} 787 788func (s *CheckInfo) MarshalJSON() ([]byte, error) { 789 type NoMethod CheckInfo 790 raw := NoMethod(*s) 791 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 792} 793 794// CheckRequest: Request message for the Check method. 795type CheckRequest struct { 796 // Operation: The operation to be checked. 797 Operation *Operation `json:"operation,omitempty"` 798 799 // RequestProjectSettings: Requests the project settings to be returned 800 // as part of the check response. 801 RequestProjectSettings bool `json:"requestProjectSettings,omitempty"` 802 803 // ServiceConfigId: Specifies which version of service configuration 804 // should be used to process 805 // the request. 806 // 807 // If unspecified or no matching version can be found, the 808 // latest one will be used. 809 ServiceConfigId string `json:"serviceConfigId,omitempty"` 810 811 // SkipActivationCheck: Indicates if service activation check should be 812 // skipped for this request. 813 // Default behavior is to perform the check and apply relevant 814 // quota. 815 // WARNING: Setting this flag to "true" will disable quota enforcement. 816 SkipActivationCheck bool `json:"skipActivationCheck,omitempty"` 817 818 // ForceSendFields is a list of field names (e.g. "Operation") to 819 // unconditionally include in API requests. By default, fields with 820 // empty values are omitted from API requests. However, any non-pointer, 821 // non-interface field appearing in ForceSendFields will be sent to the 822 // server regardless of whether the field is empty or not. This may be 823 // used to include empty fields in Patch requests. 824 ForceSendFields []string `json:"-"` 825 826 // NullFields is a list of field names (e.g. "Operation") to include in 827 // API requests with the JSON null value. By default, fields with empty 828 // values are omitted from API requests. However, any field with an 829 // empty value appearing in NullFields will be sent to the server as 830 // null. It is an error if a field in this list has a non-empty value. 831 // This may be used to include null fields in Patch requests. 832 NullFields []string `json:"-"` 833} 834 835func (s *CheckRequest) MarshalJSON() ([]byte, error) { 836 type NoMethod CheckRequest 837 raw := NoMethod(*s) 838 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 839} 840 841// CheckResponse: Response message for the Check method. 842type CheckResponse struct { 843 // CheckErrors: Indicate the decision of the check. 844 // 845 // If no check errors are present, the service should process the 846 // operation. 847 // Otherwise the service should use the list of errors to determine 848 // the 849 // appropriate action. 850 CheckErrors []*CheckError `json:"checkErrors,omitempty"` 851 852 // CheckInfo: Feedback data returned from the server during processing a 853 // Check request. 854 CheckInfo *CheckInfo `json:"checkInfo,omitempty"` 855 856 // OperationId: The same operation_id value used in the 857 // CheckRequest. 858 // Used for logging and diagnostics purposes. 859 OperationId string `json:"operationId,omitempty"` 860 861 // QuotaInfo: Quota information for the check request associated with 862 // this response. 863 // 864 QuotaInfo *QuotaInfo `json:"quotaInfo,omitempty"` 865 866 // ServiceConfigId: The actual config id used to process the request. 867 ServiceConfigId string `json:"serviceConfigId,omitempty"` 868 869 // ServiceRolloutId: Unimplemented. The current service rollout id used 870 // to process the request. 871 ServiceRolloutId string `json:"serviceRolloutId,omitempty"` 872 873 // ServerResponse contains the HTTP response code and headers from the 874 // server. 875 googleapi.ServerResponse `json:"-"` 876 877 // ForceSendFields is a list of field names (e.g. "CheckErrors") to 878 // unconditionally include in API requests. By default, fields with 879 // empty values are omitted from API requests. However, any non-pointer, 880 // non-interface field appearing in ForceSendFields will be sent to the 881 // server regardless of whether the field is empty or not. This may be 882 // used to include empty fields in Patch requests. 883 ForceSendFields []string `json:"-"` 884 885 // NullFields is a list of field names (e.g. "CheckErrors") to include 886 // in API requests with the JSON null value. By default, fields with 887 // empty values are omitted from API requests. However, any field with 888 // an empty value appearing in NullFields will be sent to the server as 889 // null. It is an error if a field in this list has a non-empty value. 890 // This may be used to include null fields in Patch requests. 891 NullFields []string `json:"-"` 892} 893 894func (s *CheckResponse) MarshalJSON() ([]byte, error) { 895 type NoMethod CheckResponse 896 raw := NoMethod(*s) 897 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 898} 899 900// ConsumerInfo: `ConsumerInfo` provides information about the consumer. 901type ConsumerInfo struct { 902 // ConsumerNumber: The consumer identity number, can be Google cloud 903 // project number, folder 904 // number or organization number e.g. 1234567890. A value of 0 indicates 905 // no 906 // consumer number is found. 907 ConsumerNumber int64 `json:"consumerNumber,omitempty,string"` 908 909 // ProjectNumber: The Google cloud project number, e.g. 1234567890. A 910 // value of 0 indicates 911 // no project number is found. 912 // 913 // NOTE: This field is deprecated after Chemist support flexible 914 // consumer 915 // id. New code should not depend on this field anymore. 916 ProjectNumber int64 `json:"projectNumber,omitempty,string"` 917 918 // Type: The type of the consumer which should have been defined 919 // in 920 // [Google Resource 921 // Manager](https://cloud.google.com/resource-manager/). 922 // 923 // Possible values: 924 // "CONSUMER_TYPE_UNSPECIFIED" - This is never used. 925 // "PROJECT" - The consumer is a Google Cloud Project. 926 // "FOLDER" - The consumer is a Google Cloud Folder. 927 // "ORGANIZATION" - The consumer is a Google Cloud Organization. 928 // "SERVICE_SPECIFIC" - Service-specific resource container which is 929 // defined by the service 930 // producer to offer their users the ability to manage service 931 // control 932 // functionalities at a finer level of granularity than the PROJECT. 933 Type string `json:"type,omitempty"` 934 935 // ForceSendFields is a list of field names (e.g. "ConsumerNumber") to 936 // unconditionally include in API requests. By default, fields with 937 // empty values are omitted from API requests. However, any non-pointer, 938 // non-interface field appearing in ForceSendFields will be sent to the 939 // server regardless of whether the field is empty or not. This may be 940 // used to include empty fields in Patch requests. 941 ForceSendFields []string `json:"-"` 942 943 // NullFields is a list of field names (e.g. "ConsumerNumber") to 944 // include in API requests with the JSON null value. By default, fields 945 // with empty values are omitted from API requests. However, any field 946 // with an empty value appearing in NullFields will be sent to the 947 // server as null. It is an error if a field in this list has a 948 // non-empty value. This may be used to include null fields in Patch 949 // requests. 950 NullFields []string `json:"-"` 951} 952 953func (s *ConsumerInfo) MarshalJSON() ([]byte, error) { 954 type NoMethod ConsumerInfo 955 raw := NoMethod(*s) 956 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 957} 958 959// Distribution: Distribution represents a frequency distribution of 960// double-valued sample 961// points. It contains the size of the population of sample points 962// plus 963// additional optional information: 964// 965// - the arithmetic mean of the samples 966// - the minimum and maximum of the samples 967// - the sum-squared-deviation of the samples, used to compute 968// variance 969// - a histogram of the values of the sample points 970type Distribution struct { 971 // BucketCounts: The number of samples in each histogram bucket. 972 // `bucket_counts` are 973 // optional. If present, they must sum to the `count` value. 974 // 975 // The buckets are defined below in `bucket_option`. There are N 976 // buckets. 977 // `bucket_counts[0]` is the number of samples in the underflow 978 // bucket. 979 // `bucket_counts[1]` to `bucket_counts[N-1]` are the numbers of 980 // samples 981 // in each of the finite buckets. And `bucket_counts[N] is the number 982 // of samples in the overflow bucket. See the comments of 983 // `bucket_option` 984 // below for more details. 985 // 986 // Any suffix of trailing zeros may be omitted. 987 BucketCounts googleapi.Int64s `json:"bucketCounts,omitempty"` 988 989 // Count: The total number of samples in the distribution. Must be >= 0. 990 Count int64 `json:"count,omitempty,string"` 991 992 // Exemplars: Example points. Must be in increasing order of `value` 993 // field. 994 Exemplars []*Exemplar `json:"exemplars,omitempty"` 995 996 // ExplicitBuckets: Buckets with arbitrary user-provided width. 997 ExplicitBuckets *ExplicitBuckets `json:"explicitBuckets,omitempty"` 998 999 // ExponentialBuckets: Buckets with exponentially growing width. 1000 ExponentialBuckets *ExponentialBuckets `json:"exponentialBuckets,omitempty"` 1001 1002 // LinearBuckets: Buckets with constant width. 1003 LinearBuckets *LinearBuckets `json:"linearBuckets,omitempty"` 1004 1005 // Maximum: The maximum of the population of values. Ignored if `count` 1006 // is zero. 1007 Maximum float64 `json:"maximum,omitempty"` 1008 1009 // Mean: The arithmetic mean of the samples in the distribution. If 1010 // `count` is 1011 // zero then this field must be zero. 1012 Mean float64 `json:"mean,omitempty"` 1013 1014 // Minimum: The minimum of the population of values. Ignored if `count` 1015 // is zero. 1016 Minimum float64 `json:"minimum,omitempty"` 1017 1018 // SumOfSquaredDeviation: The sum of squared deviations from the mean: 1019 // Sum[i=1..count]((x_i - mean)^2) 1020 // where each x_i is a sample values. If `count` is zero then this 1021 // field 1022 // must be zero, otherwise validation of the request fails. 1023 SumOfSquaredDeviation float64 `json:"sumOfSquaredDeviation,omitempty"` 1024 1025 // ForceSendFields is a list of field names (e.g. "BucketCounts") to 1026 // unconditionally include in API requests. By default, fields with 1027 // empty values are omitted from API requests. However, any non-pointer, 1028 // non-interface field appearing in ForceSendFields will be sent to the 1029 // server regardless of whether the field is empty or not. This may be 1030 // used to include empty fields in Patch requests. 1031 ForceSendFields []string `json:"-"` 1032 1033 // NullFields is a list of field names (e.g. "BucketCounts") to include 1034 // in API requests with the JSON null value. By default, fields with 1035 // empty values are omitted from API requests. However, any field with 1036 // an empty value appearing in NullFields will be sent to the server as 1037 // null. It is an error if a field in this list has a non-empty value. 1038 // This may be used to include null fields in Patch requests. 1039 NullFields []string `json:"-"` 1040} 1041 1042func (s *Distribution) MarshalJSON() ([]byte, error) { 1043 type NoMethod Distribution 1044 raw := NoMethod(*s) 1045 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1046} 1047 1048func (s *Distribution) UnmarshalJSON(data []byte) error { 1049 type NoMethod Distribution 1050 var s1 struct { 1051 Maximum gensupport.JSONFloat64 `json:"maximum"` 1052 Mean gensupport.JSONFloat64 `json:"mean"` 1053 Minimum gensupport.JSONFloat64 `json:"minimum"` 1054 SumOfSquaredDeviation gensupport.JSONFloat64 `json:"sumOfSquaredDeviation"` 1055 *NoMethod 1056 } 1057 s1.NoMethod = (*NoMethod)(s) 1058 if err := json.Unmarshal(data, &s1); err != nil { 1059 return err 1060 } 1061 s.Maximum = float64(s1.Maximum) 1062 s.Mean = float64(s1.Mean) 1063 s.Minimum = float64(s1.Minimum) 1064 s.SumOfSquaredDeviation = float64(s1.SumOfSquaredDeviation) 1065 return nil 1066} 1067 1068// Exemplar: Exemplars are example points that may be used to annotate 1069// aggregated 1070// distribution values. They are metadata that gives information about 1071// a 1072// particular value added to a Distribution bucket, such as a trace ID 1073// that 1074// was active when a value was added. They may contain further 1075// information, 1076// such as a example values and timestamps, origin, etc. 1077type Exemplar struct { 1078 // Attachments: Contextual information about the example value. Examples 1079 // are: 1080 // 1081 // Trace: type.googleapis.com/google.monitoring.v3.SpanContext 1082 // 1083 // Literal string: type.googleapis.com/google.protobuf.StringValue 1084 // 1085 // Labels dropped during aggregation: 1086 // type.googleapis.com/google.monitoring.v3.DroppedLabels 1087 // 1088 // There may be only a single attachment of any given message type in 1089 // a 1090 // single exemplar, and this is enforced by the system. 1091 Attachments []googleapi.RawMessage `json:"attachments,omitempty"` 1092 1093 // Timestamp: The observation (sampling) time of the above value. 1094 Timestamp string `json:"timestamp,omitempty"` 1095 1096 // Value: Value of the exemplar point. This value determines to which 1097 // bucket the 1098 // exemplar belongs. 1099 Value float64 `json:"value,omitempty"` 1100 1101 // ForceSendFields is a list of field names (e.g. "Attachments") to 1102 // unconditionally include in API requests. By default, fields with 1103 // empty values are omitted from API requests. However, any non-pointer, 1104 // non-interface field appearing in ForceSendFields will be sent to the 1105 // server regardless of whether the field is empty or not. This may be 1106 // used to include empty fields in Patch requests. 1107 ForceSendFields []string `json:"-"` 1108 1109 // NullFields is a list of field names (e.g. "Attachments") to include 1110 // in API requests with the JSON null value. By default, fields with 1111 // empty values are omitted from API requests. However, any field with 1112 // an empty value appearing in NullFields will be sent to the server as 1113 // null. It is an error if a field in this list has a non-empty value. 1114 // This may be used to include null fields in Patch requests. 1115 NullFields []string `json:"-"` 1116} 1117 1118func (s *Exemplar) MarshalJSON() ([]byte, error) { 1119 type NoMethod Exemplar 1120 raw := NoMethod(*s) 1121 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1122} 1123 1124func (s *Exemplar) UnmarshalJSON(data []byte) error { 1125 type NoMethod Exemplar 1126 var s1 struct { 1127 Value gensupport.JSONFloat64 `json:"value"` 1128 *NoMethod 1129 } 1130 s1.NoMethod = (*NoMethod)(s) 1131 if err := json.Unmarshal(data, &s1); err != nil { 1132 return err 1133 } 1134 s.Value = float64(s1.Value) 1135 return nil 1136} 1137 1138// ExplicitBuckets: Describing buckets with arbitrary user-provided 1139// width. 1140type ExplicitBuckets struct { 1141 // Bounds: 'bound' is a list of strictly increasing boundaries 1142 // between 1143 // buckets. Note that a list of length N-1 defines N buckets because 1144 // of fenceposting. See comments on `bucket_options` for details. 1145 // 1146 // The i'th finite bucket covers the interval 1147 // [bound[i-1], bound[i]) 1148 // where i ranges from 1 to bound_size() - 1. Note that there are 1149 // no 1150 // finite buckets at all if 'bound' only contains a single element; 1151 // in 1152 // that special case the single bound defines the boundary between 1153 // the 1154 // underflow and overflow buckets. 1155 // 1156 // bucket number lower bound upper bound 1157 // i == 0 (underflow) -inf bound[i] 1158 // 0 < i < bound_size() bound[i-1] bound[i] 1159 // i == bound_size() (overflow) bound[i-1] +inf 1160 Bounds []float64 `json:"bounds,omitempty"` 1161 1162 // ForceSendFields is a list of field names (e.g. "Bounds") to 1163 // unconditionally include in API requests. By default, fields with 1164 // empty values are omitted from API requests. However, any non-pointer, 1165 // non-interface field appearing in ForceSendFields will be sent to the 1166 // server regardless of whether the field is empty or not. This may be 1167 // used to include empty fields in Patch requests. 1168 ForceSendFields []string `json:"-"` 1169 1170 // NullFields is a list of field names (e.g. "Bounds") to include in API 1171 // requests with the JSON null value. By default, fields with empty 1172 // values are omitted from API requests. However, any field with an 1173 // empty value appearing in NullFields will be sent to the server as 1174 // null. It is an error if a field in this list has a non-empty value. 1175 // This may be used to include null fields in Patch requests. 1176 NullFields []string `json:"-"` 1177} 1178 1179func (s *ExplicitBuckets) MarshalJSON() ([]byte, error) { 1180 type NoMethod ExplicitBuckets 1181 raw := NoMethod(*s) 1182 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1183} 1184 1185// ExponentialBuckets: Describing buckets with exponentially growing 1186// width. 1187type ExponentialBuckets struct { 1188 // GrowthFactor: The i'th exponential bucket covers the interval 1189 // [scale * growth_factor^(i-1), scale * growth_factor^i) 1190 // where i ranges from 1 to num_finite_buckets inclusive. 1191 // Must be larger than 1.0. 1192 GrowthFactor float64 `json:"growthFactor,omitempty"` 1193 1194 // NumFiniteBuckets: The number of finite buckets. With the underflow 1195 // and overflow buckets, 1196 // the total number of buckets is `num_finite_buckets` + 2. 1197 // See comments on `bucket_options` for details. 1198 NumFiniteBuckets int64 `json:"numFiniteBuckets,omitempty"` 1199 1200 // Scale: The i'th exponential bucket covers the interval 1201 // [scale * growth_factor^(i-1), scale * growth_factor^i) 1202 // where i ranges from 1 to num_finite_buckets inclusive. 1203 // Must be > 0. 1204 Scale float64 `json:"scale,omitempty"` 1205 1206 // ForceSendFields is a list of field names (e.g. "GrowthFactor") to 1207 // unconditionally include in API requests. By default, fields with 1208 // empty values are omitted from API requests. However, any non-pointer, 1209 // non-interface field appearing in ForceSendFields will be sent to the 1210 // server regardless of whether the field is empty or not. This may be 1211 // used to include empty fields in Patch requests. 1212 ForceSendFields []string `json:"-"` 1213 1214 // NullFields is a list of field names (e.g. "GrowthFactor") to include 1215 // in API requests with the JSON null value. By default, fields with 1216 // empty values are omitted from API requests. However, any field with 1217 // an empty value appearing in NullFields will be sent to the server as 1218 // null. It is an error if a field in this list has a non-empty value. 1219 // This may be used to include null fields in Patch requests. 1220 NullFields []string `json:"-"` 1221} 1222 1223func (s *ExponentialBuckets) MarshalJSON() ([]byte, error) { 1224 type NoMethod ExponentialBuckets 1225 raw := NoMethod(*s) 1226 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1227} 1228 1229func (s *ExponentialBuckets) UnmarshalJSON(data []byte) error { 1230 type NoMethod ExponentialBuckets 1231 var s1 struct { 1232 GrowthFactor gensupport.JSONFloat64 `json:"growthFactor"` 1233 Scale gensupport.JSONFloat64 `json:"scale"` 1234 *NoMethod 1235 } 1236 s1.NoMethod = (*NoMethod)(s) 1237 if err := json.Unmarshal(data, &s1); err != nil { 1238 return err 1239 } 1240 s.GrowthFactor = float64(s1.GrowthFactor) 1241 s.Scale = float64(s1.Scale) 1242 return nil 1243} 1244 1245// FirstPartyPrincipal: First party identity principal. 1246type FirstPartyPrincipal struct { 1247 // PrincipalEmail: The email address of a Google account. 1248 // . 1249 PrincipalEmail string `json:"principalEmail,omitempty"` 1250 1251 // ServiceMetadata: Metadata about the service that uses the service 1252 // account. 1253 // . 1254 ServiceMetadata googleapi.RawMessage `json:"serviceMetadata,omitempty"` 1255 1256 // ForceSendFields is a list of field names (e.g. "PrincipalEmail") to 1257 // unconditionally include in API requests. By default, fields with 1258 // empty values are omitted from API requests. However, any non-pointer, 1259 // non-interface field appearing in ForceSendFields will be sent to the 1260 // server regardless of whether the field is empty or not. This may be 1261 // used to include empty fields in Patch requests. 1262 ForceSendFields []string `json:"-"` 1263 1264 // NullFields is a list of field names (e.g. "PrincipalEmail") to 1265 // include in API requests with the JSON null value. By default, fields 1266 // with empty values are omitted from API requests. However, any field 1267 // with an empty value appearing in NullFields will be sent to the 1268 // server as null. It is an error if a field in this list has a 1269 // non-empty value. This may be used to include null fields in Patch 1270 // requests. 1271 NullFields []string `json:"-"` 1272} 1273 1274func (s *FirstPartyPrincipal) MarshalJSON() ([]byte, error) { 1275 type NoMethod FirstPartyPrincipal 1276 raw := NoMethod(*s) 1277 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1278} 1279 1280// HttpRequest: A common proto for logging HTTP requests. Only contains 1281// semantics 1282// defined by the HTTP specification. Product-specific 1283// logging 1284// information MUST be defined in a separate message. 1285type HttpRequest struct { 1286 // CacheFillBytes: The number of HTTP response bytes inserted into 1287 // cache. Set only when a 1288 // cache fill was attempted. 1289 CacheFillBytes int64 `json:"cacheFillBytes,omitempty,string"` 1290 1291 // CacheHit: Whether or not an entity was served from cache 1292 // (with or without validation). 1293 CacheHit bool `json:"cacheHit,omitempty"` 1294 1295 // CacheLookup: Whether or not a cache lookup was attempted. 1296 CacheLookup bool `json:"cacheLookup,omitempty"` 1297 1298 // CacheValidatedWithOriginServer: Whether or not the response was 1299 // validated with the origin server before 1300 // being served from cache. This field is only meaningful if `cache_hit` 1301 // is 1302 // True. 1303 CacheValidatedWithOriginServer bool `json:"cacheValidatedWithOriginServer,omitempty"` 1304 1305 // Latency: The request processing latency on the server, from the time 1306 // the request was 1307 // received until the response was sent. 1308 Latency string `json:"latency,omitempty"` 1309 1310 // Protocol: Protocol used for the request. Examples: "HTTP/1.1", 1311 // "HTTP/2", "websocket" 1312 Protocol string `json:"protocol,omitempty"` 1313 1314 // Referer: The referer URL of the request, as defined in 1315 // [HTTP/1.1 Header 1316 // Field 1317 // Definitions](http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.h 1318 // tml). 1319 Referer string `json:"referer,omitempty"` 1320 1321 // RemoteIp: The IP address (IPv4 or IPv6) of the client that issued the 1322 // HTTP 1323 // request. Examples: "192.168.1.1", "FE80::0202:B3FF:FE1E:8329". 1324 RemoteIp string `json:"remoteIp,omitempty"` 1325 1326 // RequestMethod: The request method. Examples: "GET", "HEAD", 1327 // "PUT", "POST". 1328 RequestMethod string `json:"requestMethod,omitempty"` 1329 1330 // RequestSize: The size of the HTTP request message in bytes, including 1331 // the request 1332 // headers and the request body. 1333 RequestSize int64 `json:"requestSize,omitempty,string"` 1334 1335 // RequestUrl: The scheme (http, https), the host name, the path, and 1336 // the query 1337 // portion of the URL that was requested. 1338 // Example: "http://example.com/some/info?color=red". 1339 RequestUrl string `json:"requestUrl,omitempty"` 1340 1341 // ResponseSize: The size of the HTTP response message sent back to the 1342 // client, in bytes, 1343 // including the response headers and the response body. 1344 ResponseSize int64 `json:"responseSize,omitempty,string"` 1345 1346 // ServerIp: The IP address (IPv4 or IPv6) of the origin server that the 1347 // request was 1348 // sent to. 1349 ServerIp string `json:"serverIp,omitempty"` 1350 1351 // Status: The response code indicating the status of the 1352 // response. 1353 // Examples: 200, 404. 1354 Status int64 `json:"status,omitempty"` 1355 1356 // UserAgent: The user agent sent by the client. Example: 1357 // "Mozilla/4.0 (compatible; MSIE 6.0; Windows 98; Q312461; .NET 1358 // CLR 1.0.3705)". 1359 UserAgent string `json:"userAgent,omitempty"` 1360 1361 // ForceSendFields is a list of field names (e.g. "CacheFillBytes") to 1362 // unconditionally include in API requests. By default, fields with 1363 // empty values are omitted from API requests. However, any non-pointer, 1364 // non-interface field appearing in ForceSendFields will be sent to the 1365 // server regardless of whether the field is empty or not. This may be 1366 // used to include empty fields in Patch requests. 1367 ForceSendFields []string `json:"-"` 1368 1369 // NullFields is a list of field names (e.g. "CacheFillBytes") to 1370 // include in API requests with the JSON null value. By default, fields 1371 // with empty values are omitted from API requests. However, any field 1372 // with an empty value appearing in NullFields will be sent to the 1373 // server as null. It is an error if a field in this list has a 1374 // non-empty value. This may be used to include null fields in Patch 1375 // requests. 1376 NullFields []string `json:"-"` 1377} 1378 1379func (s *HttpRequest) MarshalJSON() ([]byte, error) { 1380 type NoMethod HttpRequest 1381 raw := NoMethod(*s) 1382 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1383} 1384 1385// LinearBuckets: Describing buckets with constant width. 1386type LinearBuckets struct { 1387 // NumFiniteBuckets: The number of finite buckets. With the underflow 1388 // and overflow buckets, 1389 // the total number of buckets is `num_finite_buckets` + 2. 1390 // See comments on `bucket_options` for details. 1391 NumFiniteBuckets int64 `json:"numFiniteBuckets,omitempty"` 1392 1393 // Offset: The i'th linear bucket covers the interval 1394 // [offset + (i-1) * width, offset + i * width) 1395 // where i ranges from 1 to num_finite_buckets, inclusive. 1396 Offset float64 `json:"offset,omitempty"` 1397 1398 // Width: The i'th linear bucket covers the interval 1399 // [offset + (i-1) * width, offset + i * width) 1400 // where i ranges from 1 to num_finite_buckets, inclusive. 1401 // Must be strictly positive. 1402 Width float64 `json:"width,omitempty"` 1403 1404 // ForceSendFields is a list of field names (e.g. "NumFiniteBuckets") to 1405 // unconditionally include in API requests. By default, fields with 1406 // empty values are omitted from API requests. However, any non-pointer, 1407 // non-interface field appearing in ForceSendFields will be sent to the 1408 // server regardless of whether the field is empty or not. This may be 1409 // used to include empty fields in Patch requests. 1410 ForceSendFields []string `json:"-"` 1411 1412 // NullFields is a list of field names (e.g. "NumFiniteBuckets") to 1413 // include in API requests with the JSON null value. By default, fields 1414 // with empty values are omitted from API requests. However, any field 1415 // with an empty value appearing in NullFields will be sent to the 1416 // server as null. It is an error if a field in this list has a 1417 // non-empty value. This may be used to include null fields in Patch 1418 // requests. 1419 NullFields []string `json:"-"` 1420} 1421 1422func (s *LinearBuckets) MarshalJSON() ([]byte, error) { 1423 type NoMethod LinearBuckets 1424 raw := NoMethod(*s) 1425 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1426} 1427 1428func (s *LinearBuckets) UnmarshalJSON(data []byte) error { 1429 type NoMethod LinearBuckets 1430 var s1 struct { 1431 Offset gensupport.JSONFloat64 `json:"offset"` 1432 Width gensupport.JSONFloat64 `json:"width"` 1433 *NoMethod 1434 } 1435 s1.NoMethod = (*NoMethod)(s) 1436 if err := json.Unmarshal(data, &s1); err != nil { 1437 return err 1438 } 1439 s.Offset = float64(s1.Offset) 1440 s.Width = float64(s1.Width) 1441 return nil 1442} 1443 1444// LogEntry: An individual log entry. 1445type LogEntry struct { 1446 // HttpRequest: Optional. Information about the HTTP request associated 1447 // with this 1448 // log entry, if applicable. 1449 HttpRequest *HttpRequest `json:"httpRequest,omitempty"` 1450 1451 // InsertId: A unique ID for the log entry used for deduplication. If 1452 // omitted, 1453 // the implementation will generate one based on operation_id. 1454 InsertId string `json:"insertId,omitempty"` 1455 1456 // Labels: A set of user-defined (key, value) data that provides 1457 // additional 1458 // information about the log entry. 1459 Labels map[string]string `json:"labels,omitempty"` 1460 1461 // Name: Required. The log to which this log entry belongs. Examples: 1462 // "syslog", 1463 // "book_log". 1464 Name string `json:"name,omitempty"` 1465 1466 // Operation: Optional. Information about an operation associated with 1467 // the log entry, if 1468 // applicable. 1469 Operation *LogEntryOperation `json:"operation,omitempty"` 1470 1471 // ProtoPayload: The log entry payload, represented as a protocol buffer 1472 // that is 1473 // expressed as a JSON object. The only accepted type currently 1474 // is 1475 // AuditLog. 1476 ProtoPayload googleapi.RawMessage `json:"protoPayload,omitempty"` 1477 1478 // Severity: The severity of the log entry. The default value 1479 // is 1480 // `LogSeverity.DEFAULT`. 1481 // 1482 // Possible values: 1483 // "DEFAULT" - (0) The log entry has no assigned severity level. 1484 // "DEBUG" - (100) Debug or trace information. 1485 // "INFO" - (200) Routine information, such as ongoing status or 1486 // performance. 1487 // "NOTICE" - (300) Normal but significant events, such as start up, 1488 // shut down, or 1489 // a configuration change. 1490 // "WARNING" - (400) Warning events might cause problems. 1491 // "ERROR" - (500) Error events are likely to cause problems. 1492 // "CRITICAL" - (600) Critical events cause more severe problems or 1493 // outages. 1494 // "ALERT" - (700) A person must take an action immediately. 1495 // "EMERGENCY" - (800) One or more systems are unusable. 1496 Severity string `json:"severity,omitempty"` 1497 1498 // SourceLocation: Optional. Source code location information associated 1499 // with the log entry, 1500 // if any. 1501 SourceLocation *LogEntrySourceLocation `json:"sourceLocation,omitempty"` 1502 1503 // StructPayload: The log entry payload, represented as a structure 1504 // that 1505 // is expressed as a JSON object. 1506 StructPayload googleapi.RawMessage `json:"structPayload,omitempty"` 1507 1508 // TextPayload: The log entry payload, represented as a Unicode string 1509 // (UTF-8). 1510 TextPayload string `json:"textPayload,omitempty"` 1511 1512 // Timestamp: The time the event described by the log entry occurred. 1513 // If 1514 // omitted, defaults to operation start time. 1515 Timestamp string `json:"timestamp,omitempty"` 1516 1517 // Trace: Optional. Resource name of the trace associated with the log 1518 // entry, if any. 1519 // If this field contains a relative resource name, you can assume the 1520 // name is 1521 // relative to `//tracing.googleapis.com`. 1522 // Example: 1523 // `projects/my-projectid/traces/06796866738c859f2f19b7cfb321482 1524 // 4` 1525 Trace string `json:"trace,omitempty"` 1526 1527 // ForceSendFields is a list of field names (e.g. "HttpRequest") to 1528 // unconditionally include in API requests. By default, fields with 1529 // empty values are omitted from API requests. However, any non-pointer, 1530 // non-interface field appearing in ForceSendFields will be sent to the 1531 // server regardless of whether the field is empty or not. This may be 1532 // used to include empty fields in Patch requests. 1533 ForceSendFields []string `json:"-"` 1534 1535 // NullFields is a list of field names (e.g. "HttpRequest") to include 1536 // in API requests with the JSON null value. By default, fields with 1537 // empty values are omitted from API requests. However, any field with 1538 // an empty value appearing in NullFields will be sent to the server as 1539 // null. It is an error if a field in this list has a non-empty value. 1540 // This may be used to include null fields in Patch requests. 1541 NullFields []string `json:"-"` 1542} 1543 1544func (s *LogEntry) MarshalJSON() ([]byte, error) { 1545 type NoMethod LogEntry 1546 raw := NoMethod(*s) 1547 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1548} 1549 1550// LogEntryOperation: Additional information about a potentially 1551// long-running operation with which 1552// a log entry is associated. 1553type LogEntryOperation struct { 1554 // First: Optional. Set this to True if this is the first log entry in 1555 // the operation. 1556 First bool `json:"first,omitempty"` 1557 1558 // Id: Optional. An arbitrary operation identifier. Log entries with 1559 // the 1560 // same identifier are assumed to be part of the same operation. 1561 Id string `json:"id,omitempty"` 1562 1563 // Last: Optional. Set this to True if this is the last log entry in the 1564 // operation. 1565 Last bool `json:"last,omitempty"` 1566 1567 // Producer: Optional. An arbitrary producer identifier. The combination 1568 // of 1569 // `id` and `producer` must be globally unique. Examples for 1570 // `producer`: 1571 // "MyDivision.MyBigCompany.com", 1572 // "github.com/MyProject/MyApplication". 1573 Producer string `json:"producer,omitempty"` 1574 1575 // ForceSendFields is a list of field names (e.g. "First") to 1576 // unconditionally include in API requests. By default, fields with 1577 // empty values are omitted from API requests. However, any non-pointer, 1578 // non-interface field appearing in ForceSendFields will be sent to the 1579 // server regardless of whether the field is empty or not. This may be 1580 // used to include empty fields in Patch requests. 1581 ForceSendFields []string `json:"-"` 1582 1583 // NullFields is a list of field names (e.g. "First") to include in API 1584 // requests with the JSON null value. By default, fields with empty 1585 // values are omitted from API requests. However, any field with an 1586 // empty value appearing in NullFields will be sent to the server as 1587 // null. It is an error if a field in this list has a non-empty value. 1588 // This may be used to include null fields in Patch requests. 1589 NullFields []string `json:"-"` 1590} 1591 1592func (s *LogEntryOperation) MarshalJSON() ([]byte, error) { 1593 type NoMethod LogEntryOperation 1594 raw := NoMethod(*s) 1595 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1596} 1597 1598// LogEntrySourceLocation: Additional information about the source code 1599// location that produced the log 1600// entry. 1601type LogEntrySourceLocation struct { 1602 // File: Optional. Source file name. Depending on the runtime 1603 // environment, this 1604 // might be a simple name or a fully-qualified name. 1605 File string `json:"file,omitempty"` 1606 1607 // Function: Optional. Human-readable name of the function or method 1608 // being invoked, with 1609 // optional context such as the class or package name. This information 1610 // may be 1611 // used in contexts such as the logs viewer, where a file and line 1612 // number are 1613 // less meaningful. The format can vary by language. For 1614 // example: 1615 // `qual.if.ied.Class.method` (Java), `dir/package.func` (Go), 1616 // `function` 1617 // (Python). 1618 Function string `json:"function,omitempty"` 1619 1620 // Line: Optional. Line within the source file. 1-based; 0 indicates no 1621 // line number 1622 // available. 1623 Line int64 `json:"line,omitempty,string"` 1624 1625 // ForceSendFields is a list of field names (e.g. "File") to 1626 // unconditionally include in API requests. By default, fields with 1627 // empty values are omitted from API requests. However, any non-pointer, 1628 // non-interface field appearing in ForceSendFields will be sent to the 1629 // server regardless of whether the field is empty or not. This may be 1630 // used to include empty fields in Patch requests. 1631 ForceSendFields []string `json:"-"` 1632 1633 // NullFields is a list of field names (e.g. "File") to include in API 1634 // requests with the JSON null value. By default, fields with empty 1635 // values are omitted from API requests. However, any field with an 1636 // empty value appearing in NullFields will be sent to the server as 1637 // null. It is an error if a field in this list has a non-empty value. 1638 // This may be used to include null fields in Patch requests. 1639 NullFields []string `json:"-"` 1640} 1641 1642func (s *LogEntrySourceLocation) MarshalJSON() ([]byte, error) { 1643 type NoMethod LogEntrySourceLocation 1644 raw := NoMethod(*s) 1645 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1646} 1647 1648// MetricValue: Represents a single metric value. 1649type MetricValue struct { 1650 // BoolValue: A boolean value. 1651 BoolValue *bool `json:"boolValue,omitempty"` 1652 1653 // DistributionValue: A distribution value. 1654 DistributionValue *Distribution `json:"distributionValue,omitempty"` 1655 1656 // DoubleValue: A double precision floating point value. 1657 DoubleValue *float64 `json:"doubleValue,omitempty"` 1658 1659 // EndTime: The end of the time period over which this metric value's 1660 // measurement 1661 // applies. 1662 EndTime string `json:"endTime,omitempty"` 1663 1664 // Int64Value: A signed 64-bit integer value. 1665 Int64Value *int64 `json:"int64Value,omitempty,string"` 1666 1667 // Labels: The labels describing the metric value. 1668 // See comments on google.api.servicecontrol.v1.Operation.labels for 1669 // the overriding relationship. 1670 Labels map[string]string `json:"labels,omitempty"` 1671 1672 // MoneyValue: A money value. 1673 MoneyValue *Money `json:"moneyValue,omitempty"` 1674 1675 // StartTime: The start of the time period over which this metric 1676 // value's measurement 1677 // applies. The time period has different semantics for different 1678 // metric 1679 // types (cumulative, delta, and gauge). See the metric 1680 // definition 1681 // documentation in the service configuration for details. 1682 StartTime string `json:"startTime,omitempty"` 1683 1684 // StringValue: A text string value. 1685 StringValue *string `json:"stringValue,omitempty"` 1686 1687 // ForceSendFields is a list of field names (e.g. "BoolValue") to 1688 // unconditionally include in API requests. By default, fields with 1689 // empty values are omitted from API requests. However, any non-pointer, 1690 // non-interface field appearing in ForceSendFields will be sent to the 1691 // server regardless of whether the field is empty or not. This may be 1692 // used to include empty fields in Patch requests. 1693 ForceSendFields []string `json:"-"` 1694 1695 // NullFields is a list of field names (e.g. "BoolValue") to include in 1696 // API requests with the JSON null value. By default, fields with empty 1697 // values are omitted from API requests. However, any field with an 1698 // empty value appearing in NullFields will be sent to the server as 1699 // null. It is an error if a field in this list has a non-empty value. 1700 // This may be used to include null fields in Patch requests. 1701 NullFields []string `json:"-"` 1702} 1703 1704func (s *MetricValue) MarshalJSON() ([]byte, error) { 1705 type NoMethod MetricValue 1706 raw := NoMethod(*s) 1707 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1708} 1709 1710func (s *MetricValue) UnmarshalJSON(data []byte) error { 1711 type NoMethod MetricValue 1712 var s1 struct { 1713 DoubleValue *gensupport.JSONFloat64 `json:"doubleValue"` 1714 *NoMethod 1715 } 1716 s1.NoMethod = (*NoMethod)(s) 1717 if err := json.Unmarshal(data, &s1); err != nil { 1718 return err 1719 } 1720 if s1.DoubleValue != nil { 1721 s.DoubleValue = (*float64)(s1.DoubleValue) 1722 } 1723 return nil 1724} 1725 1726// MetricValueSet: Represents a set of metric values in the same 1727// metric. 1728// Each metric value in the set should have a unique combination of 1729// start time, 1730// end time, and label values. 1731type MetricValueSet struct { 1732 // MetricName: The metric name defined in the service configuration. 1733 MetricName string `json:"metricName,omitempty"` 1734 1735 // MetricValues: The values in this metric. 1736 MetricValues []*MetricValue `json:"metricValues,omitempty"` 1737 1738 // ForceSendFields is a list of field names (e.g. "MetricName") to 1739 // unconditionally include in API requests. By default, fields with 1740 // empty values are omitted from API requests. However, any non-pointer, 1741 // non-interface field appearing in ForceSendFields will be sent to the 1742 // server regardless of whether the field is empty or not. This may be 1743 // used to include empty fields in Patch requests. 1744 ForceSendFields []string `json:"-"` 1745 1746 // NullFields is a list of field names (e.g. "MetricName") to include in 1747 // API requests with the JSON null value. By default, fields with empty 1748 // values are omitted from API requests. However, any field with an 1749 // empty value appearing in NullFields will be sent to the server as 1750 // null. It is an error if a field in this list has a non-empty value. 1751 // This may be used to include null fields in Patch requests. 1752 NullFields []string `json:"-"` 1753} 1754 1755func (s *MetricValueSet) MarshalJSON() ([]byte, error) { 1756 type NoMethod MetricValueSet 1757 raw := NoMethod(*s) 1758 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1759} 1760 1761// Money: Represents an amount of money with its currency type. 1762type Money struct { 1763 // CurrencyCode: The 3-letter currency code defined in ISO 4217. 1764 CurrencyCode string `json:"currencyCode,omitempty"` 1765 1766 // Nanos: Number of nano (10^-9) units of the amount. 1767 // The value must be between -999,999,999 and +999,999,999 inclusive. 1768 // If `units` is positive, `nanos` must be positive or zero. 1769 // If `units` is zero, `nanos` can be positive, zero, or negative. 1770 // If `units` is negative, `nanos` must be negative or zero. 1771 // For example $-1.75 is represented as `units`=-1 and 1772 // `nanos`=-750,000,000. 1773 Nanos int64 `json:"nanos,omitempty"` 1774 1775 // Units: The whole units of the amount. 1776 // For example if `currencyCode` is "USD", then 1 unit is one US 1777 // dollar. 1778 Units int64 `json:"units,omitempty,string"` 1779 1780 // ForceSendFields is a list of field names (e.g. "CurrencyCode") to 1781 // unconditionally include in API requests. By default, fields with 1782 // empty values are omitted from API requests. However, any non-pointer, 1783 // non-interface field appearing in ForceSendFields will be sent to the 1784 // server regardless of whether the field is empty or not. This may be 1785 // used to include empty fields in Patch requests. 1786 ForceSendFields []string `json:"-"` 1787 1788 // NullFields is a list of field names (e.g. "CurrencyCode") to include 1789 // in API requests with the JSON null value. By default, fields with 1790 // empty values are omitted from API requests. However, any field with 1791 // an empty value appearing in NullFields will be sent to the server as 1792 // null. It is an error if a field in this list has a non-empty value. 1793 // This may be used to include null fields in Patch requests. 1794 NullFields []string `json:"-"` 1795} 1796 1797func (s *Money) MarshalJSON() ([]byte, error) { 1798 type NoMethod Money 1799 raw := NoMethod(*s) 1800 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1801} 1802 1803// Operation: Represents information regarding an operation. 1804type Operation struct { 1805 // ConsumerId: Identity of the consumer who is using the service. 1806 // This field should be filled in for the operations initiated by 1807 // a 1808 // consumer, but not for service-initiated operations that are 1809 // not related to a specific consumer. 1810 // 1811 // - This can be in one of the following formats: 1812 // - project:PROJECT_ID, 1813 // - project`_`number:PROJECT_NUMBER, 1814 // - projects/PROJECT_ID or PROJECT_NUMBER, 1815 // - folders/FOLDER_NUMBER, 1816 // - organizations/ORGANIZATION_NUMBER, 1817 // - api`_`key:API_KEY. 1818 ConsumerId string `json:"consumerId,omitempty"` 1819 1820 // EndTime: End time of the operation. 1821 // Required when the operation is used in ServiceController.Report, 1822 // but optional when the operation is used in ServiceController.Check. 1823 EndTime string `json:"endTime,omitempty"` 1824 1825 // Importance: DO NOT USE. This is an experimental field. 1826 // 1827 // Possible values: 1828 // "LOW" - The API implementation may cache and aggregate the 1829 // data. 1830 // The data may be lost when rare and unexpected system failures occur. 1831 // "HIGH" - The API implementation doesn't cache and aggregate the 1832 // data. 1833 // If the method returns successfully, it's guaranteed that the data 1834 // has 1835 // been persisted in durable storage. 1836 // "DEBUG" - In addition to the behavior described in HIGH, DEBUG 1837 // enables 1838 // additional validation logic that is only useful during the 1839 // onboarding 1840 // process. This is only available to Google internal services and 1841 // the service must be whitelisted by chemist-dev@google.com in order 1842 // to use this level. 1843 Importance string `json:"importance,omitempty"` 1844 1845 // Labels: Labels describing the operation. Only the following labels 1846 // are allowed: 1847 // 1848 // - Labels describing monitored resources as defined in 1849 // the service configuration. 1850 // - Default labels of metric values. When specified, labels defined in 1851 // the 1852 // metric value override these default. 1853 // - The following labels defined by Google Cloud Platform: 1854 // - `cloud.googleapis.com/location` describing the location where 1855 // the 1856 // operation happened, 1857 // - `servicecontrol.googleapis.com/user_agent` describing the user 1858 // agent 1859 // of the API request, 1860 // - `servicecontrol.googleapis.com/service_agent` describing the 1861 // service 1862 // used to handle the API request (e.g. ESP), 1863 // - `servicecontrol.googleapis.com/platform` describing the 1864 // platform 1865 // where the API is served, such as App Engine, Compute Engine, 1866 // or 1867 // Kubernetes Engine. 1868 Labels map[string]string `json:"labels,omitempty"` 1869 1870 // LogEntries: Represents information to be logged. 1871 LogEntries []*LogEntry `json:"logEntries,omitempty"` 1872 1873 // MetricValueSets: Represents information about this operation. Each 1874 // MetricValueSet 1875 // corresponds to a metric defined in the service configuration. 1876 // The data type used in the MetricValueSet must agree with 1877 // the data type specified in the metric definition. 1878 // 1879 // Within a single operation, it is not allowed to have more than 1880 // one 1881 // MetricValue instances that have the same metric names and 1882 // identical 1883 // label value combinations. If a request has such duplicated 1884 // MetricValue 1885 // instances, the entire request is rejected with 1886 // an invalid argument error. 1887 MetricValueSets []*MetricValueSet `json:"metricValueSets,omitempty"` 1888 1889 // OperationId: Identity of the operation. This must be unique within 1890 // the scope of the 1891 // service that generated the operation. If the service calls 1892 // Check() and Report() on the same operation, the two calls should 1893 // carry 1894 // the same id. 1895 // 1896 // UUID version 4 is recommended, though not required. 1897 // In scenarios where an operation is computed from existing 1898 // information 1899 // and an idempotent id is desirable for deduplication purpose, UUID 1900 // version 5 1901 // is recommended. See RFC 4122 for details. 1902 OperationId string `json:"operationId,omitempty"` 1903 1904 // OperationName: Fully qualified name of the operation. Reserved for 1905 // future use. 1906 OperationName string `json:"operationName,omitempty"` 1907 1908 // QuotaProperties: Represents the properties needed for quota check. 1909 // Applicable only if this 1910 // operation is for a quota check request. If this is not specified, no 1911 // quota 1912 // check will be performed. 1913 QuotaProperties *QuotaProperties `json:"quotaProperties,omitempty"` 1914 1915 // ResourceContainer: DO NOT USE. This field is deprecated, use 1916 // "resources" field instead. 1917 // The resource name of the parent of a resource in the resource 1918 // hierarchy. 1919 // 1920 // This can be in one of the following formats: 1921 // - “projects/<project-id or project-number>” 1922 // - “folders/<folder-id>” 1923 // - “organizations/<organization-id>” 1924 ResourceContainer string `json:"resourceContainer,omitempty"` 1925 1926 // Resources: The resources that are involved in the operation. 1927 // The maximum supported number of entries in this field is 100. 1928 Resources []*ResourceInfo `json:"resources,omitempty"` 1929 1930 // StartTime: Required. Start time of the operation. 1931 StartTime string `json:"startTime,omitempty"` 1932 1933 // UserLabels: User defined labels for the resource that this operation 1934 // is associated 1935 // with. Only a combination of 1000 user labels per consumer project 1936 // are 1937 // allowed. 1938 UserLabels map[string]string `json:"userLabels,omitempty"` 1939 1940 // ForceSendFields is a list of field names (e.g. "ConsumerId") to 1941 // unconditionally include in API requests. By default, fields with 1942 // empty values are omitted from API requests. However, any non-pointer, 1943 // non-interface field appearing in ForceSendFields will be sent to the 1944 // server regardless of whether the field is empty or not. This may be 1945 // used to include empty fields in Patch requests. 1946 ForceSendFields []string `json:"-"` 1947 1948 // NullFields is a list of field names (e.g. "ConsumerId") to include in 1949 // API requests with the JSON null value. By default, fields with empty 1950 // values are omitted from API requests. However, any field with an 1951 // empty value appearing in NullFields will be sent to the server as 1952 // null. It is an error if a field in this list has a non-empty value. 1953 // This may be used to include null fields in Patch requests. 1954 NullFields []string `json:"-"` 1955} 1956 1957func (s *Operation) MarshalJSON() ([]byte, error) { 1958 type NoMethod Operation 1959 raw := NoMethod(*s) 1960 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1961} 1962 1963// Peer: This message defines attributes for a node that handles a 1964// network request. 1965// The node can be either a service or an application that sends, 1966// forwards, 1967// or receives the request. Service peers should fill in 1968// `principal` and `labels` as appropriate. 1969type Peer struct { 1970 // Ip: The IP address of the peer. 1971 Ip string `json:"ip,omitempty"` 1972 1973 // Labels: The labels associated with the peer. 1974 Labels map[string]string `json:"labels,omitempty"` 1975 1976 // Port: The network port of the peer. 1977 Port int64 `json:"port,omitempty,string"` 1978 1979 // Principal: The identity of this peer. Similar to 1980 // `Request.auth.principal`, but 1981 // relative to the peer instead of the request. For example, the 1982 // idenity associated with a load balancer that forwared the request. 1983 Principal string `json:"principal,omitempty"` 1984 1985 // RegionCode: The CLDR country/region code associated with the above IP 1986 // address. 1987 // If the IP address is private, the `region_code` should reflect 1988 // the 1989 // physical location where this peer is running. 1990 RegionCode string `json:"regionCode,omitempty"` 1991 1992 // ForceSendFields is a list of field names (e.g. "Ip") to 1993 // unconditionally include in API requests. By default, fields with 1994 // empty values are omitted from API requests. However, any non-pointer, 1995 // non-interface field appearing in ForceSendFields will be sent to the 1996 // server regardless of whether the field is empty or not. This may be 1997 // used to include empty fields in Patch requests. 1998 ForceSendFields []string `json:"-"` 1999 2000 // NullFields is a list of field names (e.g. "Ip") to include in API 2001 // requests with the JSON null value. By default, fields with empty 2002 // values are omitted from API requests. However, any field with an 2003 // empty value appearing in NullFields will be sent to the server as 2004 // null. It is an error if a field in this list has a non-empty value. 2005 // This may be used to include null fields in Patch requests. 2006 NullFields []string `json:"-"` 2007} 2008 2009func (s *Peer) MarshalJSON() ([]byte, error) { 2010 type NoMethod Peer 2011 raw := NoMethod(*s) 2012 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2013} 2014 2015// QuotaError: Represents error information for QuotaOperation. 2016type QuotaError struct { 2017 // Code: Error code. 2018 // 2019 // Possible values: 2020 // "UNSPECIFIED" - This is never used. 2021 // "RESOURCE_EXHAUSTED" - Quota allocation failed. 2022 // Same as google.rpc.Code.RESOURCE_EXHAUSTED. 2023 // "OUT_OF_RANGE" - Quota release failed. This error is ONLY returned 2024 // on a NORMAL release. 2025 // More formally: if a user requests a release of 10 tokens, but only 2026 // 5 tokens were previously allocated, in a BEST_EFFORT release, this 2027 // will 2028 // be considered a success, 5 tokens will be released, and the result 2029 // will 2030 // be "Ok". If this is done in NORMAL mode, no tokens will be 2031 // released, 2032 // and an OUT_OF_RANGE error will be returned. 2033 // Same as google.rpc.Code.OUT_OF_RANGE. 2034 // "BILLING_NOT_ACTIVE" - Consumer cannot access the service because 2035 // the service requires active 2036 // billing. 2037 // "PROJECT_DELETED" - Consumer's project has been marked as deleted 2038 // (soft deletion). 2039 // "API_KEY_INVALID" - Specified API key is invalid. 2040 // "API_KEY_EXPIRED" - Specified API Key has expired. 2041 // "SPATULA_HEADER_INVALID" - Consumer's spatula header is invalid. 2042 // "LOAS_ROLE_INVALID" - The consumer's LOAS role is invalid. 2043 // "NO_LOAS_PROJECT" - The consumer's LOAS role has no associated 2044 // project. 2045 // "PROJECT_STATUS_UNAVAILABLE" - The backend server for looking up 2046 // project id/number is unavailable. 2047 // "SERVICE_STATUS_UNAVAILABLE" - The backend server for checking 2048 // service status is unavailable. 2049 // "BILLING_STATUS_UNAVAILABLE" - The backend server for checking 2050 // billing status is unavailable. 2051 // "QUOTA_SYSTEM_UNAVAILABLE" - The backend server for checking quota 2052 // limits is unavailable. 2053 Code string `json:"code,omitempty"` 2054 2055 // Description: Free-form text that provides details on the cause of the 2056 // error. 2057 Description string `json:"description,omitempty"` 2058 2059 // Subject: Subject to whom this error applies. See the specific enum 2060 // for more details 2061 // on this field. For example, "clientip:<ip address of client>" 2062 // or 2063 // "project:<Google developer project id>". 2064 Subject string `json:"subject,omitempty"` 2065 2066 // ForceSendFields is a list of field names (e.g. "Code") to 2067 // unconditionally include in API requests. By default, fields with 2068 // empty values are omitted from API requests. However, any non-pointer, 2069 // non-interface field appearing in ForceSendFields will be sent to the 2070 // server regardless of whether the field is empty or not. This may be 2071 // used to include empty fields in Patch requests. 2072 ForceSendFields []string `json:"-"` 2073 2074 // NullFields is a list of field names (e.g. "Code") to include in API 2075 // requests with the JSON null value. By default, fields with empty 2076 // values are omitted from API requests. However, any field with an 2077 // empty value appearing in NullFields will be sent to the server as 2078 // null. It is an error if a field in this list has a non-empty value. 2079 // This may be used to include null fields in Patch requests. 2080 NullFields []string `json:"-"` 2081} 2082 2083func (s *QuotaError) MarshalJSON() ([]byte, error) { 2084 type NoMethod QuotaError 2085 raw := NoMethod(*s) 2086 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2087} 2088 2089// QuotaInfo: Contains the quota information for a quota check response. 2090type QuotaInfo struct { 2091 // LimitExceeded: Quota Metrics that have exceeded quota limits. 2092 // For QuotaGroup-based quota, this is QuotaGroup.name 2093 // For QuotaLimit-based quota, this is QuotaLimit.name 2094 // See: google.api.Quota 2095 // Deprecated: Use quota_metrics to get per quota group limit exceeded 2096 // status. 2097 LimitExceeded []string `json:"limitExceeded,omitempty"` 2098 2099 // QuotaConsumed: Map of quota group name to the actual number of tokens 2100 // consumed. If the 2101 // quota check was not successful, then this will not be populated due 2102 // to no 2103 // quota consumption. 2104 // 2105 // We are not merging this field with 'quota_metrics' field because of 2106 // the 2107 // complexity of scaling in Chemist client code base. For simplicity, we 2108 // will 2109 // keep this field for Castor (that scales quota usage) and 2110 // 'quota_metrics' 2111 // for SuperQuota (that doesn't scale quota usage). 2112 // 2113 QuotaConsumed map[string]int64 `json:"quotaConsumed,omitempty"` 2114 2115 // QuotaMetrics: Quota metrics to indicate the usage. Depending on the 2116 // check request, one or 2117 // more of the following metrics will be included: 2118 // 2119 // 1. For rate quota, per quota group or per quota metric incremental 2120 // usage 2121 // will be specified using the following delta metric: 2122 // "serviceruntime.googleapis.com/api/consumer/quota_used_count" 2123 // 2124 // 2. For allocation quota, per quota metric total usage will be 2125 // specified 2126 // using the following gauge metric: 2127 // 2128 // "serviceruntime.googleapis.com/allocation/consumer/quota_used_count" 2129 // 2130 // 2131 // 3. For both rate quota and allocation quota, the quota limit 2132 // reached 2133 // condition will be specified using the following boolean metric: 2134 // "serviceruntime.googleapis.com/quota/exceeded" 2135 QuotaMetrics []*MetricValueSet `json:"quotaMetrics,omitempty"` 2136 2137 // ForceSendFields is a list of field names (e.g. "LimitExceeded") to 2138 // unconditionally include in API requests. By default, fields with 2139 // empty values are omitted from API requests. However, any non-pointer, 2140 // non-interface field appearing in ForceSendFields will be sent to the 2141 // server regardless of whether the field is empty or not. This may be 2142 // used to include empty fields in Patch requests. 2143 ForceSendFields []string `json:"-"` 2144 2145 // NullFields is a list of field names (e.g. "LimitExceeded") to include 2146 // in API requests with the JSON null value. By default, fields with 2147 // empty values are omitted from API requests. However, any field with 2148 // an empty value appearing in NullFields will be sent to the server as 2149 // null. It is an error if a field in this list has a non-empty value. 2150 // This may be used to include null fields in Patch requests. 2151 NullFields []string `json:"-"` 2152} 2153 2154func (s *QuotaInfo) MarshalJSON() ([]byte, error) { 2155 type NoMethod QuotaInfo 2156 raw := NoMethod(*s) 2157 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2158} 2159 2160// QuotaOperation: Represents information regarding a quota operation. 2161type QuotaOperation struct { 2162 // ConsumerId: Identity of the consumer for whom this quota operation is 2163 // being performed. 2164 // 2165 // This can be in one of the following formats: 2166 // project:<project_id>, 2167 // project_number:<project_number>, 2168 // api_key:<api_key>. 2169 ConsumerId string `json:"consumerId,omitempty"` 2170 2171 // Labels: Labels describing the operation. 2172 Labels map[string]string `json:"labels,omitempty"` 2173 2174 // MethodName: Fully qualified name of the API method for which this 2175 // quota operation is 2176 // requested. This name is used for matching quota rules or metric rules 2177 // and 2178 // billing status rules defined in service configuration. 2179 // 2180 // This field should not be set if any of the following is true: 2181 // (1) the quota operation is performed on non-API resources. 2182 // (2) quota_metrics is set because the caller is doing quota 2183 // override. 2184 // 2185 // Example of an RPC method name: 2186 // google.example.library.v1.LibraryService.CreateShelf 2187 MethodName string `json:"methodName,omitempty"` 2188 2189 // OperationId: Identity of the operation. This is expected to be unique 2190 // within the scope 2191 // of the service that generated the operation, and guarantees 2192 // idempotency in 2193 // case of retries. 2194 // 2195 // In order to ensure best performance and latency in the Quota 2196 // backends, 2197 // operation_ids are optimally associated with time, so that 2198 // related 2199 // operations can be accessed fast in storage. For this reason, 2200 // the 2201 // recommended token for services that intend to operate at a high QPS 2202 // is 2203 // Unix time in nanos + UUID 2204 OperationId string `json:"operationId,omitempty"` 2205 2206 // QuotaMetrics: Represents information about this operation. Each 2207 // MetricValueSet 2208 // corresponds to a metric defined in the service configuration. 2209 // The data type used in the MetricValueSet must agree with 2210 // the data type specified in the metric definition. 2211 // 2212 // Within a single operation, it is not allowed to have more than 2213 // one 2214 // MetricValue instances that have the same metric names and 2215 // identical 2216 // label value combinations. If a request has such duplicated 2217 // MetricValue 2218 // instances, the entire request is rejected with 2219 // an invalid argument error. 2220 // 2221 // This field is mutually exclusive with method_name. 2222 QuotaMetrics []*MetricValueSet `json:"quotaMetrics,omitempty"` 2223 2224 // QuotaMode: Quota mode for this operation. 2225 // 2226 // Possible values: 2227 // "UNSPECIFIED" - Guard against implicit default. Must not be used. 2228 // "NORMAL" - For AllocateQuota request, allocates quota for the 2229 // amount specified in 2230 // the service configuration or specified using the quota metrics. If 2231 // the 2232 // amount is higher than the available quota, allocation error will 2233 // be 2234 // returned and no quota will be allocated. 2235 // If multiple quotas are part of the request, and one fails, none of 2236 // the 2237 // quotas are allocated or released. 2238 // "BEST_EFFORT" - The operation allocates quota for the amount 2239 // specified in the service 2240 // configuration or specified using the quota metrics. If the amount 2241 // is 2242 // higher than the available quota, request does not fail but all 2243 // available 2244 // quota will be allocated. 2245 // For rate quota, BEST_EFFORT will continue to deduct from other 2246 // groups 2247 // even if one does not have enough quota. For allocation, it will find 2248 // the 2249 // minimum available amount across all groups and deduct that amount 2250 // from 2251 // all the affected groups. 2252 // "CHECK_ONLY" - For AllocateQuota request, only checks if there is 2253 // enough quota 2254 // available and does not change the available quota. No lock is placed 2255 // on 2256 // the available quota either. 2257 QuotaMode string `json:"quotaMode,omitempty"` 2258 2259 // ForceSendFields is a list of field names (e.g. "ConsumerId") to 2260 // unconditionally include in API requests. By default, fields with 2261 // empty values are omitted from API requests. However, any non-pointer, 2262 // non-interface field appearing in ForceSendFields will be sent to the 2263 // server regardless of whether the field is empty or not. This may be 2264 // used to include empty fields in Patch requests. 2265 ForceSendFields []string `json:"-"` 2266 2267 // NullFields is a list of field names (e.g. "ConsumerId") to include in 2268 // API requests with the JSON null value. By default, fields with empty 2269 // values are omitted from API requests. However, any field with an 2270 // empty value appearing in NullFields will be sent to the server as 2271 // null. It is an error if a field in this list has a non-empty value. 2272 // This may be used to include null fields in Patch requests. 2273 NullFields []string `json:"-"` 2274} 2275 2276func (s *QuotaOperation) MarshalJSON() ([]byte, error) { 2277 type NoMethod QuotaOperation 2278 raw := NoMethod(*s) 2279 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2280} 2281 2282// QuotaProperties: Represents the properties needed for quota 2283// operations. 2284type QuotaProperties struct { 2285 // QuotaMode: Quota mode for this operation. 2286 // 2287 // Possible values: 2288 // "ACQUIRE" - Decreases available quota by the cost specified for the 2289 // operation. 2290 // If cost is higher than available quota, operation fails and 2291 // returns 2292 // error. 2293 // "ACQUIRE_BEST_EFFORT" - Decreases available quota by the cost 2294 // specified for the operation. 2295 // If cost is higher than available quota, operation does not fail 2296 // and 2297 // available quota goes down to zero but it returns error. 2298 // "CHECK" - Does not change any available quota. Only checks if there 2299 // is enough 2300 // quota. 2301 // No lock is placed on the checked tokens neither. 2302 // "RELEASE" - Increases available quota by the operation cost 2303 // specified for the 2304 // operation. 2305 QuotaMode string `json:"quotaMode,omitempty"` 2306 2307 // ForceSendFields is a list of field names (e.g. "QuotaMode") to 2308 // unconditionally include in API requests. By default, fields with 2309 // empty values are omitted from API requests. However, any non-pointer, 2310 // non-interface field appearing in ForceSendFields will be sent to the 2311 // server regardless of whether the field is empty or not. This may be 2312 // used to include empty fields in Patch requests. 2313 ForceSendFields []string `json:"-"` 2314 2315 // NullFields is a list of field names (e.g. "QuotaMode") to include in 2316 // API requests with the JSON null value. By default, fields with empty 2317 // values are omitted from API requests. However, any field with an 2318 // empty value appearing in NullFields will be sent to the server as 2319 // null. It is an error if a field in this list has a non-empty value. 2320 // This may be used to include null fields in Patch requests. 2321 NullFields []string `json:"-"` 2322} 2323 2324func (s *QuotaProperties) MarshalJSON() ([]byte, error) { 2325 type NoMethod QuotaProperties 2326 raw := NoMethod(*s) 2327 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2328} 2329 2330// ReportError: Represents the processing error of one Operation in the 2331// request. 2332type ReportError struct { 2333 // OperationId: The Operation.operation_id value from the request. 2334 OperationId string `json:"operationId,omitempty"` 2335 2336 // Status: Details of the error when processing the Operation. 2337 Status *Status `json:"status,omitempty"` 2338 2339 // ForceSendFields is a list of field names (e.g. "OperationId") to 2340 // unconditionally include in API requests. By default, fields with 2341 // empty values are omitted from API requests. However, any non-pointer, 2342 // non-interface field appearing in ForceSendFields will be sent to the 2343 // server regardless of whether the field is empty or not. This may be 2344 // used to include empty fields in Patch requests. 2345 ForceSendFields []string `json:"-"` 2346 2347 // NullFields is a list of field names (e.g. "OperationId") to include 2348 // in API requests with the JSON null value. By default, fields with 2349 // empty values are omitted from API requests. However, any field with 2350 // an empty value appearing in NullFields will be sent to the server as 2351 // null. It is an error if a field in this list has a non-empty value. 2352 // This may be used to include null fields in Patch requests. 2353 NullFields []string `json:"-"` 2354} 2355 2356func (s *ReportError) MarshalJSON() ([]byte, error) { 2357 type NoMethod ReportError 2358 raw := NoMethod(*s) 2359 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2360} 2361 2362// ReportInfo: Contains additional info about the report operation. 2363type ReportInfo struct { 2364 // OperationId: The Operation.operation_id value from the request. 2365 OperationId string `json:"operationId,omitempty"` 2366 2367 // QuotaInfo: Quota usage info when processing the `Operation`. 2368 QuotaInfo *QuotaInfo `json:"quotaInfo,omitempty"` 2369 2370 // ForceSendFields is a list of field names (e.g. "OperationId") to 2371 // unconditionally include in API requests. By default, fields with 2372 // empty values are omitted from API requests. However, any non-pointer, 2373 // non-interface field appearing in ForceSendFields will be sent to the 2374 // server regardless of whether the field is empty or not. This may be 2375 // used to include empty fields in Patch requests. 2376 ForceSendFields []string `json:"-"` 2377 2378 // NullFields is a list of field names (e.g. "OperationId") to include 2379 // in API requests with the JSON null value. By default, fields with 2380 // empty values are omitted from API requests. However, any field with 2381 // an empty value appearing in NullFields will be sent to the server as 2382 // null. It is an error if a field in this list has a non-empty value. 2383 // This may be used to include null fields in Patch requests. 2384 NullFields []string `json:"-"` 2385} 2386 2387func (s *ReportInfo) MarshalJSON() ([]byte, error) { 2388 type NoMethod ReportInfo 2389 raw := NoMethod(*s) 2390 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2391} 2392 2393// ReportRequest: Request message for the Report method. 2394type ReportRequest struct { 2395 // Operations: Operations to be reported. 2396 // 2397 // Typically the service should report one operation per 2398 // request. 2399 // Putting multiple operations into a single request is allowed, but 2400 // should 2401 // be used only when multiple operations are natually available at the 2402 // time 2403 // of the report. 2404 // 2405 // If multiple operations are in a single request, the total request 2406 // size 2407 // should be no larger than 1MB. See ReportResponse.report_errors 2408 // for 2409 // partial failure behavior. 2410 Operations []*Operation `json:"operations,omitempty"` 2411 2412 // ServiceConfigId: Specifies which version of service config should be 2413 // used to process the 2414 // request. 2415 // 2416 // If unspecified or no matching version can be found, the 2417 // latest one will be used. 2418 ServiceConfigId string `json:"serviceConfigId,omitempty"` 2419 2420 // ForceSendFields is a list of field names (e.g. "Operations") to 2421 // unconditionally include in API requests. By default, fields with 2422 // empty values are omitted from API requests. However, any non-pointer, 2423 // non-interface field appearing in ForceSendFields will be sent to the 2424 // server regardless of whether the field is empty or not. This may be 2425 // used to include empty fields in Patch requests. 2426 ForceSendFields []string `json:"-"` 2427 2428 // NullFields is a list of field names (e.g. "Operations") to include in 2429 // API requests with the JSON null value. By default, fields with empty 2430 // values are omitted from API requests. However, any field with an 2431 // empty value appearing in NullFields will be sent to the server as 2432 // null. It is an error if a field in this list has a non-empty value. 2433 // This may be used to include null fields in Patch requests. 2434 NullFields []string `json:"-"` 2435} 2436 2437func (s *ReportRequest) MarshalJSON() ([]byte, error) { 2438 type NoMethod ReportRequest 2439 raw := NoMethod(*s) 2440 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2441} 2442 2443// ReportResponse: Response message for the Report method. 2444type ReportResponse struct { 2445 // ReportErrors: Partial failures, one for each `Operation` in the 2446 // request that failed 2447 // processing. There are three possible combinations of the RPC 2448 // status: 2449 // 2450 // 1. The combination of a successful RPC status and an empty 2451 // `report_errors` 2452 // list indicates a complete success where all `Operations` in the 2453 // request are processed successfully. 2454 // 2. The combination of a successful RPC status and a non-empty 2455 // `report_errors` list indicates a partial success where some 2456 // `Operations` in the request succeeded. Each 2457 // `Operation` that failed processing has a corresponding item 2458 // in this list. 2459 // 3. A failed RPC status indicates a general non-deterministic 2460 // failure. 2461 // When this happens, it's impossible to know which of the 2462 // 'Operations' in the request succeeded or failed. 2463 ReportErrors []*ReportError `json:"reportErrors,omitempty"` 2464 2465 // ReportInfos: Quota usage for each quota release `Operation` 2466 // request. 2467 // 2468 // Fully or partially failed quota release request may or may not be 2469 // present 2470 // in `report_quota_info`. For example, a failed quota release request 2471 // will 2472 // have the current quota usage info when precise quota library returns 2473 // the 2474 // info. A deadline exceeded quota request will not have quota usage 2475 // info. 2476 // 2477 // If there is no quota release request, report_quota_info will be 2478 // empty. 2479 // 2480 ReportInfos []*ReportInfo `json:"reportInfos,omitempty"` 2481 2482 // ServiceConfigId: The actual config id used to process the request. 2483 ServiceConfigId string `json:"serviceConfigId,omitempty"` 2484 2485 // ServiceRolloutId: Unimplemented. The current service rollout id used 2486 // to process the request. 2487 ServiceRolloutId string `json:"serviceRolloutId,omitempty"` 2488 2489 // ServerResponse contains the HTTP response code and headers from the 2490 // server. 2491 googleapi.ServerResponse `json:"-"` 2492 2493 // ForceSendFields is a list of field names (e.g. "ReportErrors") to 2494 // unconditionally include in API requests. By default, fields with 2495 // empty values are omitted from API requests. However, any non-pointer, 2496 // non-interface field appearing in ForceSendFields will be sent to the 2497 // server regardless of whether the field is empty or not. This may be 2498 // used to include empty fields in Patch requests. 2499 ForceSendFields []string `json:"-"` 2500 2501 // NullFields is a list of field names (e.g. "ReportErrors") to include 2502 // in API requests with the JSON null value. By default, fields with 2503 // empty values are omitted from API requests. However, any field with 2504 // an empty value appearing in NullFields will be sent to the server as 2505 // null. It is an error if a field in this list has a non-empty value. 2506 // This may be used to include null fields in Patch requests. 2507 NullFields []string `json:"-"` 2508} 2509 2510func (s *ReportResponse) MarshalJSON() ([]byte, error) { 2511 type NoMethod ReportResponse 2512 raw := NoMethod(*s) 2513 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2514} 2515 2516// Request: This message defines attributes for an HTTP request. If the 2517// actual 2518// request is not an HTTP request, the runtime system should try to 2519// map 2520// the actual request to an equivalent HTTP request. 2521type Request struct { 2522 // Auth: The request authentication. May be absent for unauthenticated 2523 // requests. 2524 // Derived from the HTTP request `Authorization` header or equivalent. 2525 Auth *Auth `json:"auth,omitempty"` 2526 2527 // Headers: The HTTP request headers. If multiple headers share the same 2528 // key, they 2529 // must be merged according to the HTTP spec. All header keys must 2530 // be 2531 // lowercased, because HTTP header keys are case-insensitive. 2532 Headers map[string]string `json:"headers,omitempty"` 2533 2534 // Host: The HTTP request `Host` header value. 2535 Host string `json:"host,omitempty"` 2536 2537 // Id: The unique ID for a request, which can be propagated to 2538 // downstream 2539 // systems. The ID should have low probability of collision 2540 // within a single day for a specific service. 2541 Id string `json:"id,omitempty"` 2542 2543 // Method: The HTTP request method, such as `GET`, `POST`. 2544 Method string `json:"method,omitempty"` 2545 2546 // Path: The HTTP URL path. 2547 Path string `json:"path,omitempty"` 2548 2549 // Protocol: The network protocol used with the request, such as 2550 // "http/1.1", 2551 // "spdy/3", "h2", "h2c", "webrtc", "tcp", "udp", "quic". 2552 // See 2553 // https://www.iana.org/assignments/tls-extensiontype-values/tls-exte 2554 // nsiontype-values.xhtml#alpn-protocol-ids 2555 // for details. 2556 Protocol string `json:"protocol,omitempty"` 2557 2558 // Query: The HTTP URL query in the format of 2559 // `name1=value`&name2=value2`, as it 2560 // appears in the first line of the HTTP request. No decoding is 2561 // performed. 2562 Query string `json:"query,omitempty"` 2563 2564 // Reason: A special parameter for request reason. It is used by 2565 // security systems 2566 // to associate auditing information with a request. 2567 Reason string `json:"reason,omitempty"` 2568 2569 // Scheme: The HTTP URL scheme, such as `http` and `https`. 2570 Scheme string `json:"scheme,omitempty"` 2571 2572 // Size: The HTTP request size in bytes. If unknown, it must be -1. 2573 Size int64 `json:"size,omitempty,string"` 2574 2575 // Time: The timestamp when the `destination` service receives the first 2576 // byte of 2577 // the request. 2578 Time string `json:"time,omitempty"` 2579 2580 // ForceSendFields is a list of field names (e.g. "Auth") to 2581 // unconditionally include in API requests. By default, fields with 2582 // empty values are omitted from API requests. However, any non-pointer, 2583 // non-interface field appearing in ForceSendFields will be sent to the 2584 // server regardless of whether the field is empty or not. This may be 2585 // used to include empty fields in Patch requests. 2586 ForceSendFields []string `json:"-"` 2587 2588 // NullFields is a list of field names (e.g. "Auth") to include in API 2589 // requests with the JSON null value. By default, fields with empty 2590 // values are omitted from API requests. However, any field with an 2591 // empty value appearing in NullFields will be sent to the server as 2592 // null. It is an error if a field in this list has a non-empty value. 2593 // This may be used to include null fields in Patch requests. 2594 NullFields []string `json:"-"` 2595} 2596 2597func (s *Request) MarshalJSON() ([]byte, error) { 2598 type NoMethod Request 2599 raw := NoMethod(*s) 2600 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2601} 2602 2603// RequestMetadata: Metadata about the request. 2604type RequestMetadata struct { 2605 // CallerIp: The IP address of the caller. 2606 // For caller from internet, this will be public IPv4 or IPv6 2607 // address. 2608 // For caller from a Compute Engine VM with external IP address, 2609 // this 2610 // will be the VM's external IP address. For caller from a 2611 // Compute 2612 // Engine VM without external IP address, if the VM is in the 2613 // same 2614 // organization (or project) as the accessed resource, `caller_ip` 2615 // will 2616 // be the VM's internal IPv4 address, otherwise the `caller_ip` will 2617 // be 2618 // redacted to "gce-internal-ip". 2619 // See https://cloud.google.com/compute/docs/vpc/ for more information. 2620 CallerIp string `json:"callerIp,omitempty"` 2621 2622 // CallerNetwork: The network of the caller. 2623 // Set only if the network host project is part of the same GCP 2624 // organization 2625 // (or project) as the accessed resource. 2626 // See https://cloud.google.com/compute/docs/vpc/ for more 2627 // information. 2628 // This is a scheme-less URI full resource name. For example: 2629 // 2630 // 2631 // "//compute.googleapis.com/projects/PROJECT_ID/global/networks/NETWORK_ 2632 // ID" 2633 CallerNetwork string `json:"callerNetwork,omitempty"` 2634 2635 // CallerSuppliedUserAgent: The user agent of the caller. 2636 // This information is not authenticated and should be treated 2637 // accordingly. 2638 // For example: 2639 // 2640 // + `google-api-python-client/1.4.0`: 2641 // The request was made by the Google API client for Python. 2642 // + `Cloud SDK Command Line Tool apitools-client/1.0 gcloud/0.9.62`: 2643 // The request was made by the Google Cloud SDK CLI (gcloud). 2644 // + `AppEngine-Google; (+http://code.google.com/appengine; 2645 // appid: 2646 // s~my-project`: 2647 // The request was made from the `my-project` App Engine app. 2648 // NOLINT 2649 CallerSuppliedUserAgent string `json:"callerSuppliedUserAgent,omitempty"` 2650 2651 // DestinationAttributes: The destination of a network activity, such as 2652 // accepting a TCP connection. 2653 // In a multi hop network activity, the destination represents the 2654 // receiver of 2655 // the last hop. Only two fields are used in this message, Peer.port 2656 // and 2657 // Peer.ip. These fields are optionally populated by those services 2658 // utilizing 2659 // the IAM condition feature. 2660 DestinationAttributes *Peer `json:"destinationAttributes,omitempty"` 2661 2662 // RequestAttributes: Request attributes used in IAM condition 2663 // evaluation. This field contains 2664 // request attributes like request time and access levels associated 2665 // with 2666 // the request. 2667 // 2668 // 2669 // To get the whole view of the attributes used in IAM 2670 // condition evaluation, the user must also look 2671 // into 2672 // `AuditLog.authentication_info.resource_attributes`. 2673 RequestAttributes *Request `json:"requestAttributes,omitempty"` 2674 2675 // ForceSendFields is a list of field names (e.g. "CallerIp") to 2676 // unconditionally include in API requests. By default, fields with 2677 // empty values are omitted from API requests. However, any non-pointer, 2678 // non-interface field appearing in ForceSendFields will be sent to the 2679 // server regardless of whether the field is empty or not. This may be 2680 // used to include empty fields in Patch requests. 2681 ForceSendFields []string `json:"-"` 2682 2683 // NullFields is a list of field names (e.g. "CallerIp") to include in 2684 // API requests with the JSON null value. By default, fields with empty 2685 // values are omitted from API requests. However, any field with an 2686 // empty value appearing in NullFields will be sent to the server as 2687 // null. It is an error if a field in this list has a non-empty value. 2688 // This may be used to include null fields in Patch requests. 2689 NullFields []string `json:"-"` 2690} 2691 2692func (s *RequestMetadata) MarshalJSON() ([]byte, error) { 2693 type NoMethod RequestMetadata 2694 raw := NoMethod(*s) 2695 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2696} 2697 2698// Resource: This message defines core attributes for a resource. A 2699// resource is an 2700// addressable (named) entity provided by the destination service. 2701// For 2702// example, a file stored on a network storage service. 2703type Resource struct { 2704 // Labels: The labels or tags on the resource, such as AWS resource tags 2705 // and 2706 // Kubernetes resource labels. 2707 Labels map[string]string `json:"labels,omitempty"` 2708 2709 // Name: The stable identifier (name) of a resource on the `service`. A 2710 // resource 2711 // can be logically identified as 2712 // "//{resource.service}/{resource.name}". 2713 // The differences between a resource name and a URI are: 2714 // 2715 // * Resource name is a logical identifier, independent of network 2716 // protocol and API version. For example, 2717 // `//pubsub.googleapis.com/projects/123/topics/news-feed`. 2718 // * URI often includes protocol and version information, so it can 2719 // be used directly by applications. For example, 2720 // 2721 // `https://pubsub.googleapis.com/v1/projects/123/topics/news-feed`. 2722 // 2723 // See 2724 // https://cloud.google.com/apis/design/resource_names for details. 2725 Name string `json:"name,omitempty"` 2726 2727 // Service: The name of the service that this resource belongs to, such 2728 // as 2729 // `pubsub.googleapis.com`. The service may be different from the 2730 // DNS 2731 // hostname that actually serves the request. 2732 Service string `json:"service,omitempty"` 2733 2734 // Type: The type of the resource. The syntax is platform-specific 2735 // because 2736 // different platforms define their resources differently. 2737 // 2738 // For Google APIs, the type format must be "{service}/{kind}". 2739 Type string `json:"type,omitempty"` 2740 2741 // ForceSendFields is a list of field names (e.g. "Labels") to 2742 // unconditionally include in API requests. By default, fields with 2743 // empty values are omitted from API requests. However, any non-pointer, 2744 // non-interface field appearing in ForceSendFields will be sent to the 2745 // server regardless of whether the field is empty or not. This may be 2746 // used to include empty fields in Patch requests. 2747 ForceSendFields []string `json:"-"` 2748 2749 // NullFields is a list of field names (e.g. "Labels") to include in API 2750 // requests with the JSON null value. By default, fields with empty 2751 // values are omitted from API requests. However, any field with an 2752 // empty value appearing in NullFields will be sent to the server as 2753 // null. It is an error if a field in this list has a non-empty value. 2754 // This may be used to include null fields in Patch requests. 2755 NullFields []string `json:"-"` 2756} 2757 2758func (s *Resource) MarshalJSON() ([]byte, error) { 2759 type NoMethod Resource 2760 raw := NoMethod(*s) 2761 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2762} 2763 2764// ResourceInfo: Describes a resource associated with this operation. 2765type ResourceInfo struct { 2766 // ResourceContainer: The identifier of the parent of this resource 2767 // instance. 2768 // Must be in one of the following formats: 2769 // - “projects/<project-id or project-number>” 2770 // - “folders/<folder-id>” 2771 // - “organizations/<organization-id>” 2772 ResourceContainer string `json:"resourceContainer,omitempty"` 2773 2774 // ResourceLocation: The location of the resource. If not empty, the 2775 // resource will be checked 2776 // against location policy. The value must be a valid zone, region 2777 // or 2778 // multiregion. For example: "europe-west4" or 2779 // "northamerica-northeast1-a" 2780 ResourceLocation string `json:"resourceLocation,omitempty"` 2781 2782 // ResourceName: Name of the resource. This is used for auditing 2783 // purposes. 2784 ResourceName string `json:"resourceName,omitempty"` 2785 2786 // ForceSendFields is a list of field names (e.g. "ResourceContainer") 2787 // to unconditionally include in API requests. By default, fields with 2788 // empty values are omitted from API requests. However, any non-pointer, 2789 // non-interface field appearing in ForceSendFields will be sent to the 2790 // server regardless of whether the field is empty or not. This may be 2791 // used to include empty fields in Patch requests. 2792 ForceSendFields []string `json:"-"` 2793 2794 // NullFields is a list of field names (e.g. "ResourceContainer") to 2795 // include in API requests with the JSON null value. By default, fields 2796 // with empty values are omitted from API requests. However, any field 2797 // with an empty value appearing in NullFields will be sent to the 2798 // server as null. It is an error if a field in this list has a 2799 // non-empty value. This may be used to include null fields in Patch 2800 // requests. 2801 NullFields []string `json:"-"` 2802} 2803 2804func (s *ResourceInfo) MarshalJSON() ([]byte, error) { 2805 type NoMethod ResourceInfo 2806 raw := NoMethod(*s) 2807 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2808} 2809 2810// ResourceLocation: Location information about a resource. 2811type ResourceLocation struct { 2812 // CurrentLocations: The locations of a resource after the execution of 2813 // the operation. 2814 // Requests to create or delete a location based resource must 2815 // populate 2816 // the 'current_locations' field and not the 'original_locations' 2817 // field. 2818 // For example: 2819 // 2820 // "europe-west1-a" 2821 // "us-east1" 2822 // "nam3" 2823 CurrentLocations []string `json:"currentLocations,omitempty"` 2824 2825 // OriginalLocations: The locations of a resource prior to the execution 2826 // of the operation. 2827 // Requests that mutate the resource's location must populate both 2828 // the 2829 // 'original_locations' as well as the 'current_locations' fields. 2830 // For example: 2831 // 2832 // "europe-west1-a" 2833 // "us-east1" 2834 // "nam3" 2835 OriginalLocations []string `json:"originalLocations,omitempty"` 2836 2837 // ForceSendFields is a list of field names (e.g. "CurrentLocations") to 2838 // unconditionally include in API requests. By default, fields with 2839 // empty values are omitted from API requests. However, any non-pointer, 2840 // non-interface field appearing in ForceSendFields will be sent to the 2841 // server regardless of whether the field is empty or not. This may be 2842 // used to include empty fields in Patch requests. 2843 ForceSendFields []string `json:"-"` 2844 2845 // NullFields is a list of field names (e.g. "CurrentLocations") to 2846 // include in API requests with the JSON null value. By default, fields 2847 // with empty values are omitted from API requests. However, any field 2848 // with an empty value appearing in NullFields will be sent to the 2849 // server as null. It is an error if a field in this list has a 2850 // non-empty value. This may be used to include null fields in Patch 2851 // requests. 2852 NullFields []string `json:"-"` 2853} 2854 2855func (s *ResourceLocation) MarshalJSON() ([]byte, error) { 2856 type NoMethod ResourceLocation 2857 raw := NoMethod(*s) 2858 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2859} 2860 2861// ServiceAccountDelegationInfo: Identity delegation history of an 2862// authenticated service account. 2863type ServiceAccountDelegationInfo struct { 2864 // FirstPartyPrincipal: First party (Google) identity as the real 2865 // authority. 2866 FirstPartyPrincipal *FirstPartyPrincipal `json:"firstPartyPrincipal,omitempty"` 2867 2868 // ThirdPartyPrincipal: Third party identity as the real authority. 2869 ThirdPartyPrincipal *ThirdPartyPrincipal `json:"thirdPartyPrincipal,omitempty"` 2870 2871 // ForceSendFields is a list of field names (e.g. "FirstPartyPrincipal") 2872 // to unconditionally include in API requests. By default, fields with 2873 // empty values are omitted from API requests. However, any non-pointer, 2874 // non-interface field appearing in ForceSendFields will be sent to the 2875 // server regardless of whether the field is empty or not. This may be 2876 // used to include empty fields in Patch requests. 2877 ForceSendFields []string `json:"-"` 2878 2879 // NullFields is a list of field names (e.g. "FirstPartyPrincipal") to 2880 // include in API requests with the JSON null value. By default, fields 2881 // with empty values are omitted from API requests. However, any field 2882 // with an empty value appearing in NullFields will be sent to the 2883 // server as null. It is an error if a field in this list has a 2884 // non-empty value. This may be used to include null fields in Patch 2885 // requests. 2886 NullFields []string `json:"-"` 2887} 2888 2889func (s *ServiceAccountDelegationInfo) MarshalJSON() ([]byte, error) { 2890 type NoMethod ServiceAccountDelegationInfo 2891 raw := NoMethod(*s) 2892 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2893} 2894 2895// Status: The `Status` type defines a logical error model that is 2896// suitable for 2897// different programming environments, including REST APIs and RPC APIs. 2898// It is 2899// used by [gRPC](https://github.com/grpc). Each `Status` message 2900// contains 2901// three pieces of data: error code, error message, and error 2902// details. 2903// 2904// You can find out more about this error model and how to work with it 2905// in the 2906// [API Design Guide](https://cloud.google.com/apis/design/errors). 2907type Status struct { 2908 // Code: The status code, which should be an enum value of 2909 // google.rpc.Code. 2910 Code int64 `json:"code,omitempty"` 2911 2912 // Details: A list of messages that carry the error details. There is a 2913 // common set of 2914 // message types for APIs to use. 2915 Details []googleapi.RawMessage `json:"details,omitempty"` 2916 2917 // Message: A developer-facing error message, which should be in 2918 // English. Any 2919 // user-facing error message should be localized and sent in 2920 // the 2921 // google.rpc.Status.details field, or localized by the client. 2922 Message string `json:"message,omitempty"` 2923 2924 // ForceSendFields is a list of field names (e.g. "Code") to 2925 // unconditionally include in API requests. By default, fields with 2926 // empty values are omitted from API requests. However, any non-pointer, 2927 // non-interface field appearing in ForceSendFields will be sent to the 2928 // server regardless of whether the field is empty or not. This may be 2929 // used to include empty fields in Patch requests. 2930 ForceSendFields []string `json:"-"` 2931 2932 // NullFields is a list of field names (e.g. "Code") to include in API 2933 // requests with the JSON null value. By default, fields with empty 2934 // values are omitted from API requests. However, any field with an 2935 // empty value appearing in NullFields will be sent to the server as 2936 // null. It is an error if a field in this list has a non-empty value. 2937 // This may be used to include null fields in Patch requests. 2938 NullFields []string `json:"-"` 2939} 2940 2941func (s *Status) MarshalJSON() ([]byte, error) { 2942 type NoMethod Status 2943 raw := NoMethod(*s) 2944 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2945} 2946 2947// ThirdPartyPrincipal: Third party identity principal. 2948type ThirdPartyPrincipal struct { 2949 // ThirdPartyClaims: Metadata about third party identity. 2950 ThirdPartyClaims googleapi.RawMessage `json:"thirdPartyClaims,omitempty"` 2951 2952 // ForceSendFields is a list of field names (e.g. "ThirdPartyClaims") to 2953 // unconditionally include in API requests. By default, fields with 2954 // empty values are omitted from API requests. However, any non-pointer, 2955 // non-interface field appearing in ForceSendFields will be sent to the 2956 // server regardless of whether the field is empty or not. This may be 2957 // used to include empty fields in Patch requests. 2958 ForceSendFields []string `json:"-"` 2959 2960 // NullFields is a list of field names (e.g. "ThirdPartyClaims") to 2961 // include in API requests with the JSON null value. By default, fields 2962 // with empty values are omitted from API requests. However, any field 2963 // with an empty value appearing in NullFields will be sent to the 2964 // server as null. It is an error if a field in this list has a 2965 // non-empty value. This may be used to include null fields in Patch 2966 // requests. 2967 NullFields []string `json:"-"` 2968} 2969 2970func (s *ThirdPartyPrincipal) MarshalJSON() ([]byte, error) { 2971 type NoMethod ThirdPartyPrincipal 2972 raw := NoMethod(*s) 2973 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2974} 2975 2976// method id "servicecontrol.services.allocateQuota": 2977 2978type ServicesAllocateQuotaCall struct { 2979 s *Service 2980 serviceName string 2981 allocatequotarequest *AllocateQuotaRequest 2982 urlParams_ gensupport.URLParams 2983 ctx_ context.Context 2984 header_ http.Header 2985} 2986 2987// AllocateQuota: Attempts to allocate quota for the specified consumer. 2988// It should be called 2989// before the operation is executed. 2990// 2991// This method requires the 2992// `servicemanagement.services.quota` 2993// permission on the specified service. For more information, see 2994// [Cloud IAM](https://cloud.google.com/iam). 2995// 2996// **NOTE:** The client **must** fail-open on server errors 2997// `INTERNAL`, 2998// `UNKNOWN`, `DEADLINE_EXCEEDED`, and `UNAVAILABLE`. To ensure 2999// system 3000// reliability, the server may inject these errors to prohibit any 3001// hard 3002// dependency on the quota functionality. 3003func (r *ServicesService) AllocateQuota(serviceName string, allocatequotarequest *AllocateQuotaRequest) *ServicesAllocateQuotaCall { 3004 c := &ServicesAllocateQuotaCall{s: r.s, urlParams_: make(gensupport.URLParams)} 3005 c.serviceName = serviceName 3006 c.allocatequotarequest = allocatequotarequest 3007 return c 3008} 3009 3010// Fields allows partial responses to be retrieved. See 3011// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 3012// for more information. 3013func (c *ServicesAllocateQuotaCall) Fields(s ...googleapi.Field) *ServicesAllocateQuotaCall { 3014 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 3015 return c 3016} 3017 3018// Context sets the context to be used in this call's Do method. Any 3019// pending HTTP request will be aborted if the provided context is 3020// canceled. 3021func (c *ServicesAllocateQuotaCall) Context(ctx context.Context) *ServicesAllocateQuotaCall { 3022 c.ctx_ = ctx 3023 return c 3024} 3025 3026// Header returns an http.Header that can be modified by the caller to 3027// add HTTP headers to the request. 3028func (c *ServicesAllocateQuotaCall) Header() http.Header { 3029 if c.header_ == nil { 3030 c.header_ = make(http.Header) 3031 } 3032 return c.header_ 3033} 3034 3035func (c *ServicesAllocateQuotaCall) doRequest(alt string) (*http.Response, error) { 3036 reqHeaders := make(http.Header) 3037 reqHeaders.Set("x-goog-api-client", "gl-go/1.11.0 gdcl/20190926") 3038 for k, v := range c.header_ { 3039 reqHeaders[k] = v 3040 } 3041 reqHeaders.Set("User-Agent", c.s.userAgent()) 3042 var body io.Reader = nil 3043 body, err := googleapi.WithoutDataWrapper.JSONReader(c.allocatequotarequest) 3044 if err != nil { 3045 return nil, err 3046 } 3047 reqHeaders.Set("Content-Type", "application/json") 3048 c.urlParams_.Set("alt", alt) 3049 c.urlParams_.Set("prettyPrint", "false") 3050 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/services/{serviceName}:allocateQuota") 3051 urls += "?" + c.urlParams_.Encode() 3052 req, err := http.NewRequest("POST", urls, body) 3053 if err != nil { 3054 return nil, err 3055 } 3056 req.Header = reqHeaders 3057 googleapi.Expand(req.URL, map[string]string{ 3058 "serviceName": c.serviceName, 3059 }) 3060 return gensupport.SendRequest(c.ctx_, c.s.client, req) 3061} 3062 3063// Do executes the "servicecontrol.services.allocateQuota" call. 3064// Exactly one of *AllocateQuotaResponse or error will be non-nil. Any 3065// non-2xx status code is an error. Response headers are in either 3066// *AllocateQuotaResponse.ServerResponse.Header or (if a response was 3067// returned at all) in error.(*googleapi.Error).Header. Use 3068// googleapi.IsNotModified to check whether the returned error was 3069// because http.StatusNotModified was returned. 3070func (c *ServicesAllocateQuotaCall) Do(opts ...googleapi.CallOption) (*AllocateQuotaResponse, error) { 3071 gensupport.SetOptions(c.urlParams_, opts...) 3072 res, err := c.doRequest("json") 3073 if res != nil && res.StatusCode == http.StatusNotModified { 3074 if res.Body != nil { 3075 res.Body.Close() 3076 } 3077 return nil, &googleapi.Error{ 3078 Code: res.StatusCode, 3079 Header: res.Header, 3080 } 3081 } 3082 if err != nil { 3083 return nil, err 3084 } 3085 defer googleapi.CloseBody(res) 3086 if err := googleapi.CheckResponse(res); err != nil { 3087 return nil, err 3088 } 3089 ret := &AllocateQuotaResponse{ 3090 ServerResponse: googleapi.ServerResponse{ 3091 Header: res.Header, 3092 HTTPStatusCode: res.StatusCode, 3093 }, 3094 } 3095 target := &ret 3096 if err := gensupport.DecodeResponse(target, res); err != nil { 3097 return nil, err 3098 } 3099 return ret, nil 3100 // { 3101 // "description": "Attempts to allocate quota for the specified consumer. It should be called\nbefore the operation is executed.\n\nThis method requires the `servicemanagement.services.quota`\npermission on the specified service. For more information, see\n[Cloud IAM](https://cloud.google.com/iam).\n\n**NOTE:** The client **must** fail-open on server errors `INTERNAL`,\n`UNKNOWN`, `DEADLINE_EXCEEDED`, and `UNAVAILABLE`. To ensure system\nreliability, the server may inject these errors to prohibit any hard\ndependency on the quota functionality.", 3102 // "flatPath": "v1/services/{serviceName}:allocateQuota", 3103 // "httpMethod": "POST", 3104 // "id": "servicecontrol.services.allocateQuota", 3105 // "parameterOrder": [ 3106 // "serviceName" 3107 // ], 3108 // "parameters": { 3109 // "serviceName": { 3110 // "description": "Name of the service as specified in the service configuration. For example,\n`\"pubsub.googleapis.com\"`.\n\nSee google.api.Service for the definition of a service name.", 3111 // "location": "path", 3112 // "required": true, 3113 // "type": "string" 3114 // } 3115 // }, 3116 // "path": "v1/services/{serviceName}:allocateQuota", 3117 // "request": { 3118 // "$ref": "AllocateQuotaRequest" 3119 // }, 3120 // "response": { 3121 // "$ref": "AllocateQuotaResponse" 3122 // }, 3123 // "scopes": [ 3124 // "https://www.googleapis.com/auth/cloud-platform", 3125 // "https://www.googleapis.com/auth/servicecontrol" 3126 // ] 3127 // } 3128 3129} 3130 3131// method id "servicecontrol.services.check": 3132 3133type ServicesCheckCall struct { 3134 s *Service 3135 serviceName string 3136 checkrequest *CheckRequest 3137 urlParams_ gensupport.URLParams 3138 ctx_ context.Context 3139 header_ http.Header 3140} 3141 3142// Check: Checks whether an operation on a service should be allowed to 3143// proceed 3144// based on the configuration of the service and related policies. It 3145// must be 3146// called before the operation is executed. 3147// 3148// If feasible, the client should cache the check results and reuse them 3149// for 3150// 60 seconds. In case of any server errors, the client should rely on 3151// the 3152// cached results for much longer time to avoid outage. 3153// WARNING: There is general 60s delay for the configuration and 3154// policy 3155// propagation, therefore callers MUST NOT depend on the `Check` method 3156// having 3157// the latest policy information. 3158// 3159// NOTE: the CheckRequest has the size limit of 64KB. 3160// 3161// This method requires the `servicemanagement.services.check` 3162// permission 3163// on the specified service. For more information, see 3164// [Cloud IAM](https://cloud.google.com/iam). 3165func (r *ServicesService) Check(serviceName string, checkrequest *CheckRequest) *ServicesCheckCall { 3166 c := &ServicesCheckCall{s: r.s, urlParams_: make(gensupport.URLParams)} 3167 c.serviceName = serviceName 3168 c.checkrequest = checkrequest 3169 return c 3170} 3171 3172// Fields allows partial responses to be retrieved. See 3173// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 3174// for more information. 3175func (c *ServicesCheckCall) Fields(s ...googleapi.Field) *ServicesCheckCall { 3176 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 3177 return c 3178} 3179 3180// Context sets the context to be used in this call's Do method. Any 3181// pending HTTP request will be aborted if the provided context is 3182// canceled. 3183func (c *ServicesCheckCall) Context(ctx context.Context) *ServicesCheckCall { 3184 c.ctx_ = ctx 3185 return c 3186} 3187 3188// Header returns an http.Header that can be modified by the caller to 3189// add HTTP headers to the request. 3190func (c *ServicesCheckCall) Header() http.Header { 3191 if c.header_ == nil { 3192 c.header_ = make(http.Header) 3193 } 3194 return c.header_ 3195} 3196 3197func (c *ServicesCheckCall) doRequest(alt string) (*http.Response, error) { 3198 reqHeaders := make(http.Header) 3199 reqHeaders.Set("x-goog-api-client", "gl-go/1.11.0 gdcl/20190926") 3200 for k, v := range c.header_ { 3201 reqHeaders[k] = v 3202 } 3203 reqHeaders.Set("User-Agent", c.s.userAgent()) 3204 var body io.Reader = nil 3205 body, err := googleapi.WithoutDataWrapper.JSONReader(c.checkrequest) 3206 if err != nil { 3207 return nil, err 3208 } 3209 reqHeaders.Set("Content-Type", "application/json") 3210 c.urlParams_.Set("alt", alt) 3211 c.urlParams_.Set("prettyPrint", "false") 3212 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/services/{serviceName}:check") 3213 urls += "?" + c.urlParams_.Encode() 3214 req, err := http.NewRequest("POST", urls, body) 3215 if err != nil { 3216 return nil, err 3217 } 3218 req.Header = reqHeaders 3219 googleapi.Expand(req.URL, map[string]string{ 3220 "serviceName": c.serviceName, 3221 }) 3222 return gensupport.SendRequest(c.ctx_, c.s.client, req) 3223} 3224 3225// Do executes the "servicecontrol.services.check" call. 3226// Exactly one of *CheckResponse or error will be non-nil. Any non-2xx 3227// status code is an error. Response headers are in either 3228// *CheckResponse.ServerResponse.Header or (if a response was returned 3229// at all) in error.(*googleapi.Error).Header. Use 3230// googleapi.IsNotModified to check whether the returned error was 3231// because http.StatusNotModified was returned. 3232func (c *ServicesCheckCall) Do(opts ...googleapi.CallOption) (*CheckResponse, error) { 3233 gensupport.SetOptions(c.urlParams_, opts...) 3234 res, err := c.doRequest("json") 3235 if res != nil && res.StatusCode == http.StatusNotModified { 3236 if res.Body != nil { 3237 res.Body.Close() 3238 } 3239 return nil, &googleapi.Error{ 3240 Code: res.StatusCode, 3241 Header: res.Header, 3242 } 3243 } 3244 if err != nil { 3245 return nil, err 3246 } 3247 defer googleapi.CloseBody(res) 3248 if err := googleapi.CheckResponse(res); err != nil { 3249 return nil, err 3250 } 3251 ret := &CheckResponse{ 3252 ServerResponse: googleapi.ServerResponse{ 3253 Header: res.Header, 3254 HTTPStatusCode: res.StatusCode, 3255 }, 3256 } 3257 target := &ret 3258 if err := gensupport.DecodeResponse(target, res); err != nil { 3259 return nil, err 3260 } 3261 return ret, nil 3262 // { 3263 // "description": "Checks whether an operation on a service should be allowed to proceed\nbased on the configuration of the service and related policies. It must be\ncalled before the operation is executed.\n\nIf feasible, the client should cache the check results and reuse them for\n60 seconds. In case of any server errors, the client should rely on the\ncached results for much longer time to avoid outage.\nWARNING: There is general 60s delay for the configuration and policy\npropagation, therefore callers MUST NOT depend on the `Check` method having\nthe latest policy information.\n\nNOTE: the CheckRequest has the size limit of 64KB.\n\nThis method requires the `servicemanagement.services.check` permission\non the specified service. For more information, see\n[Cloud IAM](https://cloud.google.com/iam).", 3264 // "flatPath": "v1/services/{serviceName}:check", 3265 // "httpMethod": "POST", 3266 // "id": "servicecontrol.services.check", 3267 // "parameterOrder": [ 3268 // "serviceName" 3269 // ], 3270 // "parameters": { 3271 // "serviceName": { 3272 // "description": "The service name as specified in its service configuration. For example,\n`\"pubsub.googleapis.com\"`.\n\nSee\n[google.api.Service](https://cloud.google.com/service-management/reference/rpc/google.api#google.api.Service)\nfor the definition of a service name.", 3273 // "location": "path", 3274 // "required": true, 3275 // "type": "string" 3276 // } 3277 // }, 3278 // "path": "v1/services/{serviceName}:check", 3279 // "request": { 3280 // "$ref": "CheckRequest" 3281 // }, 3282 // "response": { 3283 // "$ref": "CheckResponse" 3284 // }, 3285 // "scopes": [ 3286 // "https://www.googleapis.com/auth/cloud-platform", 3287 // "https://www.googleapis.com/auth/servicecontrol" 3288 // ] 3289 // } 3290 3291} 3292 3293// method id "servicecontrol.services.report": 3294 3295type ServicesReportCall struct { 3296 s *Service 3297 serviceName string 3298 reportrequest *ReportRequest 3299 urlParams_ gensupport.URLParams 3300 ctx_ context.Context 3301 header_ http.Header 3302} 3303 3304// Report: Reports operation results to Google Service Control, such as 3305// logs and 3306// metrics. It should be called after an operation is completed. 3307// 3308// If feasible, the client should aggregate reporting data for up to 3309// 5 3310// seconds to reduce API traffic. Limiting aggregation to 5 seconds is 3311// to 3312// reduce data loss during client crashes. Clients should carefully 3313// choose 3314// the aggregation time window to avoid data loss risk more than 3315// 0.01% 3316// for business and compliance reasons. 3317// 3318// NOTE: the ReportRequest has the size limit of 1MB. 3319// 3320// This method requires the `servicemanagement.services.report` 3321// permission 3322// on the specified service. For more information, see 3323// [Google Cloud IAM](https://cloud.google.com/iam). 3324func (r *ServicesService) Report(serviceName string, reportrequest *ReportRequest) *ServicesReportCall { 3325 c := &ServicesReportCall{s: r.s, urlParams_: make(gensupport.URLParams)} 3326 c.serviceName = serviceName 3327 c.reportrequest = reportrequest 3328 return c 3329} 3330 3331// Fields allows partial responses to be retrieved. See 3332// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 3333// for more information. 3334func (c *ServicesReportCall) Fields(s ...googleapi.Field) *ServicesReportCall { 3335 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 3336 return c 3337} 3338 3339// Context sets the context to be used in this call's Do method. Any 3340// pending HTTP request will be aborted if the provided context is 3341// canceled. 3342func (c *ServicesReportCall) Context(ctx context.Context) *ServicesReportCall { 3343 c.ctx_ = ctx 3344 return c 3345} 3346 3347// Header returns an http.Header that can be modified by the caller to 3348// add HTTP headers to the request. 3349func (c *ServicesReportCall) Header() http.Header { 3350 if c.header_ == nil { 3351 c.header_ = make(http.Header) 3352 } 3353 return c.header_ 3354} 3355 3356func (c *ServicesReportCall) doRequest(alt string) (*http.Response, error) { 3357 reqHeaders := make(http.Header) 3358 reqHeaders.Set("x-goog-api-client", "gl-go/1.11.0 gdcl/20190926") 3359 for k, v := range c.header_ { 3360 reqHeaders[k] = v 3361 } 3362 reqHeaders.Set("User-Agent", c.s.userAgent()) 3363 var body io.Reader = nil 3364 body, err := googleapi.WithoutDataWrapper.JSONReader(c.reportrequest) 3365 if err != nil { 3366 return nil, err 3367 } 3368 reqHeaders.Set("Content-Type", "application/json") 3369 c.urlParams_.Set("alt", alt) 3370 c.urlParams_.Set("prettyPrint", "false") 3371 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/services/{serviceName}:report") 3372 urls += "?" + c.urlParams_.Encode() 3373 req, err := http.NewRequest("POST", urls, body) 3374 if err != nil { 3375 return nil, err 3376 } 3377 req.Header = reqHeaders 3378 googleapi.Expand(req.URL, map[string]string{ 3379 "serviceName": c.serviceName, 3380 }) 3381 return gensupport.SendRequest(c.ctx_, c.s.client, req) 3382} 3383 3384// Do executes the "servicecontrol.services.report" call. 3385// Exactly one of *ReportResponse or error will be non-nil. Any non-2xx 3386// status code is an error. Response headers are in either 3387// *ReportResponse.ServerResponse.Header or (if a response was returned 3388// at all) in error.(*googleapi.Error).Header. Use 3389// googleapi.IsNotModified to check whether the returned error was 3390// because http.StatusNotModified was returned. 3391func (c *ServicesReportCall) Do(opts ...googleapi.CallOption) (*ReportResponse, error) { 3392 gensupport.SetOptions(c.urlParams_, opts...) 3393 res, err := c.doRequest("json") 3394 if res != nil && res.StatusCode == http.StatusNotModified { 3395 if res.Body != nil { 3396 res.Body.Close() 3397 } 3398 return nil, &googleapi.Error{ 3399 Code: res.StatusCode, 3400 Header: res.Header, 3401 } 3402 } 3403 if err != nil { 3404 return nil, err 3405 } 3406 defer googleapi.CloseBody(res) 3407 if err := googleapi.CheckResponse(res); err != nil { 3408 return nil, err 3409 } 3410 ret := &ReportResponse{ 3411 ServerResponse: googleapi.ServerResponse{ 3412 Header: res.Header, 3413 HTTPStatusCode: res.StatusCode, 3414 }, 3415 } 3416 target := &ret 3417 if err := gensupport.DecodeResponse(target, res); err != nil { 3418 return nil, err 3419 } 3420 return ret, nil 3421 // { 3422 // "description": "Reports operation results to Google Service Control, such as logs and\nmetrics. It should be called after an operation is completed.\n\nIf feasible, the client should aggregate reporting data for up to 5\nseconds to reduce API traffic. Limiting aggregation to 5 seconds is to\nreduce data loss during client crashes. Clients should carefully choose\nthe aggregation time window to avoid data loss risk more than 0.01%\nfor business and compliance reasons.\n\nNOTE: the ReportRequest has the size limit of 1MB.\n\nThis method requires the `servicemanagement.services.report` permission\non the specified service. For more information, see\n[Google Cloud IAM](https://cloud.google.com/iam).", 3423 // "flatPath": "v1/services/{serviceName}:report", 3424 // "httpMethod": "POST", 3425 // "id": "servicecontrol.services.report", 3426 // "parameterOrder": [ 3427 // "serviceName" 3428 // ], 3429 // "parameters": { 3430 // "serviceName": { 3431 // "description": "The service name as specified in its service configuration. For example,\n`\"pubsub.googleapis.com\"`.\n\nSee\n[google.api.Service](https://cloud.google.com/service-management/reference/rpc/google.api#google.api.Service)\nfor the definition of a service name.", 3432 // "location": "path", 3433 // "required": true, 3434 // "type": "string" 3435 // } 3436 // }, 3437 // "path": "v1/services/{serviceName}:report", 3438 // "request": { 3439 // "$ref": "ReportRequest" 3440 // }, 3441 // "response": { 3442 // "$ref": "ReportResponse" 3443 // }, 3444 // "scopes": [ 3445 // "https://www.googleapis.com/auth/cloud-platform", 3446 // "https://www.googleapis.com/auth/servicecontrol" 3447 // ] 3448 // } 3449 3450} 3451