1 // Copyright 2024 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 // # Library status 12 // 13 // These client libraries are officially supported by Google. However, this 14 // library is considered complete and is in maintenance mode. This means 15 // that we will address critical bugs and security issues but will not add 16 // any new features. 17 // 18 // When possible, we recommend using our newer 19 // [Cloud Client Libraries for Go](https://pkg.go.dev/cloud.google.com/go) 20 // that are still actively being worked and iterated on. 21 // 22 // # Creating a client 23 // 24 // Usage example: 25 // 26 // import "google.golang.org/api/servicecontrol/v2" 27 // ... 28 // ctx := context.Background() 29 // servicecontrolService, err := servicecontrol.NewService(ctx) 30 // 31 // In this example, Google Application Default Credentials are used for 32 // authentication. For information on how to create and obtain Application 33 // Default Credentials, see https://developers.google.com/identity/protocols/application-default-credentials. 34 // 35 // # Other authentication options 36 // 37 // By default, all available scopes (see "Constants") are used to authenticate. 38 // To restrict scopes, use [google.golang.org/api/option.WithScopes]: 39 // 40 // servicecontrolService, err := servicecontrol.NewService(ctx, option.WithScopes(servicecontrol.ServicecontrolScope)) 41 // 42 // To use an API key for authentication (note: some APIs do not support API 43 // keys), use [google.golang.org/api/option.WithAPIKey]: 44 // 45 // servicecontrolService, err := servicecontrol.NewService(ctx, option.WithAPIKey("AIza...")) 46 // 47 // To use an OAuth token (e.g., a user token obtained via a three-legged OAuth 48 // flow, use [google.golang.org/api/option.WithTokenSource]: 49 // 50 // config := &oauth2.Config{...} 51 // // ... 52 // token, err := config.Exchange(ctx, ...) 53 // servicecontrolService, err := servicecontrol.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token))) 54 // 55 // See [google.golang.org/api/option.ClientOption] for details on options. 56 package servicecontrol // import "google.golang.org/api/servicecontrol/v2" 57 58 import ( 59 "bytes" 60 "context" 61 "encoding/json" 62 "errors" 63 "fmt" 64 "io" 65 "net/http" 66 "net/url" 67 "strconv" 68 "strings" 69 70 googleapi "google.golang.org/api/googleapi" 71 internal "google.golang.org/api/internal" 72 gensupport "google.golang.org/api/internal/gensupport" 73 option "google.golang.org/api/option" 74 internaloption "google.golang.org/api/option/internaloption" 75 htransport "google.golang.org/api/transport/http" 76 ) 77 78 // Always reference these packages, just in case the auto-generated code 79 // below doesn't. 80 var _ = bytes.NewBuffer 81 var _ = strconv.Itoa 82 var _ = fmt.Sprintf 83 var _ = json.NewDecoder 84 var _ = io.Copy 85 var _ = url.Parse 86 var _ = gensupport.MarshalJSON 87 var _ = googleapi.Version 88 var _ = errors.New 89 var _ = strings.Replace 90 var _ = context.Canceled 91 var _ = internaloption.WithDefaultEndpoint 92 var _ = internal.Version 93 94 const apiId = "servicecontrol:v2" 95 const apiName = "servicecontrol" 96 const apiVersion = "v2" 97 const basePath = "https://servicecontrol.googleapis.com/" 98 const basePathTemplate = "https://servicecontrol.UNIVERSE_DOMAIN/" 99 const mtlsBasePath = "https://servicecontrol.mtls.googleapis.com/" 100 101 // OAuth2 scopes used by this API. 102 const ( 103 // See, edit, configure, and delete your Google Cloud data and see the email 104 // address for your Google Account. 105 CloudPlatformScope = "https://www.googleapis.com/auth/cloud-platform" 106 107 // Manage your Google Service Control data 108 ServicecontrolScope = "https://www.googleapis.com/auth/servicecontrol" 109 ) 110 111 // NewService creates a new Service. 112 func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, error) { 113 scopesOption := internaloption.WithDefaultScopes( 114 "https://www.googleapis.com/auth/cloud-platform", 115 "https://www.googleapis.com/auth/servicecontrol", 116 ) 117 // NOTE: prepend, so we don't override user-specified scopes. 118 opts = append([]option.ClientOption{scopesOption}, opts...) 119 opts = append(opts, internaloption.WithDefaultEndpoint(basePath)) 120 opts = append(opts, internaloption.WithDefaultEndpointTemplate(basePathTemplate)) 121 opts = append(opts, internaloption.WithDefaultMTLSEndpoint(mtlsBasePath)) 122 opts = append(opts, internaloption.EnableNewAuthLibrary()) 123 client, endpoint, err := htransport.NewClient(ctx, opts...) 124 if err != nil { 125 return nil, err 126 } 127 s, err := New(client) 128 if err != nil { 129 return nil, err 130 } 131 if endpoint != "" { 132 s.BasePath = endpoint 133 } 134 return s, nil 135 } 136 137 // New creates a new Service. It uses the provided http.Client for requests. 138 // 139 // Deprecated: please use NewService instead. 140 // To provide a custom HTTP client, use option.WithHTTPClient. 141 // If you are using google.golang.org/api/googleapis/transport.APIKey, use option.WithAPIKey with NewService instead. 142 func New(client *http.Client) (*Service, error) { 143 if client == nil { 144 return nil, errors.New("client is nil") 145 } 146 s := &Service{client: client, BasePath: basePath} 147 s.Services = NewServicesService(s) 148 return s, nil 149 } 150 151 type Service struct { 152 client *http.Client 153 BasePath string // API endpoint base URL 154 UserAgent string // optional additional User-Agent fragment 155 156 Services *ServicesService 157 } 158 159 func (s *Service) userAgent() string { 160 if s.UserAgent == "" { 161 return googleapi.UserAgent 162 } 163 return googleapi.UserAgent + " " + s.UserAgent 164 } 165 166 func NewServicesService(s *Service) *ServicesService { 167 rs := &ServicesService{s: s} 168 return rs 169 } 170 171 type ServicesService struct { 172 s *Service 173 } 174 175 // Api: This message defines attributes associated with API operations, such as 176 // a network API request. The terminology is based on the conventions used by 177 // Google APIs, Istio, and OpenAPI. 178 type Api struct { 179 // Operation: The API operation name. For gRPC requests, it is the fully 180 // qualified API method name, such as "google.pubsub.v1.Publisher.Publish". For 181 // OpenAPI requests, it is the `operationId`, such as "getPet". 182 Operation string `json:"operation,omitempty"` 183 // Protocol: The API protocol used for sending the request, such as "http", 184 // "https", "grpc", or "internal". 185 Protocol string `json:"protocol,omitempty"` 186 // Service: The API service name. It is a logical identifier for a networked 187 // API, such as "pubsub.googleapis.com". The naming syntax depends on the API 188 // management system being used for handling the request. 189 Service string `json:"service,omitempty"` 190 // Version: The API version associated with the API operation above, such as 191 // "v1" or "v1alpha1". 192 Version string `json:"version,omitempty"` 193 // ForceSendFields is a list of field names (e.g. "Operation") to 194 // unconditionally include in API requests. By default, fields with empty or 195 // default values are omitted from API requests. See 196 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 197 // details. 198 ForceSendFields []string `json:"-"` 199 // NullFields is a list of field names (e.g. "Operation") to include in API 200 // requests with the JSON null value. By default, fields with empty values are 201 // omitted from API requests. See 202 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 203 NullFields []string `json:"-"` 204 } 205 206 func (s *Api) MarshalJSON() ([]byte, error) { 207 type NoMethod Api 208 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 209 } 210 211 // AttributeContext: This message defines the standard attribute vocabulary for 212 // Google APIs. An attribute is a piece of metadata that describes an activity 213 // on a network service. For example, the size of an HTTP request, or the 214 // status code of an HTTP response. Each attribute has a type and a name, which 215 // is logically defined as a proto message field in `AttributeContext`. The 216 // field type becomes the attribute type, and the field path becomes the 217 // attribute name. For example, the attribute `source.ip` maps to field 218 // `AttributeContext.source.ip`. This message definition is guaranteed not to 219 // have any wire breaking change. So you can use it directly for passing 220 // attributes across different systems. NOTE: Different system may generate 221 // different subset of attributes. Please verify the system specification 222 // before relying on an attribute generated a system. 223 type AttributeContext struct { 224 // Api: Represents an API operation that is involved to a network activity. 225 Api *Api `json:"api,omitempty"` 226 // Destination: The destination of a network activity, such as accepting a TCP 227 // connection. In a multi hop network activity, the destination represents the 228 // receiver of the last hop. 229 Destination *Peer `json:"destination,omitempty"` 230 // Extensions: Supports extensions for advanced use cases, such as logs and 231 // metrics. 232 Extensions []googleapi.RawMessage `json:"extensions,omitempty"` 233 // Origin: The origin of a network activity. In a multi hop network activity, 234 // the origin represents the sender of the first hop. For the first hop, the 235 // `source` and the `origin` must have the same content. 236 Origin *Peer `json:"origin,omitempty"` 237 // Request: Represents a network request, such as an HTTP request. 238 Request *Request `json:"request,omitempty"` 239 // Resource: Represents a target resource that is involved with a network 240 // activity. If multiple resources are involved with an activity, this must be 241 // the primary one. 242 Resource *Resource `json:"resource,omitempty"` 243 // Response: Represents a network response, such as an HTTP response. 244 Response *Response `json:"response,omitempty"` 245 // Source: The source of a network activity, such as starting a TCP connection. 246 // In a multi hop network activity, the source represents the sender of the 247 // last hop. 248 Source *Peer `json:"source,omitempty"` 249 // ForceSendFields is a list of field names (e.g. "Api") to unconditionally 250 // include in API requests. By default, fields with empty or default values are 251 // omitted from API requests. See 252 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 253 // details. 254 ForceSendFields []string `json:"-"` 255 // NullFields is a list of field names (e.g. "Api") to include in API requests 256 // with the JSON null value. By default, fields with empty values are omitted 257 // from API requests. See 258 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 259 NullFields []string `json:"-"` 260 } 261 262 func (s *AttributeContext) MarshalJSON() ([]byte, error) { 263 type NoMethod AttributeContext 264 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 265 } 266 267 // AuditLog: Common audit log format for Google Cloud Platform API operations. 268 type AuditLog struct { 269 // AuthenticationInfo: Authentication information. 270 AuthenticationInfo *AuthenticationInfo `json:"authenticationInfo,omitempty"` 271 // AuthorizationInfo: Authorization information. If there are multiple 272 // resources or permissions involved, then there is one AuthorizationInfo 273 // element for each {resource, permission} tuple. 274 AuthorizationInfo []*AuthorizationInfo `json:"authorizationInfo,omitempty"` 275 // Metadata: Other service-specific data about the request, response, and other 276 // information associated with the current audited event. 277 Metadata googleapi.RawMessage `json:"metadata,omitempty"` 278 // MethodName: The name of the service method or operation. For API calls, this 279 // should be the name of the API method. For example, 280 // "google.cloud.bigquery.v2.TableService.InsertTable" 281 // "google.logging.v2.ConfigServiceV2.CreateSink" 282 MethodName string `json:"methodName,omitempty"` 283 // NumResponseItems: The number of items returned from a List or Query API 284 // method, if applicable. 285 NumResponseItems int64 `json:"numResponseItems,omitempty,string"` 286 // PolicyViolationInfo: Indicates the policy violations for this request. If 287 // the request is denied by the policy, violation information will be logged 288 // here. 289 PolicyViolationInfo *PolicyViolationInfo `json:"policyViolationInfo,omitempty"` 290 // Request: The operation request. This may not include all request parameters, 291 // such as those that are too large, privacy-sensitive, or duplicated elsewhere 292 // in the log record. It should never include user-generated data, such as file 293 // contents. When the JSON object represented here has a proto equivalent, the 294 // proto name will be indicated in the `@type` property. 295 Request googleapi.RawMessage `json:"request,omitempty"` 296 // RequestMetadata: Metadata about the operation. 297 RequestMetadata *RequestMetadata `json:"requestMetadata,omitempty"` 298 // ResourceLocation: The resource location information. 299 ResourceLocation *ResourceLocation `json:"resourceLocation,omitempty"` 300 // ResourceName: The resource or collection that is the target of the 301 // operation. The name is a scheme-less URI, not including the API service 302 // name. For example: "projects/PROJECT_ID/zones/us-central1-a/instances" 303 // "projects/PROJECT_ID/datasets/DATASET_ID" 304 ResourceName string `json:"resourceName,omitempty"` 305 // ResourceOriginalState: The resource's original state before mutation. 306 // Present only for operations which have successfully modified the targeted 307 // resource(s). In general, this field should contain all changed fields, 308 // except those that are already been included in `request`, `response`, 309 // `metadata` or `service_data` fields. When the JSON object represented here 310 // has a proto equivalent, the proto name will be indicated in the `@type` 311 // property. 312 ResourceOriginalState googleapi.RawMessage `json:"resourceOriginalState,omitempty"` 313 // Response: The operation response. This may not include all response 314 // elements, such as those that are too large, privacy-sensitive, or duplicated 315 // elsewhere in the log record. It should never include user-generated data, 316 // such as file contents. When the JSON object represented here has a proto 317 // equivalent, the proto name will be indicated in the `@type` property. 318 Response googleapi.RawMessage `json:"response,omitempty"` 319 // ServiceData: Deprecated. Use the `metadata` field instead. Other 320 // service-specific data about the request, response, and other activities. 321 ServiceData googleapi.RawMessage `json:"serviceData,omitempty"` 322 // ServiceName: The name of the API service performing the operation. For 323 // example, "compute.googleapis.com". 324 ServiceName string `json:"serviceName,omitempty"` 325 // Status: The status of the overall operation. 326 Status *Status `json:"status,omitempty"` 327 // ForceSendFields is a list of field names (e.g. "AuthenticationInfo") to 328 // unconditionally include in API requests. By default, fields with empty or 329 // default values are omitted from API requests. See 330 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 331 // details. 332 ForceSendFields []string `json:"-"` 333 // NullFields is a list of field names (e.g. "AuthenticationInfo") to include 334 // in API requests with the JSON null value. By default, fields with empty 335 // values are omitted from API requests. See 336 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 337 NullFields []string `json:"-"` 338 } 339 340 func (s *AuditLog) MarshalJSON() ([]byte, error) { 341 type NoMethod AuditLog 342 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 343 } 344 345 // Auth: This message defines request authentication attributes. Terminology is 346 // based on the JSON Web Token (JWT) standard, but the terms also correlate to 347 // concepts in other standards. 348 type Auth struct { 349 // AccessLevels: A list of access level resource names that allow resources to 350 // be accessed by authenticated requester. It is part of Secure GCP processing 351 // for the incoming request. An access level string has the format: 352 // "//{api_service_name}/accessPolicies/{policy_id}/accessLevels/{short_name}" 353 // Example: 354 // "//accesscontextmanager.googleapis.com/accessPolicies/MY_POLICY_ID/accessLeve 355 // ls/MY_LEVEL" 356 AccessLevels []string `json:"accessLevels,omitempty"` 357 // Audiences: The intended audience(s) for this authentication information. 358 // Reflects the audience (`aud`) claim within a JWT. The audience value(s) 359 // depends on the `issuer`, but typically include one or more of the following 360 // pieces of information: * The services intended to receive the credential. 361 // For example, ["https://pubsub.googleapis.com/", 362 // "https://storage.googleapis.com/"]. * A set of service-based scopes. For 363 // example, ["https://www.googleapis.com/auth/cloud-platform"]. * The client id 364 // of an app, such as the Firebase project id for JWTs from Firebase Auth. 365 // Consult the documentation for the credential issuer to determine the 366 // information provided. 367 Audiences []string `json:"audiences,omitempty"` 368 // Claims: Structured claims presented with the credential. JWTs include `{key: 369 // value}` pairs for standard and private claims. The following is a subset of 370 // the standard required and optional claims that would typically be presented 371 // for a Google-based JWT: {'iss': 'accounts.google.com', 'sub': 372 // '113289723416554971153', 'aud': ['123456789012', 'pubsub.googleapis.com'], 373 // 'azp': '123456789012.apps.googleusercontent.com', 'email': 374 // 'jsmith@example.com', 'iat': 1353601026, 'exp': 1353604926} SAML assertions 375 // are similarly specified, but with an identity provider dependent structure. 376 Claims googleapi.RawMessage `json:"claims,omitempty"` 377 // CredentialId: Identifies the client credential id used for authentication. 378 // credential_id is in the format of AUTH_METHOD:IDENTIFIER, e.g. 379 // "serviceaccount:XXXXX, apikey:XXXXX" where the format of the IDENTIFIER can 380 // vary for different AUTH_METHODs. 381 CredentialId string `json:"credentialId,omitempty"` 382 // Presenter: The authorized presenter of the credential. Reflects the optional 383 // Authorized Presenter (`azp`) claim within a JWT or the OAuth client id. For 384 // example, a Google Cloud Platform client id looks as follows: 385 // "123456789012.apps.googleusercontent.com". 386 Presenter string `json:"presenter,omitempty"` 387 // Principal: The authenticated principal. Reflects the issuer (`iss`) and 388 // subject (`sub`) claims within a JWT. The issuer and subject should be `/` 389 // delimited, with `/` percent-encoded within the subject fragment. For Google 390 // accounts, the principal format is: "https://accounts.google.com/{id}" 391 Principal string `json:"principal,omitempty"` 392 // ForceSendFields is a list of field names (e.g. "AccessLevels") to 393 // unconditionally include in API requests. By default, fields with empty or 394 // default values are omitted from API requests. See 395 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 396 // details. 397 ForceSendFields []string `json:"-"` 398 // NullFields is a list of field names (e.g. "AccessLevels") to include in API 399 // requests with the JSON null value. By default, fields with empty values are 400 // omitted from API requests. See 401 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 402 NullFields []string `json:"-"` 403 } 404 405 func (s *Auth) MarshalJSON() ([]byte, error) { 406 type NoMethod Auth 407 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 408 } 409 410 // AuthenticationInfo: Authentication information for the operation. 411 type AuthenticationInfo struct { 412 // AuthoritySelector: The authority selector specified by the requestor, if 413 // any. It is not guaranteed that the principal was allowed to use this 414 // authority. 415 AuthoritySelector string `json:"authoritySelector,omitempty"` 416 // PrincipalEmail: The email address of the authenticated user (or service 417 // account on behalf of third party principal) making the request. For third 418 // party identity callers, the `principal_subject` field is populated instead 419 // of this field. For privacy reasons, the principal email address is sometimes 420 // redacted. For more information, see Caller identities in audit logs 421 // (https://cloud.google.com/logging/docs/audit#user-id). 422 PrincipalEmail string `json:"principalEmail,omitempty"` 423 // PrincipalSubject: String representation of identity of requesting party. 424 // Populated for both first and third party identities. 425 PrincipalSubject string `json:"principalSubject,omitempty"` 426 // ServiceAccountDelegationInfo: Identity delegation history of an 427 // authenticated service account that makes the request. It contains 428 // information on the real authorities that try to access GCP resources by 429 // delegating on a service account. When multiple authorities present, they are 430 // guaranteed to be sorted based on the original ordering of the identity 431 // delegation events. 432 ServiceAccountDelegationInfo []*ServiceAccountDelegationInfo `json:"serviceAccountDelegationInfo,omitempty"` 433 // ServiceAccountKeyName: The name of the service account key used to create or 434 // exchange credentials for authenticating the service account making the 435 // request. This is a scheme-less URI full resource name. For example: 436 // "//iam.googleapis.com/projects/{PROJECT_ID}/serviceAccounts/{ACCOUNT}/keys/{k 437 // ey}" 438 ServiceAccountKeyName string `json:"serviceAccountKeyName,omitempty"` 439 // ServiceDelegationHistory: Records the history of delegated resource access 440 // across Google services. 441 ServiceDelegationHistory *ServiceDelegationHistory `json:"serviceDelegationHistory,omitempty"` 442 // ThirdPartyPrincipal: The third party identification (if any) of the 443 // authenticated user making the request. When the JSON object represented here 444 // has a proto equivalent, the proto name will be indicated in the `@type` 445 // property. 446 ThirdPartyPrincipal googleapi.RawMessage `json:"thirdPartyPrincipal,omitempty"` 447 // ForceSendFields is a list of field names (e.g. "AuthoritySelector") to 448 // unconditionally include in API requests. By default, fields with empty or 449 // default values are omitted from API requests. See 450 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 451 // details. 452 ForceSendFields []string `json:"-"` 453 // NullFields is a list of field names (e.g. "AuthoritySelector") to include in 454 // API requests with the JSON null value. By default, fields with empty values 455 // are omitted from API requests. See 456 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 457 NullFields []string `json:"-"` 458 } 459 460 func (s *AuthenticationInfo) MarshalJSON() ([]byte, error) { 461 type NoMethod AuthenticationInfo 462 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 463 } 464 465 // AuthorizationInfo: Authorization information for the operation. 466 type AuthorizationInfo struct { 467 // Granted: Whether or not authorization for `resource` and `permission` was 468 // granted. 469 Granted bool `json:"granted,omitempty"` 470 // Permission: The required IAM permission. 471 Permission string `json:"permission,omitempty"` 472 // PermissionType: The type of the permission that was checked. For data access 473 // audit logs this corresponds with the permission type that must be enabled in 474 // the project/folder/organization IAM policy in order for the log to be 475 // written. 476 // 477 // Possible values: 478 // "PERMISSION_TYPE_UNSPECIFIED" - Default. Should not be used. 479 // "ADMIN_READ" - Permissions that gate reading resource configuration or 480 // metadata. 481 // "ADMIN_WRITE" - Permissions that gate modification of resource 482 // configuration or metadata. 483 // "DATA_READ" - Permissions that gate reading user-provided data. 484 // "DATA_WRITE" - Permissions that gate writing user-provided data. 485 PermissionType string `json:"permissionType,omitempty"` 486 // Resource: The resource being accessed, as a REST-style or cloud resource 487 // string. For example: 488 // bigquery.googleapis.com/projects/PROJECTID/datasets/DATASETID or 489 // projects/PROJECTID/datasets/DATASETID 490 Resource string `json:"resource,omitempty"` 491 // ResourceAttributes: Resource attributes used in IAM condition evaluation. 492 // This field contains resource attributes like resource type and resource 493 // name. To get the whole view of the attributes used in IAM condition 494 // evaluation, the user must also look into 495 // `AuditLog.request_metadata.request_attributes`. 496 ResourceAttributes *Resource `json:"resourceAttributes,omitempty"` 497 // ForceSendFields is a list of field names (e.g. "Granted") to unconditionally 498 // include in API requests. By default, fields with empty or default values are 499 // omitted from API requests. See 500 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 501 // details. 502 ForceSendFields []string `json:"-"` 503 // NullFields is a list of field names (e.g. "Granted") to include in API 504 // requests with the JSON null value. By default, fields with empty values are 505 // omitted from API requests. See 506 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 507 NullFields []string `json:"-"` 508 } 509 510 func (s *AuthorizationInfo) MarshalJSON() ([]byte, error) { 511 type NoMethod AuthorizationInfo 512 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 513 } 514 515 // CheckRequest: Request message for the Check method. 516 type CheckRequest struct { 517 // Attributes: Describes attributes about the operation being executed by the 518 // service. 519 Attributes *AttributeContext `json:"attributes,omitempty"` 520 // Flags: Optional. Contains a comma-separated list of flags. 521 Flags string `json:"flags,omitempty"` 522 // Resources: Describes the resources and the policies applied to each 523 // resource. 524 Resources []*ResourceInfo `json:"resources,omitempty"` 525 // ServiceConfigId: Specifies the version of the service configuration that 526 // should be used to process the request. Must not be empty. Set this field to 527 // 'latest' to specify using the latest configuration. 528 ServiceConfigId string `json:"serviceConfigId,omitempty"` 529 // ForceSendFields is a list of field names (e.g. "Attributes") to 530 // unconditionally include in API requests. By default, fields with empty or 531 // default values are omitted from API requests. See 532 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 533 // details. 534 ForceSendFields []string `json:"-"` 535 // NullFields is a list of field names (e.g. "Attributes") to include in API 536 // requests with the JSON null value. By default, fields with empty values are 537 // omitted from API requests. See 538 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 539 NullFields []string `json:"-"` 540 } 541 542 func (s *CheckRequest) MarshalJSON() ([]byte, error) { 543 type NoMethod CheckRequest 544 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 545 } 546 547 // CheckResponse: Response message for the Check method. 548 type CheckResponse struct { 549 // Headers: Returns a set of request contexts generated from the 550 // `CheckRequest`. 551 Headers map[string]string `json:"headers,omitempty"` 552 // Status: Operation is allowed when this field is not set. Any non-'OK' status 553 // indicates a denial; google.rpc.Status.details would contain additional 554 // details about the denial. 555 Status *Status `json:"status,omitempty"` 556 557 // ServerResponse contains the HTTP response code and headers from the server. 558 googleapi.ServerResponse `json:"-"` 559 // ForceSendFields is a list of field names (e.g. "Headers") to unconditionally 560 // include in API requests. By default, fields with empty or default values are 561 // omitted from API requests. See 562 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 563 // details. 564 ForceSendFields []string `json:"-"` 565 // NullFields is a list of field names (e.g. "Headers") to include in API 566 // requests with the JSON null value. By default, fields with empty values are 567 // omitted from API requests. See 568 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 569 NullFields []string `json:"-"` 570 } 571 572 func (s *CheckResponse) MarshalJSON() ([]byte, error) { 573 type NoMethod CheckResponse 574 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 575 } 576 577 // FirstPartyPrincipal: First party identity principal. 578 type FirstPartyPrincipal struct { 579 // PrincipalEmail: The email address of a Google account. . 580 PrincipalEmail string `json:"principalEmail,omitempty"` 581 // ServiceMetadata: Metadata about the service that uses the service account. . 582 ServiceMetadata googleapi.RawMessage `json:"serviceMetadata,omitempty"` 583 // ForceSendFields is a list of field names (e.g. "PrincipalEmail") to 584 // unconditionally include in API requests. By default, fields with empty or 585 // default values are omitted from API requests. See 586 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 587 // details. 588 ForceSendFields []string `json:"-"` 589 // NullFields is a list of field names (e.g. "PrincipalEmail") to include in 590 // API requests with the JSON null value. By default, fields with empty values 591 // are omitted from API requests. See 592 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 593 NullFields []string `json:"-"` 594 } 595 596 func (s *FirstPartyPrincipal) MarshalJSON() ([]byte, error) { 597 type NoMethod FirstPartyPrincipal 598 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 599 } 600 601 // OrgPolicyViolationInfo: Represents OrgPolicy Violation information. 602 type OrgPolicyViolationInfo struct { 603 // Payload: Optional. Resource payload that is currently in scope and is 604 // subjected to orgpolicy conditions. This payload may be the subset of the 605 // actual Resource that may come in the request. This payload should not 606 // contain any core content. 607 Payload googleapi.RawMessage `json:"payload,omitempty"` 608 // ResourceTags: Optional. Tags referenced on the resource at the time of 609 // evaluation. These also include the federated tags, if they are supplied in 610 // the CheckOrgPolicy or CheckCustomConstraints Requests. Optional field as of 611 // now. These tags are the Cloud tags that are available on the resource during 612 // the policy evaluation and will be available as part of the OrgPolicy check 613 // response for logging purposes. 614 ResourceTags map[string]string `json:"resourceTags,omitempty"` 615 // ResourceType: Optional. Resource type that the orgpolicy is checked against. 616 // Example: compute.googleapis.com/Instance, store.googleapis.com/bucket 617 ResourceType string `json:"resourceType,omitempty"` 618 // ViolationInfo: Optional. Policy violations 619 ViolationInfo []*ViolationInfo `json:"violationInfo,omitempty"` 620 // ForceSendFields is a list of field names (e.g. "Payload") to unconditionally 621 // include in API requests. By default, fields with empty or default values are 622 // omitted from API requests. See 623 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 624 // details. 625 ForceSendFields []string `json:"-"` 626 // NullFields is a list of field names (e.g. "Payload") to include in API 627 // requests with the JSON null value. By default, fields with empty values are 628 // omitted from API requests. See 629 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 630 NullFields []string `json:"-"` 631 } 632 633 func (s *OrgPolicyViolationInfo) MarshalJSON() ([]byte, error) { 634 type NoMethod OrgPolicyViolationInfo 635 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 636 } 637 638 // Peer: This message defines attributes for a node that handles a network 639 // request. The node can be either a service or an application that sends, 640 // forwards, or receives the request. Service peers should fill in `principal` 641 // and `labels` as appropriate. 642 type Peer struct { 643 // Ip: The IP address of the peer. 644 Ip string `json:"ip,omitempty"` 645 // Labels: The labels associated with the peer. 646 Labels map[string]string `json:"labels,omitempty"` 647 // Port: The network port of the peer. 648 Port int64 `json:"port,omitempty,string"` 649 // Principal: The identity of this peer. Similar to `Request.auth.principal`, 650 // but relative to the peer instead of the request. For example, the identity 651 // associated with a load balancer that forwarded the request. 652 Principal string `json:"principal,omitempty"` 653 // RegionCode: The CLDR country/region code associated with the above IP 654 // address. If the IP address is private, the `region_code` should reflect the 655 // physical location where this peer is running. 656 RegionCode string `json:"regionCode,omitempty"` 657 // ForceSendFields is a list of field names (e.g. "Ip") to unconditionally 658 // include in API requests. By default, fields with empty or default values are 659 // omitted from API requests. See 660 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 661 // details. 662 ForceSendFields []string `json:"-"` 663 // NullFields is a list of field names (e.g. "Ip") to include in API requests 664 // with the JSON null value. By default, fields with empty values are omitted 665 // from API requests. See 666 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 667 NullFields []string `json:"-"` 668 } 669 670 func (s *Peer) MarshalJSON() ([]byte, error) { 671 type NoMethod Peer 672 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 673 } 674 675 // PolicyViolationInfo: Information related to policy violations for this 676 // request. 677 type PolicyViolationInfo struct { 678 // OrgPolicyViolationInfo: Indicates the orgpolicy violations for this 679 // resource. 680 OrgPolicyViolationInfo *OrgPolicyViolationInfo `json:"orgPolicyViolationInfo,omitempty"` 681 // ForceSendFields is a list of field names (e.g. "OrgPolicyViolationInfo") to 682 // unconditionally include in API requests. By default, fields with empty or 683 // default values are omitted from API requests. See 684 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 685 // details. 686 ForceSendFields []string `json:"-"` 687 // NullFields is a list of field names (e.g. "OrgPolicyViolationInfo") to 688 // include in API requests with the JSON null value. By default, fields with 689 // empty values are omitted from API requests. See 690 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 691 NullFields []string `json:"-"` 692 } 693 694 func (s *PolicyViolationInfo) MarshalJSON() ([]byte, error) { 695 type NoMethod PolicyViolationInfo 696 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 697 } 698 699 // ReportRequest: Request message for the Report method. 700 type ReportRequest struct { 701 // Operations: Describes the list of operations to be reported. Each operation 702 // is represented as an AttributeContext, and contains all attributes around an 703 // API access. 704 Operations []*AttributeContext `json:"operations,omitempty"` 705 // ServiceConfigId: Specifies the version of the service configuration that 706 // should be used to process the request. Must not be empty. Set this field to 707 // 'latest' to specify using the latest configuration. 708 ServiceConfigId string `json:"serviceConfigId,omitempty"` 709 // ForceSendFields is a list of field names (e.g. "Operations") to 710 // unconditionally include in API requests. By default, fields with empty or 711 // default values are omitted from API requests. See 712 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 713 // details. 714 ForceSendFields []string `json:"-"` 715 // NullFields is a list of field names (e.g. "Operations") to include in API 716 // requests with the JSON null value. By default, fields with empty values are 717 // omitted from API requests. See 718 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 719 NullFields []string `json:"-"` 720 } 721 722 func (s *ReportRequest) MarshalJSON() ([]byte, error) { 723 type NoMethod ReportRequest 724 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 725 } 726 727 // ReportResponse: Response message for the Report method. 728 type ReportResponse struct { 729 // Extensions: The extension field to store serialized OTel responses. e.g. 730 // ExportLogsServiceResponse, ExportMetricsServiceResponse. 731 Extensions googleapi.RawMessage `json:"extensions,omitempty"` 732 733 // ServerResponse contains the HTTP response code and headers from the server. 734 googleapi.ServerResponse `json:"-"` 735 // ForceSendFields is a list of field names (e.g. "Extensions") to 736 // unconditionally include in API requests. By default, fields with empty or 737 // default values are omitted from API requests. See 738 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 739 // details. 740 ForceSendFields []string `json:"-"` 741 // NullFields is a list of field names (e.g. "Extensions") to include in API 742 // requests with the JSON null value. By default, fields with empty values are 743 // omitted from API requests. See 744 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 745 NullFields []string `json:"-"` 746 } 747 748 func (s *ReportResponse) MarshalJSON() ([]byte, error) { 749 type NoMethod ReportResponse 750 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 751 } 752 753 // Request: This message defines attributes for an HTTP request. If the actual 754 // request is not an HTTP request, the runtime system should try to map the 755 // actual request to an equivalent HTTP request. 756 type Request struct { 757 // Auth: The request authentication. May be absent for unauthenticated 758 // requests. Derived from the HTTP request `Authorization` header or 759 // equivalent. 760 Auth *Auth `json:"auth,omitempty"` 761 // Headers: The HTTP request headers. If multiple headers share the same key, 762 // they must be merged according to the HTTP spec. All header keys must be 763 // lowercased, because HTTP header keys are case-insensitive. 764 Headers map[string]string `json:"headers,omitempty"` 765 // Host: The HTTP request `Host` header value. 766 Host string `json:"host,omitempty"` 767 // Id: The unique ID for a request, which can be propagated to downstream 768 // systems. The ID should have low probability of collision within a single day 769 // for a specific service. 770 Id string `json:"id,omitempty"` 771 // Method: The HTTP request method, such as `GET`, `POST`. 772 Method string `json:"method,omitempty"` 773 // Path: The HTTP URL path, excluding the query parameters. 774 Path string `json:"path,omitempty"` 775 // Protocol: The network protocol used with the request, such as "http/1.1", 776 // "spdy/3", "h2", "h2c", "webrtc", "tcp", "udp", "quic". See 777 // https://www.iana.org/assignments/tls-extensiontype-values/tls-extensiontype-values.xhtml#alpn-protocol-ids 778 // for details. 779 Protocol string `json:"protocol,omitempty"` 780 // Query: The HTTP URL query in the format of `name1=value1&name2=value2`, as 781 // it appears in the first line of the HTTP request. No decoding is performed. 782 Query string `json:"query,omitempty"` 783 // Reason: A special parameter for request reason. It is used by security 784 // systems to associate auditing information with a request. 785 Reason string `json:"reason,omitempty"` 786 // Scheme: The HTTP URL scheme, such as `http` and `https`. 787 Scheme string `json:"scheme,omitempty"` 788 // Size: The HTTP request size in bytes. If unknown, it must be -1. 789 Size int64 `json:"size,omitempty,string"` 790 // Time: The timestamp when the `destination` service receives the last byte of 791 // the request. 792 Time string `json:"time,omitempty"` 793 // ForceSendFields is a list of field names (e.g. "Auth") to unconditionally 794 // include in API requests. By default, fields with empty or default values are 795 // omitted from API requests. See 796 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 797 // details. 798 ForceSendFields []string `json:"-"` 799 // NullFields is a list of field names (e.g. "Auth") to include in API requests 800 // with the JSON null value. By default, fields with empty values are omitted 801 // from API requests. See 802 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 803 NullFields []string `json:"-"` 804 } 805 806 func (s *Request) MarshalJSON() ([]byte, error) { 807 type NoMethod Request 808 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 809 } 810 811 // RequestMetadata: Metadata about the request. 812 type RequestMetadata struct { 813 // CallerIp: The IP address of the caller. For a caller from the internet, this 814 // will be the public IPv4 or IPv6 address. For calls made from inside Google's 815 // internal production network from one GCP service to another, `caller_ip` 816 // will be redacted to "private". For a caller from a Compute Engine VM with a 817 // external IP address, `caller_ip` will be the VM's external IP address. For a 818 // caller from a Compute Engine VM without a external IP address, if the VM is 819 // in the same organization (or project) as the accessed resource, `caller_ip` 820 // will be the VM's internal IPv4 address, otherwise `caller_ip` will be 821 // redacted to "gce-internal-ip". See 822 // https://cloud.google.com/compute/docs/vpc/ for more information. 823 CallerIp string `json:"callerIp,omitempty"` 824 // CallerNetwork: The network of the caller. Set only if the network host 825 // project is part of the same GCP organization (or project) as the accessed 826 // resource. See https://cloud.google.com/compute/docs/vpc/ for more 827 // information. This is a scheme-less URI full resource name. For example: 828 // "//compute.googleapis.com/projects/PROJECT_ID/global/networks/NETWORK_ID" 829 CallerNetwork string `json:"callerNetwork,omitempty"` 830 // CallerSuppliedUserAgent: The user agent of the caller. This information is 831 // not authenticated and should be treated accordingly. For example: + 832 // `google-api-python-client/1.4.0`: The request was made by the Google API 833 // client for Python. + `Cloud SDK Command Line Tool apitools-client/1.0 834 // gcloud/0.9.62`: The request was made by the Google Cloud SDK CLI (gcloud). + 835 // `AppEngine-Google; (+http://code.google.com/appengine; appid: s~my-project`: 836 // The request was made from the `my-project` App Engine app. 837 CallerSuppliedUserAgent string `json:"callerSuppliedUserAgent,omitempty"` 838 // DestinationAttributes: The destination of a network activity, such as 839 // accepting a TCP connection. In a multi hop network activity, the destination 840 // represents the receiver of the last hop. Only two fields are used in this 841 // message, Peer.port and Peer.ip. These fields are optionally populated by 842 // those services utilizing the IAM condition feature. 843 DestinationAttributes *Peer `json:"destinationAttributes,omitempty"` 844 // RequestAttributes: Request attributes used in IAM condition evaluation. This 845 // field contains request attributes like request time and access levels 846 // associated with the request. To get the whole view of the attributes used in 847 // IAM condition evaluation, the user must also look into 848 // `AuditLog.authentication_info.resource_attributes`. 849 RequestAttributes *Request `json:"requestAttributes,omitempty"` 850 // ForceSendFields is a list of field names (e.g. "CallerIp") to 851 // unconditionally include in API requests. By default, fields with empty or 852 // default values are omitted from API requests. See 853 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 854 // details. 855 ForceSendFields []string `json:"-"` 856 // NullFields is a list of field names (e.g. "CallerIp") to include in API 857 // requests with the JSON null value. By default, fields with empty values are 858 // omitted from API requests. See 859 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 860 NullFields []string `json:"-"` 861 } 862 863 func (s *RequestMetadata) MarshalJSON() ([]byte, error) { 864 type NoMethod RequestMetadata 865 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 866 } 867 868 // Resource: This message defines core attributes for a resource. A resource is 869 // an addressable (named) entity provided by the destination service. For 870 // example, a file stored on a network storage service. 871 type Resource struct { 872 // Annotations: Annotations is an unstructured key-value map stored with a 873 // resource that may be set by external tools to store and retrieve arbitrary 874 // metadata. They are not queryable and should be preserved when modifying 875 // objects. More info: 876 // https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/ 877 Annotations map[string]string `json:"annotations,omitempty"` 878 // CreateTime: Output only. The timestamp when the resource was created. This 879 // may be either the time creation was initiated or when it was completed. 880 CreateTime string `json:"createTime,omitempty"` 881 // DeleteTime: Output only. The timestamp when the resource was deleted. If the 882 // resource is not deleted, this must be empty. 883 DeleteTime string `json:"deleteTime,omitempty"` 884 // DisplayName: Mutable. The display name set by clients. Must be <= 63 885 // characters. 886 DisplayName string `json:"displayName,omitempty"` 887 // Etag: Output only. An opaque value that uniquely identifies a version or 888 // generation of a resource. It can be used to confirm that the client and 889 // server agree on the ordering of a resource being written. 890 Etag string `json:"etag,omitempty"` 891 // Labels: The labels or tags on the resource, such as AWS resource tags and 892 // Kubernetes resource labels. 893 Labels map[string]string `json:"labels,omitempty"` 894 // Location: Immutable. The location of the resource. The location encoding is 895 // specific to the service provider, and new encoding may be introduced as the 896 // service evolves. For Google Cloud products, the encoding is what is used by 897 // Google Cloud APIs, such as `us-east1`, `aws-us-east-1`, and `azure-eastus2`. 898 // The semantics of `location` is identical to the 899 // `cloud.googleapis.com/location` label used by some Google Cloud APIs. 900 Location string `json:"location,omitempty"` 901 // Name: The stable identifier (name) of a resource on the `service`. A 902 // resource can be logically identified as 903 // "//{resource.service}/{resource.name}". The differences between a resource 904 // name and a URI are: * Resource name is a logical identifier, independent of 905 // network protocol and API version. For example, 906 // `//pubsub.googleapis.com/projects/123/topics/news-feed`. * URI often 907 // includes protocol and version information, so it can be used directly by 908 // applications. For example, 909 // `https://pubsub.googleapis.com/v1/projects/123/topics/news-feed`. See 910 // https://cloud.google.com/apis/design/resource_names for details. 911 Name string `json:"name,omitempty"` 912 // Service: The name of the service that this resource belongs to, such as 913 // `pubsub.googleapis.com`. The service may be different from the DNS hostname 914 // that actually serves the request. 915 Service string `json:"service,omitempty"` 916 // Type: The type of the resource. The syntax is platform-specific because 917 // different platforms define their resources differently. For Google APIs, the 918 // type format must be "{service}/{kind}", such as 919 // "pubsub.googleapis.com/Topic". 920 Type string `json:"type,omitempty"` 921 // Uid: The unique identifier of the resource. UID is unique in the time and 922 // space for this resource within the scope of the service. It is typically 923 // generated by the server on successful creation of a resource and must not be 924 // changed. UID is used to uniquely identify resources with resource name 925 // reuses. This should be a UUID4. 926 Uid string `json:"uid,omitempty"` 927 // UpdateTime: Output only. The timestamp when the resource was last updated. 928 // Any change to the resource made by users must refresh this value. Changes to 929 // a resource made by the service should refresh this value. 930 UpdateTime string `json:"updateTime,omitempty"` 931 // ForceSendFields is a list of field names (e.g. "Annotations") to 932 // unconditionally include in API requests. By default, fields with empty or 933 // default values are omitted from API requests. See 934 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 935 // details. 936 ForceSendFields []string `json:"-"` 937 // NullFields is a list of field names (e.g. "Annotations") to include in API 938 // requests with the JSON null value. By default, fields with empty values are 939 // omitted from API requests. See 940 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 941 NullFields []string `json:"-"` 942 } 943 944 func (s *Resource) MarshalJSON() ([]byte, error) { 945 type NoMethod Resource 946 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 947 } 948 949 // ResourceInfo: Describes a resource referenced in the request. 950 type ResourceInfo struct { 951 // Container: Optional. The identifier of the container of this resource. For 952 // Google Cloud APIs, the resource container must be one of the following 953 // formats: - `projects/` - `folders/` - `organizations/` Required for the 954 // policy enforcement on the container level (e.g. VPCSC, Location Policy 955 // check, Org Policy check). 956 Container string `json:"container,omitempty"` 957 // Location: Optional. The location of the resource, it must be a valid zone, 958 // region or multiregion, for example: "europe-west4", 959 // "northamerica-northeast1-a". Required for location policy check. 960 Location string `json:"location,omitempty"` 961 // Name: The name of the resource referenced in the request. 962 Name string `json:"name,omitempty"` 963 // Permission: The resource permission needed for this request. The format must 964 // be "{service}/{plural}.{verb}". 965 Permission string `json:"permission,omitempty"` 966 // Type: The resource type in the format of "{service}/{kind}". 967 Type string `json:"type,omitempty"` 968 // ForceSendFields is a list of field names (e.g. "Container") to 969 // unconditionally include in API requests. By default, fields with empty or 970 // default values are omitted from API requests. See 971 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 972 // details. 973 ForceSendFields []string `json:"-"` 974 // NullFields is a list of field names (e.g. "Container") to include in API 975 // requests with the JSON null value. By default, fields with empty values are 976 // omitted from API requests. See 977 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 978 NullFields []string `json:"-"` 979 } 980 981 func (s *ResourceInfo) MarshalJSON() ([]byte, error) { 982 type NoMethod ResourceInfo 983 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 984 } 985 986 // ResourceLocation: Location information about a resource. 987 type ResourceLocation struct { 988 // CurrentLocations: The locations of a resource after the execution of the 989 // operation. Requests to create or delete a location based resource must 990 // populate the 'current_locations' field and not the 'original_locations' 991 // field. For example: "europe-west1-a" "us-east1" "nam3" 992 CurrentLocations []string `json:"currentLocations,omitempty"` 993 // OriginalLocations: The locations of a resource prior to the execution of the 994 // operation. Requests that mutate the resource's location must populate both 995 // the 'original_locations' as well as the 'current_locations' fields. For 996 // example: "europe-west1-a" "us-east1" "nam3" 997 OriginalLocations []string `json:"originalLocations,omitempty"` 998 // ForceSendFields is a list of field names (e.g. "CurrentLocations") to 999 // unconditionally include in API requests. By default, fields with empty or 1000 // default values are omitted from API requests. See 1001 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1002 // details. 1003 ForceSendFields []string `json:"-"` 1004 // NullFields is a list of field names (e.g. "CurrentLocations") to include in 1005 // API requests with the JSON null value. By default, fields with empty values 1006 // are omitted from API requests. See 1007 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1008 NullFields []string `json:"-"` 1009 } 1010 1011 func (s *ResourceLocation) MarshalJSON() ([]byte, error) { 1012 type NoMethod ResourceLocation 1013 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1014 } 1015 1016 // Response: This message defines attributes for a typical network response. It 1017 // generally models semantics of an HTTP response. 1018 type Response struct { 1019 // BackendLatency: The amount of time it takes the backend service to fully 1020 // respond to a request. Measured from when the destination service starts to 1021 // send the request to the backend until when the destination service receives 1022 // the complete response from the backend. 1023 BackendLatency string `json:"backendLatency,omitempty"` 1024 // Code: The HTTP response status code, such as `200` and `404`. 1025 Code int64 `json:"code,omitempty,string"` 1026 // Headers: The HTTP response headers. If multiple headers share the same key, 1027 // they must be merged according to HTTP spec. All header keys must be 1028 // lowercased, because HTTP header keys are case-insensitive. 1029 Headers map[string]string `json:"headers,omitempty"` 1030 // Size: The HTTP response size in bytes. If unknown, it must be -1. 1031 Size int64 `json:"size,omitempty,string"` 1032 // Time: The timestamp when the `destination` service sends the last byte of 1033 // the response. 1034 Time string `json:"time,omitempty"` 1035 // ForceSendFields is a list of field names (e.g. "BackendLatency") to 1036 // unconditionally include in API requests. By default, fields with empty or 1037 // default values are omitted from API requests. See 1038 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1039 // details. 1040 ForceSendFields []string `json:"-"` 1041 // NullFields is a list of field names (e.g. "BackendLatency") to include in 1042 // API requests with the JSON null value. By default, fields with empty values 1043 // are omitted from API requests. See 1044 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1045 NullFields []string `json:"-"` 1046 } 1047 1048 func (s *Response) MarshalJSON() ([]byte, error) { 1049 type NoMethod Response 1050 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1051 } 1052 1053 // ServiceAccountDelegationInfo: Identity delegation history of an 1054 // authenticated service account. 1055 type ServiceAccountDelegationInfo struct { 1056 // FirstPartyPrincipal: First party (Google) identity as the real authority. 1057 FirstPartyPrincipal *FirstPartyPrincipal `json:"firstPartyPrincipal,omitempty"` 1058 // PrincipalSubject: A string representing the principal_subject associated 1059 // with the identity. For most identities, the format will be 1060 // `principal://iam.googleapis.com/{identity pool name}/subject/{subject)` 1061 // except for some GKE identities (GKE_WORKLOAD, FREEFORM, GKE_HUB_WORKLOAD) 1062 // that are still in the legacy format `serviceAccount:{identity pool 1063 // name}[{subject}]` 1064 PrincipalSubject string `json:"principalSubject,omitempty"` 1065 // ThirdPartyPrincipal: Third party identity as the real authority. 1066 ThirdPartyPrincipal *ThirdPartyPrincipal `json:"thirdPartyPrincipal,omitempty"` 1067 // ForceSendFields is a list of field names (e.g. "FirstPartyPrincipal") to 1068 // unconditionally include in API requests. By default, fields with empty or 1069 // default values are omitted from API requests. See 1070 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1071 // details. 1072 ForceSendFields []string `json:"-"` 1073 // NullFields is a list of field names (e.g. "FirstPartyPrincipal") to include 1074 // in API requests with the JSON null value. By default, fields with empty 1075 // values are omitted from API requests. See 1076 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1077 NullFields []string `json:"-"` 1078 } 1079 1080 func (s *ServiceAccountDelegationInfo) MarshalJSON() ([]byte, error) { 1081 type NoMethod ServiceAccountDelegationInfo 1082 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1083 } 1084 1085 // ServiceDelegationHistory: The history of delegation across multiple services 1086 // as the result of the original user's action. Such as "service A uses its own 1087 // account to do something for user B". This differs from 1088 // ServiceAccountDelegationInfo, which only tracks the history of direct token 1089 // exchanges (impersonation). 1090 type ServiceDelegationHistory struct { 1091 // OriginalPrincipal: The original end user who initiated the request to GCP. 1092 OriginalPrincipal string `json:"originalPrincipal,omitempty"` 1093 // ServiceMetadata: Data identifying the service specific jobs or units of work 1094 // that were involved in a chain of service calls. 1095 ServiceMetadata []*ServiceMetadata `json:"serviceMetadata,omitempty"` 1096 // ForceSendFields is a list of field names (e.g. "OriginalPrincipal") to 1097 // unconditionally include in API requests. By default, fields with empty or 1098 // default values are omitted from API requests. See 1099 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1100 // details. 1101 ForceSendFields []string `json:"-"` 1102 // NullFields is a list of field names (e.g. "OriginalPrincipal") to include in 1103 // API requests with the JSON null value. By default, fields with empty values 1104 // are omitted from API requests. See 1105 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1106 NullFields []string `json:"-"` 1107 } 1108 1109 func (s *ServiceDelegationHistory) MarshalJSON() ([]byte, error) { 1110 type NoMethod ServiceDelegationHistory 1111 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1112 } 1113 1114 // ServiceMetadata: Metadata describing the service and additional service 1115 // specific information used to identify the job or unit of work at hand. 1116 type ServiceMetadata struct { 1117 // JobMetadata: Additional metadata provided by service teams to describe 1118 // service specific job information that was triggered by the original 1119 // principal. 1120 JobMetadata googleapi.RawMessage `json:"jobMetadata,omitempty"` 1121 // PrincipalSubject: A string representing the principal_subject associated 1122 // with the identity. For most identities, the format will be 1123 // `principal://iam.googleapis.com/{identity pool name}/subject/{subject)` 1124 // except for some GKE identities (GKE_WORKLOAD, FREEFORM, GKE_HUB_WORKLOAD) 1125 // that are still in the legacy format `serviceAccount:{identity pool 1126 // name}[{subject}]` If the identity is a Google account (e.g. workspace user 1127 // account or service account), this will be the email of the prefixed by 1128 // `serviceAccount:`. For example: 1129 // `serviceAccount:my-service-account@project-1.iam.gserviceaccount.com`. If 1130 // the identity is an individual user, the identity will be formatted as: 1131 // `user:user_ABC@email.com`. 1132 PrincipalSubject string `json:"principalSubject,omitempty"` 1133 // ServiceDomain: The service's fully qualified domain name, e.g. 1134 // "dataproc.googleapis.com". 1135 ServiceDomain string `json:"serviceDomain,omitempty"` 1136 // ForceSendFields is a list of field names (e.g. "JobMetadata") to 1137 // unconditionally include in API requests. By default, fields with empty or 1138 // default values are omitted from API requests. See 1139 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1140 // details. 1141 ForceSendFields []string `json:"-"` 1142 // NullFields is a list of field names (e.g. "JobMetadata") to include in API 1143 // requests with the JSON null value. By default, fields with empty values are 1144 // omitted from API requests. See 1145 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1146 NullFields []string `json:"-"` 1147 } 1148 1149 func (s *ServiceMetadata) MarshalJSON() ([]byte, error) { 1150 type NoMethod ServiceMetadata 1151 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1152 } 1153 1154 // SpanContext: The context of a span. This is attached to an Exemplar in 1155 // Distribution values during aggregation. It contains the name of a span with 1156 // format: projects/[PROJECT_ID_OR_NUMBER]/traces/[TRACE_ID]/spans/[SPAN_ID] 1157 type SpanContext struct { 1158 // SpanName: The resource name of the span. The format is: 1159 // projects/[PROJECT_ID_OR_NUMBER]/traces/[TRACE_ID]/spans/[SPAN_ID] 1160 // `[TRACE_ID]` is a unique identifier for a trace within a project; it is a 1161 // 32-character hexadecimal encoding of a 16-byte array. `[SPAN_ID]` is a 1162 // unique identifier for a span within a trace; it is a 16-character 1163 // hexadecimal encoding of an 8-byte array. 1164 SpanName string `json:"spanName,omitempty"` 1165 // ForceSendFields is a list of field names (e.g. "SpanName") to 1166 // unconditionally include in API requests. By default, fields with empty or 1167 // default values are omitted from API requests. See 1168 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1169 // details. 1170 ForceSendFields []string `json:"-"` 1171 // NullFields is a list of field names (e.g. "SpanName") to include in API 1172 // requests with the JSON null value. By default, fields with empty values are 1173 // omitted from API requests. See 1174 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1175 NullFields []string `json:"-"` 1176 } 1177 1178 func (s *SpanContext) MarshalJSON() ([]byte, error) { 1179 type NoMethod SpanContext 1180 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1181 } 1182 1183 // Status: The `Status` type defines a logical error model that is suitable for 1184 // different programming environments, including REST APIs and RPC APIs. It is 1185 // used by gRPC (https://github.com/grpc). Each `Status` message contains three 1186 // pieces of data: error code, error message, and error details. You can find 1187 // out more about this error model and how to work with it in the API Design 1188 // Guide (https://cloud.google.com/apis/design/errors). 1189 type Status struct { 1190 // Code: The status code, which should be an enum value of google.rpc.Code. 1191 Code int64 `json:"code,omitempty"` 1192 // Details: A list of messages that carry the error details. There is a common 1193 // set of message types for APIs to use. 1194 Details []googleapi.RawMessage `json:"details,omitempty"` 1195 // Message: A developer-facing error message, which should be in English. Any 1196 // user-facing error message should be localized and sent in the 1197 // google.rpc.Status.details field, or localized by the client. 1198 Message string `json:"message,omitempty"` 1199 // ForceSendFields is a list of field names (e.g. "Code") to unconditionally 1200 // include in API requests. By default, fields with empty or default values are 1201 // omitted from API requests. See 1202 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1203 // details. 1204 ForceSendFields []string `json:"-"` 1205 // NullFields is a list of field names (e.g. "Code") to include in API requests 1206 // with the JSON null value. By default, fields with empty values are omitted 1207 // from API requests. See 1208 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1209 NullFields []string `json:"-"` 1210 } 1211 1212 func (s *Status) MarshalJSON() ([]byte, error) { 1213 type NoMethod Status 1214 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1215 } 1216 1217 // ThirdPartyPrincipal: Third party identity principal. 1218 type ThirdPartyPrincipal struct { 1219 // ThirdPartyClaims: Metadata about third party identity. 1220 ThirdPartyClaims googleapi.RawMessage `json:"thirdPartyClaims,omitempty"` 1221 // ForceSendFields is a list of field names (e.g. "ThirdPartyClaims") to 1222 // unconditionally include in API requests. By default, fields with empty or 1223 // default values are omitted from API requests. See 1224 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1225 // details. 1226 ForceSendFields []string `json:"-"` 1227 // NullFields is a list of field names (e.g. "ThirdPartyClaims") to include in 1228 // API requests with the JSON null value. By default, fields with empty values 1229 // are omitted from API requests. See 1230 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1231 NullFields []string `json:"-"` 1232 } 1233 1234 func (s *ThirdPartyPrincipal) MarshalJSON() ([]byte, error) { 1235 type NoMethod ThirdPartyPrincipal 1236 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1237 } 1238 1239 // V2HttpRequest: A common proto for logging HTTP requests. Only contains 1240 // semantics defined by the HTTP specification. Product-specific logging 1241 // information MUST be defined in a separate message. 1242 type V2HttpRequest struct { 1243 // CacheFillBytes: The number of HTTP response bytes inserted into cache. Set 1244 // only when a cache fill was attempted. 1245 CacheFillBytes int64 `json:"cacheFillBytes,omitempty,string"` 1246 // CacheHit: Whether or not an entity was served from cache (with or without 1247 // validation). 1248 CacheHit bool `json:"cacheHit,omitempty"` 1249 // CacheLookup: Whether or not a cache lookup was attempted. 1250 CacheLookup bool `json:"cacheLookup,omitempty"` 1251 // CacheValidatedWithOriginServer: Whether or not the response was validated 1252 // with the origin server before being served from cache. This field is only 1253 // meaningful if `cache_hit` is True. 1254 CacheValidatedWithOriginServer bool `json:"cacheValidatedWithOriginServer,omitempty"` 1255 // Latency: The request processing latency on the server, from the time the 1256 // request was received until the response was sent. 1257 Latency string `json:"latency,omitempty"` 1258 // Protocol: Protocol used for the request. Examples: "HTTP/1.1", "HTTP/2", 1259 // "websocket" 1260 Protocol string `json:"protocol,omitempty"` 1261 // Referer: The referer URL of the request, as defined in HTTP/1.1 Header Field 1262 // Definitions (http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html). 1263 Referer string `json:"referer,omitempty"` 1264 // RemoteIp: The IP address (IPv4 or IPv6) of the client that issued the HTTP 1265 // request. Examples: "192.168.1.1", "FE80::0202:B3FF:FE1E:8329". 1266 RemoteIp string `json:"remoteIp,omitempty"` 1267 // RequestMethod: The request method. Examples: "GET", "HEAD", "PUT", 1268 // "POST". 1269 RequestMethod string `json:"requestMethod,omitempty"` 1270 // RequestSize: The size of the HTTP request message in bytes, including the 1271 // request headers and the request body. 1272 RequestSize int64 `json:"requestSize,omitempty,string"` 1273 // RequestUrl: The scheme (http, https), the host name, the path, and the query 1274 // portion of the URL that was requested. Example: 1275 // "http://example.com/some/info?color=red". 1276 RequestUrl string `json:"requestUrl,omitempty"` 1277 // ResponseSize: The size of the HTTP response message sent back to the client, 1278 // in bytes, including the response headers and the response body. 1279 ResponseSize int64 `json:"responseSize,omitempty,string"` 1280 // ServerIp: The IP address (IPv4 or IPv6) of the origin server that the 1281 // request was sent to. 1282 ServerIp string `json:"serverIp,omitempty"` 1283 // Status: The response code indicating the status of the response. Examples: 1284 // 200, 404. 1285 Status int64 `json:"status,omitempty"` 1286 // UserAgent: The user agent sent by the client. Example: "Mozilla/4.0 1287 // (compatible; MSIE 6.0; Windows 98; Q312461; .NET CLR 1.0.3705)". 1288 UserAgent string `json:"userAgent,omitempty"` 1289 // ForceSendFields is a list of field names (e.g. "CacheFillBytes") to 1290 // unconditionally include in API requests. By default, fields with empty or 1291 // default values are omitted from API requests. See 1292 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1293 // details. 1294 ForceSendFields []string `json:"-"` 1295 // NullFields is a list of field names (e.g. "CacheFillBytes") to include in 1296 // API requests with the JSON null value. By default, fields with empty values 1297 // are omitted from API requests. See 1298 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1299 NullFields []string `json:"-"` 1300 } 1301 1302 func (s *V2HttpRequest) MarshalJSON() ([]byte, error) { 1303 type NoMethod V2HttpRequest 1304 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1305 } 1306 1307 // V2LogEntry: An individual log entry. 1308 type V2LogEntry struct { 1309 // HttpRequest: Optional. Information about the HTTP request associated with 1310 // this log entry, if applicable. 1311 HttpRequest *V2HttpRequest `json:"httpRequest,omitempty"` 1312 // InsertId: A unique ID for the log entry used for deduplication. If omitted, 1313 // the implementation will generate one based on operation_id. 1314 InsertId string `json:"insertId,omitempty"` 1315 // Labels: A set of user-defined (key, value) data that provides additional 1316 // information about the log entry. 1317 Labels map[string]string `json:"labels,omitempty"` 1318 // MonitoredResourceLabels: A set of user-defined (key, value) data that 1319 // provides additional information about the moniotored resource that the log 1320 // entry belongs to. 1321 MonitoredResourceLabels map[string]string `json:"monitoredResourceLabels,omitempty"` 1322 // Name: Required. The log to which this log entry belongs. Examples: 1323 // "syslog", "book_log". 1324 Name string `json:"name,omitempty"` 1325 // Operation: Optional. Information about an operation associated with the log 1326 // entry, if applicable. 1327 Operation *V2LogEntryOperation `json:"operation,omitempty"` 1328 // ProtoPayload: The log entry payload, represented as a protocol buffer that 1329 // is expressed as a JSON object. The only accepted type currently is AuditLog. 1330 ProtoPayload googleapi.RawMessage `json:"protoPayload,omitempty"` 1331 // Severity: The severity of the log entry. The default value is 1332 // `LogSeverity.DEFAULT`. 1333 // 1334 // Possible values: 1335 // "DEFAULT" - (0) The log entry has no assigned severity level. 1336 // "DEBUG" - (100) Debug or trace information. 1337 // "INFO" - (200) Routine information, such as ongoing status or performance. 1338 // "NOTICE" - (300) Normal but significant events, such as start up, shut 1339 // down, or a configuration change. 1340 // "WARNING" - (400) Warning events might cause problems. 1341 // "ERROR" - (500) Error events are likely to cause problems. 1342 // "CRITICAL" - (600) Critical events cause more severe problems or outages. 1343 // "ALERT" - (700) A person must take an action immediately. 1344 // "EMERGENCY" - (800) One or more systems are unusable. 1345 Severity string `json:"severity,omitempty"` 1346 // SourceLocation: Optional. Source code location information associated with 1347 // the log entry, if any. 1348 SourceLocation *V2LogEntrySourceLocation `json:"sourceLocation,omitempty"` 1349 // StructPayload: The log entry payload, represented as a structure that is 1350 // expressed as a JSON object. 1351 StructPayload googleapi.RawMessage `json:"structPayload,omitempty"` 1352 // TextPayload: The log entry payload, represented as a Unicode string (UTF-8). 1353 TextPayload string `json:"textPayload,omitempty"` 1354 // Timestamp: The time the event described by the log entry occurred. If 1355 // omitted, defaults to operation start time. 1356 Timestamp string `json:"timestamp,omitempty"` 1357 // Trace: Optional. Resource name of the trace associated with the log entry, 1358 // if any. If this field contains a relative resource name, you can assume the 1359 // name is relative to `//tracing.googleapis.com`. Example: 1360 // `projects/my-projectid/traces/06796866738c859f2f19b7cfb3214824` 1361 Trace string `json:"trace,omitempty"` 1362 // ForceSendFields is a list of field names (e.g. "HttpRequest") to 1363 // unconditionally include in API requests. By default, fields with empty or 1364 // default values are omitted from API requests. See 1365 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1366 // details. 1367 ForceSendFields []string `json:"-"` 1368 // NullFields is a list of field names (e.g. "HttpRequest") to include in API 1369 // requests with the JSON null value. By default, fields with empty values are 1370 // omitted from API requests. See 1371 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1372 NullFields []string `json:"-"` 1373 } 1374 1375 func (s *V2LogEntry) MarshalJSON() ([]byte, error) { 1376 type NoMethod V2LogEntry 1377 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1378 } 1379 1380 // V2LogEntryOperation: Additional information about a potentially long-running 1381 // operation with which a log entry is associated. 1382 type V2LogEntryOperation struct { 1383 // First: Optional. Set this to True if this is the first log entry in the 1384 // operation. 1385 First bool `json:"first,omitempty"` 1386 // Id: Optional. An arbitrary operation identifier. Log entries with the same 1387 // identifier are assumed to be part of the same operation. 1388 Id string `json:"id,omitempty"` 1389 // Last: Optional. Set this to True if this is the last log entry in the 1390 // operation. 1391 Last bool `json:"last,omitempty"` 1392 // Producer: Optional. An arbitrary producer identifier. The combination of 1393 // `id` and `producer` must be globally unique. Examples for `producer`: 1394 // "MyDivision.MyBigCompany.com", "github.com/MyProject/MyApplication". 1395 Producer string `json:"producer,omitempty"` 1396 // ForceSendFields is a list of field names (e.g. "First") to unconditionally 1397 // include in API requests. By default, fields with empty or default values are 1398 // omitted from API requests. See 1399 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1400 // details. 1401 ForceSendFields []string `json:"-"` 1402 // NullFields is a list of field names (e.g. "First") to include in API 1403 // requests with the JSON null value. By default, fields with empty values are 1404 // omitted from API requests. See 1405 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1406 NullFields []string `json:"-"` 1407 } 1408 1409 func (s *V2LogEntryOperation) MarshalJSON() ([]byte, error) { 1410 type NoMethod V2LogEntryOperation 1411 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1412 } 1413 1414 // V2LogEntrySourceLocation: Additional information about the source code 1415 // location that produced the log entry. 1416 type V2LogEntrySourceLocation struct { 1417 // File: Optional. Source file name. Depending on the runtime environment, this 1418 // might be a simple name or a fully-qualified name. 1419 File string `json:"file,omitempty"` 1420 // Function: Optional. Human-readable name of the function or method being 1421 // invoked, with optional context such as the class or package name. This 1422 // information may be used in contexts such as the logs viewer, where a file 1423 // and line number are less meaningful. The format can vary by language. For 1424 // example: `qual.if.ied.Class.method` (Java), `dir/package.func` (Go), 1425 // `function` (Python). 1426 Function string `json:"function,omitempty"` 1427 // Line: Optional. Line within the source file. 1-based; 0 indicates no line 1428 // number available. 1429 Line int64 `json:"line,omitempty,string"` 1430 // ForceSendFields is a list of field names (e.g. "File") to unconditionally 1431 // include in API requests. By default, fields with empty or default values are 1432 // omitted from API requests. See 1433 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1434 // details. 1435 ForceSendFields []string `json:"-"` 1436 // NullFields is a list of field names (e.g. "File") to include in API requests 1437 // with the JSON null value. By default, fields with empty values are omitted 1438 // from API requests. See 1439 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1440 NullFields []string `json:"-"` 1441 } 1442 1443 func (s *V2LogEntrySourceLocation) MarshalJSON() ([]byte, error) { 1444 type NoMethod V2LogEntrySourceLocation 1445 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1446 } 1447 1448 // V2ResourceEvent: Report v2 extension proto for passing the resource metadata 1449 // associated with a resource create/update/delete/undelete event from ESF to 1450 // Chemist. ResourceEvent proto should be serialized into the 1451 // ReportRequest.operations.extensions. 1452 type V2ResourceEvent struct { 1453 // Destinations: The destinations field determines which backend services 1454 // should handle the event. This should be specified as a comma-delimited 1455 // string. 1456 Destinations string `json:"destinations,omitempty"` 1457 // Parent: The parent resource for the resource. 1458 Parent *Resource `json:"parent,omitempty"` 1459 // Path: The api path the resource event was created in. This should match the 1460 // source of the `payload` field. For direct integrations with Chemist, this 1461 // should generally be the RESPONSE. go/resource-event-pipeline-type 1462 // 1463 // Possible values: 1464 // "API_PATH_UNSPECIFIED" - Default value. Do not use. 1465 // "REQUEST" - The request path. 1466 // "RESPONSE" - The response path. 1467 Path string `json:"path,omitempty"` 1468 // Payload: The payload contains metadata associated with the resource event. A 1469 // ResourceEventPayloadStatus is provided instead if the original payload 1470 // cannot be returned due to a limitation (e.g. size limit). 1471 Payload googleapi.RawMessage `json:"payload,omitempty"` 1472 // Resource: The resource associated with the event. 1473 Resource *Resource `json:"resource,omitempty"` 1474 // Type: The resource event type determines how the backend service should 1475 // process the event. 1476 // 1477 // Possible values: 1478 // "TYPE_UNSPECIFIED" - The resource event type is unclear. We do not expect 1479 // any events to fall into this category. 1480 // "CREATE" - The resource is created/inserted. 1481 // "UPDATE" - The resource is updated. 1482 // "DELETE" - The resource is deleted. 1483 // "UNDELETE" - The resource is un-deleted. 1484 Type string `json:"type,omitempty"` 1485 // ForceSendFields is a list of field names (e.g. "Destinations") to 1486 // unconditionally include in API requests. By default, fields with empty or 1487 // default values are omitted from API requests. See 1488 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1489 // details. 1490 ForceSendFields []string `json:"-"` 1491 // NullFields is a list of field names (e.g. "Destinations") to include in API 1492 // requests with the JSON null value. By default, fields with empty values are 1493 // omitted from API requests. See 1494 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1495 NullFields []string `json:"-"` 1496 } 1497 1498 func (s *V2ResourceEvent) MarshalJSON() ([]byte, error) { 1499 type NoMethod V2ResourceEvent 1500 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1501 } 1502 1503 // ViolationInfo: Provides information about the Policy violation info for this 1504 // request. 1505 type ViolationInfo struct { 1506 // CheckedValue: Optional. Value that is being checked for the policy. This 1507 // could be in encrypted form (if pii sensitive). This field will only be 1508 // emitted in LIST_POLICY types 1509 CheckedValue string `json:"checkedValue,omitempty"` 1510 // Constraint: Optional. Constraint name 1511 Constraint string `json:"constraint,omitempty"` 1512 // ErrorMessage: Optional. Error message that policy is indicating. 1513 ErrorMessage string `json:"errorMessage,omitempty"` 1514 // PolicyType: Optional. Indicates the type of the policy. 1515 // 1516 // Possible values: 1517 // "POLICY_TYPE_UNSPECIFIED" - Default value. This value should not be used. 1518 // "BOOLEAN_CONSTRAINT" - Indicates boolean policy constraint 1519 // "LIST_CONSTRAINT" - Indicates list policy constraint 1520 // "CUSTOM_CONSTRAINT" - Indicates custom policy constraint 1521 PolicyType string `json:"policyType,omitempty"` 1522 // ForceSendFields is a list of field names (e.g. "CheckedValue") to 1523 // unconditionally include in API requests. By default, fields with empty or 1524 // default values are omitted from API requests. See 1525 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1526 // details. 1527 ForceSendFields []string `json:"-"` 1528 // NullFields is a list of field names (e.g. "CheckedValue") to include in API 1529 // requests with the JSON null value. By default, fields with empty values are 1530 // omitted from API requests. See 1531 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1532 NullFields []string `json:"-"` 1533 } 1534 1535 func (s *ViolationInfo) MarshalJSON() ([]byte, error) { 1536 type NoMethod ViolationInfo 1537 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1538 } 1539 1540 type ServicesCheckCall struct { 1541 s *Service 1542 serviceName string 1543 checkrequest *CheckRequest 1544 urlParams_ gensupport.URLParams 1545 ctx_ context.Context 1546 header_ http.Header 1547 } 1548 1549 // Check: Private Preview. This feature is only available for approved 1550 // services. This method provides admission control for services that are 1551 // integrated with Service Infrastructure 1552 // (https://cloud.google.com/service-infrastructure). It checks whether an 1553 // operation should be allowed based on the service configuration and relevant 1554 // policies. It must be called before the operation is executed. For more 1555 // information, see Admission Control 1556 // (https://cloud.google.com/service-infrastructure/docs/admission-control). 1557 // NOTE: The admission control has an expected policy propagation delay of 60s. 1558 // The caller **must** not depend on the most recent policy changes. NOTE: The 1559 // admission control has a hard limit of 1 referenced resources per call. If an 1560 // operation refers to more than 1 resources, the caller must call the Check 1561 // method multiple times. This method requires the 1562 // `servicemanagement.services.check` permission on the specified service. For 1563 // more information, see Service Control API Access Control 1564 // (https://cloud.google.com/service-infrastructure/docs/service-control/access-control). 1565 // 1566 // - serviceName: The service name as specified in its service configuration. 1567 // For example, "pubsub.googleapis.com". See google.api.Service 1568 // (https://cloud.google.com/service-management/reference/rpc/google.api#google.api.Service) 1569 // for the definition of a service name. 1570 func (r *ServicesService) Check(serviceName string, checkrequest *CheckRequest) *ServicesCheckCall { 1571 c := &ServicesCheckCall{s: r.s, urlParams_: make(gensupport.URLParams)} 1572 c.serviceName = serviceName 1573 c.checkrequest = checkrequest 1574 return c 1575 } 1576 1577 // Fields allows partial responses to be retrieved. See 1578 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 1579 // details. 1580 func (c *ServicesCheckCall) Fields(s ...googleapi.Field) *ServicesCheckCall { 1581 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 1582 return c 1583 } 1584 1585 // Context sets the context to be used in this call's Do method. 1586 func (c *ServicesCheckCall) Context(ctx context.Context) *ServicesCheckCall { 1587 c.ctx_ = ctx 1588 return c 1589 } 1590 1591 // Header returns a http.Header that can be modified by the caller to add 1592 // headers to the request. 1593 func (c *ServicesCheckCall) Header() http.Header { 1594 if c.header_ == nil { 1595 c.header_ = make(http.Header) 1596 } 1597 return c.header_ 1598 } 1599 1600 func (c *ServicesCheckCall) doRequest(alt string) (*http.Response, error) { 1601 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) 1602 var body io.Reader = nil 1603 body, err := googleapi.WithoutDataWrapper.JSONReader(c.checkrequest) 1604 if err != nil { 1605 return nil, err 1606 } 1607 c.urlParams_.Set("alt", alt) 1608 c.urlParams_.Set("prettyPrint", "false") 1609 urls := googleapi.ResolveRelative(c.s.BasePath, "v2/services/{serviceName}:check") 1610 urls += "?" + c.urlParams_.Encode() 1611 req, err := http.NewRequest("POST", urls, body) 1612 if err != nil { 1613 return nil, err 1614 } 1615 req.Header = reqHeaders 1616 googleapi.Expand(req.URL, map[string]string{ 1617 "serviceName": c.serviceName, 1618 }) 1619 return gensupport.SendRequest(c.ctx_, c.s.client, req) 1620 } 1621 1622 // Do executes the "servicecontrol.services.check" call. 1623 // Any non-2xx status code is an error. Response headers are in either 1624 // *CheckResponse.ServerResponse.Header or (if a response was returned at all) 1625 // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 1626 // whether the returned error was because http.StatusNotModified was returned. 1627 func (c *ServicesCheckCall) Do(opts ...googleapi.CallOption) (*CheckResponse, error) { 1628 gensupport.SetOptions(c.urlParams_, opts...) 1629 res, err := c.doRequest("json") 1630 if res != nil && res.StatusCode == http.StatusNotModified { 1631 if res.Body != nil { 1632 res.Body.Close() 1633 } 1634 return nil, gensupport.WrapError(&googleapi.Error{ 1635 Code: res.StatusCode, 1636 Header: res.Header, 1637 }) 1638 } 1639 if err != nil { 1640 return nil, err 1641 } 1642 defer googleapi.CloseBody(res) 1643 if err := googleapi.CheckResponse(res); err != nil { 1644 return nil, gensupport.WrapError(err) 1645 } 1646 ret := &CheckResponse{ 1647 ServerResponse: googleapi.ServerResponse{ 1648 Header: res.Header, 1649 HTTPStatusCode: res.StatusCode, 1650 }, 1651 } 1652 target := &ret 1653 if err := gensupport.DecodeResponse(target, res); err != nil { 1654 return nil, err 1655 } 1656 return ret, nil 1657 } 1658 1659 type ServicesReportCall struct { 1660 s *Service 1661 serviceName string 1662 reportrequest *ReportRequest 1663 urlParams_ gensupport.URLParams 1664 ctx_ context.Context 1665 header_ http.Header 1666 } 1667 1668 // Report: Private Preview. This feature is only available for approved 1669 // services. This method provides telemetry reporting for services that are 1670 // integrated with Service Infrastructure 1671 // (https://cloud.google.com/service-infrastructure). It reports a list of 1672 // operations that have occurred on a service. It must be called after the 1673 // operations have been executed. For more information, see Telemetry Reporting 1674 // (https://cloud.google.com/service-infrastructure/docs/telemetry-reporting). 1675 // NOTE: The telemetry reporting has a hard limit of 1000 operations and 1MB 1676 // per Report call. It is recommended to have no more than 100 operations per 1677 // call. This method requires the `servicemanagement.services.report` 1678 // permission on the specified service. For more information, see Service 1679 // Control API Access Control 1680 // (https://cloud.google.com/service-infrastructure/docs/service-control/access-control). 1681 // 1682 // - serviceName: The service name as specified in its service configuration. 1683 // For example, "pubsub.googleapis.com". See google.api.Service 1684 // (https://cloud.google.com/service-management/reference/rpc/google.api#google.api.Service) 1685 // for the definition of a service name. 1686 func (r *ServicesService) Report(serviceName string, reportrequest *ReportRequest) *ServicesReportCall { 1687 c := &ServicesReportCall{s: r.s, urlParams_: make(gensupport.URLParams)} 1688 c.serviceName = serviceName 1689 c.reportrequest = reportrequest 1690 return c 1691 } 1692 1693 // Fields allows partial responses to be retrieved. See 1694 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 1695 // details. 1696 func (c *ServicesReportCall) Fields(s ...googleapi.Field) *ServicesReportCall { 1697 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 1698 return c 1699 } 1700 1701 // Context sets the context to be used in this call's Do method. 1702 func (c *ServicesReportCall) Context(ctx context.Context) *ServicesReportCall { 1703 c.ctx_ = ctx 1704 return c 1705 } 1706 1707 // Header returns a http.Header that can be modified by the caller to add 1708 // headers to the request. 1709 func (c *ServicesReportCall) Header() http.Header { 1710 if c.header_ == nil { 1711 c.header_ = make(http.Header) 1712 } 1713 return c.header_ 1714 } 1715 1716 func (c *ServicesReportCall) doRequest(alt string) (*http.Response, error) { 1717 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) 1718 var body io.Reader = nil 1719 body, err := googleapi.WithoutDataWrapper.JSONReader(c.reportrequest) 1720 if err != nil { 1721 return nil, err 1722 } 1723 c.urlParams_.Set("alt", alt) 1724 c.urlParams_.Set("prettyPrint", "false") 1725 urls := googleapi.ResolveRelative(c.s.BasePath, "v2/services/{serviceName}:report") 1726 urls += "?" + c.urlParams_.Encode() 1727 req, err := http.NewRequest("POST", urls, body) 1728 if err != nil { 1729 return nil, err 1730 } 1731 req.Header = reqHeaders 1732 googleapi.Expand(req.URL, map[string]string{ 1733 "serviceName": c.serviceName, 1734 }) 1735 return gensupport.SendRequest(c.ctx_, c.s.client, req) 1736 } 1737 1738 // Do executes the "servicecontrol.services.report" call. 1739 // Any non-2xx status code is an error. Response headers are in either 1740 // *ReportResponse.ServerResponse.Header or (if a response was returned at all) 1741 // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 1742 // whether the returned error was because http.StatusNotModified was returned. 1743 func (c *ServicesReportCall) Do(opts ...googleapi.CallOption) (*ReportResponse, error) { 1744 gensupport.SetOptions(c.urlParams_, opts...) 1745 res, err := c.doRequest("json") 1746 if res != nil && res.StatusCode == http.StatusNotModified { 1747 if res.Body != nil { 1748 res.Body.Close() 1749 } 1750 return nil, gensupport.WrapError(&googleapi.Error{ 1751 Code: res.StatusCode, 1752 Header: res.Header, 1753 }) 1754 } 1755 if err != nil { 1756 return nil, err 1757 } 1758 defer googleapi.CloseBody(res) 1759 if err := googleapi.CheckResponse(res); err != nil { 1760 return nil, gensupport.WrapError(err) 1761 } 1762 ret := &ReportResponse{ 1763 ServerResponse: googleapi.ServerResponse{ 1764 Header: res.Header, 1765 HTTPStatusCode: res.StatusCode, 1766 }, 1767 } 1768 target := &ret 1769 if err := gensupport.DecodeResponse(target, res); err != nil { 1770 return nil, err 1771 } 1772 return ret, nil 1773 } 1774