diff --git a/packages/grafeas/grafeas/grafeas_v1/services/grafeas/transports/rest.py b/packages/grafeas/grafeas/grafeas_v1/services/grafeas/transports/rest.py index d6efd688605c..00fff7011546 100644 --- a/packages/grafeas/grafeas/grafeas_v1/services/grafeas/transports/rest.py +++ b/packages/grafeas/grafeas/grafeas_v1/services/grafeas/transports/rest.py @@ -609,6 +609,11 @@ def __call__( "uri": "/v1/{parent=projects/*}/notes:batchCreate", "body": "*", }, + { + "method": "post", + "uri": "/v1/{parent=projects/*/locations/*}/notes:batchCreate", + "body": "*", + }, ] request, metadata = self._interceptor.pre_batch_create_notes( request, metadata @@ -706,6 +711,11 @@ def __call__( "uri": "/v1/{parent=projects/*}/occurrences:batchCreate", "body": "*", }, + { + "method": "post", + "uri": "/v1/{parent=projects/*/locations/*}/occurrences:batchCreate", + "body": "*", + }, ] request, metadata = self._interceptor.pre_batch_create_occurrences( request, metadata @@ -804,6 +814,11 @@ def __call__( "uri": "/v1/{parent=projects/*}/notes", "body": "note", }, + { + "method": "post", + "uri": "/v1/{parent=projects/*/locations/*}/notes", + "body": "note", + }, ] request, metadata = self._interceptor.pre_create_note(request, metadata) pb_request = grafeas.CreateNoteRequest.pb(request) @@ -898,6 +913,11 @@ def __call__( "uri": "/v1/{parent=projects/*}/occurrences", "body": "occurrence", }, + { + "method": "post", + "uri": "/v1/{parent=projects/*/locations/*}/occurrences", + "body": "occurrence", + }, ] request, metadata = self._interceptor.pre_create_occurrence( request, metadata @@ -987,6 +1007,10 @@ def __call__( "method": "delete", "uri": "/v1/{name=projects/*/notes/*}", }, + { + "method": "delete", + "uri": "/v1/{name=projects/*/locations/*/notes/*}", + }, ] request, metadata = self._interceptor.pre_delete_note(request, metadata) pb_request = grafeas.DeleteNoteRequest.pb(request) @@ -1060,6 +1084,10 @@ def __call__( "method": "delete", "uri": "/v1/{name=projects/*/occurrences/*}", }, + { + "method": "delete", + "uri": "/v1/{name=projects/*/locations/*/occurrences/*}", + }, ] request, metadata = self._interceptor.pre_delete_occurrence( request, metadata @@ -1692,6 +1720,11 @@ def __call__( "uri": "/v1/{name=projects/*/notes/*}", "body": "note", }, + { + "method": "patch", + "uri": "/v1/{name=projects/*/locations/*/notes/*}", + "body": "note", + }, ] request, metadata = self._interceptor.pre_update_note(request, metadata) pb_request = grafeas.UpdateNoteRequest.pb(request) @@ -1786,6 +1819,11 @@ def __call__( "uri": "/v1/{name=projects/*/occurrences/*}", "body": "occurrence", }, + { + "method": "patch", + "uri": "/v1/{name=projects/*/locations/*/occurrences/*}", + "body": "occurrence", + }, ] request, metadata = self._interceptor.pre_update_occurrence( request, metadata diff --git a/packages/grafeas/grafeas/grafeas_v1/types/compliance.py b/packages/grafeas/grafeas/grafeas_v1/types/compliance.py index 567028dc99cd..77228d04f08a 100644 --- a/packages/grafeas/grafeas/grafeas_v1/types/compliance.py +++ b/packages/grafeas/grafeas/grafeas_v1/types/compliance.py @@ -163,6 +163,9 @@ class ComplianceOccurrence(proto.Message): non_compliance_reason (str): + version (grafeas.grafeas_v1.types.ComplianceVersion): + The OS and config version the benchmark was + run on. """ non_compliant_files: MutableSequence["NonCompliantFile"] = proto.RepeatedField( @@ -174,6 +177,11 @@ class ComplianceOccurrence(proto.Message): proto.STRING, number=3, ) + version: "ComplianceVersion" = proto.Field( + proto.MESSAGE, + number=4, + message="ComplianceVersion", + ) class NonCompliantFile(proto.Message): diff --git a/packages/grafeas/grafeas/grafeas_v1/types/discovery.py b/packages/grafeas/grafeas/grafeas_v1/types/discovery.py index 58fe5a065725..198bcc0c0cbb 100644 --- a/packages/grafeas/grafeas/grafeas_v1/types/discovery.py +++ b/packages/grafeas/grafeas/grafeas_v1/types/discovery.py @@ -80,6 +80,9 @@ class DiscoveryOccurrence(proto.Message): discovery occurrence were archived. sbom_status (grafeas.grafeas_v1.types.DiscoveryOccurrence.SBOMStatus): The status of an SBOM generation. + vulnerability_attestation (grafeas.grafeas_v1.types.DiscoveryOccurrence.VulnerabilityAttestation): + The status of an vulnerability attestation + generation. """ class ContinuousAnalysis(proto.Enum): @@ -179,6 +182,53 @@ class SBOMState(proto.Enum): number=2, ) + class VulnerabilityAttestation(proto.Message): + r"""The status of an vulnerability attestation generation. + + Attributes: + last_attempt_time (google.protobuf.timestamp_pb2.Timestamp): + The last time we attempted to generate an + attestation. + state (grafeas.grafeas_v1.types.DiscoveryOccurrence.VulnerabilityAttestation.VulnerabilityAttestationState): + The success/failure state of the latest + attestation attempt. + error (str): + If failure, the error reason for why the + attestation generation failed. + """ + + class VulnerabilityAttestationState(proto.Enum): + r"""An enum indicating the state of the attestation generation. + + Values: + VULNERABILITY_ATTESTATION_STATE_UNSPECIFIED (0): + Default unknown state. + SUCCESS (1): + Attestation was successfully generated and + stored. + FAILURE (2): + Attestation was unsuccessfully generated and + stored. + """ + VULNERABILITY_ATTESTATION_STATE_UNSPECIFIED = 0 + SUCCESS = 1 + FAILURE = 2 + + last_attempt_time: timestamp_pb2.Timestamp = proto.Field( + proto.MESSAGE, + number=1, + message=timestamp_pb2.Timestamp, + ) + state: "DiscoveryOccurrence.VulnerabilityAttestation.VulnerabilityAttestationState" = proto.Field( + proto.ENUM, + number=2, + enum="DiscoveryOccurrence.VulnerabilityAttestation.VulnerabilityAttestationState", + ) + error: str = proto.Field( + proto.STRING, + number=3, + ) + continuous_analysis: ContinuousAnalysis = proto.Field( proto.ENUM, number=1, @@ -223,6 +273,11 @@ class SBOMState(proto.Enum): number=9, message=SBOMStatus, ) + vulnerability_attestation: VulnerabilityAttestation = proto.Field( + proto.MESSAGE, + number=10, + message=VulnerabilityAttestation, + ) __all__ = tuple(sorted(__protobuf__.manifest)) diff --git a/packages/grafeas/tests/unit/gapic/grafeas_v1/test_grafeas.py b/packages/grafeas/tests/unit/gapic/grafeas_v1/test_grafeas.py index 08109cb6d8ee..45679a0a8311 100644 --- a/packages/grafeas/tests/unit/gapic/grafeas_v1/test_grafeas.py +++ b/packages/grafeas/tests/unit/gapic/grafeas_v1/test_grafeas.py @@ -7383,6 +7383,11 @@ def test_create_occurrence_rest(request_type): "last_scan_time": {}, "archive_time": {}, "sbom_status": {"sbom_state": 1, "error": "error_value"}, + "vulnerability_attestation": { + "last_attempt_time": {}, + "state": 1, + "error": "error_value", + }, }, "attestation": { "serialized_payload": b"serialized_payload_blob", @@ -7421,6 +7426,11 @@ def test_create_occurrence_rest(request_type): } ], "non_compliance_reason": "non_compliance_reason_value", + "version": { + "cpe_uri": "cpe_uri_value", + "benchmark_document": "benchmark_document_value", + "version": "version_value", + }, }, "dsse_attestation": { "envelope": { @@ -8442,6 +8452,11 @@ def test_update_occurrence_rest(request_type): "last_scan_time": {}, "archive_time": {}, "sbom_status": {"sbom_state": 1, "error": "error_value"}, + "vulnerability_attestation": { + "last_attempt_time": {}, + "state": 1, + "error": "error_value", + }, }, "attestation": { "serialized_payload": b"serialized_payload_blob", @@ -8480,6 +8495,11 @@ def test_update_occurrence_rest(request_type): } ], "non_compliance_reason": "non_compliance_reason_value", + "version": { + "cpe_uri": "cpe_uri_value", + "benchmark_document": "benchmark_document_value", + "version": "version_value", + }, }, "dsse_attestation": { "envelope": {