1// Copyright 2021 Google LLC. 2// Use of this source code is governed by a BSD-style 3// license that can be found in the LICENSE file. 4 5// Code generated file. DO NOT EDIT. 6 7// Package 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/v2" 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/v2" 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:v2" 79const apiName = "servicecontrol" 80const apiVersion = "v2" 81const basePath = "https://servicecontrol.googleapis.com/" 82const mtlsBasePath = "https://servicecontrol.mtls.googleapis.com/" 83 84// OAuth2 scopes used by this API. 85const ( 86 // See, edit, configure, and delete your Google Cloud data and see the 87 // email address for your Google Account. 88 CloudPlatformScope = "https://www.googleapis.com/auth/cloud-platform" 89 90 // Manage your Google Service Control data 91 ServicecontrolScope = "https://www.googleapis.com/auth/servicecontrol" 92) 93 94// NewService creates a new Service. 95func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, error) { 96 scopesOption := option.WithScopes( 97 "https://www.googleapis.com/auth/cloud-platform", 98 "https://www.googleapis.com/auth/servicecontrol", 99 ) 100 // NOTE: prepend, so we don't override user-specified scopes. 101 opts = append([]option.ClientOption{scopesOption}, opts...) 102 opts = append(opts, internaloption.WithDefaultEndpoint(basePath)) 103 opts = append(opts, internaloption.WithDefaultMTLSEndpoint(mtlsBasePath)) 104 client, endpoint, err := htransport.NewClient(ctx, opts...) 105 if err != nil { 106 return nil, err 107 } 108 s, err := New(client) 109 if err != nil { 110 return nil, err 111 } 112 if endpoint != "" { 113 s.BasePath = endpoint 114 } 115 return s, nil 116} 117 118// New creates a new Service. It uses the provided http.Client for requests. 119// 120// Deprecated: please use NewService instead. 121// To provide a custom HTTP client, use option.WithHTTPClient. 122// If you are using google.golang.org/api/googleapis/transport.APIKey, use option.WithAPIKey with NewService instead. 123func New(client *http.Client) (*Service, error) { 124 if client == nil { 125 return nil, errors.New("client is nil") 126 } 127 s := &Service{client: client, BasePath: basePath} 128 s.Services = NewServicesService(s) 129 return s, nil 130} 131 132type Service struct { 133 client *http.Client 134 BasePath string // API endpoint base URL 135 UserAgent string // optional additional User-Agent fragment 136 137 Services *ServicesService 138} 139 140func (s *Service) userAgent() string { 141 if s.UserAgent == "" { 142 return googleapi.UserAgent 143 } 144 return googleapi.UserAgent + " " + s.UserAgent 145} 146 147func NewServicesService(s *Service) *ServicesService { 148 rs := &ServicesService{s: s} 149 return rs 150} 151 152type ServicesService struct { 153 s *Service 154} 155 156// Api: This message defines attributes associated with API operations, 157// such as a network API request. The terminology is based on the 158// conventions used by Google APIs, Istio, and OpenAPI. 159type Api struct { 160 // Operation: The API operation name. For gRPC requests, it is the fully 161 // qualified API method name, such as 162 // "google.pubsub.v1.Publisher.Publish". For OpenAPI requests, it is the 163 // `operationId`, such as "getPet". 164 Operation string `json:"operation,omitempty"` 165 166 // Protocol: The API protocol used for sending the request, such as 167 // "http", "https", "grpc", or "internal". 168 Protocol string `json:"protocol,omitempty"` 169 170 // Service: The API service name. It is a logical identifier for a 171 // networked API, such as "pubsub.googleapis.com". The naming syntax 172 // depends on the API management system being used for handling the 173 // request. 174 Service string `json:"service,omitempty"` 175 176 // Version: The API version associated with the API operation above, 177 // such as "v1" or "v1alpha1". 178 Version string `json:"version,omitempty"` 179 180 // ForceSendFields is a list of field names (e.g. "Operation") to 181 // unconditionally include in API requests. By default, fields with 182 // empty or default values are omitted from API requests. However, any 183 // non-pointer, non-interface field appearing in ForceSendFields will be 184 // sent to the server regardless of whether the field is empty or not. 185 // This may be used to include empty fields in Patch requests. 186 ForceSendFields []string `json:"-"` 187 188 // NullFields is a list of field names (e.g. "Operation") to include in 189 // API requests with the JSON null value. By default, fields with empty 190 // values are omitted from API requests. However, any field with an 191 // empty value appearing in NullFields will be sent to the server as 192 // null. It is an error if a field in this list has a non-empty value. 193 // This may be used to include null fields in Patch requests. 194 NullFields []string `json:"-"` 195} 196 197func (s *Api) MarshalJSON() ([]byte, error) { 198 type NoMethod Api 199 raw := NoMethod(*s) 200 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 201} 202 203// AttributeContext: This message defines the standard attribute 204// vocabulary for Google APIs. An attribute is a piece of metadata that 205// describes an activity on a network service. For example, the size of 206// an HTTP request, or the status code of an HTTP response. Each 207// attribute has a type and a name, which is logically defined as a 208// proto message field in `AttributeContext`. The field type becomes the 209// attribute type, and the field path becomes the attribute name. For 210// example, the attribute `source.ip` maps to field 211// `AttributeContext.source.ip`. This message definition is guaranteed 212// not to have any wire breaking change. So you can use it directly for 213// passing attributes across different systems. NOTE: Different system 214// may generate different subset of attributes. Please verify the system 215// specification before relying on an attribute generated a system. 216type AttributeContext struct { 217 // Api: Represents an API operation that is involved to a network 218 // activity. 219 Api *Api `json:"api,omitempty"` 220 221 // Destination: The destination of a network activity, such as accepting 222 // a TCP connection. In a multi hop network activity, the destination 223 // represents the receiver of the last hop. 224 Destination *Peer `json:"destination,omitempty"` 225 226 // Extensions: Supports extensions for advanced use cases, such as logs 227 // and metrics. 228 Extensions []googleapi.RawMessage `json:"extensions,omitempty"` 229 230 // Origin: The origin of a network activity. In a multi hop network 231 // activity, the origin represents the sender of the first hop. For the 232 // first hop, the `source` and the `origin` must have the same content. 233 Origin *Peer `json:"origin,omitempty"` 234 235 // Request: Represents a network request, such as an HTTP request. 236 Request *Request `json:"request,omitempty"` 237 238 // Resource: Represents a target resource that is involved with a 239 // network activity. If multiple resources are involved with an 240 // activity, this must be the primary one. 241 Resource *Resource `json:"resource,omitempty"` 242 243 // Response: Represents a network response, such as an HTTP response. 244 Response *Response `json:"response,omitempty"` 245 246 // Source: The source of a network activity, such as starting a TCP 247 // connection. In a multi hop network activity, the source represents 248 // the sender of the last hop. 249 Source *Peer `json:"source,omitempty"` 250 251 // ForceSendFields is a list of field names (e.g. "Api") to 252 // unconditionally include in API requests. By default, fields with 253 // empty or default values are omitted from API requests. However, any 254 // non-pointer, non-interface field appearing in ForceSendFields will be 255 // sent to the server regardless of whether the field is empty or not. 256 // This may be used to include empty fields in Patch requests. 257 ForceSendFields []string `json:"-"` 258 259 // NullFields is a list of field names (e.g. "Api") to include in API 260 // requests with the JSON null value. By default, fields with empty 261 // values are omitted from API requests. However, any field with an 262 // empty value appearing in NullFields will be sent to the server as 263 // null. It is an error if a field in this list has a non-empty value. 264 // This may be used to include null fields in Patch requests. 265 NullFields []string `json:"-"` 266} 267 268func (s *AttributeContext) MarshalJSON() ([]byte, error) { 269 type NoMethod AttributeContext 270 raw := NoMethod(*s) 271 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 272} 273 274// AuditLog: Common audit log format for Google Cloud Platform API 275// operations. 276type AuditLog struct { 277 // AuthenticationInfo: Authentication information. 278 AuthenticationInfo *AuthenticationInfo `json:"authenticationInfo,omitempty"` 279 280 // AuthorizationInfo: Authorization information. If there are multiple 281 // resources or permissions involved, then there is one 282 // AuthorizationInfo element for each {resource, permission} tuple. 283 AuthorizationInfo []*AuthorizationInfo `json:"authorizationInfo,omitempty"` 284 285 // Metadata: Other service-specific data about the request, response, 286 // and other information associated with the current audited event. 287 Metadata googleapi.RawMessage `json:"metadata,omitempty"` 288 289 // MethodName: The name of the service method or operation. For API 290 // calls, this should be the name of the API method. For example, 291 // "google.cloud.bigquery.v2.TableService.InsertTable" 292 // "google.logging.v2.ConfigServiceV2.CreateSink" 293 MethodName string `json:"methodName,omitempty"` 294 295 // NumResponseItems: The number of items returned from a List or Query 296 // API method, if applicable. 297 NumResponseItems int64 `json:"numResponseItems,omitempty,string"` 298 299 // Request: The operation request. This may not include all request 300 // parameters, such as those that are too large, privacy-sensitive, or 301 // duplicated elsewhere in the log record. It should never include 302 // user-generated data, such as file contents. When the JSON object 303 // represented here has a proto equivalent, the proto name will be 304 // indicated in the `@type` property. 305 Request googleapi.RawMessage `json:"request,omitempty"` 306 307 // RequestMetadata: Metadata about the operation. 308 RequestMetadata *RequestMetadata `json:"requestMetadata,omitempty"` 309 310 // ResourceLocation: The resource location information. 311 ResourceLocation *ResourceLocation `json:"resourceLocation,omitempty"` 312 313 // ResourceName: The resource or collection that is the target of the 314 // operation. The name is a scheme-less URI, not including the API 315 // service name. For example: 316 // "projects/PROJECT_ID/zones/us-central1-a/instances" 317 // "projects/PROJECT_ID/datasets/DATASET_ID" 318 ResourceName string `json:"resourceName,omitempty"` 319 320 // ResourceOriginalState: The resource's original state before mutation. 321 // Present only for operations which have successfully modified the 322 // targeted resource(s). In general, this field should contain all 323 // changed fields, except those that are already been included in 324 // `request`, `response`, `metadata` or `service_data` fields. When the 325 // JSON object represented here has a proto equivalent, the proto name 326 // will be indicated in the `@type` property. 327 ResourceOriginalState googleapi.RawMessage `json:"resourceOriginalState,omitempty"` 328 329 // Response: The operation response. This may not include all response 330 // elements, such as those that are too large, privacy-sensitive, or 331 // duplicated elsewhere in the log record. It should never include 332 // user-generated data, such as file contents. When the JSON object 333 // represented here has a proto equivalent, the proto name will be 334 // indicated in the `@type` property. 335 Response googleapi.RawMessage `json:"response,omitempty"` 336 337 // ServiceData: Deprecated. Use the `metadata` field instead. Other 338 // service-specific data about the request, response, and other 339 // activities. 340 ServiceData googleapi.RawMessage `json:"serviceData,omitempty"` 341 342 // ServiceName: The name of the API service performing the operation. 343 // For example, "compute.googleapis.com". 344 ServiceName string `json:"serviceName,omitempty"` 345 346 // Status: The status of the overall operation. 347 Status *Status `json:"status,omitempty"` 348 349 // ForceSendFields is a list of field names (e.g. "AuthenticationInfo") 350 // to unconditionally include in API requests. By default, fields with 351 // empty or default values are omitted from API requests. However, any 352 // non-pointer, non-interface field appearing in ForceSendFields will be 353 // sent to the server regardless of whether the field is empty or not. 354 // This may be used to include empty fields in Patch requests. 355 ForceSendFields []string `json:"-"` 356 357 // NullFields is a list of field names (e.g. "AuthenticationInfo") to 358 // include in API requests with the JSON null value. By default, fields 359 // with empty values are omitted from API requests. However, any field 360 // with an empty value appearing in NullFields will be sent to the 361 // server as null. It is an error if a field in this list has a 362 // non-empty value. This may be used to include null fields in Patch 363 // requests. 364 NullFields []string `json:"-"` 365} 366 367func (s *AuditLog) MarshalJSON() ([]byte, error) { 368 type NoMethod AuditLog 369 raw := NoMethod(*s) 370 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 371} 372 373// Auth: This message defines request authentication attributes. 374// Terminology is based on the JSON Web Token (JWT) standard, but the 375// terms also correlate to concepts in other standards. 376type Auth struct { 377 // AccessLevels: A list of access level resource names that allow 378 // resources to be accessed by authenticated requester. It is part of 379 // Secure GCP processing for the incoming request. An access level 380 // string has the format: 381 // "//{api_service_name}/accessPolicies/{policy_id}/accessLevels/{short_n 382 // ame}" Example: 383 // "//accesscontextmanager.googleapis.com/accessPolicies/MY_POLICY_ID/acc 384 // essLevels/MY_LEVEL" 385 AccessLevels []string `json:"accessLevels,omitempty"` 386 387 // Audiences: The intended audience(s) for this authentication 388 // information. Reflects the audience (`aud`) claim within a JWT. The 389 // audience value(s) depends on the `issuer`, but typically include one 390 // or more of the following pieces of information: * The services 391 // intended to receive the credential. For example, 392 // ["https://pubsub.googleapis.com/", 393 // "https://storage.googleapis.com/"]. * A set of service-based scopes. 394 // For example, ["https://www.googleapis.com/auth/cloud-platform"]. * 395 // The client id of an app, such as the Firebase project id for JWTs 396 // from Firebase Auth. Consult the documentation for the credential 397 // issuer to determine the information provided. 398 Audiences []string `json:"audiences,omitempty"` 399 400 // Claims: Structured claims presented with the credential. JWTs include 401 // `{key: value}` pairs for standard and private claims. The following 402 // is a subset of the standard required and optional claims that would 403 // typically be presented for a Google-based JWT: {'iss': 404 // 'accounts.google.com', 'sub': '113289723416554971153', 'aud': 405 // ['123456789012', 'pubsub.googleapis.com'], 'azp': 406 // '123456789012.apps.googleusercontent.com', 'email': 407 // 'jsmith@example.com', 'iat': 1353601026, 'exp': 1353604926} SAML 408 // assertions are similarly specified, but with an identity provider 409 // dependent structure. 410 Claims googleapi.RawMessage `json:"claims,omitempty"` 411 412 // Presenter: The authorized presenter of the credential. Reflects the 413 // optional Authorized Presenter (`azp`) claim within a JWT or the OAuth 414 // client id. For example, a Google Cloud Platform client id looks as 415 // follows: "123456789012.apps.googleusercontent.com". 416 Presenter string `json:"presenter,omitempty"` 417 418 // Principal: The authenticated principal. Reflects the issuer (`iss`) 419 // and subject (`sub`) claims within a JWT. The issuer and subject 420 // should be `/` delimited, with `/` percent-encoded within the subject 421 // fragment. For Google accounts, the principal format is: 422 // "https://accounts.google.com/{id}" 423 Principal string `json:"principal,omitempty"` 424 425 // ForceSendFields is a list of field names (e.g. "AccessLevels") to 426 // unconditionally include in API requests. By default, fields with 427 // empty or default values are omitted from API requests. However, any 428 // non-pointer, non-interface field appearing in ForceSendFields will be 429 // sent to the server regardless of whether the field is empty or not. 430 // This may be used to include empty fields in Patch requests. 431 ForceSendFields []string `json:"-"` 432 433 // NullFields is a list of field names (e.g. "AccessLevels") to include 434 // in API requests with the JSON null value. By default, fields with 435 // empty values are omitted from API requests. However, any field with 436 // an empty value appearing in NullFields will be sent to the server as 437 // null. It is an error if a field in this list has a non-empty value. 438 // This may be used to include null fields in Patch requests. 439 NullFields []string `json:"-"` 440} 441 442func (s *Auth) MarshalJSON() ([]byte, error) { 443 type NoMethod Auth 444 raw := NoMethod(*s) 445 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 446} 447 448// AuthenticationInfo: Authentication information for the operation. 449type AuthenticationInfo struct { 450 // AuthoritySelector: The authority selector specified by the requestor, 451 // if any. It is not guaranteed that the principal was allowed to use 452 // this authority. 453 AuthoritySelector string `json:"authoritySelector,omitempty"` 454 455 // PrincipalEmail: The email address of the authenticated user (or 456 // service account on behalf of third party principal) making the 457 // request. For third party identity callers, the `principal_subject` 458 // field is populated instead of this field. For privacy reasons, the 459 // principal email address is sometimes redacted. For more information, 460 // see Caller identities in audit logs 461 // (https://cloud.google.com/logging/docs/audit#user-id). 462 PrincipalEmail string `json:"principalEmail,omitempty"` 463 464 // PrincipalSubject: String representation of identity of requesting 465 // party. Populated for both first and third party identities. 466 PrincipalSubject string `json:"principalSubject,omitempty"` 467 468 // ServiceAccountDelegationInfo: Identity delegation history of an 469 // authenticated service account that makes the request. It contains 470 // information on the real authorities that try to access GCP resources 471 // by delegating on a service account. When multiple authorities 472 // present, they are guaranteed to be sorted based on the original 473 // ordering of the identity delegation events. 474 ServiceAccountDelegationInfo []*ServiceAccountDelegationInfo `json:"serviceAccountDelegationInfo,omitempty"` 475 476 // ServiceAccountKeyName: The name of the service account key used to 477 // create or exchange credentials for authenticating the service account 478 // making the request. This is a scheme-less URI full resource name. For 479 // example: 480 // "//iam.googleapis.com/projects/{PROJECT_ID}/serviceAccounts/{ACCOUNT}/ 481 // keys/{key}" 482 ServiceAccountKeyName string `json:"serviceAccountKeyName,omitempty"` 483 484 // ThirdPartyPrincipal: The third party identification (if any) of the 485 // authenticated user making the request. When the JSON object 486 // represented here has a proto equivalent, the proto name will be 487 // indicated in the `@type` property. 488 ThirdPartyPrincipal googleapi.RawMessage `json:"thirdPartyPrincipal,omitempty"` 489 490 // ForceSendFields is a list of field names (e.g. "AuthoritySelector") 491 // to unconditionally include in API requests. By default, fields with 492 // empty or default values are omitted from API requests. However, any 493 // non-pointer, non-interface field appearing in ForceSendFields will be 494 // sent to the server regardless of whether the field is empty or not. 495 // This may be used to include empty fields in Patch requests. 496 ForceSendFields []string `json:"-"` 497 498 // NullFields is a list of field names (e.g. "AuthoritySelector") to 499 // include in API requests with the JSON null value. By default, fields 500 // with empty values are omitted from API requests. However, any field 501 // with an empty value appearing in NullFields will be sent to the 502 // server as null. It is an error if a field in this list has a 503 // non-empty value. This may be used to include null fields in Patch 504 // requests. 505 NullFields []string `json:"-"` 506} 507 508func (s *AuthenticationInfo) MarshalJSON() ([]byte, error) { 509 type NoMethod AuthenticationInfo 510 raw := NoMethod(*s) 511 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 512} 513 514// AuthorizationInfo: Authorization information for the operation. 515type AuthorizationInfo struct { 516 // Granted: Whether or not authorization for `resource` and `permission` 517 // was granted. 518 Granted bool `json:"granted,omitempty"` 519 520 // Permission: The required IAM permission. 521 Permission string `json:"permission,omitempty"` 522 523 // Resource: The resource being accessed, as a REST-style or cloud 524 // resource string. For example: 525 // bigquery.googleapis.com/projects/PROJECTID/datasets/DATASETID or 526 // projects/PROJECTID/datasets/DATASETID 527 Resource string `json:"resource,omitempty"` 528 529 // ResourceAttributes: Resource attributes used in IAM condition 530 // evaluation. This field contains resource attributes like resource 531 // type and resource name. To get the whole view of the attributes used 532 // in IAM condition evaluation, the user must also look into 533 // `AuditLog.request_metadata.request_attributes`. 534 ResourceAttributes *Resource `json:"resourceAttributes,omitempty"` 535 536 // ForceSendFields is a list of field names (e.g. "Granted") to 537 // unconditionally include in API requests. By default, fields with 538 // empty or default values are omitted from API requests. However, any 539 // non-pointer, non-interface field appearing in ForceSendFields will be 540 // sent to the server regardless of whether the field is empty or not. 541 // This may be used to include empty fields in Patch requests. 542 ForceSendFields []string `json:"-"` 543 544 // NullFields is a list of field names (e.g. "Granted") to include in 545 // API requests with the JSON null value. By default, fields with empty 546 // values are omitted from API requests. However, any field with an 547 // empty value appearing in NullFields will be sent to the server as 548 // null. It is an error if a field in this list has a non-empty value. 549 // This may be used to include null fields in Patch requests. 550 NullFields []string `json:"-"` 551} 552 553func (s *AuthorizationInfo) MarshalJSON() ([]byte, error) { 554 type NoMethod AuthorizationInfo 555 raw := NoMethod(*s) 556 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 557} 558 559// CheckRequest: Request message for the Check method. 560type CheckRequest struct { 561 // Attributes: Describes attributes about the operation being executed 562 // by the service. 563 Attributes *AttributeContext `json:"attributes,omitempty"` 564 565 // Flags: Optional. Contains a comma-separated list of flags. 566 Flags string `json:"flags,omitempty"` 567 568 // Resources: Describes the resources and the policies applied to each 569 // resource. 570 Resources []*ResourceInfo `json:"resources,omitempty"` 571 572 // ServiceConfigId: Specifies the version of the service configuration 573 // that should be used to process the request. Must not be empty. Set 574 // this field to 'latest' to specify using the latest configuration. 575 ServiceConfigId string `json:"serviceConfigId,omitempty"` 576 577 // ForceSendFields is a list of field names (e.g. "Attributes") to 578 // unconditionally include in API requests. By default, fields with 579 // empty or default values are omitted from API requests. However, any 580 // non-pointer, non-interface field appearing in ForceSendFields will be 581 // sent to the server regardless of whether the field is empty or not. 582 // This may be used to include empty fields in Patch requests. 583 ForceSendFields []string `json:"-"` 584 585 // NullFields is a list of field names (e.g. "Attributes") to include in 586 // API requests with the JSON null value. By default, fields with empty 587 // values are omitted from API requests. However, any field with an 588 // empty value appearing in NullFields will be sent to the server as 589 // null. It is an error if a field in this list has a non-empty value. 590 // This may be used to include null fields in Patch requests. 591 NullFields []string `json:"-"` 592} 593 594func (s *CheckRequest) MarshalJSON() ([]byte, error) { 595 type NoMethod CheckRequest 596 raw := NoMethod(*s) 597 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 598} 599 600// CheckResponse: Response message for the Check method. 601type CheckResponse struct { 602 // Headers: Returns a set of request contexts generated from the 603 // `CheckRequest`. 604 Headers map[string]string `json:"headers,omitempty"` 605 606 // Status: Operation is allowed when this field is not set. Any non-'OK' 607 // status indicates a denial; google.rpc.Status.details () would contain 608 // additional details about the denial. 609 Status *Status `json:"status,omitempty"` 610 611 // ServerResponse contains the HTTP response code and headers from the 612 // server. 613 googleapi.ServerResponse `json:"-"` 614 615 // ForceSendFields is a list of field names (e.g. "Headers") to 616 // unconditionally include in API requests. By default, fields with 617 // empty or default values are omitted from API requests. However, any 618 // non-pointer, non-interface field appearing in ForceSendFields will be 619 // sent to the server regardless of whether the field is empty or not. 620 // This may be used to include empty fields in Patch requests. 621 ForceSendFields []string `json:"-"` 622 623 // NullFields is a list of field names (e.g. "Headers") to include in 624 // API requests with the JSON null value. By default, fields with empty 625 // values are omitted from API requests. However, any field with an 626 // empty value appearing in NullFields will be sent to the server as 627 // null. It is an error if a field in this list has a non-empty value. 628 // This may be used to include null fields in Patch requests. 629 NullFields []string `json:"-"` 630} 631 632func (s *CheckResponse) MarshalJSON() ([]byte, error) { 633 type NoMethod CheckResponse 634 raw := NoMethod(*s) 635 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 636} 637 638// FirstPartyPrincipal: First party identity principal. 639type FirstPartyPrincipal struct { 640 // PrincipalEmail: The email address of a Google account. . 641 PrincipalEmail string `json:"principalEmail,omitempty"` 642 643 // ServiceMetadata: Metadata about the service that uses the service 644 // account. . 645 ServiceMetadata googleapi.RawMessage `json:"serviceMetadata,omitempty"` 646 647 // ForceSendFields is a list of field names (e.g. "PrincipalEmail") to 648 // unconditionally include in API requests. By default, fields with 649 // empty or default values are omitted from API requests. However, any 650 // non-pointer, non-interface field appearing in ForceSendFields will be 651 // sent to the server regardless of whether the field is empty or not. 652 // This may be used to include empty fields in Patch requests. 653 ForceSendFields []string `json:"-"` 654 655 // NullFields is a list of field names (e.g. "PrincipalEmail") to 656 // include in API requests with the JSON null value. By default, fields 657 // with empty values are omitted from API requests. However, any field 658 // with an empty value appearing in NullFields will be sent to the 659 // server as null. It is an error if a field in this list has a 660 // non-empty value. This may be used to include null fields in Patch 661 // requests. 662 NullFields []string `json:"-"` 663} 664 665func (s *FirstPartyPrincipal) MarshalJSON() ([]byte, error) { 666 type NoMethod FirstPartyPrincipal 667 raw := NoMethod(*s) 668 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 669} 670 671// Peer: This message defines attributes for a node that handles a 672// network request. The node can be either a service or an application 673// that sends, forwards, or receives the request. Service peers should 674// fill in `principal` and `labels` as appropriate. 675type Peer struct { 676 // Ip: The IP address of the peer. 677 Ip string `json:"ip,omitempty"` 678 679 // Labels: The labels associated with the peer. 680 Labels map[string]string `json:"labels,omitempty"` 681 682 // Port: The network port of the peer. 683 Port int64 `json:"port,omitempty,string"` 684 685 // Principal: The identity of this peer. Similar to 686 // `Request.auth.principal`, but relative to the peer instead of the 687 // request. For example, the idenity associated with a load balancer 688 // that forwared the request. 689 Principal string `json:"principal,omitempty"` 690 691 // RegionCode: The CLDR country/region code associated with the above IP 692 // address. If the IP address is private, the `region_code` should 693 // reflect the physical location where this peer is running. 694 RegionCode string `json:"regionCode,omitempty"` 695 696 // ForceSendFields is a list of field names (e.g. "Ip") to 697 // unconditionally include in API requests. By default, fields with 698 // empty or default values are omitted from API requests. However, any 699 // non-pointer, non-interface field appearing in ForceSendFields will be 700 // sent to the server regardless of whether the field is empty or not. 701 // This may be used to include empty fields in Patch requests. 702 ForceSendFields []string `json:"-"` 703 704 // NullFields is a list of field names (e.g. "Ip") to include in API 705 // requests with the JSON null value. By default, fields with empty 706 // values are omitted from API requests. However, any field with an 707 // empty value appearing in NullFields will be sent to the server as 708 // null. It is an error if a field in this list has a non-empty value. 709 // This may be used to include null fields in Patch requests. 710 NullFields []string `json:"-"` 711} 712 713func (s *Peer) MarshalJSON() ([]byte, error) { 714 type NoMethod Peer 715 raw := NoMethod(*s) 716 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 717} 718 719// ReportRequest: Request message for the Report method. 720type ReportRequest struct { 721 // Operations: Describes the list of operations to be reported. Each 722 // operation is represented as an AttributeContext, and contains all 723 // attributes around an API access. 724 Operations []*AttributeContext `json:"operations,omitempty"` 725 726 // ServiceConfigId: Specifies the version of the service configuration 727 // that should be used to process the request. Must not be empty. Set 728 // this field to 'latest' to specify using the latest configuration. 729 ServiceConfigId string `json:"serviceConfigId,omitempty"` 730 731 // ForceSendFields is a list of field names (e.g. "Operations") to 732 // unconditionally include in API requests. By default, fields with 733 // empty or default values are omitted from API requests. However, any 734 // non-pointer, non-interface field appearing in ForceSendFields will be 735 // sent to the server regardless of whether the field is empty or not. 736 // This may be used to include empty fields in Patch requests. 737 ForceSendFields []string `json:"-"` 738 739 // NullFields is a list of field names (e.g. "Operations") to include in 740 // API requests with the JSON null value. By default, fields with empty 741 // values are omitted from API requests. However, any field with an 742 // empty value appearing in NullFields will be sent to the server as 743 // null. It is an error if a field in this list has a non-empty value. 744 // This may be used to include null fields in Patch requests. 745 NullFields []string `json:"-"` 746} 747 748func (s *ReportRequest) MarshalJSON() ([]byte, error) { 749 type NoMethod ReportRequest 750 raw := NoMethod(*s) 751 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 752} 753 754// ReportResponse: Response message for the Report method. If the 755// request contains any invalid data, the server returns an RPC error. 756type ReportResponse struct { 757 // ServerResponse contains the HTTP response code and headers from the 758 // server. 759 googleapi.ServerResponse `json:"-"` 760} 761 762// Request: This message defines attributes for an HTTP request. If the 763// actual request is not an HTTP request, the runtime system should try 764// to map the actual request to an equivalent HTTP request. 765type Request struct { 766 // Auth: The request authentication. May be absent for unauthenticated 767 // requests. Derived from the HTTP request `Authorization` header or 768 // equivalent. 769 Auth *Auth `json:"auth,omitempty"` 770 771 // Headers: The HTTP request headers. If multiple headers share the same 772 // key, they must be merged according to the HTTP spec. All header keys 773 // must be lowercased, because HTTP header keys are case-insensitive. 774 Headers map[string]string `json:"headers,omitempty"` 775 776 // Host: The HTTP request `Host` header value. 777 Host string `json:"host,omitempty"` 778 779 // Id: The unique ID for a request, which can be propagated to 780 // downstream systems. The ID should have low probability of collision 781 // within a single day for a specific service. 782 Id string `json:"id,omitempty"` 783 784 // Method: The HTTP request method, such as `GET`, `POST`. 785 Method string `json:"method,omitempty"` 786 787 // Path: The HTTP URL path, excluding the query parameters. 788 Path string `json:"path,omitempty"` 789 790 // Protocol: The network protocol used with the request, such as 791 // "http/1.1", "spdy/3", "h2", "h2c", "webrtc", "tcp", "udp", "quic". 792 // See 793 // https://www.iana.org/assignments/tls-extensiontype-values/tls-extensiontype-values.xhtml#alpn-protocol-ids 794 // for details. 795 Protocol string `json:"protocol,omitempty"` 796 797 // Query: The HTTP URL query in the format of 798 // `name1=value1&name2=value2`, as it appears in the first line of the 799 // HTTP request. No decoding is performed. 800 Query string `json:"query,omitempty"` 801 802 // Reason: A special parameter for request reason. It is used by 803 // security systems to associate auditing information with a request. 804 Reason string `json:"reason,omitempty"` 805 806 // Scheme: The HTTP URL scheme, such as `http` and `https`. 807 Scheme string `json:"scheme,omitempty"` 808 809 // Size: The HTTP request size in bytes. If unknown, it must be -1. 810 Size int64 `json:"size,omitempty,string"` 811 812 // Time: The timestamp when the `destination` service receives the last 813 // byte of the request. 814 Time string `json:"time,omitempty"` 815 816 // ForceSendFields is a list of field names (e.g. "Auth") to 817 // unconditionally include in API requests. By default, fields with 818 // empty or default values are omitted from API requests. However, any 819 // non-pointer, non-interface field appearing in ForceSendFields will be 820 // sent to the server regardless of whether the field is empty or not. 821 // This may be used to include empty fields in Patch requests. 822 ForceSendFields []string `json:"-"` 823 824 // NullFields is a list of field names (e.g. "Auth") to include in API 825 // requests with the JSON null value. By default, fields with empty 826 // values are omitted from API requests. However, any field with an 827 // empty value appearing in NullFields will be sent to the server as 828 // null. It is an error if a field in this list has a non-empty value. 829 // This may be used to include null fields in Patch requests. 830 NullFields []string `json:"-"` 831} 832 833func (s *Request) MarshalJSON() ([]byte, error) { 834 type NoMethod Request 835 raw := NoMethod(*s) 836 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 837} 838 839// RequestMetadata: Metadata about the request. 840type RequestMetadata struct { 841 // CallerIp: The IP address of the caller. For caller from internet, 842 // this will be public IPv4 or IPv6 address. For caller from a Compute 843 // Engine VM with external IP address, this will be the VM's external IP 844 // address. For caller from a Compute Engine VM without external IP 845 // address, if the VM is in the same organization (or project) as the 846 // accessed resource, `caller_ip` will be the VM's internal IPv4 847 // address, otherwise the `caller_ip` will be redacted to 848 // "gce-internal-ip". See https://cloud.google.com/compute/docs/vpc/ for 849 // more information. 850 CallerIp string `json:"callerIp,omitempty"` 851 852 // CallerNetwork: The network of the caller. Set only if the network 853 // host project is part of the same GCP organization (or project) as the 854 // accessed resource. See https://cloud.google.com/compute/docs/vpc/ for 855 // more information. This is a scheme-less URI full resource name. For 856 // example: 857 // "//compute.googleapis.com/projects/PROJECT_ID/global/networks/NETWORK_ 858 // ID" 859 CallerNetwork string `json:"callerNetwork,omitempty"` 860 861 // CallerSuppliedUserAgent: The user agent of the caller. This 862 // information is not authenticated and should be treated accordingly. 863 // For example: + `google-api-python-client/1.4.0`: The request was made 864 // by the Google API client for Python. + `Cloud SDK Command Line Tool 865 // apitools-client/1.0 gcloud/0.9.62`: The request was made by the 866 // Google Cloud SDK CLI (gcloud). + `AppEngine-Google; 867 // (+http://code.google.com/appengine; appid: s~my-project`: The request 868 // was made from the `my-project` App Engine app. NOLINT 869 CallerSuppliedUserAgent string `json:"callerSuppliedUserAgent,omitempty"` 870 871 // DestinationAttributes: The destination of a network activity, such as 872 // accepting a TCP connection. In a multi hop network activity, the 873 // destination represents the receiver of the last hop. Only two fields 874 // are used in this message, Peer.port and Peer.ip. These fields are 875 // optionally populated by those services utilizing the IAM condition 876 // feature. 877 DestinationAttributes *Peer `json:"destinationAttributes,omitempty"` 878 879 // RequestAttributes: Request attributes used in IAM condition 880 // evaluation. This field contains request attributes like request time 881 // and access levels associated with the request. To get the whole view 882 // of the attributes used in IAM condition evaluation, the user must 883 // also look into `AuditLog.authentication_info.resource_attributes`. 884 RequestAttributes *Request `json:"requestAttributes,omitempty"` 885 886 // ForceSendFields is a list of field names (e.g. "CallerIp") to 887 // unconditionally include in API requests. By default, fields with 888 // empty or default values are omitted from API requests. However, any 889 // non-pointer, non-interface field appearing in ForceSendFields will be 890 // sent to the server regardless of whether the field is empty or not. 891 // This may be used to include empty fields in Patch requests. 892 ForceSendFields []string `json:"-"` 893 894 // NullFields is a list of field names (e.g. "CallerIp") to include in 895 // API requests with the JSON null value. By default, fields with empty 896 // values are omitted from API requests. However, any field with an 897 // empty value appearing in NullFields will be sent to the server as 898 // null. It is an error if a field in this list has a non-empty value. 899 // This may be used to include null fields in Patch requests. 900 NullFields []string `json:"-"` 901} 902 903func (s *RequestMetadata) MarshalJSON() ([]byte, error) { 904 type NoMethod RequestMetadata 905 raw := NoMethod(*s) 906 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 907} 908 909// Resource: This message defines core attributes for a resource. A 910// resource is an addressable (named) entity provided by the destination 911// service. For example, a file stored on a network storage service. 912type Resource struct { 913 // Annotations: Annotations is an unstructured key-value map stored with 914 // a resource that may be set by external tools to store and retrieve 915 // arbitrary metadata. They are not queryable and should be preserved 916 // when modifying objects. More info: 917 // https://kubernetes.io/docs/user-guide/annotations 918 Annotations map[string]string `json:"annotations,omitempty"` 919 920 // CreateTime: Output only. The timestamp when the resource was created. 921 // This may be either the time creation was initiated or when it was 922 // completed. 923 CreateTime string `json:"createTime,omitempty"` 924 925 // DeleteTime: Output only. The timestamp when the resource was deleted. 926 // If the resource is not deleted, this must be empty. 927 DeleteTime string `json:"deleteTime,omitempty"` 928 929 // DisplayName: Mutable. The display name set by clients. Must be <= 63 930 // characters. 931 DisplayName string `json:"displayName,omitempty"` 932 933 // Etag: Output only. An opaque value that uniquely identifies a version 934 // or generation of a resource. It can be used to confirm that the 935 // client and server agree on the ordering of a resource being written. 936 Etag string `json:"etag,omitempty"` 937 938 // Labels: The labels or tags on the resource, such as AWS resource tags 939 // and Kubernetes resource labels. 940 Labels map[string]string `json:"labels,omitempty"` 941 942 // Location: Immutable. The location of the resource. The location 943 // encoding is specific to the service provider, and new encoding may be 944 // introduced as the service evolves. For Google Cloud products, the 945 // encoding is what is used by Google Cloud APIs, such as `us-east1`, 946 // `aws-us-east-1`, and `azure-eastus2`. The semantics of `location` is 947 // identical to the `cloud.googleapis.com/location` label used by some 948 // Google Cloud APIs. 949 Location string `json:"location,omitempty"` 950 951 // Name: The stable identifier (name) of a resource on the `service`. A 952 // resource can be logically identified as 953 // "//{resource.service}/{resource.name}". The differences between a 954 // resource name and a URI are: * Resource name is a logical identifier, 955 // independent of network protocol and API version. For example, 956 // `//pubsub.googleapis.com/projects/123/topics/news-feed`. * URI often 957 // includes protocol and version information, so it can be used directly 958 // by applications. For example, 959 // `https://pubsub.googleapis.com/v1/projects/123/topics/news-feed`. See 960 // https://cloud.google.com/apis/design/resource_names for details. 961 Name string `json:"name,omitempty"` 962 963 // Service: The name of the service that this resource belongs to, such 964 // as `pubsub.googleapis.com`. The service may be different from the DNS 965 // hostname that actually serves the request. 966 Service string `json:"service,omitempty"` 967 968 // Type: The type of the resource. The syntax is platform-specific 969 // because different platforms define their resources differently. For 970 // Google APIs, the type format must be "{service}/{kind}". 971 Type string `json:"type,omitempty"` 972 973 // Uid: The unique identifier of the resource. UID is unique in the time 974 // and space for this resource within the scope of the service. It is 975 // typically generated by the server on successful creation of a 976 // resource and must not be changed. UID is used to uniquely identify 977 // resources with resource name reuses. This should be a UUID4. 978 Uid string `json:"uid,omitempty"` 979 980 // UpdateTime: Output only. The timestamp when the resource was last 981 // updated. Any change to the resource made by users must refresh this 982 // value. Changes to a resource made by the service should refresh this 983 // value. 984 UpdateTime string `json:"updateTime,omitempty"` 985 986 // ForceSendFields is a list of field names (e.g. "Annotations") to 987 // unconditionally include in API requests. By default, fields with 988 // empty or default values are omitted from API requests. However, any 989 // non-pointer, non-interface field appearing in ForceSendFields will be 990 // sent to the server regardless of whether the field is empty or not. 991 // This may be used to include empty fields in Patch requests. 992 ForceSendFields []string `json:"-"` 993 994 // NullFields is a list of field names (e.g. "Annotations") to include 995 // in API requests with the JSON null value. By default, fields with 996 // empty values are omitted from API requests. However, any field with 997 // an empty value appearing in NullFields will be sent to the server as 998 // null. It is an error if a field in this list has a non-empty value. 999 // This may be used to include null fields in Patch requests. 1000 NullFields []string `json:"-"` 1001} 1002 1003func (s *Resource) MarshalJSON() ([]byte, error) { 1004 type NoMethod Resource 1005 raw := NoMethod(*s) 1006 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1007} 1008 1009// ResourceInfo: Describes a resource referenced in the request. 1010type ResourceInfo struct { 1011 // Container: Optional. The identifier of the container of this 1012 // resource. For Google Cloud APIs, the resource container must be one 1013 // of the following formats: - `projects/` - `folders/` - 1014 // `organizations/` For the policy enforcement on the container level 1015 // (VPCSC and Location Policy check), this field takes precedence on the 1016 // container extracted from name when presents. 1017 Container string `json:"container,omitempty"` 1018 1019 // Location: Optional. The location of the resource. The value must be a 1020 // valid zone, region or multiregion. For example: "europe-west4" or 1021 // "northamerica-northeast1-a" 1022 Location string `json:"location,omitempty"` 1023 1024 // Name: The name of the resource referenced in the request. 1025 Name string `json:"name,omitempty"` 1026 1027 // Permission: The resource permission needed for this request. The 1028 // format must be "{service}/{plural}.{verb}". 1029 Permission string `json:"permission,omitempty"` 1030 1031 // Type: The resource type in the format of "{service}/{kind}". 1032 Type string `json:"type,omitempty"` 1033 1034 // ForceSendFields is a list of field names (e.g. "Container") to 1035 // unconditionally include in API requests. By default, fields with 1036 // empty or default values are omitted from API requests. However, any 1037 // non-pointer, non-interface field appearing in ForceSendFields will be 1038 // sent to the server regardless of whether the field is empty or not. 1039 // This may be used to include empty fields in Patch requests. 1040 ForceSendFields []string `json:"-"` 1041 1042 // NullFields is a list of field names (e.g. "Container") to include in 1043 // API requests with the JSON null value. By default, fields with empty 1044 // values are omitted from API requests. However, any field with an 1045 // empty value appearing in NullFields will be sent to the server as 1046 // null. It is an error if a field in this list has a non-empty value. 1047 // This may be used to include null fields in Patch requests. 1048 NullFields []string `json:"-"` 1049} 1050 1051func (s *ResourceInfo) MarshalJSON() ([]byte, error) { 1052 type NoMethod ResourceInfo 1053 raw := NoMethod(*s) 1054 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1055} 1056 1057// ResourceLocation: Location information about a resource. 1058type ResourceLocation struct { 1059 // CurrentLocations: The locations of a resource after the execution of 1060 // the operation. Requests to create or delete a location based resource 1061 // must populate the 'current_locations' field and not the 1062 // 'original_locations' field. For example: "europe-west1-a" "us-east1" 1063 // "nam3" 1064 CurrentLocations []string `json:"currentLocations,omitempty"` 1065 1066 // OriginalLocations: The locations of a resource prior to the execution 1067 // of the operation. Requests that mutate the resource's location must 1068 // populate both the 'original_locations' as well as the 1069 // 'current_locations' fields. For example: "europe-west1-a" "us-east1" 1070 // "nam3" 1071 OriginalLocations []string `json:"originalLocations,omitempty"` 1072 1073 // ForceSendFields is a list of field names (e.g. "CurrentLocations") to 1074 // unconditionally include in API requests. By default, fields with 1075 // empty or default values are omitted from API requests. However, any 1076 // non-pointer, non-interface field appearing in ForceSendFields will be 1077 // sent to the server regardless of whether the field is empty or not. 1078 // This may be used to include empty fields in Patch requests. 1079 ForceSendFields []string `json:"-"` 1080 1081 // NullFields is a list of field names (e.g. "CurrentLocations") to 1082 // include in API requests with the JSON null value. By default, fields 1083 // with empty values are omitted from API requests. However, any field 1084 // with an empty value appearing in NullFields will be sent to the 1085 // server as null. It is an error if a field in this list has a 1086 // non-empty value. This may be used to include null fields in Patch 1087 // requests. 1088 NullFields []string `json:"-"` 1089} 1090 1091func (s *ResourceLocation) MarshalJSON() ([]byte, error) { 1092 type NoMethod ResourceLocation 1093 raw := NoMethod(*s) 1094 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1095} 1096 1097// Response: This message defines attributes for a typical network 1098// response. It generally models semantics of an HTTP response. 1099type Response struct { 1100 // BackendLatency: The amount of time it takes the backend service to 1101 // fully respond to a request. Measured from when the destination 1102 // service starts to send the request to the backend until when the 1103 // destination service receives the complete response from the backend. 1104 BackendLatency string `json:"backendLatency,omitempty"` 1105 1106 // Code: The HTTP response status code, such as `200` and `404`. 1107 Code int64 `json:"code,omitempty,string"` 1108 1109 // Headers: The HTTP response headers. If multiple headers share the 1110 // same key, they must be merged according to HTTP spec. All header keys 1111 // must be lowercased, because HTTP header keys are case-insensitive. 1112 Headers map[string]string `json:"headers,omitempty"` 1113 1114 // Size: The HTTP response size in bytes. If unknown, it must be -1. 1115 Size int64 `json:"size,omitempty,string"` 1116 1117 // Time: The timestamp when the `destination` service sends the last 1118 // byte of the response. 1119 Time string `json:"time,omitempty"` 1120 1121 // ForceSendFields is a list of field names (e.g. "BackendLatency") to 1122 // unconditionally include in API requests. By default, fields with 1123 // empty or default values are omitted from API requests. However, any 1124 // non-pointer, non-interface field appearing in ForceSendFields will be 1125 // sent to the server regardless of whether the field is empty or not. 1126 // This may be used to include empty fields in Patch requests. 1127 ForceSendFields []string `json:"-"` 1128 1129 // NullFields is a list of field names (e.g. "BackendLatency") to 1130 // include in API requests with the JSON null value. By default, fields 1131 // with empty values are omitted from API requests. However, any field 1132 // with an empty value appearing in NullFields will be sent to the 1133 // server as null. It is an error if a field in this list has a 1134 // non-empty value. This may be used to include null fields in Patch 1135 // requests. 1136 NullFields []string `json:"-"` 1137} 1138 1139func (s *Response) MarshalJSON() ([]byte, error) { 1140 type NoMethod Response 1141 raw := NoMethod(*s) 1142 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1143} 1144 1145// ServiceAccountDelegationInfo: Identity delegation history of an 1146// authenticated service account. 1147type ServiceAccountDelegationInfo struct { 1148 // FirstPartyPrincipal: First party (Google) identity as the real 1149 // authority. 1150 FirstPartyPrincipal *FirstPartyPrincipal `json:"firstPartyPrincipal,omitempty"` 1151 1152 // PrincipalSubject: A string representing the principal_subject 1153 // associated with the identity. For most identities, the format will be 1154 // `principal://iam.googleapis.com/{identity pool 1155 // name}/subject/{subject)` except for some GKE identities 1156 // (GKE_WORKLOAD, FREEFORM, GKE_HUB_WORKLOAD) that are still in the 1157 // legacy format `serviceAccount:{identity pool name}[{subject}]` 1158 PrincipalSubject string `json:"principalSubject,omitempty"` 1159 1160 // ThirdPartyPrincipal: Third party identity as the real authority. 1161 ThirdPartyPrincipal *ThirdPartyPrincipal `json:"thirdPartyPrincipal,omitempty"` 1162 1163 // ForceSendFields is a list of field names (e.g. "FirstPartyPrincipal") 1164 // to unconditionally include in API requests. By default, fields with 1165 // empty or default values are omitted from API requests. However, any 1166 // non-pointer, non-interface field appearing in ForceSendFields will be 1167 // sent to the server regardless of whether the field is empty or not. 1168 // This may be used to include empty fields in Patch requests. 1169 ForceSendFields []string `json:"-"` 1170 1171 // NullFields is a list of field names (e.g. "FirstPartyPrincipal") to 1172 // include in API requests with the JSON null value. By default, fields 1173 // with empty values are omitted from API requests. However, any field 1174 // with an empty value appearing in NullFields will be sent to the 1175 // server as null. It is an error if a field in this list has a 1176 // non-empty value. This may be used to include null fields in Patch 1177 // requests. 1178 NullFields []string `json:"-"` 1179} 1180 1181func (s *ServiceAccountDelegationInfo) MarshalJSON() ([]byte, error) { 1182 type NoMethod ServiceAccountDelegationInfo 1183 raw := NoMethod(*s) 1184 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1185} 1186 1187// SpanContext: The context of a span. This is attached to an Exemplar 1188// in Distribution values during aggregation. It contains the name of a 1189// span with format: 1190// projects/[PROJECT_ID_OR_NUMBER]/traces/[TRACE_ID]/spans/[SPAN_ID] 1191type SpanContext struct { 1192 // SpanName: The resource name of the span. The format is: 1193 // projects/[PROJECT_ID_OR_NUMBER]/traces/[TRACE_ID]/spans/[SPAN_ID] 1194 // `[TRACE_ID]` is a unique identifier for a trace within a project; it 1195 // is a 32-character hexadecimal encoding of a 16-byte array. 1196 // `[SPAN_ID]` is a unique identifier for a span within a trace; it is a 1197 // 16-character hexadecimal encoding of an 8-byte array. 1198 SpanName string `json:"spanName,omitempty"` 1199 1200 // ForceSendFields is a list of field names (e.g. "SpanName") to 1201 // unconditionally include in API requests. By default, fields with 1202 // empty or default values are omitted from API requests. However, any 1203 // non-pointer, non-interface field appearing in ForceSendFields will be 1204 // sent to the server regardless of whether the field is empty or not. 1205 // This may be used to include empty fields in Patch requests. 1206 ForceSendFields []string `json:"-"` 1207 1208 // NullFields is a list of field names (e.g. "SpanName") to include in 1209 // API requests with the JSON null value. By default, fields with empty 1210 // values are omitted from API requests. However, any field with an 1211 // empty value appearing in NullFields will be sent to the server as 1212 // null. It is an error if a field in this list has a non-empty value. 1213 // This may be used to include null fields in Patch requests. 1214 NullFields []string `json:"-"` 1215} 1216 1217func (s *SpanContext) MarshalJSON() ([]byte, error) { 1218 type NoMethod SpanContext 1219 raw := NoMethod(*s) 1220 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1221} 1222 1223// Status: The `Status` type defines a logical error model that is 1224// suitable for different programming environments, including REST APIs 1225// and RPC APIs. It is used by gRPC (https://github.com/grpc). Each 1226// `Status` message contains three pieces of data: error code, error 1227// message, and error details. You can find out more about this error 1228// model and how to work with it in the API Design Guide 1229// (https://cloud.google.com/apis/design/errors). 1230type Status struct { 1231 // Code: The status code, which should be an enum value of 1232 // google.rpc.Code. 1233 Code int64 `json:"code,omitempty"` 1234 1235 // Details: A list of messages that carry the error details. There is a 1236 // common set of message types for APIs to use. 1237 Details []googleapi.RawMessage `json:"details,omitempty"` 1238 1239 // Message: A developer-facing error message, which should be in 1240 // English. Any user-facing error message should be localized and sent 1241 // in the google.rpc.Status.details field, or localized by the client. 1242 Message string `json:"message,omitempty"` 1243 1244 // ForceSendFields is a list of field names (e.g. "Code") to 1245 // unconditionally include in API requests. By default, fields with 1246 // empty or default values are omitted from API requests. However, any 1247 // non-pointer, non-interface field appearing in ForceSendFields will be 1248 // sent to the server regardless of whether the field is empty or not. 1249 // This may be used to include empty fields in Patch requests. 1250 ForceSendFields []string `json:"-"` 1251 1252 // NullFields is a list of field names (e.g. "Code") to include in API 1253 // requests with the JSON null value. By default, fields with empty 1254 // values are omitted from API requests. However, any field with an 1255 // empty value appearing in NullFields will be sent to the server as 1256 // null. It is an error if a field in this list has a non-empty value. 1257 // This may be used to include null fields in Patch requests. 1258 NullFields []string `json:"-"` 1259} 1260 1261func (s *Status) MarshalJSON() ([]byte, error) { 1262 type NoMethod Status 1263 raw := NoMethod(*s) 1264 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1265} 1266 1267// ThirdPartyPrincipal: Third party identity principal. 1268type ThirdPartyPrincipal struct { 1269 // ThirdPartyClaims: Metadata about third party identity. 1270 ThirdPartyClaims googleapi.RawMessage `json:"thirdPartyClaims,omitempty"` 1271 1272 // ForceSendFields is a list of field names (e.g. "ThirdPartyClaims") to 1273 // unconditionally include in API requests. By default, fields with 1274 // empty or default values are omitted from API requests. However, any 1275 // non-pointer, non-interface field appearing in ForceSendFields will be 1276 // sent to the server regardless of whether the field is empty or not. 1277 // This may be used to include empty fields in Patch requests. 1278 ForceSendFields []string `json:"-"` 1279 1280 // NullFields is a list of field names (e.g. "ThirdPartyClaims") to 1281 // include in API requests with the JSON null value. By default, fields 1282 // with empty values are omitted from API requests. However, any field 1283 // with an empty value appearing in NullFields will be sent to the 1284 // server as null. It is an error if a field in this list has a 1285 // non-empty value. This may be used to include null fields in Patch 1286 // requests. 1287 NullFields []string `json:"-"` 1288} 1289 1290func (s *ThirdPartyPrincipal) MarshalJSON() ([]byte, error) { 1291 type NoMethod ThirdPartyPrincipal 1292 raw := NoMethod(*s) 1293 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1294} 1295 1296// method id "servicecontrol.services.check": 1297 1298type ServicesCheckCall struct { 1299 s *Service 1300 serviceName string 1301 checkrequest *CheckRequest 1302 urlParams_ gensupport.URLParams 1303 ctx_ context.Context 1304 header_ http.Header 1305} 1306 1307// Check: Private Preview. This feature is only available for approved 1308// services. This method provides admission control for services that 1309// are integrated with Service Infrastructure (/service-infrastructure). 1310// It checks whether an operation should be allowed based on the service 1311// configuration and relevant policies. It must be called before the 1312// operation is executed. For more information, see Admission Control 1313// (/service-infrastructure/docs/admission-control). NOTE: The admission 1314// control has an expected policy propagation delay of 60s. The caller 1315// **must** not depend on the most recent policy changes. NOTE: The 1316// admission control has a hard limit of 1 referenced resources per 1317// call. If an operation refers to more than 1 resources, the caller 1318// must call the Check method multiple times. This method requires the 1319// `servicemanagement.services.check` permission on the specified 1320// service. For more information, see Service Control API Access Control 1321// (https://cloud.google.com/service-infrastructure/docs/service-control/access-control). 1322// 1323// - serviceName: The service name as specified in its service 1324// configuration. For example, "pubsub.googleapis.com". See 1325// google.api.Service 1326// (https://cloud.google.com/service-management/reference/rpc/google.api#google.api.Service) 1327// for the definition of a service name. 1328func (r *ServicesService) Check(serviceName string, checkrequest *CheckRequest) *ServicesCheckCall { 1329 c := &ServicesCheckCall{s: r.s, urlParams_: make(gensupport.URLParams)} 1330 c.serviceName = serviceName 1331 c.checkrequest = checkrequest 1332 return c 1333} 1334 1335// Fields allows partial responses to be retrieved. See 1336// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 1337// for more information. 1338func (c *ServicesCheckCall) Fields(s ...googleapi.Field) *ServicesCheckCall { 1339 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 1340 return c 1341} 1342 1343// Context sets the context to be used in this call's Do method. Any 1344// pending HTTP request will be aborted if the provided context is 1345// canceled. 1346func (c *ServicesCheckCall) Context(ctx context.Context) *ServicesCheckCall { 1347 c.ctx_ = ctx 1348 return c 1349} 1350 1351// Header returns an http.Header that can be modified by the caller to 1352// add HTTP headers to the request. 1353func (c *ServicesCheckCall) Header() http.Header { 1354 if c.header_ == nil { 1355 c.header_ = make(http.Header) 1356 } 1357 return c.header_ 1358} 1359 1360func (c *ServicesCheckCall) doRequest(alt string) (*http.Response, error) { 1361 reqHeaders := make(http.Header) 1362 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210830") 1363 for k, v := range c.header_ { 1364 reqHeaders[k] = v 1365 } 1366 reqHeaders.Set("User-Agent", c.s.userAgent()) 1367 var body io.Reader = nil 1368 body, err := googleapi.WithoutDataWrapper.JSONReader(c.checkrequest) 1369 if err != nil { 1370 return nil, err 1371 } 1372 reqHeaders.Set("Content-Type", "application/json") 1373 c.urlParams_.Set("alt", alt) 1374 c.urlParams_.Set("prettyPrint", "false") 1375 urls := googleapi.ResolveRelative(c.s.BasePath, "v2/services/{serviceName}:check") 1376 urls += "?" + c.urlParams_.Encode() 1377 req, err := http.NewRequest("POST", urls, body) 1378 if err != nil { 1379 return nil, err 1380 } 1381 req.Header = reqHeaders 1382 googleapi.Expand(req.URL, map[string]string{ 1383 "serviceName": c.serviceName, 1384 }) 1385 return gensupport.SendRequest(c.ctx_, c.s.client, req) 1386} 1387 1388// Do executes the "servicecontrol.services.check" call. 1389// Exactly one of *CheckResponse or error will be non-nil. Any non-2xx 1390// status code is an error. Response headers are in either 1391// *CheckResponse.ServerResponse.Header or (if a response was returned 1392// at all) in error.(*googleapi.Error).Header. Use 1393// googleapi.IsNotModified to check whether the returned error was 1394// because http.StatusNotModified was returned. 1395func (c *ServicesCheckCall) Do(opts ...googleapi.CallOption) (*CheckResponse, error) { 1396 gensupport.SetOptions(c.urlParams_, opts...) 1397 res, err := c.doRequest("json") 1398 if res != nil && res.StatusCode == http.StatusNotModified { 1399 if res.Body != nil { 1400 res.Body.Close() 1401 } 1402 return nil, &googleapi.Error{ 1403 Code: res.StatusCode, 1404 Header: res.Header, 1405 } 1406 } 1407 if err != nil { 1408 return nil, err 1409 } 1410 defer googleapi.CloseBody(res) 1411 if err := googleapi.CheckResponse(res); err != nil { 1412 return nil, err 1413 } 1414 ret := &CheckResponse{ 1415 ServerResponse: googleapi.ServerResponse{ 1416 Header: res.Header, 1417 HTTPStatusCode: res.StatusCode, 1418 }, 1419 } 1420 target := &ret 1421 if err := gensupport.DecodeResponse(target, res); err != nil { 1422 return nil, err 1423 } 1424 return ret, nil 1425 // { 1426 // "description": "Private Preview. This feature is only available for approved services. This method provides admission control for services that are integrated with [Service Infrastructure](/service-infrastructure). It checks whether an operation should be allowed based on the service configuration and relevant policies. It must be called before the operation is executed. For more information, see [Admission Control](/service-infrastructure/docs/admission-control). NOTE: The admission control has an expected policy propagation delay of 60s. The caller **must** not depend on the most recent policy changes. NOTE: The admission control has a hard limit of 1 referenced resources per call. If an operation refers to more than 1 resources, the caller must call the Check method multiple times. This method requires the `servicemanagement.services.check` permission on the specified service. For more information, see [Service Control API Access Control](https://cloud.google.com/service-infrastructure/docs/service-control/access-control).", 1427 // "flatPath": "v2/services/{serviceName}:check", 1428 // "httpMethod": "POST", 1429 // "id": "servicecontrol.services.check", 1430 // "parameterOrder": [ 1431 // "serviceName" 1432 // ], 1433 // "parameters": { 1434 // "serviceName": { 1435 // "description": "The service name as specified in its service configuration. For example, `\"pubsub.googleapis.com\"`. See [google.api.Service](https://cloud.google.com/service-management/reference/rpc/google.api#google.api.Service) for the definition of a service name.", 1436 // "location": "path", 1437 // "required": true, 1438 // "type": "string" 1439 // } 1440 // }, 1441 // "path": "v2/services/{serviceName}:check", 1442 // "request": { 1443 // "$ref": "CheckRequest" 1444 // }, 1445 // "response": { 1446 // "$ref": "CheckResponse" 1447 // }, 1448 // "scopes": [ 1449 // "https://www.googleapis.com/auth/cloud-platform", 1450 // "https://www.googleapis.com/auth/servicecontrol" 1451 // ] 1452 // } 1453 1454} 1455 1456// method id "servicecontrol.services.report": 1457 1458type ServicesReportCall struct { 1459 s *Service 1460 serviceName string 1461 reportrequest *ReportRequest 1462 urlParams_ gensupport.URLParams 1463 ctx_ context.Context 1464 header_ http.Header 1465} 1466 1467// Report: Private Preview. This feature is only available for approved 1468// services. This method provides telemetry reporting for services that 1469// are integrated with Service Infrastructure (/service-infrastructure). 1470// It reports a list of operations that have occurred on a service. It 1471// must be called after the operations have been executed. For more 1472// information, see Telemetry Reporting 1473// (/service-infrastructure/docs/telemetry-reporting). NOTE: The 1474// telemetry reporting has a hard limit of 1000 operations and 1MB per 1475// Report call. It is recommended to have no more than 100 operations 1476// per call. This method requires the 1477// `servicemanagement.services.report` permission on the specified 1478// service. For more information, see Service Control API Access Control 1479// (https://cloud.google.com/service-infrastructure/docs/service-control/access-control). 1480// 1481// - serviceName: The service name as specified in its service 1482// configuration. For example, "pubsub.googleapis.com". See 1483// google.api.Service 1484// (https://cloud.google.com/service-management/reference/rpc/google.api#google.api.Service) 1485// for the definition of a service name. 1486func (r *ServicesService) Report(serviceName string, reportrequest *ReportRequest) *ServicesReportCall { 1487 c := &ServicesReportCall{s: r.s, urlParams_: make(gensupport.URLParams)} 1488 c.serviceName = serviceName 1489 c.reportrequest = reportrequest 1490 return c 1491} 1492 1493// Fields allows partial responses to be retrieved. See 1494// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 1495// for more information. 1496func (c *ServicesReportCall) Fields(s ...googleapi.Field) *ServicesReportCall { 1497 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 1498 return c 1499} 1500 1501// Context sets the context to be used in this call's Do method. Any 1502// pending HTTP request will be aborted if the provided context is 1503// canceled. 1504func (c *ServicesReportCall) Context(ctx context.Context) *ServicesReportCall { 1505 c.ctx_ = ctx 1506 return c 1507} 1508 1509// Header returns an http.Header that can be modified by the caller to 1510// add HTTP headers to the request. 1511func (c *ServicesReportCall) Header() http.Header { 1512 if c.header_ == nil { 1513 c.header_ = make(http.Header) 1514 } 1515 return c.header_ 1516} 1517 1518func (c *ServicesReportCall) doRequest(alt string) (*http.Response, error) { 1519 reqHeaders := make(http.Header) 1520 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210830") 1521 for k, v := range c.header_ { 1522 reqHeaders[k] = v 1523 } 1524 reqHeaders.Set("User-Agent", c.s.userAgent()) 1525 var body io.Reader = nil 1526 body, err := googleapi.WithoutDataWrapper.JSONReader(c.reportrequest) 1527 if err != nil { 1528 return nil, err 1529 } 1530 reqHeaders.Set("Content-Type", "application/json") 1531 c.urlParams_.Set("alt", alt) 1532 c.urlParams_.Set("prettyPrint", "false") 1533 urls := googleapi.ResolveRelative(c.s.BasePath, "v2/services/{serviceName}:report") 1534 urls += "?" + c.urlParams_.Encode() 1535 req, err := http.NewRequest("POST", urls, body) 1536 if err != nil { 1537 return nil, err 1538 } 1539 req.Header = reqHeaders 1540 googleapi.Expand(req.URL, map[string]string{ 1541 "serviceName": c.serviceName, 1542 }) 1543 return gensupport.SendRequest(c.ctx_, c.s.client, req) 1544} 1545 1546// Do executes the "servicecontrol.services.report" call. 1547// Exactly one of *ReportResponse or error will be non-nil. Any non-2xx 1548// status code is an error. Response headers are in either 1549// *ReportResponse.ServerResponse.Header or (if a response was returned 1550// at all) in error.(*googleapi.Error).Header. Use 1551// googleapi.IsNotModified to check whether the returned error was 1552// because http.StatusNotModified was returned. 1553func (c *ServicesReportCall) Do(opts ...googleapi.CallOption) (*ReportResponse, error) { 1554 gensupport.SetOptions(c.urlParams_, opts...) 1555 res, err := c.doRequest("json") 1556 if res != nil && res.StatusCode == http.StatusNotModified { 1557 if res.Body != nil { 1558 res.Body.Close() 1559 } 1560 return nil, &googleapi.Error{ 1561 Code: res.StatusCode, 1562 Header: res.Header, 1563 } 1564 } 1565 if err != nil { 1566 return nil, err 1567 } 1568 defer googleapi.CloseBody(res) 1569 if err := googleapi.CheckResponse(res); err != nil { 1570 return nil, err 1571 } 1572 ret := &ReportResponse{ 1573 ServerResponse: googleapi.ServerResponse{ 1574 Header: res.Header, 1575 HTTPStatusCode: res.StatusCode, 1576 }, 1577 } 1578 target := &ret 1579 if err := gensupport.DecodeResponse(target, res); err != nil { 1580 return nil, err 1581 } 1582 return ret, nil 1583 // { 1584 // "description": "Private Preview. This feature is only available for approved services. This method provides telemetry reporting for services that are integrated with [Service Infrastructure](/service-infrastructure). It reports a list of operations that have occurred on a service. It must be called after the operations have been executed. For more information, see [Telemetry Reporting](/service-infrastructure/docs/telemetry-reporting). NOTE: The telemetry reporting has a hard limit of 1000 operations and 1MB per Report call. It is recommended to have no more than 100 operations per call. This method requires the `servicemanagement.services.report` permission on the specified service. For more information, see [Service Control API Access Control](https://cloud.google.com/service-infrastructure/docs/service-control/access-control).", 1585 // "flatPath": "v2/services/{serviceName}:report", 1586 // "httpMethod": "POST", 1587 // "id": "servicecontrol.services.report", 1588 // "parameterOrder": [ 1589 // "serviceName" 1590 // ], 1591 // "parameters": { 1592 // "serviceName": { 1593 // "description": "The service name as specified in its service configuration. For example, `\"pubsub.googleapis.com\"`. See [google.api.Service](https://cloud.google.com/service-management/reference/rpc/google.api#google.api.Service) for the definition of a service name.", 1594 // "location": "path", 1595 // "required": true, 1596 // "type": "string" 1597 // } 1598 // }, 1599 // "path": "v2/services/{serviceName}:report", 1600 // "request": { 1601 // "$ref": "ReportRequest" 1602 // }, 1603 // "response": { 1604 // "$ref": "ReportResponse" 1605 // }, 1606 // "scopes": [ 1607 // "https://www.googleapis.com/auth/cloud-platform", 1608 // "https://www.googleapis.com/auth/servicecontrol" 1609 // ] 1610 // } 1611 1612} 1613