Skip to content

Commit a8e7269

Browse files
feat: Add GovernanceEvent message (#11939)
- [ ] Regenerate this pull request now. PiperOrigin-RevId: 577940009 Source-Link: googleapis/googleapis@ac76e17 Source-Link: googleapis/googleapis-gen@fbe80c4 Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLWRhdGFwbGV4Ly5Pd2xCb3QueWFtbCIsImgiOiJmYmU4MGM0ODJmZWNiNGJiY2E0MWJiMWRiZGMxYzdkNDkzNTliNzIxIn0= --------- Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
1 parent 9cd9608 commit a8e7269

File tree

5 files changed

+127
-0
lines changed

5 files changed

+127
-0
lines changed

packages/google-cloud-dataplex/google/cloud/dataplex/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,7 @@
112112
DataQualityScanRuleResult,
113113
DataScanEvent,
114114
DiscoveryEvent,
115+
GovernanceEvent,
115116
JobEvent,
116117
SessionEvent,
117118
)
@@ -257,6 +258,7 @@
257258
"DataQualityScanRuleResult",
258259
"DataScanEvent",
259260
"DiscoveryEvent",
261+
"GovernanceEvent",
260262
"JobEvent",
261263
"SessionEvent",
262264
"CreateEntityRequest",

packages/google-cloud-dataplex/google/cloud/dataplex_v1/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@
9090
DataQualityScanRuleResult,
9191
DataScanEvent,
9292
DiscoveryEvent,
93+
GovernanceEvent,
9394
JobEvent,
9495
SessionEvent,
9596
)
@@ -236,6 +237,7 @@
236237
"GetPartitionRequest",
237238
"GetTaskRequest",
238239
"GetZoneRequest",
240+
"GovernanceEvent",
239241
"Job",
240242
"JobEvent",
241243
"Lake",

packages/google-cloud-dataplex/google/cloud/dataplex_v1/types/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@
7474
DataQualityScanRuleResult,
7575
DataScanEvent,
7676
DiscoveryEvent,
77+
GovernanceEvent,
7778
JobEvent,
7879
SessionEvent,
7980
)
@@ -202,6 +203,7 @@
202203
"DataQualityScanRuleResult",
203204
"DataScanEvent",
204205
"DiscoveryEvent",
206+
"GovernanceEvent",
205207
"JobEvent",
206208
"SessionEvent",
207209
"CreateEntityRequest",

packages/google-cloud-dataplex/google/cloud/dataplex_v1/types/logs.py

Lines changed: 118 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
"DiscoveryEvent",
2828
"JobEvent",
2929
"SessionEvent",
30+
"GovernanceEvent",
3031
"DataScanEvent",
3132
"DataQualityScanRuleResult",
3233
},
@@ -565,6 +566,123 @@ class Engine(proto.Enum):
565566
)
566567

567568

569+
class GovernanceEvent(proto.Message):
570+
r"""Payload associated with Governance related log events.
571+
572+
.. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields
573+
574+
Attributes:
575+
message (str):
576+
The log message.
577+
event_type (google.cloud.dataplex_v1.types.GovernanceEvent.EventType):
578+
The type of the event.
579+
entity (google.cloud.dataplex_v1.types.GovernanceEvent.Entity):
580+
Entity resource information if the log event
581+
is associated with a specific entity.
582+
583+
This field is a member of `oneof`_ ``_entity``.
584+
"""
585+
586+
class EventType(proto.Enum):
587+
r"""Type of governance log event.
588+
589+
Values:
590+
EVENT_TYPE_UNSPECIFIED (0):
591+
An unspecified event type.
592+
RESOURCE_IAM_POLICY_UPDATE (1):
593+
Resource IAM policy update event.
594+
BIGQUERY_TABLE_CREATE (2):
595+
BigQuery table create event.
596+
BIGQUERY_TABLE_UPDATE (3):
597+
BigQuery table update event.
598+
BIGQUERY_TABLE_DELETE (4):
599+
BigQuery table delete event.
600+
BIGQUERY_CONNECTION_CREATE (5):
601+
BigQuery connection create event.
602+
BIGQUERY_CONNECTION_UPDATE (6):
603+
BigQuery connection update event.
604+
BIGQUERY_CONNECTION_DELETE (7):
605+
BigQuery connection delete event.
606+
BIGQUERY_TAXONOMY_CREATE (10):
607+
BigQuery taxonomy created.
608+
BIGQUERY_POLICY_TAG_CREATE (11):
609+
BigQuery policy tag created.
610+
BIGQUERY_POLICY_TAG_DELETE (12):
611+
BigQuery policy tag deleted.
612+
BIGQUERY_POLICY_TAG_SET_IAM_POLICY (13):
613+
BigQuery set iam policy for policy tag.
614+
ACCESS_POLICY_UPDATE (14):
615+
Access policy update event.
616+
"""
617+
EVENT_TYPE_UNSPECIFIED = 0
618+
RESOURCE_IAM_POLICY_UPDATE = 1
619+
BIGQUERY_TABLE_CREATE = 2
620+
BIGQUERY_TABLE_UPDATE = 3
621+
BIGQUERY_TABLE_DELETE = 4
622+
BIGQUERY_CONNECTION_CREATE = 5
623+
BIGQUERY_CONNECTION_UPDATE = 6
624+
BIGQUERY_CONNECTION_DELETE = 7
625+
BIGQUERY_TAXONOMY_CREATE = 10
626+
BIGQUERY_POLICY_TAG_CREATE = 11
627+
BIGQUERY_POLICY_TAG_DELETE = 12
628+
BIGQUERY_POLICY_TAG_SET_IAM_POLICY = 13
629+
ACCESS_POLICY_UPDATE = 14
630+
631+
class Entity(proto.Message):
632+
r"""Information about Entity resource that the log event is
633+
associated with.
634+
635+
Attributes:
636+
entity (str):
637+
The Entity resource the log event is associated with.
638+
Format:
639+
``projects/{project_number}/locations/{location_id}/lakes/{lake_id}/zones/{zone_id}/entities/{entity_id}``
640+
entity_type (google.cloud.dataplex_v1.types.GovernanceEvent.Entity.EntityType):
641+
Type of entity.
642+
"""
643+
644+
class EntityType(proto.Enum):
645+
r"""Type of entity.
646+
647+
Values:
648+
ENTITY_TYPE_UNSPECIFIED (0):
649+
An unspecified Entity type.
650+
TABLE (1):
651+
Table entity type.
652+
FILESET (2):
653+
Fileset entity type.
654+
"""
655+
ENTITY_TYPE_UNSPECIFIED = 0
656+
TABLE = 1
657+
FILESET = 2
658+
659+
entity: str = proto.Field(
660+
proto.STRING,
661+
number=1,
662+
)
663+
entity_type: "GovernanceEvent.Entity.EntityType" = proto.Field(
664+
proto.ENUM,
665+
number=2,
666+
enum="GovernanceEvent.Entity.EntityType",
667+
)
668+
669+
message: str = proto.Field(
670+
proto.STRING,
671+
number=1,
672+
)
673+
event_type: EventType = proto.Field(
674+
proto.ENUM,
675+
number=2,
676+
enum=EventType,
677+
)
678+
entity: Entity = proto.Field(
679+
proto.MESSAGE,
680+
number=3,
681+
optional=True,
682+
message=Entity,
683+
)
684+
685+
568686
class DataScanEvent(proto.Message):
569687
r"""These messages contain information about the execution of a
570688
datascan. The monitored resource is 'DataScan'

packages/google-cloud-dataplex/noxfile.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,10 @@
2929

3030
BLACK_VERSION = "black[jupyter]==23.7.0"
3131
ISORT_VERSION = "isort==5.11.0"
32+
3233
LINT_PATHS = ["docs", "google", "tests", "noxfile.py", "setup.py"]
3334

35+
3436
DEFAULT_PYTHON_VERSION = "3.9"
3537

3638
UNIT_TEST_PYTHON_VERSIONS: List[str] = ["3.7", "3.8", "3.9", "3.10", "3.11"]
@@ -89,6 +91,7 @@ def lint(session):
8991
"--check",
9092
*LINT_PATHS,
9193
)
94+
9295
session.run("flake8", "google", "tests")
9396

9497

0 commit comments

Comments
 (0)