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