From 2da5f2b35912bfbc6f6c6157882d11ac105140f3 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Mon, 10 Jan 2022 12:06:07 -0800 Subject: [PATCH] fix: [Grafeas] Modify the bazel.BUILD file by hand to include the compliance protos which are not autogenerated (#4988) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix: Modify the bazel.BUILD file by hand to include the compliance protos which are not autogenerated PiperOrigin-RevId: 420306668 Source-Link: https://github.com/googleapis/googleapis/commit/9a8910e4ea79cd897c316916047766d989192579 Source-Link: https://github.com/googleapis/googleapis-gen/commit/24c9bfc4d59f50a49e22a6070d1c229f523defdc Copy-Tag: eyJwIjoiR3JhZmVhcy8uT3dsQm90LnlhbWwiLCJoIjoiMjRjOWJmYzRkNTlmNTBhNDllMjJhNjA3MGQxYzIyOWY1MjNkZWZkYyJ9 * 🦉 Updates from OwlBot See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: Owl Bot --- Grafeas/metadata/V1/Compliance.php | Bin 1292 -> 1287 bytes Grafeas/metadata/V1/Cvss.php | Bin 1861 -> 3256 bytes Grafeas/metadata/V1/Discovery.php | Bin 1454 -> 1601 bytes Grafeas/metadata/V1/Severity.php | Bin 0 -> 744 bytes Grafeas/metadata/V1/Vulnerability.php | Bin 2848 -> 2737 bytes Grafeas/src/V1/CVSS.php | 384 +++++++++++++++++++++ Grafeas/src/V1/CVSS/AttackComplexity.php | 54 +++ Grafeas/src/V1/CVSS/AttackVector.php | 64 ++++ Grafeas/src/V1/CVSS/Authentication.php | 59 ++++ Grafeas/src/V1/CVSS/Impact.php | 59 ++++ Grafeas/src/V1/CVSS/PrivilegesRequired.php | 59 ++++ Grafeas/src/V1/CVSS/Scope.php | 54 +++ Grafeas/src/V1/CVSS/UserInteraction.php | 54 +++ Grafeas/src/V1/DiscoveryOccurrence.php | 44 +++ Grafeas/src/V1/Severity.php | 2 +- Grafeas/src/V1/VulnerabilityOccurrence.php | 14 +- 16 files changed, 839 insertions(+), 8 deletions(-) create mode 100644 Grafeas/metadata/V1/Severity.php create mode 100644 Grafeas/src/V1/CVSS.php create mode 100644 Grafeas/src/V1/CVSS/AttackComplexity.php create mode 100644 Grafeas/src/V1/CVSS/AttackVector.php create mode 100644 Grafeas/src/V1/CVSS/Authentication.php create mode 100644 Grafeas/src/V1/CVSS/Impact.php create mode 100644 Grafeas/src/V1/CVSS/PrivilegesRequired.php create mode 100644 Grafeas/src/V1/CVSS/Scope.php create mode 100644 Grafeas/src/V1/CVSS/UserInteraction.php diff --git a/Grafeas/metadata/V1/Compliance.php b/Grafeas/metadata/V1/Compliance.php index f0e28dce5231b5c8aba9ef72f18ae1c8b2833103..954fe27d6147431c2f60ff95be313ebc2ecc6d5d 100644 GIT binary patch delta 18 ZcmeC-YUkRphLJTmwJf!0^ESpXW&k}b22ub3 delta 23 ecmZqY>fze3hLJ0*G$${$C^0EBXY)qJFlGQ`PFVsdtTS!!}gevt%= z0;2|>k*r>NQDRzZVzFMCp&m%Fo+DUQ7+8^z4VNHPS8{%CK~8E#W=W+4D_Ex@4xP?$ zg+k_Be2Jwc8L4?Cnfl3zC7Jno5^P|-@|b#|>LAL5944=1l9}AhBq*vEP?TAgnUk8H zS{#&GSejXsnj&O1`7M*AmjZ?%p~b01o_QsyMTyBE%Y;<9Sc{YM3sNOG!M2KFXb1+$ z3Ykw1WtNu`$B^~REdUxMWH@;Ov!pvtX%jBt#InT9oW!Ke9AN0gXM%M}@PMtv(6#vs zvk+r_BO@1|BdU+(xTG9ILp)slLOh)vLp=Tc;zRv{16-Xw-8@}g1Q>**xx~@reM5ah pJOg}O1sH`SxkS+Mm;gY{tU>?) delta 19 bcmdlXd6aL%c1EUST$^_?zG0ax!LtAWPtgaH diff --git a/Grafeas/metadata/V1/Discovery.php b/Grafeas/metadata/V1/Discovery.php index 034a4170ce056d7d44617bd08b9bae46742ee46e..57259be59b7f8158d5618795a45201f324d82929 100644 GIT binary patch delta 136 zcmZ3-eUN9vGDbnig3K7V%+#C|r__wZvdsLV$qGzjlg}}VOkT#gpXC-Cm()aWDP1A1 z^rFPH)Wl-FGD9i(^!)tvoK*dSqWqHlq|!9~lFZ!H;*!MN0zI(M1N#nN=8t kgiN`35{r^EGRsoqLCPf9CbP0AusSh6aAe-B%F@XQ0F8(&r2qf` delta 33 pcmX@evyOYiGRDad8TT_bO#)?J6baQ#w)U+hU&8=Ig00?$NI%OfDH#r)TVGCwh z;FW~n;;;=6CQNIbu8Hs)(5^I_Cp<)Ln6cX)*H>I{!&$d zwz(XSuu*z!wH}!4pivp!?~bU*WJt0^efV2} z*N^7zz`Eov58quv?SHt=D|k5_Tnx_q*^jI9(R4EC`N#gCUw`5}gWaJ&@`v5idd1m= z>go70} z#I96vGbT}diDp@1Dc8+A|Lyhh&sNnt>&|xy=*Rud%IJe4cm*qfe}6pT A_y7O^ literal 0 HcmV?d00001 diff --git a/Grafeas/metadata/V1/Vulnerability.php b/Grafeas/metadata/V1/Vulnerability.php index 74c9f3dc772ef8226c771266e66078956527a5ad..bb481167800307aafab1a134e0f64d149641dbd6 100644 GIT binary patch delta 120 zcmZ1=wo!D$8m7s!82Kj4GjVYQr zi}lM4^^2j3Hs>)fVP;yxI$4B0MNxr^ExD|?xXf6BOMy{?+eknUsza~LP|rCmIC%1A Q_HUcta~LvCZs1w~09mmoZ2$lO delta 206 zcmdlexO%s&3%0!%=|*nC}GJVSj2n1wjFSUf!4Jp@>Uc(^#6fkt>b0~NDQ7UWt000$j2 Aq5uE@ diff --git a/Grafeas/src/V1/CVSS.php b/Grafeas/src/V1/CVSS.php new file mode 100644 index 000000000000..4c21badfc303 --- /dev/null +++ b/Grafeas/src/V1/CVSS.php @@ -0,0 +1,384 @@ +grafeas.v1.CVSS + */ +class CVSS extends \Google\Protobuf\Internal\Message +{ + /** + * The base score is a function of the base metric scores. + * + * Generated from protobuf field float base_score = 1; + */ + private $base_score = 0.0; + /** + * Generated from protobuf field float exploitability_score = 2; + */ + private $exploitability_score = 0.0; + /** + * Generated from protobuf field float impact_score = 3; + */ + private $impact_score = 0.0; + /** + * Base Metrics + * Represents the intrinsic characteristics of a vulnerability that are + * constant over time and across user environments. + * + * Generated from protobuf field .grafeas.v1.CVSS.AttackVector attack_vector = 4; + */ + private $attack_vector = 0; + /** + * Generated from protobuf field .grafeas.v1.CVSS.AttackComplexity attack_complexity = 5; + */ + private $attack_complexity = 0; + /** + * Generated from protobuf field .grafeas.v1.CVSS.Authentication authentication = 6; + */ + private $authentication = 0; + /** + * Generated from protobuf field .grafeas.v1.CVSS.PrivilegesRequired privileges_required = 7; + */ + private $privileges_required = 0; + /** + * Generated from protobuf field .grafeas.v1.CVSS.UserInteraction user_interaction = 8; + */ + private $user_interaction = 0; + /** + * Generated from protobuf field .grafeas.v1.CVSS.Scope scope = 9; + */ + private $scope = 0; + /** + * Generated from protobuf field .grafeas.v1.CVSS.Impact confidentiality_impact = 10; + */ + private $confidentiality_impact = 0; + /** + * Generated from protobuf field .grafeas.v1.CVSS.Impact integrity_impact = 11; + */ + private $integrity_impact = 0; + /** + * Generated from protobuf field .grafeas.v1.CVSS.Impact availability_impact = 12; + */ + private $availability_impact = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type float $base_score + * The base score is a function of the base metric scores. + * @type float $exploitability_score + * @type float $impact_score + * @type int $attack_vector + * Base Metrics + * Represents the intrinsic characteristics of a vulnerability that are + * constant over time and across user environments. + * @type int $attack_complexity + * @type int $authentication + * @type int $privileges_required + * @type int $user_interaction + * @type int $scope + * @type int $confidentiality_impact + * @type int $integrity_impact + * @type int $availability_impact + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Grafeas\V1\Cvss::initOnce(); + parent::__construct($data); + } + + /** + * The base score is a function of the base metric scores. + * + * Generated from protobuf field float base_score = 1; + * @return float + */ + public function getBaseScore() + { + return $this->base_score; + } + + /** + * The base score is a function of the base metric scores. + * + * Generated from protobuf field float base_score = 1; + * @param float $var + * @return $this + */ + public function setBaseScore($var) + { + GPBUtil::checkFloat($var); + $this->base_score = $var; + + return $this; + } + + /** + * Generated from protobuf field float exploitability_score = 2; + * @return float + */ + public function getExploitabilityScore() + { + return $this->exploitability_score; + } + + /** + * Generated from protobuf field float exploitability_score = 2; + * @param float $var + * @return $this + */ + public function setExploitabilityScore($var) + { + GPBUtil::checkFloat($var); + $this->exploitability_score = $var; + + return $this; + } + + /** + * Generated from protobuf field float impact_score = 3; + * @return float + */ + public function getImpactScore() + { + return $this->impact_score; + } + + /** + * Generated from protobuf field float impact_score = 3; + * @param float $var + * @return $this + */ + public function setImpactScore($var) + { + GPBUtil::checkFloat($var); + $this->impact_score = $var; + + return $this; + } + + /** + * Base Metrics + * Represents the intrinsic characteristics of a vulnerability that are + * constant over time and across user environments. + * + * Generated from protobuf field .grafeas.v1.CVSS.AttackVector attack_vector = 4; + * @return int + */ + public function getAttackVector() + { + return $this->attack_vector; + } + + /** + * Base Metrics + * Represents the intrinsic characteristics of a vulnerability that are + * constant over time and across user environments. + * + * Generated from protobuf field .grafeas.v1.CVSS.AttackVector attack_vector = 4; + * @param int $var + * @return $this + */ + public function setAttackVector($var) + { + GPBUtil::checkEnum($var, \Grafeas\V1\CVSS\AttackVector::class); + $this->attack_vector = $var; + + return $this; + } + + /** + * Generated from protobuf field .grafeas.v1.CVSS.AttackComplexity attack_complexity = 5; + * @return int + */ + public function getAttackComplexity() + { + return $this->attack_complexity; + } + + /** + * Generated from protobuf field .grafeas.v1.CVSS.AttackComplexity attack_complexity = 5; + * @param int $var + * @return $this + */ + public function setAttackComplexity($var) + { + GPBUtil::checkEnum($var, \Grafeas\V1\CVSS\AttackComplexity::class); + $this->attack_complexity = $var; + + return $this; + } + + /** + * Generated from protobuf field .grafeas.v1.CVSS.Authentication authentication = 6; + * @return int + */ + public function getAuthentication() + { + return $this->authentication; + } + + /** + * Generated from protobuf field .grafeas.v1.CVSS.Authentication authentication = 6; + * @param int $var + * @return $this + */ + public function setAuthentication($var) + { + GPBUtil::checkEnum($var, \Grafeas\V1\CVSS\Authentication::class); + $this->authentication = $var; + + return $this; + } + + /** + * Generated from protobuf field .grafeas.v1.CVSS.PrivilegesRequired privileges_required = 7; + * @return int + */ + public function getPrivilegesRequired() + { + return $this->privileges_required; + } + + /** + * Generated from protobuf field .grafeas.v1.CVSS.PrivilegesRequired privileges_required = 7; + * @param int $var + * @return $this + */ + public function setPrivilegesRequired($var) + { + GPBUtil::checkEnum($var, \Grafeas\V1\CVSS\PrivilegesRequired::class); + $this->privileges_required = $var; + + return $this; + } + + /** + * Generated from protobuf field .grafeas.v1.CVSS.UserInteraction user_interaction = 8; + * @return int + */ + public function getUserInteraction() + { + return $this->user_interaction; + } + + /** + * Generated from protobuf field .grafeas.v1.CVSS.UserInteraction user_interaction = 8; + * @param int $var + * @return $this + */ + public function setUserInteraction($var) + { + GPBUtil::checkEnum($var, \Grafeas\V1\CVSS\UserInteraction::class); + $this->user_interaction = $var; + + return $this; + } + + /** + * Generated from protobuf field .grafeas.v1.CVSS.Scope scope = 9; + * @return int + */ + public function getScope() + { + return $this->scope; + } + + /** + * Generated from protobuf field .grafeas.v1.CVSS.Scope scope = 9; + * @param int $var + * @return $this + */ + public function setScope($var) + { + GPBUtil::checkEnum($var, \Grafeas\V1\CVSS\Scope::class); + $this->scope = $var; + + return $this; + } + + /** + * Generated from protobuf field .grafeas.v1.CVSS.Impact confidentiality_impact = 10; + * @return int + */ + public function getConfidentialityImpact() + { + return $this->confidentiality_impact; + } + + /** + * Generated from protobuf field .grafeas.v1.CVSS.Impact confidentiality_impact = 10; + * @param int $var + * @return $this + */ + public function setConfidentialityImpact($var) + { + GPBUtil::checkEnum($var, \Grafeas\V1\CVSS\Impact::class); + $this->confidentiality_impact = $var; + + return $this; + } + + /** + * Generated from protobuf field .grafeas.v1.CVSS.Impact integrity_impact = 11; + * @return int + */ + public function getIntegrityImpact() + { + return $this->integrity_impact; + } + + /** + * Generated from protobuf field .grafeas.v1.CVSS.Impact integrity_impact = 11; + * @param int $var + * @return $this + */ + public function setIntegrityImpact($var) + { + GPBUtil::checkEnum($var, \Grafeas\V1\CVSS\Impact::class); + $this->integrity_impact = $var; + + return $this; + } + + /** + * Generated from protobuf field .grafeas.v1.CVSS.Impact availability_impact = 12; + * @return int + */ + public function getAvailabilityImpact() + { + return $this->availability_impact; + } + + /** + * Generated from protobuf field .grafeas.v1.CVSS.Impact availability_impact = 12; + * @param int $var + * @return $this + */ + public function setAvailabilityImpact($var) + { + GPBUtil::checkEnum($var, \Grafeas\V1\CVSS\Impact::class); + $this->availability_impact = $var; + + return $this; + } + +} + diff --git a/Grafeas/src/V1/CVSS/AttackComplexity.php b/Grafeas/src/V1/CVSS/AttackComplexity.php new file mode 100644 index 000000000000..252eb5549db8 --- /dev/null +++ b/Grafeas/src/V1/CVSS/AttackComplexity.php @@ -0,0 +1,54 @@ +grafeas.v1.CVSS.AttackComplexity + */ +class AttackComplexity +{ + /** + * Generated from protobuf enum ATTACK_COMPLEXITY_UNSPECIFIED = 0; + */ + const ATTACK_COMPLEXITY_UNSPECIFIED = 0; + /** + * Generated from protobuf enum ATTACK_COMPLEXITY_LOW = 1; + */ + const ATTACK_COMPLEXITY_LOW = 1; + /** + * Generated from protobuf enum ATTACK_COMPLEXITY_HIGH = 2; + */ + const ATTACK_COMPLEXITY_HIGH = 2; + + private static $valueToName = [ + self::ATTACK_COMPLEXITY_UNSPECIFIED => 'ATTACK_COMPLEXITY_UNSPECIFIED', + self::ATTACK_COMPLEXITY_LOW => 'ATTACK_COMPLEXITY_LOW', + self::ATTACK_COMPLEXITY_HIGH => 'ATTACK_COMPLEXITY_HIGH', + ]; + + 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/CVSS/AttackVector.php b/Grafeas/src/V1/CVSS/AttackVector.php new file mode 100644 index 000000000000..8226035ea9fc --- /dev/null +++ b/Grafeas/src/V1/CVSS/AttackVector.php @@ -0,0 +1,64 @@ +grafeas.v1.CVSS.AttackVector + */ +class AttackVector +{ + /** + * Generated from protobuf enum ATTACK_VECTOR_UNSPECIFIED = 0; + */ + const ATTACK_VECTOR_UNSPECIFIED = 0; + /** + * Generated from protobuf enum ATTACK_VECTOR_NETWORK = 1; + */ + const ATTACK_VECTOR_NETWORK = 1; + /** + * Generated from protobuf enum ATTACK_VECTOR_ADJACENT = 2; + */ + const ATTACK_VECTOR_ADJACENT = 2; + /** + * Generated from protobuf enum ATTACK_VECTOR_LOCAL = 3; + */ + const ATTACK_VECTOR_LOCAL = 3; + /** + * Generated from protobuf enum ATTACK_VECTOR_PHYSICAL = 4; + */ + const ATTACK_VECTOR_PHYSICAL = 4; + + private static $valueToName = [ + self::ATTACK_VECTOR_UNSPECIFIED => 'ATTACK_VECTOR_UNSPECIFIED', + self::ATTACK_VECTOR_NETWORK => 'ATTACK_VECTOR_NETWORK', + self::ATTACK_VECTOR_ADJACENT => 'ATTACK_VECTOR_ADJACENT', + self::ATTACK_VECTOR_LOCAL => 'ATTACK_VECTOR_LOCAL', + self::ATTACK_VECTOR_PHYSICAL => 'ATTACK_VECTOR_PHYSICAL', + ]; + + 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/CVSS/Authentication.php b/Grafeas/src/V1/CVSS/Authentication.php new file mode 100644 index 000000000000..83e50d12e120 --- /dev/null +++ b/Grafeas/src/V1/CVSS/Authentication.php @@ -0,0 +1,59 @@ +grafeas.v1.CVSS.Authentication + */ +class Authentication +{ + /** + * Generated from protobuf enum AUTHENTICATION_UNSPECIFIED = 0; + */ + const AUTHENTICATION_UNSPECIFIED = 0; + /** + * Generated from protobuf enum AUTHENTICATION_MULTIPLE = 1; + */ + const AUTHENTICATION_MULTIPLE = 1; + /** + * Generated from protobuf enum AUTHENTICATION_SINGLE = 2; + */ + const AUTHENTICATION_SINGLE = 2; + /** + * Generated from protobuf enum AUTHENTICATION_NONE = 3; + */ + const AUTHENTICATION_NONE = 3; + + private static $valueToName = [ + self::AUTHENTICATION_UNSPECIFIED => 'AUTHENTICATION_UNSPECIFIED', + self::AUTHENTICATION_MULTIPLE => 'AUTHENTICATION_MULTIPLE', + self::AUTHENTICATION_SINGLE => 'AUTHENTICATION_SINGLE', + self::AUTHENTICATION_NONE => 'AUTHENTICATION_NONE', + ]; + + 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/CVSS/Impact.php b/Grafeas/src/V1/CVSS/Impact.php new file mode 100644 index 000000000000..d1d982099c32 --- /dev/null +++ b/Grafeas/src/V1/CVSS/Impact.php @@ -0,0 +1,59 @@ +grafeas.v1.CVSS.Impact + */ +class Impact +{ + /** + * Generated from protobuf enum IMPACT_UNSPECIFIED = 0; + */ + const IMPACT_UNSPECIFIED = 0; + /** + * Generated from protobuf enum IMPACT_HIGH = 1; + */ + const IMPACT_HIGH = 1; + /** + * Generated from protobuf enum IMPACT_LOW = 2; + */ + const IMPACT_LOW = 2; + /** + * Generated from protobuf enum IMPACT_NONE = 3; + */ + const IMPACT_NONE = 3; + + private static $valueToName = [ + self::IMPACT_UNSPECIFIED => 'IMPACT_UNSPECIFIED', + self::IMPACT_HIGH => 'IMPACT_HIGH', + self::IMPACT_LOW => 'IMPACT_LOW', + self::IMPACT_NONE => 'IMPACT_NONE', + ]; + + 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/CVSS/PrivilegesRequired.php b/Grafeas/src/V1/CVSS/PrivilegesRequired.php new file mode 100644 index 000000000000..1e1df64acbbe --- /dev/null +++ b/Grafeas/src/V1/CVSS/PrivilegesRequired.php @@ -0,0 +1,59 @@ +grafeas.v1.CVSS.PrivilegesRequired + */ +class PrivilegesRequired +{ + /** + * Generated from protobuf enum PRIVILEGES_REQUIRED_UNSPECIFIED = 0; + */ + const PRIVILEGES_REQUIRED_UNSPECIFIED = 0; + /** + * Generated from protobuf enum PRIVILEGES_REQUIRED_NONE = 1; + */ + const PRIVILEGES_REQUIRED_NONE = 1; + /** + * Generated from protobuf enum PRIVILEGES_REQUIRED_LOW = 2; + */ + const PRIVILEGES_REQUIRED_LOW = 2; + /** + * Generated from protobuf enum PRIVILEGES_REQUIRED_HIGH = 3; + */ + const PRIVILEGES_REQUIRED_HIGH = 3; + + private static $valueToName = [ + self::PRIVILEGES_REQUIRED_UNSPECIFIED => 'PRIVILEGES_REQUIRED_UNSPECIFIED', + self::PRIVILEGES_REQUIRED_NONE => 'PRIVILEGES_REQUIRED_NONE', + self::PRIVILEGES_REQUIRED_LOW => 'PRIVILEGES_REQUIRED_LOW', + self::PRIVILEGES_REQUIRED_HIGH => 'PRIVILEGES_REQUIRED_HIGH', + ]; + + 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/CVSS/Scope.php b/Grafeas/src/V1/CVSS/Scope.php new file mode 100644 index 000000000000..fabd226b91d3 --- /dev/null +++ b/Grafeas/src/V1/CVSS/Scope.php @@ -0,0 +1,54 @@ +grafeas.v1.CVSS.Scope + */ +class Scope +{ + /** + * Generated from protobuf enum SCOPE_UNSPECIFIED = 0; + */ + const SCOPE_UNSPECIFIED = 0; + /** + * Generated from protobuf enum SCOPE_UNCHANGED = 1; + */ + const SCOPE_UNCHANGED = 1; + /** + * Generated from protobuf enum SCOPE_CHANGED = 2; + */ + const SCOPE_CHANGED = 2; + + private static $valueToName = [ + self::SCOPE_UNSPECIFIED => 'SCOPE_UNSPECIFIED', + self::SCOPE_UNCHANGED => 'SCOPE_UNCHANGED', + self::SCOPE_CHANGED => 'SCOPE_CHANGED', + ]; + + 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/CVSS/UserInteraction.php b/Grafeas/src/V1/CVSS/UserInteraction.php new file mode 100644 index 000000000000..a8121cdf2392 --- /dev/null +++ b/Grafeas/src/V1/CVSS/UserInteraction.php @@ -0,0 +1,54 @@ +grafeas.v1.CVSS.UserInteraction + */ +class UserInteraction +{ + /** + * Generated from protobuf enum USER_INTERACTION_UNSPECIFIED = 0; + */ + const USER_INTERACTION_UNSPECIFIED = 0; + /** + * Generated from protobuf enum USER_INTERACTION_NONE = 1; + */ + const USER_INTERACTION_NONE = 1; + /** + * Generated from protobuf enum USER_INTERACTION_REQUIRED = 2; + */ + const USER_INTERACTION_REQUIRED = 2; + + private static $valueToName = [ + self::USER_INTERACTION_UNSPECIFIED => 'USER_INTERACTION_UNSPECIFIED', + self::USER_INTERACTION_NONE => 'USER_INTERACTION_NONE', + self::USER_INTERACTION_REQUIRED => 'USER_INTERACTION_REQUIRED', + ]; + + 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/DiscoveryOccurrence.php b/Grafeas/src/V1/DiscoveryOccurrence.php index 55fb2d325543..f4ff68b50d95 100644 --- a/Grafeas/src/V1/DiscoveryOccurrence.php +++ b/Grafeas/src/V1/DiscoveryOccurrence.php @@ -47,6 +47,12 @@ class DiscoveryOccurrence extends \Google\Protobuf\Internal\Message * Generated from protobuf field .google.protobuf.Timestamp last_scan_time = 5; */ private $last_scan_time = null; + /** + * The time occurrences related to this discovery occurrence were archived. + * + * Generated from protobuf field .google.protobuf.Timestamp archive_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $archive_time = null; /** * Constructor. @@ -66,6 +72,8 @@ class DiscoveryOccurrence extends \Google\Protobuf\Internal\Message * The CPE of the resource being scanned. * @type \Google\Protobuf\Timestamp $last_scan_time * The last time this resource was scanned. + * @type \Google\Protobuf\Timestamp $archive_time + * The time occurrences related to this discovery occurrence were archived. * } */ public function __construct($data = NULL) { @@ -227,5 +235,41 @@ public function setLastScanTime($var) return $this; } + /** + * The time occurrences related to this discovery occurrence were archived. + * + * Generated from protobuf field .google.protobuf.Timestamp archive_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getArchiveTime() + { + return $this->archive_time; + } + + public function hasArchiveTime() + { + return isset($this->archive_time); + } + + public function clearArchiveTime() + { + unset($this->archive_time); + } + + /** + * The time occurrences related to this discovery occurrence were archived. + * + * Generated from protobuf field .google.protobuf.Timestamp archive_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setArchiveTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->archive_time = $var; + + return $this; + } + } diff --git a/Grafeas/src/V1/Severity.php b/Grafeas/src/V1/Severity.php index 5898e5a209dc..698112c5460e 100644 --- a/Grafeas/src/V1/Severity.php +++ b/Grafeas/src/V1/Severity.php @@ -1,6 +1,6 @@ .grafeas.v1.VulnerabilityOccurrence.CVSSV3 cvssv3 = 10; + * Generated from protobuf field .grafeas.v1.CVSS cvssv3 = 10; */ private $cvssv3 = null; /** @@ -104,7 +104,7 @@ class VulnerabilityOccurrence extends \Google\Protobuf\Internal\Message * Output only. The CVSS score of this vulnerability. CVSS score is on a * scale of 0 - 10 where 0 indicates low severity and 10 indicates high * severity. - * @type \Grafeas\V1\VulnerabilityOccurrence\CVSSV3 $cvssv3 + * @type \Grafeas\V1\CVSS $cvssv3 * The cvss v3 score for the vulnerability. * @type \Grafeas\V1\VulnerabilityOccurrence\PackageIssue[]|\Google\Protobuf\Internal\RepeatedField $package_issue * Required. The set of affected locations and their fixes (if available) @@ -222,8 +222,8 @@ public function setCvssScore($var) /** * The cvss v3 score for the vulnerability. * - * Generated from protobuf field .grafeas.v1.VulnerabilityOccurrence.CVSSV3 cvssv3 = 10; - * @return \Grafeas\V1\VulnerabilityOccurrence\CVSSV3|null + * Generated from protobuf field .grafeas.v1.CVSS cvssv3 = 10; + * @return \Grafeas\V1\CVSS|null */ public function getCvssv3() { @@ -243,13 +243,13 @@ public function clearCvssv3() /** * The cvss v3 score for the vulnerability. * - * Generated from protobuf field .grafeas.v1.VulnerabilityOccurrence.CVSSV3 cvssv3 = 10; - * @param \Grafeas\V1\VulnerabilityOccurrence\CVSSV3 $var + * Generated from protobuf field .grafeas.v1.CVSS cvssv3 = 10; + * @param \Grafeas\V1\CVSS $var * @return $this */ public function setCvssv3($var) { - GPBUtil::checkMessage($var, \Grafeas\V1\VulnerabilityOccurrence\CVSSV3::class); + GPBUtil::checkMessage($var, \Grafeas\V1\CVSS::class); $this->cvssv3 = $var; return $this;