25개 이상의 토픽을 선택하실 수 없습니다. Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

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