1// Copyright 2021 Google LLC. 2// Use of this source code is governed by a BSD-style 3// license that can be found in the LICENSE file. 4 5// Code generated file. DO NOT EDIT. 6 7// Package containeranalysis provides access to the Container Analysis API. 8// 9// For product documentation, see: https://cloud.google.com/container-analysis/api/reference/rest/ 10// 11// Creating a client 12// 13// Usage example: 14// 15// import "google.golang.org/api/containeranalysis/v1alpha1" 16// ... 17// ctx := context.Background() 18// containeranalysisService, err := containeranalysis.NewService(ctx) 19// 20// In this example, Google Application Default Credentials are used for authentication. 21// 22// For information on how to create and obtain Application Default Credentials, see https://developers.google.com/identity/protocols/application-default-credentials. 23// 24// Other authentication options 25// 26// To use an API key for authentication (note: some APIs do not support API keys), use option.WithAPIKey: 27// 28// containeranalysisService, err := containeranalysis.NewService(ctx, option.WithAPIKey("AIza...")) 29// 30// To use an OAuth token (e.g., a user token obtained via a three-legged OAuth flow), use option.WithTokenSource: 31// 32// config := &oauth2.Config{...} 33// // ... 34// token, err := config.Exchange(ctx, ...) 35// containeranalysisService, err := containeranalysis.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token))) 36// 37// See https://godoc.org/google.golang.org/api/option/ for details on options. 38package containeranalysis // import "google.golang.org/api/containeranalysis/v1alpha1" 39 40import ( 41 "bytes" 42 "context" 43 "encoding/json" 44 "errors" 45 "fmt" 46 "io" 47 "net/http" 48 "net/url" 49 "strconv" 50 "strings" 51 52 googleapi "google.golang.org/api/googleapi" 53 gensupport "google.golang.org/api/internal/gensupport" 54 option "google.golang.org/api/option" 55 internaloption "google.golang.org/api/option/internaloption" 56 htransport "google.golang.org/api/transport/http" 57) 58 59// Always reference these packages, just in case the auto-generated code 60// below doesn't. 61var _ = bytes.NewBuffer 62var _ = strconv.Itoa 63var _ = fmt.Sprintf 64var _ = json.NewDecoder 65var _ = io.Copy 66var _ = url.Parse 67var _ = gensupport.MarshalJSON 68var _ = googleapi.Version 69var _ = errors.New 70var _ = strings.Replace 71var _ = context.Canceled 72var _ = internaloption.WithDefaultEndpoint 73 74const apiId = "containeranalysis:v1alpha1" 75const apiName = "containeranalysis" 76const apiVersion = "v1alpha1" 77const basePath = "https://containeranalysis.googleapis.com/" 78const mtlsBasePath = "https://containeranalysis.mtls.googleapis.com/" 79 80// OAuth2 scopes used by this API. 81const ( 82 // See, edit, configure, and delete your Google Cloud Platform data 83 CloudPlatformScope = "https://www.googleapis.com/auth/cloud-platform" 84) 85 86// NewService creates a new Service. 87func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, error) { 88 scopesOption := option.WithScopes( 89 "https://www.googleapis.com/auth/cloud-platform", 90 ) 91 // NOTE: prepend, so we don't override user-specified scopes. 92 opts = append([]option.ClientOption{scopesOption}, opts...) 93 opts = append(opts, internaloption.WithDefaultEndpoint(basePath)) 94 opts = append(opts, internaloption.WithDefaultMTLSEndpoint(mtlsBasePath)) 95 client, endpoint, err := htransport.NewClient(ctx, opts...) 96 if err != nil { 97 return nil, err 98 } 99 s, err := New(client) 100 if err != nil { 101 return nil, err 102 } 103 if endpoint != "" { 104 s.BasePath = endpoint 105 } 106 return s, nil 107} 108 109// New creates a new Service. It uses the provided http.Client for requests. 110// 111// Deprecated: please use NewService instead. 112// To provide a custom HTTP client, use option.WithHTTPClient. 113// If you are using google.golang.org/api/googleapis/transport.APIKey, use option.WithAPIKey with NewService instead. 114func New(client *http.Client) (*Service, error) { 115 if client == nil { 116 return nil, errors.New("client is nil") 117 } 118 s := &Service{client: client, BasePath: basePath} 119 s.Projects = NewProjectsService(s) 120 s.Providers = NewProvidersService(s) 121 return s, nil 122} 123 124type Service struct { 125 client *http.Client 126 BasePath string // API endpoint base URL 127 UserAgent string // optional additional User-Agent fragment 128 129 Projects *ProjectsService 130 131 Providers *ProvidersService 132} 133 134func (s *Service) userAgent() string { 135 if s.UserAgent == "" { 136 return googleapi.UserAgent 137 } 138 return googleapi.UserAgent + " " + s.UserAgent 139} 140 141func NewProjectsService(s *Service) *ProjectsService { 142 rs := &ProjectsService{s: s} 143 rs.Notes = NewProjectsNotesService(s) 144 rs.Occurrences = NewProjectsOccurrencesService(s) 145 rs.Operations = NewProjectsOperationsService(s) 146 rs.ScanConfigs = NewProjectsScanConfigsService(s) 147 return rs 148} 149 150type ProjectsService struct { 151 s *Service 152 153 Notes *ProjectsNotesService 154 155 Occurrences *ProjectsOccurrencesService 156 157 Operations *ProjectsOperationsService 158 159 ScanConfigs *ProjectsScanConfigsService 160} 161 162func NewProjectsNotesService(s *Service) *ProjectsNotesService { 163 rs := &ProjectsNotesService{s: s} 164 rs.Occurrences = NewProjectsNotesOccurrencesService(s) 165 return rs 166} 167 168type ProjectsNotesService struct { 169 s *Service 170 171 Occurrences *ProjectsNotesOccurrencesService 172} 173 174func NewProjectsNotesOccurrencesService(s *Service) *ProjectsNotesOccurrencesService { 175 rs := &ProjectsNotesOccurrencesService{s: s} 176 return rs 177} 178 179type ProjectsNotesOccurrencesService struct { 180 s *Service 181} 182 183func NewProjectsOccurrencesService(s *Service) *ProjectsOccurrencesService { 184 rs := &ProjectsOccurrencesService{s: s} 185 return rs 186} 187 188type ProjectsOccurrencesService struct { 189 s *Service 190} 191 192func NewProjectsOperationsService(s *Service) *ProjectsOperationsService { 193 rs := &ProjectsOperationsService{s: s} 194 return rs 195} 196 197type ProjectsOperationsService struct { 198 s *Service 199} 200 201func NewProjectsScanConfigsService(s *Service) *ProjectsScanConfigsService { 202 rs := &ProjectsScanConfigsService{s: s} 203 return rs 204} 205 206type ProjectsScanConfigsService struct { 207 s *Service 208} 209 210func NewProvidersService(s *Service) *ProvidersService { 211 rs := &ProvidersService{s: s} 212 rs.Notes = NewProvidersNotesService(s) 213 return rs 214} 215 216type ProvidersService struct { 217 s *Service 218 219 Notes *ProvidersNotesService 220} 221 222func NewProvidersNotesService(s *Service) *ProvidersNotesService { 223 rs := &ProvidersNotesService{s: s} 224 rs.Occurrences = NewProvidersNotesOccurrencesService(s) 225 return rs 226} 227 228type ProvidersNotesService struct { 229 s *Service 230 231 Occurrences *ProvidersNotesOccurrencesService 232} 233 234func NewProvidersNotesOccurrencesService(s *Service) *ProvidersNotesOccurrencesService { 235 rs := &ProvidersNotesOccurrencesService{s: s} 236 return rs 237} 238 239type ProvidersNotesOccurrencesService struct { 240 s *Service 241} 242 243// Artifact: Artifact describes a build product. 244type Artifact struct { 245 // Checksum: Hash or checksum value of a binary, or Docker Registry 2.0 246 // digest of a container. 247 Checksum string `json:"checksum,omitempty"` 248 249 // Id: Artifact ID, if any; for container images, this will be a URL by 250 // digest like gcr.io/projectID/imagename@sha256:123456 251 Id string `json:"id,omitempty"` 252 253 // Name: Name of the artifact. This may be the path to a binary or jar 254 // file, or in the case of a container build, the name used to push the 255 // container image to Google Container Registry, as presented to `docker 256 // push`. This field is deprecated in favor of the plural `names` field; 257 // it continues to exist here to allow existing BuildProvenance 258 // serialized to json in 259 // google.devtools.containeranalysis.v1alpha1.BuildDetails.provenance_byt 260 // es to deserialize back into proto. 261 Name string `json:"name,omitempty"` 262 263 // Names: Related artifact names. This may be the path to a binary or 264 // jar file, or in the case of a container build, the name used to push 265 // the container image to Google Container Registry, as presented to 266 // `docker push`. Note that a single Artifact ID can have multiple 267 // names, for example if two tags are applied to one image. 268 Names []string `json:"names,omitempty"` 269 270 // ForceSendFields is a list of field names (e.g. "Checksum") to 271 // unconditionally include in API requests. By default, fields with 272 // empty values are omitted from API requests. However, any non-pointer, 273 // non-interface field appearing in ForceSendFields will be sent to the 274 // server regardless of whether the field is empty or not. This may be 275 // used to include empty fields in Patch requests. 276 ForceSendFields []string `json:"-"` 277 278 // NullFields is a list of field names (e.g. "Checksum") to include in 279 // API requests with the JSON null value. By default, fields with empty 280 // values are omitted from API requests. However, any field with an 281 // empty value appearing in NullFields will be sent to the server as 282 // null. It is an error if a field in this list has a non-empty value. 283 // This may be used to include null fields in Patch requests. 284 NullFields []string `json:"-"` 285} 286 287func (s *Artifact) MarshalJSON() ([]byte, error) { 288 type NoMethod Artifact 289 raw := NoMethod(*s) 290 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 291} 292 293// Attestation: Occurrence that represents a single "attestation". The 294// authenticity of an Attestation can be verified using the attached 295// signature. If the verifier trusts the public key of the signer, then 296// verifying the signature is sufficient to establish trust. In this 297// circumstance, the AttestationAuthority to which this Attestation is 298// attached is primarily useful for look-up (how to find this 299// Attestation if you already know the Authority and artifact to be 300// verified) and intent (which authority was this attestation intended 301// to sign for). 302type Attestation struct { 303 PgpSignedAttestation *PgpSignedAttestation `json:"pgpSignedAttestation,omitempty"` 304 305 // ForceSendFields is a list of field names (e.g. 306 // "PgpSignedAttestation") to unconditionally include in API requests. 307 // By default, fields with empty values are omitted from API requests. 308 // However, any non-pointer, non-interface field appearing in 309 // ForceSendFields will be sent to the server regardless of whether the 310 // field is empty or not. This may be used to include empty fields in 311 // Patch requests. 312 ForceSendFields []string `json:"-"` 313 314 // NullFields is a list of field names (e.g. "PgpSignedAttestation") to 315 // include in API requests with the JSON null value. By default, fields 316 // with empty values are omitted from API requests. However, any field 317 // with an empty value appearing in NullFields will be sent to the 318 // server as null. It is an error if a field in this list has a 319 // non-empty value. This may be used to include null fields in Patch 320 // requests. 321 NullFields []string `json:"-"` 322} 323 324func (s *Attestation) MarshalJSON() ([]byte, error) { 325 type NoMethod Attestation 326 raw := NoMethod(*s) 327 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 328} 329 330// AttestationAuthority: Note kind that represents a logical attestation 331// "role" or "authority". For example, an organization might have one 332// `AttestationAuthority` for "QA" and one for "build". This Note is 333// intended to act strictly as a grouping mechanism for the attached 334// Occurrences (Attestations). This grouping mechanism also provides a 335// security boundary, since IAM ACLs gate the ability for a principle to 336// attach an Occurrence to a given Note. It also provides a single point 337// of lookup to find all attached Attestation Occurrences, even if they 338// don't all live in the same project. 339type AttestationAuthority struct { 340 Hint *AttestationAuthorityHint `json:"hint,omitempty"` 341 342 // ForceSendFields is a list of field names (e.g. "Hint") to 343 // unconditionally include in API requests. By default, fields with 344 // empty values are omitted from API requests. However, any non-pointer, 345 // non-interface field appearing in ForceSendFields will be sent to the 346 // server regardless of whether the field is empty or not. This may be 347 // used to include empty fields in Patch requests. 348 ForceSendFields []string `json:"-"` 349 350 // NullFields is a list of field names (e.g. "Hint") to include in API 351 // requests with the JSON null value. By default, fields with empty 352 // values are omitted from API requests. However, any field with an 353 // empty value appearing in NullFields will be sent to the server as 354 // null. It is an error if a field in this list has a non-empty value. 355 // This may be used to include null fields in Patch requests. 356 NullFields []string `json:"-"` 357} 358 359func (s *AttestationAuthority) MarshalJSON() ([]byte, error) { 360 type NoMethod AttestationAuthority 361 raw := NoMethod(*s) 362 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 363} 364 365// AttestationAuthorityHint: This submessage provides human-readable 366// hints about the purpose of the AttestationAuthority. Because the name 367// of a Note acts as its resource reference, it is important to 368// disambiguate the canonical name of the Note (which might be a UUID 369// for security purposes) from "readable" names more suitable for debug 370// output. Note that these hints should NOT be used to look up 371// AttestationAuthorities in security sensitive contexts, such as when 372// looking up Attestations to verify. 373type AttestationAuthorityHint struct { 374 // HumanReadableName: The human readable name of this Attestation 375 // Authority, for example "qa". 376 HumanReadableName string `json:"humanReadableName,omitempty"` 377 378 // ForceSendFields is a list of field names (e.g. "HumanReadableName") 379 // to unconditionally include in API requests. By default, fields with 380 // empty values are omitted from API requests. However, any non-pointer, 381 // non-interface field appearing in ForceSendFields will be sent to the 382 // server regardless of whether the field is empty or not. This may be 383 // used to include empty fields in Patch requests. 384 ForceSendFields []string `json:"-"` 385 386 // NullFields is a list of field names (e.g. "HumanReadableName") to 387 // include in API requests with the JSON null value. By default, fields 388 // with empty values are omitted from API requests. However, any field 389 // with an empty value appearing in NullFields will be sent to the 390 // server as null. It is an error if a field in this list has a 391 // non-empty value. This may be used to include null fields in Patch 392 // requests. 393 NullFields []string `json:"-"` 394} 395 396func (s *AttestationAuthorityHint) MarshalJSON() ([]byte, error) { 397 type NoMethod AttestationAuthorityHint 398 raw := NoMethod(*s) 399 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 400} 401 402// Basis: Basis describes the base image portion (Note) of the 403// DockerImage relationship. Linked occurrences are derived from this or 404// an equivalent image via: FROM Or an equivalent reference, e.g. a tag 405// of the resource_url. 406type Basis struct { 407 // Fingerprint: The fingerprint of the base image. 408 Fingerprint *Fingerprint `json:"fingerprint,omitempty"` 409 410 // ResourceUrl: The resource_url for the resource representing the basis 411 // of associated occurrence images. 412 ResourceUrl string `json:"resourceUrl,omitempty"` 413 414 // ForceSendFields is a list of field names (e.g. "Fingerprint") to 415 // unconditionally include in API requests. By default, fields with 416 // empty values are omitted from API requests. However, any non-pointer, 417 // non-interface field appearing in ForceSendFields will be sent to the 418 // server regardless of whether the field is empty or not. This may be 419 // used to include empty fields in Patch requests. 420 ForceSendFields []string `json:"-"` 421 422 // NullFields is a list of field names (e.g. "Fingerprint") to include 423 // in API requests with the JSON null value. By default, fields with 424 // empty values are omitted from API requests. However, any field with 425 // an empty value appearing in NullFields will be sent to the server as 426 // null. It is an error if a field in this list has a non-empty value. 427 // This may be used to include null fields in Patch requests. 428 NullFields []string `json:"-"` 429} 430 431func (s *Basis) MarshalJSON() ([]byte, error) { 432 type NoMethod Basis 433 raw := NoMethod(*s) 434 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 435} 436 437// Binding: Associates `members` with a `role`. 438type Binding struct { 439 // Condition: The condition that is associated with this binding. If the 440 // condition evaluates to `true`, then this binding applies to the 441 // current request. If the condition evaluates to `false`, then this 442 // binding does not apply to the current request. However, a different 443 // role binding might grant the same role to one or more of the members 444 // in this binding. To learn which resources support conditions in their 445 // IAM policies, see the IAM documentation 446 // (https://cloud.google.com/iam/help/conditions/resource-policies). 447 Condition *Expr `json:"condition,omitempty"` 448 449 // Members: Specifies the identities requesting access for a Cloud 450 // Platform resource. `members` can have the following values: * 451 // `allUsers`: A special identifier that represents anyone who is on the 452 // internet; with or without a Google account. * 453 // `allAuthenticatedUsers`: A special identifier that represents anyone 454 // who is authenticated with a Google account or a service account. * 455 // `user:{emailid}`: An email address that represents a specific Google 456 // account. For example, `alice@example.com` . * 457 // `serviceAccount:{emailid}`: An email address that represents a 458 // service account. For example, 459 // `my-other-app@appspot.gserviceaccount.com`. * `group:{emailid}`: An 460 // email address that represents a Google group. For example, 461 // `admins@example.com`. * `deleted:user:{emailid}?uid={uniqueid}`: An 462 // email address (plus unique identifier) representing a user that has 463 // been recently deleted. For example, 464 // `alice@example.com?uid=123456789012345678901`. If the user is 465 // recovered, this value reverts to `user:{emailid}` and the recovered 466 // user retains the role in the binding. * 467 // `deleted:serviceAccount:{emailid}?uid={uniqueid}`: An email address 468 // (plus unique identifier) representing a service account that has been 469 // recently deleted. For example, 470 // `my-other-app@appspot.gserviceaccount.com?uid=123456789012345678901`. 471 // If the service account is undeleted, this value reverts to 472 // `serviceAccount:{emailid}` and the undeleted service account retains 473 // the role in the binding. * `deleted:group:{emailid}?uid={uniqueid}`: 474 // An email address (plus unique identifier) representing a Google group 475 // that has been recently deleted. For example, 476 // `admins@example.com?uid=123456789012345678901`. If the group is 477 // recovered, this value reverts to `group:{emailid}` and the recovered 478 // group retains the role in the binding. * `domain:{domain}`: The G 479 // Suite domain (primary) that represents all the users of that domain. 480 // For example, `google.com` or `example.com`. 481 Members []string `json:"members,omitempty"` 482 483 // Role: Role that is assigned to `members`. For example, 484 // `roles/viewer`, `roles/editor`, or `roles/owner`. 485 Role string `json:"role,omitempty"` 486 487 // ForceSendFields is a list of field names (e.g. "Condition") to 488 // unconditionally include in API requests. By default, fields with 489 // empty values are omitted from API requests. However, any non-pointer, 490 // non-interface field appearing in ForceSendFields will be sent to the 491 // server regardless of whether the field is empty or not. This may be 492 // used to include empty fields in Patch requests. 493 ForceSendFields []string `json:"-"` 494 495 // NullFields is a list of field names (e.g. "Condition") to include in 496 // API requests with the JSON null value. By default, fields with empty 497 // values are omitted from API requests. However, any field with an 498 // empty value appearing in NullFields will be sent to the server as 499 // null. It is an error if a field in this list has a non-empty value. 500 // This may be used to include null fields in Patch requests. 501 NullFields []string `json:"-"` 502} 503 504func (s *Binding) MarshalJSON() ([]byte, error) { 505 type NoMethod Binding 506 raw := NoMethod(*s) 507 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 508} 509 510// BuildDetails: Message encapsulating build provenance details. 511type BuildDetails struct { 512 // Provenance: The actual provenance 513 Provenance *BuildProvenance `json:"provenance,omitempty"` 514 515 // ProvenanceBytes: Serialized JSON representation of the provenance, 516 // used in generating the `BuildSignature` in the corresponding Result. 517 // After verifying the signature, `provenance_bytes` can be unmarshalled 518 // and compared to the provenance to confirm that it is unchanged. A 519 // base64-encoded string representation of the provenance bytes is used 520 // for the signature in order to interoperate with openssl which expects 521 // this format for signature verification. The serialized form is 522 // captured both to avoid ambiguity in how the provenance is marshalled 523 // to json as well to prevent incompatibilities with future changes. 524 ProvenanceBytes string `json:"provenanceBytes,omitempty"` 525 526 // ForceSendFields is a list of field names (e.g. "Provenance") to 527 // unconditionally include in API requests. By default, fields with 528 // empty values are omitted from API requests. However, any non-pointer, 529 // non-interface field appearing in ForceSendFields will be sent to the 530 // server regardless of whether the field is empty or not. This may be 531 // used to include empty fields in Patch requests. 532 ForceSendFields []string `json:"-"` 533 534 // NullFields is a list of field names (e.g. "Provenance") to include in 535 // API requests with the JSON null value. By default, fields with empty 536 // values are omitted from API requests. However, any field with an 537 // empty value appearing in NullFields will be sent to the server as 538 // null. It is an error if a field in this list has a non-empty value. 539 // This may be used to include null fields in Patch requests. 540 NullFields []string `json:"-"` 541} 542 543func (s *BuildDetails) MarshalJSON() ([]byte, error) { 544 type NoMethod BuildDetails 545 raw := NoMethod(*s) 546 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 547} 548 549// BuildProvenance: Provenance of a build. Contains all information 550// needed to verify the full details about the build from source to 551// completion. 552type BuildProvenance struct { 553 // BuildOptions: Special options applied to this build. This is a 554 // catch-all field where build providers can enter any desired 555 // additional details. 556 BuildOptions map[string]string `json:"buildOptions,omitempty"` 557 558 // BuilderVersion: Version string of the builder at the time this build 559 // was executed. 560 BuilderVersion string `json:"builderVersion,omitempty"` 561 562 // BuiltArtifacts: Output of the build. 563 BuiltArtifacts []*Artifact `json:"builtArtifacts,omitempty"` 564 565 // Commands: Commands requested by the build. 566 Commands []*Command `json:"commands,omitempty"` 567 568 // CreateTime: Time at which the build was created. 569 CreateTime string `json:"createTime,omitempty"` 570 571 // Creator: E-mail address of the user who initiated this build. Note 572 // that this was the user's e-mail address at the time the build was 573 // initiated; this address may not represent the same end-user for all 574 // time. 575 Creator string `json:"creator,omitempty"` 576 577 // FinishTime: Time at which execution of the build was finished. 578 FinishTime string `json:"finishTime,omitempty"` 579 580 // Id: Unique identifier of the build. 581 Id string `json:"id,omitempty"` 582 583 // LogsBucket: Google Cloud Storage bucket where logs were written. 584 LogsBucket string `json:"logsBucket,omitempty"` 585 586 // ProjectId: ID of the project. 587 ProjectId string `json:"projectId,omitempty"` 588 589 // SourceProvenance: Details of the Source input to the build. 590 SourceProvenance *Source `json:"sourceProvenance,omitempty"` 591 592 // StartTime: Time at which execution of the build was started. 593 StartTime string `json:"startTime,omitempty"` 594 595 // TriggerId: Trigger identifier if the build was triggered 596 // automatically; empty if not. 597 TriggerId string `json:"triggerId,omitempty"` 598 599 // ForceSendFields is a list of field names (e.g. "BuildOptions") to 600 // unconditionally include in API requests. By default, fields with 601 // empty values are omitted from API requests. However, any non-pointer, 602 // non-interface field appearing in ForceSendFields will be sent to the 603 // server regardless of whether the field is empty or not. This may be 604 // used to include empty fields in Patch requests. 605 ForceSendFields []string `json:"-"` 606 607 // NullFields is a list of field names (e.g. "BuildOptions") to include 608 // in API requests with the JSON null value. By default, fields with 609 // empty values are omitted from API requests. However, any field with 610 // an empty value appearing in NullFields will be sent to the server as 611 // null. It is an error if a field in this list has a non-empty value. 612 // This may be used to include null fields in Patch requests. 613 NullFields []string `json:"-"` 614} 615 616func (s *BuildProvenance) MarshalJSON() ([]byte, error) { 617 type NoMethod BuildProvenance 618 raw := NoMethod(*s) 619 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 620} 621 622// BuildSignature: Message encapsulating the signature of the verified 623// build. 624type BuildSignature struct { 625 // KeyId: An Id for the key used to sign. This could be either an Id for 626 // the key stored in `public_key` (such as the Id or fingerprint for a 627 // PGP key, or the CN for a cert), or a reference to an external key 628 // (such as a reference to a key in Cloud Key Management Service). 629 KeyId string `json:"keyId,omitempty"` 630 631 // KeyType: The type of the key, either stored in `public_key` or 632 // referenced in `key_id` 633 // 634 // Possible values: 635 // "KEY_TYPE_UNSPECIFIED" - `KeyType` is not set. 636 // "PGP_ASCII_ARMORED" - `PGP ASCII Armored` public key. 637 // "PKIX_PEM" - `PKIX PEM` public key. 638 KeyType string `json:"keyType,omitempty"` 639 640 // PublicKey: Public key of the builder which can be used to verify that 641 // the related findings are valid and unchanged. If `key_type` is empty, 642 // this defaults to PEM encoded public keys. This field may be empty if 643 // `key_id` references an external key. For Cloud Build based 644 // signatures, this is a PEM encoded public key. To verify the Cloud 645 // Build signature, place the contents of this field into a file 646 // (public.pem). The signature field is base64-decoded into its binary 647 // representation in signature.bin, and the provenance bytes from 648 // `BuildDetails` are base64-decoded into a binary representation in 649 // signed.bin. OpenSSL can then verify the signature: `openssl sha256 650 // -verify public.pem -signature signature.bin signed.bin` 651 PublicKey string `json:"publicKey,omitempty"` 652 653 // Signature: Signature of the related `BuildProvenance`, encoded in a 654 // base64 string. 655 Signature string `json:"signature,omitempty"` 656 657 // ForceSendFields is a list of field names (e.g. "KeyId") to 658 // unconditionally include in API requests. By default, fields with 659 // empty values are omitted from API requests. However, any non-pointer, 660 // non-interface field appearing in ForceSendFields will be sent to the 661 // server regardless of whether the field is empty or not. This may be 662 // used to include empty fields in Patch requests. 663 ForceSendFields []string `json:"-"` 664 665 // NullFields is a list of field names (e.g. "KeyId") to include in API 666 // requests with the JSON null value. By default, fields with empty 667 // values are omitted from API requests. However, any field with an 668 // empty value appearing in NullFields will be sent to the server as 669 // null. It is an error if a field in this list has a non-empty value. 670 // This may be used to include null fields in Patch requests. 671 NullFields []string `json:"-"` 672} 673 674func (s *BuildSignature) MarshalJSON() ([]byte, error) { 675 type NoMethod BuildSignature 676 raw := NoMethod(*s) 677 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 678} 679 680// BuildType: Note holding the version of the provider's builder and the 681// signature of the provenance message in linked BuildDetails. 682type BuildType struct { 683 // BuilderVersion: Version of the builder which produced this Note. 684 BuilderVersion string `json:"builderVersion,omitempty"` 685 686 // Signature: Signature of the build in Occurrences pointing to the Note 687 // containing this `BuilderDetails`. 688 Signature *BuildSignature `json:"signature,omitempty"` 689 690 // ForceSendFields is a list of field names (e.g. "BuilderVersion") to 691 // unconditionally include in API requests. By default, fields with 692 // empty values are omitted from API requests. However, any non-pointer, 693 // non-interface field appearing in ForceSendFields will be sent to the 694 // server regardless of whether the field is empty or not. This may be 695 // used to include empty fields in Patch requests. 696 ForceSendFields []string `json:"-"` 697 698 // NullFields is a list of field names (e.g. "BuilderVersion") to 699 // include in API requests with the JSON null value. By default, fields 700 // with empty values are omitted from API requests. However, any field 701 // with an empty value appearing in NullFields will be sent to the 702 // server as null. It is an error if a field in this list has a 703 // non-empty value. This may be used to include null fields in Patch 704 // requests. 705 NullFields []string `json:"-"` 706} 707 708func (s *BuildType) MarshalJSON() ([]byte, error) { 709 type NoMethod BuildType 710 raw := NoMethod(*s) 711 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 712} 713 714// Command: Command describes a step performed as part of the build 715// pipeline. 716type Command struct { 717 // Args: Command-line arguments used when executing this Command. 718 Args []string `json:"args,omitempty"` 719 720 // Dir: Working directory (relative to project source root) used when 721 // running this Command. 722 Dir string `json:"dir,omitempty"` 723 724 // Env: Environment variables set before running this Command. 725 Env []string `json:"env,omitempty"` 726 727 // Id: Optional unique identifier for this Command, used in wait_for to 728 // reference this Command as a dependency. 729 Id string `json:"id,omitempty"` 730 731 // Name: Name of the command, as presented on the command line, or if 732 // the command is packaged as a Docker container, as presented to 733 // `docker pull`. 734 Name string `json:"name,omitempty"` 735 736 // WaitFor: The ID(s) of the Command(s) that this Command depends on. 737 WaitFor []string `json:"waitFor,omitempty"` 738 739 // ForceSendFields is a list of field names (e.g. "Args") to 740 // unconditionally include in API requests. By default, fields with 741 // empty values are omitted from API requests. However, any non-pointer, 742 // non-interface field appearing in ForceSendFields will be sent to the 743 // server regardless of whether the field is empty or not. This may be 744 // used to include empty fields in Patch requests. 745 ForceSendFields []string `json:"-"` 746 747 // NullFields is a list of field names (e.g. "Args") to include in API 748 // requests with the JSON null value. By default, fields with empty 749 // values are omitted from API requests. However, any field with an 750 // empty value appearing in NullFields will be sent to the server as 751 // null. It is an error if a field in this list has a non-empty value. 752 // This may be used to include null fields in Patch requests. 753 NullFields []string `json:"-"` 754} 755 756func (s *Command) MarshalJSON() ([]byte, error) { 757 type NoMethod Command 758 raw := NoMethod(*s) 759 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 760} 761 762// CreateOperationRequest: Request for creating an operation 763type CreateOperationRequest struct { 764 // Operation: The operation to create. 765 Operation *Operation `json:"operation,omitempty"` 766 767 // OperationId: The ID to use for this operation. 768 OperationId string `json:"operationId,omitempty"` 769 770 // ForceSendFields is a list of field names (e.g. "Operation") to 771 // unconditionally include in API requests. By default, fields with 772 // empty values are omitted from API requests. However, any non-pointer, 773 // non-interface field appearing in ForceSendFields will be sent to the 774 // server regardless of whether the field is empty or not. This may be 775 // used to include empty fields in Patch requests. 776 ForceSendFields []string `json:"-"` 777 778 // NullFields is a list of field names (e.g. "Operation") to include in 779 // API requests with the JSON null value. By default, fields with empty 780 // values are omitted from API requests. However, any field with an 781 // empty value appearing in NullFields will be sent to the server as 782 // null. It is an error if a field in this list has a non-empty value. 783 // This may be used to include null fields in Patch requests. 784 NullFields []string `json:"-"` 785} 786 787func (s *CreateOperationRequest) MarshalJSON() ([]byte, error) { 788 type NoMethod CreateOperationRequest 789 raw := NoMethod(*s) 790 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 791} 792 793// Deployable: An artifact that can be deployed in some runtime. 794type Deployable struct { 795 // ResourceUri: Resource URI for the artifact being deployed. 796 ResourceUri []string `json:"resourceUri,omitempty"` 797 798 // ForceSendFields is a list of field names (e.g. "ResourceUri") to 799 // unconditionally include in API requests. By default, fields with 800 // empty values are omitted from API requests. However, any non-pointer, 801 // non-interface field appearing in ForceSendFields will be sent to the 802 // server regardless of whether the field is empty or not. This may be 803 // used to include empty fields in Patch requests. 804 ForceSendFields []string `json:"-"` 805 806 // NullFields is a list of field names (e.g. "ResourceUri") to include 807 // in API requests with the JSON null value. By default, fields with 808 // empty values are omitted from API requests. However, any field with 809 // an empty value appearing in NullFields will be sent to the server as 810 // null. It is an error if a field in this list has a non-empty value. 811 // This may be used to include null fields in Patch requests. 812 NullFields []string `json:"-"` 813} 814 815func (s *Deployable) MarshalJSON() ([]byte, error) { 816 type NoMethod Deployable 817 raw := NoMethod(*s) 818 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 819} 820 821// Deployment: The period during which some deployable was active in a 822// runtime. 823type Deployment struct { 824 // Address: Address of the runtime element hosting this deployment. 825 Address string `json:"address,omitempty"` 826 827 // Config: Configuration used to create this deployment. 828 Config string `json:"config,omitempty"` 829 830 // DeployTime: Beginning of the lifetime of this deployment. 831 DeployTime string `json:"deployTime,omitempty"` 832 833 // Platform: Platform hosting this deployment. 834 // 835 // Possible values: 836 // "PLATFORM_UNSPECIFIED" - Unknown 837 // "GKE" - Google Container Engine 838 // "FLEX" - Google App Engine: Flexible Environment 839 // "CUSTOM" - Custom user-defined platform 840 Platform string `json:"platform,omitempty"` 841 842 // ResourceUri: Output only. Resource URI for the artifact being 843 // deployed taken from the deployable field with the same name. 844 ResourceUri []string `json:"resourceUri,omitempty"` 845 846 // UndeployTime: End of the lifetime of this deployment. 847 UndeployTime string `json:"undeployTime,omitempty"` 848 849 // UserEmail: Identity of the user that triggered this deployment. 850 UserEmail string `json:"userEmail,omitempty"` 851 852 // ForceSendFields is a list of field names (e.g. "Address") to 853 // unconditionally include in API requests. By default, fields with 854 // empty values are omitted from API requests. However, any non-pointer, 855 // non-interface field appearing in ForceSendFields will be sent to the 856 // server regardless of whether the field is empty or not. This may be 857 // used to include empty fields in Patch requests. 858 ForceSendFields []string `json:"-"` 859 860 // NullFields is a list of field names (e.g. "Address") to include in 861 // API requests with the JSON null value. By default, fields with empty 862 // values are omitted from API requests. However, any field with an 863 // empty value appearing in NullFields will be sent to the server as 864 // null. It is an error if a field in this list has a non-empty value. 865 // This may be used to include null fields in Patch requests. 866 NullFields []string `json:"-"` 867} 868 869func (s *Deployment) MarshalJSON() ([]byte, error) { 870 type NoMethod Deployment 871 raw := NoMethod(*s) 872 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 873} 874 875// Derived: Derived describes the derived image portion (Occurrence) of 876// the DockerImage relationship. This image would be produced from a 877// Dockerfile with FROM . 878type Derived struct { 879 // BaseResourceUrl: Output only. This contains the base image URL for 880 // the derived image occurrence. 881 BaseResourceUrl string `json:"baseResourceUrl,omitempty"` 882 883 // Distance: Output only. The number of layers by which this image 884 // differs from the associated image basis. 885 Distance int64 `json:"distance,omitempty"` 886 887 // Fingerprint: The fingerprint of the derived image. 888 Fingerprint *Fingerprint `json:"fingerprint,omitempty"` 889 890 // LayerInfo: This contains layer-specific metadata, if populated it has 891 // length "distance" and is ordered with [distance] being the layer 892 // immediately following the base image and [1] being the final layer. 893 LayerInfo []*Layer `json:"layerInfo,omitempty"` 894 895 // ForceSendFields is a list of field names (e.g. "BaseResourceUrl") to 896 // unconditionally include in API requests. By default, fields with 897 // empty values are omitted from API requests. However, any non-pointer, 898 // non-interface field appearing in ForceSendFields will be sent to the 899 // server regardless of whether the field is empty or not. This may be 900 // used to include empty fields in Patch requests. 901 ForceSendFields []string `json:"-"` 902 903 // NullFields is a list of field names (e.g. "BaseResourceUrl") to 904 // include in API requests with the JSON null value. By default, fields 905 // with empty values are omitted from API requests. However, any field 906 // with an empty value appearing in NullFields will be sent to the 907 // server as null. It is an error if a field in this list has a 908 // non-empty value. This may be used to include null fields in Patch 909 // requests. 910 NullFields []string `json:"-"` 911} 912 913func (s *Derived) MarshalJSON() ([]byte, error) { 914 type NoMethod Derived 915 raw := NoMethod(*s) 916 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 917} 918 919// Detail: Identifies all occurrences of this vulnerability in the 920// package for a specific distro/location For example: glibc in 921// cpe:/o:debian:debian_linux:8 for versions 2.1 - 2.2 922type Detail struct { 923 // CpeUri: The cpe_uri in [cpe format] 924 // (https://cpe.mitre.org/specification/) in which the vulnerability 925 // manifests. Examples include distro or storage location for vulnerable 926 // jar. This field can be used as a filter in list requests. 927 CpeUri string `json:"cpeUri,omitempty"` 928 929 // Description: A vendor-specific description of this note. 930 Description string `json:"description,omitempty"` 931 932 // FixedLocation: The fix for this specific package version. 933 FixedLocation *VulnerabilityLocation `json:"fixedLocation,omitempty"` 934 935 // IsObsolete: Whether this Detail is obsolete. Occurrences are expected 936 // not to point to obsolete details. 937 IsObsolete bool `json:"isObsolete,omitempty"` 938 939 // MaxAffectedVersion: The max version of the package in which the 940 // vulnerability exists. 941 MaxAffectedVersion *Version `json:"maxAffectedVersion,omitempty"` 942 943 // MinAffectedVersion: The min version of the package in which the 944 // vulnerability exists. 945 MinAffectedVersion *Version `json:"minAffectedVersion,omitempty"` 946 947 // Package: The name of the package where the vulnerability was found. 948 // This field can be used as a filter in list requests. 949 Package string `json:"package,omitempty"` 950 951 // PackageType: The type of package; whether native or non native(ruby 952 // gems, node.js packages etc) 953 PackageType string `json:"packageType,omitempty"` 954 955 // SeverityName: The severity (eg: distro assigned severity) for this 956 // vulnerability. 957 SeverityName string `json:"severityName,omitempty"` 958 959 // Source: The source from which the information in this Detail was 960 // obtained. 961 Source string `json:"source,omitempty"` 962 963 // Vendor: The vendor of the product. e.g. "google" 964 Vendor string `json:"vendor,omitempty"` 965 966 // ForceSendFields is a list of field names (e.g. "CpeUri") to 967 // unconditionally include in API requests. By default, fields with 968 // empty values are omitted from API requests. However, any non-pointer, 969 // non-interface field appearing in ForceSendFields will be sent to the 970 // server regardless of whether the field is empty or not. This may be 971 // used to include empty fields in Patch requests. 972 ForceSendFields []string `json:"-"` 973 974 // NullFields is a list of field names (e.g. "CpeUri") to include in API 975 // requests with the JSON null value. By default, fields with empty 976 // values are omitted from API requests. However, any field with an 977 // empty value appearing in NullFields will be sent to the server as 978 // null. It is an error if a field in this list has a non-empty value. 979 // This may be used to include null fields in Patch requests. 980 NullFields []string `json:"-"` 981} 982 983func (s *Detail) MarshalJSON() ([]byte, error) { 984 type NoMethod Detail 985 raw := NoMethod(*s) 986 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 987} 988 989// Discovered: Provides information about the scan status of a 990// discovered resource. 991type Discovered struct { 992 // AnalysisStatus: The status of discovery for the resource. 993 // 994 // Possible values: 995 // "ANALYSIS_STATUS_UNSPECIFIED" - Unknown 996 // "PENDING" - Resource is known but no action has been taken yet. 997 // "SCANNING" - Resource is being analyzed. 998 // "FINISHED_SUCCESS" - Analysis has finished successfully. 999 // "FINISHED_FAILED" - Analysis has finished unsuccessfully, the 1000 // analysis itself is in a bad state. 1001 // "FINISHED_UNSUPPORTED" - The resource is known not to be supported. 1002 AnalysisStatus string `json:"analysisStatus,omitempty"` 1003 1004 // AnalysisStatusError: When an error is encountered this will contain a 1005 // LocalizedMessage under details to show to the user. The 1006 // LocalizedMessage output only and populated by the API. 1007 AnalysisStatusError *Status `json:"analysisStatusError,omitempty"` 1008 1009 // ContinuousAnalysis: Whether the resource is continuously analyzed. 1010 // 1011 // Possible values: 1012 // "CONTINUOUS_ANALYSIS_UNSPECIFIED" - Unknown 1013 // "ACTIVE" - The resource is continuously analyzed. 1014 // "INACTIVE" - The resource is ignored for continuous analysis. 1015 ContinuousAnalysis string `json:"continuousAnalysis,omitempty"` 1016 1017 // Cpe: The CPE of the resource being scanned. 1018 Cpe string `json:"cpe,omitempty"` 1019 1020 // Operation: Output only. An operation that indicates the status of the 1021 // current scan. This field is deprecated, do not use. 1022 Operation *Operation `json:"operation,omitempty"` 1023 1024 // ForceSendFields is a list of field names (e.g. "AnalysisStatus") to 1025 // unconditionally include in API requests. By default, fields with 1026 // empty values are omitted from API requests. However, any non-pointer, 1027 // non-interface field appearing in ForceSendFields will be sent to the 1028 // server regardless of whether the field is empty or not. This may be 1029 // used to include empty fields in Patch requests. 1030 ForceSendFields []string `json:"-"` 1031 1032 // NullFields is a list of field names (e.g. "AnalysisStatus") to 1033 // include in API requests with the JSON null value. By default, fields 1034 // with empty values are omitted from API requests. However, any field 1035 // with an empty value appearing in NullFields will be sent to the 1036 // server as null. It is an error if a field in this list has a 1037 // non-empty value. This may be used to include null fields in Patch 1038 // requests. 1039 NullFields []string `json:"-"` 1040} 1041 1042func (s *Discovered) MarshalJSON() ([]byte, error) { 1043 type NoMethod Discovered 1044 raw := NoMethod(*s) 1045 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1046} 1047 1048// Discovery: A note that indicates a type of analysis a provider would 1049// perform. This note exists in a provider's project. A `Discovery` 1050// occurrence is created in a consumer's project at the start of 1051// analysis. The occurrence's operation will indicate the status of the 1052// analysis. Absence of an occurrence linked to this note for a resource 1053// indicates that analysis hasn't started. 1054type Discovery struct { 1055 // AnalysisKind: The kind of analysis that is handled by this discovery. 1056 // 1057 // Possible values: 1058 // "KIND_UNSPECIFIED" - Unknown 1059 // "PACKAGE_VULNERABILITY" - The note and occurrence represent a 1060 // package vulnerability. 1061 // "BUILD_DETAILS" - The note and occurrence assert build provenance. 1062 // "IMAGE_BASIS" - This represents an image basis relationship. 1063 // "PACKAGE_MANAGER" - This represents a package installed via a 1064 // package manager. 1065 // "DEPLOYABLE" - The note and occurrence track deployment events. 1066 // "DISCOVERY" - The note and occurrence track the initial discovery 1067 // status of a resource. 1068 // "ATTESTATION_AUTHORITY" - This represents a logical "role" that can 1069 // attest to artifacts. 1070 // "UPGRADE" - This represents an available software upgrade. 1071 AnalysisKind string `json:"analysisKind,omitempty"` 1072 1073 // ForceSendFields is a list of field names (e.g. "AnalysisKind") to 1074 // unconditionally include in API requests. By default, fields with 1075 // empty values are omitted from API requests. However, any non-pointer, 1076 // non-interface field appearing in ForceSendFields will be sent to the 1077 // server regardless of whether the field is empty or not. This may be 1078 // used to include empty fields in Patch requests. 1079 ForceSendFields []string `json:"-"` 1080 1081 // NullFields is a list of field names (e.g. "AnalysisKind") to include 1082 // in API requests with the JSON null value. By default, fields with 1083 // empty values are omitted from API requests. However, any field with 1084 // an empty value appearing in NullFields will be sent to the server as 1085 // null. It is an error if a field in this list has a non-empty value. 1086 // This may be used to include null fields in Patch requests. 1087 NullFields []string `json:"-"` 1088} 1089 1090func (s *Discovery) MarshalJSON() ([]byte, error) { 1091 type NoMethod Discovery 1092 raw := NoMethod(*s) 1093 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1094} 1095 1096// Distribution: This represents a particular channel of distribution 1097// for a given package. e.g. Debian's jessie-backports dpkg mirror 1098type Distribution struct { 1099 // Architecture: The CPU architecture for which packages in this 1100 // distribution channel were built 1101 // 1102 // Possible values: 1103 // "ARCHITECTURE_UNSPECIFIED" - Unknown architecture 1104 // "X86" - X86 architecture 1105 // "X64" - X64 architecture 1106 Architecture string `json:"architecture,omitempty"` 1107 1108 // CpeUri: The cpe_uri in cpe format 1109 // (https://cpe.mitre.org/specification/) denoting the package manager 1110 // version distributing a package. 1111 CpeUri string `json:"cpeUri,omitempty"` 1112 1113 // Description: The distribution channel-specific description of this 1114 // package. 1115 Description string `json:"description,omitempty"` 1116 1117 // LatestVersion: The latest available version of this package in this 1118 // distribution channel. 1119 LatestVersion *Version `json:"latestVersion,omitempty"` 1120 1121 // Maintainer: A freeform string denoting the maintainer of this 1122 // package. 1123 Maintainer string `json:"maintainer,omitempty"` 1124 1125 // Url: The distribution channel-specific homepage for this package. 1126 Url string `json:"url,omitempty"` 1127 1128 // ForceSendFields is a list of field names (e.g. "Architecture") to 1129 // unconditionally include in API requests. By default, fields with 1130 // empty values are omitted from API requests. However, any non-pointer, 1131 // non-interface field appearing in ForceSendFields will be sent to the 1132 // server regardless of whether the field is empty or not. This may be 1133 // used to include empty fields in Patch requests. 1134 ForceSendFields []string `json:"-"` 1135 1136 // NullFields is a list of field names (e.g. "Architecture") to include 1137 // in API requests with the JSON null value. By default, fields with 1138 // empty values are omitted from API requests. However, any field with 1139 // an empty value appearing in NullFields will be sent to the server as 1140 // null. It is an error if a field in this list has a non-empty value. 1141 // This may be used to include null fields in Patch requests. 1142 NullFields []string `json:"-"` 1143} 1144 1145func (s *Distribution) MarshalJSON() ([]byte, error) { 1146 type NoMethod Distribution 1147 raw := NoMethod(*s) 1148 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1149} 1150 1151// Empty: A generic empty message that you can re-use to avoid defining 1152// duplicated empty messages in your APIs. A typical example is to use 1153// it as the request or the response type of an API method. For 1154// instance: service Foo { rpc Bar(google.protobuf.Empty) returns 1155// (google.protobuf.Empty); } The JSON representation for `Empty` is 1156// empty JSON object `{}`. 1157type Empty struct { 1158 // ServerResponse contains the HTTP response code and headers from the 1159 // server. 1160 googleapi.ServerResponse `json:"-"` 1161} 1162 1163// Expr: Represents a textual expression in the Common Expression 1164// Language (CEL) syntax. CEL is a C-like expression language. The 1165// syntax and semantics of CEL are documented at 1166// https://github.com/google/cel-spec. Example (Comparison): title: 1167// "Summary size limit" description: "Determines if a summary is less 1168// than 100 chars" expression: "document.summary.size() < 100" Example 1169// (Equality): title: "Requestor is owner" description: "Determines if 1170// requestor is the document owner" expression: "document.owner == 1171// request.auth.claims.email" Example (Logic): title: "Public documents" 1172// description: "Determine whether the document should be publicly 1173// visible" expression: "document.type != 'private' && document.type != 1174// 'internal'" Example (Data Manipulation): title: "Notification string" 1175// description: "Create a notification string with a timestamp." 1176// expression: "'New message received at ' + 1177// string(document.create_time)" The exact variables and functions that 1178// may be referenced within an expression are determined by the service 1179// that evaluates it. See the service documentation for additional 1180// information. 1181type Expr struct { 1182 // Description: Optional. Description of the expression. This is a 1183 // longer text which describes the expression, e.g. when hovered over it 1184 // in a UI. 1185 Description string `json:"description,omitempty"` 1186 1187 // Expression: Textual representation of an expression in Common 1188 // Expression Language syntax. 1189 Expression string `json:"expression,omitempty"` 1190 1191 // Location: Optional. String indicating the location of the expression 1192 // for error reporting, e.g. a file name and a position in the file. 1193 Location string `json:"location,omitempty"` 1194 1195 // Title: Optional. Title for the expression, i.e. a short string 1196 // describing its purpose. This can be used e.g. in UIs which allow to 1197 // enter the expression. 1198 Title string `json:"title,omitempty"` 1199 1200 // ForceSendFields is a list of field names (e.g. "Description") to 1201 // unconditionally include in API requests. By default, fields with 1202 // empty values are omitted from API requests. However, any non-pointer, 1203 // non-interface field appearing in ForceSendFields will be sent to the 1204 // server regardless of whether the field is empty or not. This may be 1205 // used to include empty fields in Patch requests. 1206 ForceSendFields []string `json:"-"` 1207 1208 // NullFields is a list of field names (e.g. "Description") to include 1209 // in API requests with the JSON null value. By default, fields with 1210 // empty values are omitted from API requests. However, any field with 1211 // an empty value appearing in NullFields will be sent to the server as 1212 // null. It is an error if a field in this list has a non-empty value. 1213 // This may be used to include null fields in Patch requests. 1214 NullFields []string `json:"-"` 1215} 1216 1217func (s *Expr) MarshalJSON() ([]byte, error) { 1218 type NoMethod Expr 1219 raw := NoMethod(*s) 1220 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1221} 1222 1223// FileHashes: Container message for hashes of byte content of files, 1224// used in Source messages to verify integrity of source input to the 1225// build. 1226type FileHashes struct { 1227 // FileHash: Collection of file hashes. 1228 FileHash []*Hash `json:"fileHash,omitempty"` 1229 1230 // ForceSendFields is a list of field names (e.g. "FileHash") to 1231 // unconditionally include in API requests. By default, fields with 1232 // empty values are omitted from API requests. However, any non-pointer, 1233 // non-interface field appearing in ForceSendFields will be sent to the 1234 // server regardless of whether the field is empty or not. This may be 1235 // used to include empty fields in Patch requests. 1236 ForceSendFields []string `json:"-"` 1237 1238 // NullFields is a list of field names (e.g. "FileHash") to include in 1239 // API requests with the JSON null value. By default, fields with empty 1240 // values are omitted from API requests. However, any field with an 1241 // empty value appearing in NullFields will be sent to the server as 1242 // null. It is an error if a field in this list has a non-empty value. 1243 // This may be used to include null fields in Patch requests. 1244 NullFields []string `json:"-"` 1245} 1246 1247func (s *FileHashes) MarshalJSON() ([]byte, error) { 1248 type NoMethod FileHashes 1249 raw := NoMethod(*s) 1250 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1251} 1252 1253// Fingerprint: A set of properties that uniquely identify a given 1254// Docker image. 1255type Fingerprint struct { 1256 // V1Name: The layer-id of the final layer in the Docker image's v1 1257 // representation. This field can be used as a filter in list requests. 1258 V1Name string `json:"v1Name,omitempty"` 1259 1260 // V2Blob: The ordered list of v2 blobs that represent a given image. 1261 V2Blob []string `json:"v2Blob,omitempty"` 1262 1263 // V2Name: Output only. The name of the image's v2 blobs computed via: 1264 // [bottom] := v2_blobbottom := sha256(v2_blob[N] + " " + v2_name[N+1]) 1265 // Only the name of the final blob is kept. This field can be used as a 1266 // filter in list requests. 1267 V2Name string `json:"v2Name,omitempty"` 1268 1269 // ForceSendFields is a list of field names (e.g. "V1Name") to 1270 // unconditionally include in API requests. By default, fields with 1271 // empty values are omitted from API requests. However, any non-pointer, 1272 // non-interface field appearing in ForceSendFields will be sent to the 1273 // server regardless of whether the field is empty or not. This may be 1274 // used to include empty fields in Patch requests. 1275 ForceSendFields []string `json:"-"` 1276 1277 // NullFields is a list of field names (e.g. "V1Name") to include in API 1278 // requests with the JSON null value. By default, fields with empty 1279 // values are omitted from API requests. However, any field with an 1280 // empty value appearing in NullFields will be sent to the server as 1281 // null. It is an error if a field in this list has a non-empty value. 1282 // This may be used to include null fields in Patch requests. 1283 NullFields []string `json:"-"` 1284} 1285 1286func (s *Fingerprint) MarshalJSON() ([]byte, error) { 1287 type NoMethod Fingerprint 1288 raw := NoMethod(*s) 1289 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1290} 1291 1292// GetIamPolicyRequest: Request message for `GetIamPolicy` method. 1293type GetIamPolicyRequest struct { 1294 // Options: OPTIONAL: A `GetPolicyOptions` object for specifying options 1295 // to `GetIamPolicy`. 1296 Options *GetPolicyOptions `json:"options,omitempty"` 1297 1298 // ForceSendFields is a list of field names (e.g. "Options") to 1299 // unconditionally include in API requests. By default, fields with 1300 // empty values are omitted from API requests. However, any non-pointer, 1301 // non-interface field appearing in ForceSendFields will be sent to the 1302 // server regardless of whether the field is empty or not. This may be 1303 // used to include empty fields in Patch requests. 1304 ForceSendFields []string `json:"-"` 1305 1306 // NullFields is a list of field names (e.g. "Options") to include in 1307 // API requests with the JSON null value. By default, fields with empty 1308 // values are omitted from API requests. However, any field with an 1309 // empty value appearing in NullFields will be sent to the server as 1310 // null. It is an error if a field in this list has a non-empty value. 1311 // This may be used to include null fields in Patch requests. 1312 NullFields []string `json:"-"` 1313} 1314 1315func (s *GetIamPolicyRequest) MarshalJSON() ([]byte, error) { 1316 type NoMethod GetIamPolicyRequest 1317 raw := NoMethod(*s) 1318 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1319} 1320 1321// GetPolicyOptions: Encapsulates settings provided to GetIamPolicy. 1322type GetPolicyOptions struct { 1323 // RequestedPolicyVersion: Optional. The policy format version to be 1324 // returned. Valid values are 0, 1, and 3. Requests specifying an 1325 // invalid value will be rejected. Requests for policies with any 1326 // conditional bindings must specify version 3. Policies without any 1327 // conditional bindings may specify any valid value or leave the field 1328 // unset. To learn which resources support conditions in their IAM 1329 // policies, see the IAM documentation 1330 // (https://cloud.google.com/iam/help/conditions/resource-policies). 1331 RequestedPolicyVersion int64 `json:"requestedPolicyVersion,omitempty"` 1332 1333 // ForceSendFields is a list of field names (e.g. 1334 // "RequestedPolicyVersion") to unconditionally include in API requests. 1335 // By default, fields with empty values are omitted from API requests. 1336 // However, any non-pointer, non-interface field appearing in 1337 // ForceSendFields will be sent to the server regardless of whether the 1338 // field is empty or not. This may be used to include empty fields in 1339 // Patch requests. 1340 ForceSendFields []string `json:"-"` 1341 1342 // NullFields is a list of field names (e.g. "RequestedPolicyVersion") 1343 // to include in API requests with the JSON null value. By default, 1344 // fields with empty values are omitted from API requests. However, any 1345 // field with an empty value appearing in NullFields will be sent to the 1346 // server as null. It is an error if a field in this list has a 1347 // non-empty value. This may be used to include null fields in Patch 1348 // requests. 1349 NullFields []string `json:"-"` 1350} 1351 1352func (s *GetPolicyOptions) MarshalJSON() ([]byte, error) { 1353 type NoMethod GetPolicyOptions 1354 raw := NoMethod(*s) 1355 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1356} 1357 1358// GetVulnzOccurrencesSummaryResponse: A summary of how many vulnz 1359// occurrences there are per severity type. counts by groups, or if we 1360// should have different summary messages like this. 1361type GetVulnzOccurrencesSummaryResponse struct { 1362 // Counts: A map of how many occurrences were found for each severity. 1363 Counts []*SeverityCount `json:"counts,omitempty"` 1364 1365 // ServerResponse contains the HTTP response code and headers from the 1366 // server. 1367 googleapi.ServerResponse `json:"-"` 1368 1369 // ForceSendFields is a list of field names (e.g. "Counts") to 1370 // unconditionally include in API requests. By default, fields with 1371 // empty values are omitted from API requests. However, any non-pointer, 1372 // non-interface field appearing in ForceSendFields will be sent to the 1373 // server regardless of whether the field is empty or not. This may be 1374 // used to include empty fields in Patch requests. 1375 ForceSendFields []string `json:"-"` 1376 1377 // NullFields is a list of field names (e.g. "Counts") to include in API 1378 // requests with the JSON null value. By default, fields with empty 1379 // values are omitted from API requests. However, any field with an 1380 // empty value appearing in NullFields will be sent to the server as 1381 // null. It is an error if a field in this list has a non-empty value. 1382 // This may be used to include null fields in Patch requests. 1383 NullFields []string `json:"-"` 1384} 1385 1386func (s *GetVulnzOccurrencesSummaryResponse) MarshalJSON() ([]byte, error) { 1387 type NoMethod GetVulnzOccurrencesSummaryResponse 1388 raw := NoMethod(*s) 1389 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1390} 1391 1392// GoogleDevtoolsContaineranalysisV1alpha1AliasContext: An alias to a 1393// repo revision. 1394type GoogleDevtoolsContaineranalysisV1alpha1AliasContext struct { 1395 // Kind: The alias kind. 1396 // 1397 // Possible values: 1398 // "KIND_UNSPECIFIED" - Unknown. 1399 // "FIXED" - Git tag. 1400 // "MOVABLE" - Git branch. 1401 // "OTHER" - Used to specify non-standard aliases. For example, if a 1402 // Git repo has a ref named "refs/foo/bar". 1403 Kind string `json:"kind,omitempty"` 1404 1405 // Name: The alias name. 1406 Name string `json:"name,omitempty"` 1407 1408 // ForceSendFields is a list of field names (e.g. "Kind") to 1409 // unconditionally include in API requests. By default, fields with 1410 // empty values are omitted from API requests. However, any non-pointer, 1411 // non-interface field appearing in ForceSendFields will be sent to the 1412 // server regardless of whether the field is empty or not. This may be 1413 // used to include empty fields in Patch requests. 1414 ForceSendFields []string `json:"-"` 1415 1416 // NullFields is a list of field names (e.g. "Kind") to include in API 1417 // requests with the JSON null value. By default, fields with empty 1418 // values are omitted from API requests. However, any field with an 1419 // empty value appearing in NullFields will be sent to the server as 1420 // null. It is an error if a field in this list has a non-empty value. 1421 // This may be used to include null fields in Patch requests. 1422 NullFields []string `json:"-"` 1423} 1424 1425func (s *GoogleDevtoolsContaineranalysisV1alpha1AliasContext) MarshalJSON() ([]byte, error) { 1426 type NoMethod GoogleDevtoolsContaineranalysisV1alpha1AliasContext 1427 raw := NoMethod(*s) 1428 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1429} 1430 1431// GoogleDevtoolsContaineranalysisV1alpha1CloudRepoSourceContext: A 1432// CloudRepoSourceContext denotes a particular revision in a Google 1433// Cloud Source Repo. 1434type GoogleDevtoolsContaineranalysisV1alpha1CloudRepoSourceContext struct { 1435 // AliasContext: An alias, which may be a branch or tag. 1436 AliasContext *GoogleDevtoolsContaineranalysisV1alpha1AliasContext `json:"aliasContext,omitempty"` 1437 1438 // RepoId: The ID of the repo. 1439 RepoId *GoogleDevtoolsContaineranalysisV1alpha1RepoId `json:"repoId,omitempty"` 1440 1441 // RevisionId: A revision ID. 1442 RevisionId string `json:"revisionId,omitempty"` 1443 1444 // ForceSendFields is a list of field names (e.g. "AliasContext") to 1445 // unconditionally include in API requests. By default, fields with 1446 // empty values are omitted from API requests. However, any non-pointer, 1447 // non-interface field appearing in ForceSendFields will be sent to the 1448 // server regardless of whether the field is empty or not. This may be 1449 // used to include empty fields in Patch requests. 1450 ForceSendFields []string `json:"-"` 1451 1452 // NullFields is a list of field names (e.g. "AliasContext") to include 1453 // in API requests with the JSON null value. By default, fields with 1454 // empty values are omitted from API requests. However, any field with 1455 // an empty value appearing in NullFields will be sent to the server as 1456 // null. It is an error if a field in this list has a non-empty value. 1457 // This may be used to include null fields in Patch requests. 1458 NullFields []string `json:"-"` 1459} 1460 1461func (s *GoogleDevtoolsContaineranalysisV1alpha1CloudRepoSourceContext) MarshalJSON() ([]byte, error) { 1462 type NoMethod GoogleDevtoolsContaineranalysisV1alpha1CloudRepoSourceContext 1463 raw := NoMethod(*s) 1464 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1465} 1466 1467// GoogleDevtoolsContaineranalysisV1alpha1GerritSourceContext: A 1468// SourceContext referring to a Gerrit project. 1469type GoogleDevtoolsContaineranalysisV1alpha1GerritSourceContext struct { 1470 // AliasContext: An alias, which may be a branch or tag. 1471 AliasContext *GoogleDevtoolsContaineranalysisV1alpha1AliasContext `json:"aliasContext,omitempty"` 1472 1473 // GerritProject: The full project name within the host. Projects may be 1474 // nested, so "project/subproject" is a valid project name. The "repo 1475 // name" is the hostURI/project. 1476 GerritProject string `json:"gerritProject,omitempty"` 1477 1478 // HostUri: The URI of a running Gerrit instance. 1479 HostUri string `json:"hostUri,omitempty"` 1480 1481 // RevisionId: A revision (commit) ID. 1482 RevisionId string `json:"revisionId,omitempty"` 1483 1484 // ForceSendFields is a list of field names (e.g. "AliasContext") to 1485 // unconditionally include in API requests. By default, fields with 1486 // empty values are omitted from API requests. However, any non-pointer, 1487 // non-interface field appearing in ForceSendFields will be sent to the 1488 // server regardless of whether the field is empty or not. This may be 1489 // used to include empty fields in Patch requests. 1490 ForceSendFields []string `json:"-"` 1491 1492 // NullFields is a list of field names (e.g. "AliasContext") to include 1493 // in API requests with the JSON null value. By default, fields with 1494 // empty values are omitted from API requests. However, any field with 1495 // an empty value appearing in NullFields will be sent to the server as 1496 // null. It is an error if a field in this list has a non-empty value. 1497 // This may be used to include null fields in Patch requests. 1498 NullFields []string `json:"-"` 1499} 1500 1501func (s *GoogleDevtoolsContaineranalysisV1alpha1GerritSourceContext) MarshalJSON() ([]byte, error) { 1502 type NoMethod GoogleDevtoolsContaineranalysisV1alpha1GerritSourceContext 1503 raw := NoMethod(*s) 1504 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1505} 1506 1507// GoogleDevtoolsContaineranalysisV1alpha1GitSourceContext: A 1508// GitSourceContext denotes a particular revision in a third party Git 1509// repository (e.g., GitHub). 1510type GoogleDevtoolsContaineranalysisV1alpha1GitSourceContext struct { 1511 // RevisionId: Required. Git commit hash. 1512 RevisionId string `json:"revisionId,omitempty"` 1513 1514 // Url: Git repository URL. 1515 Url string `json:"url,omitempty"` 1516 1517 // ForceSendFields is a list of field names (e.g. "RevisionId") to 1518 // unconditionally include in API requests. By default, fields with 1519 // empty values are omitted from API requests. However, any non-pointer, 1520 // non-interface field appearing in ForceSendFields will be sent to the 1521 // server regardless of whether the field is empty or not. This may be 1522 // used to include empty fields in Patch requests. 1523 ForceSendFields []string `json:"-"` 1524 1525 // NullFields is a list of field names (e.g. "RevisionId") to include in 1526 // API requests with the JSON null value. By default, fields with empty 1527 // values are omitted from API requests. However, any field with an 1528 // empty value appearing in NullFields will be sent to the server as 1529 // null. It is an error if a field in this list has a non-empty value. 1530 // This may be used to include null fields in Patch requests. 1531 NullFields []string `json:"-"` 1532} 1533 1534func (s *GoogleDevtoolsContaineranalysisV1alpha1GitSourceContext) MarshalJSON() ([]byte, error) { 1535 type NoMethod GoogleDevtoolsContaineranalysisV1alpha1GitSourceContext 1536 raw := NoMethod(*s) 1537 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1538} 1539 1540// GoogleDevtoolsContaineranalysisV1alpha1OperationMetadata: Metadata 1541// for all operations used and required for all operations that created 1542// by Container Analysis Providers 1543type GoogleDevtoolsContaineranalysisV1alpha1OperationMetadata struct { 1544 // CreateTime: Output only. The time this operation was created. 1545 CreateTime string `json:"createTime,omitempty"` 1546 1547 // EndTime: Output only. The time that this operation was marked 1548 // completed or failed. 1549 EndTime string `json:"endTime,omitempty"` 1550 1551 // ForceSendFields is a list of field names (e.g. "CreateTime") to 1552 // unconditionally include in API requests. By default, fields with 1553 // empty values are omitted from API requests. However, any non-pointer, 1554 // non-interface field appearing in ForceSendFields will be sent to the 1555 // server regardless of whether the field is empty or not. This may be 1556 // used to include empty fields in Patch requests. 1557 ForceSendFields []string `json:"-"` 1558 1559 // NullFields is a list of field names (e.g. "CreateTime") to include in 1560 // API requests with the JSON null value. By default, fields with empty 1561 // values are omitted from API requests. However, any field with an 1562 // empty value appearing in NullFields will be sent to the server as 1563 // null. It is an error if a field in this list has a non-empty value. 1564 // This may be used to include null fields in Patch requests. 1565 NullFields []string `json:"-"` 1566} 1567 1568func (s *GoogleDevtoolsContaineranalysisV1alpha1OperationMetadata) MarshalJSON() ([]byte, error) { 1569 type NoMethod GoogleDevtoolsContaineranalysisV1alpha1OperationMetadata 1570 raw := NoMethod(*s) 1571 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1572} 1573 1574// GoogleDevtoolsContaineranalysisV1alpha1ProjectRepoId: Selects a repo 1575// using a Google Cloud Platform project ID (e.g., winged-cargo-31) and 1576// a repo name within that project. 1577type GoogleDevtoolsContaineranalysisV1alpha1ProjectRepoId struct { 1578 // ProjectId: The ID of the project. 1579 ProjectId string `json:"projectId,omitempty"` 1580 1581 // RepoName: The name of the repo. Leave empty for the default repo. 1582 RepoName string `json:"repoName,omitempty"` 1583 1584 // ForceSendFields is a list of field names (e.g. "ProjectId") to 1585 // unconditionally include in API requests. By default, fields with 1586 // empty values are omitted from API requests. However, any non-pointer, 1587 // non-interface field appearing in ForceSendFields will be sent to the 1588 // server regardless of whether the field is empty or not. This may be 1589 // used to include empty fields in Patch requests. 1590 ForceSendFields []string `json:"-"` 1591 1592 // NullFields is a list of field names (e.g. "ProjectId") to include in 1593 // API requests with the JSON null value. By default, fields with empty 1594 // values are omitted from API requests. However, any field with an 1595 // empty value appearing in NullFields will be sent to the server as 1596 // null. It is an error if a field in this list has a non-empty value. 1597 // This may be used to include null fields in Patch requests. 1598 NullFields []string `json:"-"` 1599} 1600 1601func (s *GoogleDevtoolsContaineranalysisV1alpha1ProjectRepoId) MarshalJSON() ([]byte, error) { 1602 type NoMethod GoogleDevtoolsContaineranalysisV1alpha1ProjectRepoId 1603 raw := NoMethod(*s) 1604 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1605} 1606 1607// GoogleDevtoolsContaineranalysisV1alpha1RepoId: A unique identifier 1608// for a Cloud Repo. 1609type GoogleDevtoolsContaineranalysisV1alpha1RepoId struct { 1610 // ProjectRepoId: A combination of a project ID and a repo name. 1611 ProjectRepoId *GoogleDevtoolsContaineranalysisV1alpha1ProjectRepoId `json:"projectRepoId,omitempty"` 1612 1613 // Uid: A server-assigned, globally unique identifier. 1614 Uid string `json:"uid,omitempty"` 1615 1616 // ForceSendFields is a list of field names (e.g. "ProjectRepoId") to 1617 // unconditionally include in API requests. By default, fields with 1618 // empty values are omitted from API requests. However, any non-pointer, 1619 // non-interface field appearing in ForceSendFields will be sent to the 1620 // server regardless of whether the field is empty or not. This may be 1621 // used to include empty fields in Patch requests. 1622 ForceSendFields []string `json:"-"` 1623 1624 // NullFields is a list of field names (e.g. "ProjectRepoId") to include 1625 // in API requests with the JSON null value. By default, fields with 1626 // empty values are omitted from API requests. However, any field with 1627 // an empty value appearing in NullFields will be sent to the server as 1628 // null. It is an error if a field in this list has a non-empty value. 1629 // This may be used to include null fields in Patch requests. 1630 NullFields []string `json:"-"` 1631} 1632 1633func (s *GoogleDevtoolsContaineranalysisV1alpha1RepoId) MarshalJSON() ([]byte, error) { 1634 type NoMethod GoogleDevtoolsContaineranalysisV1alpha1RepoId 1635 raw := NoMethod(*s) 1636 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1637} 1638 1639// GoogleDevtoolsContaineranalysisV1alpha1SourceContext: A SourceContext 1640// is a reference to a tree of files. A SourceContext together with a 1641// path point to a unique revision of a single file or directory. 1642type GoogleDevtoolsContaineranalysisV1alpha1SourceContext struct { 1643 // CloudRepo: A SourceContext referring to a revision in a Google Cloud 1644 // Source Repo. 1645 CloudRepo *GoogleDevtoolsContaineranalysisV1alpha1CloudRepoSourceContext `json:"cloudRepo,omitempty"` 1646 1647 // Gerrit: A SourceContext referring to a Gerrit project. 1648 Gerrit *GoogleDevtoolsContaineranalysisV1alpha1GerritSourceContext `json:"gerrit,omitempty"` 1649 1650 // Git: A SourceContext referring to any third party Git repo (e.g., 1651 // GitHub). 1652 Git *GoogleDevtoolsContaineranalysisV1alpha1GitSourceContext `json:"git,omitempty"` 1653 1654 // Labels: Labels with user defined metadata. 1655 Labels map[string]string `json:"labels,omitempty"` 1656 1657 // ForceSendFields is a list of field names (e.g. "CloudRepo") to 1658 // unconditionally include in API requests. By default, fields with 1659 // empty values are omitted from API requests. However, any non-pointer, 1660 // non-interface field appearing in ForceSendFields will be sent to the 1661 // server regardless of whether the field is empty or not. This may be 1662 // used to include empty fields in Patch requests. 1663 ForceSendFields []string `json:"-"` 1664 1665 // NullFields is a list of field names (e.g. "CloudRepo") to include in 1666 // API requests with the JSON null value. By default, fields with empty 1667 // values are omitted from API requests. However, any field with an 1668 // empty value appearing in NullFields will be sent to the server as 1669 // null. It is an error if a field in this list has a non-empty value. 1670 // This may be used to include null fields in Patch requests. 1671 NullFields []string `json:"-"` 1672} 1673 1674func (s *GoogleDevtoolsContaineranalysisV1alpha1SourceContext) MarshalJSON() ([]byte, error) { 1675 type NoMethod GoogleDevtoolsContaineranalysisV1alpha1SourceContext 1676 raw := NoMethod(*s) 1677 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1678} 1679 1680// Hash: Container message for hash values. 1681type Hash struct { 1682 // Type: The type of hash that was performed. 1683 // 1684 // Possible values: 1685 // "NONE" - No hash requested. 1686 // "SHA256" - A sha256 hash. 1687 Type string `json:"type,omitempty"` 1688 1689 // Value: The hash value. 1690 Value string `json:"value,omitempty"` 1691 1692 // ForceSendFields is a list of field names (e.g. "Type") to 1693 // unconditionally include in API requests. By default, fields with 1694 // empty values are omitted from API requests. However, any non-pointer, 1695 // non-interface field appearing in ForceSendFields will be sent to the 1696 // server regardless of whether the field is empty or not. This may be 1697 // used to include empty fields in Patch requests. 1698 ForceSendFields []string `json:"-"` 1699 1700 // NullFields is a list of field names (e.g. "Type") to include in API 1701 // requests with the JSON null value. By default, fields with empty 1702 // values are omitted from API requests. However, any field with an 1703 // empty value appearing in NullFields will be sent to the server as 1704 // null. It is an error if a field in this list has a non-empty value. 1705 // This may be used to include null fields in Patch requests. 1706 NullFields []string `json:"-"` 1707} 1708 1709func (s *Hash) MarshalJSON() ([]byte, error) { 1710 type NoMethod Hash 1711 raw := NoMethod(*s) 1712 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1713} 1714 1715// Installation: This represents how a particular software package may 1716// be installed on a system. 1717type Installation struct { 1718 // Location: All of the places within the filesystem versions of this 1719 // package have been found. 1720 Location []*Location `json:"location,omitempty"` 1721 1722 // Name: Output only. The name of the installed package. 1723 Name string `json:"name,omitempty"` 1724 1725 // ForceSendFields is a list of field names (e.g. "Location") to 1726 // unconditionally include in API requests. By default, fields with 1727 // empty values are omitted from API requests. However, any non-pointer, 1728 // non-interface field appearing in ForceSendFields will be sent to the 1729 // server regardless of whether the field is empty or not. This may be 1730 // used to include empty fields in Patch requests. 1731 ForceSendFields []string `json:"-"` 1732 1733 // NullFields is a list of field names (e.g. "Location") to include in 1734 // API requests with the JSON null value. By default, fields with empty 1735 // values are omitted from API requests. However, any field with an 1736 // empty value appearing in NullFields will be sent to the server as 1737 // null. It is an error if a field in this list has a non-empty value. 1738 // This may be used to include null fields in Patch requests. 1739 NullFields []string `json:"-"` 1740} 1741 1742func (s *Installation) MarshalJSON() ([]byte, error) { 1743 type NoMethod Installation 1744 raw := NoMethod(*s) 1745 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1746} 1747 1748// Layer: Layer holds metadata specific to a layer of a Docker image. 1749type Layer struct { 1750 // Arguments: The recovered arguments to the Dockerfile directive. 1751 Arguments string `json:"arguments,omitempty"` 1752 1753 // Directive: The recovered Dockerfile directive used to construct this 1754 // layer. 1755 // 1756 // Possible values: 1757 // "DIRECTIVE_UNSPECIFIED" - Default value for unsupported/missing 1758 // directive 1759 // "MAINTAINER" - https://docs.docker.com/engine/reference/builder/ 1760 // "RUN" - https://docs.docker.com/engine/reference/builder/ 1761 // "CMD" - https://docs.docker.com/engine/reference/builder/ 1762 // "LABEL" - https://docs.docker.com/engine/reference/builder/ 1763 // "EXPOSE" - https://docs.docker.com/engine/reference/builder/ 1764 // "ENV" - https://docs.docker.com/engine/reference/builder/ 1765 // "ADD" - https://docs.docker.com/engine/reference/builder/ 1766 // "COPY" - https://docs.docker.com/reference/builder/#copy 1767 // "ENTRYPOINT" - https://docs.docker.com/engine/reference/builder/ 1768 // "VOLUME" - https://docs.docker.com/engine/reference/builder/ 1769 // "USER" - https://docs.docker.com/engine/reference/builder/ 1770 // "WORKDIR" - https://docs.docker.com/engine/reference/builder/ 1771 // "ARG" - https://docs.docker.com/engine/reference/builder/ 1772 // "ONBUILD" - https://docs.docker.com/engine/reference/builder/ 1773 // "STOPSIGNAL" - https://docs.docker.com/engine/reference/builder/ 1774 // "HEALTHCHECK" - https://docs.docker.com/engine/reference/builder/ 1775 // "SHELL" - https://docs.docker.com/engine/reference/builder/ 1776 Directive string `json:"directive,omitempty"` 1777 1778 // ForceSendFields is a list of field names (e.g. "Arguments") to 1779 // unconditionally include in API requests. By default, fields with 1780 // empty values are omitted from API requests. However, any non-pointer, 1781 // non-interface field appearing in ForceSendFields will be sent to the 1782 // server regardless of whether the field is empty or not. This may be 1783 // used to include empty fields in Patch requests. 1784 ForceSendFields []string `json:"-"` 1785 1786 // NullFields is a list of field names (e.g. "Arguments") to include in 1787 // API requests with the JSON null value. By default, fields with empty 1788 // values are omitted from API requests. However, any field with an 1789 // empty value appearing in NullFields will be sent to the server as 1790 // null. It is an error if a field in this list has a non-empty value. 1791 // This may be used to include null fields in Patch requests. 1792 NullFields []string `json:"-"` 1793} 1794 1795func (s *Layer) MarshalJSON() ([]byte, error) { 1796 type NoMethod Layer 1797 raw := NoMethod(*s) 1798 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1799} 1800 1801// ListNoteOccurrencesResponse: Response including listed occurrences 1802// for a note. 1803type ListNoteOccurrencesResponse struct { 1804 // NextPageToken: Token to receive the next page of notes. 1805 NextPageToken string `json:"nextPageToken,omitempty"` 1806 1807 // Occurrences: The occurrences attached to the specified note. 1808 Occurrences []*Occurrence `json:"occurrences,omitempty"` 1809 1810 // ServerResponse contains the HTTP response code and headers from the 1811 // server. 1812 googleapi.ServerResponse `json:"-"` 1813 1814 // ForceSendFields is a list of field names (e.g. "NextPageToken") to 1815 // unconditionally include in API requests. By default, fields with 1816 // empty values are omitted from API requests. However, any non-pointer, 1817 // non-interface field appearing in ForceSendFields will be sent to the 1818 // server regardless of whether the field is empty or not. This may be 1819 // used to include empty fields in Patch requests. 1820 ForceSendFields []string `json:"-"` 1821 1822 // NullFields is a list of field names (e.g. "NextPageToken") to include 1823 // in API requests with the JSON null value. By default, fields with 1824 // empty values are omitted from API requests. However, any field with 1825 // an empty value appearing in NullFields will be sent to the server as 1826 // null. It is an error if a field in this list has a non-empty value. 1827 // This may be used to include null fields in Patch requests. 1828 NullFields []string `json:"-"` 1829} 1830 1831func (s *ListNoteOccurrencesResponse) MarshalJSON() ([]byte, error) { 1832 type NoMethod ListNoteOccurrencesResponse 1833 raw := NoMethod(*s) 1834 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1835} 1836 1837// ListNotesResponse: Response including listed notes. 1838type ListNotesResponse struct { 1839 // NextPageToken: The next pagination token in the list response. It 1840 // should be used as page_token for the following request. An empty 1841 // value means no more result. 1842 NextPageToken string `json:"nextPageToken,omitempty"` 1843 1844 // Notes: The occurrences requested 1845 Notes []*Note `json:"notes,omitempty"` 1846 1847 // ServerResponse contains the HTTP response code and headers from the 1848 // server. 1849 googleapi.ServerResponse `json:"-"` 1850 1851 // ForceSendFields is a list of field names (e.g. "NextPageToken") to 1852 // unconditionally include in API requests. By default, fields with 1853 // empty values are omitted from API requests. However, any non-pointer, 1854 // non-interface field appearing in ForceSendFields will be sent to the 1855 // server regardless of whether the field is empty or not. This may be 1856 // used to include empty fields in Patch requests. 1857 ForceSendFields []string `json:"-"` 1858 1859 // NullFields is a list of field names (e.g. "NextPageToken") to include 1860 // in API requests with the JSON null value. By default, fields with 1861 // empty values are omitted from API requests. However, any field with 1862 // an empty value appearing in NullFields will be sent to the server as 1863 // null. It is an error if a field in this list has a non-empty value. 1864 // This may be used to include null fields in Patch requests. 1865 NullFields []string `json:"-"` 1866} 1867 1868func (s *ListNotesResponse) MarshalJSON() ([]byte, error) { 1869 type NoMethod ListNotesResponse 1870 raw := NoMethod(*s) 1871 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1872} 1873 1874// ListOccurrencesResponse: Response including listed active 1875// occurrences. 1876type ListOccurrencesResponse struct { 1877 // NextPageToken: The next pagination token in the list response. It 1878 // should be used as `page_token` for the following request. An empty 1879 // value means no more results. 1880 NextPageToken string `json:"nextPageToken,omitempty"` 1881 1882 // Occurrences: The occurrences requested. 1883 Occurrences []*Occurrence `json:"occurrences,omitempty"` 1884 1885 // ServerResponse contains the HTTP response code and headers from the 1886 // server. 1887 googleapi.ServerResponse `json:"-"` 1888 1889 // ForceSendFields is a list of field names (e.g. "NextPageToken") to 1890 // unconditionally include in API requests. By default, fields with 1891 // empty values are omitted from API requests. However, any non-pointer, 1892 // non-interface field appearing in ForceSendFields will be sent to the 1893 // server regardless of whether the field is empty or not. This may be 1894 // used to include empty fields in Patch requests. 1895 ForceSendFields []string `json:"-"` 1896 1897 // NullFields is a list of field names (e.g. "NextPageToken") to include 1898 // in API requests with the JSON null value. By default, fields with 1899 // empty values are omitted from API requests. However, any field with 1900 // an empty value appearing in NullFields will be sent to the server as 1901 // null. It is an error if a field in this list has a non-empty value. 1902 // This may be used to include null fields in Patch requests. 1903 NullFields []string `json:"-"` 1904} 1905 1906func (s *ListOccurrencesResponse) MarshalJSON() ([]byte, error) { 1907 type NoMethod ListOccurrencesResponse 1908 raw := NoMethod(*s) 1909 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1910} 1911 1912// ListScanConfigsResponse: A list of scan configs for the project. 1913type ListScanConfigsResponse struct { 1914 // NextPageToken: A page token to pass in order to get more scan 1915 // configs. 1916 NextPageToken string `json:"nextPageToken,omitempty"` 1917 1918 // ScanConfigs: The set of scan configs. 1919 ScanConfigs []*ScanConfig `json:"scanConfigs,omitempty"` 1920 1921 // ServerResponse contains the HTTP response code and headers from the 1922 // server. 1923 googleapi.ServerResponse `json:"-"` 1924 1925 // ForceSendFields is a list of field names (e.g. "NextPageToken") to 1926 // unconditionally include in API requests. By default, fields with 1927 // empty values are omitted from API requests. However, any non-pointer, 1928 // non-interface field appearing in ForceSendFields will be sent to the 1929 // server regardless of whether the field is empty or not. This may be 1930 // used to include empty fields in Patch requests. 1931 ForceSendFields []string `json:"-"` 1932 1933 // NullFields is a list of field names (e.g. "NextPageToken") to include 1934 // in API requests with the JSON null value. By default, fields with 1935 // empty values are omitted from API requests. However, any field with 1936 // an empty value appearing in NullFields will be sent to the server as 1937 // null. It is an error if a field in this list has a non-empty value. 1938 // This may be used to include null fields in Patch requests. 1939 NullFields []string `json:"-"` 1940} 1941 1942func (s *ListScanConfigsResponse) MarshalJSON() ([]byte, error) { 1943 type NoMethod ListScanConfigsResponse 1944 raw := NoMethod(*s) 1945 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1946} 1947 1948// Location: An occurrence of a particular package installation found 1949// within a system's filesystem. e.g. glibc was found in 1950// /var/lib/dpkg/status 1951type Location struct { 1952 // CpeUri: The cpe_uri in cpe format 1953 // (https://cpe.mitre.org/specification/) denoting the package manager 1954 // version distributing a package. 1955 CpeUri string `json:"cpeUri,omitempty"` 1956 1957 // Path: The path from which we gathered that this package/version is 1958 // installed. 1959 Path string `json:"path,omitempty"` 1960 1961 // Version: The version installed at this location. 1962 Version *Version `json:"version,omitempty"` 1963 1964 // ForceSendFields is a list of field names (e.g. "CpeUri") to 1965 // unconditionally include in API requests. By default, fields with 1966 // empty values are omitted from API requests. However, any non-pointer, 1967 // non-interface field appearing in ForceSendFields will be sent to the 1968 // server regardless of whether the field is empty or not. This may be 1969 // used to include empty fields in Patch requests. 1970 ForceSendFields []string `json:"-"` 1971 1972 // NullFields is a list of field names (e.g. "CpeUri") to include in API 1973 // requests with the JSON null value. By default, fields with empty 1974 // values are omitted from API requests. However, any field with an 1975 // empty value appearing in NullFields will be sent to the server as 1976 // null. It is an error if a field in this list has a non-empty value. 1977 // This may be used to include null fields in Patch requests. 1978 NullFields []string `json:"-"` 1979} 1980 1981func (s *Location) MarshalJSON() ([]byte, error) { 1982 type NoMethod Location 1983 raw := NoMethod(*s) 1984 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1985} 1986 1987// Note: Provides a detailed description of a `Note`. 1988type Note struct { 1989 // AttestationAuthority: A note describing an attestation role. 1990 AttestationAuthority *AttestationAuthority `json:"attestationAuthority,omitempty"` 1991 1992 // BaseImage: A note describing a base image. 1993 BaseImage *Basis `json:"baseImage,omitempty"` 1994 1995 // BuildType: Build provenance type for a verifiable build. 1996 BuildType *BuildType `json:"buildType,omitempty"` 1997 1998 // CreateTime: Output only. The time this note was created. This field 1999 // can be used as a filter in list requests. 2000 CreateTime string `json:"createTime,omitempty"` 2001 2002 // Deployable: A note describing something that can be deployed. 2003 Deployable *Deployable `json:"deployable,omitempty"` 2004 2005 // Discovery: A note describing a provider/analysis type. 2006 Discovery *Discovery `json:"discovery,omitempty"` 2007 2008 // ExpirationTime: Time of expiration for this note, null if note does 2009 // not expire. 2010 ExpirationTime string `json:"expirationTime,omitempty"` 2011 2012 // Kind: Output only. This explicitly denotes which kind of note is 2013 // specified. This field can be used as a filter in list requests. 2014 // 2015 // Possible values: 2016 // "KIND_UNSPECIFIED" - Unknown 2017 // "PACKAGE_VULNERABILITY" - The note and occurrence represent a 2018 // package vulnerability. 2019 // "BUILD_DETAILS" - The note and occurrence assert build provenance. 2020 // "IMAGE_BASIS" - This represents an image basis relationship. 2021 // "PACKAGE_MANAGER" - This represents a package installed via a 2022 // package manager. 2023 // "DEPLOYABLE" - The note and occurrence track deployment events. 2024 // "DISCOVERY" - The note and occurrence track the initial discovery 2025 // status of a resource. 2026 // "ATTESTATION_AUTHORITY" - This represents a logical "role" that can 2027 // attest to artifacts. 2028 // "UPGRADE" - This represents an available software upgrade. 2029 Kind string `json:"kind,omitempty"` 2030 2031 // LongDescription: A detailed description of this `Note`. 2032 LongDescription string `json:"longDescription,omitempty"` 2033 2034 // Name: The name of the note in the form 2035 // "projects/{provider_project_id}/notes/{NOTE_ID}" 2036 Name string `json:"name,omitempty"` 2037 2038 // Package: A note describing a package hosted by various package 2039 // managers. 2040 Package *Package `json:"package,omitempty"` 2041 2042 // RelatedUrl: URLs associated with this note 2043 RelatedUrl []*RelatedUrl `json:"relatedUrl,omitempty"` 2044 2045 // ShortDescription: A one sentence description of this `Note`. 2046 ShortDescription string `json:"shortDescription,omitempty"` 2047 2048 // UpdateTime: Output only. The time this note was last updated. This 2049 // field can be used as a filter in list requests. 2050 UpdateTime string `json:"updateTime,omitempty"` 2051 2052 // Upgrade: A note describing an upgrade. 2053 Upgrade *UpgradeNote `json:"upgrade,omitempty"` 2054 2055 // VulnerabilityType: A package vulnerability type of note. 2056 VulnerabilityType *VulnerabilityType `json:"vulnerabilityType,omitempty"` 2057 2058 // ServerResponse contains the HTTP response code and headers from the 2059 // server. 2060 googleapi.ServerResponse `json:"-"` 2061 2062 // ForceSendFields is a list of field names (e.g. 2063 // "AttestationAuthority") to unconditionally include in API requests. 2064 // By default, fields with empty values are omitted from API requests. 2065 // However, any non-pointer, non-interface field appearing in 2066 // ForceSendFields will be sent to the server regardless of whether the 2067 // field is empty or not. This may be used to include empty fields in 2068 // Patch requests. 2069 ForceSendFields []string `json:"-"` 2070 2071 // NullFields is a list of field names (e.g. "AttestationAuthority") to 2072 // include in API requests with the JSON null value. By default, fields 2073 // with empty values are omitted from API requests. However, any field 2074 // with an empty value appearing in NullFields will be sent to the 2075 // server as null. It is an error if a field in this list has a 2076 // non-empty value. This may be used to include null fields in Patch 2077 // requests. 2078 NullFields []string `json:"-"` 2079} 2080 2081func (s *Note) MarshalJSON() ([]byte, error) { 2082 type NoMethod Note 2083 raw := NoMethod(*s) 2084 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2085} 2086 2087// Occurrence: `Occurrence` includes information about analysis 2088// occurrences for an image. 2089type Occurrence struct { 2090 // Attestation: Describes an attestation of an artifact. 2091 Attestation *Attestation `json:"attestation,omitempty"` 2092 2093 // BuildDetails: Build details for a verifiable build. 2094 BuildDetails *BuildDetails `json:"buildDetails,omitempty"` 2095 2096 // CreateTime: Output only. The time this `Occurrence` was created. 2097 CreateTime string `json:"createTime,omitempty"` 2098 2099 // Deployment: Describes the deployment of an artifact on a runtime. 2100 Deployment *Deployment `json:"deployment,omitempty"` 2101 2102 // DerivedImage: Describes how this resource derives from the basis in 2103 // the associated note. 2104 DerivedImage *Derived `json:"derivedImage,omitempty"` 2105 2106 // Discovered: Describes the initial scan status for this resource. 2107 Discovered *Discovered `json:"discovered,omitempty"` 2108 2109 // Installation: Describes the installation of a package on the linked 2110 // resource. 2111 Installation *Installation `json:"installation,omitempty"` 2112 2113 // Kind: Output only. This explicitly denotes which of the `Occurrence` 2114 // details are specified. This field can be used as a filter in list 2115 // requests. 2116 // 2117 // Possible values: 2118 // "KIND_UNSPECIFIED" - Unknown 2119 // "PACKAGE_VULNERABILITY" - The note and occurrence represent a 2120 // package vulnerability. 2121 // "BUILD_DETAILS" - The note and occurrence assert build provenance. 2122 // "IMAGE_BASIS" - This represents an image basis relationship. 2123 // "PACKAGE_MANAGER" - This represents a package installed via a 2124 // package manager. 2125 // "DEPLOYABLE" - The note and occurrence track deployment events. 2126 // "DISCOVERY" - The note and occurrence track the initial discovery 2127 // status of a resource. 2128 // "ATTESTATION_AUTHORITY" - This represents a logical "role" that can 2129 // attest to artifacts. 2130 // "UPGRADE" - This represents an available software upgrade. 2131 Kind string `json:"kind,omitempty"` 2132 2133 // Name: Output only. The name of the `Occurrence` in the form 2134 // "projects/{project_id}/occurrences/{OCCURRENCE_ID}" 2135 Name string `json:"name,omitempty"` 2136 2137 // NoteName: An analysis note associated with this image, in the form 2138 // "providers/{provider_id}/notes/{NOTE_ID}" This field can be used as a 2139 // filter in list requests. 2140 NoteName string `json:"noteName,omitempty"` 2141 2142 // Remediation: A description of actions that can be taken to remedy the 2143 // `Note` 2144 Remediation string `json:"remediation,omitempty"` 2145 2146 // Resource: The resource for which the `Occurrence` applies. 2147 Resource *Resource `json:"resource,omitempty"` 2148 2149 // ResourceUrl: The unique URL of the image or the container for which 2150 // the `Occurrence` applies. For example, 2151 // https://gcr.io/project/image@sha256:foo This field can be used as a 2152 // filter in list requests. 2153 ResourceUrl string `json:"resourceUrl,omitempty"` 2154 2155 // UpdateTime: Output only. The time this `Occurrence` was last updated. 2156 UpdateTime string `json:"updateTime,omitempty"` 2157 2158 // Upgrade: Describes an upgrade. 2159 Upgrade *UpgradeOccurrence `json:"upgrade,omitempty"` 2160 2161 // VulnerabilityDetails: Details of a security vulnerability note. 2162 VulnerabilityDetails *VulnerabilityDetails `json:"vulnerabilityDetails,omitempty"` 2163 2164 // ServerResponse contains the HTTP response code and headers from the 2165 // server. 2166 googleapi.ServerResponse `json:"-"` 2167 2168 // ForceSendFields is a list of field names (e.g. "Attestation") to 2169 // unconditionally include in API requests. By default, fields with 2170 // empty values are omitted from API requests. However, any non-pointer, 2171 // non-interface field appearing in ForceSendFields will be sent to the 2172 // server regardless of whether the field is empty or not. This may be 2173 // used to include empty fields in Patch requests. 2174 ForceSendFields []string `json:"-"` 2175 2176 // NullFields is a list of field names (e.g. "Attestation") to include 2177 // in API requests with the JSON null value. By default, fields with 2178 // empty values are omitted from API requests. However, any field with 2179 // an empty value appearing in NullFields will be sent to the server as 2180 // null. It is an error if a field in this list has a non-empty value. 2181 // This may be used to include null fields in Patch requests. 2182 NullFields []string `json:"-"` 2183} 2184 2185func (s *Occurrence) MarshalJSON() ([]byte, error) { 2186 type NoMethod Occurrence 2187 raw := NoMethod(*s) 2188 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2189} 2190 2191// Operation: This resource represents a long-running operation that is 2192// the result of a network API call. 2193type Operation struct { 2194 // Done: If the value is `false`, it means the operation is still in 2195 // progress. If `true`, the operation is completed, and either `error` 2196 // or `response` is available. 2197 Done bool `json:"done,omitempty"` 2198 2199 // Error: The error result of the operation in case of failure or 2200 // cancellation. 2201 Error *Status `json:"error,omitempty"` 2202 2203 // Metadata: Service-specific metadata associated with the operation. It 2204 // typically contains progress information and common metadata such as 2205 // create time. Some services might not provide such metadata. Any 2206 // method that returns a long-running operation should document the 2207 // metadata type, if any. 2208 Metadata googleapi.RawMessage `json:"metadata,omitempty"` 2209 2210 // Name: The server-assigned name, which is only unique within the same 2211 // service that originally returns it. If you use the default HTTP 2212 // mapping, the `name` should be a resource name ending with 2213 // `operations/{unique_id}`. 2214 Name string `json:"name,omitempty"` 2215 2216 // Response: The normal response of the operation in case of success. If 2217 // the original method returns no data on success, such as `Delete`, the 2218 // response is `google.protobuf.Empty`. If the original method is 2219 // standard `Get`/`Create`/`Update`, the response should be the 2220 // resource. For other methods, the response should have the type 2221 // `XxxResponse`, where `Xxx` is the original method name. For example, 2222 // if the original method name is `TakeSnapshot()`, the inferred 2223 // response type is `TakeSnapshotResponse`. 2224 Response googleapi.RawMessage `json:"response,omitempty"` 2225 2226 // ServerResponse contains the HTTP response code and headers from the 2227 // server. 2228 googleapi.ServerResponse `json:"-"` 2229 2230 // ForceSendFields is a list of field names (e.g. "Done") to 2231 // unconditionally include in API requests. By default, fields with 2232 // empty values are omitted from API requests. However, any non-pointer, 2233 // non-interface field appearing in ForceSendFields will be sent to the 2234 // server regardless of whether the field is empty or not. This may be 2235 // used to include empty fields in Patch requests. 2236 ForceSendFields []string `json:"-"` 2237 2238 // NullFields is a list of field names (e.g. "Done") to include in API 2239 // requests with the JSON null value. By default, fields with empty 2240 // values are omitted from API requests. However, any field with an 2241 // empty value appearing in NullFields will be sent to the server as 2242 // null. It is an error if a field in this list has a non-empty value. 2243 // This may be used to include null fields in Patch requests. 2244 NullFields []string `json:"-"` 2245} 2246 2247func (s *Operation) MarshalJSON() ([]byte, error) { 2248 type NoMethod Operation 2249 raw := NoMethod(*s) 2250 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2251} 2252 2253// Package: This represents a particular package that is distributed 2254// over various channels. e.g. glibc (aka libc6) is distributed by many, 2255// at various versions. 2256type Package struct { 2257 // Distribution: The various channels by which a package is distributed. 2258 Distribution []*Distribution `json:"distribution,omitempty"` 2259 2260 // Name: The name of the package. 2261 Name string `json:"name,omitempty"` 2262 2263 // ForceSendFields is a list of field names (e.g. "Distribution") to 2264 // unconditionally include in API requests. By default, fields with 2265 // empty values are omitted from API requests. However, any non-pointer, 2266 // non-interface field appearing in ForceSendFields will be sent to the 2267 // server regardless of whether the field is empty or not. This may be 2268 // used to include empty fields in Patch requests. 2269 ForceSendFields []string `json:"-"` 2270 2271 // NullFields is a list of field names (e.g. "Distribution") to include 2272 // in API requests with the JSON null value. By default, fields with 2273 // empty values are omitted from API requests. However, any field with 2274 // an empty value appearing in NullFields will be sent to the server as 2275 // null. It is an error if a field in this list has a non-empty value. 2276 // This may be used to include null fields in Patch requests. 2277 NullFields []string `json:"-"` 2278} 2279 2280func (s *Package) MarshalJSON() ([]byte, error) { 2281 type NoMethod Package 2282 raw := NoMethod(*s) 2283 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2284} 2285 2286// PackageIssue: This message wraps a location affected by a 2287// vulnerability and its associated fix (if one is available). 2288type PackageIssue struct { 2289 // AffectedLocation: The location of the vulnerability. 2290 AffectedLocation *VulnerabilityLocation `json:"affectedLocation,omitempty"` 2291 2292 // FixedLocation: The location of the available fix for vulnerability. 2293 FixedLocation *VulnerabilityLocation `json:"fixedLocation,omitempty"` 2294 2295 SeverityName string `json:"severityName,omitempty"` 2296 2297 // ForceSendFields is a list of field names (e.g. "AffectedLocation") to 2298 // unconditionally include in API requests. By default, fields with 2299 // empty values are omitted from API requests. However, any non-pointer, 2300 // non-interface field appearing in ForceSendFields will be sent to the 2301 // server regardless of whether the field is empty or not. This may be 2302 // used to include empty fields in Patch requests. 2303 ForceSendFields []string `json:"-"` 2304 2305 // NullFields is a list of field names (e.g. "AffectedLocation") to 2306 // include in API requests with the JSON null value. By default, fields 2307 // with empty values are omitted from API requests. However, any field 2308 // with an empty value appearing in NullFields will be sent to the 2309 // server as null. It is an error if a field in this list has a 2310 // non-empty value. This may be used to include null fields in Patch 2311 // requests. 2312 NullFields []string `json:"-"` 2313} 2314 2315func (s *PackageIssue) MarshalJSON() ([]byte, error) { 2316 type NoMethod PackageIssue 2317 raw := NoMethod(*s) 2318 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2319} 2320 2321// PgpSignedAttestation: An attestation wrapper with a PGP-compatible 2322// signature. This message only supports `ATTACHED` signatures, where 2323// the payload that is signed is included alongside the signature itself 2324// in the same file. 2325type PgpSignedAttestation struct { 2326 // ContentType: Type (for example schema) of the attestation payload 2327 // that was signed. The verifier must ensure that the provided type is 2328 // one that the verifier supports, and that the attestation payload is a 2329 // valid instantiation of that type (for example by validating a JSON 2330 // schema). 2331 // 2332 // Possible values: 2333 // "CONTENT_TYPE_UNSPECIFIED" - `ContentType` is not set. 2334 // "SIMPLE_SIGNING_JSON" - Atomic format attestation signature. See 2335 // https://github.com/containers/image/blob/8a5d2f82a6e3263290c8e0276c3e0f64e77723e7/docs/atomic-signature.md 2336 // The payload extracted from `signature` is a JSON blob conforming to 2337 // the linked schema. 2338 ContentType string `json:"contentType,omitempty"` 2339 2340 // PgpKeyId: The cryptographic fingerprint of the key used to generate 2341 // the signature, as output by, e.g. `gpg --list-keys`. This should be 2342 // the version 4, full 160-bit fingerprint, expressed as a 40 character 2343 // hexadecimal string. See 2344 // https://tools.ietf.org/html/rfc4880#section-12.2 for details. 2345 // Implementations may choose to acknowledge "LONG", "SHORT", or other 2346 // abbreviated key IDs, but only the full fingerprint is guaranteed to 2347 // work. In gpg, the full fingerprint can be retrieved from the `fpr` 2348 // field returned when calling --list-keys with --with-colons. For 2349 // example: ``` gpg --with-colons --with-fingerprint --force-v4-certs \ 2350 // --list-keys attester@example.com tru::1:1513631572:0:3:1:5 pub:...... 2351 // fpr:::::::::24FF6481B76AC91E66A00AC657A93A81EF3AE6FB: ``` Above, the 2352 // fingerprint is `24FF6481B76AC91E66A00AC657A93A81EF3AE6FB`. 2353 PgpKeyId string `json:"pgpKeyId,omitempty"` 2354 2355 // Signature: The raw content of the signature, as output by GNU Privacy 2356 // Guard (GPG) or equivalent. Since this message only supports attached 2357 // signatures, the payload that was signed must be attached. While the 2358 // signature format supported is dependent on the verification 2359 // implementation, currently only ASCII-armored (`--armor` to gpg), 2360 // non-clearsigned (`--sign` rather than `--clearsign` to gpg) are 2361 // supported. Concretely, `gpg --sign --armor --output=signature.gpg 2362 // payload.json` will create the signature content expected in this 2363 // field in `signature.gpg` for the `payload.json` attestation payload. 2364 Signature string `json:"signature,omitempty"` 2365 2366 // ForceSendFields is a list of field names (e.g. "ContentType") to 2367 // unconditionally include in API requests. By default, fields with 2368 // empty values are omitted from API requests. However, any non-pointer, 2369 // non-interface field appearing in ForceSendFields will be sent to the 2370 // server regardless of whether the field is empty or not. This may be 2371 // used to include empty fields in Patch requests. 2372 ForceSendFields []string `json:"-"` 2373 2374 // NullFields is a list of field names (e.g. "ContentType") to include 2375 // in API requests with the JSON null value. By default, fields with 2376 // empty values are omitted from API requests. However, any field with 2377 // an empty value appearing in NullFields will be sent to the server as 2378 // null. It is an error if a field in this list has a non-empty value. 2379 // This may be used to include null fields in Patch requests. 2380 NullFields []string `json:"-"` 2381} 2382 2383func (s *PgpSignedAttestation) MarshalJSON() ([]byte, error) { 2384 type NoMethod PgpSignedAttestation 2385 raw := NoMethod(*s) 2386 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2387} 2388 2389// Policy: An Identity and Access Management (IAM) policy, which 2390// specifies access controls for Google Cloud resources. A `Policy` is a 2391// collection of `bindings`. A `binding` binds one or more `members` to 2392// a single `role`. Members can be user accounts, service accounts, 2393// Google groups, and domains (such as G Suite). A `role` is a named 2394// list of permissions; each `role` can be an IAM predefined role or a 2395// user-created custom role. For some types of Google Cloud resources, a 2396// `binding` can also specify a `condition`, which is a logical 2397// expression that allows access to a resource only if the expression 2398// evaluates to `true`. A condition can add constraints based on 2399// attributes of the request, the resource, or both. To learn which 2400// resources support conditions in their IAM policies, see the IAM 2401// documentation 2402// (https://cloud.google.com/iam/help/conditions/resource-policies). 2403// **JSON example:** { "bindings": [ { "role": 2404// "roles/resourcemanager.organizationAdmin", "members": [ 2405// "user:mike@example.com", "group:admins@example.com", 2406// "domain:google.com", 2407// "serviceAccount:my-project-id@appspot.gserviceaccount.com" ] }, { 2408// "role": "roles/resourcemanager.organizationViewer", "members": [ 2409// "user:eve@example.com" ], "condition": { "title": "expirable access", 2410// "description": "Does not grant access after Sep 2020", "expression": 2411// "request.time < timestamp('2020-10-01T00:00:00.000Z')", } } ], 2412// "etag": "BwWWja0YfJA=", "version": 3 } **YAML example:** bindings: - 2413// members: - user:mike@example.com - group:admins@example.com - 2414// domain:google.com - 2415// serviceAccount:my-project-id@appspot.gserviceaccount.com role: 2416// roles/resourcemanager.organizationAdmin - members: - 2417// user:eve@example.com role: roles/resourcemanager.organizationViewer 2418// condition: title: expirable access description: Does not grant access 2419// after Sep 2020 expression: request.time < 2420// timestamp('2020-10-01T00:00:00.000Z') - etag: BwWWja0YfJA= - version: 2421// 3 For a description of IAM and its features, see the IAM 2422// documentation (https://cloud.google.com/iam/docs/). 2423type Policy struct { 2424 // Bindings: Associates a list of `members` to a `role`. Optionally, may 2425 // specify a `condition` that determines how and when the `bindings` are 2426 // applied. Each of the `bindings` must contain at least one member. 2427 Bindings []*Binding `json:"bindings,omitempty"` 2428 2429 // Etag: `etag` is used for optimistic concurrency control as a way to 2430 // help prevent simultaneous updates of a policy from overwriting each 2431 // other. It is strongly suggested that systems make use of the `etag` 2432 // in the read-modify-write cycle to perform policy updates in order to 2433 // avoid race conditions: An `etag` is returned in the response to 2434 // `getIamPolicy`, and systems are expected to put that etag in the 2435 // request to `setIamPolicy` to ensure that their change will be applied 2436 // to the same version of the policy. **Important:** If you use IAM 2437 // Conditions, you must include the `etag` field whenever you call 2438 // `setIamPolicy`. If you omit this field, then IAM allows you to 2439 // overwrite a version `3` policy with a version `1` policy, and all of 2440 // the conditions in the version `3` policy are lost. 2441 Etag string `json:"etag,omitempty"` 2442 2443 // Version: Specifies the format of the policy. Valid values are `0`, 2444 // `1`, and `3`. Requests that specify an invalid value are rejected. 2445 // Any operation that affects conditional role bindings must specify 2446 // version `3`. This requirement applies to the following operations: * 2447 // Getting a policy that includes a conditional role binding * Adding a 2448 // conditional role binding to a policy * Changing a conditional role 2449 // binding in a policy * Removing any role binding, with or without a 2450 // condition, from a policy that includes conditions **Important:** If 2451 // you use IAM Conditions, you must include the `etag` field whenever 2452 // you call `setIamPolicy`. If you omit this field, then IAM allows you 2453 // to overwrite a version `3` policy with a version `1` policy, and all 2454 // of the conditions in the version `3` policy are lost. If a policy 2455 // does not include any conditions, operations on that policy may 2456 // specify any valid version or leave the field unset. To learn which 2457 // resources support conditions in their IAM policies, see the IAM 2458 // documentation 2459 // (https://cloud.google.com/iam/help/conditions/resource-policies). 2460 Version int64 `json:"version,omitempty"` 2461 2462 // ServerResponse contains the HTTP response code and headers from the 2463 // server. 2464 googleapi.ServerResponse `json:"-"` 2465 2466 // ForceSendFields is a list of field names (e.g. "Bindings") to 2467 // unconditionally include in API requests. By default, fields with 2468 // empty values are omitted from API requests. However, any non-pointer, 2469 // non-interface field appearing in ForceSendFields will be sent to the 2470 // server regardless of whether the field is empty or not. This may be 2471 // used to include empty fields in Patch requests. 2472 ForceSendFields []string `json:"-"` 2473 2474 // NullFields is a list of field names (e.g. "Bindings") to include in 2475 // API requests with the JSON null value. By default, fields with empty 2476 // values are omitted from API requests. However, any field with an 2477 // empty value appearing in NullFields will be sent to the server as 2478 // null. It is an error if a field in this list has a non-empty value. 2479 // This may be used to include null fields in Patch requests. 2480 NullFields []string `json:"-"` 2481} 2482 2483func (s *Policy) MarshalJSON() ([]byte, error) { 2484 type NoMethod Policy 2485 raw := NoMethod(*s) 2486 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2487} 2488 2489// RelatedUrl: Metadata for any related URL information 2490type RelatedUrl struct { 2491 // Label: Label to describe usage of the URL 2492 Label string `json:"label,omitempty"` 2493 2494 // Url: Specific URL to associate with the note 2495 Url string `json:"url,omitempty"` 2496 2497 // ForceSendFields is a list of field names (e.g. "Label") to 2498 // unconditionally include in API requests. By default, fields with 2499 // empty values are omitted from API requests. However, any non-pointer, 2500 // non-interface field appearing in ForceSendFields will be sent to the 2501 // server regardless of whether the field is empty or not. This may be 2502 // used to include empty fields in Patch requests. 2503 ForceSendFields []string `json:"-"` 2504 2505 // NullFields is a list of field names (e.g. "Label") to include in API 2506 // requests with the JSON null value. By default, fields with empty 2507 // values are omitted from API requests. However, any field with an 2508 // empty value appearing in NullFields will be sent to the server as 2509 // null. It is an error if a field in this list has a non-empty value. 2510 // This may be used to include null fields in Patch requests. 2511 NullFields []string `json:"-"` 2512} 2513 2514func (s *RelatedUrl) MarshalJSON() ([]byte, error) { 2515 type NoMethod RelatedUrl 2516 raw := NoMethod(*s) 2517 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2518} 2519 2520// RepoSource: RepoSource describes the location of the source in a 2521// Google Cloud Source Repository. 2522type RepoSource struct { 2523 // BranchName: Name of the branch to build. 2524 BranchName string `json:"branchName,omitempty"` 2525 2526 // CommitSha: Explicit commit SHA to build. 2527 CommitSha string `json:"commitSha,omitempty"` 2528 2529 // ProjectId: ID of the project that owns the repo. 2530 ProjectId string `json:"projectId,omitempty"` 2531 2532 // RepoName: Name of the repo. 2533 RepoName string `json:"repoName,omitempty"` 2534 2535 // TagName: Name of the tag to build. 2536 TagName string `json:"tagName,omitempty"` 2537 2538 // ForceSendFields is a list of field names (e.g. "BranchName") to 2539 // unconditionally include in API requests. By default, fields with 2540 // empty values are omitted from API requests. However, any non-pointer, 2541 // non-interface field appearing in ForceSendFields will be sent to the 2542 // server regardless of whether the field is empty or not. This may be 2543 // used to include empty fields in Patch requests. 2544 ForceSendFields []string `json:"-"` 2545 2546 // NullFields is a list of field names (e.g. "BranchName") to include in 2547 // API requests with the JSON null value. By default, fields with empty 2548 // values are omitted from API requests. However, any field with an 2549 // empty value appearing in NullFields will be sent to the server as 2550 // null. It is an error if a field in this list has a non-empty value. 2551 // This may be used to include null fields in Patch requests. 2552 NullFields []string `json:"-"` 2553} 2554 2555func (s *RepoSource) MarshalJSON() ([]byte, error) { 2556 type NoMethod RepoSource 2557 raw := NoMethod(*s) 2558 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2559} 2560 2561// Resource: Resource is an entity that can have metadata. E.g., a 2562// Docker image. 2563type Resource struct { 2564 // ContentHash: The hash of the resource content. E.g., the Docker 2565 // digest. 2566 ContentHash *Hash `json:"contentHash,omitempty"` 2567 2568 // Name: The name of the resource. E.g., the name of a Docker image - 2569 // "Debian". 2570 Name string `json:"name,omitempty"` 2571 2572 // Uri: The unique URI of the resource. E.g., 2573 // "https://gcr.io/project/image@sha256:foo" for a Docker image. 2574 Uri string `json:"uri,omitempty"` 2575 2576 // ForceSendFields is a list of field names (e.g. "ContentHash") to 2577 // unconditionally include in API requests. By default, fields with 2578 // empty values are omitted from API requests. However, any non-pointer, 2579 // non-interface field appearing in ForceSendFields will be sent to the 2580 // server regardless of whether the field is empty or not. This may be 2581 // used to include empty fields in Patch requests. 2582 ForceSendFields []string `json:"-"` 2583 2584 // NullFields is a list of field names (e.g. "ContentHash") to include 2585 // in API requests with the JSON null value. By default, fields with 2586 // empty values are omitted from API requests. However, any field with 2587 // an empty value appearing in NullFields will be sent to the server as 2588 // null. It is an error if a field in this list has a non-empty value. 2589 // This may be used to include null fields in Patch requests. 2590 NullFields []string `json:"-"` 2591} 2592 2593func (s *Resource) MarshalJSON() ([]byte, error) { 2594 type NoMethod Resource 2595 raw := NoMethod(*s) 2596 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2597} 2598 2599// ScanConfig: Indicates various scans and whether they are turned on or 2600// off. 2601type ScanConfig struct { 2602 // CreateTime: Output only. The time this scan config was created. 2603 CreateTime string `json:"createTime,omitempty"` 2604 2605 // Description: Output only. A human-readable description of what the 2606 // `ScanConfig` does. 2607 Description string `json:"description,omitempty"` 2608 2609 // Enabled: Indicates whether the Scan is enabled. 2610 Enabled bool `json:"enabled,omitempty"` 2611 2612 // Name: Output only. The name of the ScanConfig in the form 2613 // “projects/{project_id}/scanConfigs/{scan_config_id}". 2614 Name string `json:"name,omitempty"` 2615 2616 // UpdateTime: Output only. The time this scan config was last updated. 2617 UpdateTime string `json:"updateTime,omitempty"` 2618 2619 // ServerResponse contains the HTTP response code and headers from the 2620 // server. 2621 googleapi.ServerResponse `json:"-"` 2622 2623 // ForceSendFields is a list of field names (e.g. "CreateTime") to 2624 // unconditionally include in API requests. By default, fields with 2625 // empty values are omitted from API requests. However, any non-pointer, 2626 // non-interface field appearing in ForceSendFields will be sent to the 2627 // server regardless of whether the field is empty or not. This may be 2628 // used to include empty fields in Patch requests. 2629 ForceSendFields []string `json:"-"` 2630 2631 // NullFields is a list of field names (e.g. "CreateTime") to include in 2632 // API requests with the JSON null value. By default, fields with empty 2633 // values are omitted from API requests. However, any field with an 2634 // empty value appearing in NullFields will be sent to the server as 2635 // null. It is an error if a field in this list has a non-empty value. 2636 // This may be used to include null fields in Patch requests. 2637 NullFields []string `json:"-"` 2638} 2639 2640func (s *ScanConfig) MarshalJSON() ([]byte, error) { 2641 type NoMethod ScanConfig 2642 raw := NoMethod(*s) 2643 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2644} 2645 2646// SetIamPolicyRequest: Request message for `SetIamPolicy` method. 2647type SetIamPolicyRequest struct { 2648 // Policy: REQUIRED: The complete policy to be applied to the 2649 // `resource`. The size of the policy is limited to a few 10s of KB. An 2650 // empty policy is a valid policy but certain Cloud Platform services 2651 // (such as Projects) might reject them. 2652 Policy *Policy `json:"policy,omitempty"` 2653 2654 // ForceSendFields is a list of field names (e.g. "Policy") to 2655 // unconditionally include in API requests. By default, fields with 2656 // empty values are omitted from API requests. However, any non-pointer, 2657 // non-interface field appearing in ForceSendFields will be sent to the 2658 // server regardless of whether the field is empty or not. This may be 2659 // used to include empty fields in Patch requests. 2660 ForceSendFields []string `json:"-"` 2661 2662 // NullFields is a list of field names (e.g. "Policy") to include in API 2663 // requests with the JSON null value. By default, fields with empty 2664 // values are omitted from API requests. However, any field with an 2665 // empty value appearing in NullFields will be sent to the server as 2666 // null. It is an error if a field in this list has a non-empty value. 2667 // This may be used to include null fields in Patch requests. 2668 NullFields []string `json:"-"` 2669} 2670 2671func (s *SetIamPolicyRequest) MarshalJSON() ([]byte, error) { 2672 type NoMethod SetIamPolicyRequest 2673 raw := NoMethod(*s) 2674 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2675} 2676 2677// SeverityCount: The number of occurrences created for a specific 2678// severity. 2679type SeverityCount struct { 2680 // Count: The number of occurrences with the severity. 2681 Count int64 `json:"count,omitempty,string"` 2682 2683 // Severity: The severity of the occurrences. 2684 // 2685 // Possible values: 2686 // "SEVERITY_UNSPECIFIED" - Unknown Impact 2687 // "MINIMAL" - Minimal Impact 2688 // "LOW" - Low Impact 2689 // "MEDIUM" - Medium Impact 2690 // "HIGH" - High Impact 2691 // "CRITICAL" - Critical Impact 2692 Severity string `json:"severity,omitempty"` 2693 2694 // ForceSendFields is a list of field names (e.g. "Count") to 2695 // unconditionally include in API requests. By default, fields with 2696 // empty values are omitted from API requests. However, any non-pointer, 2697 // non-interface field appearing in ForceSendFields will be sent to the 2698 // server regardless of whether the field is empty or not. This may be 2699 // used to include empty fields in Patch requests. 2700 ForceSendFields []string `json:"-"` 2701 2702 // NullFields is a list of field names (e.g. "Count") to include in API 2703 // requests with the JSON null value. By default, fields with empty 2704 // values are omitted from API requests. However, any field with an 2705 // empty value appearing in NullFields will be sent to the server as 2706 // null. It is an error if a field in this list has a non-empty value. 2707 // This may be used to include null fields in Patch requests. 2708 NullFields []string `json:"-"` 2709} 2710 2711func (s *SeverityCount) MarshalJSON() ([]byte, error) { 2712 type NoMethod SeverityCount 2713 raw := NoMethod(*s) 2714 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2715} 2716 2717// Source: Source describes the location of the source used for the 2718// build. 2719type Source struct { 2720 // AdditionalContexts: If provided, some of the source code used for the 2721 // build may be found in these locations, in the case where the source 2722 // repository had multiple remotes or submodules. This list will not 2723 // include the context specified in the context field. 2724 AdditionalContexts []*GoogleDevtoolsContaineranalysisV1alpha1SourceContext `json:"additionalContexts,omitempty"` 2725 2726 // ArtifactStorageSource: If provided, the input binary artifacts for 2727 // the build came from this location. 2728 ArtifactStorageSource *StorageSource `json:"artifactStorageSource,omitempty"` 2729 2730 // Context: If provided, the source code used for the build came from 2731 // this location. 2732 Context *GoogleDevtoolsContaineranalysisV1alpha1SourceContext `json:"context,omitempty"` 2733 2734 // FileHashes: Hash(es) of the build source, which can be used to verify 2735 // that the original source integrity was maintained in the build. The 2736 // keys to this map are file paths used as build source and the values 2737 // contain the hash values for those files. If the build source came in 2738 // a single package such as a gzipped tarfile (.tar.gz), the FileHash 2739 // will be for the single path to that file. 2740 FileHashes map[string]FileHashes `json:"fileHashes,omitempty"` 2741 2742 // RepoSource: If provided, get source from this location in a Cloud 2743 // Repo. 2744 RepoSource *RepoSource `json:"repoSource,omitempty"` 2745 2746 // StorageSource: If provided, get the source from this location in in 2747 // Google Cloud Storage. 2748 StorageSource *StorageSource `json:"storageSource,omitempty"` 2749 2750 // ForceSendFields is a list of field names (e.g. "AdditionalContexts") 2751 // to unconditionally include in API requests. By default, fields with 2752 // empty values are omitted from API requests. However, any non-pointer, 2753 // non-interface field appearing in ForceSendFields will be sent to the 2754 // server regardless of whether the field is empty or not. This may be 2755 // used to include empty fields in Patch requests. 2756 ForceSendFields []string `json:"-"` 2757 2758 // NullFields is a list of field names (e.g. "AdditionalContexts") to 2759 // include in API requests with the JSON null value. By default, fields 2760 // with empty values are omitted from API requests. However, any field 2761 // with an empty value appearing in NullFields will be sent to the 2762 // server as null. It is an error if a field in this list has a 2763 // non-empty value. This may be used to include null fields in Patch 2764 // requests. 2765 NullFields []string `json:"-"` 2766} 2767 2768func (s *Source) MarshalJSON() ([]byte, error) { 2769 type NoMethod Source 2770 raw := NoMethod(*s) 2771 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2772} 2773 2774// Status: The `Status` type defines a logical error model that is 2775// suitable for different programming environments, including REST APIs 2776// and RPC APIs. It is used by gRPC (https://github.com/grpc). Each 2777// `Status` message contains three pieces of data: error code, error 2778// message, and error details. You can find out more about this error 2779// model and how to work with it in the API Design Guide 2780// (https://cloud.google.com/apis/design/errors). 2781type Status struct { 2782 // Code: The status code, which should be an enum value of 2783 // google.rpc.Code. 2784 Code int64 `json:"code,omitempty"` 2785 2786 // Details: A list of messages that carry the error details. There is a 2787 // common set of message types for APIs to use. 2788 Details []googleapi.RawMessage `json:"details,omitempty"` 2789 2790 // Message: A developer-facing error message, which should be in 2791 // English. Any user-facing error message should be localized and sent 2792 // in the google.rpc.Status.details field, or localized by the client. 2793 Message string `json:"message,omitempty"` 2794 2795 // ForceSendFields is a list of field names (e.g. "Code") to 2796 // unconditionally include in API requests. By default, fields with 2797 // empty values are omitted from API requests. However, any non-pointer, 2798 // non-interface field appearing in ForceSendFields will be sent to the 2799 // server regardless of whether the field is empty or not. This may be 2800 // used to include empty fields in Patch requests. 2801 ForceSendFields []string `json:"-"` 2802 2803 // NullFields is a list of field names (e.g. "Code") to include in API 2804 // requests with the JSON null value. By default, fields with empty 2805 // values are omitted from API requests. However, any field with an 2806 // empty value appearing in NullFields will be sent to the server as 2807 // null. It is an error if a field in this list has a non-empty value. 2808 // This may be used to include null fields in Patch requests. 2809 NullFields []string `json:"-"` 2810} 2811 2812func (s *Status) MarshalJSON() ([]byte, error) { 2813 type NoMethod Status 2814 raw := NoMethod(*s) 2815 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2816} 2817 2818// StorageSource: StorageSource describes the location of the source in 2819// an archive file in Google Cloud Storage. 2820type StorageSource struct { 2821 // Bucket: Google Cloud Storage bucket containing source (see [Bucket 2822 // Name Requirements] 2823 // (https://cloud.google.com/storage/docs/bucket-naming#requirements)). 2824 Bucket string `json:"bucket,omitempty"` 2825 2826 // Generation: Google Cloud Storage generation for the object. 2827 Generation int64 `json:"generation,omitempty,string"` 2828 2829 // Object: Google Cloud Storage object containing source. 2830 Object string `json:"object,omitempty"` 2831 2832 // ForceSendFields is a list of field names (e.g. "Bucket") to 2833 // unconditionally include in API requests. By default, fields with 2834 // empty values are omitted from API requests. However, any non-pointer, 2835 // non-interface field appearing in ForceSendFields will be sent to the 2836 // server regardless of whether the field is empty or not. This may be 2837 // used to include empty fields in Patch requests. 2838 ForceSendFields []string `json:"-"` 2839 2840 // NullFields is a list of field names (e.g. "Bucket") to include in API 2841 // requests with the JSON null value. By default, fields with empty 2842 // values are omitted from API requests. However, any field with an 2843 // empty value appearing in NullFields will be sent to the server as 2844 // null. It is an error if a field in this list has a non-empty value. 2845 // This may be used to include null fields in Patch requests. 2846 NullFields []string `json:"-"` 2847} 2848 2849func (s *StorageSource) MarshalJSON() ([]byte, error) { 2850 type NoMethod StorageSource 2851 raw := NoMethod(*s) 2852 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2853} 2854 2855// TestIamPermissionsRequest: Request message for `TestIamPermissions` 2856// method. 2857type TestIamPermissionsRequest struct { 2858 // Permissions: The set of permissions to check for the `resource`. 2859 // Permissions with wildcards (such as '*' or 'storage.*') are not 2860 // allowed. For more information see IAM Overview 2861 // (https://cloud.google.com/iam/docs/overview#permissions). 2862 Permissions []string `json:"permissions,omitempty"` 2863 2864 // ForceSendFields is a list of field names (e.g. "Permissions") to 2865 // unconditionally include in API requests. By default, fields with 2866 // empty values are omitted from API requests. However, any non-pointer, 2867 // non-interface field appearing in ForceSendFields will be sent to the 2868 // server regardless of whether the field is empty or not. This may be 2869 // used to include empty fields in Patch requests. 2870 ForceSendFields []string `json:"-"` 2871 2872 // NullFields is a list of field names (e.g. "Permissions") to include 2873 // in API requests with the JSON null value. By default, fields with 2874 // empty values are omitted from API requests. However, any field with 2875 // an empty value appearing in NullFields will be sent to the server as 2876 // null. It is an error if a field in this list has a non-empty value. 2877 // This may be used to include null fields in Patch requests. 2878 NullFields []string `json:"-"` 2879} 2880 2881func (s *TestIamPermissionsRequest) MarshalJSON() ([]byte, error) { 2882 type NoMethod TestIamPermissionsRequest 2883 raw := NoMethod(*s) 2884 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2885} 2886 2887// TestIamPermissionsResponse: Response message for `TestIamPermissions` 2888// method. 2889type TestIamPermissionsResponse struct { 2890 // Permissions: A subset of `TestPermissionsRequest.permissions` that 2891 // the caller is allowed. 2892 Permissions []string `json:"permissions,omitempty"` 2893 2894 // ServerResponse contains the HTTP response code and headers from the 2895 // server. 2896 googleapi.ServerResponse `json:"-"` 2897 2898 // ForceSendFields is a list of field names (e.g. "Permissions") to 2899 // unconditionally include in API requests. By default, fields with 2900 // empty values are omitted from API requests. However, any non-pointer, 2901 // non-interface field appearing in ForceSendFields will be sent to the 2902 // server regardless of whether the field is empty or not. This may be 2903 // used to include empty fields in Patch requests. 2904 ForceSendFields []string `json:"-"` 2905 2906 // NullFields is a list of field names (e.g. "Permissions") to include 2907 // in API requests with the JSON null value. By default, fields with 2908 // empty values are omitted from API requests. However, any field with 2909 // an empty value appearing in NullFields will be sent to the server as 2910 // null. It is an error if a field in this list has a non-empty value. 2911 // This may be used to include null fields in Patch requests. 2912 NullFields []string `json:"-"` 2913} 2914 2915func (s *TestIamPermissionsResponse) MarshalJSON() ([]byte, error) { 2916 type NoMethod TestIamPermissionsResponse 2917 raw := NoMethod(*s) 2918 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2919} 2920 2921// UpdateOperationRequest: Request for updating an existing operation 2922type UpdateOperationRequest struct { 2923 // Operation: The operation to create. 2924 Operation *Operation `json:"operation,omitempty"` 2925 2926 // UpdateMask: The fields to update. 2927 UpdateMask string `json:"updateMask,omitempty"` 2928 2929 // ForceSendFields is a list of field names (e.g. "Operation") to 2930 // unconditionally include in API requests. By default, fields with 2931 // empty values are omitted from API requests. However, any non-pointer, 2932 // non-interface field appearing in ForceSendFields will be sent to the 2933 // server regardless of whether the field is empty or not. This may be 2934 // used to include empty fields in Patch requests. 2935 ForceSendFields []string `json:"-"` 2936 2937 // NullFields is a list of field names (e.g. "Operation") to include in 2938 // API requests with the JSON null value. By default, fields with empty 2939 // values are omitted from API requests. However, any field with an 2940 // empty value appearing in NullFields will be sent to the server as 2941 // null. It is an error if a field in this list has a non-empty value. 2942 // This may be used to include null fields in Patch requests. 2943 NullFields []string `json:"-"` 2944} 2945 2946func (s *UpdateOperationRequest) MarshalJSON() ([]byte, error) { 2947 type NoMethod UpdateOperationRequest 2948 raw := NoMethod(*s) 2949 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2950} 2951 2952// UpgradeDistribution: The Upgrade Distribution represents metadata 2953// about the Upgrade for each operating system (CPE). Some distributions 2954// have additional metadata around updates, classifying them into 2955// various categories and severities. 2956type UpgradeDistribution struct { 2957 // Classification: The operating system classification of this Upgrade, 2958 // as specified by the upstream operating system upgrade feed. 2959 Classification string `json:"classification,omitempty"` 2960 2961 // CpeUri: Required - The specific operating system this metadata 2962 // applies to. See https://cpe.mitre.org/specification/. 2963 CpeUri string `json:"cpeUri,omitempty"` 2964 2965 // Cve: The cve that would be resolved by this upgrade. 2966 Cve []string `json:"cve,omitempty"` 2967 2968 // Severity: The severity as specified by the upstream operating system. 2969 Severity string `json:"severity,omitempty"` 2970 2971 // ForceSendFields is a list of field names (e.g. "Classification") to 2972 // unconditionally include in API requests. By default, fields with 2973 // empty values are omitted from API requests. However, any non-pointer, 2974 // non-interface field appearing in ForceSendFields will be sent to the 2975 // server regardless of whether the field is empty or not. This may be 2976 // used to include empty fields in Patch requests. 2977 ForceSendFields []string `json:"-"` 2978 2979 // NullFields is a list of field names (e.g. "Classification") to 2980 // include in API requests with the JSON null value. By default, fields 2981 // with empty values are omitted from API requests. However, any field 2982 // with an empty value appearing in NullFields will be sent to the 2983 // server as null. It is an error if a field in this list has a 2984 // non-empty value. This may be used to include null fields in Patch 2985 // requests. 2986 NullFields []string `json:"-"` 2987} 2988 2989func (s *UpgradeDistribution) MarshalJSON() ([]byte, error) { 2990 type NoMethod UpgradeDistribution 2991 raw := NoMethod(*s) 2992 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2993} 2994 2995// UpgradeNote: An Upgrade Note represents a potential upgrade of a 2996// package to a given version. For each package version combination 2997// (i.e. bash 4.0, bash 4.1, bash 4.1.2), there will be a Upgrade Note. 2998type UpgradeNote struct { 2999 // Distributions: Metadata about the upgrade for each specific operating 3000 // system. 3001 Distributions []*UpgradeDistribution `json:"distributions,omitempty"` 3002 3003 // Package: Required - The package this Upgrade is for. 3004 Package string `json:"package,omitempty"` 3005 3006 // Version: Required - The version of the package in machine + human 3007 // readable form. 3008 Version *Version `json:"version,omitempty"` 3009 3010 // ForceSendFields is a list of field names (e.g. "Distributions") to 3011 // unconditionally include in API requests. By default, fields with 3012 // empty values are omitted from API requests. However, any non-pointer, 3013 // non-interface field appearing in ForceSendFields will be sent to the 3014 // server regardless of whether the field is empty or not. This may be 3015 // used to include empty fields in Patch requests. 3016 ForceSendFields []string `json:"-"` 3017 3018 // NullFields is a list of field names (e.g. "Distributions") to include 3019 // in API requests with the JSON null value. By default, fields with 3020 // empty values are omitted from API requests. However, any field with 3021 // an empty value appearing in NullFields will be sent to the server as 3022 // null. It is an error if a field in this list has a non-empty value. 3023 // This may be used to include null fields in Patch requests. 3024 NullFields []string `json:"-"` 3025} 3026 3027func (s *UpgradeNote) MarshalJSON() ([]byte, error) { 3028 type NoMethod UpgradeNote 3029 raw := NoMethod(*s) 3030 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3031} 3032 3033// UpgradeOccurrence: An Upgrade Occurrence represents that a specific 3034// resource_url could install a specific upgrade. This presence is 3035// supplied via local sources (i.e. it is present in the mirror and the 3036// running system has noticed its availability). 3037type UpgradeOccurrence struct { 3038 // Distribution: Metadata about the upgrade for available for the 3039 // specific operating system for the resource_url. This allows efficient 3040 // filtering, as well as making it easier to use the occurrence. 3041 Distribution *UpgradeDistribution `json:"distribution,omitempty"` 3042 3043 // Package: Required - The package this Upgrade is for. 3044 Package string `json:"package,omitempty"` 3045 3046 // ParsedVersion: Required - The version of the package in a machine + 3047 // human readable form. 3048 ParsedVersion *Version `json:"parsedVersion,omitempty"` 3049 3050 // ForceSendFields is a list of field names (e.g. "Distribution") to 3051 // unconditionally include in API requests. By default, fields with 3052 // empty values are omitted from API requests. However, any non-pointer, 3053 // non-interface field appearing in ForceSendFields will be sent to the 3054 // server regardless of whether the field is empty or not. This may be 3055 // used to include empty fields in Patch requests. 3056 ForceSendFields []string `json:"-"` 3057 3058 // NullFields is a list of field names (e.g. "Distribution") to include 3059 // in API requests with the JSON null value. By default, fields with 3060 // empty values are omitted from API requests. However, any field with 3061 // an empty value appearing in NullFields will be sent to the server as 3062 // null. It is an error if a field in this list has a non-empty value. 3063 // This may be used to include null fields in Patch requests. 3064 NullFields []string `json:"-"` 3065} 3066 3067func (s *UpgradeOccurrence) MarshalJSON() ([]byte, error) { 3068 type NoMethod UpgradeOccurrence 3069 raw := NoMethod(*s) 3070 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3071} 3072 3073// Version: Version contains structured information about the version of 3074// the package. For a discussion of this in Debian/Ubuntu: 3075// http://serverfault.com/questions/604541/debian-packages-version-convention 3076// For a discussion of this in Redhat/Fedora/Centos: 3077// http://blog.jasonantman.com/2014/07/how-yum-and-rpm-compare-versions/ 3078type Version struct { 3079 // Epoch: Used to correct mistakes in the version numbering scheme. 3080 Epoch int64 `json:"epoch,omitempty"` 3081 3082 // Inclusive: Whether this version is vulnerable, when defining the 3083 // version bounds. For example, if the minimum version is 2.0, 3084 // inclusive=true would say 2.0 is vulnerable, while inclusive=false 3085 // would say it's not 3086 Inclusive bool `json:"inclusive,omitempty"` 3087 3088 // Kind: Distinguish between sentinel MIN/MAX versions and normal 3089 // versions. If kind is not NORMAL, then the other fields are ignored. 3090 // 3091 // Possible values: 3092 // "NORMAL" - A standard package version, defined by the other fields. 3093 // "MINIMUM" - A special version representing negative infinity, other 3094 // fields are ignored. 3095 // "MAXIMUM" - A special version representing positive infinity, other 3096 // fields are ignored. 3097 Kind string `json:"kind,omitempty"` 3098 3099 // Name: The main part of the version name. 3100 Name string `json:"name,omitempty"` 3101 3102 // Revision: The iteration of the package build from the above version. 3103 Revision string `json:"revision,omitempty"` 3104 3105 // ForceSendFields is a list of field names (e.g. "Epoch") to 3106 // unconditionally include in API requests. By default, fields with 3107 // empty values are omitted from API requests. However, any non-pointer, 3108 // non-interface field appearing in ForceSendFields will be sent to the 3109 // server regardless of whether the field is empty or not. This may be 3110 // used to include empty fields in Patch requests. 3111 ForceSendFields []string `json:"-"` 3112 3113 // NullFields is a list of field names (e.g. "Epoch") to include in API 3114 // requests with the JSON null value. By default, fields with empty 3115 // values are omitted from API requests. However, any field with an 3116 // empty value appearing in NullFields will be sent to the server as 3117 // null. It is an error if a field in this list has a non-empty value. 3118 // This may be used to include null fields in Patch requests. 3119 NullFields []string `json:"-"` 3120} 3121 3122func (s *Version) MarshalJSON() ([]byte, error) { 3123 type NoMethod Version 3124 raw := NoMethod(*s) 3125 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3126} 3127 3128// VulnerabilityDetails: Used by Occurrence to point to where the 3129// vulnerability exists and how to fix it. 3130type VulnerabilityDetails struct { 3131 // CvssScore: Output only. The CVSS score of this vulnerability. CVSS 3132 // score is on a scale of 0-10 where 0 indicates low severity and 10 3133 // indicates high severity. 3134 CvssScore float64 `json:"cvssScore,omitempty"` 3135 3136 // EffectiveSeverity: The distro assigned severity for this 3137 // vulnerability when that is available and note provider assigned 3138 // severity when distro has not yet assigned a severity for this 3139 // vulnerability. 3140 // 3141 // Possible values: 3142 // "SEVERITY_UNSPECIFIED" - Unknown Impact 3143 // "MINIMAL" - Minimal Impact 3144 // "LOW" - Low Impact 3145 // "MEDIUM" - Medium Impact 3146 // "HIGH" - High Impact 3147 // "CRITICAL" - Critical Impact 3148 EffectiveSeverity string `json:"effectiveSeverity,omitempty"` 3149 3150 // PackageIssue: The set of affected locations and their fixes (if 3151 // available) within the associated resource. 3152 PackageIssue []*PackageIssue `json:"packageIssue,omitempty"` 3153 3154 // Severity: Output only. The note provider assigned Severity of the 3155 // vulnerability. 3156 // 3157 // Possible values: 3158 // "SEVERITY_UNSPECIFIED" - Unknown Impact 3159 // "MINIMAL" - Minimal Impact 3160 // "LOW" - Low Impact 3161 // "MEDIUM" - Medium Impact 3162 // "HIGH" - High Impact 3163 // "CRITICAL" - Critical Impact 3164 Severity string `json:"severity,omitempty"` 3165 3166 // Type: The type of package; whether native or non native(ruby gems, 3167 // node.js packages etc) 3168 Type string `json:"type,omitempty"` 3169 3170 // ForceSendFields is a list of field names (e.g. "CvssScore") to 3171 // unconditionally include in API requests. By default, fields with 3172 // empty values are omitted from API requests. However, any non-pointer, 3173 // non-interface field appearing in ForceSendFields will be sent to the 3174 // server regardless of whether the field is empty or not. This may be 3175 // used to include empty fields in Patch requests. 3176 ForceSendFields []string `json:"-"` 3177 3178 // NullFields is a list of field names (e.g. "CvssScore") to include in 3179 // API requests with the JSON null value. By default, fields with empty 3180 // values are omitted from API requests. However, any field with an 3181 // empty value appearing in NullFields will be sent to the server as 3182 // null. It is an error if a field in this list has a non-empty value. 3183 // This may be used to include null fields in Patch requests. 3184 NullFields []string `json:"-"` 3185} 3186 3187func (s *VulnerabilityDetails) MarshalJSON() ([]byte, error) { 3188 type NoMethod VulnerabilityDetails 3189 raw := NoMethod(*s) 3190 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3191} 3192 3193func (s *VulnerabilityDetails) UnmarshalJSON(data []byte) error { 3194 type NoMethod VulnerabilityDetails 3195 var s1 struct { 3196 CvssScore gensupport.JSONFloat64 `json:"cvssScore"` 3197 *NoMethod 3198 } 3199 s1.NoMethod = (*NoMethod)(s) 3200 if err := json.Unmarshal(data, &s1); err != nil { 3201 return err 3202 } 3203 s.CvssScore = float64(s1.CvssScore) 3204 return nil 3205} 3206 3207// VulnerabilityLocation: The location of the vulnerability 3208type VulnerabilityLocation struct { 3209 // CpeUri: The cpe_uri in [cpe format] 3210 // (https://cpe.mitre.org/specification/) format. Examples include 3211 // distro or storage location for vulnerable jar. This field can be used 3212 // as a filter in list requests. 3213 CpeUri string `json:"cpeUri,omitempty"` 3214 3215 // Package: The package being described. 3216 Package string `json:"package,omitempty"` 3217 3218 // Version: The version of the package being described. This field can 3219 // be used as a filter in list requests. 3220 Version *Version `json:"version,omitempty"` 3221 3222 // ForceSendFields is a list of field names (e.g. "CpeUri") to 3223 // unconditionally include in API requests. By default, fields with 3224 // empty values are omitted from API requests. However, any non-pointer, 3225 // non-interface field appearing in ForceSendFields will be sent to the 3226 // server regardless of whether the field is empty or not. This may be 3227 // used to include empty fields in Patch requests. 3228 ForceSendFields []string `json:"-"` 3229 3230 // NullFields is a list of field names (e.g. "CpeUri") to include in API 3231 // requests with the JSON null value. By default, fields with empty 3232 // values are omitted from API requests. However, any field with an 3233 // empty value appearing in NullFields will be sent to the server as 3234 // null. It is an error if a field in this list has a non-empty value. 3235 // This may be used to include null fields in Patch requests. 3236 NullFields []string `json:"-"` 3237} 3238 3239func (s *VulnerabilityLocation) MarshalJSON() ([]byte, error) { 3240 type NoMethod VulnerabilityLocation 3241 raw := NoMethod(*s) 3242 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3243} 3244 3245// VulnerabilityType: VulnerabilityType provides metadata about a 3246// security vulnerability. 3247type VulnerabilityType struct { 3248 // CvssScore: The CVSS score for this Vulnerability. 3249 CvssScore float64 `json:"cvssScore,omitempty"` 3250 3251 // Details: All information about the package to specifically identify 3252 // this vulnerability. One entry per (version range and cpe_uri) the 3253 // package vulnerability has manifested in. 3254 Details []*Detail `json:"details,omitempty"` 3255 3256 // Severity: Note provider assigned impact of the vulnerability 3257 // 3258 // Possible values: 3259 // "SEVERITY_UNSPECIFIED" - Unknown Impact 3260 // "MINIMAL" - Minimal Impact 3261 // "LOW" - Low Impact 3262 // "MEDIUM" - Medium Impact 3263 // "HIGH" - High Impact 3264 // "CRITICAL" - Critical Impact 3265 Severity string `json:"severity,omitempty"` 3266 3267 // ForceSendFields is a list of field names (e.g. "CvssScore") to 3268 // unconditionally include in API requests. By default, fields with 3269 // empty values are omitted from API requests. However, any non-pointer, 3270 // non-interface field appearing in ForceSendFields will be sent to the 3271 // server regardless of whether the field is empty or not. This may be 3272 // used to include empty fields in Patch requests. 3273 ForceSendFields []string `json:"-"` 3274 3275 // NullFields is a list of field names (e.g. "CvssScore") to include in 3276 // API requests with the JSON null value. By default, fields with empty 3277 // values are omitted from API requests. However, any field with an 3278 // empty value appearing in NullFields will be sent to the server as 3279 // null. It is an error if a field in this list has a non-empty value. 3280 // This may be used to include null fields in Patch requests. 3281 NullFields []string `json:"-"` 3282} 3283 3284func (s *VulnerabilityType) MarshalJSON() ([]byte, error) { 3285 type NoMethod VulnerabilityType 3286 raw := NoMethod(*s) 3287 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3288} 3289 3290func (s *VulnerabilityType) UnmarshalJSON(data []byte) error { 3291 type NoMethod VulnerabilityType 3292 var s1 struct { 3293 CvssScore gensupport.JSONFloat64 `json:"cvssScore"` 3294 *NoMethod 3295 } 3296 s1.NoMethod = (*NoMethod)(s) 3297 if err := json.Unmarshal(data, &s1); err != nil { 3298 return err 3299 } 3300 s.CvssScore = float64(s1.CvssScore) 3301 return nil 3302} 3303 3304// method id "containeranalysis.projects.notes.create": 3305 3306type ProjectsNotesCreateCall struct { 3307 s *Service 3308 parent string 3309 note *Note 3310 urlParams_ gensupport.URLParams 3311 ctx_ context.Context 3312 header_ http.Header 3313} 3314 3315// Create: Creates a new `Note`. 3316// 3317// - parent: This field contains the project Id for example: 3318// "projects/{project_id}. 3319func (r *ProjectsNotesService) Create(parent string, note *Note) *ProjectsNotesCreateCall { 3320 c := &ProjectsNotesCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 3321 c.parent = parent 3322 c.note = note 3323 return c 3324} 3325 3326// Name sets the optional parameter "name": The name of the project. 3327// Should be of the form "providers/{provider_id}". @Deprecated 3328func (c *ProjectsNotesCreateCall) Name(name string) *ProjectsNotesCreateCall { 3329 c.urlParams_.Set("name", name) 3330 return c 3331} 3332 3333// NoteId sets the optional parameter "noteId": The ID to use for this 3334// note. 3335func (c *ProjectsNotesCreateCall) NoteId(noteId string) *ProjectsNotesCreateCall { 3336 c.urlParams_.Set("noteId", noteId) 3337 return c 3338} 3339 3340// Fields allows partial responses to be retrieved. See 3341// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 3342// for more information. 3343func (c *ProjectsNotesCreateCall) Fields(s ...googleapi.Field) *ProjectsNotesCreateCall { 3344 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 3345 return c 3346} 3347 3348// Context sets the context to be used in this call's Do method. Any 3349// pending HTTP request will be aborted if the provided context is 3350// canceled. 3351func (c *ProjectsNotesCreateCall) Context(ctx context.Context) *ProjectsNotesCreateCall { 3352 c.ctx_ = ctx 3353 return c 3354} 3355 3356// Header returns an http.Header that can be modified by the caller to 3357// add HTTP headers to the request. 3358func (c *ProjectsNotesCreateCall) Header() http.Header { 3359 if c.header_ == nil { 3360 c.header_ = make(http.Header) 3361 } 3362 return c.header_ 3363} 3364 3365func (c *ProjectsNotesCreateCall) doRequest(alt string) (*http.Response, error) { 3366 reqHeaders := make(http.Header) 3367 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210410") 3368 for k, v := range c.header_ { 3369 reqHeaders[k] = v 3370 } 3371 reqHeaders.Set("User-Agent", c.s.userAgent()) 3372 var body io.Reader = nil 3373 body, err := googleapi.WithoutDataWrapper.JSONReader(c.note) 3374 if err != nil { 3375 return nil, err 3376 } 3377 reqHeaders.Set("Content-Type", "application/json") 3378 c.urlParams_.Set("alt", alt) 3379 c.urlParams_.Set("prettyPrint", "false") 3380 urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+parent}/notes") 3381 urls += "?" + c.urlParams_.Encode() 3382 req, err := http.NewRequest("POST", urls, body) 3383 if err != nil { 3384 return nil, err 3385 } 3386 req.Header = reqHeaders 3387 googleapi.Expand(req.URL, map[string]string{ 3388 "parent": c.parent, 3389 }) 3390 return gensupport.SendRequest(c.ctx_, c.s.client, req) 3391} 3392 3393// Do executes the "containeranalysis.projects.notes.create" call. 3394// Exactly one of *Note or error will be non-nil. Any non-2xx status 3395// code is an error. Response headers are in either 3396// *Note.ServerResponse.Header or (if a response was returned at all) in 3397// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 3398// whether the returned error was because http.StatusNotModified was 3399// returned. 3400func (c *ProjectsNotesCreateCall) Do(opts ...googleapi.CallOption) (*Note, error) { 3401 gensupport.SetOptions(c.urlParams_, opts...) 3402 res, err := c.doRequest("json") 3403 if res != nil && res.StatusCode == http.StatusNotModified { 3404 if res.Body != nil { 3405 res.Body.Close() 3406 } 3407 return nil, &googleapi.Error{ 3408 Code: res.StatusCode, 3409 Header: res.Header, 3410 } 3411 } 3412 if err != nil { 3413 return nil, err 3414 } 3415 defer googleapi.CloseBody(res) 3416 if err := googleapi.CheckResponse(res); err != nil { 3417 return nil, err 3418 } 3419 ret := &Note{ 3420 ServerResponse: googleapi.ServerResponse{ 3421 Header: res.Header, 3422 HTTPStatusCode: res.StatusCode, 3423 }, 3424 } 3425 target := &ret 3426 if err := gensupport.DecodeResponse(target, res); err != nil { 3427 return nil, err 3428 } 3429 return ret, nil 3430 // { 3431 // "description": "Creates a new `Note`.", 3432 // "flatPath": "v1alpha1/projects/{projectsId}/notes", 3433 // "httpMethod": "POST", 3434 // "id": "containeranalysis.projects.notes.create", 3435 // "parameterOrder": [ 3436 // "parent" 3437 // ], 3438 // "parameters": { 3439 // "name": { 3440 // "description": "The name of the project. Should be of the form \"providers/{provider_id}\". @Deprecated", 3441 // "location": "query", 3442 // "type": "string" 3443 // }, 3444 // "noteId": { 3445 // "description": "The ID to use for this note.", 3446 // "location": "query", 3447 // "type": "string" 3448 // }, 3449 // "parent": { 3450 // "description": "This field contains the project Id for example: \"projects/{project_id}", 3451 // "location": "path", 3452 // "pattern": "^projects/[^/]+$", 3453 // "required": true, 3454 // "type": "string" 3455 // } 3456 // }, 3457 // "path": "v1alpha1/{+parent}/notes", 3458 // "request": { 3459 // "$ref": "Note" 3460 // }, 3461 // "response": { 3462 // "$ref": "Note" 3463 // }, 3464 // "scopes": [ 3465 // "https://www.googleapis.com/auth/cloud-platform" 3466 // ] 3467 // } 3468 3469} 3470 3471// method id "containeranalysis.projects.notes.delete": 3472 3473type ProjectsNotesDeleteCall struct { 3474 s *Service 3475 name string 3476 urlParams_ gensupport.URLParams 3477 ctx_ context.Context 3478 header_ http.Header 3479} 3480 3481// Delete: Deletes the given `Note` from the system. 3482// 3483// - name: The name of the note in the form of 3484// "providers/{provider_id}/notes/{NOTE_ID}". 3485func (r *ProjectsNotesService) Delete(name string) *ProjectsNotesDeleteCall { 3486 c := &ProjectsNotesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} 3487 c.name = name 3488 return c 3489} 3490 3491// Fields allows partial responses to be retrieved. See 3492// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 3493// for more information. 3494func (c *ProjectsNotesDeleteCall) Fields(s ...googleapi.Field) *ProjectsNotesDeleteCall { 3495 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 3496 return c 3497} 3498 3499// Context sets the context to be used in this call's Do method. Any 3500// pending HTTP request will be aborted if the provided context is 3501// canceled. 3502func (c *ProjectsNotesDeleteCall) Context(ctx context.Context) *ProjectsNotesDeleteCall { 3503 c.ctx_ = ctx 3504 return c 3505} 3506 3507// Header returns an http.Header that can be modified by the caller to 3508// add HTTP headers to the request. 3509func (c *ProjectsNotesDeleteCall) Header() http.Header { 3510 if c.header_ == nil { 3511 c.header_ = make(http.Header) 3512 } 3513 return c.header_ 3514} 3515 3516func (c *ProjectsNotesDeleteCall) doRequest(alt string) (*http.Response, error) { 3517 reqHeaders := make(http.Header) 3518 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210410") 3519 for k, v := range c.header_ { 3520 reqHeaders[k] = v 3521 } 3522 reqHeaders.Set("User-Agent", c.s.userAgent()) 3523 var body io.Reader = nil 3524 c.urlParams_.Set("alt", alt) 3525 c.urlParams_.Set("prettyPrint", "false") 3526 urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+name}") 3527 urls += "?" + c.urlParams_.Encode() 3528 req, err := http.NewRequest("DELETE", urls, body) 3529 if err != nil { 3530 return nil, err 3531 } 3532 req.Header = reqHeaders 3533 googleapi.Expand(req.URL, map[string]string{ 3534 "name": c.name, 3535 }) 3536 return gensupport.SendRequest(c.ctx_, c.s.client, req) 3537} 3538 3539// Do executes the "containeranalysis.projects.notes.delete" call. 3540// Exactly one of *Empty or error will be non-nil. Any non-2xx status 3541// code is an error. Response headers are in either 3542// *Empty.ServerResponse.Header or (if a response was returned at all) 3543// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 3544// check whether the returned error was because http.StatusNotModified 3545// was returned. 3546func (c *ProjectsNotesDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) { 3547 gensupport.SetOptions(c.urlParams_, opts...) 3548 res, err := c.doRequest("json") 3549 if res != nil && res.StatusCode == http.StatusNotModified { 3550 if res.Body != nil { 3551 res.Body.Close() 3552 } 3553 return nil, &googleapi.Error{ 3554 Code: res.StatusCode, 3555 Header: res.Header, 3556 } 3557 } 3558 if err != nil { 3559 return nil, err 3560 } 3561 defer googleapi.CloseBody(res) 3562 if err := googleapi.CheckResponse(res); err != nil { 3563 return nil, err 3564 } 3565 ret := &Empty{ 3566 ServerResponse: googleapi.ServerResponse{ 3567 Header: res.Header, 3568 HTTPStatusCode: res.StatusCode, 3569 }, 3570 } 3571 target := &ret 3572 if err := gensupport.DecodeResponse(target, res); err != nil { 3573 return nil, err 3574 } 3575 return ret, nil 3576 // { 3577 // "description": "Deletes the given `Note` from the system.", 3578 // "flatPath": "v1alpha1/projects/{projectsId}/notes/{notesId}", 3579 // "httpMethod": "DELETE", 3580 // "id": "containeranalysis.projects.notes.delete", 3581 // "parameterOrder": [ 3582 // "name" 3583 // ], 3584 // "parameters": { 3585 // "name": { 3586 // "description": "The name of the note in the form of \"providers/{provider_id}/notes/{NOTE_ID}\"", 3587 // "location": "path", 3588 // "pattern": "^projects/[^/]+/notes/[^/]+$", 3589 // "required": true, 3590 // "type": "string" 3591 // } 3592 // }, 3593 // "path": "v1alpha1/{+name}", 3594 // "response": { 3595 // "$ref": "Empty" 3596 // }, 3597 // "scopes": [ 3598 // "https://www.googleapis.com/auth/cloud-platform" 3599 // ] 3600 // } 3601 3602} 3603 3604// method id "containeranalysis.projects.notes.get": 3605 3606type ProjectsNotesGetCall struct { 3607 s *Service 3608 name string 3609 urlParams_ gensupport.URLParams 3610 ifNoneMatch_ string 3611 ctx_ context.Context 3612 header_ http.Header 3613} 3614 3615// Get: Returns the requested `Note`. 3616// 3617// - name: The name of the note in the form of 3618// "providers/{provider_id}/notes/{NOTE_ID}". 3619func (r *ProjectsNotesService) Get(name string) *ProjectsNotesGetCall { 3620 c := &ProjectsNotesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 3621 c.name = name 3622 return c 3623} 3624 3625// Fields allows partial responses to be retrieved. See 3626// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 3627// for more information. 3628func (c *ProjectsNotesGetCall) Fields(s ...googleapi.Field) *ProjectsNotesGetCall { 3629 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 3630 return c 3631} 3632 3633// IfNoneMatch sets the optional parameter which makes the operation 3634// fail if the object's ETag matches the given value. This is useful for 3635// getting updates only after the object has changed since the last 3636// request. Use googleapi.IsNotModified to check whether the response 3637// error from Do is the result of In-None-Match. 3638func (c *ProjectsNotesGetCall) IfNoneMatch(entityTag string) *ProjectsNotesGetCall { 3639 c.ifNoneMatch_ = entityTag 3640 return c 3641} 3642 3643// Context sets the context to be used in this call's Do method. Any 3644// pending HTTP request will be aborted if the provided context is 3645// canceled. 3646func (c *ProjectsNotesGetCall) Context(ctx context.Context) *ProjectsNotesGetCall { 3647 c.ctx_ = ctx 3648 return c 3649} 3650 3651// Header returns an http.Header that can be modified by the caller to 3652// add HTTP headers to the request. 3653func (c *ProjectsNotesGetCall) Header() http.Header { 3654 if c.header_ == nil { 3655 c.header_ = make(http.Header) 3656 } 3657 return c.header_ 3658} 3659 3660func (c *ProjectsNotesGetCall) doRequest(alt string) (*http.Response, error) { 3661 reqHeaders := make(http.Header) 3662 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210410") 3663 for k, v := range c.header_ { 3664 reqHeaders[k] = v 3665 } 3666 reqHeaders.Set("User-Agent", c.s.userAgent()) 3667 if c.ifNoneMatch_ != "" { 3668 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 3669 } 3670 var body io.Reader = nil 3671 c.urlParams_.Set("alt", alt) 3672 c.urlParams_.Set("prettyPrint", "false") 3673 urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+name}") 3674 urls += "?" + c.urlParams_.Encode() 3675 req, err := http.NewRequest("GET", urls, body) 3676 if err != nil { 3677 return nil, err 3678 } 3679 req.Header = reqHeaders 3680 googleapi.Expand(req.URL, map[string]string{ 3681 "name": c.name, 3682 }) 3683 return gensupport.SendRequest(c.ctx_, c.s.client, req) 3684} 3685 3686// Do executes the "containeranalysis.projects.notes.get" call. 3687// Exactly one of *Note or error will be non-nil. Any non-2xx status 3688// code is an error. Response headers are in either 3689// *Note.ServerResponse.Header or (if a response was returned at all) in 3690// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 3691// whether the returned error was because http.StatusNotModified was 3692// returned. 3693func (c *ProjectsNotesGetCall) Do(opts ...googleapi.CallOption) (*Note, error) { 3694 gensupport.SetOptions(c.urlParams_, opts...) 3695 res, err := c.doRequest("json") 3696 if res != nil && res.StatusCode == http.StatusNotModified { 3697 if res.Body != nil { 3698 res.Body.Close() 3699 } 3700 return nil, &googleapi.Error{ 3701 Code: res.StatusCode, 3702 Header: res.Header, 3703 } 3704 } 3705 if err != nil { 3706 return nil, err 3707 } 3708 defer googleapi.CloseBody(res) 3709 if err := googleapi.CheckResponse(res); err != nil { 3710 return nil, err 3711 } 3712 ret := &Note{ 3713 ServerResponse: googleapi.ServerResponse{ 3714 Header: res.Header, 3715 HTTPStatusCode: res.StatusCode, 3716 }, 3717 } 3718 target := &ret 3719 if err := gensupport.DecodeResponse(target, res); err != nil { 3720 return nil, err 3721 } 3722 return ret, nil 3723 // { 3724 // "description": "Returns the requested `Note`.", 3725 // "flatPath": "v1alpha1/projects/{projectsId}/notes/{notesId}", 3726 // "httpMethod": "GET", 3727 // "id": "containeranalysis.projects.notes.get", 3728 // "parameterOrder": [ 3729 // "name" 3730 // ], 3731 // "parameters": { 3732 // "name": { 3733 // "description": "The name of the note in the form of \"providers/{provider_id}/notes/{NOTE_ID}\"", 3734 // "location": "path", 3735 // "pattern": "^projects/[^/]+/notes/[^/]+$", 3736 // "required": true, 3737 // "type": "string" 3738 // } 3739 // }, 3740 // "path": "v1alpha1/{+name}", 3741 // "response": { 3742 // "$ref": "Note" 3743 // }, 3744 // "scopes": [ 3745 // "https://www.googleapis.com/auth/cloud-platform" 3746 // ] 3747 // } 3748 3749} 3750 3751// method id "containeranalysis.projects.notes.getIamPolicy": 3752 3753type ProjectsNotesGetIamPolicyCall struct { 3754 s *Service 3755 resource string 3756 getiampolicyrequest *GetIamPolicyRequest 3757 urlParams_ gensupport.URLParams 3758 ctx_ context.Context 3759 header_ http.Header 3760} 3761 3762// GetIamPolicy: Gets the access control policy for a note or an 3763// `Occurrence` resource. Requires 3764// `containeranalysis.notes.setIamPolicy` or 3765// `containeranalysis.occurrences.setIamPolicy` permission if the 3766// resource is a note or occurrence, respectively. Attempting to call 3767// this method on a resource without the required permission will result 3768// in a `PERMISSION_DENIED` error. Attempting to call this method on a 3769// non-existent resource will result in a `NOT_FOUND` error if the user 3770// has list permission on the project, or a `PERMISSION_DENIED` error 3771// otherwise. The resource takes the following formats: 3772// `projects/{PROJECT_ID}/occurrences/{OCCURRENCE_ID}` for occurrences 3773// and projects/{PROJECT_ID}/notes/{NOTE_ID} for notes 3774// 3775// - resource: REQUIRED: The resource for which the policy is being 3776// requested. See the operation documentation for the appropriate 3777// value for this field. 3778func (r *ProjectsNotesService) GetIamPolicy(resource string, getiampolicyrequest *GetIamPolicyRequest) *ProjectsNotesGetIamPolicyCall { 3779 c := &ProjectsNotesGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)} 3780 c.resource = resource 3781 c.getiampolicyrequest = getiampolicyrequest 3782 return c 3783} 3784 3785// Fields allows partial responses to be retrieved. See 3786// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 3787// for more information. 3788func (c *ProjectsNotesGetIamPolicyCall) Fields(s ...googleapi.Field) *ProjectsNotesGetIamPolicyCall { 3789 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 3790 return c 3791} 3792 3793// Context sets the context to be used in this call's Do method. Any 3794// pending HTTP request will be aborted if the provided context is 3795// canceled. 3796func (c *ProjectsNotesGetIamPolicyCall) Context(ctx context.Context) *ProjectsNotesGetIamPolicyCall { 3797 c.ctx_ = ctx 3798 return c 3799} 3800 3801// Header returns an http.Header that can be modified by the caller to 3802// add HTTP headers to the request. 3803func (c *ProjectsNotesGetIamPolicyCall) Header() http.Header { 3804 if c.header_ == nil { 3805 c.header_ = make(http.Header) 3806 } 3807 return c.header_ 3808} 3809 3810func (c *ProjectsNotesGetIamPolicyCall) doRequest(alt string) (*http.Response, error) { 3811 reqHeaders := make(http.Header) 3812 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210410") 3813 for k, v := range c.header_ { 3814 reqHeaders[k] = v 3815 } 3816 reqHeaders.Set("User-Agent", c.s.userAgent()) 3817 var body io.Reader = nil 3818 body, err := googleapi.WithoutDataWrapper.JSONReader(c.getiampolicyrequest) 3819 if err != nil { 3820 return nil, err 3821 } 3822 reqHeaders.Set("Content-Type", "application/json") 3823 c.urlParams_.Set("alt", alt) 3824 c.urlParams_.Set("prettyPrint", "false") 3825 urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+resource}:getIamPolicy") 3826 urls += "?" + c.urlParams_.Encode() 3827 req, err := http.NewRequest("POST", urls, body) 3828 if err != nil { 3829 return nil, err 3830 } 3831 req.Header = reqHeaders 3832 googleapi.Expand(req.URL, map[string]string{ 3833 "resource": c.resource, 3834 }) 3835 return gensupport.SendRequest(c.ctx_, c.s.client, req) 3836} 3837 3838// Do executes the "containeranalysis.projects.notes.getIamPolicy" call. 3839// Exactly one of *Policy or error will be non-nil. Any non-2xx status 3840// code is an error. Response headers are in either 3841// *Policy.ServerResponse.Header or (if a response was returned at all) 3842// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 3843// check whether the returned error was because http.StatusNotModified 3844// was returned. 3845func (c *ProjectsNotesGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) { 3846 gensupport.SetOptions(c.urlParams_, opts...) 3847 res, err := c.doRequest("json") 3848 if res != nil && res.StatusCode == http.StatusNotModified { 3849 if res.Body != nil { 3850 res.Body.Close() 3851 } 3852 return nil, &googleapi.Error{ 3853 Code: res.StatusCode, 3854 Header: res.Header, 3855 } 3856 } 3857 if err != nil { 3858 return nil, err 3859 } 3860 defer googleapi.CloseBody(res) 3861 if err := googleapi.CheckResponse(res); err != nil { 3862 return nil, err 3863 } 3864 ret := &Policy{ 3865 ServerResponse: googleapi.ServerResponse{ 3866 Header: res.Header, 3867 HTTPStatusCode: res.StatusCode, 3868 }, 3869 } 3870 target := &ret 3871 if err := gensupport.DecodeResponse(target, res); err != nil { 3872 return nil, err 3873 } 3874 return ret, nil 3875 // { 3876 // "description": "Gets the access control policy for a note or an `Occurrence` resource. Requires `containeranalysis.notes.setIamPolicy` or `containeranalysis.occurrences.setIamPolicy` permission if the resource is a note or occurrence, respectively. Attempting to call this method on a resource without the required permission will result in a `PERMISSION_DENIED` error. Attempting to call this method on a non-existent resource will result in a `NOT_FOUND` error if the user has list permission on the project, or a `PERMISSION_DENIED` error otherwise. The resource takes the following formats: `projects/{PROJECT_ID}/occurrences/{OCCURRENCE_ID}` for occurrences and projects/{PROJECT_ID}/notes/{NOTE_ID} for notes", 3877 // "flatPath": "v1alpha1/projects/{projectsId}/notes/{notesId}:getIamPolicy", 3878 // "httpMethod": "POST", 3879 // "id": "containeranalysis.projects.notes.getIamPolicy", 3880 // "parameterOrder": [ 3881 // "resource" 3882 // ], 3883 // "parameters": { 3884 // "resource": { 3885 // "description": "REQUIRED: The resource for which the policy is being requested. See the operation documentation for the appropriate value for this field.", 3886 // "location": "path", 3887 // "pattern": "^projects/[^/]+/notes/[^/]+$", 3888 // "required": true, 3889 // "type": "string" 3890 // } 3891 // }, 3892 // "path": "v1alpha1/{+resource}:getIamPolicy", 3893 // "request": { 3894 // "$ref": "GetIamPolicyRequest" 3895 // }, 3896 // "response": { 3897 // "$ref": "Policy" 3898 // }, 3899 // "scopes": [ 3900 // "https://www.googleapis.com/auth/cloud-platform" 3901 // ] 3902 // } 3903 3904} 3905 3906// method id "containeranalysis.projects.notes.list": 3907 3908type ProjectsNotesListCall struct { 3909 s *Service 3910 parent string 3911 urlParams_ gensupport.URLParams 3912 ifNoneMatch_ string 3913 ctx_ context.Context 3914 header_ http.Header 3915} 3916 3917// List: Lists all `Notes` for a given project. 3918// 3919// - parent: This field contains the project Id for example: 3920// "projects/{PROJECT_ID}". 3921func (r *ProjectsNotesService) List(parent string) *ProjectsNotesListCall { 3922 c := &ProjectsNotesListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 3923 c.parent = parent 3924 return c 3925} 3926 3927// Filter sets the optional parameter "filter": The filter expression. 3928func (c *ProjectsNotesListCall) Filter(filter string) *ProjectsNotesListCall { 3929 c.urlParams_.Set("filter", filter) 3930 return c 3931} 3932 3933// Name sets the optional parameter "name": The name field will contain 3934// the project Id for example: "providers/{provider_id} @Deprecated 3935func (c *ProjectsNotesListCall) Name(name string) *ProjectsNotesListCall { 3936 c.urlParams_.Set("name", name) 3937 return c 3938} 3939 3940// PageSize sets the optional parameter "pageSize": Number of notes to 3941// return in the list. 3942func (c *ProjectsNotesListCall) PageSize(pageSize int64) *ProjectsNotesListCall { 3943 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) 3944 return c 3945} 3946 3947// PageToken sets the optional parameter "pageToken": Token to provide 3948// to skip to a particular spot in the list. 3949func (c *ProjectsNotesListCall) PageToken(pageToken string) *ProjectsNotesListCall { 3950 c.urlParams_.Set("pageToken", pageToken) 3951 return c 3952} 3953 3954// Fields allows partial responses to be retrieved. See 3955// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 3956// for more information. 3957func (c *ProjectsNotesListCall) Fields(s ...googleapi.Field) *ProjectsNotesListCall { 3958 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 3959 return c 3960} 3961 3962// IfNoneMatch sets the optional parameter which makes the operation 3963// fail if the object's ETag matches the given value. This is useful for 3964// getting updates only after the object has changed since the last 3965// request. Use googleapi.IsNotModified to check whether the response 3966// error from Do is the result of In-None-Match. 3967func (c *ProjectsNotesListCall) IfNoneMatch(entityTag string) *ProjectsNotesListCall { 3968 c.ifNoneMatch_ = entityTag 3969 return c 3970} 3971 3972// Context sets the context to be used in this call's Do method. Any 3973// pending HTTP request will be aborted if the provided context is 3974// canceled. 3975func (c *ProjectsNotesListCall) Context(ctx context.Context) *ProjectsNotesListCall { 3976 c.ctx_ = ctx 3977 return c 3978} 3979 3980// Header returns an http.Header that can be modified by the caller to 3981// add HTTP headers to the request. 3982func (c *ProjectsNotesListCall) Header() http.Header { 3983 if c.header_ == nil { 3984 c.header_ = make(http.Header) 3985 } 3986 return c.header_ 3987} 3988 3989func (c *ProjectsNotesListCall) doRequest(alt string) (*http.Response, error) { 3990 reqHeaders := make(http.Header) 3991 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210410") 3992 for k, v := range c.header_ { 3993 reqHeaders[k] = v 3994 } 3995 reqHeaders.Set("User-Agent", c.s.userAgent()) 3996 if c.ifNoneMatch_ != "" { 3997 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 3998 } 3999 var body io.Reader = nil 4000 c.urlParams_.Set("alt", alt) 4001 c.urlParams_.Set("prettyPrint", "false") 4002 urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+parent}/notes") 4003 urls += "?" + c.urlParams_.Encode() 4004 req, err := http.NewRequest("GET", urls, body) 4005 if err != nil { 4006 return nil, err 4007 } 4008 req.Header = reqHeaders 4009 googleapi.Expand(req.URL, map[string]string{ 4010 "parent": c.parent, 4011 }) 4012 return gensupport.SendRequest(c.ctx_, c.s.client, req) 4013} 4014 4015// Do executes the "containeranalysis.projects.notes.list" call. 4016// Exactly one of *ListNotesResponse or error will be non-nil. Any 4017// non-2xx status code is an error. Response headers are in either 4018// *ListNotesResponse.ServerResponse.Header or (if a response was 4019// returned at all) in error.(*googleapi.Error).Header. Use 4020// googleapi.IsNotModified to check whether the returned error was 4021// because http.StatusNotModified was returned. 4022func (c *ProjectsNotesListCall) Do(opts ...googleapi.CallOption) (*ListNotesResponse, error) { 4023 gensupport.SetOptions(c.urlParams_, opts...) 4024 res, err := c.doRequest("json") 4025 if res != nil && res.StatusCode == http.StatusNotModified { 4026 if res.Body != nil { 4027 res.Body.Close() 4028 } 4029 return nil, &googleapi.Error{ 4030 Code: res.StatusCode, 4031 Header: res.Header, 4032 } 4033 } 4034 if err != nil { 4035 return nil, err 4036 } 4037 defer googleapi.CloseBody(res) 4038 if err := googleapi.CheckResponse(res); err != nil { 4039 return nil, err 4040 } 4041 ret := &ListNotesResponse{ 4042 ServerResponse: googleapi.ServerResponse{ 4043 Header: res.Header, 4044 HTTPStatusCode: res.StatusCode, 4045 }, 4046 } 4047 target := &ret 4048 if err := gensupport.DecodeResponse(target, res); err != nil { 4049 return nil, err 4050 } 4051 return ret, nil 4052 // { 4053 // "description": "Lists all `Notes` for a given project.", 4054 // "flatPath": "v1alpha1/projects/{projectsId}/notes", 4055 // "httpMethod": "GET", 4056 // "id": "containeranalysis.projects.notes.list", 4057 // "parameterOrder": [ 4058 // "parent" 4059 // ], 4060 // "parameters": { 4061 // "filter": { 4062 // "description": "The filter expression.", 4063 // "location": "query", 4064 // "type": "string" 4065 // }, 4066 // "name": { 4067 // "description": "The name field will contain the project Id for example: \"providers/{provider_id} @Deprecated", 4068 // "location": "query", 4069 // "type": "string" 4070 // }, 4071 // "pageSize": { 4072 // "description": "Number of notes to return in the list.", 4073 // "format": "int32", 4074 // "location": "query", 4075 // "type": "integer" 4076 // }, 4077 // "pageToken": { 4078 // "description": "Token to provide to skip to a particular spot in the list.", 4079 // "location": "query", 4080 // "type": "string" 4081 // }, 4082 // "parent": { 4083 // "description": "This field contains the project Id for example: \"projects/{PROJECT_ID}\".", 4084 // "location": "path", 4085 // "pattern": "^projects/[^/]+$", 4086 // "required": true, 4087 // "type": "string" 4088 // } 4089 // }, 4090 // "path": "v1alpha1/{+parent}/notes", 4091 // "response": { 4092 // "$ref": "ListNotesResponse" 4093 // }, 4094 // "scopes": [ 4095 // "https://www.googleapis.com/auth/cloud-platform" 4096 // ] 4097 // } 4098 4099} 4100 4101// Pages invokes f for each page of results. 4102// A non-nil error returned from f will halt the iteration. 4103// The provided context supersedes any context provided to the Context method. 4104func (c *ProjectsNotesListCall) Pages(ctx context.Context, f func(*ListNotesResponse) error) error { 4105 c.ctx_ = ctx 4106 defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point 4107 for { 4108 x, err := c.Do() 4109 if err != nil { 4110 return err 4111 } 4112 if err := f(x); err != nil { 4113 return err 4114 } 4115 if x.NextPageToken == "" { 4116 return nil 4117 } 4118 c.PageToken(x.NextPageToken) 4119 } 4120} 4121 4122// method id "containeranalysis.projects.notes.patch": 4123 4124type ProjectsNotesPatchCall struct { 4125 s *Service 4126 name string 4127 note *Note 4128 urlParams_ gensupport.URLParams 4129 ctx_ context.Context 4130 header_ http.Header 4131} 4132 4133// Patch: Updates an existing `Note`. 4134// 4135// - name: The name of the note. Should be of the form 4136// "projects/{provider_id}/notes/{note_id}". 4137func (r *ProjectsNotesService) Patch(name string, note *Note) *ProjectsNotesPatchCall { 4138 c := &ProjectsNotesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} 4139 c.name = name 4140 c.note = note 4141 return c 4142} 4143 4144// UpdateMask sets the optional parameter "updateMask": The fields to 4145// update. 4146func (c *ProjectsNotesPatchCall) UpdateMask(updateMask string) *ProjectsNotesPatchCall { 4147 c.urlParams_.Set("updateMask", updateMask) 4148 return c 4149} 4150 4151// Fields allows partial responses to be retrieved. See 4152// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 4153// for more information. 4154func (c *ProjectsNotesPatchCall) Fields(s ...googleapi.Field) *ProjectsNotesPatchCall { 4155 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 4156 return c 4157} 4158 4159// Context sets the context to be used in this call's Do method. Any 4160// pending HTTP request will be aborted if the provided context is 4161// canceled. 4162func (c *ProjectsNotesPatchCall) Context(ctx context.Context) *ProjectsNotesPatchCall { 4163 c.ctx_ = ctx 4164 return c 4165} 4166 4167// Header returns an http.Header that can be modified by the caller to 4168// add HTTP headers to the request. 4169func (c *ProjectsNotesPatchCall) Header() http.Header { 4170 if c.header_ == nil { 4171 c.header_ = make(http.Header) 4172 } 4173 return c.header_ 4174} 4175 4176func (c *ProjectsNotesPatchCall) doRequest(alt string) (*http.Response, error) { 4177 reqHeaders := make(http.Header) 4178 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210410") 4179 for k, v := range c.header_ { 4180 reqHeaders[k] = v 4181 } 4182 reqHeaders.Set("User-Agent", c.s.userAgent()) 4183 var body io.Reader = nil 4184 body, err := googleapi.WithoutDataWrapper.JSONReader(c.note) 4185 if err != nil { 4186 return nil, err 4187 } 4188 reqHeaders.Set("Content-Type", "application/json") 4189 c.urlParams_.Set("alt", alt) 4190 c.urlParams_.Set("prettyPrint", "false") 4191 urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+name}") 4192 urls += "?" + c.urlParams_.Encode() 4193 req, err := http.NewRequest("PATCH", urls, body) 4194 if err != nil { 4195 return nil, err 4196 } 4197 req.Header = reqHeaders 4198 googleapi.Expand(req.URL, map[string]string{ 4199 "name": c.name, 4200 }) 4201 return gensupport.SendRequest(c.ctx_, c.s.client, req) 4202} 4203 4204// Do executes the "containeranalysis.projects.notes.patch" call. 4205// Exactly one of *Note or error will be non-nil. Any non-2xx status 4206// code is an error. Response headers are in either 4207// *Note.ServerResponse.Header or (if a response was returned at all) in 4208// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 4209// whether the returned error was because http.StatusNotModified was 4210// returned. 4211func (c *ProjectsNotesPatchCall) Do(opts ...googleapi.CallOption) (*Note, error) { 4212 gensupport.SetOptions(c.urlParams_, opts...) 4213 res, err := c.doRequest("json") 4214 if res != nil && res.StatusCode == http.StatusNotModified { 4215 if res.Body != nil { 4216 res.Body.Close() 4217 } 4218 return nil, &googleapi.Error{ 4219 Code: res.StatusCode, 4220 Header: res.Header, 4221 } 4222 } 4223 if err != nil { 4224 return nil, err 4225 } 4226 defer googleapi.CloseBody(res) 4227 if err := googleapi.CheckResponse(res); err != nil { 4228 return nil, err 4229 } 4230 ret := &Note{ 4231 ServerResponse: googleapi.ServerResponse{ 4232 Header: res.Header, 4233 HTTPStatusCode: res.StatusCode, 4234 }, 4235 } 4236 target := &ret 4237 if err := gensupport.DecodeResponse(target, res); err != nil { 4238 return nil, err 4239 } 4240 return ret, nil 4241 // { 4242 // "description": "Updates an existing `Note`.", 4243 // "flatPath": "v1alpha1/projects/{projectsId}/notes/{notesId}", 4244 // "httpMethod": "PATCH", 4245 // "id": "containeranalysis.projects.notes.patch", 4246 // "parameterOrder": [ 4247 // "name" 4248 // ], 4249 // "parameters": { 4250 // "name": { 4251 // "description": "The name of the note. Should be of the form \"projects/{provider_id}/notes/{note_id}\".", 4252 // "location": "path", 4253 // "pattern": "^projects/[^/]+/notes/[^/]+$", 4254 // "required": true, 4255 // "type": "string" 4256 // }, 4257 // "updateMask": { 4258 // "description": "The fields to update.", 4259 // "format": "google-fieldmask", 4260 // "location": "query", 4261 // "type": "string" 4262 // } 4263 // }, 4264 // "path": "v1alpha1/{+name}", 4265 // "request": { 4266 // "$ref": "Note" 4267 // }, 4268 // "response": { 4269 // "$ref": "Note" 4270 // }, 4271 // "scopes": [ 4272 // "https://www.googleapis.com/auth/cloud-platform" 4273 // ] 4274 // } 4275 4276} 4277 4278// method id "containeranalysis.projects.notes.setIamPolicy": 4279 4280type ProjectsNotesSetIamPolicyCall struct { 4281 s *Service 4282 resource string 4283 setiampolicyrequest *SetIamPolicyRequest 4284 urlParams_ gensupport.URLParams 4285 ctx_ context.Context 4286 header_ http.Header 4287} 4288 4289// SetIamPolicy: Sets the access control policy on the specified `Note` 4290// or `Occurrence`. Requires `containeranalysis.notes.setIamPolicy` or 4291// `containeranalysis.occurrences.setIamPolicy` permission if the 4292// resource is a `Note` or an `Occurrence`, respectively. Attempting to 4293// call this method without these permissions will result in a ` 4294// `PERMISSION_DENIED` error. Attempting to call this method on a 4295// non-existent resource will result in a `NOT_FOUND` error if the user 4296// has `containeranalysis.notes.list` permission on a `Note` or 4297// `containeranalysis.occurrences.list` on an `Occurrence`, or a 4298// `PERMISSION_DENIED` error otherwise. The resource takes the following 4299// formats: `projects/{projectid}/occurrences/{occurrenceid}` for 4300// occurrences and projects/{projectid}/notes/{noteid} for notes 4301// 4302// - resource: REQUIRED: The resource for which the policy is being 4303// specified. See the operation documentation for the appropriate 4304// value for this field. 4305func (r *ProjectsNotesService) SetIamPolicy(resource string, setiampolicyrequest *SetIamPolicyRequest) *ProjectsNotesSetIamPolicyCall { 4306 c := &ProjectsNotesSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)} 4307 c.resource = resource 4308 c.setiampolicyrequest = setiampolicyrequest 4309 return c 4310} 4311 4312// Fields allows partial responses to be retrieved. See 4313// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 4314// for more information. 4315func (c *ProjectsNotesSetIamPolicyCall) Fields(s ...googleapi.Field) *ProjectsNotesSetIamPolicyCall { 4316 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 4317 return c 4318} 4319 4320// Context sets the context to be used in this call's Do method. Any 4321// pending HTTP request will be aborted if the provided context is 4322// canceled. 4323func (c *ProjectsNotesSetIamPolicyCall) Context(ctx context.Context) *ProjectsNotesSetIamPolicyCall { 4324 c.ctx_ = ctx 4325 return c 4326} 4327 4328// Header returns an http.Header that can be modified by the caller to 4329// add HTTP headers to the request. 4330func (c *ProjectsNotesSetIamPolicyCall) Header() http.Header { 4331 if c.header_ == nil { 4332 c.header_ = make(http.Header) 4333 } 4334 return c.header_ 4335} 4336 4337func (c *ProjectsNotesSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { 4338 reqHeaders := make(http.Header) 4339 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210410") 4340 for k, v := range c.header_ { 4341 reqHeaders[k] = v 4342 } 4343 reqHeaders.Set("User-Agent", c.s.userAgent()) 4344 var body io.Reader = nil 4345 body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest) 4346 if err != nil { 4347 return nil, err 4348 } 4349 reqHeaders.Set("Content-Type", "application/json") 4350 c.urlParams_.Set("alt", alt) 4351 c.urlParams_.Set("prettyPrint", "false") 4352 urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+resource}:setIamPolicy") 4353 urls += "?" + c.urlParams_.Encode() 4354 req, err := http.NewRequest("POST", urls, body) 4355 if err != nil { 4356 return nil, err 4357 } 4358 req.Header = reqHeaders 4359 googleapi.Expand(req.URL, map[string]string{ 4360 "resource": c.resource, 4361 }) 4362 return gensupport.SendRequest(c.ctx_, c.s.client, req) 4363} 4364 4365// Do executes the "containeranalysis.projects.notes.setIamPolicy" call. 4366// Exactly one of *Policy or error will be non-nil. Any non-2xx status 4367// code is an error. Response headers are in either 4368// *Policy.ServerResponse.Header or (if a response was returned at all) 4369// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 4370// check whether the returned error was because http.StatusNotModified 4371// was returned. 4372func (c *ProjectsNotesSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) { 4373 gensupport.SetOptions(c.urlParams_, opts...) 4374 res, err := c.doRequest("json") 4375 if res != nil && res.StatusCode == http.StatusNotModified { 4376 if res.Body != nil { 4377 res.Body.Close() 4378 } 4379 return nil, &googleapi.Error{ 4380 Code: res.StatusCode, 4381 Header: res.Header, 4382 } 4383 } 4384 if err != nil { 4385 return nil, err 4386 } 4387 defer googleapi.CloseBody(res) 4388 if err := googleapi.CheckResponse(res); err != nil { 4389 return nil, err 4390 } 4391 ret := &Policy{ 4392 ServerResponse: googleapi.ServerResponse{ 4393 Header: res.Header, 4394 HTTPStatusCode: res.StatusCode, 4395 }, 4396 } 4397 target := &ret 4398 if err := gensupport.DecodeResponse(target, res); err != nil { 4399 return nil, err 4400 } 4401 return ret, nil 4402 // { 4403 // "description": "Sets the access control policy on the specified `Note` or `Occurrence`. Requires `containeranalysis.notes.setIamPolicy` or `containeranalysis.occurrences.setIamPolicy` permission if the resource is a `Note` or an `Occurrence`, respectively. Attempting to call this method without these permissions will result in a ` `PERMISSION_DENIED` error. Attempting to call this method on a non-existent resource will result in a `NOT_FOUND` error if the user has `containeranalysis.notes.list` permission on a `Note` or `containeranalysis.occurrences.list` on an `Occurrence`, or a `PERMISSION_DENIED` error otherwise. The resource takes the following formats: `projects/{projectid}/occurrences/{occurrenceid}` for occurrences and projects/{projectid}/notes/{noteid} for notes", 4404 // "flatPath": "v1alpha1/projects/{projectsId}/notes/{notesId}:setIamPolicy", 4405 // "httpMethod": "POST", 4406 // "id": "containeranalysis.projects.notes.setIamPolicy", 4407 // "parameterOrder": [ 4408 // "resource" 4409 // ], 4410 // "parameters": { 4411 // "resource": { 4412 // "description": "REQUIRED: The resource for which the policy is being specified. See the operation documentation for the appropriate value for this field.", 4413 // "location": "path", 4414 // "pattern": "^projects/[^/]+/notes/[^/]+$", 4415 // "required": true, 4416 // "type": "string" 4417 // } 4418 // }, 4419 // "path": "v1alpha1/{+resource}:setIamPolicy", 4420 // "request": { 4421 // "$ref": "SetIamPolicyRequest" 4422 // }, 4423 // "response": { 4424 // "$ref": "Policy" 4425 // }, 4426 // "scopes": [ 4427 // "https://www.googleapis.com/auth/cloud-platform" 4428 // ] 4429 // } 4430 4431} 4432 4433// method id "containeranalysis.projects.notes.testIamPermissions": 4434 4435type ProjectsNotesTestIamPermissionsCall struct { 4436 s *Service 4437 resource string 4438 testiampermissionsrequest *TestIamPermissionsRequest 4439 urlParams_ gensupport.URLParams 4440 ctx_ context.Context 4441 header_ http.Header 4442} 4443 4444// TestIamPermissions: Returns the permissions that a caller has on the 4445// specified note or occurrence resource. Requires list permission on 4446// the project (for example, "storage.objects.list" on the containing 4447// bucket for testing permission of an object). Attempting to call this 4448// method on a non-existent resource will result in a `NOT_FOUND` error 4449// if the user has list permission on the project, or a 4450// `PERMISSION_DENIED` error otherwise. The resource takes the following 4451// formats: `projects/{PROJECT_ID}/occurrences/{OCCURRENCE_ID}` for 4452// `Occurrences` and `projects/{PROJECT_ID}/notes/{NOTE_ID}` for `Notes` 4453// 4454// - resource: REQUIRED: The resource for which the policy detail is 4455// being requested. See the operation documentation for the 4456// appropriate value for this field. 4457func (r *ProjectsNotesService) TestIamPermissions(resource string, testiampermissionsrequest *TestIamPermissionsRequest) *ProjectsNotesTestIamPermissionsCall { 4458 c := &ProjectsNotesTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)} 4459 c.resource = resource 4460 c.testiampermissionsrequest = testiampermissionsrequest 4461 return c 4462} 4463 4464// Fields allows partial responses to be retrieved. See 4465// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 4466// for more information. 4467func (c *ProjectsNotesTestIamPermissionsCall) Fields(s ...googleapi.Field) *ProjectsNotesTestIamPermissionsCall { 4468 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 4469 return c 4470} 4471 4472// Context sets the context to be used in this call's Do method. Any 4473// pending HTTP request will be aborted if the provided context is 4474// canceled. 4475func (c *ProjectsNotesTestIamPermissionsCall) Context(ctx context.Context) *ProjectsNotesTestIamPermissionsCall { 4476 c.ctx_ = ctx 4477 return c 4478} 4479 4480// Header returns an http.Header that can be modified by the caller to 4481// add HTTP headers to the request. 4482func (c *ProjectsNotesTestIamPermissionsCall) Header() http.Header { 4483 if c.header_ == nil { 4484 c.header_ = make(http.Header) 4485 } 4486 return c.header_ 4487} 4488 4489func (c *ProjectsNotesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { 4490 reqHeaders := make(http.Header) 4491 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210410") 4492 for k, v := range c.header_ { 4493 reqHeaders[k] = v 4494 } 4495 reqHeaders.Set("User-Agent", c.s.userAgent()) 4496 var body io.Reader = nil 4497 body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest) 4498 if err != nil { 4499 return nil, err 4500 } 4501 reqHeaders.Set("Content-Type", "application/json") 4502 c.urlParams_.Set("alt", alt) 4503 c.urlParams_.Set("prettyPrint", "false") 4504 urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+resource}:testIamPermissions") 4505 urls += "?" + c.urlParams_.Encode() 4506 req, err := http.NewRequest("POST", urls, body) 4507 if err != nil { 4508 return nil, err 4509 } 4510 req.Header = reqHeaders 4511 googleapi.Expand(req.URL, map[string]string{ 4512 "resource": c.resource, 4513 }) 4514 return gensupport.SendRequest(c.ctx_, c.s.client, req) 4515} 4516 4517// Do executes the "containeranalysis.projects.notes.testIamPermissions" call. 4518// Exactly one of *TestIamPermissionsResponse or error will be non-nil. 4519// Any non-2xx status code is an error. Response headers are in either 4520// *TestIamPermissionsResponse.ServerResponse.Header or (if a response 4521// was returned at all) in error.(*googleapi.Error).Header. Use 4522// googleapi.IsNotModified to check whether the returned error was 4523// because http.StatusNotModified was returned. 4524func (c *ProjectsNotesTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestIamPermissionsResponse, error) { 4525 gensupport.SetOptions(c.urlParams_, opts...) 4526 res, err := c.doRequest("json") 4527 if res != nil && res.StatusCode == http.StatusNotModified { 4528 if res.Body != nil { 4529 res.Body.Close() 4530 } 4531 return nil, &googleapi.Error{ 4532 Code: res.StatusCode, 4533 Header: res.Header, 4534 } 4535 } 4536 if err != nil { 4537 return nil, err 4538 } 4539 defer googleapi.CloseBody(res) 4540 if err := googleapi.CheckResponse(res); err != nil { 4541 return nil, err 4542 } 4543 ret := &TestIamPermissionsResponse{ 4544 ServerResponse: googleapi.ServerResponse{ 4545 Header: res.Header, 4546 HTTPStatusCode: res.StatusCode, 4547 }, 4548 } 4549 target := &ret 4550 if err := gensupport.DecodeResponse(target, res); err != nil { 4551 return nil, err 4552 } 4553 return ret, nil 4554 // { 4555 // "description": "Returns the permissions that a caller has on the specified note or occurrence resource. Requires list permission on the project (for example, \"storage.objects.list\" on the containing bucket for testing permission of an object). Attempting to call this method on a non-existent resource will result in a `NOT_FOUND` error if the user has list permission on the project, or a `PERMISSION_DENIED` error otherwise. The resource takes the following formats: `projects/{PROJECT_ID}/occurrences/{OCCURRENCE_ID}` for `Occurrences` and `projects/{PROJECT_ID}/notes/{NOTE_ID}` for `Notes`", 4556 // "flatPath": "v1alpha1/projects/{projectsId}/notes/{notesId}:testIamPermissions", 4557 // "httpMethod": "POST", 4558 // "id": "containeranalysis.projects.notes.testIamPermissions", 4559 // "parameterOrder": [ 4560 // "resource" 4561 // ], 4562 // "parameters": { 4563 // "resource": { 4564 // "description": "REQUIRED: The resource for which the policy detail is being requested. See the operation documentation for the appropriate value for this field.", 4565 // "location": "path", 4566 // "pattern": "^projects/[^/]+/notes/[^/]+$", 4567 // "required": true, 4568 // "type": "string" 4569 // } 4570 // }, 4571 // "path": "v1alpha1/{+resource}:testIamPermissions", 4572 // "request": { 4573 // "$ref": "TestIamPermissionsRequest" 4574 // }, 4575 // "response": { 4576 // "$ref": "TestIamPermissionsResponse" 4577 // }, 4578 // "scopes": [ 4579 // "https://www.googleapis.com/auth/cloud-platform" 4580 // ] 4581 // } 4582 4583} 4584 4585// method id "containeranalysis.projects.notes.occurrences.list": 4586 4587type ProjectsNotesOccurrencesListCall struct { 4588 s *Service 4589 name string 4590 urlParams_ gensupport.URLParams 4591 ifNoneMatch_ string 4592 ctx_ context.Context 4593 header_ http.Header 4594} 4595 4596// List: Lists `Occurrences` referencing the specified `Note`. Use this 4597// method to get all occurrences referencing your `Note` across all your 4598// customer projects. 4599// 4600// - name: The name field will contain the note name for example: 4601// "provider/{provider_id}/notes/{note_id}". 4602func (r *ProjectsNotesOccurrencesService) List(name string) *ProjectsNotesOccurrencesListCall { 4603 c := &ProjectsNotesOccurrencesListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 4604 c.name = name 4605 return c 4606} 4607 4608// Filter sets the optional parameter "filter": The filter expression. 4609func (c *ProjectsNotesOccurrencesListCall) Filter(filter string) *ProjectsNotesOccurrencesListCall { 4610 c.urlParams_.Set("filter", filter) 4611 return c 4612} 4613 4614// PageSize sets the optional parameter "pageSize": Number of notes to 4615// return in the list. 4616func (c *ProjectsNotesOccurrencesListCall) PageSize(pageSize int64) *ProjectsNotesOccurrencesListCall { 4617 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) 4618 return c 4619} 4620 4621// PageToken sets the optional parameter "pageToken": Token to provide 4622// to skip to a particular spot in the list. 4623func (c *ProjectsNotesOccurrencesListCall) PageToken(pageToken string) *ProjectsNotesOccurrencesListCall { 4624 c.urlParams_.Set("pageToken", pageToken) 4625 return c 4626} 4627 4628// Fields allows partial responses to be retrieved. See 4629// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 4630// for more information. 4631func (c *ProjectsNotesOccurrencesListCall) Fields(s ...googleapi.Field) *ProjectsNotesOccurrencesListCall { 4632 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 4633 return c 4634} 4635 4636// IfNoneMatch sets the optional parameter which makes the operation 4637// fail if the object's ETag matches the given value. This is useful for 4638// getting updates only after the object has changed since the last 4639// request. Use googleapi.IsNotModified to check whether the response 4640// error from Do is the result of In-None-Match. 4641func (c *ProjectsNotesOccurrencesListCall) IfNoneMatch(entityTag string) *ProjectsNotesOccurrencesListCall { 4642 c.ifNoneMatch_ = entityTag 4643 return c 4644} 4645 4646// Context sets the context to be used in this call's Do method. Any 4647// pending HTTP request will be aborted if the provided context is 4648// canceled. 4649func (c *ProjectsNotesOccurrencesListCall) Context(ctx context.Context) *ProjectsNotesOccurrencesListCall { 4650 c.ctx_ = ctx 4651 return c 4652} 4653 4654// Header returns an http.Header that can be modified by the caller to 4655// add HTTP headers to the request. 4656func (c *ProjectsNotesOccurrencesListCall) Header() http.Header { 4657 if c.header_ == nil { 4658 c.header_ = make(http.Header) 4659 } 4660 return c.header_ 4661} 4662 4663func (c *ProjectsNotesOccurrencesListCall) doRequest(alt string) (*http.Response, error) { 4664 reqHeaders := make(http.Header) 4665 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210410") 4666 for k, v := range c.header_ { 4667 reqHeaders[k] = v 4668 } 4669 reqHeaders.Set("User-Agent", c.s.userAgent()) 4670 if c.ifNoneMatch_ != "" { 4671 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 4672 } 4673 var body io.Reader = nil 4674 c.urlParams_.Set("alt", alt) 4675 c.urlParams_.Set("prettyPrint", "false") 4676 urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+name}/occurrences") 4677 urls += "?" + c.urlParams_.Encode() 4678 req, err := http.NewRequest("GET", urls, body) 4679 if err != nil { 4680 return nil, err 4681 } 4682 req.Header = reqHeaders 4683 googleapi.Expand(req.URL, map[string]string{ 4684 "name": c.name, 4685 }) 4686 return gensupport.SendRequest(c.ctx_, c.s.client, req) 4687} 4688 4689// Do executes the "containeranalysis.projects.notes.occurrences.list" call. 4690// Exactly one of *ListNoteOccurrencesResponse or error will be non-nil. 4691// Any non-2xx status code is an error. Response headers are in either 4692// *ListNoteOccurrencesResponse.ServerResponse.Header or (if a response 4693// was returned at all) in error.(*googleapi.Error).Header. Use 4694// googleapi.IsNotModified to check whether the returned error was 4695// because http.StatusNotModified was returned. 4696func (c *ProjectsNotesOccurrencesListCall) Do(opts ...googleapi.CallOption) (*ListNoteOccurrencesResponse, error) { 4697 gensupport.SetOptions(c.urlParams_, opts...) 4698 res, err := c.doRequest("json") 4699 if res != nil && res.StatusCode == http.StatusNotModified { 4700 if res.Body != nil { 4701 res.Body.Close() 4702 } 4703 return nil, &googleapi.Error{ 4704 Code: res.StatusCode, 4705 Header: res.Header, 4706 } 4707 } 4708 if err != nil { 4709 return nil, err 4710 } 4711 defer googleapi.CloseBody(res) 4712 if err := googleapi.CheckResponse(res); err != nil { 4713 return nil, err 4714 } 4715 ret := &ListNoteOccurrencesResponse{ 4716 ServerResponse: googleapi.ServerResponse{ 4717 Header: res.Header, 4718 HTTPStatusCode: res.StatusCode, 4719 }, 4720 } 4721 target := &ret 4722 if err := gensupport.DecodeResponse(target, res); err != nil { 4723 return nil, err 4724 } 4725 return ret, nil 4726 // { 4727 // "description": "Lists `Occurrences` referencing the specified `Note`. Use this method to get all occurrences referencing your `Note` across all your customer projects.", 4728 // "flatPath": "v1alpha1/projects/{projectsId}/notes/{notesId}/occurrences", 4729 // "httpMethod": "GET", 4730 // "id": "containeranalysis.projects.notes.occurrences.list", 4731 // "parameterOrder": [ 4732 // "name" 4733 // ], 4734 // "parameters": { 4735 // "filter": { 4736 // "description": "The filter expression.", 4737 // "location": "query", 4738 // "type": "string" 4739 // }, 4740 // "name": { 4741 // "description": "The name field will contain the note name for example: \"provider/{provider_id}/notes/{note_id}\"", 4742 // "location": "path", 4743 // "pattern": "^projects/[^/]+/notes/[^/]+$", 4744 // "required": true, 4745 // "type": "string" 4746 // }, 4747 // "pageSize": { 4748 // "description": "Number of notes to return in the list.", 4749 // "format": "int32", 4750 // "location": "query", 4751 // "type": "integer" 4752 // }, 4753 // "pageToken": { 4754 // "description": "Token to provide to skip to a particular spot in the list.", 4755 // "location": "query", 4756 // "type": "string" 4757 // } 4758 // }, 4759 // "path": "v1alpha1/{+name}/occurrences", 4760 // "response": { 4761 // "$ref": "ListNoteOccurrencesResponse" 4762 // }, 4763 // "scopes": [ 4764 // "https://www.googleapis.com/auth/cloud-platform" 4765 // ] 4766 // } 4767 4768} 4769 4770// Pages invokes f for each page of results. 4771// A non-nil error returned from f will halt the iteration. 4772// The provided context supersedes any context provided to the Context method. 4773func (c *ProjectsNotesOccurrencesListCall) Pages(ctx context.Context, f func(*ListNoteOccurrencesResponse) error) error { 4774 c.ctx_ = ctx 4775 defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point 4776 for { 4777 x, err := c.Do() 4778 if err != nil { 4779 return err 4780 } 4781 if err := f(x); err != nil { 4782 return err 4783 } 4784 if x.NextPageToken == "" { 4785 return nil 4786 } 4787 c.PageToken(x.NextPageToken) 4788 } 4789} 4790 4791// method id "containeranalysis.projects.occurrences.create": 4792 4793type ProjectsOccurrencesCreateCall struct { 4794 s *Service 4795 parent string 4796 occurrence *Occurrence 4797 urlParams_ gensupport.URLParams 4798 ctx_ context.Context 4799 header_ http.Header 4800} 4801 4802// Create: Creates a new `Occurrence`. Use this method to create 4803// `Occurrences` for a resource. 4804// 4805// - parent: This field contains the project Id for example: 4806// "projects/{project_id}". 4807func (r *ProjectsOccurrencesService) Create(parent string, occurrence *Occurrence) *ProjectsOccurrencesCreateCall { 4808 c := &ProjectsOccurrencesCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 4809 c.parent = parent 4810 c.occurrence = occurrence 4811 return c 4812} 4813 4814// Name sets the optional parameter "name": The name of the project. 4815// Should be of the form "projects/{project_id}". @Deprecated 4816func (c *ProjectsOccurrencesCreateCall) Name(name string) *ProjectsOccurrencesCreateCall { 4817 c.urlParams_.Set("name", name) 4818 return c 4819} 4820 4821// Fields allows partial responses to be retrieved. See 4822// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 4823// for more information. 4824func (c *ProjectsOccurrencesCreateCall) Fields(s ...googleapi.Field) *ProjectsOccurrencesCreateCall { 4825 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 4826 return c 4827} 4828 4829// Context sets the context to be used in this call's Do method. Any 4830// pending HTTP request will be aborted if the provided context is 4831// canceled. 4832func (c *ProjectsOccurrencesCreateCall) Context(ctx context.Context) *ProjectsOccurrencesCreateCall { 4833 c.ctx_ = ctx 4834 return c 4835} 4836 4837// Header returns an http.Header that can be modified by the caller to 4838// add HTTP headers to the request. 4839func (c *ProjectsOccurrencesCreateCall) Header() http.Header { 4840 if c.header_ == nil { 4841 c.header_ = make(http.Header) 4842 } 4843 return c.header_ 4844} 4845 4846func (c *ProjectsOccurrencesCreateCall) doRequest(alt string) (*http.Response, error) { 4847 reqHeaders := make(http.Header) 4848 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210410") 4849 for k, v := range c.header_ { 4850 reqHeaders[k] = v 4851 } 4852 reqHeaders.Set("User-Agent", c.s.userAgent()) 4853 var body io.Reader = nil 4854 body, err := googleapi.WithoutDataWrapper.JSONReader(c.occurrence) 4855 if err != nil { 4856 return nil, err 4857 } 4858 reqHeaders.Set("Content-Type", "application/json") 4859 c.urlParams_.Set("alt", alt) 4860 c.urlParams_.Set("prettyPrint", "false") 4861 urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+parent}/occurrences") 4862 urls += "?" + c.urlParams_.Encode() 4863 req, err := http.NewRequest("POST", urls, body) 4864 if err != nil { 4865 return nil, err 4866 } 4867 req.Header = reqHeaders 4868 googleapi.Expand(req.URL, map[string]string{ 4869 "parent": c.parent, 4870 }) 4871 return gensupport.SendRequest(c.ctx_, c.s.client, req) 4872} 4873 4874// Do executes the "containeranalysis.projects.occurrences.create" call. 4875// Exactly one of *Occurrence or error will be non-nil. Any non-2xx 4876// status code is an error. Response headers are in either 4877// *Occurrence.ServerResponse.Header or (if a response was returned at 4878// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 4879// to check whether the returned error was because 4880// http.StatusNotModified was returned. 4881func (c *ProjectsOccurrencesCreateCall) Do(opts ...googleapi.CallOption) (*Occurrence, error) { 4882 gensupport.SetOptions(c.urlParams_, opts...) 4883 res, err := c.doRequest("json") 4884 if res != nil && res.StatusCode == http.StatusNotModified { 4885 if res.Body != nil { 4886 res.Body.Close() 4887 } 4888 return nil, &googleapi.Error{ 4889 Code: res.StatusCode, 4890 Header: res.Header, 4891 } 4892 } 4893 if err != nil { 4894 return nil, err 4895 } 4896 defer googleapi.CloseBody(res) 4897 if err := googleapi.CheckResponse(res); err != nil { 4898 return nil, err 4899 } 4900 ret := &Occurrence{ 4901 ServerResponse: googleapi.ServerResponse{ 4902 Header: res.Header, 4903 HTTPStatusCode: res.StatusCode, 4904 }, 4905 } 4906 target := &ret 4907 if err := gensupport.DecodeResponse(target, res); err != nil { 4908 return nil, err 4909 } 4910 return ret, nil 4911 // { 4912 // "description": "Creates a new `Occurrence`. Use this method to create `Occurrences` for a resource.", 4913 // "flatPath": "v1alpha1/projects/{projectsId}/occurrences", 4914 // "httpMethod": "POST", 4915 // "id": "containeranalysis.projects.occurrences.create", 4916 // "parameterOrder": [ 4917 // "parent" 4918 // ], 4919 // "parameters": { 4920 // "name": { 4921 // "description": "The name of the project. Should be of the form \"projects/{project_id}\". @Deprecated", 4922 // "location": "query", 4923 // "type": "string" 4924 // }, 4925 // "parent": { 4926 // "description": "This field contains the project Id for example: \"projects/{project_id}\"", 4927 // "location": "path", 4928 // "pattern": "^projects/[^/]+$", 4929 // "required": true, 4930 // "type": "string" 4931 // } 4932 // }, 4933 // "path": "v1alpha1/{+parent}/occurrences", 4934 // "request": { 4935 // "$ref": "Occurrence" 4936 // }, 4937 // "response": { 4938 // "$ref": "Occurrence" 4939 // }, 4940 // "scopes": [ 4941 // "https://www.googleapis.com/auth/cloud-platform" 4942 // ] 4943 // } 4944 4945} 4946 4947// method id "containeranalysis.projects.occurrences.delete": 4948 4949type ProjectsOccurrencesDeleteCall struct { 4950 s *Service 4951 name string 4952 urlParams_ gensupport.URLParams 4953 ctx_ context.Context 4954 header_ http.Header 4955} 4956 4957// Delete: Deletes the given `Occurrence` from the system. Use this when 4958// an `Occurrence` is no longer applicable for the given resource. 4959// 4960// - name: The name of the occurrence in the form of 4961// "projects/{project_id}/occurrences/{OCCURRENCE_ID}". 4962func (r *ProjectsOccurrencesService) Delete(name string) *ProjectsOccurrencesDeleteCall { 4963 c := &ProjectsOccurrencesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} 4964 c.name = name 4965 return c 4966} 4967 4968// Fields allows partial responses to be retrieved. See 4969// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 4970// for more information. 4971func (c *ProjectsOccurrencesDeleteCall) Fields(s ...googleapi.Field) *ProjectsOccurrencesDeleteCall { 4972 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 4973 return c 4974} 4975 4976// Context sets the context to be used in this call's Do method. Any 4977// pending HTTP request will be aborted if the provided context is 4978// canceled. 4979func (c *ProjectsOccurrencesDeleteCall) Context(ctx context.Context) *ProjectsOccurrencesDeleteCall { 4980 c.ctx_ = ctx 4981 return c 4982} 4983 4984// Header returns an http.Header that can be modified by the caller to 4985// add HTTP headers to the request. 4986func (c *ProjectsOccurrencesDeleteCall) Header() http.Header { 4987 if c.header_ == nil { 4988 c.header_ = make(http.Header) 4989 } 4990 return c.header_ 4991} 4992 4993func (c *ProjectsOccurrencesDeleteCall) doRequest(alt string) (*http.Response, error) { 4994 reqHeaders := make(http.Header) 4995 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210410") 4996 for k, v := range c.header_ { 4997 reqHeaders[k] = v 4998 } 4999 reqHeaders.Set("User-Agent", c.s.userAgent()) 5000 var body io.Reader = nil 5001 c.urlParams_.Set("alt", alt) 5002 c.urlParams_.Set("prettyPrint", "false") 5003 urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+name}") 5004 urls += "?" + c.urlParams_.Encode() 5005 req, err := http.NewRequest("DELETE", urls, body) 5006 if err != nil { 5007 return nil, err 5008 } 5009 req.Header = reqHeaders 5010 googleapi.Expand(req.URL, map[string]string{ 5011 "name": c.name, 5012 }) 5013 return gensupport.SendRequest(c.ctx_, c.s.client, req) 5014} 5015 5016// Do executes the "containeranalysis.projects.occurrences.delete" call. 5017// Exactly one of *Empty or error will be non-nil. Any non-2xx status 5018// code is an error. Response headers are in either 5019// *Empty.ServerResponse.Header or (if a response was returned at all) 5020// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 5021// check whether the returned error was because http.StatusNotModified 5022// was returned. 5023func (c *ProjectsOccurrencesDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) { 5024 gensupport.SetOptions(c.urlParams_, opts...) 5025 res, err := c.doRequest("json") 5026 if res != nil && res.StatusCode == http.StatusNotModified { 5027 if res.Body != nil { 5028 res.Body.Close() 5029 } 5030 return nil, &googleapi.Error{ 5031 Code: res.StatusCode, 5032 Header: res.Header, 5033 } 5034 } 5035 if err != nil { 5036 return nil, err 5037 } 5038 defer googleapi.CloseBody(res) 5039 if err := googleapi.CheckResponse(res); err != nil { 5040 return nil, err 5041 } 5042 ret := &Empty{ 5043 ServerResponse: googleapi.ServerResponse{ 5044 Header: res.Header, 5045 HTTPStatusCode: res.StatusCode, 5046 }, 5047 } 5048 target := &ret 5049 if err := gensupport.DecodeResponse(target, res); err != nil { 5050 return nil, err 5051 } 5052 return ret, nil 5053 // { 5054 // "description": "Deletes the given `Occurrence` from the system. Use this when an `Occurrence` is no longer applicable for the given resource.", 5055 // "flatPath": "v1alpha1/projects/{projectsId}/occurrences/{occurrencesId}", 5056 // "httpMethod": "DELETE", 5057 // "id": "containeranalysis.projects.occurrences.delete", 5058 // "parameterOrder": [ 5059 // "name" 5060 // ], 5061 // "parameters": { 5062 // "name": { 5063 // "description": "The name of the occurrence in the form of \"projects/{project_id}/occurrences/{OCCURRENCE_ID}\"", 5064 // "location": "path", 5065 // "pattern": "^projects/[^/]+/occurrences/[^/]+$", 5066 // "required": true, 5067 // "type": "string" 5068 // } 5069 // }, 5070 // "path": "v1alpha1/{+name}", 5071 // "response": { 5072 // "$ref": "Empty" 5073 // }, 5074 // "scopes": [ 5075 // "https://www.googleapis.com/auth/cloud-platform" 5076 // ] 5077 // } 5078 5079} 5080 5081// method id "containeranalysis.projects.occurrences.get": 5082 5083type ProjectsOccurrencesGetCall struct { 5084 s *Service 5085 name string 5086 urlParams_ gensupport.URLParams 5087 ifNoneMatch_ string 5088 ctx_ context.Context 5089 header_ http.Header 5090} 5091 5092// Get: Returns the requested `Occurrence`. 5093// 5094// - name: The name of the occurrence of the form 5095// "projects/{project_id}/occurrences/{OCCURRENCE_ID}". 5096func (r *ProjectsOccurrencesService) Get(name string) *ProjectsOccurrencesGetCall { 5097 c := &ProjectsOccurrencesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 5098 c.name = name 5099 return c 5100} 5101 5102// Fields allows partial responses to be retrieved. See 5103// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 5104// for more information. 5105func (c *ProjectsOccurrencesGetCall) Fields(s ...googleapi.Field) *ProjectsOccurrencesGetCall { 5106 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 5107 return c 5108} 5109 5110// IfNoneMatch sets the optional parameter which makes the operation 5111// fail if the object's ETag matches the given value. This is useful for 5112// getting updates only after the object has changed since the last 5113// request. Use googleapi.IsNotModified to check whether the response 5114// error from Do is the result of In-None-Match. 5115func (c *ProjectsOccurrencesGetCall) IfNoneMatch(entityTag string) *ProjectsOccurrencesGetCall { 5116 c.ifNoneMatch_ = entityTag 5117 return c 5118} 5119 5120// Context sets the context to be used in this call's Do method. Any 5121// pending HTTP request will be aborted if the provided context is 5122// canceled. 5123func (c *ProjectsOccurrencesGetCall) Context(ctx context.Context) *ProjectsOccurrencesGetCall { 5124 c.ctx_ = ctx 5125 return c 5126} 5127 5128// Header returns an http.Header that can be modified by the caller to 5129// add HTTP headers to the request. 5130func (c *ProjectsOccurrencesGetCall) Header() http.Header { 5131 if c.header_ == nil { 5132 c.header_ = make(http.Header) 5133 } 5134 return c.header_ 5135} 5136 5137func (c *ProjectsOccurrencesGetCall) doRequest(alt string) (*http.Response, error) { 5138 reqHeaders := make(http.Header) 5139 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210410") 5140 for k, v := range c.header_ { 5141 reqHeaders[k] = v 5142 } 5143 reqHeaders.Set("User-Agent", c.s.userAgent()) 5144 if c.ifNoneMatch_ != "" { 5145 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 5146 } 5147 var body io.Reader = nil 5148 c.urlParams_.Set("alt", alt) 5149 c.urlParams_.Set("prettyPrint", "false") 5150 urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+name}") 5151 urls += "?" + c.urlParams_.Encode() 5152 req, err := http.NewRequest("GET", urls, body) 5153 if err != nil { 5154 return nil, err 5155 } 5156 req.Header = reqHeaders 5157 googleapi.Expand(req.URL, map[string]string{ 5158 "name": c.name, 5159 }) 5160 return gensupport.SendRequest(c.ctx_, c.s.client, req) 5161} 5162 5163// Do executes the "containeranalysis.projects.occurrences.get" call. 5164// Exactly one of *Occurrence or error will be non-nil. Any non-2xx 5165// status code is an error. Response headers are in either 5166// *Occurrence.ServerResponse.Header or (if a response was returned at 5167// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 5168// to check whether the returned error was because 5169// http.StatusNotModified was returned. 5170func (c *ProjectsOccurrencesGetCall) Do(opts ...googleapi.CallOption) (*Occurrence, error) { 5171 gensupport.SetOptions(c.urlParams_, opts...) 5172 res, err := c.doRequest("json") 5173 if res != nil && res.StatusCode == http.StatusNotModified { 5174 if res.Body != nil { 5175 res.Body.Close() 5176 } 5177 return nil, &googleapi.Error{ 5178 Code: res.StatusCode, 5179 Header: res.Header, 5180 } 5181 } 5182 if err != nil { 5183 return nil, err 5184 } 5185 defer googleapi.CloseBody(res) 5186 if err := googleapi.CheckResponse(res); err != nil { 5187 return nil, err 5188 } 5189 ret := &Occurrence{ 5190 ServerResponse: googleapi.ServerResponse{ 5191 Header: res.Header, 5192 HTTPStatusCode: res.StatusCode, 5193 }, 5194 } 5195 target := &ret 5196 if err := gensupport.DecodeResponse(target, res); err != nil { 5197 return nil, err 5198 } 5199 return ret, nil 5200 // { 5201 // "description": "Returns the requested `Occurrence`.", 5202 // "flatPath": "v1alpha1/projects/{projectsId}/occurrences/{occurrencesId}", 5203 // "httpMethod": "GET", 5204 // "id": "containeranalysis.projects.occurrences.get", 5205 // "parameterOrder": [ 5206 // "name" 5207 // ], 5208 // "parameters": { 5209 // "name": { 5210 // "description": "The name of the occurrence of the form \"projects/{project_id}/occurrences/{OCCURRENCE_ID}\"", 5211 // "location": "path", 5212 // "pattern": "^projects/[^/]+/occurrences/[^/]+$", 5213 // "required": true, 5214 // "type": "string" 5215 // } 5216 // }, 5217 // "path": "v1alpha1/{+name}", 5218 // "response": { 5219 // "$ref": "Occurrence" 5220 // }, 5221 // "scopes": [ 5222 // "https://www.googleapis.com/auth/cloud-platform" 5223 // ] 5224 // } 5225 5226} 5227 5228// method id "containeranalysis.projects.occurrences.getIamPolicy": 5229 5230type ProjectsOccurrencesGetIamPolicyCall struct { 5231 s *Service 5232 resource string 5233 getiampolicyrequest *GetIamPolicyRequest 5234 urlParams_ gensupport.URLParams 5235 ctx_ context.Context 5236 header_ http.Header 5237} 5238 5239// GetIamPolicy: Gets the access control policy for a note or an 5240// `Occurrence` resource. Requires 5241// `containeranalysis.notes.setIamPolicy` or 5242// `containeranalysis.occurrences.setIamPolicy` permission if the 5243// resource is a note or occurrence, respectively. Attempting to call 5244// this method on a resource without the required permission will result 5245// in a `PERMISSION_DENIED` error. Attempting to call this method on a 5246// non-existent resource will result in a `NOT_FOUND` error if the user 5247// has list permission on the project, or a `PERMISSION_DENIED` error 5248// otherwise. The resource takes the following formats: 5249// `projects/{PROJECT_ID}/occurrences/{OCCURRENCE_ID}` for occurrences 5250// and projects/{PROJECT_ID}/notes/{NOTE_ID} for notes 5251// 5252// - resource: REQUIRED: The resource for which the policy is being 5253// requested. See the operation documentation for the appropriate 5254// value for this field. 5255func (r *ProjectsOccurrencesService) GetIamPolicy(resource string, getiampolicyrequest *GetIamPolicyRequest) *ProjectsOccurrencesGetIamPolicyCall { 5256 c := &ProjectsOccurrencesGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)} 5257 c.resource = resource 5258 c.getiampolicyrequest = getiampolicyrequest 5259 return c 5260} 5261 5262// Fields allows partial responses to be retrieved. See 5263// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 5264// for more information. 5265func (c *ProjectsOccurrencesGetIamPolicyCall) Fields(s ...googleapi.Field) *ProjectsOccurrencesGetIamPolicyCall { 5266 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 5267 return c 5268} 5269 5270// Context sets the context to be used in this call's Do method. Any 5271// pending HTTP request will be aborted if the provided context is 5272// canceled. 5273func (c *ProjectsOccurrencesGetIamPolicyCall) Context(ctx context.Context) *ProjectsOccurrencesGetIamPolicyCall { 5274 c.ctx_ = ctx 5275 return c 5276} 5277 5278// Header returns an http.Header that can be modified by the caller to 5279// add HTTP headers to the request. 5280func (c *ProjectsOccurrencesGetIamPolicyCall) Header() http.Header { 5281 if c.header_ == nil { 5282 c.header_ = make(http.Header) 5283 } 5284 return c.header_ 5285} 5286 5287func (c *ProjectsOccurrencesGetIamPolicyCall) doRequest(alt string) (*http.Response, error) { 5288 reqHeaders := make(http.Header) 5289 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210410") 5290 for k, v := range c.header_ { 5291 reqHeaders[k] = v 5292 } 5293 reqHeaders.Set("User-Agent", c.s.userAgent()) 5294 var body io.Reader = nil 5295 body, err := googleapi.WithoutDataWrapper.JSONReader(c.getiampolicyrequest) 5296 if err != nil { 5297 return nil, err 5298 } 5299 reqHeaders.Set("Content-Type", "application/json") 5300 c.urlParams_.Set("alt", alt) 5301 c.urlParams_.Set("prettyPrint", "false") 5302 urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+resource}:getIamPolicy") 5303 urls += "?" + c.urlParams_.Encode() 5304 req, err := http.NewRequest("POST", urls, body) 5305 if err != nil { 5306 return nil, err 5307 } 5308 req.Header = reqHeaders 5309 googleapi.Expand(req.URL, map[string]string{ 5310 "resource": c.resource, 5311 }) 5312 return gensupport.SendRequest(c.ctx_, c.s.client, req) 5313} 5314 5315// Do executes the "containeranalysis.projects.occurrences.getIamPolicy" call. 5316// Exactly one of *Policy or error will be non-nil. Any non-2xx status 5317// code is an error. Response headers are in either 5318// *Policy.ServerResponse.Header or (if a response was returned at all) 5319// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 5320// check whether the returned error was because http.StatusNotModified 5321// was returned. 5322func (c *ProjectsOccurrencesGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) { 5323 gensupport.SetOptions(c.urlParams_, opts...) 5324 res, err := c.doRequest("json") 5325 if res != nil && res.StatusCode == http.StatusNotModified { 5326 if res.Body != nil { 5327 res.Body.Close() 5328 } 5329 return nil, &googleapi.Error{ 5330 Code: res.StatusCode, 5331 Header: res.Header, 5332 } 5333 } 5334 if err != nil { 5335 return nil, err 5336 } 5337 defer googleapi.CloseBody(res) 5338 if err := googleapi.CheckResponse(res); err != nil { 5339 return nil, err 5340 } 5341 ret := &Policy{ 5342 ServerResponse: googleapi.ServerResponse{ 5343 Header: res.Header, 5344 HTTPStatusCode: res.StatusCode, 5345 }, 5346 } 5347 target := &ret 5348 if err := gensupport.DecodeResponse(target, res); err != nil { 5349 return nil, err 5350 } 5351 return ret, nil 5352 // { 5353 // "description": "Gets the access control policy for a note or an `Occurrence` resource. Requires `containeranalysis.notes.setIamPolicy` or `containeranalysis.occurrences.setIamPolicy` permission if the resource is a note or occurrence, respectively. Attempting to call this method on a resource without the required permission will result in a `PERMISSION_DENIED` error. Attempting to call this method on a non-existent resource will result in a `NOT_FOUND` error if the user has list permission on the project, or a `PERMISSION_DENIED` error otherwise. The resource takes the following formats: `projects/{PROJECT_ID}/occurrences/{OCCURRENCE_ID}` for occurrences and projects/{PROJECT_ID}/notes/{NOTE_ID} for notes", 5354 // "flatPath": "v1alpha1/projects/{projectsId}/occurrences/{occurrencesId}:getIamPolicy", 5355 // "httpMethod": "POST", 5356 // "id": "containeranalysis.projects.occurrences.getIamPolicy", 5357 // "parameterOrder": [ 5358 // "resource" 5359 // ], 5360 // "parameters": { 5361 // "resource": { 5362 // "description": "REQUIRED: The resource for which the policy is being requested. See the operation documentation for the appropriate value for this field.", 5363 // "location": "path", 5364 // "pattern": "^projects/[^/]+/occurrences/[^/]+$", 5365 // "required": true, 5366 // "type": "string" 5367 // } 5368 // }, 5369 // "path": "v1alpha1/{+resource}:getIamPolicy", 5370 // "request": { 5371 // "$ref": "GetIamPolicyRequest" 5372 // }, 5373 // "response": { 5374 // "$ref": "Policy" 5375 // }, 5376 // "scopes": [ 5377 // "https://www.googleapis.com/auth/cloud-platform" 5378 // ] 5379 // } 5380 5381} 5382 5383// method id "containeranalysis.projects.occurrences.getNotes": 5384 5385type ProjectsOccurrencesGetNotesCall struct { 5386 s *Service 5387 name string 5388 urlParams_ gensupport.URLParams 5389 ifNoneMatch_ string 5390 ctx_ context.Context 5391 header_ http.Header 5392} 5393 5394// GetNotes: Gets the `Note` attached to the given `Occurrence`. 5395// 5396// - name: The name of the occurrence in the form 5397// "projects/{project_id}/occurrences/{OCCURRENCE_ID}". 5398func (r *ProjectsOccurrencesService) GetNotes(name string) *ProjectsOccurrencesGetNotesCall { 5399 c := &ProjectsOccurrencesGetNotesCall{s: r.s, urlParams_: make(gensupport.URLParams)} 5400 c.name = name 5401 return c 5402} 5403 5404// Fields allows partial responses to be retrieved. See 5405// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 5406// for more information. 5407func (c *ProjectsOccurrencesGetNotesCall) Fields(s ...googleapi.Field) *ProjectsOccurrencesGetNotesCall { 5408 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 5409 return c 5410} 5411 5412// IfNoneMatch sets the optional parameter which makes the operation 5413// fail if the object's ETag matches the given value. This is useful for 5414// getting updates only after the object has changed since the last 5415// request. Use googleapi.IsNotModified to check whether the response 5416// error from Do is the result of In-None-Match. 5417func (c *ProjectsOccurrencesGetNotesCall) IfNoneMatch(entityTag string) *ProjectsOccurrencesGetNotesCall { 5418 c.ifNoneMatch_ = entityTag 5419 return c 5420} 5421 5422// Context sets the context to be used in this call's Do method. Any 5423// pending HTTP request will be aborted if the provided context is 5424// canceled. 5425func (c *ProjectsOccurrencesGetNotesCall) Context(ctx context.Context) *ProjectsOccurrencesGetNotesCall { 5426 c.ctx_ = ctx 5427 return c 5428} 5429 5430// Header returns an http.Header that can be modified by the caller to 5431// add HTTP headers to the request. 5432func (c *ProjectsOccurrencesGetNotesCall) Header() http.Header { 5433 if c.header_ == nil { 5434 c.header_ = make(http.Header) 5435 } 5436 return c.header_ 5437} 5438 5439func (c *ProjectsOccurrencesGetNotesCall) doRequest(alt string) (*http.Response, error) { 5440 reqHeaders := make(http.Header) 5441 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210410") 5442 for k, v := range c.header_ { 5443 reqHeaders[k] = v 5444 } 5445 reqHeaders.Set("User-Agent", c.s.userAgent()) 5446 if c.ifNoneMatch_ != "" { 5447 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 5448 } 5449 var body io.Reader = nil 5450 c.urlParams_.Set("alt", alt) 5451 c.urlParams_.Set("prettyPrint", "false") 5452 urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+name}/notes") 5453 urls += "?" + c.urlParams_.Encode() 5454 req, err := http.NewRequest("GET", urls, body) 5455 if err != nil { 5456 return nil, err 5457 } 5458 req.Header = reqHeaders 5459 googleapi.Expand(req.URL, map[string]string{ 5460 "name": c.name, 5461 }) 5462 return gensupport.SendRequest(c.ctx_, c.s.client, req) 5463} 5464 5465// Do executes the "containeranalysis.projects.occurrences.getNotes" call. 5466// Exactly one of *Note or error will be non-nil. Any non-2xx status 5467// code is an error. Response headers are in either 5468// *Note.ServerResponse.Header or (if a response was returned at all) in 5469// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 5470// whether the returned error was because http.StatusNotModified was 5471// returned. 5472func (c *ProjectsOccurrencesGetNotesCall) Do(opts ...googleapi.CallOption) (*Note, error) { 5473 gensupport.SetOptions(c.urlParams_, opts...) 5474 res, err := c.doRequest("json") 5475 if res != nil && res.StatusCode == http.StatusNotModified { 5476 if res.Body != nil { 5477 res.Body.Close() 5478 } 5479 return nil, &googleapi.Error{ 5480 Code: res.StatusCode, 5481 Header: res.Header, 5482 } 5483 } 5484 if err != nil { 5485 return nil, err 5486 } 5487 defer googleapi.CloseBody(res) 5488 if err := googleapi.CheckResponse(res); err != nil { 5489 return nil, err 5490 } 5491 ret := &Note{ 5492 ServerResponse: googleapi.ServerResponse{ 5493 Header: res.Header, 5494 HTTPStatusCode: res.StatusCode, 5495 }, 5496 } 5497 target := &ret 5498 if err := gensupport.DecodeResponse(target, res); err != nil { 5499 return nil, err 5500 } 5501 return ret, nil 5502 // { 5503 // "description": "Gets the `Note` attached to the given `Occurrence`.", 5504 // "flatPath": "v1alpha1/projects/{projectsId}/occurrences/{occurrencesId}/notes", 5505 // "httpMethod": "GET", 5506 // "id": "containeranalysis.projects.occurrences.getNotes", 5507 // "parameterOrder": [ 5508 // "name" 5509 // ], 5510 // "parameters": { 5511 // "name": { 5512 // "description": "The name of the occurrence in the form \"projects/{project_id}/occurrences/{OCCURRENCE_ID}\"", 5513 // "location": "path", 5514 // "pattern": "^projects/[^/]+/occurrences/[^/]+$", 5515 // "required": true, 5516 // "type": "string" 5517 // } 5518 // }, 5519 // "path": "v1alpha1/{+name}/notes", 5520 // "response": { 5521 // "$ref": "Note" 5522 // }, 5523 // "scopes": [ 5524 // "https://www.googleapis.com/auth/cloud-platform" 5525 // ] 5526 // } 5527 5528} 5529 5530// method id "containeranalysis.projects.occurrences.getVulnerabilitySummary": 5531 5532type ProjectsOccurrencesGetVulnerabilitySummaryCall struct { 5533 s *Service 5534 parent string 5535 urlParams_ gensupport.URLParams 5536 ifNoneMatch_ string 5537 ctx_ context.Context 5538 header_ http.Header 5539} 5540 5541// GetVulnerabilitySummary: Gets a summary of the number and severity of 5542// occurrences. 5543// 5544// - parent: This contains the project Id for example: 5545// projects/{project_id}. 5546func (r *ProjectsOccurrencesService) GetVulnerabilitySummary(parent string) *ProjectsOccurrencesGetVulnerabilitySummaryCall { 5547 c := &ProjectsOccurrencesGetVulnerabilitySummaryCall{s: r.s, urlParams_: make(gensupport.URLParams)} 5548 c.parent = parent 5549 return c 5550} 5551 5552// Filter sets the optional parameter "filter": The filter expression. 5553func (c *ProjectsOccurrencesGetVulnerabilitySummaryCall) Filter(filter string) *ProjectsOccurrencesGetVulnerabilitySummaryCall { 5554 c.urlParams_.Set("filter", filter) 5555 return c 5556} 5557 5558// Fields allows partial responses to be retrieved. See 5559// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 5560// for more information. 5561func (c *ProjectsOccurrencesGetVulnerabilitySummaryCall) Fields(s ...googleapi.Field) *ProjectsOccurrencesGetVulnerabilitySummaryCall { 5562 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 5563 return c 5564} 5565 5566// IfNoneMatch sets the optional parameter which makes the operation 5567// fail if the object's ETag matches the given value. This is useful for 5568// getting updates only after the object has changed since the last 5569// request. Use googleapi.IsNotModified to check whether the response 5570// error from Do is the result of In-None-Match. 5571func (c *ProjectsOccurrencesGetVulnerabilitySummaryCall) IfNoneMatch(entityTag string) *ProjectsOccurrencesGetVulnerabilitySummaryCall { 5572 c.ifNoneMatch_ = entityTag 5573 return c 5574} 5575 5576// Context sets the context to be used in this call's Do method. Any 5577// pending HTTP request will be aborted if the provided context is 5578// canceled. 5579func (c *ProjectsOccurrencesGetVulnerabilitySummaryCall) Context(ctx context.Context) *ProjectsOccurrencesGetVulnerabilitySummaryCall { 5580 c.ctx_ = ctx 5581 return c 5582} 5583 5584// Header returns an http.Header that can be modified by the caller to 5585// add HTTP headers to the request. 5586func (c *ProjectsOccurrencesGetVulnerabilitySummaryCall) Header() http.Header { 5587 if c.header_ == nil { 5588 c.header_ = make(http.Header) 5589 } 5590 return c.header_ 5591} 5592 5593func (c *ProjectsOccurrencesGetVulnerabilitySummaryCall) doRequest(alt string) (*http.Response, error) { 5594 reqHeaders := make(http.Header) 5595 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210410") 5596 for k, v := range c.header_ { 5597 reqHeaders[k] = v 5598 } 5599 reqHeaders.Set("User-Agent", c.s.userAgent()) 5600 if c.ifNoneMatch_ != "" { 5601 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 5602 } 5603 var body io.Reader = nil 5604 c.urlParams_.Set("alt", alt) 5605 c.urlParams_.Set("prettyPrint", "false") 5606 urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+parent}/occurrences:vulnerabilitySummary") 5607 urls += "?" + c.urlParams_.Encode() 5608 req, err := http.NewRequest("GET", urls, body) 5609 if err != nil { 5610 return nil, err 5611 } 5612 req.Header = reqHeaders 5613 googleapi.Expand(req.URL, map[string]string{ 5614 "parent": c.parent, 5615 }) 5616 return gensupport.SendRequest(c.ctx_, c.s.client, req) 5617} 5618 5619// Do executes the "containeranalysis.projects.occurrences.getVulnerabilitySummary" call. 5620// Exactly one of *GetVulnzOccurrencesSummaryResponse or error will be 5621// non-nil. Any non-2xx status code is an error. Response headers are in 5622// either *GetVulnzOccurrencesSummaryResponse.ServerResponse.Header or 5623// (if a response was returned at all) in 5624// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 5625// whether the returned error was because http.StatusNotModified was 5626// returned. 5627func (c *ProjectsOccurrencesGetVulnerabilitySummaryCall) Do(opts ...googleapi.CallOption) (*GetVulnzOccurrencesSummaryResponse, error) { 5628 gensupport.SetOptions(c.urlParams_, opts...) 5629 res, err := c.doRequest("json") 5630 if res != nil && res.StatusCode == http.StatusNotModified { 5631 if res.Body != nil { 5632 res.Body.Close() 5633 } 5634 return nil, &googleapi.Error{ 5635 Code: res.StatusCode, 5636 Header: res.Header, 5637 } 5638 } 5639 if err != nil { 5640 return nil, err 5641 } 5642 defer googleapi.CloseBody(res) 5643 if err := googleapi.CheckResponse(res); err != nil { 5644 return nil, err 5645 } 5646 ret := &GetVulnzOccurrencesSummaryResponse{ 5647 ServerResponse: googleapi.ServerResponse{ 5648 Header: res.Header, 5649 HTTPStatusCode: res.StatusCode, 5650 }, 5651 } 5652 target := &ret 5653 if err := gensupport.DecodeResponse(target, res); err != nil { 5654 return nil, err 5655 } 5656 return ret, nil 5657 // { 5658 // "description": "Gets a summary of the number and severity of occurrences.", 5659 // "flatPath": "v1alpha1/projects/{projectsId}/occurrences:vulnerabilitySummary", 5660 // "httpMethod": "GET", 5661 // "id": "containeranalysis.projects.occurrences.getVulnerabilitySummary", 5662 // "parameterOrder": [ 5663 // "parent" 5664 // ], 5665 // "parameters": { 5666 // "filter": { 5667 // "description": "The filter expression.", 5668 // "location": "query", 5669 // "type": "string" 5670 // }, 5671 // "parent": { 5672 // "description": "This contains the project Id for example: projects/{project_id}", 5673 // "location": "path", 5674 // "pattern": "^projects/[^/]+$", 5675 // "required": true, 5676 // "type": "string" 5677 // } 5678 // }, 5679 // "path": "v1alpha1/{+parent}/occurrences:vulnerabilitySummary", 5680 // "response": { 5681 // "$ref": "GetVulnzOccurrencesSummaryResponse" 5682 // }, 5683 // "scopes": [ 5684 // "https://www.googleapis.com/auth/cloud-platform" 5685 // ] 5686 // } 5687 5688} 5689 5690// method id "containeranalysis.projects.occurrences.list": 5691 5692type ProjectsOccurrencesListCall struct { 5693 s *Service 5694 parent string 5695 urlParams_ gensupport.URLParams 5696 ifNoneMatch_ string 5697 ctx_ context.Context 5698 header_ http.Header 5699} 5700 5701// List: Lists active `Occurrences` for a given project matching the 5702// filters. 5703// 5704// - parent: This contains the project Id for example: 5705// projects/{project_id}. 5706func (r *ProjectsOccurrencesService) List(parent string) *ProjectsOccurrencesListCall { 5707 c := &ProjectsOccurrencesListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 5708 c.parent = parent 5709 return c 5710} 5711 5712// Filter sets the optional parameter "filter": The filter expression. 5713func (c *ProjectsOccurrencesListCall) Filter(filter string) *ProjectsOccurrencesListCall { 5714 c.urlParams_.Set("filter", filter) 5715 return c 5716} 5717 5718// Kind sets the optional parameter "kind": The kind of occurrences to 5719// filter on. 5720// 5721// Possible values: 5722// "KIND_UNSPECIFIED" - Unknown 5723// "PACKAGE_VULNERABILITY" - The note and occurrence represent a 5724// package vulnerability. 5725// "BUILD_DETAILS" - The note and occurrence assert build provenance. 5726// "IMAGE_BASIS" - This represents an image basis relationship. 5727// "PACKAGE_MANAGER" - This represents a package installed via a 5728// package manager. 5729// "DEPLOYABLE" - The note and occurrence track deployment events. 5730// "DISCOVERY" - The note and occurrence track the initial discovery 5731// status of a resource. 5732// "ATTESTATION_AUTHORITY" - This represents a logical "role" that can 5733// attest to artifacts. 5734// "UPGRADE" - This represents an available software upgrade. 5735func (c *ProjectsOccurrencesListCall) Kind(kind string) *ProjectsOccurrencesListCall { 5736 c.urlParams_.Set("kind", kind) 5737 return c 5738} 5739 5740// Name sets the optional parameter "name": The name field contains the 5741// project Id. For example: "projects/{project_id} @Deprecated 5742func (c *ProjectsOccurrencesListCall) Name(name string) *ProjectsOccurrencesListCall { 5743 c.urlParams_.Set("name", name) 5744 return c 5745} 5746 5747// PageSize sets the optional parameter "pageSize": Number of 5748// occurrences to return in the list. 5749func (c *ProjectsOccurrencesListCall) PageSize(pageSize int64) *ProjectsOccurrencesListCall { 5750 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) 5751 return c 5752} 5753 5754// PageToken sets the optional parameter "pageToken": Token to provide 5755// to skip to a particular spot in the list. 5756func (c *ProjectsOccurrencesListCall) PageToken(pageToken string) *ProjectsOccurrencesListCall { 5757 c.urlParams_.Set("pageToken", pageToken) 5758 return c 5759} 5760 5761// Fields allows partial responses to be retrieved. See 5762// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 5763// for more information. 5764func (c *ProjectsOccurrencesListCall) Fields(s ...googleapi.Field) *ProjectsOccurrencesListCall { 5765 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 5766 return c 5767} 5768 5769// IfNoneMatch sets the optional parameter which makes the operation 5770// fail if the object's ETag matches the given value. This is useful for 5771// getting updates only after the object has changed since the last 5772// request. Use googleapi.IsNotModified to check whether the response 5773// error from Do is the result of In-None-Match. 5774func (c *ProjectsOccurrencesListCall) IfNoneMatch(entityTag string) *ProjectsOccurrencesListCall { 5775 c.ifNoneMatch_ = entityTag 5776 return c 5777} 5778 5779// Context sets the context to be used in this call's Do method. Any 5780// pending HTTP request will be aborted if the provided context is 5781// canceled. 5782func (c *ProjectsOccurrencesListCall) Context(ctx context.Context) *ProjectsOccurrencesListCall { 5783 c.ctx_ = ctx 5784 return c 5785} 5786 5787// Header returns an http.Header that can be modified by the caller to 5788// add HTTP headers to the request. 5789func (c *ProjectsOccurrencesListCall) Header() http.Header { 5790 if c.header_ == nil { 5791 c.header_ = make(http.Header) 5792 } 5793 return c.header_ 5794} 5795 5796func (c *ProjectsOccurrencesListCall) doRequest(alt string) (*http.Response, error) { 5797 reqHeaders := make(http.Header) 5798 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210410") 5799 for k, v := range c.header_ { 5800 reqHeaders[k] = v 5801 } 5802 reqHeaders.Set("User-Agent", c.s.userAgent()) 5803 if c.ifNoneMatch_ != "" { 5804 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 5805 } 5806 var body io.Reader = nil 5807 c.urlParams_.Set("alt", alt) 5808 c.urlParams_.Set("prettyPrint", "false") 5809 urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+parent}/occurrences") 5810 urls += "?" + c.urlParams_.Encode() 5811 req, err := http.NewRequest("GET", urls, body) 5812 if err != nil { 5813 return nil, err 5814 } 5815 req.Header = reqHeaders 5816 googleapi.Expand(req.URL, map[string]string{ 5817 "parent": c.parent, 5818 }) 5819 return gensupport.SendRequest(c.ctx_, c.s.client, req) 5820} 5821 5822// Do executes the "containeranalysis.projects.occurrences.list" call. 5823// Exactly one of *ListOccurrencesResponse or error will be non-nil. Any 5824// non-2xx status code is an error. Response headers are in either 5825// *ListOccurrencesResponse.ServerResponse.Header or (if a response was 5826// returned at all) in error.(*googleapi.Error).Header. Use 5827// googleapi.IsNotModified to check whether the returned error was 5828// because http.StatusNotModified was returned. 5829func (c *ProjectsOccurrencesListCall) Do(opts ...googleapi.CallOption) (*ListOccurrencesResponse, error) { 5830 gensupport.SetOptions(c.urlParams_, opts...) 5831 res, err := c.doRequest("json") 5832 if res != nil && res.StatusCode == http.StatusNotModified { 5833 if res.Body != nil { 5834 res.Body.Close() 5835 } 5836 return nil, &googleapi.Error{ 5837 Code: res.StatusCode, 5838 Header: res.Header, 5839 } 5840 } 5841 if err != nil { 5842 return nil, err 5843 } 5844 defer googleapi.CloseBody(res) 5845 if err := googleapi.CheckResponse(res); err != nil { 5846 return nil, err 5847 } 5848 ret := &ListOccurrencesResponse{ 5849 ServerResponse: googleapi.ServerResponse{ 5850 Header: res.Header, 5851 HTTPStatusCode: res.StatusCode, 5852 }, 5853 } 5854 target := &ret 5855 if err := gensupport.DecodeResponse(target, res); err != nil { 5856 return nil, err 5857 } 5858 return ret, nil 5859 // { 5860 // "description": "Lists active `Occurrences` for a given project matching the filters.", 5861 // "flatPath": "v1alpha1/projects/{projectsId}/occurrences", 5862 // "httpMethod": "GET", 5863 // "id": "containeranalysis.projects.occurrences.list", 5864 // "parameterOrder": [ 5865 // "parent" 5866 // ], 5867 // "parameters": { 5868 // "filter": { 5869 // "description": "The filter expression.", 5870 // "location": "query", 5871 // "type": "string" 5872 // }, 5873 // "kind": { 5874 // "description": "The kind of occurrences to filter on.", 5875 // "enum": [ 5876 // "KIND_UNSPECIFIED", 5877 // "PACKAGE_VULNERABILITY", 5878 // "BUILD_DETAILS", 5879 // "IMAGE_BASIS", 5880 // "PACKAGE_MANAGER", 5881 // "DEPLOYABLE", 5882 // "DISCOVERY", 5883 // "ATTESTATION_AUTHORITY", 5884 // "UPGRADE" 5885 // ], 5886 // "enumDescriptions": [ 5887 // "Unknown", 5888 // "The note and occurrence represent a package vulnerability.", 5889 // "The note and occurrence assert build provenance.", 5890 // "This represents an image basis relationship.", 5891 // "This represents a package installed via a package manager.", 5892 // "The note and occurrence track deployment events.", 5893 // "The note and occurrence track the initial discovery status of a resource.", 5894 // "This represents a logical \"role\" that can attest to artifacts.", 5895 // "This represents an available software upgrade." 5896 // ], 5897 // "location": "query", 5898 // "type": "string" 5899 // }, 5900 // "name": { 5901 // "description": "The name field contains the project Id. For example: \"projects/{project_id} @Deprecated", 5902 // "location": "query", 5903 // "type": "string" 5904 // }, 5905 // "pageSize": { 5906 // "description": "Number of occurrences to return in the list.", 5907 // "format": "int32", 5908 // "location": "query", 5909 // "type": "integer" 5910 // }, 5911 // "pageToken": { 5912 // "description": "Token to provide to skip to a particular spot in the list.", 5913 // "location": "query", 5914 // "type": "string" 5915 // }, 5916 // "parent": { 5917 // "description": "This contains the project Id for example: projects/{project_id}.", 5918 // "location": "path", 5919 // "pattern": "^projects/[^/]+$", 5920 // "required": true, 5921 // "type": "string" 5922 // } 5923 // }, 5924 // "path": "v1alpha1/{+parent}/occurrences", 5925 // "response": { 5926 // "$ref": "ListOccurrencesResponse" 5927 // }, 5928 // "scopes": [ 5929 // "https://www.googleapis.com/auth/cloud-platform" 5930 // ] 5931 // } 5932 5933} 5934 5935// Pages invokes f for each page of results. 5936// A non-nil error returned from f will halt the iteration. 5937// The provided context supersedes any context provided to the Context method. 5938func (c *ProjectsOccurrencesListCall) Pages(ctx context.Context, f func(*ListOccurrencesResponse) error) error { 5939 c.ctx_ = ctx 5940 defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point 5941 for { 5942 x, err := c.Do() 5943 if err != nil { 5944 return err 5945 } 5946 if err := f(x); err != nil { 5947 return err 5948 } 5949 if x.NextPageToken == "" { 5950 return nil 5951 } 5952 c.PageToken(x.NextPageToken) 5953 } 5954} 5955 5956// method id "containeranalysis.projects.occurrences.patch": 5957 5958type ProjectsOccurrencesPatchCall struct { 5959 s *Service 5960 name string 5961 occurrence *Occurrence 5962 urlParams_ gensupport.URLParams 5963 ctx_ context.Context 5964 header_ http.Header 5965} 5966 5967// Patch: Updates an existing occurrence. 5968// 5969// - name: The name of the occurrence. Should be of the form 5970// "projects/{project_id}/occurrences/{OCCURRENCE_ID}". 5971func (r *ProjectsOccurrencesService) Patch(name string, occurrence *Occurrence) *ProjectsOccurrencesPatchCall { 5972 c := &ProjectsOccurrencesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} 5973 c.name = name 5974 c.occurrence = occurrence 5975 return c 5976} 5977 5978// UpdateMask sets the optional parameter "updateMask": The fields to 5979// update. 5980func (c *ProjectsOccurrencesPatchCall) UpdateMask(updateMask string) *ProjectsOccurrencesPatchCall { 5981 c.urlParams_.Set("updateMask", updateMask) 5982 return c 5983} 5984 5985// Fields allows partial responses to be retrieved. See 5986// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 5987// for more information. 5988func (c *ProjectsOccurrencesPatchCall) Fields(s ...googleapi.Field) *ProjectsOccurrencesPatchCall { 5989 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 5990 return c 5991} 5992 5993// Context sets the context to be used in this call's Do method. Any 5994// pending HTTP request will be aborted if the provided context is 5995// canceled. 5996func (c *ProjectsOccurrencesPatchCall) Context(ctx context.Context) *ProjectsOccurrencesPatchCall { 5997 c.ctx_ = ctx 5998 return c 5999} 6000 6001// Header returns an http.Header that can be modified by the caller to 6002// add HTTP headers to the request. 6003func (c *ProjectsOccurrencesPatchCall) Header() http.Header { 6004 if c.header_ == nil { 6005 c.header_ = make(http.Header) 6006 } 6007 return c.header_ 6008} 6009 6010func (c *ProjectsOccurrencesPatchCall) doRequest(alt string) (*http.Response, error) { 6011 reqHeaders := make(http.Header) 6012 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210410") 6013 for k, v := range c.header_ { 6014 reqHeaders[k] = v 6015 } 6016 reqHeaders.Set("User-Agent", c.s.userAgent()) 6017 var body io.Reader = nil 6018 body, err := googleapi.WithoutDataWrapper.JSONReader(c.occurrence) 6019 if err != nil { 6020 return nil, err 6021 } 6022 reqHeaders.Set("Content-Type", "application/json") 6023 c.urlParams_.Set("alt", alt) 6024 c.urlParams_.Set("prettyPrint", "false") 6025 urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+name}") 6026 urls += "?" + c.urlParams_.Encode() 6027 req, err := http.NewRequest("PATCH", urls, body) 6028 if err != nil { 6029 return nil, err 6030 } 6031 req.Header = reqHeaders 6032 googleapi.Expand(req.URL, map[string]string{ 6033 "name": c.name, 6034 }) 6035 return gensupport.SendRequest(c.ctx_, c.s.client, req) 6036} 6037 6038// Do executes the "containeranalysis.projects.occurrences.patch" call. 6039// Exactly one of *Occurrence or error will be non-nil. Any non-2xx 6040// status code is an error. Response headers are in either 6041// *Occurrence.ServerResponse.Header or (if a response was returned at 6042// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 6043// to check whether the returned error was because 6044// http.StatusNotModified was returned. 6045func (c *ProjectsOccurrencesPatchCall) Do(opts ...googleapi.CallOption) (*Occurrence, error) { 6046 gensupport.SetOptions(c.urlParams_, opts...) 6047 res, err := c.doRequest("json") 6048 if res != nil && res.StatusCode == http.StatusNotModified { 6049 if res.Body != nil { 6050 res.Body.Close() 6051 } 6052 return nil, &googleapi.Error{ 6053 Code: res.StatusCode, 6054 Header: res.Header, 6055 } 6056 } 6057 if err != nil { 6058 return nil, err 6059 } 6060 defer googleapi.CloseBody(res) 6061 if err := googleapi.CheckResponse(res); err != nil { 6062 return nil, err 6063 } 6064 ret := &Occurrence{ 6065 ServerResponse: googleapi.ServerResponse{ 6066 Header: res.Header, 6067 HTTPStatusCode: res.StatusCode, 6068 }, 6069 } 6070 target := &ret 6071 if err := gensupport.DecodeResponse(target, res); err != nil { 6072 return nil, err 6073 } 6074 return ret, nil 6075 // { 6076 // "description": "Updates an existing occurrence.", 6077 // "flatPath": "v1alpha1/projects/{projectsId}/occurrences/{occurrencesId}", 6078 // "httpMethod": "PATCH", 6079 // "id": "containeranalysis.projects.occurrences.patch", 6080 // "parameterOrder": [ 6081 // "name" 6082 // ], 6083 // "parameters": { 6084 // "name": { 6085 // "description": "The name of the occurrence. Should be of the form \"projects/{project_id}/occurrences/{OCCURRENCE_ID}\".", 6086 // "location": "path", 6087 // "pattern": "^projects/[^/]+/occurrences/[^/]+$", 6088 // "required": true, 6089 // "type": "string" 6090 // }, 6091 // "updateMask": { 6092 // "description": "The fields to update.", 6093 // "format": "google-fieldmask", 6094 // "location": "query", 6095 // "type": "string" 6096 // } 6097 // }, 6098 // "path": "v1alpha1/{+name}", 6099 // "request": { 6100 // "$ref": "Occurrence" 6101 // }, 6102 // "response": { 6103 // "$ref": "Occurrence" 6104 // }, 6105 // "scopes": [ 6106 // "https://www.googleapis.com/auth/cloud-platform" 6107 // ] 6108 // } 6109 6110} 6111 6112// method id "containeranalysis.projects.occurrences.setIamPolicy": 6113 6114type ProjectsOccurrencesSetIamPolicyCall struct { 6115 s *Service 6116 resource string 6117 setiampolicyrequest *SetIamPolicyRequest 6118 urlParams_ gensupport.URLParams 6119 ctx_ context.Context 6120 header_ http.Header 6121} 6122 6123// SetIamPolicy: Sets the access control policy on the specified `Note` 6124// or `Occurrence`. Requires `containeranalysis.notes.setIamPolicy` or 6125// `containeranalysis.occurrences.setIamPolicy` permission if the 6126// resource is a `Note` or an `Occurrence`, respectively. Attempting to 6127// call this method without these permissions will result in a ` 6128// `PERMISSION_DENIED` error. Attempting to call this method on a 6129// non-existent resource will result in a `NOT_FOUND` error if the user 6130// has `containeranalysis.notes.list` permission on a `Note` or 6131// `containeranalysis.occurrences.list` on an `Occurrence`, or a 6132// `PERMISSION_DENIED` error otherwise. The resource takes the following 6133// formats: `projects/{projectid}/occurrences/{occurrenceid}` for 6134// occurrences and projects/{projectid}/notes/{noteid} for notes 6135// 6136// - resource: REQUIRED: The resource for which the policy is being 6137// specified. See the operation documentation for the appropriate 6138// value for this field. 6139func (r *ProjectsOccurrencesService) SetIamPolicy(resource string, setiampolicyrequest *SetIamPolicyRequest) *ProjectsOccurrencesSetIamPolicyCall { 6140 c := &ProjectsOccurrencesSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)} 6141 c.resource = resource 6142 c.setiampolicyrequest = setiampolicyrequest 6143 return c 6144} 6145 6146// Fields allows partial responses to be retrieved. See 6147// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 6148// for more information. 6149func (c *ProjectsOccurrencesSetIamPolicyCall) Fields(s ...googleapi.Field) *ProjectsOccurrencesSetIamPolicyCall { 6150 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 6151 return c 6152} 6153 6154// Context sets the context to be used in this call's Do method. Any 6155// pending HTTP request will be aborted if the provided context is 6156// canceled. 6157func (c *ProjectsOccurrencesSetIamPolicyCall) Context(ctx context.Context) *ProjectsOccurrencesSetIamPolicyCall { 6158 c.ctx_ = ctx 6159 return c 6160} 6161 6162// Header returns an http.Header that can be modified by the caller to 6163// add HTTP headers to the request. 6164func (c *ProjectsOccurrencesSetIamPolicyCall) Header() http.Header { 6165 if c.header_ == nil { 6166 c.header_ = make(http.Header) 6167 } 6168 return c.header_ 6169} 6170 6171func (c *ProjectsOccurrencesSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { 6172 reqHeaders := make(http.Header) 6173 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210410") 6174 for k, v := range c.header_ { 6175 reqHeaders[k] = v 6176 } 6177 reqHeaders.Set("User-Agent", c.s.userAgent()) 6178 var body io.Reader = nil 6179 body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest) 6180 if err != nil { 6181 return nil, err 6182 } 6183 reqHeaders.Set("Content-Type", "application/json") 6184 c.urlParams_.Set("alt", alt) 6185 c.urlParams_.Set("prettyPrint", "false") 6186 urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+resource}:setIamPolicy") 6187 urls += "?" + c.urlParams_.Encode() 6188 req, err := http.NewRequest("POST", urls, body) 6189 if err != nil { 6190 return nil, err 6191 } 6192 req.Header = reqHeaders 6193 googleapi.Expand(req.URL, map[string]string{ 6194 "resource": c.resource, 6195 }) 6196 return gensupport.SendRequest(c.ctx_, c.s.client, req) 6197} 6198 6199// Do executes the "containeranalysis.projects.occurrences.setIamPolicy" call. 6200// Exactly one of *Policy or error will be non-nil. Any non-2xx status 6201// code is an error. Response headers are in either 6202// *Policy.ServerResponse.Header or (if a response was returned at all) 6203// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 6204// check whether the returned error was because http.StatusNotModified 6205// was returned. 6206func (c *ProjectsOccurrencesSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) { 6207 gensupport.SetOptions(c.urlParams_, opts...) 6208 res, err := c.doRequest("json") 6209 if res != nil && res.StatusCode == http.StatusNotModified { 6210 if res.Body != nil { 6211 res.Body.Close() 6212 } 6213 return nil, &googleapi.Error{ 6214 Code: res.StatusCode, 6215 Header: res.Header, 6216 } 6217 } 6218 if err != nil { 6219 return nil, err 6220 } 6221 defer googleapi.CloseBody(res) 6222 if err := googleapi.CheckResponse(res); err != nil { 6223 return nil, err 6224 } 6225 ret := &Policy{ 6226 ServerResponse: googleapi.ServerResponse{ 6227 Header: res.Header, 6228 HTTPStatusCode: res.StatusCode, 6229 }, 6230 } 6231 target := &ret 6232 if err := gensupport.DecodeResponse(target, res); err != nil { 6233 return nil, err 6234 } 6235 return ret, nil 6236 // { 6237 // "description": "Sets the access control policy on the specified `Note` or `Occurrence`. Requires `containeranalysis.notes.setIamPolicy` or `containeranalysis.occurrences.setIamPolicy` permission if the resource is a `Note` or an `Occurrence`, respectively. Attempting to call this method without these permissions will result in a ` `PERMISSION_DENIED` error. Attempting to call this method on a non-existent resource will result in a `NOT_FOUND` error if the user has `containeranalysis.notes.list` permission on a `Note` or `containeranalysis.occurrences.list` on an `Occurrence`, or a `PERMISSION_DENIED` error otherwise. The resource takes the following formats: `projects/{projectid}/occurrences/{occurrenceid}` for occurrences and projects/{projectid}/notes/{noteid} for notes", 6238 // "flatPath": "v1alpha1/projects/{projectsId}/occurrences/{occurrencesId}:setIamPolicy", 6239 // "httpMethod": "POST", 6240 // "id": "containeranalysis.projects.occurrences.setIamPolicy", 6241 // "parameterOrder": [ 6242 // "resource" 6243 // ], 6244 // "parameters": { 6245 // "resource": { 6246 // "description": "REQUIRED: The resource for which the policy is being specified. See the operation documentation for the appropriate value for this field.", 6247 // "location": "path", 6248 // "pattern": "^projects/[^/]+/occurrences/[^/]+$", 6249 // "required": true, 6250 // "type": "string" 6251 // } 6252 // }, 6253 // "path": "v1alpha1/{+resource}:setIamPolicy", 6254 // "request": { 6255 // "$ref": "SetIamPolicyRequest" 6256 // }, 6257 // "response": { 6258 // "$ref": "Policy" 6259 // }, 6260 // "scopes": [ 6261 // "https://www.googleapis.com/auth/cloud-platform" 6262 // ] 6263 // } 6264 6265} 6266 6267// method id "containeranalysis.projects.occurrences.testIamPermissions": 6268 6269type ProjectsOccurrencesTestIamPermissionsCall struct { 6270 s *Service 6271 resource string 6272 testiampermissionsrequest *TestIamPermissionsRequest 6273 urlParams_ gensupport.URLParams 6274 ctx_ context.Context 6275 header_ http.Header 6276} 6277 6278// TestIamPermissions: Returns the permissions that a caller has on the 6279// specified note or occurrence resource. Requires list permission on 6280// the project (for example, "storage.objects.list" on the containing 6281// bucket for testing permission of an object). Attempting to call this 6282// method on a non-existent resource will result in a `NOT_FOUND` error 6283// if the user has list permission on the project, or a 6284// `PERMISSION_DENIED` error otherwise. The resource takes the following 6285// formats: `projects/{PROJECT_ID}/occurrences/{OCCURRENCE_ID}` for 6286// `Occurrences` and `projects/{PROJECT_ID}/notes/{NOTE_ID}` for `Notes` 6287// 6288// - resource: REQUIRED: The resource for which the policy detail is 6289// being requested. See the operation documentation for the 6290// appropriate value for this field. 6291func (r *ProjectsOccurrencesService) TestIamPermissions(resource string, testiampermissionsrequest *TestIamPermissionsRequest) *ProjectsOccurrencesTestIamPermissionsCall { 6292 c := &ProjectsOccurrencesTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)} 6293 c.resource = resource 6294 c.testiampermissionsrequest = testiampermissionsrequest 6295 return c 6296} 6297 6298// Fields allows partial responses to be retrieved. See 6299// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 6300// for more information. 6301func (c *ProjectsOccurrencesTestIamPermissionsCall) Fields(s ...googleapi.Field) *ProjectsOccurrencesTestIamPermissionsCall { 6302 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 6303 return c 6304} 6305 6306// Context sets the context to be used in this call's Do method. Any 6307// pending HTTP request will be aborted if the provided context is 6308// canceled. 6309func (c *ProjectsOccurrencesTestIamPermissionsCall) Context(ctx context.Context) *ProjectsOccurrencesTestIamPermissionsCall { 6310 c.ctx_ = ctx 6311 return c 6312} 6313 6314// Header returns an http.Header that can be modified by the caller to 6315// add HTTP headers to the request. 6316func (c *ProjectsOccurrencesTestIamPermissionsCall) Header() http.Header { 6317 if c.header_ == nil { 6318 c.header_ = make(http.Header) 6319 } 6320 return c.header_ 6321} 6322 6323func (c *ProjectsOccurrencesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { 6324 reqHeaders := make(http.Header) 6325 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210410") 6326 for k, v := range c.header_ { 6327 reqHeaders[k] = v 6328 } 6329 reqHeaders.Set("User-Agent", c.s.userAgent()) 6330 var body io.Reader = nil 6331 body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest) 6332 if err != nil { 6333 return nil, err 6334 } 6335 reqHeaders.Set("Content-Type", "application/json") 6336 c.urlParams_.Set("alt", alt) 6337 c.urlParams_.Set("prettyPrint", "false") 6338 urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+resource}:testIamPermissions") 6339 urls += "?" + c.urlParams_.Encode() 6340 req, err := http.NewRequest("POST", urls, body) 6341 if err != nil { 6342 return nil, err 6343 } 6344 req.Header = reqHeaders 6345 googleapi.Expand(req.URL, map[string]string{ 6346 "resource": c.resource, 6347 }) 6348 return gensupport.SendRequest(c.ctx_, c.s.client, req) 6349} 6350 6351// Do executes the "containeranalysis.projects.occurrences.testIamPermissions" call. 6352// Exactly one of *TestIamPermissionsResponse or error will be non-nil. 6353// Any non-2xx status code is an error. Response headers are in either 6354// *TestIamPermissionsResponse.ServerResponse.Header or (if a response 6355// was returned at all) in error.(*googleapi.Error).Header. Use 6356// googleapi.IsNotModified to check whether the returned error was 6357// because http.StatusNotModified was returned. 6358func (c *ProjectsOccurrencesTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestIamPermissionsResponse, error) { 6359 gensupport.SetOptions(c.urlParams_, opts...) 6360 res, err := c.doRequest("json") 6361 if res != nil && res.StatusCode == http.StatusNotModified { 6362 if res.Body != nil { 6363 res.Body.Close() 6364 } 6365 return nil, &googleapi.Error{ 6366 Code: res.StatusCode, 6367 Header: res.Header, 6368 } 6369 } 6370 if err != nil { 6371 return nil, err 6372 } 6373 defer googleapi.CloseBody(res) 6374 if err := googleapi.CheckResponse(res); err != nil { 6375 return nil, err 6376 } 6377 ret := &TestIamPermissionsResponse{ 6378 ServerResponse: googleapi.ServerResponse{ 6379 Header: res.Header, 6380 HTTPStatusCode: res.StatusCode, 6381 }, 6382 } 6383 target := &ret 6384 if err := gensupport.DecodeResponse(target, res); err != nil { 6385 return nil, err 6386 } 6387 return ret, nil 6388 // { 6389 // "description": "Returns the permissions that a caller has on the specified note or occurrence resource. Requires list permission on the project (for example, \"storage.objects.list\" on the containing bucket for testing permission of an object). Attempting to call this method on a non-existent resource will result in a `NOT_FOUND` error if the user has list permission on the project, or a `PERMISSION_DENIED` error otherwise. The resource takes the following formats: `projects/{PROJECT_ID}/occurrences/{OCCURRENCE_ID}` for `Occurrences` and `projects/{PROJECT_ID}/notes/{NOTE_ID}` for `Notes`", 6390 // "flatPath": "v1alpha1/projects/{projectsId}/occurrences/{occurrencesId}:testIamPermissions", 6391 // "httpMethod": "POST", 6392 // "id": "containeranalysis.projects.occurrences.testIamPermissions", 6393 // "parameterOrder": [ 6394 // "resource" 6395 // ], 6396 // "parameters": { 6397 // "resource": { 6398 // "description": "REQUIRED: The resource for which the policy detail is being requested. See the operation documentation for the appropriate value for this field.", 6399 // "location": "path", 6400 // "pattern": "^projects/[^/]+/occurrences/[^/]+$", 6401 // "required": true, 6402 // "type": "string" 6403 // } 6404 // }, 6405 // "path": "v1alpha1/{+resource}:testIamPermissions", 6406 // "request": { 6407 // "$ref": "TestIamPermissionsRequest" 6408 // }, 6409 // "response": { 6410 // "$ref": "TestIamPermissionsResponse" 6411 // }, 6412 // "scopes": [ 6413 // "https://www.googleapis.com/auth/cloud-platform" 6414 // ] 6415 // } 6416 6417} 6418 6419// method id "containeranalysis.projects.operations.create": 6420 6421type ProjectsOperationsCreateCall struct { 6422 s *Service 6423 parent string 6424 createoperationrequest *CreateOperationRequest 6425 urlParams_ gensupport.URLParams 6426 ctx_ context.Context 6427 header_ http.Header 6428} 6429 6430// Create: Creates a new `Operation`. 6431// 6432// - parent: The project Id that this operation should be created under. 6433func (r *ProjectsOperationsService) Create(parent string, createoperationrequest *CreateOperationRequest) *ProjectsOperationsCreateCall { 6434 c := &ProjectsOperationsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 6435 c.parent = parent 6436 c.createoperationrequest = createoperationrequest 6437 return c 6438} 6439 6440// Fields allows partial responses to be retrieved. See 6441// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 6442// for more information. 6443func (c *ProjectsOperationsCreateCall) Fields(s ...googleapi.Field) *ProjectsOperationsCreateCall { 6444 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 6445 return c 6446} 6447 6448// Context sets the context to be used in this call's Do method. Any 6449// pending HTTP request will be aborted if the provided context is 6450// canceled. 6451func (c *ProjectsOperationsCreateCall) Context(ctx context.Context) *ProjectsOperationsCreateCall { 6452 c.ctx_ = ctx 6453 return c 6454} 6455 6456// Header returns an http.Header that can be modified by the caller to 6457// add HTTP headers to the request. 6458func (c *ProjectsOperationsCreateCall) Header() http.Header { 6459 if c.header_ == nil { 6460 c.header_ = make(http.Header) 6461 } 6462 return c.header_ 6463} 6464 6465func (c *ProjectsOperationsCreateCall) doRequest(alt string) (*http.Response, error) { 6466 reqHeaders := make(http.Header) 6467 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210410") 6468 for k, v := range c.header_ { 6469 reqHeaders[k] = v 6470 } 6471 reqHeaders.Set("User-Agent", c.s.userAgent()) 6472 var body io.Reader = nil 6473 body, err := googleapi.WithoutDataWrapper.JSONReader(c.createoperationrequest) 6474 if err != nil { 6475 return nil, err 6476 } 6477 reqHeaders.Set("Content-Type", "application/json") 6478 c.urlParams_.Set("alt", alt) 6479 c.urlParams_.Set("prettyPrint", "false") 6480 urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+parent}/operations") 6481 urls += "?" + c.urlParams_.Encode() 6482 req, err := http.NewRequest("POST", urls, body) 6483 if err != nil { 6484 return nil, err 6485 } 6486 req.Header = reqHeaders 6487 googleapi.Expand(req.URL, map[string]string{ 6488 "parent": c.parent, 6489 }) 6490 return gensupport.SendRequest(c.ctx_, c.s.client, req) 6491} 6492 6493// Do executes the "containeranalysis.projects.operations.create" call. 6494// Exactly one of *Operation or error will be non-nil. Any non-2xx 6495// status code is an error. Response headers are in either 6496// *Operation.ServerResponse.Header or (if a response was returned at 6497// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 6498// to check whether the returned error was because 6499// http.StatusNotModified was returned. 6500func (c *ProjectsOperationsCreateCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 6501 gensupport.SetOptions(c.urlParams_, opts...) 6502 res, err := c.doRequest("json") 6503 if res != nil && res.StatusCode == http.StatusNotModified { 6504 if res.Body != nil { 6505 res.Body.Close() 6506 } 6507 return nil, &googleapi.Error{ 6508 Code: res.StatusCode, 6509 Header: res.Header, 6510 } 6511 } 6512 if err != nil { 6513 return nil, err 6514 } 6515 defer googleapi.CloseBody(res) 6516 if err := googleapi.CheckResponse(res); err != nil { 6517 return nil, err 6518 } 6519 ret := &Operation{ 6520 ServerResponse: googleapi.ServerResponse{ 6521 Header: res.Header, 6522 HTTPStatusCode: res.StatusCode, 6523 }, 6524 } 6525 target := &ret 6526 if err := gensupport.DecodeResponse(target, res); err != nil { 6527 return nil, err 6528 } 6529 return ret, nil 6530 // { 6531 // "description": "Creates a new `Operation`.", 6532 // "flatPath": "v1alpha1/projects/{projectsId}/operations", 6533 // "httpMethod": "POST", 6534 // "id": "containeranalysis.projects.operations.create", 6535 // "parameterOrder": [ 6536 // "parent" 6537 // ], 6538 // "parameters": { 6539 // "parent": { 6540 // "description": "The project Id that this operation should be created under.", 6541 // "location": "path", 6542 // "pattern": "^projects/[^/]+$", 6543 // "required": true, 6544 // "type": "string" 6545 // } 6546 // }, 6547 // "path": "v1alpha1/{+parent}/operations", 6548 // "request": { 6549 // "$ref": "CreateOperationRequest" 6550 // }, 6551 // "response": { 6552 // "$ref": "Operation" 6553 // }, 6554 // "scopes": [ 6555 // "https://www.googleapis.com/auth/cloud-platform" 6556 // ] 6557 // } 6558 6559} 6560 6561// method id "containeranalysis.projects.operations.patch": 6562 6563type ProjectsOperationsPatchCall struct { 6564 s *Service 6565 name string 6566 updateoperationrequest *UpdateOperationRequest 6567 urlParams_ gensupport.URLParams 6568 ctx_ context.Context 6569 header_ http.Header 6570} 6571 6572// Patch: Updates an existing operation returns an error if operation 6573// does not exist. The only valid operations are to update mark the done 6574// bit change the result. 6575// 6576// - name: The name of the Operation. Should be of the form 6577// "projects/{provider_id}/operations/{operation_id}". 6578func (r *ProjectsOperationsService) Patch(name string, updateoperationrequest *UpdateOperationRequest) *ProjectsOperationsPatchCall { 6579 c := &ProjectsOperationsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} 6580 c.name = name 6581 c.updateoperationrequest = updateoperationrequest 6582 return c 6583} 6584 6585// Fields allows partial responses to be retrieved. See 6586// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 6587// for more information. 6588func (c *ProjectsOperationsPatchCall) Fields(s ...googleapi.Field) *ProjectsOperationsPatchCall { 6589 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 6590 return c 6591} 6592 6593// Context sets the context to be used in this call's Do method. Any 6594// pending HTTP request will be aborted if the provided context is 6595// canceled. 6596func (c *ProjectsOperationsPatchCall) Context(ctx context.Context) *ProjectsOperationsPatchCall { 6597 c.ctx_ = ctx 6598 return c 6599} 6600 6601// Header returns an http.Header that can be modified by the caller to 6602// add HTTP headers to the request. 6603func (c *ProjectsOperationsPatchCall) Header() http.Header { 6604 if c.header_ == nil { 6605 c.header_ = make(http.Header) 6606 } 6607 return c.header_ 6608} 6609 6610func (c *ProjectsOperationsPatchCall) doRequest(alt string) (*http.Response, error) { 6611 reqHeaders := make(http.Header) 6612 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210410") 6613 for k, v := range c.header_ { 6614 reqHeaders[k] = v 6615 } 6616 reqHeaders.Set("User-Agent", c.s.userAgent()) 6617 var body io.Reader = nil 6618 body, err := googleapi.WithoutDataWrapper.JSONReader(c.updateoperationrequest) 6619 if err != nil { 6620 return nil, err 6621 } 6622 reqHeaders.Set("Content-Type", "application/json") 6623 c.urlParams_.Set("alt", alt) 6624 c.urlParams_.Set("prettyPrint", "false") 6625 urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+name}") 6626 urls += "?" + c.urlParams_.Encode() 6627 req, err := http.NewRequest("PATCH", urls, body) 6628 if err != nil { 6629 return nil, err 6630 } 6631 req.Header = reqHeaders 6632 googleapi.Expand(req.URL, map[string]string{ 6633 "name": c.name, 6634 }) 6635 return gensupport.SendRequest(c.ctx_, c.s.client, req) 6636} 6637 6638// Do executes the "containeranalysis.projects.operations.patch" call. 6639// Exactly one of *Operation or error will be non-nil. Any non-2xx 6640// status code is an error. Response headers are in either 6641// *Operation.ServerResponse.Header or (if a response was returned at 6642// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 6643// to check whether the returned error was because 6644// http.StatusNotModified was returned. 6645func (c *ProjectsOperationsPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 6646 gensupport.SetOptions(c.urlParams_, opts...) 6647 res, err := c.doRequest("json") 6648 if res != nil && res.StatusCode == http.StatusNotModified { 6649 if res.Body != nil { 6650 res.Body.Close() 6651 } 6652 return nil, &googleapi.Error{ 6653 Code: res.StatusCode, 6654 Header: res.Header, 6655 } 6656 } 6657 if err != nil { 6658 return nil, err 6659 } 6660 defer googleapi.CloseBody(res) 6661 if err := googleapi.CheckResponse(res); err != nil { 6662 return nil, err 6663 } 6664 ret := &Operation{ 6665 ServerResponse: googleapi.ServerResponse{ 6666 Header: res.Header, 6667 HTTPStatusCode: res.StatusCode, 6668 }, 6669 } 6670 target := &ret 6671 if err := gensupport.DecodeResponse(target, res); err != nil { 6672 return nil, err 6673 } 6674 return ret, nil 6675 // { 6676 // "description": "Updates an existing operation returns an error if operation does not exist. The only valid operations are to update mark the done bit change the result.", 6677 // "flatPath": "v1alpha1/projects/{projectsId}/operations/{operationsId}", 6678 // "httpMethod": "PATCH", 6679 // "id": "containeranalysis.projects.operations.patch", 6680 // "parameterOrder": [ 6681 // "name" 6682 // ], 6683 // "parameters": { 6684 // "name": { 6685 // "description": "The name of the Operation. Should be of the form \"projects/{provider_id}/operations/{operation_id}\".", 6686 // "location": "path", 6687 // "pattern": "^projects/[^/]+/operations/[^/]+$", 6688 // "required": true, 6689 // "type": "string" 6690 // } 6691 // }, 6692 // "path": "v1alpha1/{+name}", 6693 // "request": { 6694 // "$ref": "UpdateOperationRequest" 6695 // }, 6696 // "response": { 6697 // "$ref": "Operation" 6698 // }, 6699 // "scopes": [ 6700 // "https://www.googleapis.com/auth/cloud-platform" 6701 // ] 6702 // } 6703 6704} 6705 6706// method id "containeranalysis.projects.scanConfigs.get": 6707 6708type ProjectsScanConfigsGetCall struct { 6709 s *Service 6710 name string 6711 urlParams_ gensupport.URLParams 6712 ifNoneMatch_ string 6713 ctx_ context.Context 6714 header_ http.Header 6715} 6716 6717// Get: Gets a specific scan configuration for a project. 6718// 6719// - name: The name of the ScanConfig in the form 6720// projects/{project_id}/scanConfigs/{scan_config_id}. 6721func (r *ProjectsScanConfigsService) Get(name string) *ProjectsScanConfigsGetCall { 6722 c := &ProjectsScanConfigsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 6723 c.name = name 6724 return c 6725} 6726 6727// Fields allows partial responses to be retrieved. See 6728// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 6729// for more information. 6730func (c *ProjectsScanConfigsGetCall) Fields(s ...googleapi.Field) *ProjectsScanConfigsGetCall { 6731 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 6732 return c 6733} 6734 6735// IfNoneMatch sets the optional parameter which makes the operation 6736// fail if the object's ETag matches the given value. This is useful for 6737// getting updates only after the object has changed since the last 6738// request. Use googleapi.IsNotModified to check whether the response 6739// error from Do is the result of In-None-Match. 6740func (c *ProjectsScanConfigsGetCall) IfNoneMatch(entityTag string) *ProjectsScanConfigsGetCall { 6741 c.ifNoneMatch_ = entityTag 6742 return c 6743} 6744 6745// Context sets the context to be used in this call's Do method. Any 6746// pending HTTP request will be aborted if the provided context is 6747// canceled. 6748func (c *ProjectsScanConfigsGetCall) Context(ctx context.Context) *ProjectsScanConfigsGetCall { 6749 c.ctx_ = ctx 6750 return c 6751} 6752 6753// Header returns an http.Header that can be modified by the caller to 6754// add HTTP headers to the request. 6755func (c *ProjectsScanConfigsGetCall) Header() http.Header { 6756 if c.header_ == nil { 6757 c.header_ = make(http.Header) 6758 } 6759 return c.header_ 6760} 6761 6762func (c *ProjectsScanConfigsGetCall) doRequest(alt string) (*http.Response, error) { 6763 reqHeaders := make(http.Header) 6764 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210410") 6765 for k, v := range c.header_ { 6766 reqHeaders[k] = v 6767 } 6768 reqHeaders.Set("User-Agent", c.s.userAgent()) 6769 if c.ifNoneMatch_ != "" { 6770 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 6771 } 6772 var body io.Reader = nil 6773 c.urlParams_.Set("alt", alt) 6774 c.urlParams_.Set("prettyPrint", "false") 6775 urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+name}") 6776 urls += "?" + c.urlParams_.Encode() 6777 req, err := http.NewRequest("GET", urls, body) 6778 if err != nil { 6779 return nil, err 6780 } 6781 req.Header = reqHeaders 6782 googleapi.Expand(req.URL, map[string]string{ 6783 "name": c.name, 6784 }) 6785 return gensupport.SendRequest(c.ctx_, c.s.client, req) 6786} 6787 6788// Do executes the "containeranalysis.projects.scanConfigs.get" call. 6789// Exactly one of *ScanConfig or error will be non-nil. Any non-2xx 6790// status code is an error. Response headers are in either 6791// *ScanConfig.ServerResponse.Header or (if a response was returned at 6792// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 6793// to check whether the returned error was because 6794// http.StatusNotModified was returned. 6795func (c *ProjectsScanConfigsGetCall) Do(opts ...googleapi.CallOption) (*ScanConfig, error) { 6796 gensupport.SetOptions(c.urlParams_, opts...) 6797 res, err := c.doRequest("json") 6798 if res != nil && res.StatusCode == http.StatusNotModified { 6799 if res.Body != nil { 6800 res.Body.Close() 6801 } 6802 return nil, &googleapi.Error{ 6803 Code: res.StatusCode, 6804 Header: res.Header, 6805 } 6806 } 6807 if err != nil { 6808 return nil, err 6809 } 6810 defer googleapi.CloseBody(res) 6811 if err := googleapi.CheckResponse(res); err != nil { 6812 return nil, err 6813 } 6814 ret := &ScanConfig{ 6815 ServerResponse: googleapi.ServerResponse{ 6816 Header: res.Header, 6817 HTTPStatusCode: res.StatusCode, 6818 }, 6819 } 6820 target := &ret 6821 if err := gensupport.DecodeResponse(target, res); err != nil { 6822 return nil, err 6823 } 6824 return ret, nil 6825 // { 6826 // "description": "Gets a specific scan configuration for a project.", 6827 // "flatPath": "v1alpha1/projects/{projectsId}/scanConfigs/{scanConfigsId}", 6828 // "httpMethod": "GET", 6829 // "id": "containeranalysis.projects.scanConfigs.get", 6830 // "parameterOrder": [ 6831 // "name" 6832 // ], 6833 // "parameters": { 6834 // "name": { 6835 // "description": "The name of the ScanConfig in the form projects/{project_id}/scanConfigs/{scan_config_id}", 6836 // "location": "path", 6837 // "pattern": "^projects/[^/]+/scanConfigs/[^/]+$", 6838 // "required": true, 6839 // "type": "string" 6840 // } 6841 // }, 6842 // "path": "v1alpha1/{+name}", 6843 // "response": { 6844 // "$ref": "ScanConfig" 6845 // }, 6846 // "scopes": [ 6847 // "https://www.googleapis.com/auth/cloud-platform" 6848 // ] 6849 // } 6850 6851} 6852 6853// method id "containeranalysis.projects.scanConfigs.list": 6854 6855type ProjectsScanConfigsListCall struct { 6856 s *Service 6857 parent string 6858 urlParams_ gensupport.URLParams 6859 ifNoneMatch_ string 6860 ctx_ context.Context 6861 header_ http.Header 6862} 6863 6864// List: Lists scan configurations for a project. 6865// 6866// - parent: This containers the project Id i.e.: projects/{project_id}. 6867func (r *ProjectsScanConfigsService) List(parent string) *ProjectsScanConfigsListCall { 6868 c := &ProjectsScanConfigsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 6869 c.parent = parent 6870 return c 6871} 6872 6873// Filter sets the optional parameter "filter": The filter expression. 6874func (c *ProjectsScanConfigsListCall) Filter(filter string) *ProjectsScanConfigsListCall { 6875 c.urlParams_.Set("filter", filter) 6876 return c 6877} 6878 6879// PageSize sets the optional parameter "pageSize": The number of items 6880// to return. 6881func (c *ProjectsScanConfigsListCall) PageSize(pageSize int64) *ProjectsScanConfigsListCall { 6882 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) 6883 return c 6884} 6885 6886// PageToken sets the optional parameter "pageToken": The page token to 6887// use for the next request. 6888func (c *ProjectsScanConfigsListCall) PageToken(pageToken string) *ProjectsScanConfigsListCall { 6889 c.urlParams_.Set("pageToken", pageToken) 6890 return c 6891} 6892 6893// Fields allows partial responses to be retrieved. See 6894// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 6895// for more information. 6896func (c *ProjectsScanConfigsListCall) Fields(s ...googleapi.Field) *ProjectsScanConfigsListCall { 6897 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 6898 return c 6899} 6900 6901// IfNoneMatch sets the optional parameter which makes the operation 6902// fail if the object's ETag matches the given value. This is useful for 6903// getting updates only after the object has changed since the last 6904// request. Use googleapi.IsNotModified to check whether the response 6905// error from Do is the result of In-None-Match. 6906func (c *ProjectsScanConfigsListCall) IfNoneMatch(entityTag string) *ProjectsScanConfigsListCall { 6907 c.ifNoneMatch_ = entityTag 6908 return c 6909} 6910 6911// Context sets the context to be used in this call's Do method. Any 6912// pending HTTP request will be aborted if the provided context is 6913// canceled. 6914func (c *ProjectsScanConfigsListCall) Context(ctx context.Context) *ProjectsScanConfigsListCall { 6915 c.ctx_ = ctx 6916 return c 6917} 6918 6919// Header returns an http.Header that can be modified by the caller to 6920// add HTTP headers to the request. 6921func (c *ProjectsScanConfigsListCall) Header() http.Header { 6922 if c.header_ == nil { 6923 c.header_ = make(http.Header) 6924 } 6925 return c.header_ 6926} 6927 6928func (c *ProjectsScanConfigsListCall) doRequest(alt string) (*http.Response, error) { 6929 reqHeaders := make(http.Header) 6930 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210410") 6931 for k, v := range c.header_ { 6932 reqHeaders[k] = v 6933 } 6934 reqHeaders.Set("User-Agent", c.s.userAgent()) 6935 if c.ifNoneMatch_ != "" { 6936 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 6937 } 6938 var body io.Reader = nil 6939 c.urlParams_.Set("alt", alt) 6940 c.urlParams_.Set("prettyPrint", "false") 6941 urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+parent}/scanConfigs") 6942 urls += "?" + c.urlParams_.Encode() 6943 req, err := http.NewRequest("GET", urls, body) 6944 if err != nil { 6945 return nil, err 6946 } 6947 req.Header = reqHeaders 6948 googleapi.Expand(req.URL, map[string]string{ 6949 "parent": c.parent, 6950 }) 6951 return gensupport.SendRequest(c.ctx_, c.s.client, req) 6952} 6953 6954// Do executes the "containeranalysis.projects.scanConfigs.list" call. 6955// Exactly one of *ListScanConfigsResponse or error will be non-nil. Any 6956// non-2xx status code is an error. Response headers are in either 6957// *ListScanConfigsResponse.ServerResponse.Header or (if a response was 6958// returned at all) in error.(*googleapi.Error).Header. Use 6959// googleapi.IsNotModified to check whether the returned error was 6960// because http.StatusNotModified was returned. 6961func (c *ProjectsScanConfigsListCall) Do(opts ...googleapi.CallOption) (*ListScanConfigsResponse, error) { 6962 gensupport.SetOptions(c.urlParams_, opts...) 6963 res, err := c.doRequest("json") 6964 if res != nil && res.StatusCode == http.StatusNotModified { 6965 if res.Body != nil { 6966 res.Body.Close() 6967 } 6968 return nil, &googleapi.Error{ 6969 Code: res.StatusCode, 6970 Header: res.Header, 6971 } 6972 } 6973 if err != nil { 6974 return nil, err 6975 } 6976 defer googleapi.CloseBody(res) 6977 if err := googleapi.CheckResponse(res); err != nil { 6978 return nil, err 6979 } 6980 ret := &ListScanConfigsResponse{ 6981 ServerResponse: googleapi.ServerResponse{ 6982 Header: res.Header, 6983 HTTPStatusCode: res.StatusCode, 6984 }, 6985 } 6986 target := &ret 6987 if err := gensupport.DecodeResponse(target, res); err != nil { 6988 return nil, err 6989 } 6990 return ret, nil 6991 // { 6992 // "description": "Lists scan configurations for a project.", 6993 // "flatPath": "v1alpha1/projects/{projectsId}/scanConfigs", 6994 // "httpMethod": "GET", 6995 // "id": "containeranalysis.projects.scanConfigs.list", 6996 // "parameterOrder": [ 6997 // "parent" 6998 // ], 6999 // "parameters": { 7000 // "filter": { 7001 // "description": "The filter expression.", 7002 // "location": "query", 7003 // "type": "string" 7004 // }, 7005 // "pageSize": { 7006 // "description": "The number of items to return.", 7007 // "format": "int32", 7008 // "location": "query", 7009 // "type": "integer" 7010 // }, 7011 // "pageToken": { 7012 // "description": "The page token to use for the next request.", 7013 // "location": "query", 7014 // "type": "string" 7015 // }, 7016 // "parent": { 7017 // "description": "This containers the project Id i.e.: projects/{project_id}", 7018 // "location": "path", 7019 // "pattern": "^projects/[^/]+$", 7020 // "required": true, 7021 // "type": "string" 7022 // } 7023 // }, 7024 // "path": "v1alpha1/{+parent}/scanConfigs", 7025 // "response": { 7026 // "$ref": "ListScanConfigsResponse" 7027 // }, 7028 // "scopes": [ 7029 // "https://www.googleapis.com/auth/cloud-platform" 7030 // ] 7031 // } 7032 7033} 7034 7035// Pages invokes f for each page of results. 7036// A non-nil error returned from f will halt the iteration. 7037// The provided context supersedes any context provided to the Context method. 7038func (c *ProjectsScanConfigsListCall) Pages(ctx context.Context, f func(*ListScanConfigsResponse) error) error { 7039 c.ctx_ = ctx 7040 defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point 7041 for { 7042 x, err := c.Do() 7043 if err != nil { 7044 return err 7045 } 7046 if err := f(x); err != nil { 7047 return err 7048 } 7049 if x.NextPageToken == "" { 7050 return nil 7051 } 7052 c.PageToken(x.NextPageToken) 7053 } 7054} 7055 7056// method id "containeranalysis.projects.scanConfigs.patch": 7057 7058type ProjectsScanConfigsPatchCall struct { 7059 s *Service 7060 name string 7061 scanconfig *ScanConfig 7062 urlParams_ gensupport.URLParams 7063 ctx_ context.Context 7064 header_ http.Header 7065} 7066 7067// Patch: Updates the scan configuration to a new value. 7068// 7069// - name: The scan config to update of the form 7070// projects/{project_id}/scanConfigs/{scan_config_id}. 7071func (r *ProjectsScanConfigsService) Patch(name string, scanconfig *ScanConfig) *ProjectsScanConfigsPatchCall { 7072 c := &ProjectsScanConfigsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} 7073 c.name = name 7074 c.scanconfig = scanconfig 7075 return c 7076} 7077 7078// UpdateMask sets the optional parameter "updateMask": The fields to 7079// update. 7080func (c *ProjectsScanConfigsPatchCall) UpdateMask(updateMask string) *ProjectsScanConfigsPatchCall { 7081 c.urlParams_.Set("updateMask", updateMask) 7082 return c 7083} 7084 7085// Fields allows partial responses to be retrieved. See 7086// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 7087// for more information. 7088func (c *ProjectsScanConfigsPatchCall) Fields(s ...googleapi.Field) *ProjectsScanConfigsPatchCall { 7089 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 7090 return c 7091} 7092 7093// Context sets the context to be used in this call's Do method. Any 7094// pending HTTP request will be aborted if the provided context is 7095// canceled. 7096func (c *ProjectsScanConfigsPatchCall) Context(ctx context.Context) *ProjectsScanConfigsPatchCall { 7097 c.ctx_ = ctx 7098 return c 7099} 7100 7101// Header returns an http.Header that can be modified by the caller to 7102// add HTTP headers to the request. 7103func (c *ProjectsScanConfigsPatchCall) Header() http.Header { 7104 if c.header_ == nil { 7105 c.header_ = make(http.Header) 7106 } 7107 return c.header_ 7108} 7109 7110func (c *ProjectsScanConfigsPatchCall) doRequest(alt string) (*http.Response, error) { 7111 reqHeaders := make(http.Header) 7112 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210410") 7113 for k, v := range c.header_ { 7114 reqHeaders[k] = v 7115 } 7116 reqHeaders.Set("User-Agent", c.s.userAgent()) 7117 var body io.Reader = nil 7118 body, err := googleapi.WithoutDataWrapper.JSONReader(c.scanconfig) 7119 if err != nil { 7120 return nil, err 7121 } 7122 reqHeaders.Set("Content-Type", "application/json") 7123 c.urlParams_.Set("alt", alt) 7124 c.urlParams_.Set("prettyPrint", "false") 7125 urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+name}") 7126 urls += "?" + c.urlParams_.Encode() 7127 req, err := http.NewRequest("PATCH", urls, body) 7128 if err != nil { 7129 return nil, err 7130 } 7131 req.Header = reqHeaders 7132 googleapi.Expand(req.URL, map[string]string{ 7133 "name": c.name, 7134 }) 7135 return gensupport.SendRequest(c.ctx_, c.s.client, req) 7136} 7137 7138// Do executes the "containeranalysis.projects.scanConfigs.patch" call. 7139// Exactly one of *ScanConfig or error will be non-nil. Any non-2xx 7140// status code is an error. Response headers are in either 7141// *ScanConfig.ServerResponse.Header or (if a response was returned at 7142// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 7143// to check whether the returned error was because 7144// http.StatusNotModified was returned. 7145func (c *ProjectsScanConfigsPatchCall) Do(opts ...googleapi.CallOption) (*ScanConfig, error) { 7146 gensupport.SetOptions(c.urlParams_, opts...) 7147 res, err := c.doRequest("json") 7148 if res != nil && res.StatusCode == http.StatusNotModified { 7149 if res.Body != nil { 7150 res.Body.Close() 7151 } 7152 return nil, &googleapi.Error{ 7153 Code: res.StatusCode, 7154 Header: res.Header, 7155 } 7156 } 7157 if err != nil { 7158 return nil, err 7159 } 7160 defer googleapi.CloseBody(res) 7161 if err := googleapi.CheckResponse(res); err != nil { 7162 return nil, err 7163 } 7164 ret := &ScanConfig{ 7165 ServerResponse: googleapi.ServerResponse{ 7166 Header: res.Header, 7167 HTTPStatusCode: res.StatusCode, 7168 }, 7169 } 7170 target := &ret 7171 if err := gensupport.DecodeResponse(target, res); err != nil { 7172 return nil, err 7173 } 7174 return ret, nil 7175 // { 7176 // "description": "Updates the scan configuration to a new value.", 7177 // "flatPath": "v1alpha1/projects/{projectsId}/scanConfigs/{scanConfigsId}", 7178 // "httpMethod": "PATCH", 7179 // "id": "containeranalysis.projects.scanConfigs.patch", 7180 // "parameterOrder": [ 7181 // "name" 7182 // ], 7183 // "parameters": { 7184 // "name": { 7185 // "description": "The scan config to update of the form projects/{project_id}/scanConfigs/{scan_config_id}.", 7186 // "location": "path", 7187 // "pattern": "^projects/[^/]+/scanConfigs/[^/]+$", 7188 // "required": true, 7189 // "type": "string" 7190 // }, 7191 // "updateMask": { 7192 // "description": "The fields to update.", 7193 // "format": "google-fieldmask", 7194 // "location": "query", 7195 // "type": "string" 7196 // } 7197 // }, 7198 // "path": "v1alpha1/{+name}", 7199 // "request": { 7200 // "$ref": "ScanConfig" 7201 // }, 7202 // "response": { 7203 // "$ref": "ScanConfig" 7204 // }, 7205 // "scopes": [ 7206 // "https://www.googleapis.com/auth/cloud-platform" 7207 // ] 7208 // } 7209 7210} 7211 7212// method id "containeranalysis.providers.notes.create": 7213 7214type ProvidersNotesCreateCall struct { 7215 s *Service 7216 name string 7217 note *Note 7218 urlParams_ gensupport.URLParams 7219 ctx_ context.Context 7220 header_ http.Header 7221} 7222 7223// Create: Creates a new `Note`. 7224// 7225// - name: The name of the project. Should be of the form 7226// "providers/{provider_id}". @Deprecated. 7227func (r *ProvidersNotesService) Create(name string, note *Note) *ProvidersNotesCreateCall { 7228 c := &ProvidersNotesCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 7229 c.name = name 7230 c.note = note 7231 return c 7232} 7233 7234// NoteId sets the optional parameter "noteId": The ID to use for this 7235// note. 7236func (c *ProvidersNotesCreateCall) NoteId(noteId string) *ProvidersNotesCreateCall { 7237 c.urlParams_.Set("noteId", noteId) 7238 return c 7239} 7240 7241// Parent sets the optional parameter "parent": This field contains the 7242// project Id for example: "projects/{project_id} 7243func (c *ProvidersNotesCreateCall) Parent(parent string) *ProvidersNotesCreateCall { 7244 c.urlParams_.Set("parent", parent) 7245 return c 7246} 7247 7248// Fields allows partial responses to be retrieved. See 7249// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 7250// for more information. 7251func (c *ProvidersNotesCreateCall) Fields(s ...googleapi.Field) *ProvidersNotesCreateCall { 7252 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 7253 return c 7254} 7255 7256// Context sets the context to be used in this call's Do method. Any 7257// pending HTTP request will be aborted if the provided context is 7258// canceled. 7259func (c *ProvidersNotesCreateCall) Context(ctx context.Context) *ProvidersNotesCreateCall { 7260 c.ctx_ = ctx 7261 return c 7262} 7263 7264// Header returns an http.Header that can be modified by the caller to 7265// add HTTP headers to the request. 7266func (c *ProvidersNotesCreateCall) Header() http.Header { 7267 if c.header_ == nil { 7268 c.header_ = make(http.Header) 7269 } 7270 return c.header_ 7271} 7272 7273func (c *ProvidersNotesCreateCall) doRequest(alt string) (*http.Response, error) { 7274 reqHeaders := make(http.Header) 7275 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210410") 7276 for k, v := range c.header_ { 7277 reqHeaders[k] = v 7278 } 7279 reqHeaders.Set("User-Agent", c.s.userAgent()) 7280 var body io.Reader = nil 7281 body, err := googleapi.WithoutDataWrapper.JSONReader(c.note) 7282 if err != nil { 7283 return nil, err 7284 } 7285 reqHeaders.Set("Content-Type", "application/json") 7286 c.urlParams_.Set("alt", alt) 7287 c.urlParams_.Set("prettyPrint", "false") 7288 urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+name}/notes") 7289 urls += "?" + c.urlParams_.Encode() 7290 req, err := http.NewRequest("POST", urls, body) 7291 if err != nil { 7292 return nil, err 7293 } 7294 req.Header = reqHeaders 7295 googleapi.Expand(req.URL, map[string]string{ 7296 "name": c.name, 7297 }) 7298 return gensupport.SendRequest(c.ctx_, c.s.client, req) 7299} 7300 7301// Do executes the "containeranalysis.providers.notes.create" call. 7302// Exactly one of *Note or error will be non-nil. Any non-2xx status 7303// code is an error. Response headers are in either 7304// *Note.ServerResponse.Header or (if a response was returned at all) in 7305// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 7306// whether the returned error was because http.StatusNotModified was 7307// returned. 7308func (c *ProvidersNotesCreateCall) Do(opts ...googleapi.CallOption) (*Note, error) { 7309 gensupport.SetOptions(c.urlParams_, opts...) 7310 res, err := c.doRequest("json") 7311 if res != nil && res.StatusCode == http.StatusNotModified { 7312 if res.Body != nil { 7313 res.Body.Close() 7314 } 7315 return nil, &googleapi.Error{ 7316 Code: res.StatusCode, 7317 Header: res.Header, 7318 } 7319 } 7320 if err != nil { 7321 return nil, err 7322 } 7323 defer googleapi.CloseBody(res) 7324 if err := googleapi.CheckResponse(res); err != nil { 7325 return nil, err 7326 } 7327 ret := &Note{ 7328 ServerResponse: googleapi.ServerResponse{ 7329 Header: res.Header, 7330 HTTPStatusCode: res.StatusCode, 7331 }, 7332 } 7333 target := &ret 7334 if err := gensupport.DecodeResponse(target, res); err != nil { 7335 return nil, err 7336 } 7337 return ret, nil 7338 // { 7339 // "description": "Creates a new `Note`.", 7340 // "flatPath": "v1alpha1/providers/{providersId}/notes", 7341 // "httpMethod": "POST", 7342 // "id": "containeranalysis.providers.notes.create", 7343 // "parameterOrder": [ 7344 // "name" 7345 // ], 7346 // "parameters": { 7347 // "name": { 7348 // "description": "The name of the project. Should be of the form \"providers/{provider_id}\". @Deprecated", 7349 // "location": "path", 7350 // "pattern": "^providers/[^/]+$", 7351 // "required": true, 7352 // "type": "string" 7353 // }, 7354 // "noteId": { 7355 // "description": "The ID to use for this note.", 7356 // "location": "query", 7357 // "type": "string" 7358 // }, 7359 // "parent": { 7360 // "description": "This field contains the project Id for example: \"projects/{project_id}", 7361 // "location": "query", 7362 // "type": "string" 7363 // } 7364 // }, 7365 // "path": "v1alpha1/{+name}/notes", 7366 // "request": { 7367 // "$ref": "Note" 7368 // }, 7369 // "response": { 7370 // "$ref": "Note" 7371 // }, 7372 // "scopes": [ 7373 // "https://www.googleapis.com/auth/cloud-platform" 7374 // ] 7375 // } 7376 7377} 7378 7379// method id "containeranalysis.providers.notes.delete": 7380 7381type ProvidersNotesDeleteCall struct { 7382 s *Service 7383 name string 7384 urlParams_ gensupport.URLParams 7385 ctx_ context.Context 7386 header_ http.Header 7387} 7388 7389// Delete: Deletes the given `Note` from the system. 7390// 7391// - name: The name of the note in the form of 7392// "providers/{provider_id}/notes/{NOTE_ID}". 7393func (r *ProvidersNotesService) Delete(name string) *ProvidersNotesDeleteCall { 7394 c := &ProvidersNotesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} 7395 c.name = name 7396 return c 7397} 7398 7399// Fields allows partial responses to be retrieved. See 7400// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 7401// for more information. 7402func (c *ProvidersNotesDeleteCall) Fields(s ...googleapi.Field) *ProvidersNotesDeleteCall { 7403 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 7404 return c 7405} 7406 7407// Context sets the context to be used in this call's Do method. Any 7408// pending HTTP request will be aborted if the provided context is 7409// canceled. 7410func (c *ProvidersNotesDeleteCall) Context(ctx context.Context) *ProvidersNotesDeleteCall { 7411 c.ctx_ = ctx 7412 return c 7413} 7414 7415// Header returns an http.Header that can be modified by the caller to 7416// add HTTP headers to the request. 7417func (c *ProvidersNotesDeleteCall) Header() http.Header { 7418 if c.header_ == nil { 7419 c.header_ = make(http.Header) 7420 } 7421 return c.header_ 7422} 7423 7424func (c *ProvidersNotesDeleteCall) doRequest(alt string) (*http.Response, error) { 7425 reqHeaders := make(http.Header) 7426 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210410") 7427 for k, v := range c.header_ { 7428 reqHeaders[k] = v 7429 } 7430 reqHeaders.Set("User-Agent", c.s.userAgent()) 7431 var body io.Reader = nil 7432 c.urlParams_.Set("alt", alt) 7433 c.urlParams_.Set("prettyPrint", "false") 7434 urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+name}") 7435 urls += "?" + c.urlParams_.Encode() 7436 req, err := http.NewRequest("DELETE", urls, body) 7437 if err != nil { 7438 return nil, err 7439 } 7440 req.Header = reqHeaders 7441 googleapi.Expand(req.URL, map[string]string{ 7442 "name": c.name, 7443 }) 7444 return gensupport.SendRequest(c.ctx_, c.s.client, req) 7445} 7446 7447// Do executes the "containeranalysis.providers.notes.delete" call. 7448// Exactly one of *Empty or error will be non-nil. Any non-2xx status 7449// code is an error. Response headers are in either 7450// *Empty.ServerResponse.Header or (if a response was returned at all) 7451// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 7452// check whether the returned error was because http.StatusNotModified 7453// was returned. 7454func (c *ProvidersNotesDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) { 7455 gensupport.SetOptions(c.urlParams_, opts...) 7456 res, err := c.doRequest("json") 7457 if res != nil && res.StatusCode == http.StatusNotModified { 7458 if res.Body != nil { 7459 res.Body.Close() 7460 } 7461 return nil, &googleapi.Error{ 7462 Code: res.StatusCode, 7463 Header: res.Header, 7464 } 7465 } 7466 if err != nil { 7467 return nil, err 7468 } 7469 defer googleapi.CloseBody(res) 7470 if err := googleapi.CheckResponse(res); err != nil { 7471 return nil, err 7472 } 7473 ret := &Empty{ 7474 ServerResponse: googleapi.ServerResponse{ 7475 Header: res.Header, 7476 HTTPStatusCode: res.StatusCode, 7477 }, 7478 } 7479 target := &ret 7480 if err := gensupport.DecodeResponse(target, res); err != nil { 7481 return nil, err 7482 } 7483 return ret, nil 7484 // { 7485 // "description": "Deletes the given `Note` from the system.", 7486 // "flatPath": "v1alpha1/providers/{providersId}/notes/{notesId}", 7487 // "httpMethod": "DELETE", 7488 // "id": "containeranalysis.providers.notes.delete", 7489 // "parameterOrder": [ 7490 // "name" 7491 // ], 7492 // "parameters": { 7493 // "name": { 7494 // "description": "The name of the note in the form of \"providers/{provider_id}/notes/{NOTE_ID}\"", 7495 // "location": "path", 7496 // "pattern": "^providers/[^/]+/notes/[^/]+$", 7497 // "required": true, 7498 // "type": "string" 7499 // } 7500 // }, 7501 // "path": "v1alpha1/{+name}", 7502 // "response": { 7503 // "$ref": "Empty" 7504 // }, 7505 // "scopes": [ 7506 // "https://www.googleapis.com/auth/cloud-platform" 7507 // ] 7508 // } 7509 7510} 7511 7512// method id "containeranalysis.providers.notes.get": 7513 7514type ProvidersNotesGetCall struct { 7515 s *Service 7516 name string 7517 urlParams_ gensupport.URLParams 7518 ifNoneMatch_ string 7519 ctx_ context.Context 7520 header_ http.Header 7521} 7522 7523// Get: Returns the requested `Note`. 7524// 7525// - name: The name of the note in the form of 7526// "providers/{provider_id}/notes/{NOTE_ID}". 7527func (r *ProvidersNotesService) Get(name string) *ProvidersNotesGetCall { 7528 c := &ProvidersNotesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 7529 c.name = name 7530 return c 7531} 7532 7533// Fields allows partial responses to be retrieved. See 7534// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 7535// for more information. 7536func (c *ProvidersNotesGetCall) Fields(s ...googleapi.Field) *ProvidersNotesGetCall { 7537 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 7538 return c 7539} 7540 7541// IfNoneMatch sets the optional parameter which makes the operation 7542// fail if the object's ETag matches the given value. This is useful for 7543// getting updates only after the object has changed since the last 7544// request. Use googleapi.IsNotModified to check whether the response 7545// error from Do is the result of In-None-Match. 7546func (c *ProvidersNotesGetCall) IfNoneMatch(entityTag string) *ProvidersNotesGetCall { 7547 c.ifNoneMatch_ = entityTag 7548 return c 7549} 7550 7551// Context sets the context to be used in this call's Do method. Any 7552// pending HTTP request will be aborted if the provided context is 7553// canceled. 7554func (c *ProvidersNotesGetCall) Context(ctx context.Context) *ProvidersNotesGetCall { 7555 c.ctx_ = ctx 7556 return c 7557} 7558 7559// Header returns an http.Header that can be modified by the caller to 7560// add HTTP headers to the request. 7561func (c *ProvidersNotesGetCall) Header() http.Header { 7562 if c.header_ == nil { 7563 c.header_ = make(http.Header) 7564 } 7565 return c.header_ 7566} 7567 7568func (c *ProvidersNotesGetCall) doRequest(alt string) (*http.Response, error) { 7569 reqHeaders := make(http.Header) 7570 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210410") 7571 for k, v := range c.header_ { 7572 reqHeaders[k] = v 7573 } 7574 reqHeaders.Set("User-Agent", c.s.userAgent()) 7575 if c.ifNoneMatch_ != "" { 7576 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 7577 } 7578 var body io.Reader = nil 7579 c.urlParams_.Set("alt", alt) 7580 c.urlParams_.Set("prettyPrint", "false") 7581 urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+name}") 7582 urls += "?" + c.urlParams_.Encode() 7583 req, err := http.NewRequest("GET", urls, body) 7584 if err != nil { 7585 return nil, err 7586 } 7587 req.Header = reqHeaders 7588 googleapi.Expand(req.URL, map[string]string{ 7589 "name": c.name, 7590 }) 7591 return gensupport.SendRequest(c.ctx_, c.s.client, req) 7592} 7593 7594// Do executes the "containeranalysis.providers.notes.get" call. 7595// Exactly one of *Note or error will be non-nil. Any non-2xx status 7596// code is an error. Response headers are in either 7597// *Note.ServerResponse.Header or (if a response was returned at all) in 7598// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 7599// whether the returned error was because http.StatusNotModified was 7600// returned. 7601func (c *ProvidersNotesGetCall) Do(opts ...googleapi.CallOption) (*Note, error) { 7602 gensupport.SetOptions(c.urlParams_, opts...) 7603 res, err := c.doRequest("json") 7604 if res != nil && res.StatusCode == http.StatusNotModified { 7605 if res.Body != nil { 7606 res.Body.Close() 7607 } 7608 return nil, &googleapi.Error{ 7609 Code: res.StatusCode, 7610 Header: res.Header, 7611 } 7612 } 7613 if err != nil { 7614 return nil, err 7615 } 7616 defer googleapi.CloseBody(res) 7617 if err := googleapi.CheckResponse(res); err != nil { 7618 return nil, err 7619 } 7620 ret := &Note{ 7621 ServerResponse: googleapi.ServerResponse{ 7622 Header: res.Header, 7623 HTTPStatusCode: res.StatusCode, 7624 }, 7625 } 7626 target := &ret 7627 if err := gensupport.DecodeResponse(target, res); err != nil { 7628 return nil, err 7629 } 7630 return ret, nil 7631 // { 7632 // "description": "Returns the requested `Note`.", 7633 // "flatPath": "v1alpha1/providers/{providersId}/notes/{notesId}", 7634 // "httpMethod": "GET", 7635 // "id": "containeranalysis.providers.notes.get", 7636 // "parameterOrder": [ 7637 // "name" 7638 // ], 7639 // "parameters": { 7640 // "name": { 7641 // "description": "The name of the note in the form of \"providers/{provider_id}/notes/{NOTE_ID}\"", 7642 // "location": "path", 7643 // "pattern": "^providers/[^/]+/notes/[^/]+$", 7644 // "required": true, 7645 // "type": "string" 7646 // } 7647 // }, 7648 // "path": "v1alpha1/{+name}", 7649 // "response": { 7650 // "$ref": "Note" 7651 // }, 7652 // "scopes": [ 7653 // "https://www.googleapis.com/auth/cloud-platform" 7654 // ] 7655 // } 7656 7657} 7658 7659// method id "containeranalysis.providers.notes.getIamPolicy": 7660 7661type ProvidersNotesGetIamPolicyCall struct { 7662 s *Service 7663 resource string 7664 getiampolicyrequest *GetIamPolicyRequest 7665 urlParams_ gensupport.URLParams 7666 ctx_ context.Context 7667 header_ http.Header 7668} 7669 7670// GetIamPolicy: Gets the access control policy for a note or an 7671// `Occurrence` resource. Requires 7672// `containeranalysis.notes.setIamPolicy` or 7673// `containeranalysis.occurrences.setIamPolicy` permission if the 7674// resource is a note or occurrence, respectively. Attempting to call 7675// this method on a resource without the required permission will result 7676// in a `PERMISSION_DENIED` error. Attempting to call this method on a 7677// non-existent resource will result in a `NOT_FOUND` error if the user 7678// has list permission on the project, or a `PERMISSION_DENIED` error 7679// otherwise. The resource takes the following formats: 7680// `projects/{PROJECT_ID}/occurrences/{OCCURRENCE_ID}` for occurrences 7681// and projects/{PROJECT_ID}/notes/{NOTE_ID} for notes 7682// 7683// - resource: REQUIRED: The resource for which the policy is being 7684// requested. See the operation documentation for the appropriate 7685// value for this field. 7686func (r *ProvidersNotesService) GetIamPolicy(resource string, getiampolicyrequest *GetIamPolicyRequest) *ProvidersNotesGetIamPolicyCall { 7687 c := &ProvidersNotesGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)} 7688 c.resource = resource 7689 c.getiampolicyrequest = getiampolicyrequest 7690 return c 7691} 7692 7693// Fields allows partial responses to be retrieved. See 7694// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 7695// for more information. 7696func (c *ProvidersNotesGetIamPolicyCall) Fields(s ...googleapi.Field) *ProvidersNotesGetIamPolicyCall { 7697 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 7698 return c 7699} 7700 7701// Context sets the context to be used in this call's Do method. Any 7702// pending HTTP request will be aborted if the provided context is 7703// canceled. 7704func (c *ProvidersNotesGetIamPolicyCall) Context(ctx context.Context) *ProvidersNotesGetIamPolicyCall { 7705 c.ctx_ = ctx 7706 return c 7707} 7708 7709// Header returns an http.Header that can be modified by the caller to 7710// add HTTP headers to the request. 7711func (c *ProvidersNotesGetIamPolicyCall) Header() http.Header { 7712 if c.header_ == nil { 7713 c.header_ = make(http.Header) 7714 } 7715 return c.header_ 7716} 7717 7718func (c *ProvidersNotesGetIamPolicyCall) doRequest(alt string) (*http.Response, error) { 7719 reqHeaders := make(http.Header) 7720 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210410") 7721 for k, v := range c.header_ { 7722 reqHeaders[k] = v 7723 } 7724 reqHeaders.Set("User-Agent", c.s.userAgent()) 7725 var body io.Reader = nil 7726 body, err := googleapi.WithoutDataWrapper.JSONReader(c.getiampolicyrequest) 7727 if err != nil { 7728 return nil, err 7729 } 7730 reqHeaders.Set("Content-Type", "application/json") 7731 c.urlParams_.Set("alt", alt) 7732 c.urlParams_.Set("prettyPrint", "false") 7733 urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+resource}:getIamPolicy") 7734 urls += "?" + c.urlParams_.Encode() 7735 req, err := http.NewRequest("POST", urls, body) 7736 if err != nil { 7737 return nil, err 7738 } 7739 req.Header = reqHeaders 7740 googleapi.Expand(req.URL, map[string]string{ 7741 "resource": c.resource, 7742 }) 7743 return gensupport.SendRequest(c.ctx_, c.s.client, req) 7744} 7745 7746// Do executes the "containeranalysis.providers.notes.getIamPolicy" call. 7747// Exactly one of *Policy or error will be non-nil. Any non-2xx status 7748// code is an error. Response headers are in either 7749// *Policy.ServerResponse.Header or (if a response was returned at all) 7750// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 7751// check whether the returned error was because http.StatusNotModified 7752// was returned. 7753func (c *ProvidersNotesGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) { 7754 gensupport.SetOptions(c.urlParams_, opts...) 7755 res, err := c.doRequest("json") 7756 if res != nil && res.StatusCode == http.StatusNotModified { 7757 if res.Body != nil { 7758 res.Body.Close() 7759 } 7760 return nil, &googleapi.Error{ 7761 Code: res.StatusCode, 7762 Header: res.Header, 7763 } 7764 } 7765 if err != nil { 7766 return nil, err 7767 } 7768 defer googleapi.CloseBody(res) 7769 if err := googleapi.CheckResponse(res); err != nil { 7770 return nil, err 7771 } 7772 ret := &Policy{ 7773 ServerResponse: googleapi.ServerResponse{ 7774 Header: res.Header, 7775 HTTPStatusCode: res.StatusCode, 7776 }, 7777 } 7778 target := &ret 7779 if err := gensupport.DecodeResponse(target, res); err != nil { 7780 return nil, err 7781 } 7782 return ret, nil 7783 // { 7784 // "description": "Gets the access control policy for a note or an `Occurrence` resource. Requires `containeranalysis.notes.setIamPolicy` or `containeranalysis.occurrences.setIamPolicy` permission if the resource is a note or occurrence, respectively. Attempting to call this method on a resource without the required permission will result in a `PERMISSION_DENIED` error. Attempting to call this method on a non-existent resource will result in a `NOT_FOUND` error if the user has list permission on the project, or a `PERMISSION_DENIED` error otherwise. The resource takes the following formats: `projects/{PROJECT_ID}/occurrences/{OCCURRENCE_ID}` for occurrences and projects/{PROJECT_ID}/notes/{NOTE_ID} for notes", 7785 // "flatPath": "v1alpha1/providers/{providersId}/notes/{notesId}:getIamPolicy", 7786 // "httpMethod": "POST", 7787 // "id": "containeranalysis.providers.notes.getIamPolicy", 7788 // "parameterOrder": [ 7789 // "resource" 7790 // ], 7791 // "parameters": { 7792 // "resource": { 7793 // "description": "REQUIRED: The resource for which the policy is being requested. See the operation documentation for the appropriate value for this field.", 7794 // "location": "path", 7795 // "pattern": "^providers/[^/]+/notes/[^/]+$", 7796 // "required": true, 7797 // "type": "string" 7798 // } 7799 // }, 7800 // "path": "v1alpha1/{+resource}:getIamPolicy", 7801 // "request": { 7802 // "$ref": "GetIamPolicyRequest" 7803 // }, 7804 // "response": { 7805 // "$ref": "Policy" 7806 // }, 7807 // "scopes": [ 7808 // "https://www.googleapis.com/auth/cloud-platform" 7809 // ] 7810 // } 7811 7812} 7813 7814// method id "containeranalysis.providers.notes.list": 7815 7816type ProvidersNotesListCall struct { 7817 s *Service 7818 name string 7819 urlParams_ gensupport.URLParams 7820 ifNoneMatch_ string 7821 ctx_ context.Context 7822 header_ http.Header 7823} 7824 7825// List: Lists all `Notes` for a given project. 7826// 7827// - name: The name field will contain the project Id for example: 7828// "providers/{provider_id} @Deprecated. 7829func (r *ProvidersNotesService) List(name string) *ProvidersNotesListCall { 7830 c := &ProvidersNotesListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 7831 c.name = name 7832 return c 7833} 7834 7835// Filter sets the optional parameter "filter": The filter expression. 7836func (c *ProvidersNotesListCall) Filter(filter string) *ProvidersNotesListCall { 7837 c.urlParams_.Set("filter", filter) 7838 return c 7839} 7840 7841// PageSize sets the optional parameter "pageSize": Number of notes to 7842// return in the list. 7843func (c *ProvidersNotesListCall) PageSize(pageSize int64) *ProvidersNotesListCall { 7844 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) 7845 return c 7846} 7847 7848// PageToken sets the optional parameter "pageToken": Token to provide 7849// to skip to a particular spot in the list. 7850func (c *ProvidersNotesListCall) PageToken(pageToken string) *ProvidersNotesListCall { 7851 c.urlParams_.Set("pageToken", pageToken) 7852 return c 7853} 7854 7855// Parent sets the optional parameter "parent": This field contains the 7856// project Id for example: "projects/{PROJECT_ID}". 7857func (c *ProvidersNotesListCall) Parent(parent string) *ProvidersNotesListCall { 7858 c.urlParams_.Set("parent", parent) 7859 return c 7860} 7861 7862// Fields allows partial responses to be retrieved. See 7863// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 7864// for more information. 7865func (c *ProvidersNotesListCall) Fields(s ...googleapi.Field) *ProvidersNotesListCall { 7866 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 7867 return c 7868} 7869 7870// IfNoneMatch sets the optional parameter which makes the operation 7871// fail if the object's ETag matches the given value. This is useful for 7872// getting updates only after the object has changed since the last 7873// request. Use googleapi.IsNotModified to check whether the response 7874// error from Do is the result of In-None-Match. 7875func (c *ProvidersNotesListCall) IfNoneMatch(entityTag string) *ProvidersNotesListCall { 7876 c.ifNoneMatch_ = entityTag 7877 return c 7878} 7879 7880// Context sets the context to be used in this call's Do method. Any 7881// pending HTTP request will be aborted if the provided context is 7882// canceled. 7883func (c *ProvidersNotesListCall) Context(ctx context.Context) *ProvidersNotesListCall { 7884 c.ctx_ = ctx 7885 return c 7886} 7887 7888// Header returns an http.Header that can be modified by the caller to 7889// add HTTP headers to the request. 7890func (c *ProvidersNotesListCall) Header() http.Header { 7891 if c.header_ == nil { 7892 c.header_ = make(http.Header) 7893 } 7894 return c.header_ 7895} 7896 7897func (c *ProvidersNotesListCall) doRequest(alt string) (*http.Response, error) { 7898 reqHeaders := make(http.Header) 7899 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210410") 7900 for k, v := range c.header_ { 7901 reqHeaders[k] = v 7902 } 7903 reqHeaders.Set("User-Agent", c.s.userAgent()) 7904 if c.ifNoneMatch_ != "" { 7905 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 7906 } 7907 var body io.Reader = nil 7908 c.urlParams_.Set("alt", alt) 7909 c.urlParams_.Set("prettyPrint", "false") 7910 urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+name}/notes") 7911 urls += "?" + c.urlParams_.Encode() 7912 req, err := http.NewRequest("GET", urls, body) 7913 if err != nil { 7914 return nil, err 7915 } 7916 req.Header = reqHeaders 7917 googleapi.Expand(req.URL, map[string]string{ 7918 "name": c.name, 7919 }) 7920 return gensupport.SendRequest(c.ctx_, c.s.client, req) 7921} 7922 7923// Do executes the "containeranalysis.providers.notes.list" call. 7924// Exactly one of *ListNotesResponse or error will be non-nil. Any 7925// non-2xx status code is an error. Response headers are in either 7926// *ListNotesResponse.ServerResponse.Header or (if a response was 7927// returned at all) in error.(*googleapi.Error).Header. Use 7928// googleapi.IsNotModified to check whether the returned error was 7929// because http.StatusNotModified was returned. 7930func (c *ProvidersNotesListCall) Do(opts ...googleapi.CallOption) (*ListNotesResponse, error) { 7931 gensupport.SetOptions(c.urlParams_, opts...) 7932 res, err := c.doRequest("json") 7933 if res != nil && res.StatusCode == http.StatusNotModified { 7934 if res.Body != nil { 7935 res.Body.Close() 7936 } 7937 return nil, &googleapi.Error{ 7938 Code: res.StatusCode, 7939 Header: res.Header, 7940 } 7941 } 7942 if err != nil { 7943 return nil, err 7944 } 7945 defer googleapi.CloseBody(res) 7946 if err := googleapi.CheckResponse(res); err != nil { 7947 return nil, err 7948 } 7949 ret := &ListNotesResponse{ 7950 ServerResponse: googleapi.ServerResponse{ 7951 Header: res.Header, 7952 HTTPStatusCode: res.StatusCode, 7953 }, 7954 } 7955 target := &ret 7956 if err := gensupport.DecodeResponse(target, res); err != nil { 7957 return nil, err 7958 } 7959 return ret, nil 7960 // { 7961 // "description": "Lists all `Notes` for a given project.", 7962 // "flatPath": "v1alpha1/providers/{providersId}/notes", 7963 // "httpMethod": "GET", 7964 // "id": "containeranalysis.providers.notes.list", 7965 // "parameterOrder": [ 7966 // "name" 7967 // ], 7968 // "parameters": { 7969 // "filter": { 7970 // "description": "The filter expression.", 7971 // "location": "query", 7972 // "type": "string" 7973 // }, 7974 // "name": { 7975 // "description": "The name field will contain the project Id for example: \"providers/{provider_id} @Deprecated", 7976 // "location": "path", 7977 // "pattern": "^providers/[^/]+$", 7978 // "required": true, 7979 // "type": "string" 7980 // }, 7981 // "pageSize": { 7982 // "description": "Number of notes to return in the list.", 7983 // "format": "int32", 7984 // "location": "query", 7985 // "type": "integer" 7986 // }, 7987 // "pageToken": { 7988 // "description": "Token to provide to skip to a particular spot in the list.", 7989 // "location": "query", 7990 // "type": "string" 7991 // }, 7992 // "parent": { 7993 // "description": "This field contains the project Id for example: \"projects/{PROJECT_ID}\".", 7994 // "location": "query", 7995 // "type": "string" 7996 // } 7997 // }, 7998 // "path": "v1alpha1/{+name}/notes", 7999 // "response": { 8000 // "$ref": "ListNotesResponse" 8001 // }, 8002 // "scopes": [ 8003 // "https://www.googleapis.com/auth/cloud-platform" 8004 // ] 8005 // } 8006 8007} 8008 8009// Pages invokes f for each page of results. 8010// A non-nil error returned from f will halt the iteration. 8011// The provided context supersedes any context provided to the Context method. 8012func (c *ProvidersNotesListCall) Pages(ctx context.Context, f func(*ListNotesResponse) error) error { 8013 c.ctx_ = ctx 8014 defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point 8015 for { 8016 x, err := c.Do() 8017 if err != nil { 8018 return err 8019 } 8020 if err := f(x); err != nil { 8021 return err 8022 } 8023 if x.NextPageToken == "" { 8024 return nil 8025 } 8026 c.PageToken(x.NextPageToken) 8027 } 8028} 8029 8030// method id "containeranalysis.providers.notes.patch": 8031 8032type ProvidersNotesPatchCall struct { 8033 s *Service 8034 name string 8035 note *Note 8036 urlParams_ gensupport.URLParams 8037 ctx_ context.Context 8038 header_ http.Header 8039} 8040 8041// Patch: Updates an existing `Note`. 8042// 8043// - name: The name of the note. Should be of the form 8044// "projects/{provider_id}/notes/{note_id}". 8045func (r *ProvidersNotesService) Patch(name string, note *Note) *ProvidersNotesPatchCall { 8046 c := &ProvidersNotesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} 8047 c.name = name 8048 c.note = note 8049 return c 8050} 8051 8052// UpdateMask sets the optional parameter "updateMask": The fields to 8053// update. 8054func (c *ProvidersNotesPatchCall) UpdateMask(updateMask string) *ProvidersNotesPatchCall { 8055 c.urlParams_.Set("updateMask", updateMask) 8056 return c 8057} 8058 8059// Fields allows partial responses to be retrieved. See 8060// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 8061// for more information. 8062func (c *ProvidersNotesPatchCall) Fields(s ...googleapi.Field) *ProvidersNotesPatchCall { 8063 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 8064 return c 8065} 8066 8067// Context sets the context to be used in this call's Do method. Any 8068// pending HTTP request will be aborted if the provided context is 8069// canceled. 8070func (c *ProvidersNotesPatchCall) Context(ctx context.Context) *ProvidersNotesPatchCall { 8071 c.ctx_ = ctx 8072 return c 8073} 8074 8075// Header returns an http.Header that can be modified by the caller to 8076// add HTTP headers to the request. 8077func (c *ProvidersNotesPatchCall) Header() http.Header { 8078 if c.header_ == nil { 8079 c.header_ = make(http.Header) 8080 } 8081 return c.header_ 8082} 8083 8084func (c *ProvidersNotesPatchCall) doRequest(alt string) (*http.Response, error) { 8085 reqHeaders := make(http.Header) 8086 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210410") 8087 for k, v := range c.header_ { 8088 reqHeaders[k] = v 8089 } 8090 reqHeaders.Set("User-Agent", c.s.userAgent()) 8091 var body io.Reader = nil 8092 body, err := googleapi.WithoutDataWrapper.JSONReader(c.note) 8093 if err != nil { 8094 return nil, err 8095 } 8096 reqHeaders.Set("Content-Type", "application/json") 8097 c.urlParams_.Set("alt", alt) 8098 c.urlParams_.Set("prettyPrint", "false") 8099 urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+name}") 8100 urls += "?" + c.urlParams_.Encode() 8101 req, err := http.NewRequest("PATCH", urls, body) 8102 if err != nil { 8103 return nil, err 8104 } 8105 req.Header = reqHeaders 8106 googleapi.Expand(req.URL, map[string]string{ 8107 "name": c.name, 8108 }) 8109 return gensupport.SendRequest(c.ctx_, c.s.client, req) 8110} 8111 8112// Do executes the "containeranalysis.providers.notes.patch" call. 8113// Exactly one of *Note or error will be non-nil. Any non-2xx status 8114// code is an error. Response headers are in either 8115// *Note.ServerResponse.Header or (if a response was returned at all) in 8116// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 8117// whether the returned error was because http.StatusNotModified was 8118// returned. 8119func (c *ProvidersNotesPatchCall) Do(opts ...googleapi.CallOption) (*Note, error) { 8120 gensupport.SetOptions(c.urlParams_, opts...) 8121 res, err := c.doRequest("json") 8122 if res != nil && res.StatusCode == http.StatusNotModified { 8123 if res.Body != nil { 8124 res.Body.Close() 8125 } 8126 return nil, &googleapi.Error{ 8127 Code: res.StatusCode, 8128 Header: res.Header, 8129 } 8130 } 8131 if err != nil { 8132 return nil, err 8133 } 8134 defer googleapi.CloseBody(res) 8135 if err := googleapi.CheckResponse(res); err != nil { 8136 return nil, err 8137 } 8138 ret := &Note{ 8139 ServerResponse: googleapi.ServerResponse{ 8140 Header: res.Header, 8141 HTTPStatusCode: res.StatusCode, 8142 }, 8143 } 8144 target := &ret 8145 if err := gensupport.DecodeResponse(target, res); err != nil { 8146 return nil, err 8147 } 8148 return ret, nil 8149 // { 8150 // "description": "Updates an existing `Note`.", 8151 // "flatPath": "v1alpha1/providers/{providersId}/notes/{notesId}", 8152 // "httpMethod": "PATCH", 8153 // "id": "containeranalysis.providers.notes.patch", 8154 // "parameterOrder": [ 8155 // "name" 8156 // ], 8157 // "parameters": { 8158 // "name": { 8159 // "description": "The name of the note. Should be of the form \"projects/{provider_id}/notes/{note_id}\".", 8160 // "location": "path", 8161 // "pattern": "^providers/[^/]+/notes/[^/]+$", 8162 // "required": true, 8163 // "type": "string" 8164 // }, 8165 // "updateMask": { 8166 // "description": "The fields to update.", 8167 // "format": "google-fieldmask", 8168 // "location": "query", 8169 // "type": "string" 8170 // } 8171 // }, 8172 // "path": "v1alpha1/{+name}", 8173 // "request": { 8174 // "$ref": "Note" 8175 // }, 8176 // "response": { 8177 // "$ref": "Note" 8178 // }, 8179 // "scopes": [ 8180 // "https://www.googleapis.com/auth/cloud-platform" 8181 // ] 8182 // } 8183 8184} 8185 8186// method id "containeranalysis.providers.notes.setIamPolicy": 8187 8188type ProvidersNotesSetIamPolicyCall struct { 8189 s *Service 8190 resource string 8191 setiampolicyrequest *SetIamPolicyRequest 8192 urlParams_ gensupport.URLParams 8193 ctx_ context.Context 8194 header_ http.Header 8195} 8196 8197// SetIamPolicy: Sets the access control policy on the specified `Note` 8198// or `Occurrence`. Requires `containeranalysis.notes.setIamPolicy` or 8199// `containeranalysis.occurrences.setIamPolicy` permission if the 8200// resource is a `Note` or an `Occurrence`, respectively. Attempting to 8201// call this method without these permissions will result in a ` 8202// `PERMISSION_DENIED` error. Attempting to call this method on a 8203// non-existent resource will result in a `NOT_FOUND` error if the user 8204// has `containeranalysis.notes.list` permission on a `Note` or 8205// `containeranalysis.occurrences.list` on an `Occurrence`, or a 8206// `PERMISSION_DENIED` error otherwise. The resource takes the following 8207// formats: `projects/{projectid}/occurrences/{occurrenceid}` for 8208// occurrences and projects/{projectid}/notes/{noteid} for notes 8209// 8210// - resource: REQUIRED: The resource for which the policy is being 8211// specified. See the operation documentation for the appropriate 8212// value for this field. 8213func (r *ProvidersNotesService) SetIamPolicy(resource string, setiampolicyrequest *SetIamPolicyRequest) *ProvidersNotesSetIamPolicyCall { 8214 c := &ProvidersNotesSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)} 8215 c.resource = resource 8216 c.setiampolicyrequest = setiampolicyrequest 8217 return c 8218} 8219 8220// Fields allows partial responses to be retrieved. See 8221// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 8222// for more information. 8223func (c *ProvidersNotesSetIamPolicyCall) Fields(s ...googleapi.Field) *ProvidersNotesSetIamPolicyCall { 8224 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 8225 return c 8226} 8227 8228// Context sets the context to be used in this call's Do method. Any 8229// pending HTTP request will be aborted if the provided context is 8230// canceled. 8231func (c *ProvidersNotesSetIamPolicyCall) Context(ctx context.Context) *ProvidersNotesSetIamPolicyCall { 8232 c.ctx_ = ctx 8233 return c 8234} 8235 8236// Header returns an http.Header that can be modified by the caller to 8237// add HTTP headers to the request. 8238func (c *ProvidersNotesSetIamPolicyCall) Header() http.Header { 8239 if c.header_ == nil { 8240 c.header_ = make(http.Header) 8241 } 8242 return c.header_ 8243} 8244 8245func (c *ProvidersNotesSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { 8246 reqHeaders := make(http.Header) 8247 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210410") 8248 for k, v := range c.header_ { 8249 reqHeaders[k] = v 8250 } 8251 reqHeaders.Set("User-Agent", c.s.userAgent()) 8252 var body io.Reader = nil 8253 body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest) 8254 if err != nil { 8255 return nil, err 8256 } 8257 reqHeaders.Set("Content-Type", "application/json") 8258 c.urlParams_.Set("alt", alt) 8259 c.urlParams_.Set("prettyPrint", "false") 8260 urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+resource}:setIamPolicy") 8261 urls += "?" + c.urlParams_.Encode() 8262 req, err := http.NewRequest("POST", urls, body) 8263 if err != nil { 8264 return nil, err 8265 } 8266 req.Header = reqHeaders 8267 googleapi.Expand(req.URL, map[string]string{ 8268 "resource": c.resource, 8269 }) 8270 return gensupport.SendRequest(c.ctx_, c.s.client, req) 8271} 8272 8273// Do executes the "containeranalysis.providers.notes.setIamPolicy" call. 8274// Exactly one of *Policy or error will be non-nil. Any non-2xx status 8275// code is an error. Response headers are in either 8276// *Policy.ServerResponse.Header or (if a response was returned at all) 8277// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 8278// check whether the returned error was because http.StatusNotModified 8279// was returned. 8280func (c *ProvidersNotesSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) { 8281 gensupport.SetOptions(c.urlParams_, opts...) 8282 res, err := c.doRequest("json") 8283 if res != nil && res.StatusCode == http.StatusNotModified { 8284 if res.Body != nil { 8285 res.Body.Close() 8286 } 8287 return nil, &googleapi.Error{ 8288 Code: res.StatusCode, 8289 Header: res.Header, 8290 } 8291 } 8292 if err != nil { 8293 return nil, err 8294 } 8295 defer googleapi.CloseBody(res) 8296 if err := googleapi.CheckResponse(res); err != nil { 8297 return nil, err 8298 } 8299 ret := &Policy{ 8300 ServerResponse: googleapi.ServerResponse{ 8301 Header: res.Header, 8302 HTTPStatusCode: res.StatusCode, 8303 }, 8304 } 8305 target := &ret 8306 if err := gensupport.DecodeResponse(target, res); err != nil { 8307 return nil, err 8308 } 8309 return ret, nil 8310 // { 8311 // "description": "Sets the access control policy on the specified `Note` or `Occurrence`. Requires `containeranalysis.notes.setIamPolicy` or `containeranalysis.occurrences.setIamPolicy` permission if the resource is a `Note` or an `Occurrence`, respectively. Attempting to call this method without these permissions will result in a ` `PERMISSION_DENIED` error. Attempting to call this method on a non-existent resource will result in a `NOT_FOUND` error if the user has `containeranalysis.notes.list` permission on a `Note` or `containeranalysis.occurrences.list` on an `Occurrence`, or a `PERMISSION_DENIED` error otherwise. The resource takes the following formats: `projects/{projectid}/occurrences/{occurrenceid}` for occurrences and projects/{projectid}/notes/{noteid} for notes", 8312 // "flatPath": "v1alpha1/providers/{providersId}/notes/{notesId}:setIamPolicy", 8313 // "httpMethod": "POST", 8314 // "id": "containeranalysis.providers.notes.setIamPolicy", 8315 // "parameterOrder": [ 8316 // "resource" 8317 // ], 8318 // "parameters": { 8319 // "resource": { 8320 // "description": "REQUIRED: The resource for which the policy is being specified. See the operation documentation for the appropriate value for this field.", 8321 // "location": "path", 8322 // "pattern": "^providers/[^/]+/notes/[^/]+$", 8323 // "required": true, 8324 // "type": "string" 8325 // } 8326 // }, 8327 // "path": "v1alpha1/{+resource}:setIamPolicy", 8328 // "request": { 8329 // "$ref": "SetIamPolicyRequest" 8330 // }, 8331 // "response": { 8332 // "$ref": "Policy" 8333 // }, 8334 // "scopes": [ 8335 // "https://www.googleapis.com/auth/cloud-platform" 8336 // ] 8337 // } 8338 8339} 8340 8341// method id "containeranalysis.providers.notes.testIamPermissions": 8342 8343type ProvidersNotesTestIamPermissionsCall struct { 8344 s *Service 8345 resource string 8346 testiampermissionsrequest *TestIamPermissionsRequest 8347 urlParams_ gensupport.URLParams 8348 ctx_ context.Context 8349 header_ http.Header 8350} 8351 8352// TestIamPermissions: Returns the permissions that a caller has on the 8353// specified note or occurrence resource. Requires list permission on 8354// the project (for example, "storage.objects.list" on the containing 8355// bucket for testing permission of an object). Attempting to call this 8356// method on a non-existent resource will result in a `NOT_FOUND` error 8357// if the user has list permission on the project, or a 8358// `PERMISSION_DENIED` error otherwise. The resource takes the following 8359// formats: `projects/{PROJECT_ID}/occurrences/{OCCURRENCE_ID}` for 8360// `Occurrences` and `projects/{PROJECT_ID}/notes/{NOTE_ID}` for `Notes` 8361// 8362// - resource: REQUIRED: The resource for which the policy detail is 8363// being requested. See the operation documentation for the 8364// appropriate value for this field. 8365func (r *ProvidersNotesService) TestIamPermissions(resource string, testiampermissionsrequest *TestIamPermissionsRequest) *ProvidersNotesTestIamPermissionsCall { 8366 c := &ProvidersNotesTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)} 8367 c.resource = resource 8368 c.testiampermissionsrequest = testiampermissionsrequest 8369 return c 8370} 8371 8372// Fields allows partial responses to be retrieved. See 8373// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 8374// for more information. 8375func (c *ProvidersNotesTestIamPermissionsCall) Fields(s ...googleapi.Field) *ProvidersNotesTestIamPermissionsCall { 8376 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 8377 return c 8378} 8379 8380// Context sets the context to be used in this call's Do method. Any 8381// pending HTTP request will be aborted if the provided context is 8382// canceled. 8383func (c *ProvidersNotesTestIamPermissionsCall) Context(ctx context.Context) *ProvidersNotesTestIamPermissionsCall { 8384 c.ctx_ = ctx 8385 return c 8386} 8387 8388// Header returns an http.Header that can be modified by the caller to 8389// add HTTP headers to the request. 8390func (c *ProvidersNotesTestIamPermissionsCall) Header() http.Header { 8391 if c.header_ == nil { 8392 c.header_ = make(http.Header) 8393 } 8394 return c.header_ 8395} 8396 8397func (c *ProvidersNotesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { 8398 reqHeaders := make(http.Header) 8399 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210410") 8400 for k, v := range c.header_ { 8401 reqHeaders[k] = v 8402 } 8403 reqHeaders.Set("User-Agent", c.s.userAgent()) 8404 var body io.Reader = nil 8405 body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest) 8406 if err != nil { 8407 return nil, err 8408 } 8409 reqHeaders.Set("Content-Type", "application/json") 8410 c.urlParams_.Set("alt", alt) 8411 c.urlParams_.Set("prettyPrint", "false") 8412 urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+resource}:testIamPermissions") 8413 urls += "?" + c.urlParams_.Encode() 8414 req, err := http.NewRequest("POST", urls, body) 8415 if err != nil { 8416 return nil, err 8417 } 8418 req.Header = reqHeaders 8419 googleapi.Expand(req.URL, map[string]string{ 8420 "resource": c.resource, 8421 }) 8422 return gensupport.SendRequest(c.ctx_, c.s.client, req) 8423} 8424 8425// Do executes the "containeranalysis.providers.notes.testIamPermissions" call. 8426// Exactly one of *TestIamPermissionsResponse or error will be non-nil. 8427// Any non-2xx status code is an error. Response headers are in either 8428// *TestIamPermissionsResponse.ServerResponse.Header or (if a response 8429// was returned at all) in error.(*googleapi.Error).Header. Use 8430// googleapi.IsNotModified to check whether the returned error was 8431// because http.StatusNotModified was returned. 8432func (c *ProvidersNotesTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestIamPermissionsResponse, error) { 8433 gensupport.SetOptions(c.urlParams_, opts...) 8434 res, err := c.doRequest("json") 8435 if res != nil && res.StatusCode == http.StatusNotModified { 8436 if res.Body != nil { 8437 res.Body.Close() 8438 } 8439 return nil, &googleapi.Error{ 8440 Code: res.StatusCode, 8441 Header: res.Header, 8442 } 8443 } 8444 if err != nil { 8445 return nil, err 8446 } 8447 defer googleapi.CloseBody(res) 8448 if err := googleapi.CheckResponse(res); err != nil { 8449 return nil, err 8450 } 8451 ret := &TestIamPermissionsResponse{ 8452 ServerResponse: googleapi.ServerResponse{ 8453 Header: res.Header, 8454 HTTPStatusCode: res.StatusCode, 8455 }, 8456 } 8457 target := &ret 8458 if err := gensupport.DecodeResponse(target, res); err != nil { 8459 return nil, err 8460 } 8461 return ret, nil 8462 // { 8463 // "description": "Returns the permissions that a caller has on the specified note or occurrence resource. Requires list permission on the project (for example, \"storage.objects.list\" on the containing bucket for testing permission of an object). Attempting to call this method on a non-existent resource will result in a `NOT_FOUND` error if the user has list permission on the project, or a `PERMISSION_DENIED` error otherwise. The resource takes the following formats: `projects/{PROJECT_ID}/occurrences/{OCCURRENCE_ID}` for `Occurrences` and `projects/{PROJECT_ID}/notes/{NOTE_ID}` for `Notes`", 8464 // "flatPath": "v1alpha1/providers/{providersId}/notes/{notesId}:testIamPermissions", 8465 // "httpMethod": "POST", 8466 // "id": "containeranalysis.providers.notes.testIamPermissions", 8467 // "parameterOrder": [ 8468 // "resource" 8469 // ], 8470 // "parameters": { 8471 // "resource": { 8472 // "description": "REQUIRED: The resource for which the policy detail is being requested. See the operation documentation for the appropriate value for this field.", 8473 // "location": "path", 8474 // "pattern": "^providers/[^/]+/notes/[^/]+$", 8475 // "required": true, 8476 // "type": "string" 8477 // } 8478 // }, 8479 // "path": "v1alpha1/{+resource}:testIamPermissions", 8480 // "request": { 8481 // "$ref": "TestIamPermissionsRequest" 8482 // }, 8483 // "response": { 8484 // "$ref": "TestIamPermissionsResponse" 8485 // }, 8486 // "scopes": [ 8487 // "https://www.googleapis.com/auth/cloud-platform" 8488 // ] 8489 // } 8490 8491} 8492 8493// method id "containeranalysis.providers.notes.occurrences.list": 8494 8495type ProvidersNotesOccurrencesListCall struct { 8496 s *Service 8497 name string 8498 urlParams_ gensupport.URLParams 8499 ifNoneMatch_ string 8500 ctx_ context.Context 8501 header_ http.Header 8502} 8503 8504// List: Lists `Occurrences` referencing the specified `Note`. Use this 8505// method to get all occurrences referencing your `Note` across all your 8506// customer projects. 8507// 8508// - name: The name field will contain the note name for example: 8509// "provider/{provider_id}/notes/{note_id}". 8510func (r *ProvidersNotesOccurrencesService) List(name string) *ProvidersNotesOccurrencesListCall { 8511 c := &ProvidersNotesOccurrencesListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 8512 c.name = name 8513 return c 8514} 8515 8516// Filter sets the optional parameter "filter": The filter expression. 8517func (c *ProvidersNotesOccurrencesListCall) Filter(filter string) *ProvidersNotesOccurrencesListCall { 8518 c.urlParams_.Set("filter", filter) 8519 return c 8520} 8521 8522// PageSize sets the optional parameter "pageSize": Number of notes to 8523// return in the list. 8524func (c *ProvidersNotesOccurrencesListCall) PageSize(pageSize int64) *ProvidersNotesOccurrencesListCall { 8525 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) 8526 return c 8527} 8528 8529// PageToken sets the optional parameter "pageToken": Token to provide 8530// to skip to a particular spot in the list. 8531func (c *ProvidersNotesOccurrencesListCall) PageToken(pageToken string) *ProvidersNotesOccurrencesListCall { 8532 c.urlParams_.Set("pageToken", pageToken) 8533 return c 8534} 8535 8536// Fields allows partial responses to be retrieved. See 8537// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 8538// for more information. 8539func (c *ProvidersNotesOccurrencesListCall) Fields(s ...googleapi.Field) *ProvidersNotesOccurrencesListCall { 8540 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 8541 return c 8542} 8543 8544// IfNoneMatch sets the optional parameter which makes the operation 8545// fail if the object's ETag matches the given value. This is useful for 8546// getting updates only after the object has changed since the last 8547// request. Use googleapi.IsNotModified to check whether the response 8548// error from Do is the result of In-None-Match. 8549func (c *ProvidersNotesOccurrencesListCall) IfNoneMatch(entityTag string) *ProvidersNotesOccurrencesListCall { 8550 c.ifNoneMatch_ = entityTag 8551 return c 8552} 8553 8554// Context sets the context to be used in this call's Do method. Any 8555// pending HTTP request will be aborted if the provided context is 8556// canceled. 8557func (c *ProvidersNotesOccurrencesListCall) Context(ctx context.Context) *ProvidersNotesOccurrencesListCall { 8558 c.ctx_ = ctx 8559 return c 8560} 8561 8562// Header returns an http.Header that can be modified by the caller to 8563// add HTTP headers to the request. 8564func (c *ProvidersNotesOccurrencesListCall) Header() http.Header { 8565 if c.header_ == nil { 8566 c.header_ = make(http.Header) 8567 } 8568 return c.header_ 8569} 8570 8571func (c *ProvidersNotesOccurrencesListCall) doRequest(alt string) (*http.Response, error) { 8572 reqHeaders := make(http.Header) 8573 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210410") 8574 for k, v := range c.header_ { 8575 reqHeaders[k] = v 8576 } 8577 reqHeaders.Set("User-Agent", c.s.userAgent()) 8578 if c.ifNoneMatch_ != "" { 8579 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 8580 } 8581 var body io.Reader = nil 8582 c.urlParams_.Set("alt", alt) 8583 c.urlParams_.Set("prettyPrint", "false") 8584 urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+name}/occurrences") 8585 urls += "?" + c.urlParams_.Encode() 8586 req, err := http.NewRequest("GET", urls, body) 8587 if err != nil { 8588 return nil, err 8589 } 8590 req.Header = reqHeaders 8591 googleapi.Expand(req.URL, map[string]string{ 8592 "name": c.name, 8593 }) 8594 return gensupport.SendRequest(c.ctx_, c.s.client, req) 8595} 8596 8597// Do executes the "containeranalysis.providers.notes.occurrences.list" call. 8598// Exactly one of *ListNoteOccurrencesResponse or error will be non-nil. 8599// Any non-2xx status code is an error. Response headers are in either 8600// *ListNoteOccurrencesResponse.ServerResponse.Header or (if a response 8601// was returned at all) in error.(*googleapi.Error).Header. Use 8602// googleapi.IsNotModified to check whether the returned error was 8603// because http.StatusNotModified was returned. 8604func (c *ProvidersNotesOccurrencesListCall) Do(opts ...googleapi.CallOption) (*ListNoteOccurrencesResponse, error) { 8605 gensupport.SetOptions(c.urlParams_, opts...) 8606 res, err := c.doRequest("json") 8607 if res != nil && res.StatusCode == http.StatusNotModified { 8608 if res.Body != nil { 8609 res.Body.Close() 8610 } 8611 return nil, &googleapi.Error{ 8612 Code: res.StatusCode, 8613 Header: res.Header, 8614 } 8615 } 8616 if err != nil { 8617 return nil, err 8618 } 8619 defer googleapi.CloseBody(res) 8620 if err := googleapi.CheckResponse(res); err != nil { 8621 return nil, err 8622 } 8623 ret := &ListNoteOccurrencesResponse{ 8624 ServerResponse: googleapi.ServerResponse{ 8625 Header: res.Header, 8626 HTTPStatusCode: res.StatusCode, 8627 }, 8628 } 8629 target := &ret 8630 if err := gensupport.DecodeResponse(target, res); err != nil { 8631 return nil, err 8632 } 8633 return ret, nil 8634 // { 8635 // "description": "Lists `Occurrences` referencing the specified `Note`. Use this method to get all occurrences referencing your `Note` across all your customer projects.", 8636 // "flatPath": "v1alpha1/providers/{providersId}/notes/{notesId}/occurrences", 8637 // "httpMethod": "GET", 8638 // "id": "containeranalysis.providers.notes.occurrences.list", 8639 // "parameterOrder": [ 8640 // "name" 8641 // ], 8642 // "parameters": { 8643 // "filter": { 8644 // "description": "The filter expression.", 8645 // "location": "query", 8646 // "type": "string" 8647 // }, 8648 // "name": { 8649 // "description": "The name field will contain the note name for example: \"provider/{provider_id}/notes/{note_id}\"", 8650 // "location": "path", 8651 // "pattern": "^providers/[^/]+/notes/[^/]+$", 8652 // "required": true, 8653 // "type": "string" 8654 // }, 8655 // "pageSize": { 8656 // "description": "Number of notes to return in the list.", 8657 // "format": "int32", 8658 // "location": "query", 8659 // "type": "integer" 8660 // }, 8661 // "pageToken": { 8662 // "description": "Token to provide to skip to a particular spot in the list.", 8663 // "location": "query", 8664 // "type": "string" 8665 // } 8666 // }, 8667 // "path": "v1alpha1/{+name}/occurrences", 8668 // "response": { 8669 // "$ref": "ListNoteOccurrencesResponse" 8670 // }, 8671 // "scopes": [ 8672 // "https://www.googleapis.com/auth/cloud-platform" 8673 // ] 8674 // } 8675 8676} 8677 8678// Pages invokes f for each page of results. 8679// A non-nil error returned from f will halt the iteration. 8680// The provided context supersedes any context provided to the Context method. 8681func (c *ProvidersNotesOccurrencesListCall) Pages(ctx context.Context, f func(*ListNoteOccurrencesResponse) error) error { 8682 c.ctx_ = ctx 8683 defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point 8684 for { 8685 x, err := c.Do() 8686 if err != nil { 8687 return err 8688 } 8689 if err := f(x); err != nil { 8690 return err 8691 } 8692 if x.NextPageToken == "" { 8693 return nil 8694 } 8695 c.PageToken(x.NextPageToken) 8696 } 8697} 8698