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