From 41443d552ba4fd609565123b43f11af5b97be42a Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Tue, 30 Jul 2024 12:49:28 -0700 Subject: [PATCH] feat: A new field `version` is added to message `.grafeas.v1.ComplianceOccurrence` (#7565) feat: A new message `VulnerabilityAttestation` is added feat: A new field `vulnerability_attestation` is added to message `.grafeas.v1.DiscoveryOccurrence` PiperOrigin-RevId: 657298794 Source-Link: https://github.com/googleapis/googleapis/commit/ad5c47728cac14fc75d152b2736c4872637e7a6d Source-Link: https://github.com/googleapis/googleapis-gen/commit/882414c3f64237e180014f1f5d79541702096230 Copy-Tag: eyJwIjoiR3JhZmVhcy8uT3dsQm90LnlhbWwiLCJoIjoiODgyNDE0YzNmNjQyMzdlMTgwMDE0ZjFmNWQ3OTU0MTcwMjA5NjIzMCJ9 --- Grafeas/metadata/V1/Compliance.php | Bin 1353 -> 1402 bytes Grafeas/metadata/V1/Discovery.php | Bin 2023 -> 2426 bytes Grafeas/metadata/V1/Grafeas.php | Bin 8690 -> 9144 bytes Grafeas/src/V1/ComplianceOccurrence.php | 44 ++++++ Grafeas/src/V1/DiscoveryOccurrence.php | 44 ++++++ .../VulnerabilityAttestation.php | 146 ++++++++++++++++++ .../VulnerabilityAttestationState.php | 62 ++++++++ .../resources/grafeas_rest_client_config.php | 57 +++++++ 8 files changed, 353 insertions(+) create mode 100644 Grafeas/src/V1/DiscoveryOccurrence/VulnerabilityAttestation.php create mode 100644 Grafeas/src/V1/DiscoveryOccurrence/VulnerabilityAttestation/VulnerabilityAttestationState.php diff --git a/Grafeas/metadata/V1/Compliance.php b/Grafeas/metadata/V1/Compliance.php index 6dd7720e658fd361b83e6067a96b8d1b35b00375..e03f334377b814587d91b5bb51f525f34df5284d 100644 GIT binary patch delta 45 zcmX@f^^0r6Pe#U_n}0EWW@K8xIQboO0l$zQ7kgQ1QE_H|o&<{mMhNk8v8EOk zQ#3uVoO7bI12sJZJo*-4gG?8&KqqG!r8CaRbWGzW+}v@&yn5!@q_ z-%9haMA;f4dxn4WTWKLCrg@B$`Bht;zEh#3qA0|5kyMLufN2 z7Z=b?lNZX1PVSRakuAC9C=3mTy!?{X_{-%%fdQzb33WIhFG#M~iUmXo z-JASPE?%PkmLm_60mWdQSzs-4le^`C5n!cc3e!KiRbG^F>*U$;_KandZ_CRvM;L+K T$q6ws%FqbewVNdrZZQG?^L4C3 delta 341 zcmdnt{>ga*FB{Vw^UeHh=LDIK3vIqH-o?n+JUL4;kl*N*BTHUlZfeuzCzF{}wI(;n zsBj9+VdN5UE=o#>esXeY5s;M((PB7xf|Mbv&;dp+ zvB?v~#U@KjN67f!aumW)T@1FtWby=Q6HcLJKnp?(QXm#+$`~+)PL7sQW;C2!FJrj* zy$l-@W8viQaxMZo$gY#ulAYWrBRW|?j)O_4Ve)i&dpXBjj>1rz^72bk<1jXCwPMr~YMQL4 WXwT?8IZsiRS=9(`_vU+ww-^Dz;B<5V diff --git a/Grafeas/src/V1/ComplianceOccurrence.php b/Grafeas/src/V1/ComplianceOccurrence.php index 50e0d4091b2a..48224305c9f7 100644 --- a/Grafeas/src/V1/ComplianceOccurrence.php +++ b/Grafeas/src/V1/ComplianceOccurrence.php @@ -24,6 +24,12 @@ class ComplianceOccurrence extends \Google\Protobuf\Internal\Message * Generated from protobuf field string non_compliance_reason = 3; */ protected $non_compliance_reason = ''; + /** + * The OS and config version the benchmark was run on. + * + * Generated from protobuf field .grafeas.v1.ComplianceVersion version = 4; + */ + protected $version = null; /** * Constructor. @@ -33,6 +39,8 @@ class ComplianceOccurrence extends \Google\Protobuf\Internal\Message * * @type array<\Grafeas\V1\NonCompliantFile>|\Google\Protobuf\Internal\RepeatedField $non_compliant_files * @type string $non_compliance_reason + * @type \Grafeas\V1\ComplianceVersion $version + * The OS and config version the benchmark was run on. * } */ public function __construct($data = NULL) { @@ -84,5 +92,41 @@ public function setNonComplianceReason($var) return $this; } + /** + * The OS and config version the benchmark was run on. + * + * Generated from protobuf field .grafeas.v1.ComplianceVersion version = 4; + * @return \Grafeas\V1\ComplianceVersion|null + */ + public function getVersion() + { + return $this->version; + } + + public function hasVersion() + { + return isset($this->version); + } + + public function clearVersion() + { + unset($this->version); + } + + /** + * The OS and config version the benchmark was run on. + * + * Generated from protobuf field .grafeas.v1.ComplianceVersion version = 4; + * @param \Grafeas\V1\ComplianceVersion $var + * @return $this + */ + public function setVersion($var) + { + GPBUtil::checkMessage($var, \Grafeas\V1\ComplianceVersion::class); + $this->version = $var; + + return $this; + } + } diff --git a/Grafeas/src/V1/DiscoveryOccurrence.php b/Grafeas/src/V1/DiscoveryOccurrence.php index 48d5f5bc740e..f01e0fe3da66 100644 --- a/Grafeas/src/V1/DiscoveryOccurrence.php +++ b/Grafeas/src/V1/DiscoveryOccurrence.php @@ -70,6 +70,12 @@ class DiscoveryOccurrence extends \Google\Protobuf\Internal\Message * Generated from protobuf field .grafeas.v1.DiscoveryOccurrence.SBOMStatus sbom_status = 9; */ protected $sbom_status = null; + /** + * The status of an vulnerability attestation generation. + * + * Generated from protobuf field .grafeas.v1.DiscoveryOccurrence.VulnerabilityAttestation vulnerability_attestation = 10; + */ + protected $vulnerability_attestation = null; /** * Constructor. @@ -97,6 +103,8 @@ class DiscoveryOccurrence extends \Google\Protobuf\Internal\Message * The time occurrences related to this discovery occurrence were archived. * @type \Grafeas\V1\DiscoveryOccurrence\SBOMStatus $sbom_status * The status of an SBOM generation. + * @type \Grafeas\V1\DiscoveryOccurrence\VulnerabilityAttestation $vulnerability_attestation + * The status of an vulnerability attestation generation. * } */ public function __construct($data = NULL) { @@ -390,5 +398,41 @@ public function setSbomStatus($var) return $this; } + /** + * The status of an vulnerability attestation generation. + * + * Generated from protobuf field .grafeas.v1.DiscoveryOccurrence.VulnerabilityAttestation vulnerability_attestation = 10; + * @return \Grafeas\V1\DiscoveryOccurrence\VulnerabilityAttestation|null + */ + public function getVulnerabilityAttestation() + { + return $this->vulnerability_attestation; + } + + public function hasVulnerabilityAttestation() + { + return isset($this->vulnerability_attestation); + } + + public function clearVulnerabilityAttestation() + { + unset($this->vulnerability_attestation); + } + + /** + * The status of an vulnerability attestation generation. + * + * Generated from protobuf field .grafeas.v1.DiscoveryOccurrence.VulnerabilityAttestation vulnerability_attestation = 10; + * @param \Grafeas\V1\DiscoveryOccurrence\VulnerabilityAttestation $var + * @return $this + */ + public function setVulnerabilityAttestation($var) + { + GPBUtil::checkMessage($var, \Grafeas\V1\DiscoveryOccurrence\VulnerabilityAttestation::class); + $this->vulnerability_attestation = $var; + + return $this; + } + } diff --git a/Grafeas/src/V1/DiscoveryOccurrence/VulnerabilityAttestation.php b/Grafeas/src/V1/DiscoveryOccurrence/VulnerabilityAttestation.php new file mode 100644 index 000000000000..e72898848ee6 --- /dev/null +++ b/Grafeas/src/V1/DiscoveryOccurrence/VulnerabilityAttestation.php @@ -0,0 +1,146 @@ +grafeas.v1.DiscoveryOccurrence.VulnerabilityAttestation + */ +class VulnerabilityAttestation extends \Google\Protobuf\Internal\Message +{ + /** + * The last time we attempted to generate an attestation. + * + * Generated from protobuf field .google.protobuf.Timestamp last_attempt_time = 1; + */ + protected $last_attempt_time = null; + /** + * The success/failure state of the latest attestation attempt. + * + * Generated from protobuf field .grafeas.v1.DiscoveryOccurrence.VulnerabilityAttestation.VulnerabilityAttestationState state = 2; + */ + protected $state = 0; + /** + * If failure, the error reason for why the attestation generation failed. + * + * Generated from protobuf field string error = 3; + */ + protected $error = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Protobuf\Timestamp $last_attempt_time + * The last time we attempted to generate an attestation. + * @type int $state + * The success/failure state of the latest attestation attempt. + * @type string $error + * If failure, the error reason for why the attestation generation failed. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Grafeas\V1\Discovery::initOnce(); + parent::__construct($data); + } + + /** + * The last time we attempted to generate an attestation. + * + * Generated from protobuf field .google.protobuf.Timestamp last_attempt_time = 1; + * @return \Google\Protobuf\Timestamp|null + */ + public function getLastAttemptTime() + { + return $this->last_attempt_time; + } + + public function hasLastAttemptTime() + { + return isset($this->last_attempt_time); + } + + public function clearLastAttemptTime() + { + unset($this->last_attempt_time); + } + + /** + * The last time we attempted to generate an attestation. + * + * Generated from protobuf field .google.protobuf.Timestamp last_attempt_time = 1; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setLastAttemptTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->last_attempt_time = $var; + + return $this; + } + + /** + * The success/failure state of the latest attestation attempt. + * + * Generated from protobuf field .grafeas.v1.DiscoveryOccurrence.VulnerabilityAttestation.VulnerabilityAttestationState state = 2; + * @return int + */ + public function getState() + { + return $this->state; + } + + /** + * The success/failure state of the latest attestation attempt. + * + * Generated from protobuf field .grafeas.v1.DiscoveryOccurrence.VulnerabilityAttestation.VulnerabilityAttestationState state = 2; + * @param int $var + * @return $this + */ + public function setState($var) + { + GPBUtil::checkEnum($var, \Grafeas\V1\DiscoveryOccurrence\VulnerabilityAttestation\VulnerabilityAttestationState::class); + $this->state = $var; + + return $this; + } + + /** + * If failure, the error reason for why the attestation generation failed. + * + * Generated from protobuf field string error = 3; + * @return string + */ + public function getError() + { + return $this->error; + } + + /** + * If failure, the error reason for why the attestation generation failed. + * + * Generated from protobuf field string error = 3; + * @param string $var + * @return $this + */ + public function setError($var) + { + GPBUtil::checkString($var, True); + $this->error = $var; + + return $this; + } + +} + + diff --git a/Grafeas/src/V1/DiscoveryOccurrence/VulnerabilityAttestation/VulnerabilityAttestationState.php b/Grafeas/src/V1/DiscoveryOccurrence/VulnerabilityAttestation/VulnerabilityAttestationState.php new file mode 100644 index 000000000000..96d2e11849d1 --- /dev/null +++ b/Grafeas/src/V1/DiscoveryOccurrence/VulnerabilityAttestation/VulnerabilityAttestationState.php @@ -0,0 +1,62 @@ +grafeas.v1.DiscoveryOccurrence.VulnerabilityAttestation.VulnerabilityAttestationState + */ +class VulnerabilityAttestationState +{ + /** + * Default unknown state. + * + * Generated from protobuf enum VULNERABILITY_ATTESTATION_STATE_UNSPECIFIED = 0; + */ + const VULNERABILITY_ATTESTATION_STATE_UNSPECIFIED = 0; + /** + * Attestation was successfully generated and stored. + * + * Generated from protobuf enum SUCCESS = 1; + */ + const SUCCESS = 1; + /** + * Attestation was unsuccessfully generated and stored. + * + * Generated from protobuf enum FAILURE = 2; + */ + const FAILURE = 2; + + private static $valueToName = [ + self::VULNERABILITY_ATTESTATION_STATE_UNSPECIFIED => 'VULNERABILITY_ATTESTATION_STATE_UNSPECIFIED', + self::SUCCESS => 'SUCCESS', + self::FAILURE => 'FAILURE', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + + diff --git a/Grafeas/src/V1/resources/grafeas_rest_client_config.php b/Grafeas/src/V1/resources/grafeas_rest_client_config.php index 887e6505cfe3..101f65b6390b 100644 --- a/Grafeas/src/V1/resources/grafeas_rest_client_config.php +++ b/Grafeas/src/V1/resources/grafeas_rest_client_config.php @@ -27,6 +27,13 @@ 'method' => 'post', 'uriTemplate' => '/v1/{parent=projects/*}/notes:batchCreate', 'body' => '*', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*}/notes:batchCreate', + 'body' => '*', + ], + ], 'placeholders' => [ 'parent' => [ 'getters' => [ @@ -39,6 +46,13 @@ 'method' => 'post', 'uriTemplate' => '/v1/{parent=projects/*}/occurrences:batchCreate', 'body' => '*', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*}/occurrences:batchCreate', + 'body' => '*', + ], + ], 'placeholders' => [ 'parent' => [ 'getters' => [ @@ -51,6 +65,16 @@ 'method' => 'post', 'uriTemplate' => '/v1/{parent=projects/*}/notes', 'body' => 'note', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*}/notes', + 'body' => 'note', + 'queryParams' => [ + 'note_id', + ], + ], + ], 'placeholders' => [ 'parent' => [ 'getters' => [ @@ -66,6 +90,13 @@ 'method' => 'post', 'uriTemplate' => '/v1/{parent=projects/*}/occurrences', 'body' => 'occurrence', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*}/occurrences', + 'body' => 'occurrence', + ], + ], 'placeholders' => [ 'parent' => [ 'getters' => [ @@ -77,6 +108,12 @@ 'DeleteNote' => [ 'method' => 'delete', 'uriTemplate' => '/v1/{name=projects/*/notes/*}', + 'additionalBindings' => [ + [ + 'method' => 'delete', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/notes/*}', + ], + ], 'placeholders' => [ 'name' => [ 'getters' => [ @@ -88,6 +125,12 @@ 'DeleteOccurrence' => [ 'method' => 'delete', 'uriTemplate' => '/v1/{name=projects/*/occurrences/*}', + 'additionalBindings' => [ + [ + 'method' => 'delete', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/occurrences/*}', + ], + ], 'placeholders' => [ 'name' => [ 'getters' => [ @@ -202,6 +245,13 @@ 'method' => 'patch', 'uriTemplate' => '/v1/{name=projects/*/notes/*}', 'body' => 'note', + 'additionalBindings' => [ + [ + 'method' => 'patch', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/notes/*}', + 'body' => 'note', + ], + ], 'placeholders' => [ 'name' => [ 'getters' => [ @@ -214,6 +264,13 @@ 'method' => 'patch', 'uriTemplate' => '/v1/{name=projects/*/occurrences/*}', 'body' => 'occurrence', + 'additionalBindings' => [ + [ + 'method' => 'patch', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/occurrences/*}', + 'body' => 'occurrence', + ], + ], 'placeholders' => [ 'name' => [ 'getters' => [