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