You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

8844 lines
311 KiB

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