diff --git a/packages/google-cloud-dataplex/protos/google/cloud/dataplex/v1/logs.proto b/packages/google-cloud-dataplex/protos/google/cloud/dataplex/v1/logs.proto index 191327b3750..0691afbbbaf 100644 --- a/packages/google-cloud-dataplex/protos/google/cloud/dataplex/v1/logs.proto +++ b/packages/google-cloud-dataplex/protos/google/cloud/dataplex/v1/logs.proto @@ -315,6 +315,86 @@ message SessionEvent { google.protobuf.Duration unassigned_duration = 8; } +// Payload associated with Governance related log events. +message GovernanceEvent { + // Information about Entity resource that the log event is associated with. + message Entity { + // Type of entity. + enum EntityType { + // An unspecified Entity type. + ENTITY_TYPE_UNSPECIFIED = 0; + + // Table entity type. + TABLE = 1; + + // Fileset entity type. + FILESET = 2; + } + + // 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}` + string entity = 1 [(google.api.resource_reference) = { + type: "dataplex.googleapis.com/Entity" + }]; + + // Type of entity. + EntityType entity_type = 2; + } + + // Type of governance log event. + enum EventType { + // An unspecified event type. + EVENT_TYPE_UNSPECIFIED = 0; + + // Resource IAM policy update event. + RESOURCE_IAM_POLICY_UPDATE = 1; + + // BigQuery table create event. + BIGQUERY_TABLE_CREATE = 2; + + // BigQuery table update event. + BIGQUERY_TABLE_UPDATE = 3; + + // BigQuery table delete event. + BIGQUERY_TABLE_DELETE = 4; + + // BigQuery connection create event. + BIGQUERY_CONNECTION_CREATE = 5; + + // BigQuery connection update event. + BIGQUERY_CONNECTION_UPDATE = 6; + + // BigQuery connection delete event. + BIGQUERY_CONNECTION_DELETE = 7; + + // BigQuery taxonomy created. + BIGQUERY_TAXONOMY_CREATE = 10; + + // BigQuery policy tag created. + BIGQUERY_POLICY_TAG_CREATE = 11; + + // BigQuery policy tag deleted. + BIGQUERY_POLICY_TAG_DELETE = 12; + + // BigQuery set iam policy for policy tag. + BIGQUERY_POLICY_TAG_SET_IAM_POLICY = 13; + + // Access policy update event. + ACCESS_POLICY_UPDATE = 14; + } + + // The log message. + string message = 1; + + // The type of the event. + EventType event_type = 2; + + // Entity resource information if the log event is associated with a + // specific entity. + optional Entity entity = 3; +} + // These messages contain information about the execution of a datascan. // The monitored resource is 'DataScan' // Next ID: 13 diff --git a/packages/google-cloud-dataplex/protos/protos.d.ts b/packages/google-cloud-dataplex/protos/protos.d.ts index fd1e835608c..a09fa355d0e 100644 --- a/packages/google-cloud-dataplex/protos/protos.d.ts +++ b/packages/google-cloud-dataplex/protos/protos.d.ts @@ -22500,6 +22500,251 @@ export namespace google { } } + /** Properties of a GovernanceEvent. */ + interface IGovernanceEvent { + + /** GovernanceEvent message */ + message?: (string|null); + + /** GovernanceEvent eventType */ + eventType?: (google.cloud.dataplex.v1.GovernanceEvent.EventType|keyof typeof google.cloud.dataplex.v1.GovernanceEvent.EventType|null); + + /** GovernanceEvent entity */ + entity?: (google.cloud.dataplex.v1.GovernanceEvent.IEntity|null); + } + + /** Represents a GovernanceEvent. */ + class GovernanceEvent implements IGovernanceEvent { + + /** + * Constructs a new GovernanceEvent. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataplex.v1.IGovernanceEvent); + + /** GovernanceEvent message. */ + public message: string; + + /** GovernanceEvent eventType. */ + public eventType: (google.cloud.dataplex.v1.GovernanceEvent.EventType|keyof typeof google.cloud.dataplex.v1.GovernanceEvent.EventType); + + /** GovernanceEvent entity. */ + public entity?: (google.cloud.dataplex.v1.GovernanceEvent.IEntity|null); + + /** GovernanceEvent _entity. */ + public _entity?: "entity"; + + /** + * Creates a new GovernanceEvent instance using the specified properties. + * @param [properties] Properties to set + * @returns GovernanceEvent instance + */ + public static create(properties?: google.cloud.dataplex.v1.IGovernanceEvent): google.cloud.dataplex.v1.GovernanceEvent; + + /** + * Encodes the specified GovernanceEvent message. Does not implicitly {@link google.cloud.dataplex.v1.GovernanceEvent.verify|verify} messages. + * @param message GovernanceEvent message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dataplex.v1.IGovernanceEvent, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GovernanceEvent message, length delimited. Does not implicitly {@link google.cloud.dataplex.v1.GovernanceEvent.verify|verify} messages. + * @param message GovernanceEvent message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dataplex.v1.IGovernanceEvent, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GovernanceEvent message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GovernanceEvent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataplex.v1.GovernanceEvent; + + /** + * Decodes a GovernanceEvent message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GovernanceEvent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataplex.v1.GovernanceEvent; + + /** + * Verifies a GovernanceEvent message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GovernanceEvent message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GovernanceEvent + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dataplex.v1.GovernanceEvent; + + /** + * Creates a plain object from a GovernanceEvent message. Also converts values to other types if specified. + * @param message GovernanceEvent + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dataplex.v1.GovernanceEvent, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GovernanceEvent to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GovernanceEvent + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace GovernanceEvent { + + /** Properties of an Entity. */ + interface IEntity { + + /** Entity entity */ + entity?: (string|null); + + /** Entity entityType */ + entityType?: (google.cloud.dataplex.v1.GovernanceEvent.Entity.EntityType|keyof typeof google.cloud.dataplex.v1.GovernanceEvent.Entity.EntityType|null); + } + + /** Represents an Entity. */ + class Entity implements IEntity { + + /** + * Constructs a new Entity. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataplex.v1.GovernanceEvent.IEntity); + + /** Entity entity. */ + public entity: string; + + /** Entity entityType. */ + public entityType: (google.cloud.dataplex.v1.GovernanceEvent.Entity.EntityType|keyof typeof google.cloud.dataplex.v1.GovernanceEvent.Entity.EntityType); + + /** + * Creates a new Entity instance using the specified properties. + * @param [properties] Properties to set + * @returns Entity instance + */ + public static create(properties?: google.cloud.dataplex.v1.GovernanceEvent.IEntity): google.cloud.dataplex.v1.GovernanceEvent.Entity; + + /** + * Encodes the specified Entity message. Does not implicitly {@link google.cloud.dataplex.v1.GovernanceEvent.Entity.verify|verify} messages. + * @param message Entity message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dataplex.v1.GovernanceEvent.IEntity, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Entity message, length delimited. Does not implicitly {@link google.cloud.dataplex.v1.GovernanceEvent.Entity.verify|verify} messages. + * @param message Entity message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dataplex.v1.GovernanceEvent.IEntity, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Entity message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Entity + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataplex.v1.GovernanceEvent.Entity; + + /** + * Decodes an Entity message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Entity + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataplex.v1.GovernanceEvent.Entity; + + /** + * Verifies an Entity message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Entity message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Entity + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dataplex.v1.GovernanceEvent.Entity; + + /** + * Creates a plain object from an Entity message. Also converts values to other types if specified. + * @param message Entity + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dataplex.v1.GovernanceEvent.Entity, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Entity to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Entity + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Entity { + + /** EntityType enum. */ + enum EntityType { + ENTITY_TYPE_UNSPECIFIED = 0, + TABLE = 1, + FILESET = 2 + } + } + + /** EventType enum. */ + enum EventType { + 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 + } + } + /** Properties of a DataScanEvent. */ interface IDataScanEvent { diff --git a/packages/google-cloud-dataplex/protos/protos.js b/packages/google-cloud-dataplex/protos/protos.js index 3acf06da254..682e19a177e 100644 --- a/packages/google-cloud-dataplex/protos/protos.js +++ b/packages/google-cloud-dataplex/protos/protos.js @@ -55431,6 +55431,658 @@ return SessionEvent; })(); + v1.GovernanceEvent = (function() { + + /** + * Properties of a GovernanceEvent. + * @memberof google.cloud.dataplex.v1 + * @interface IGovernanceEvent + * @property {string|null} [message] GovernanceEvent message + * @property {google.cloud.dataplex.v1.GovernanceEvent.EventType|null} [eventType] GovernanceEvent eventType + * @property {google.cloud.dataplex.v1.GovernanceEvent.IEntity|null} [entity] GovernanceEvent entity + */ + + /** + * Constructs a new GovernanceEvent. + * @memberof google.cloud.dataplex.v1 + * @classdesc Represents a GovernanceEvent. + * @implements IGovernanceEvent + * @constructor + * @param {google.cloud.dataplex.v1.IGovernanceEvent=} [properties] Properties to set + */ + function GovernanceEvent(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GovernanceEvent message. + * @member {string} message + * @memberof google.cloud.dataplex.v1.GovernanceEvent + * @instance + */ + GovernanceEvent.prototype.message = ""; + + /** + * GovernanceEvent eventType. + * @member {google.cloud.dataplex.v1.GovernanceEvent.EventType} eventType + * @memberof google.cloud.dataplex.v1.GovernanceEvent + * @instance + */ + GovernanceEvent.prototype.eventType = 0; + + /** + * GovernanceEvent entity. + * @member {google.cloud.dataplex.v1.GovernanceEvent.IEntity|null|undefined} entity + * @memberof google.cloud.dataplex.v1.GovernanceEvent + * @instance + */ + GovernanceEvent.prototype.entity = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GovernanceEvent _entity. + * @member {"entity"|undefined} _entity + * @memberof google.cloud.dataplex.v1.GovernanceEvent + * @instance + */ + Object.defineProperty(GovernanceEvent.prototype, "_entity", { + get: $util.oneOfGetter($oneOfFields = ["entity"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GovernanceEvent instance using the specified properties. + * @function create + * @memberof google.cloud.dataplex.v1.GovernanceEvent + * @static + * @param {google.cloud.dataplex.v1.IGovernanceEvent=} [properties] Properties to set + * @returns {google.cloud.dataplex.v1.GovernanceEvent} GovernanceEvent instance + */ + GovernanceEvent.create = function create(properties) { + return new GovernanceEvent(properties); + }; + + /** + * Encodes the specified GovernanceEvent message. Does not implicitly {@link google.cloud.dataplex.v1.GovernanceEvent.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataplex.v1.GovernanceEvent + * @static + * @param {google.cloud.dataplex.v1.IGovernanceEvent} message GovernanceEvent message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GovernanceEvent.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.message != null && Object.hasOwnProperty.call(message, "message")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.message); + if (message.eventType != null && Object.hasOwnProperty.call(message, "eventType")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.eventType); + if (message.entity != null && Object.hasOwnProperty.call(message, "entity")) + $root.google.cloud.dataplex.v1.GovernanceEvent.Entity.encode(message.entity, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GovernanceEvent message, length delimited. Does not implicitly {@link google.cloud.dataplex.v1.GovernanceEvent.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataplex.v1.GovernanceEvent + * @static + * @param {google.cloud.dataplex.v1.IGovernanceEvent} message GovernanceEvent message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GovernanceEvent.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GovernanceEvent message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dataplex.v1.GovernanceEvent + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataplex.v1.GovernanceEvent} GovernanceEvent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GovernanceEvent.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataplex.v1.GovernanceEvent(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.message = reader.string(); + break; + } + case 2: { + message.eventType = reader.int32(); + break; + } + case 3: { + message.entity = $root.google.cloud.dataplex.v1.GovernanceEvent.Entity.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GovernanceEvent message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dataplex.v1.GovernanceEvent + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataplex.v1.GovernanceEvent} GovernanceEvent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GovernanceEvent.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GovernanceEvent message. + * @function verify + * @memberof google.cloud.dataplex.v1.GovernanceEvent + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GovernanceEvent.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.message != null && message.hasOwnProperty("message")) + if (!$util.isString(message.message)) + return "message: string expected"; + if (message.eventType != null && message.hasOwnProperty("eventType")) + switch (message.eventType) { + default: + return "eventType: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 10: + case 11: + case 12: + case 13: + case 14: + break; + } + if (message.entity != null && message.hasOwnProperty("entity")) { + properties._entity = 1; + { + var error = $root.google.cloud.dataplex.v1.GovernanceEvent.Entity.verify(message.entity); + if (error) + return "entity." + error; + } + } + return null; + }; + + /** + * Creates a GovernanceEvent message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dataplex.v1.GovernanceEvent + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataplex.v1.GovernanceEvent} GovernanceEvent + */ + GovernanceEvent.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataplex.v1.GovernanceEvent) + return object; + var message = new $root.google.cloud.dataplex.v1.GovernanceEvent(); + if (object.message != null) + message.message = String(object.message); + switch (object.eventType) { + default: + if (typeof object.eventType === "number") { + message.eventType = object.eventType; + break; + } + break; + case "EVENT_TYPE_UNSPECIFIED": + case 0: + message.eventType = 0; + break; + case "RESOURCE_IAM_POLICY_UPDATE": + case 1: + message.eventType = 1; + break; + case "BIGQUERY_TABLE_CREATE": + case 2: + message.eventType = 2; + break; + case "BIGQUERY_TABLE_UPDATE": + case 3: + message.eventType = 3; + break; + case "BIGQUERY_TABLE_DELETE": + case 4: + message.eventType = 4; + break; + case "BIGQUERY_CONNECTION_CREATE": + case 5: + message.eventType = 5; + break; + case "BIGQUERY_CONNECTION_UPDATE": + case 6: + message.eventType = 6; + break; + case "BIGQUERY_CONNECTION_DELETE": + case 7: + message.eventType = 7; + break; + case "BIGQUERY_TAXONOMY_CREATE": + case 10: + message.eventType = 10; + break; + case "BIGQUERY_POLICY_TAG_CREATE": + case 11: + message.eventType = 11; + break; + case "BIGQUERY_POLICY_TAG_DELETE": + case 12: + message.eventType = 12; + break; + case "BIGQUERY_POLICY_TAG_SET_IAM_POLICY": + case 13: + message.eventType = 13; + break; + case "ACCESS_POLICY_UPDATE": + case 14: + message.eventType = 14; + break; + } + if (object.entity != null) { + if (typeof object.entity !== "object") + throw TypeError(".google.cloud.dataplex.v1.GovernanceEvent.entity: object expected"); + message.entity = $root.google.cloud.dataplex.v1.GovernanceEvent.Entity.fromObject(object.entity); + } + return message; + }; + + /** + * Creates a plain object from a GovernanceEvent message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataplex.v1.GovernanceEvent + * @static + * @param {google.cloud.dataplex.v1.GovernanceEvent} message GovernanceEvent + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GovernanceEvent.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.message = ""; + object.eventType = options.enums === String ? "EVENT_TYPE_UNSPECIFIED" : 0; + } + if (message.message != null && message.hasOwnProperty("message")) + object.message = message.message; + if (message.eventType != null && message.hasOwnProperty("eventType")) + object.eventType = options.enums === String ? $root.google.cloud.dataplex.v1.GovernanceEvent.EventType[message.eventType] === undefined ? message.eventType : $root.google.cloud.dataplex.v1.GovernanceEvent.EventType[message.eventType] : message.eventType; + if (message.entity != null && message.hasOwnProperty("entity")) { + object.entity = $root.google.cloud.dataplex.v1.GovernanceEvent.Entity.toObject(message.entity, options); + if (options.oneofs) + object._entity = "entity"; + } + return object; + }; + + /** + * Converts this GovernanceEvent to JSON. + * @function toJSON + * @memberof google.cloud.dataplex.v1.GovernanceEvent + * @instance + * @returns {Object.} JSON object + */ + GovernanceEvent.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GovernanceEvent + * @function getTypeUrl + * @memberof google.cloud.dataplex.v1.GovernanceEvent + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GovernanceEvent.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dataplex.v1.GovernanceEvent"; + }; + + GovernanceEvent.Entity = (function() { + + /** + * Properties of an Entity. + * @memberof google.cloud.dataplex.v1.GovernanceEvent + * @interface IEntity + * @property {string|null} [entity] Entity entity + * @property {google.cloud.dataplex.v1.GovernanceEvent.Entity.EntityType|null} [entityType] Entity entityType + */ + + /** + * Constructs a new Entity. + * @memberof google.cloud.dataplex.v1.GovernanceEvent + * @classdesc Represents an Entity. + * @implements IEntity + * @constructor + * @param {google.cloud.dataplex.v1.GovernanceEvent.IEntity=} [properties] Properties to set + */ + function Entity(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Entity entity. + * @member {string} entity + * @memberof google.cloud.dataplex.v1.GovernanceEvent.Entity + * @instance + */ + Entity.prototype.entity = ""; + + /** + * Entity entityType. + * @member {google.cloud.dataplex.v1.GovernanceEvent.Entity.EntityType} entityType + * @memberof google.cloud.dataplex.v1.GovernanceEvent.Entity + * @instance + */ + Entity.prototype.entityType = 0; + + /** + * Creates a new Entity instance using the specified properties. + * @function create + * @memberof google.cloud.dataplex.v1.GovernanceEvent.Entity + * @static + * @param {google.cloud.dataplex.v1.GovernanceEvent.IEntity=} [properties] Properties to set + * @returns {google.cloud.dataplex.v1.GovernanceEvent.Entity} Entity instance + */ + Entity.create = function create(properties) { + return new Entity(properties); + }; + + /** + * Encodes the specified Entity message. Does not implicitly {@link google.cloud.dataplex.v1.GovernanceEvent.Entity.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataplex.v1.GovernanceEvent.Entity + * @static + * @param {google.cloud.dataplex.v1.GovernanceEvent.IEntity} message Entity message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Entity.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.entity != null && Object.hasOwnProperty.call(message, "entity")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.entity); + if (message.entityType != null && Object.hasOwnProperty.call(message, "entityType")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.entityType); + return writer; + }; + + /** + * Encodes the specified Entity message, length delimited. Does not implicitly {@link google.cloud.dataplex.v1.GovernanceEvent.Entity.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataplex.v1.GovernanceEvent.Entity + * @static + * @param {google.cloud.dataplex.v1.GovernanceEvent.IEntity} message Entity message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Entity.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Entity message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dataplex.v1.GovernanceEvent.Entity + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataplex.v1.GovernanceEvent.Entity} Entity + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Entity.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataplex.v1.GovernanceEvent.Entity(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.entity = reader.string(); + break; + } + case 2: { + message.entityType = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Entity message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dataplex.v1.GovernanceEvent.Entity + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataplex.v1.GovernanceEvent.Entity} Entity + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Entity.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Entity message. + * @function verify + * @memberof google.cloud.dataplex.v1.GovernanceEvent.Entity + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Entity.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.entity != null && message.hasOwnProperty("entity")) + if (!$util.isString(message.entity)) + return "entity: string expected"; + if (message.entityType != null && message.hasOwnProperty("entityType")) + switch (message.entityType) { + default: + return "entityType: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates an Entity message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dataplex.v1.GovernanceEvent.Entity + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataplex.v1.GovernanceEvent.Entity} Entity + */ + Entity.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataplex.v1.GovernanceEvent.Entity) + return object; + var message = new $root.google.cloud.dataplex.v1.GovernanceEvent.Entity(); + if (object.entity != null) + message.entity = String(object.entity); + switch (object.entityType) { + default: + if (typeof object.entityType === "number") { + message.entityType = object.entityType; + break; + } + break; + case "ENTITY_TYPE_UNSPECIFIED": + case 0: + message.entityType = 0; + break; + case "TABLE": + case 1: + message.entityType = 1; + break; + case "FILESET": + case 2: + message.entityType = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from an Entity message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataplex.v1.GovernanceEvent.Entity + * @static + * @param {google.cloud.dataplex.v1.GovernanceEvent.Entity} message Entity + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Entity.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.entity = ""; + object.entityType = options.enums === String ? "ENTITY_TYPE_UNSPECIFIED" : 0; + } + if (message.entity != null && message.hasOwnProperty("entity")) + object.entity = message.entity; + if (message.entityType != null && message.hasOwnProperty("entityType")) + object.entityType = options.enums === String ? $root.google.cloud.dataplex.v1.GovernanceEvent.Entity.EntityType[message.entityType] === undefined ? message.entityType : $root.google.cloud.dataplex.v1.GovernanceEvent.Entity.EntityType[message.entityType] : message.entityType; + return object; + }; + + /** + * Converts this Entity to JSON. + * @function toJSON + * @memberof google.cloud.dataplex.v1.GovernanceEvent.Entity + * @instance + * @returns {Object.} JSON object + */ + Entity.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Entity + * @function getTypeUrl + * @memberof google.cloud.dataplex.v1.GovernanceEvent.Entity + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Entity.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dataplex.v1.GovernanceEvent.Entity"; + }; + + /** + * EntityType enum. + * @name google.cloud.dataplex.v1.GovernanceEvent.Entity.EntityType + * @enum {number} + * @property {number} ENTITY_TYPE_UNSPECIFIED=0 ENTITY_TYPE_UNSPECIFIED value + * @property {number} TABLE=1 TABLE value + * @property {number} FILESET=2 FILESET value + */ + Entity.EntityType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ENTITY_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "TABLE"] = 1; + values[valuesById[2] = "FILESET"] = 2; + return values; + })(); + + return Entity; + })(); + + /** + * EventType enum. + * @name google.cloud.dataplex.v1.GovernanceEvent.EventType + * @enum {number} + * @property {number} EVENT_TYPE_UNSPECIFIED=0 EVENT_TYPE_UNSPECIFIED value + * @property {number} RESOURCE_IAM_POLICY_UPDATE=1 RESOURCE_IAM_POLICY_UPDATE value + * @property {number} BIGQUERY_TABLE_CREATE=2 BIGQUERY_TABLE_CREATE value + * @property {number} BIGQUERY_TABLE_UPDATE=3 BIGQUERY_TABLE_UPDATE value + * @property {number} BIGQUERY_TABLE_DELETE=4 BIGQUERY_TABLE_DELETE value + * @property {number} BIGQUERY_CONNECTION_CREATE=5 BIGQUERY_CONNECTION_CREATE value + * @property {number} BIGQUERY_CONNECTION_UPDATE=6 BIGQUERY_CONNECTION_UPDATE value + * @property {number} BIGQUERY_CONNECTION_DELETE=7 BIGQUERY_CONNECTION_DELETE value + * @property {number} BIGQUERY_TAXONOMY_CREATE=10 BIGQUERY_TAXONOMY_CREATE value + * @property {number} BIGQUERY_POLICY_TAG_CREATE=11 BIGQUERY_POLICY_TAG_CREATE value + * @property {number} BIGQUERY_POLICY_TAG_DELETE=12 BIGQUERY_POLICY_TAG_DELETE value + * @property {number} BIGQUERY_POLICY_TAG_SET_IAM_POLICY=13 BIGQUERY_POLICY_TAG_SET_IAM_POLICY value + * @property {number} ACCESS_POLICY_UPDATE=14 ACCESS_POLICY_UPDATE value + */ + GovernanceEvent.EventType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "EVENT_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "RESOURCE_IAM_POLICY_UPDATE"] = 1; + values[valuesById[2] = "BIGQUERY_TABLE_CREATE"] = 2; + values[valuesById[3] = "BIGQUERY_TABLE_UPDATE"] = 3; + values[valuesById[4] = "BIGQUERY_TABLE_DELETE"] = 4; + values[valuesById[5] = "BIGQUERY_CONNECTION_CREATE"] = 5; + values[valuesById[6] = "BIGQUERY_CONNECTION_UPDATE"] = 6; + values[valuesById[7] = "BIGQUERY_CONNECTION_DELETE"] = 7; + values[valuesById[10] = "BIGQUERY_TAXONOMY_CREATE"] = 10; + values[valuesById[11] = "BIGQUERY_POLICY_TAG_CREATE"] = 11; + values[valuesById[12] = "BIGQUERY_POLICY_TAG_DELETE"] = 12; + values[valuesById[13] = "BIGQUERY_POLICY_TAG_SET_IAM_POLICY"] = 13; + values[valuesById[14] = "ACCESS_POLICY_UPDATE"] = 14; + return values; + })(); + + return GovernanceEvent; + })(); + v1.DataScanEvent = (function() { /** diff --git a/packages/google-cloud-dataplex/protos/protos.json b/packages/google-cloud-dataplex/protos/protos.json index a4bfe4c96f8..28a72bcf2b4 100644 --- a/packages/google-cloud-dataplex/protos/protos.json +++ b/packages/google-cloud-dataplex/protos/protos.json @@ -6926,6 +6926,75 @@ } } }, + "GovernanceEvent": { + "oneofs": { + "_entity": { + "oneof": [ + "entity" + ] + } + }, + "fields": { + "message": { + "type": "string", + "id": 1 + }, + "eventType": { + "type": "EventType", + "id": 2 + }, + "entity": { + "type": "Entity", + "id": 3, + "options": { + "proto3_optional": true + } + } + }, + "nested": { + "Entity": { + "fields": { + "entity": { + "type": "string", + "id": 1, + "options": { + "(google.api.resource_reference).type": "dataplex.googleapis.com/Entity" + } + }, + "entityType": { + "type": "EntityType", + "id": 2 + } + }, + "nested": { + "EntityType": { + "values": { + "ENTITY_TYPE_UNSPECIFIED": 0, + "TABLE": 1, + "FILESET": 2 + } + } + } + }, + "EventType": { + "values": { + "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 + } + } + } + }, "DataScanEvent": { "oneofs": { "result": {