Skip to content

Commit

Permalink
feat: Add GovernanceEvent message (#11939)
Browse files Browse the repository at this point in the history
- [ ] 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>
  • Loading branch information
gcf-owl-bot[bot] and gcf-owl-bot[bot] committed Oct 31, 2023
1 parent 9cd9608 commit a8e7269
Show file tree
Hide file tree
Showing 5 changed files with 127 additions and 0 deletions.
Expand Up @@ -112,6 +112,7 @@
DataQualityScanRuleResult,
DataScanEvent,
DiscoveryEvent,
GovernanceEvent,
JobEvent,
SessionEvent,
)
Expand Down Expand Up @@ -257,6 +258,7 @@
"DataQualityScanRuleResult",
"DataScanEvent",
"DiscoveryEvent",
"GovernanceEvent",
"JobEvent",
"SessionEvent",
"CreateEntityRequest",
Expand Down
Expand Up @@ -90,6 +90,7 @@
DataQualityScanRuleResult,
DataScanEvent,
DiscoveryEvent,
GovernanceEvent,
JobEvent,
SessionEvent,
)
Expand Down Expand Up @@ -236,6 +237,7 @@
"GetPartitionRequest",
"GetTaskRequest",
"GetZoneRequest",
"GovernanceEvent",
"Job",
"JobEvent",
"Lake",
Expand Down
Expand Up @@ -74,6 +74,7 @@
DataQualityScanRuleResult,
DataScanEvent,
DiscoveryEvent,
GovernanceEvent,
JobEvent,
SessionEvent,
)
Expand Down Expand Up @@ -202,6 +203,7 @@
"DataQualityScanRuleResult",
"DataScanEvent",
"DiscoveryEvent",
"GovernanceEvent",
"JobEvent",
"SessionEvent",
"CreateEntityRequest",
Expand Down
118 changes: 118 additions & 0 deletions packages/google-cloud-dataplex/google/cloud/dataplex_v1/types/logs.py
Expand Up @@ -27,6 +27,7 @@
"DiscoveryEvent",
"JobEvent",
"SessionEvent",
"GovernanceEvent",
"DataScanEvent",
"DataQualityScanRuleResult",
},
Expand Down Expand Up @@ -565,6 +566,123 @@ class Engine(proto.Enum):
)


class GovernanceEvent(proto.Message):
r"""Payload associated with Governance related log events.
.. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields
Attributes:
message (str):
The log message.
event_type (google.cloud.dataplex_v1.types.GovernanceEvent.EventType):
The type of the event.
entity (google.cloud.dataplex_v1.types.GovernanceEvent.Entity):
Entity resource information if the log event
is associated with a specific entity.
This field is a member of `oneof`_ ``_entity``.
"""

class EventType(proto.Enum):
r"""Type of governance log event.
Values:
EVENT_TYPE_UNSPECIFIED (0):
An unspecified event type.
RESOURCE_IAM_POLICY_UPDATE (1):
Resource IAM policy update event.
BIGQUERY_TABLE_CREATE (2):
BigQuery table create event.
BIGQUERY_TABLE_UPDATE (3):
BigQuery table update event.
BIGQUERY_TABLE_DELETE (4):
BigQuery table delete event.
BIGQUERY_CONNECTION_CREATE (5):
BigQuery connection create event.
BIGQUERY_CONNECTION_UPDATE (6):
BigQuery connection update event.
BIGQUERY_CONNECTION_DELETE (7):
BigQuery connection delete event.
BIGQUERY_TAXONOMY_CREATE (10):
BigQuery taxonomy created.
BIGQUERY_POLICY_TAG_CREATE (11):
BigQuery policy tag created.
BIGQUERY_POLICY_TAG_DELETE (12):
BigQuery policy tag deleted.
BIGQUERY_POLICY_TAG_SET_IAM_POLICY (13):
BigQuery set iam policy for policy tag.
ACCESS_POLICY_UPDATE (14):
Access policy update event.
"""
EVENT_TYPE_UNSPECIFIED = 0
RESOURCE_IAM_POLICY_UPDATE = 1
BIGQUERY_TABLE_CREATE = 2
BIGQUERY_TABLE_UPDATE = 3
BIGQUERY_TABLE_DELETE = 4
BIGQUERY_CONNECTION_CREATE = 5
BIGQUERY_CONNECTION_UPDATE = 6
BIGQUERY_CONNECTION_DELETE = 7
BIGQUERY_TAXONOMY_CREATE = 10
BIGQUERY_POLICY_TAG_CREATE = 11
BIGQUERY_POLICY_TAG_DELETE = 12
BIGQUERY_POLICY_TAG_SET_IAM_POLICY = 13
ACCESS_POLICY_UPDATE = 14

class Entity(proto.Message):
r"""Information about Entity resource that the log event is
associated with.
Attributes:
entity (str):
The Entity resource the log event is associated with.
Format:
``projects/{project_number}/locations/{location_id}/lakes/{lake_id}/zones/{zone_id}/entities/{entity_id}``
entity_type (google.cloud.dataplex_v1.types.GovernanceEvent.Entity.EntityType):
Type of entity.
"""

class EntityType(proto.Enum):
r"""Type of entity.
Values:
ENTITY_TYPE_UNSPECIFIED (0):
An unspecified Entity type.
TABLE (1):
Table entity type.
FILESET (2):
Fileset entity type.
"""
ENTITY_TYPE_UNSPECIFIED = 0
TABLE = 1
FILESET = 2

entity: str = proto.Field(
proto.STRING,
number=1,
)
entity_type: "GovernanceEvent.Entity.EntityType" = proto.Field(
proto.ENUM,
number=2,
enum="GovernanceEvent.Entity.EntityType",
)

message: str = proto.Field(
proto.STRING,
number=1,
)
event_type: EventType = proto.Field(
proto.ENUM,
number=2,
enum=EventType,
)
entity: Entity = proto.Field(
proto.MESSAGE,
number=3,
optional=True,
message=Entity,
)


class DataScanEvent(proto.Message):
r"""These messages contain information about the execution of a
datascan. The monitored resource is 'DataScan'
Expand Down
3 changes: 3 additions & 0 deletions packages/google-cloud-dataplex/noxfile.py
Expand Up @@ -29,8 +29,10 @@

BLACK_VERSION = "black[jupyter]==23.7.0"
ISORT_VERSION = "isort==5.11.0"

LINT_PATHS = ["docs", "google", "tests", "noxfile.py", "setup.py"]


DEFAULT_PYTHON_VERSION = "3.9"

UNIT_TEST_PYTHON_VERSIONS: List[str] = ["3.7", "3.8", "3.9", "3.10", "3.11"]
Expand Down Expand Up @@ -89,6 +91,7 @@ def lint(session):
"--check",
*LINT_PATHS,
)

session.run("flake8", "google", "tests")


Expand Down

0 comments on commit a8e7269

Please sign in to comment.